How to Integrate ACP with Cursor
How-To Guide
Document Type: How-To Guide
Status: OUTLINE — Content to be added
Goal: Set up Cursor IDE to use ACP context
Prerequisites: ACP CLI installed, Cursor IDE installed
Time: 10-15 minutes
The Problem
You want Cursor to understand your codebase's constraints and structure so it generates better, safer code suggestions.
Solution Overview
- Initialize ACP in your project
- Generate the
.cursorrulesfile - Configure Cursor to use ACP context
- Verify the integration
Step 1: Initialize ACP
TODO: Add screenshots
If you haven't already:
cd your-project
acp initStep 2: Add Annotations
Add at least critical annotations:
// @acp:lock frozen - Critical code, DO NOT modify
// @acp:domain auth - Authentication domainSee Annotating Your Codebase for details.
Step 3: Generate Cursor Rules
acp sync --tools cursorThis creates .cursorrules with:
- Frozen file list
- Domain boundaries
- Constraint summaries
- Project structure overview
Customize the Output
# More detailed context
acp sync --tools cursor --budget 1000
# Safety-focused
acp sync --tools cursor --preset safeStep 4: Verify .cursorrules
TODO: Add example content
Check the generated file:
cat .cursorrulesExpected structure:
# Project Context
## Constraints
### Frozen Files (DO NOT MODIFY)
- src/auth/session.ts - Security critical
- src/payments/processor.ts - Payment processing
### Restricted Files (Require Approval)
- src/api/public/*.ts - Public API
## Domains
- auth: Authentication and authorization
- payments: Payment processing
- users: User management
## Architecture
[Domain relationships and layer structure]Step 5: Configure Cursor
TODO: Add screenshots, version-specific instructions
Automatic Detection
Cursor automatically reads .cursorrules from:
- Project root
.cursor/directory
Manual Configuration
If automatic detection doesn't work:
- Open Cursor Settings
- Navigate to AI → Context
- Add
.cursorrulespath
Step 6: Test the Integration
TODO: Add test scenarios
Test 1: Frozen File Respect
- Open a frozen file in Cursor
- Ask: "Refactor this function"
- Expected: Cursor should acknowledge constraint
Test 2: Domain Awareness
- Ask: "Add a new feature to auth"
- Expected: Cursor suggests files in auth domain only
Test 3: Context Inclusion
- Ask: "What are the main domains?"
- Expected: Cursor lists domains from ACP
Keeping Cursor Rules Updated
Manual Update
acp sync --tools cursorAutomatic Update
Use the ACP daemon for real-time updates:
acp daemon startOr use the VS Code extension with auto-sync enabled.
Git Hook (Optional)
# .git/hooks/post-commit
#!/bin/sh
acp index && acp sync --tools cursorAdvanced Configuration
Custom Token Budget
// .acp.sync.json
{
"tools": {
"cursor": {
"enabled": true,
"budget": 750
}
}
}Custom Primer Weights
{
"primer": {
"weights": {
"safety": 2.0,
"structure": 1.0,
"efficiency": 0.5
}
}
}Multiple Cursor Profiles
TODO: Document profile-specific rules
Verification
Check Cursor Is Using Rules
- Open a new Cursor chat
- Ask: "What files are frozen in this project?"
- Cursor should list files from
.cursorrules
Debug Mode
acp sync --tools cursor --verboseShows what's included/excluded and why.
Troubleshooting
Cursor Not Reading Rules
- Verify
.cursorrulesexists in project root - Restart Cursor
- Check Cursor version (rules support added in X.X)
Rules Seem Outdated
- Run
acp sync --tools cursor - Check
acp indexis up to date - Verify git commit matches cache
Context Too Large
- Reduce budget:
--budget 300 - Use
--preset minimal - Exclude non-essential sections
Context Too Small
- Increase budget:
--budget 1000 - Use
--preset detailed - Add specific sections in config
Related
This guide is an outline. Contribute content →