@@ -609,16 +609,26 @@ acp validate .acp/acp.vars.json
609609
610610### `acp primer`
611611
612- Generate AI bootstrap primers with value-based section selection (RFC-0004).
612+ Generate AI bootstrap primers with tiered content selection (RFC-0015).
613+
614+ **Automatic Tier Selection:**
615+
616+ | Tier | Token Budget | Content |
617+ |------|--------------|---------|
618+ | `micro` | <300 | Essential safety constraints only |
619+ | `minimal` | 300-449 | Core project context |
620+ | `standard` | 450-699 | Balanced context with conventions |
621+ | `full` | ≥700 | Complete project understanding |
613622
614623```bash
615624acp primer [OPTIONS]
616625
617626Core Options:
618- -b, --budget <N> Token budget [default: 200]
627+ -b, --budget <N> Token budget determines tier [default: 200]
619628 --capabilities <caps> Filter by capabilities (shell, mcp, editor)
620629 -f, --format <type> Output format: markdown, compact, json, text [default: markdown]
621630 --json Output as JSON with metadata
631+ --standalone Standalone mode for raw API usage (not needed in IDEs)
622632
623633Selection Options:
624634 -p, --preset <name> Weight preset: safe, efficient, accurate, balanced [default: balanced]
@@ -628,7 +638,7 @@ Selection Options:
628638 --no-dynamic Disable dynamic value modifiers
629639
630640Introspection:
631- --list-sections List all available sections (37 sections)
641+ --list-sections List all available sections
632642 --list-presets List weight presets with dimension weights
633643 --preview Preview selection without rendering
634644 --explain Show selection reasoning
@@ -650,28 +660,28 @@ Configuration:
650660**Examples:**
651661
652662```bash
653- # Standard primer (200 tokens)
654- acp primer
655-
656- # Minimal primer for small context windows
663+ # Micro tier primer (~250 tokens)
657664acp primer -b 100
658665
659- # Full primer with selection reasoning
666+ # Minimal tier primer (~400 tokens)
667+ acp primer -b 350
668+
669+ # Standard tier primer (~600 tokens)
660670acp primer -b 500 --explain
661671
662- # MCP-only primer with safe preset
663- acp primer -b 300 --capabilities mcp --preset safe
672+ # Full tier primer with MCP capability
673+ acp primer -b 800 --capabilities mcp --preset safe
674+
675+ # Standalone mode for raw API usage
676+ acp primer -b 500 --standalone
664677
665678# List available sections
666679acp primer --list-sections
667680
668681# Preview what would be selected
669682acp primer -b 400 --preview
670683
671- # Exclude specific sections
672- acp primer --exclude cli-overview,annotation-syntax
673-
674- # JSON output with metadata
684+ # JSON output with tier metadata
675685acp primer --json
676686```
677687
@@ -685,6 +695,55 @@ Create `.acp/primer.json` to customize:
685695
686696---
687697
698+ ### `acp context`
699+
700+ Get operation-specific context for AI agents (RFC-0015).
701+
702+ ```bash
703+ acp context <OPERATION> [OPTIONS]
704+
705+ Operations:
706+ create <directory> Get context for creating new files
707+ modify <file> Get context for modifying existing files
708+ debug <target> Get context for debugging (file or symbol)
709+ explore [--domain] Get context for exploring the codebase
710+
711+ Options:
712+ --cache <path> Cache file [default: .acp/acp.cache.json]
713+ --json Output as JSON
714+ --verbose Verbose output
715+ ```
716+
717+ **Context Types:**
718+
719+ | Operation | Returns |
720+ |-----------|---------|
721+ | `create` | Naming conventions, import style, similar files |
722+ | `modify` | Constraints, importers (affected files), symbols |
723+ | `debug` | Related files, symbol info, hotpaths |
724+ | `explore` | Project stats, domain overview, key files |
725+
726+ **Examples:**
727+
728+ ```bash
729+ # Get context before creating a new file
730+ acp context create src/auth/
731+
732+ # Get context before modifying a file
733+ acp context modify src/auth/session.ts
734+
735+ # Get debug context for a symbol
736+ acp context debug validateSession
737+
738+ # Explore the codebase structure
739+ acp context explore
740+
741+ # Focus on a specific domain
742+ acp context explore --domain auth
743+ ```
744+
745+ ---
746+
688747## Configuration
689748
690749Create `.acp.config.json` in your project root (or run `acp init`):
@@ -748,10 +807,90 @@ Or install separately from [acp-mcp](https://github.com/acp-protocol/acp-mcp).
748807
749808**Available MCP Tools:**
750809
751- - **acp_query** — Query symbols, files, and domains
752- - **acp_constraints** — Check file constraints before modification
753- - **acp_primer** — Generate context primers
754- - **acp_expand** — Expand variable references
810+ - **acp_get_architecture** — Get project overview with domains, files, symbols
811+ - **acp_get_file_context** — Get detailed context for a specific file
812+ - **acp_get_symbol_context** — Get symbol info with callers and callees
813+ - **acp_get_domain_files** — Get files in a domain
814+ - **acp_check_constraints** — Check file constraints before modification
815+ - **acp_get_hotpaths** — Get frequently-called symbols
816+ - **acp_expand_variable** — Expand ACP variable references
817+ - **acp_generate_primer** — Generate context primers with tier selection
818+ - **acp_context** — Operation-specific context (create, modify, debug, explore)
819+
820+ ---
821+
822+ ## IDE Integration
823+
824+ ACP automatically detects your IDE environment and adapts its behavior accordingly.
825+
826+ **Supported IDEs:**
827+
828+ | IDE | Detection | Notes |
829+ |-----|-----------|-------|
830+ | Cursor | `CURSOR_*` env vars | Uses `.cursorrules` |
831+ | VS Code | `VSCODE_*` env vars | Uses CLAUDE.md with Cline |
832+ | Cline | `CLINE_*` env vars | Extension-provided context |
833+ | JetBrains | `JETBRAINS_IDE` env var | IntelliJ, WebStorm, etc. |
834+ | Zed | `ZED_*` env vars | Built-in AI integration |
835+ | Claude Code | `CLAUDE_CODE` env var | Uses CLAUDE.md |
836+ | Terminal | Default | Raw API usage |
837+
838+ **Bootstrap Files:**
839+
840+ When you run `acp init`, it creates IDE-specific bootstrap files:
841+
842+ ```bash
843+ # Bootstrap for Cursor
844+ .cursorrules
845+
846+ # Bootstrap for Claude Code, Cline
847+ CLAUDE.md
848+
849+ # Both include primers and project context
850+ ```
851+
852+ **Using Primers with IDEs:**
853+
854+ ```bash
855+ # IDE context (auto-detected) - no --standalone needed
856+ acp primer -b 500
857+
858+ # Raw API usage (e.g., direct Anthropic API calls)
859+ acp primer -b 500 --standalone
860+ ```
861+
862+ **Environment Variables:**
863+
864+ | Variable | Purpose |
865+ |----------|---------|
866+ | `ACP_NO_IDE_DETECT=1` | Disable IDE detection |
867+
868+ **Example: Cursor Integration**
869+
870+ ```bash
871+ # 1. Initialize project
872+ acp init
873+
874+ # 2. Add primer to .cursorrules
875+ echo "$(acp primer -b 400)" >> .cursorrules
876+
877+ # 3. Get context before modifications
878+ acp context modify src/auth/session.ts
879+ ```
880+
881+ **Example: Claude Code Integration**
882+
883+ ```bash
884+ # 1. Initialize project
885+ acp init
886+
887+ # 2. Add primer to CLAUDE.md
888+ echo "$(acp primer -b 500)" >> CLAUDE.md
889+
890+ # 3. Use context command for operations
891+ acp context create src/utils/
892+ acp context debug validateSession
893+ ```
755894
756895---
757896
0 commit comments