Skip to content

prmichaelsen/agent-context-protocol

Repository files navigation

Agent Context Protocol (ACP)

A documentation-first development methodology that enables AI agents to understand, build, and maintain complex software projects through structured knowledge capture.

Search ACP packages

Claude Code is ACP's preferred coding agent provider, however any provider will work out of the box.


Quick Start

Requirements

  • OS: Linux or macOS
  • Shell: Bash 4+ (bash --version to check)
  • Git: 2.x+

macOS note: The default /bin/bash on macOS is 3.2. Homebrew's bash (/opt/homebrew/bin/bash or /usr/local/bin/bash) is typically 5.x and works out of the box.

Bootstrap a New Project

curl -fsSL https://raw.githubusercontent.com/prmichaelsen/agent-context-protocol/mainline/agent/scripts/acp.install.sh | bash

Update an Existing Project

You can update an existing project via @acp.version-update command or by running the update script directly:

curl -fsSL https://raw.githubusercontent.com/prmichaelsen/agent-context-protocol/mainline/agent/scripts/acp.version-update.sh | bash

Or if you have ACP already installed locally:

./agent/scripts/acp.version-update.sh

What is ACP?

The Agent Context Protocol is a standardized directory structure and documentation pattern that transforms implicit project knowledge into explicit, machine-readable documentation. It provides:

  • Design Documents - Architectural decisions and technical specifications
  • Milestones - Project phases with clear deliverables
  • Tasks - Granular, actionable work items
  • Patterns - Reusable architectural and coding patterns
  • Progress Tracking - YAML-based progress monitoring

This enables AI agents to pick up where previous agents left off, preserving all context and decisions across sessions.


This will create:

  • AGENT.md - Complete ACP methodology documentation
  • agent/ directory with all template files
  • agent/scripts/ directory with update utilities

Usage

Once ACP is installed, use these commands with your AI agent:

Start Working on a Project

Type: @acp.init (or AGENT.md: Initialize)

This will:

  • Check for ACP updates
  • Read all agent documentation
  • Review source code
  • Update stale documentation
  • Prepare to work on tasks

Continue Working

Type: @acp.proceed (or AGENT.md: Proceed)

This will:

  • Continue with current or next task
  • Update progress tracking
  • Maintain documentation

Resume a Previous Session

Type: @acp.resume ⭐ Recommended

This convenient command automatically:

  • Initializes context (@acp.init)
  • Reviews latest session report
  • Continues with next task (@acp.proceed)

Perfect for starting new sessions or returning after breaks.

Check Project Status

Type: @acp.status

This will:

  • Display current milestone and progress
  • Show current task
  • List recent work and next steps

Available Commands

Workflow Commands:

  • @acp.resume ⭐ - Resume work (init + report + proceed)
  • @acp.init - Initialize agent context
  • @acp.proceed - Continue with next task
  • @acp.status - Display project status
  • @acp.sync - Sync documentation with code
  • @acp.validate - Validate ACP structure
  • @acp.report - Generate session report
  • @acp.index - Manage the key file index (list, add, remove, explore, show)

Package Management:

  • @acp.package-install - Install packages (supports --global flag)
  • @acp.package-list - List installed packages (supports --global flag)
  • @acp.package-info - Show package details (supports --global flag)
  • @acp.package-update - Update packages (supports --global flag)
  • @acp.package-remove - Remove packages (supports --global flag)
  • @acp.package-search - Search for packages
  • @acp.package-validate - Validate package structure
  • @acp.package-publish - Publish package
  • @acp.package-create - Create new package

Entity Creation:

  • @acp.command-create - Create command files
  • @acp.pattern-create - Create pattern files
  • @acp.design-create - Create design documents
  • @acp.task-create - Create task files

Version Commands:

  • @acp.version-check - Show current ACP version
  • @acp.version-check-for-updates - Check for updates
  • @acp.version-update - Update ACP to latest version

Project Registry:

  • @acp.project-list - List registered projects
  • @acp.project-set - Switch to a project
  • @acp.project-info - Show project details
  • @acp.project-update - Update project metadata
  • @acp.project-remove - Remove project from registry
  • @acp.projects-sync - Discover unregistered projects

Sessions (Experimental):

  • @acp.sessions - Manage and view active agent sessions across projects

Git Commands:

  • @git.commit - Intelligent version-aware commits
  • @git.init - Initialize git repository

See AGENT.md for complete command documentation and methodology.


Global Package Installation

Install packages globally to ~/.acp/agent/ for package development or global command libraries:

# Install package globally
./agent/scripts/acp.package-install.sh --global https://github.com/user/acp-firebase.git

# Or via command
@acp.package-install --global https://github.com/user/acp-firebase.git

# List global packages
@acp.package-list --global

# Update global packages
@acp.package-update --global firebase

# Remove global packages
@acp.package-remove --global firebase

Global vs Local:

  • Global: Installed to ~/.acp/agent/, available for discovery in any project
  • Local: Installed to ./agent/, only available in current project
  • Precedence: Local packages always override global packages

Use cases for global installation:

  • Package development with full ACP tooling
  • Common utilities used across many projects
  • Building a personal command library
  • Experimenting with packages before local installation

Experimental Features

Install packages with experimental features:

# Install only stable features (default)
@acp.package-install --repo https://github.com/user/acp-firebase.git

# Install including experimental features
@acp.package-install --repo https://github.com/user/acp-firebase.git --experimental

What are experimental features?

  • Bleeding-edge features that may change
  • Require explicit opt-in via --experimental flag
  • Once installed, update normally

See AGENT.md for complete documentation.


Key File Index

ACP includes a weighted key file index (agent/index/) that ensures agents read critical project files before making decisions. Each entry declares a file path, priority weight, and which commands should read it.

# Manage the key file index
@acp.index list              # List all indexed key files
@acp.index add <path>        # Add a file to the index
@acp.index remove <path>     # Remove a file from the index

Packages can ship their own index files (contents.indices in package.yaml), which are automatically installed to agent/index/ and discovered by commands.

See AGENT.md for complete documentation.


Benchmark Suite

ACP includes an automated benchmark system that measures the impact of ACP on AI-driven development. It runs identical tasks with and without ACP, comparing metrics like token usage, code quality, and task completion.

# Run all benchmarks
bash agent/benchmarks/runner/run-benchmark.sh

# Run a specific task
bash agent/benchmarks/runner/run-benchmark.sh --task complex-auth-system

# View HTML reports
bash agent/benchmarks/runner/serve-reports.sh

6 benchmark tasks ranging from simple (hello-world) to complex (order pipeline with event-driven refactor). Each task includes automated verification and LLM-based quality evaluation.

See AGENT.md for complete documentation. On-demand CI via GitHub Actions (workflow_dispatch).


Project Registry

Manage multiple ACP projects with the global project registry at ~/.acp/projects.yaml:

# List all registered projects
@acp.project-list

# Switch to a specific project
@acp.project-set my-project

# View current project details
@acp.project-info

# Update project metadata (tags, status, description)
@acp.project-update --tags "typescript,api" --status in_progress

# Discover unregistered projects in ~/.acp/projects/
@acp.projects-sync

# Remove project from registry (keeps files)
@acp.project-remove old-project

Key Features:

  • Project Discovery: List and filter projects by type, status, or tags
  • Context Switching: Quickly switch between projects
  • Metadata Tracking: Track type, status, tags, and relationships
  • Auto-Registration: Projects auto-register when created via @acp.project-create

See AGENT.md for complete documentation.


Examples

Sample ACP Projects

See these repositories for real-world examples of ACP in action:


Directory Structure

project-root/
├── AGENT.md                        # ACP documentation (this pattern)
├── agent/                          # Agent directory
│   ├── commands/                   # Command system
│   │   ├── .gitkeep
│   │   ├── command.template.md     # Command template
│   │   ├── acp.init.md             # @acp.init
│   │   ├── acp.proceed.md          # @acp.proceed
│   │   ├── acp.status.md           # @acp.status
│   │   └── ...                     # More commands
│   │
│   ├── design/                     # Design documents
│   │   ├── .gitkeep
│   │   ├── design.template.md      # Template for design docs
│   │   └── requirements.md         # Your project requirements
│   │
│   ├── milestones/                 # Project milestones
│   │   ├── .gitkeep
│   │   ├── milestone-1-{title}.template.md
│   │   └── milestone-1-foundation.md
│   │
│   ├── patterns/                   # Architectural patterns
│   │   ├── .gitkeep
│   │   ├── pattern.template.md
│   │   ├── bootstrap.template.md
│   │   └── typescript/             # Language-specific patterns
│   │       └── *.md
│   │
│   ├── tasks/                      # Granular tasks
│   │   ├── .gitkeep
│   │   ├── task-1-{title}.template.md
│   │   └── task-1-setup.md
│   │
│   ├── index/                      # Key file index
│   │   ├── local.main.yaml         # Project's key files
│   │   └── {pkg}.main.yaml         # Package-shipped indices
│   │
│   └── progress.yaml               # Progress tracking
│
└── (your project files)

Template Files

ACP provides template files for each document type:

  • design.template.md - Template for design documents
  • milestone-1-{title}.template.md - Template for milestone documents
  • task-1-{title}.template.md - Template for task documents
  • pattern.template.md - Template for pattern documents
  • bootstrap.template.md - Template for project bootstrap patterns
  • progress.template.yaml - Template for progress tracking

Each template includes:

  • Section headers with descriptions
  • Example content showing proper usage
  • Guidance on what to include
  • Best practices and conventions

Key Principles

  1. Documentation is Infrastructure - Treat it with the same care as code
  2. Explicit Over Implicit - Document everything that matters
  3. Structure Enables Scale - Organization makes complexity manageable
  4. Agents Need Context - Provide complete, accessible context
  5. Progress is Measurable - Track objectively with YAML
  6. Patterns Ensure Quality - Document and follow best practices
  7. Knowledge Persists - No more lost tribal knowledge

When to Use ACP

Use ACP when:

  • Complex projects (>1 month)
  • Multiple contributors (agents or humans)
  • Long-term maintenance required
  • Quality and consistency critical
  • Knowledge preservation important

Don't use ACP for:

  • Trivial scripts (<100 lines)
  • One-off prototypes
  • Throwaway code
  • Simple, well-understood problems

Documentation

For complete documentation, see AGENT.md, which includes:

  • Detailed explanation of each component
  • Step-by-step usage instructions
  • Best practices and conventions
  • Problem-solving patterns
  • Real-world examples

Contributing

Contributions are welcome! Please:

  1. Follow the existing template structure
  2. Document your changes in design documents
  3. Update relevant patterns
  4. Add examples where helpful

License

MIT License - See LICENSE for details


Links


The Agent Context Protocol is not just documentation—it's a development methodology that makes complex software projects tractable for AI agents.

About

The Agent Context Protocol (ACP) is a documentation and planning system that enables AI agents to understand, build, and maintain complex software projects through structured knowledge capture. It transforms implicit project knowledge into explicit, machine-readable documentation that persists across agent sessions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors