@prmichaelsen/task-mcp 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +19 -0
- package/AGENT.md +1165 -0
- package/CHANGELOG.md +72 -0
- package/agent/commands/acp.commit.md +511 -0
- package/agent/commands/acp.init.md +376 -0
- package/agent/commands/acp.package-install.md +347 -0
- package/agent/commands/acp.proceed.md +311 -0
- package/agent/commands/acp.report.md +392 -0
- package/agent/commands/acp.status.md +280 -0
- package/agent/commands/acp.sync.md +323 -0
- package/agent/commands/acp.update.md +301 -0
- package/agent/commands/acp.validate.md +385 -0
- package/agent/commands/acp.version-check-for-updates.md +275 -0
- package/agent/commands/acp.version-check.md +190 -0
- package/agent/commands/acp.version-update.md +288 -0
- package/agent/commands/command.template.md +273 -0
- package/agent/commands/git.commit.md +511 -0
- package/agent/commands/git.init.md +513 -0
- package/agent/design/.gitkeep +0 -0
- package/agent/design/acp-task-execution-requirements.md +555 -0
- package/agent/design/api-dto-design.md +394 -0
- package/agent/design/code-extraction-guide.md +827 -0
- package/agent/design/design.template.md +136 -0
- package/agent/design/requirements.template.md +387 -0
- package/agent/design/rest-api-integration.md +489 -0
- package/agent/design/sdk-export-requirements.md +549 -0
- package/agent/milestones/.gitkeep +0 -0
- package/agent/milestones/milestone-1-{title}.template.md +206 -0
- package/agent/milestones/milestone-2-task-infrastructure.md +232 -0
- package/agent/milestones/milestone-4-autonomous-execution.md +235 -0
- package/agent/patterns/.gitkeep +0 -0
- package/agent/patterns/bootstrap.md +1271 -0
- package/agent/patterns/bootstrap.template.md +1237 -0
- package/agent/patterns/pattern.template.md +364 -0
- package/agent/progress.template.yaml +158 -0
- package/agent/progress.yaml +375 -0
- package/agent/scripts/check-for-updates.sh +88 -0
- package/agent/scripts/install.sh +157 -0
- package/agent/scripts/uninstall.sh +75 -0
- package/agent/scripts/update.sh +139 -0
- package/agent/scripts/version.sh +35 -0
- package/agent/tasks/.gitkeep +0 -0
- package/agent/tasks/task-1-{title}.template.md +225 -0
- package/agent/tasks/task-86-task-data-model-schemas.md +143 -0
- package/agent/tasks/task-87-task-database-service.md +220 -0
- package/agent/tasks/task-88-firebase-client-wrapper.md +139 -0
- package/agent/tasks/task-88-task-execution-engine.md +277 -0
- package/agent/tasks/task-89-mcp-server-implementation.md +197 -0
- package/agent/tasks/task-90-build-configuration.md +146 -0
- package/agent/tasks/task-91-deployment-configuration.md +128 -0
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +191 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +191 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov-report/src/client.ts.html +1030 -0
- package/coverage/lcov-report/src/constant/collections.ts.html +469 -0
- package/coverage/lcov-report/src/constant/index.html +116 -0
- package/coverage/lcov-report/src/dto/index.html +116 -0
- package/coverage/lcov-report/src/dto/transformers.ts.html +568 -0
- package/coverage/lcov-report/src/index.html +146 -0
- package/coverage/lcov-report/src/schemas/index.html +116 -0
- package/coverage/lcov-report/src/schemas/task.ts.html +547 -0
- package/coverage/lcov-report/src/server-factory.ts.html +418 -0
- package/coverage/lcov-report/src/server.ts.html +289 -0
- package/coverage/lcov-report/src/services/index.html +116 -0
- package/coverage/lcov-report/src/services/task-database.service.ts.html +1495 -0
- package/coverage/lcov-report/src/tools/index.html +236 -0
- package/coverage/lcov-report/src/tools/index.ts.html +292 -0
- package/coverage/lcov-report/src/tools/task-add-message.ts.html +277 -0
- package/coverage/lcov-report/src/tools/task-complete-task-item.ts.html +343 -0
- package/coverage/lcov-report/src/tools/task-create-milestone.ts.html +286 -0
- package/coverage/lcov-report/src/tools/task-create-task-item.ts.html +358 -0
- package/coverage/lcov-report/src/tools/task-get-next-step.ts.html +460 -0
- package/coverage/lcov-report/src/tools/task-get-status.ts.html +316 -0
- package/coverage/lcov-report/src/tools/task-report-completion.ts.html +343 -0
- package/coverage/lcov-report/src/tools/task-update-progress.ts.html +232 -0
- package/coverage/lcov.info +974 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +210 -0
- package/coverage/src/client.ts.html +1030 -0
- package/coverage/src/constant/collections.ts.html +469 -0
- package/coverage/src/constant/index.html +116 -0
- package/coverage/src/dto/index.html +116 -0
- package/coverage/src/dto/transformers.ts.html +568 -0
- package/coverage/src/index.html +146 -0
- package/coverage/src/schemas/index.html +116 -0
- package/coverage/src/schemas/task.ts.html +547 -0
- package/coverage/src/server-factory.ts.html +418 -0
- package/coverage/src/server.ts.html +289 -0
- package/coverage/src/services/index.html +116 -0
- package/coverage/src/services/task-database.service.ts.html +1495 -0
- package/coverage/src/tools/index.html +236 -0
- package/coverage/src/tools/index.ts.html +292 -0
- package/coverage/src/tools/task-add-message.ts.html +277 -0
- package/coverage/src/tools/task-complete-task-item.ts.html +343 -0
- package/coverage/src/tools/task-create-milestone.ts.html +286 -0
- package/coverage/src/tools/task-create-task-item.ts.html +358 -0
- package/coverage/src/tools/task-get-next-step.ts.html +460 -0
- package/coverage/src/tools/task-get-status.ts.html +316 -0
- package/coverage/src/tools/task-report-completion.ts.html +343 -0
- package/coverage/src/tools/task-update-progress.ts.html +232 -0
- package/firestore.rules +95 -0
- package/jest.config.js +31 -0
- package/package.json +67 -0
- package/src/client.spec.ts +199 -0
- package/src/client.ts +315 -0
- package/src/constant/collections.ts +128 -0
- package/src/dto/index.ts +47 -0
- package/src/dto/task-api.dto.ts +219 -0
- package/src/dto/transformers.spec.ts +462 -0
- package/src/dto/transformers.ts +161 -0
- package/src/schemas/task.ts +154 -0
- package/src/server-factory.spec.ts +70 -0
- package/src/server-factory.ts +111 -0
- package/src/server.ts +68 -0
- package/src/services/task-database.service.e2e.ts +116 -0
- package/src/services/task-database.service.spec.ts +479 -0
- package/src/services/task-database.service.ts +470 -0
- package/src/test-schemas.ts +161 -0
- package/src/tools/index.ts +69 -0
- package/src/tools/task-add-message.ts +64 -0
- package/src/tools/task-complete-task-item.ts +86 -0
- package/src/tools/task-create-milestone.ts +67 -0
- package/src/tools/task-create-task-item.ts +91 -0
- package/src/tools/task-get-next-step.spec.ts +136 -0
- package/src/tools/task-get-next-step.ts +125 -0
- package/src/tools/task-get-status.spec.ts +213 -0
- package/src/tools/task-get-status.ts +77 -0
- package/src/tools/task-report-completion.ts +86 -0
- package/src/tools/task-update-progress.ts +49 -0
- package/src/tools/tools.spec.ts +194 -0
- package/tsconfig.json +31 -0
package/AGENT.md
ADDED
|
@@ -0,0 +1,1165 @@
|
|
|
1
|
+
# Agent Context Protocol (ACP)
|
|
2
|
+
|
|
3
|
+
**Also Known As**: The Agent Directory Pattern
|
|
4
|
+
**Version**: 1.4.2
|
|
5
|
+
**Created**: 2026-02-11
|
|
6
|
+
**Status**: Production Pattern
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Table of Contents
|
|
11
|
+
|
|
12
|
+
1. [Overview](#overview)
|
|
13
|
+
2. [What is the Agent Pattern?](#what-is-the-agent-pattern)
|
|
14
|
+
3. [Why This Pattern Exists](#why-this-pattern-exists)
|
|
15
|
+
4. [Directory Structure](#directory-structure)
|
|
16
|
+
5. [Core Components](#core-components)
|
|
17
|
+
6. [How to Use the Agent Pattern](#how-to-use-the-agent-pattern)
|
|
18
|
+
7. [Pattern Significance & Impact](#pattern-significance--impact)
|
|
19
|
+
8. [Problems This Pattern Solves](#problems-this-pattern-solves)
|
|
20
|
+
9. [Instructions for Future Agents](#instructions-for-future-agents)
|
|
21
|
+
10. [Real-World Example: remember-mcp](#real-world-example-remember-mcp)
|
|
22
|
+
11. [Best Practices](#best-practices)
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Overview
|
|
27
|
+
|
|
28
|
+
The **Agent Context Protocol (ACP)** is a comprehensive documentation and planning system designed to enable 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.
|
|
29
|
+
|
|
30
|
+
**Core Principle**: *Every decision, pattern, and requirement should be documented in a way that allows a future agent (or human) to understand the project's complete context without needing to reverse-engineer the codebase.*
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## What is ACP?
|
|
35
|
+
|
|
36
|
+
The **Agent Context Protocol (ACP)** is a **documentation-first development methodology** that creates a parallel knowledge base alongside your source code. It consists of:
|
|
37
|
+
|
|
38
|
+
1. **Design Documents** - Architectural decisions, patterns, and technical specifications
|
|
39
|
+
2. **Milestones** - Project phases with clear deliverables and success criteria
|
|
40
|
+
3. **Tasks** - Granular, actionable work items with verification steps
|
|
41
|
+
4. **Patterns** - Reusable architectural and coding patterns
|
|
42
|
+
5. **Progress Tracking** - YAML-based progress monitoring and status updates
|
|
43
|
+
|
|
44
|
+
This pattern enables:
|
|
45
|
+
- **Agent Continuity**: New agents can pick up where previous agents left off
|
|
46
|
+
- **Knowledge Preservation**: Design decisions and rationale are never lost
|
|
47
|
+
- **Systematic Development**: Complex projects are broken into manageable pieces
|
|
48
|
+
- **Quality Assurance**: Clear success criteria and verification steps
|
|
49
|
+
- **Collaboration**: Multiple agents (or humans) can work on the same project
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Why This Pattern Exists
|
|
54
|
+
|
|
55
|
+
### The Problem
|
|
56
|
+
|
|
57
|
+
Traditional software development faces several challenges when working with AI agents:
|
|
58
|
+
|
|
59
|
+
1. **Context Loss**: Agents have no memory between sessions
|
|
60
|
+
2. **Implicit Knowledge**: Design decisions exist only in developers' heads
|
|
61
|
+
3. **Inconsistent Patterns**: No single source of truth for architectural patterns
|
|
62
|
+
4. **Scope Creep**: Projects expand without clear boundaries
|
|
63
|
+
5. **Quality Drift**: Standards erode without explicit documentation
|
|
64
|
+
6. **Onboarding Friction**: New contributors must reverse-engineer intent
|
|
65
|
+
|
|
66
|
+
### The Solution
|
|
67
|
+
|
|
68
|
+
ACP solves these by:
|
|
69
|
+
|
|
70
|
+
- **Externalizing Knowledge**: All decisions documented explicitly
|
|
71
|
+
- **Structured Planning**: Milestones and tasks provide clear roadmap
|
|
72
|
+
- **Pattern Library**: Reusable solutions to common problems
|
|
73
|
+
- **Progress Tracking**: YAML files track what's done and what's next
|
|
74
|
+
- **Self-Documenting**: ACP documents itself
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Directory Structure
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
project-root/
|
|
82
|
+
├── AGENT.md # This file - ACP documentation
|
|
83
|
+
├── agent/ # Agent directory (ACP structure)
|
|
84
|
+
│ ├── commands/ # Command system
|
|
85
|
+
│ │ ├── .gitkeep
|
|
86
|
+
│ │ ├── command.template.md # Command template
|
|
87
|
+
│ │ ├── acp.init.md # @acp-init
|
|
88
|
+
│ │ ├── acp.proceed.md # @acp-proceed
|
|
89
|
+
│ │ ├── acp.status.md # @acp-status
|
|
90
|
+
│ │ └── ... # More commands
|
|
91
|
+
│ │
|
|
92
|
+
│ ├── design/ # Design documents
|
|
93
|
+
│ │ ├── .gitkeep
|
|
94
|
+
│ │ ├── requirements.md # Core requirements
|
|
95
|
+
│ │ ├── {feature}-design.md # Feature specifications
|
|
96
|
+
│ │ ├── {pattern}-pattern.md # Design patterns
|
|
97
|
+
│ │ └── ...
|
|
98
|
+
│ │
|
|
99
|
+
│ ├── milestones/ # Project milestones
|
|
100
|
+
│ │ ├── .gitkeep
|
|
101
|
+
│ │ ├── milestone-1-{name}.md
|
|
102
|
+
│ │ ├── milestone-2-{name}.md
|
|
103
|
+
│ │ └── ...
|
|
104
|
+
│ │
|
|
105
|
+
│ ├── patterns/ # Architectural patterns
|
|
106
|
+
│ │ ├── .gitkeep
|
|
107
|
+
│ │ ├── bootstrap.md # Project setup pattern
|
|
108
|
+
│ │ ├── {pattern-name}.md
|
|
109
|
+
│ │ └── ...
|
|
110
|
+
│ │
|
|
111
|
+
│ ├── tasks/ # Granular tasks
|
|
112
|
+
│ │ ├── .gitkeep
|
|
113
|
+
│ │ ├── task-1-{name}.md
|
|
114
|
+
│ │ ├── task-2-{name}.md
|
|
115
|
+
│ │ └── ...
|
|
116
|
+
│ │
|
|
117
|
+
│ └── progress.yaml # Progress tracking
|
|
118
|
+
│
|
|
119
|
+
└── (project-specific files) # Your project structure
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Core Components
|
|
125
|
+
|
|
126
|
+
### 1. Design Documents (`agent/design/`)
|
|
127
|
+
|
|
128
|
+
**Purpose**: Capture architectural decisions, technical specifications, and design rationale.
|
|
129
|
+
|
|
130
|
+
**Structure**:
|
|
131
|
+
```markdown
|
|
132
|
+
# {Feature/Pattern Name}
|
|
133
|
+
|
|
134
|
+
**Concept**: One-line description
|
|
135
|
+
**Created**: YYYY-MM-DD
|
|
136
|
+
**Status**: Proposal | Design Specification | Implemented
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Overview
|
|
141
|
+
High-level description of what this is and why it exists
|
|
142
|
+
|
|
143
|
+
## Problem Statement
|
|
144
|
+
What problem does this solve?
|
|
145
|
+
|
|
146
|
+
## Solution
|
|
147
|
+
How does this solve the problem?
|
|
148
|
+
|
|
149
|
+
## Implementation
|
|
150
|
+
Technical details, code examples, schemas
|
|
151
|
+
|
|
152
|
+
## Benefits
|
|
153
|
+
Why this approach is better than alternatives
|
|
154
|
+
|
|
155
|
+
## Trade-offs
|
|
156
|
+
What are the downsides or limitations?
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
**Status**: Current status
|
|
161
|
+
**Recommendation**: What should be done
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### 2. Milestones (`agent/milestones/`)
|
|
165
|
+
|
|
166
|
+
**Purpose**: Define project phases with clear deliverables and success criteria.
|
|
167
|
+
|
|
168
|
+
**Structure**:
|
|
169
|
+
```markdown
|
|
170
|
+
# Milestone {N}: {Name}
|
|
171
|
+
|
|
172
|
+
**Goal**: One-line objective
|
|
173
|
+
**Duration**: Estimated time
|
|
174
|
+
**Dependencies**: Previous milestones
|
|
175
|
+
**Status**: Not Started | In Progress | Completed
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Overview
|
|
180
|
+
What this milestone accomplishes
|
|
181
|
+
|
|
182
|
+
## Deliverables
|
|
183
|
+
- Concrete outputs
|
|
184
|
+
- Measurable results
|
|
185
|
+
- Specific artifacts
|
|
186
|
+
|
|
187
|
+
## Success Criteria
|
|
188
|
+
- [ ] Criterion 1
|
|
189
|
+
- [ ] Criterion 2
|
|
190
|
+
- [ ] ...
|
|
191
|
+
|
|
192
|
+
## Key Files to Create
|
|
193
|
+
List of files/directories this milestone produces
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
**Next Milestone**: Link to next phase
|
|
198
|
+
**Blockers**: Current obstacles
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### 3. Tasks (`agent/tasks/`)
|
|
202
|
+
|
|
203
|
+
**Purpose**: Break milestones into actionable, verifiable work items.
|
|
204
|
+
|
|
205
|
+
**Structure**:
|
|
206
|
+
```markdown
|
|
207
|
+
# Task {N}: {Name}
|
|
208
|
+
|
|
209
|
+
**Milestone**: Parent milestone
|
|
210
|
+
**Estimated Time**: Hours/days
|
|
211
|
+
**Dependencies**: Other tasks
|
|
212
|
+
**Status**: Not Started | In Progress | Completed
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Objective
|
|
217
|
+
What this task accomplishes
|
|
218
|
+
|
|
219
|
+
## Steps
|
|
220
|
+
1. Concrete action 1
|
|
221
|
+
2. Concrete action 2
|
|
222
|
+
3. ...
|
|
223
|
+
|
|
224
|
+
## Verification
|
|
225
|
+
- [ ] Verification step 1
|
|
226
|
+
- [ ] Verification step 2
|
|
227
|
+
- [ ] ...
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
**Next Task**: Link to next task
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### 4. Patterns (`agent/patterns/`)
|
|
235
|
+
|
|
236
|
+
**Purpose**: Document reusable architectural and coding patterns.
|
|
237
|
+
|
|
238
|
+
**Structure**:
|
|
239
|
+
```markdown
|
|
240
|
+
# {Pattern Name}
|
|
241
|
+
|
|
242
|
+
## Overview
|
|
243
|
+
What this pattern is and when to use it
|
|
244
|
+
|
|
245
|
+
## Core Principles
|
|
246
|
+
Fundamental concepts
|
|
247
|
+
|
|
248
|
+
## Implementation
|
|
249
|
+
How to implement this pattern
|
|
250
|
+
|
|
251
|
+
## Examples
|
|
252
|
+
Code examples and use cases
|
|
253
|
+
|
|
254
|
+
## Benefits
|
|
255
|
+
Why use this pattern
|
|
256
|
+
|
|
257
|
+
## Anti-Patterns
|
|
258
|
+
What NOT to do
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
**Status**: Current status
|
|
263
|
+
**Recommendation**: When to use this pattern
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### 5. Progress Tracking (`agent/progress.yaml`)
|
|
267
|
+
|
|
268
|
+
**Purpose**: Machine-readable progress tracking and status monitoring.
|
|
269
|
+
|
|
270
|
+
**Structure**:
|
|
271
|
+
```yaml
|
|
272
|
+
project:
|
|
273
|
+
name: project-name
|
|
274
|
+
version: 0.1.0
|
|
275
|
+
started: YYYY-MM-DD
|
|
276
|
+
status: in_progress | completed
|
|
277
|
+
current_milestone: M1
|
|
278
|
+
|
|
279
|
+
milestones:
|
|
280
|
+
- id: M1
|
|
281
|
+
name: Milestone Name
|
|
282
|
+
status: not_started | in_progress | completed
|
|
283
|
+
progress: 0-100%
|
|
284
|
+
started: YYYY-MM-DD
|
|
285
|
+
completed: YYYY-MM-DD | null
|
|
286
|
+
estimated_weeks: N
|
|
287
|
+
tasks_completed: N
|
|
288
|
+
tasks_total: N
|
|
289
|
+
notes: |
|
|
290
|
+
Progress notes
|
|
291
|
+
|
|
292
|
+
tasks:
|
|
293
|
+
milestone_1:
|
|
294
|
+
- id: task-1
|
|
295
|
+
name: Task Name
|
|
296
|
+
status: not_started | in_progress | completed
|
|
297
|
+
file: agent/tasks/task-1-name.md
|
|
298
|
+
estimated_hours: N
|
|
299
|
+
completed_date: YYYY-MM-DD | null
|
|
300
|
+
notes: |
|
|
301
|
+
Task notes
|
|
302
|
+
|
|
303
|
+
documentation:
|
|
304
|
+
design_documents: N
|
|
305
|
+
milestone_documents: N
|
|
306
|
+
pattern_documents: N
|
|
307
|
+
task_documents: N
|
|
308
|
+
|
|
309
|
+
progress:
|
|
310
|
+
planning: 0-100%
|
|
311
|
+
implementation: 0-100%
|
|
312
|
+
overall: 0-100%
|
|
313
|
+
|
|
314
|
+
recent_work:
|
|
315
|
+
- date: YYYY-MM-DD
|
|
316
|
+
description: What was done
|
|
317
|
+
items:
|
|
318
|
+
- ✅ Completed item
|
|
319
|
+
- ⚠️ Warning/note
|
|
320
|
+
- 📋 Pending item
|
|
321
|
+
|
|
322
|
+
next_steps:
|
|
323
|
+
- Next action 1
|
|
324
|
+
- Next action 2
|
|
325
|
+
|
|
326
|
+
notes:
|
|
327
|
+
- Important note 1
|
|
328
|
+
- Important note 2
|
|
329
|
+
|
|
330
|
+
current_blockers:
|
|
331
|
+
- Blocker 1
|
|
332
|
+
- Blocker 2
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
## How to Use the Agent Pattern
|
|
338
|
+
|
|
339
|
+
### For Starting a New Project
|
|
340
|
+
|
|
341
|
+
1. **Create Agent Directory Structure**
|
|
342
|
+
```bash
|
|
343
|
+
mkdir -p agent/{design,milestones,patterns,tasks}
|
|
344
|
+
touch agent/{design,milestones,patterns,tasks}/.gitkeep
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
2. **Write Requirements Document**
|
|
348
|
+
- Create `agent/design/requirements.md`
|
|
349
|
+
- Document core requirements, constraints, and goals
|
|
350
|
+
- Define success criteria
|
|
351
|
+
|
|
352
|
+
3. **Define Milestones**
|
|
353
|
+
- Break project into 5-10 major phases
|
|
354
|
+
- Each milestone should be 1-3 weeks of work
|
|
355
|
+
- Clear deliverables and success criteria
|
|
356
|
+
|
|
357
|
+
4. **Create Initial Tasks**
|
|
358
|
+
- Break first milestone into concrete tasks
|
|
359
|
+
- Each task should be 1-4 hours of work
|
|
360
|
+
- Include verification steps
|
|
361
|
+
|
|
362
|
+
5. **Initialize Progress Tracking**
|
|
363
|
+
- Create `agent/progress.yaml`
|
|
364
|
+
- Set up milestone and task tracking
|
|
365
|
+
- Document initial status
|
|
366
|
+
|
|
367
|
+
6. **Document Patterns**
|
|
368
|
+
- Create `agent/patterns/bootstrap.md` with setup instructions
|
|
369
|
+
- Document architectural decisions as patterns
|
|
370
|
+
- Include code examples
|
|
371
|
+
|
|
372
|
+
### For Continuing an Existing Project
|
|
373
|
+
|
|
374
|
+
1. **Read Progress File**
|
|
375
|
+
- Understand current status
|
|
376
|
+
- Identify current milestone
|
|
377
|
+
- Find next tasks
|
|
378
|
+
|
|
379
|
+
2. **Review Design Documents**
|
|
380
|
+
- Read relevant design docs in `agent/design/`
|
|
381
|
+
- Understand architectural decisions
|
|
382
|
+
- Check for constraints and patterns
|
|
383
|
+
|
|
384
|
+
3. **Check Current Milestone**
|
|
385
|
+
- Read milestone document
|
|
386
|
+
- Review success criteria
|
|
387
|
+
- Understand deliverables
|
|
388
|
+
|
|
389
|
+
4. **Find Next Task**
|
|
390
|
+
- Look at current milestone's tasks
|
|
391
|
+
- Find first incomplete task
|
|
392
|
+
- Read task document
|
|
393
|
+
|
|
394
|
+
5. **Execute Task**
|
|
395
|
+
- Follow task steps
|
|
396
|
+
- Verify completion
|
|
397
|
+
- Update progress.yaml
|
|
398
|
+
|
|
399
|
+
6. **Document Changes**
|
|
400
|
+
- Update progress.yaml
|
|
401
|
+
- Add notes about work completed
|
|
402
|
+
- Document any new patterns or decisions
|
|
403
|
+
|
|
404
|
+
### For Adding New Features
|
|
405
|
+
|
|
406
|
+
1. **Create Design Document**
|
|
407
|
+
- Document in `agent/design/{feature}-design.md`
|
|
408
|
+
- Include problem, solution, implementation
|
|
409
|
+
- Get approval before proceeding
|
|
410
|
+
|
|
411
|
+
2. **Update Milestones**
|
|
412
|
+
- Add new milestone or extend existing
|
|
413
|
+
- Update progress.yaml
|
|
414
|
+
|
|
415
|
+
3. **Create Tasks**
|
|
416
|
+
- Break feature into tasks
|
|
417
|
+
- Add to appropriate milestone
|
|
418
|
+
- Include verification steps
|
|
419
|
+
|
|
420
|
+
4. **Document Patterns**
|
|
421
|
+
- If feature introduces new patterns, document them
|
|
422
|
+
- Update existing patterns if needed
|
|
423
|
+
|
|
424
|
+
---
|
|
425
|
+
|
|
426
|
+
## Pattern Significance & Impact
|
|
427
|
+
|
|
428
|
+
### Significance
|
|
429
|
+
|
|
430
|
+
The Agent Pattern represents a **paradigm shift** in how we approach AI-assisted development:
|
|
431
|
+
|
|
432
|
+
1. **Knowledge as Code**: Documentation is treated with the same rigor as source code
|
|
433
|
+
2. **Agent-First Design**: Projects are designed to be understandable by AI agents
|
|
434
|
+
3. **Explicit Over Implicit**: All knowledge is externalized and documented
|
|
435
|
+
4. **Systematic Development**: Complex projects become manageable through structure
|
|
436
|
+
5. **Quality by Design**: Standards and patterns are enforced through documentation
|
|
437
|
+
|
|
438
|
+
### Impact
|
|
439
|
+
|
|
440
|
+
**On Development Speed**:
|
|
441
|
+
- ✅ 50-70% faster onboarding for new agents
|
|
442
|
+
- ✅ Reduced context-gathering time
|
|
443
|
+
- ✅ Fewer architectural mistakes
|
|
444
|
+
- ✅ Less rework due to clear specifications
|
|
445
|
+
|
|
446
|
+
**On Code Quality**:
|
|
447
|
+
- ✅ Consistent patterns across codebase
|
|
448
|
+
- ✅ Better architectural decisions (documented rationale)
|
|
449
|
+
- ✅ Fewer bugs (clear verification steps)
|
|
450
|
+
- ✅ More maintainable code (patterns documented)
|
|
451
|
+
|
|
452
|
+
**On Project Management**:
|
|
453
|
+
- ✅ Clear progress visibility
|
|
454
|
+
- ✅ Accurate time estimates
|
|
455
|
+
- ✅ Better scope management
|
|
456
|
+
- ✅ Easier to parallelize work
|
|
457
|
+
|
|
458
|
+
**On Team Collaboration**:
|
|
459
|
+
- ✅ Shared understanding of architecture
|
|
460
|
+
- ✅ Consistent coding standards
|
|
461
|
+
- ✅ Better knowledge transfer
|
|
462
|
+
- ✅ Reduced communication overhead
|
|
463
|
+
|
|
464
|
+
---
|
|
465
|
+
|
|
466
|
+
## Problems This Pattern Solves
|
|
467
|
+
|
|
468
|
+
### 1. **Context Loss Between Agent Sessions**
|
|
469
|
+
|
|
470
|
+
**Problem**: Agents have no memory between sessions. Each new session starts from scratch.
|
|
471
|
+
|
|
472
|
+
**Solution**: The agent directory provides complete context:
|
|
473
|
+
- `progress.yaml` shows current status
|
|
474
|
+
- Design docs explain architectural decisions
|
|
475
|
+
- Patterns document coding standards
|
|
476
|
+
- Tasks provide next steps
|
|
477
|
+
|
|
478
|
+
**Example**: An agent can read `progress.yaml`, see that task-3 is next, read the task document, and continue work immediately.
|
|
479
|
+
|
|
480
|
+
### 2. **Implicit Knowledge**
|
|
481
|
+
|
|
482
|
+
**Problem**: Design decisions exist only in developers' heads or scattered across chat logs.
|
|
483
|
+
|
|
484
|
+
**Solution**: All decisions are documented in design documents with rationale:
|
|
485
|
+
- Why this approach was chosen
|
|
486
|
+
- What alternatives were considered
|
|
487
|
+
- What trade-offs were made
|
|
488
|
+
|
|
489
|
+
**Example**: A design document might explain why discriminated unions are better than exceptions for access control, with code examples and trade-off analysis.
|
|
490
|
+
|
|
491
|
+
### 3. **Inconsistent Patterns**
|
|
492
|
+
|
|
493
|
+
**Problem**: Different parts of codebase use different patterns for the same problems.
|
|
494
|
+
|
|
495
|
+
**Solution**: Patterns directory provides single source of truth:
|
|
496
|
+
- Architectural patterns documented
|
|
497
|
+
- Code examples provided
|
|
498
|
+
- Anti-patterns identified
|
|
499
|
+
|
|
500
|
+
**Example**: A pattern document might specify that all data access must go through service layers, with implementation examples and anti-patterns.
|
|
501
|
+
|
|
502
|
+
### 4. **Scope Creep**
|
|
503
|
+
|
|
504
|
+
**Problem**: Projects expand without clear boundaries, leading to never-ending development.
|
|
505
|
+
|
|
506
|
+
**Solution**: Milestones and tasks provide clear scope:
|
|
507
|
+
- Each milestone has specific deliverables
|
|
508
|
+
- Tasks are granular and verifiable
|
|
509
|
+
- Progress is tracked objectively
|
|
510
|
+
|
|
511
|
+
**Example**: Milestone 1 has exactly 7 tasks. When those are done, the milestone is complete.
|
|
512
|
+
|
|
513
|
+
### 5. **Quality Drift**
|
|
514
|
+
|
|
515
|
+
**Problem**: Code quality degrades over time as standards are forgotten or ignored.
|
|
516
|
+
|
|
517
|
+
**Solution**: Patterns and verification steps maintain quality:
|
|
518
|
+
- Every task has verification checklist
|
|
519
|
+
- Patterns document best practices
|
|
520
|
+
- Design docs explain quality requirements
|
|
521
|
+
|
|
522
|
+
**Example**: Each task includes verification steps like "TypeScript compiles without errors" and "All tests pass".
|
|
523
|
+
|
|
524
|
+
### 6. **Onboarding Friction**
|
|
525
|
+
|
|
526
|
+
**Problem**: New contributors (agents or humans) need weeks to understand the project.
|
|
527
|
+
|
|
528
|
+
**Solution**: Self-documenting structure enables rapid onboarding:
|
|
529
|
+
- Start with `progress.yaml` for status
|
|
530
|
+
- Read `requirements.md` for context
|
|
531
|
+
- Review patterns for coding standards
|
|
532
|
+
- Pick up next task and start working
|
|
533
|
+
|
|
534
|
+
**Example**: A new agent can become productive in minutes instead of days.
|
|
535
|
+
|
|
536
|
+
### 7. **Lost Architectural Decisions**
|
|
537
|
+
|
|
538
|
+
**Problem**: "Why did we do it this way?" becomes unanswerable after a few months.
|
|
539
|
+
|
|
540
|
+
**Solution**: Design documents capture rationale:
|
|
541
|
+
- Problem statement
|
|
542
|
+
- Solution approach
|
|
543
|
+
- Benefits and trade-offs
|
|
544
|
+
- Implementation details
|
|
545
|
+
|
|
546
|
+
**Example**: A design document might explain why certain IDs are reused across databases, with rationale for the decision and implementation details.
|
|
547
|
+
|
|
548
|
+
### 8. **Unclear Progress**
|
|
549
|
+
|
|
550
|
+
**Problem**: Hard to know how much work is done and what's remaining.
|
|
551
|
+
|
|
552
|
+
**Solution**: `progress.yaml` provides objective metrics:
|
|
553
|
+
- Percentage complete per milestone
|
|
554
|
+
- Tasks completed vs total
|
|
555
|
+
- Recent work logged
|
|
556
|
+
- Next steps identified
|
|
557
|
+
|
|
558
|
+
**Example**: "Milestone 1: 20% complete (1/7 tasks done)"
|
|
559
|
+
|
|
560
|
+
---
|
|
561
|
+
|
|
562
|
+
## ACP Commands
|
|
563
|
+
|
|
564
|
+
ACP supports a command system for common workflows. Commands are file-based triggers that provide standardized, discoverable interfaces for ACP operations.
|
|
565
|
+
|
|
566
|
+
### What are ACP Commands?
|
|
567
|
+
|
|
568
|
+
Commands are markdown files in [`agent/commands/`](agent/commands/) that contain step-by-step instructions for AI agents. Instead of typing long prompts like "AGENT.md: Initialize", you can reference command files like `@acp.init` to trigger specific workflows.
|
|
569
|
+
|
|
570
|
+
**Benefits**:
|
|
571
|
+
- **Discoverable**: Browse [`agent/commands/`](agent/commands/) to see all available commands
|
|
572
|
+
- **Consistent**: All commands follow the same structure
|
|
573
|
+
- **Extensible**: Create custom commands for your project
|
|
574
|
+
- **Self-Documenting**: Each command file contains complete documentation
|
|
575
|
+
- **Autocomplete-Friendly**: Type `@acp.` to see all ACP commands
|
|
576
|
+
|
|
577
|
+
### Core Commands
|
|
578
|
+
|
|
579
|
+
Core ACP commands use the `acp.` prefix and are available in [`agent/commands/`](agent/commands/):
|
|
580
|
+
|
|
581
|
+
- **[`@acp.init`](agent/commands/acp.init.md)** - Initialize agent context (replaces "AGENT.md: Initialize")
|
|
582
|
+
- **[`@acp.proceed`](agent/commands/acp.proceed.md)** - Continue with next task (replaces "AGENT.md: Proceed")
|
|
583
|
+
- **[`@acp.status`](agent/commands/acp.status.md)** - Display project status
|
|
584
|
+
- **[`@acp.version-check`](agent/commands/acp.version-check.md)** - Show current ACP version
|
|
585
|
+
- **[`@acp.version-check-for-updates`](agent/commands/acp.version-check-for-updates.md)** - Check for ACP updates
|
|
586
|
+
- **[`@acp.version-update`](agent/commands/acp.version-update.md)** - Update ACP to latest version
|
|
587
|
+
|
|
588
|
+
### Command Invocation
|
|
589
|
+
|
|
590
|
+
Commands are invoked using the `@` syntax with dot notation:
|
|
591
|
+
|
|
592
|
+
```
|
|
593
|
+
@acp.init → agent/commands/acp.init.md
|
|
594
|
+
@acp.proceed → agent/commands/acp.proceed.md
|
|
595
|
+
@acp.status → agent/commands/acp.status.md
|
|
596
|
+
@deploy.production → agent/commands/deploy.production.md
|
|
597
|
+
```
|
|
598
|
+
|
|
599
|
+
**Format**: `@{namespace}.{action}` resolves to `agent/commands/{namespace}.{action}.md`
|
|
600
|
+
|
|
601
|
+
### Creating Custom Commands
|
|
602
|
+
|
|
603
|
+
To create custom commands for your project:
|
|
604
|
+
|
|
605
|
+
1. **Choose a namespace** (e.g., `deploy`, `test`, `custom`)
|
|
606
|
+
- ⚠️ The `acp` namespace is reserved for core commands
|
|
607
|
+
- Use descriptive, single-word namespaces
|
|
608
|
+
|
|
609
|
+
2. **Copy the command template**:
|
|
610
|
+
```bash
|
|
611
|
+
cp agent/commands/command.template.md agent/commands/{namespace}.{action}.md
|
|
612
|
+
```
|
|
613
|
+
|
|
614
|
+
3. **Fill in the template sections**:
|
|
615
|
+
- Purpose and description
|
|
616
|
+
- Prerequisites
|
|
617
|
+
- Step-by-step instructions
|
|
618
|
+
- Verification checklist
|
|
619
|
+
- Examples and troubleshooting
|
|
620
|
+
|
|
621
|
+
4. **Invoke your command**: `@{namespace}.{action}`
|
|
622
|
+
|
|
623
|
+
**Example**: Creating a deployment command:
|
|
624
|
+
```bash
|
|
625
|
+
# Create the command file
|
|
626
|
+
cp agent/commands/command.template.md agent/commands/deploy.production.md
|
|
627
|
+
|
|
628
|
+
# Edit the file with your deployment steps
|
|
629
|
+
# ...
|
|
630
|
+
|
|
631
|
+
# Invoke it
|
|
632
|
+
@deploy.production
|
|
633
|
+
```
|
|
634
|
+
|
|
635
|
+
### Command Template
|
|
636
|
+
|
|
637
|
+
See [`agent/commands/command.template.md`](agent/commands/command.template.md) for the complete command template with all sections and examples.
|
|
638
|
+
|
|
639
|
+
### Installing Third-Party Commands
|
|
640
|
+
|
|
641
|
+
Use `@acp.install` to install command packages from git repositories (available in future release).
|
|
642
|
+
|
|
643
|
+
**Security Note**: Third-party commands can instruct agents to modify files and execute scripts. Always review command files before installation.
|
|
644
|
+
|
|
645
|
+
---
|
|
646
|
+
|
|
647
|
+
## Sample Prompts for Using ACP
|
|
648
|
+
|
|
649
|
+
### Initialize Prompt
|
|
650
|
+
|
|
651
|
+
**Trigger**: `AGENT.md: Initialize`
|
|
652
|
+
|
|
653
|
+
Use this prompt when starting work on an ACP-structured project:
|
|
654
|
+
|
|
655
|
+
```markdown
|
|
656
|
+
First, check for ACP updates by running ./agent/scripts/check-for-updates.sh (if it exists). If updates are available, report what changed and ask if I want to update.
|
|
657
|
+
|
|
658
|
+
Then read ALL files in @agent. We are going to understand this project then work on a generic task.
|
|
659
|
+
|
|
660
|
+
Then read KEY src files per your understanding.
|
|
661
|
+
|
|
662
|
+
Then read @agent again, update stale @agent/tasks, stale documentation, and update 'agent/progress.yaml'.
|
|
663
|
+
```
|
|
664
|
+
|
|
665
|
+
**Purpose**:
|
|
666
|
+
- Checks for updates to ACP methodology and documentation
|
|
667
|
+
- Loads complete project context from agent directory
|
|
668
|
+
- Reviews source code to understand current implementation
|
|
669
|
+
- Updates documentation to reflect current state
|
|
670
|
+
- Ensures progress tracking is accurate
|
|
671
|
+
|
|
672
|
+
### Proceed Prompt
|
|
673
|
+
|
|
674
|
+
**Trigger**: `AGENT.md: Proceed`
|
|
675
|
+
|
|
676
|
+
Use this prompt to continue with the next task:
|
|
677
|
+
|
|
678
|
+
```markdown
|
|
679
|
+
Let's proceed with implementing the current or next task. Remember to update @agent/progress.yaml as you progress.
|
|
680
|
+
```
|
|
681
|
+
|
|
682
|
+
**Purpose**:
|
|
683
|
+
- Continues work on current or next task
|
|
684
|
+
- Reminds agent to maintain progress tracking
|
|
685
|
+
- Keeps workflow focused and documented
|
|
686
|
+
|
|
687
|
+
### Update Prompt
|
|
688
|
+
|
|
689
|
+
**Trigger**: `AGENT.md: Update`
|
|
690
|
+
|
|
691
|
+
Updates all ACP files to the latest version:
|
|
692
|
+
|
|
693
|
+
```markdown
|
|
694
|
+
Run ./agent/scripts/update.sh to update all ACP files (AGENT.md, templates, and scripts) to the latest version.
|
|
695
|
+
```
|
|
696
|
+
|
|
697
|
+
**Purpose**:
|
|
698
|
+
- Updates AGENT.md methodology
|
|
699
|
+
- Updates all template files
|
|
700
|
+
- Updates utility scripts
|
|
701
|
+
- Keeps ACP current with latest improvements
|
|
702
|
+
|
|
703
|
+
### Check for Updates Prompt
|
|
704
|
+
|
|
705
|
+
**Trigger**: `AGENT.md: Check for updates`
|
|
706
|
+
|
|
707
|
+
Checks if updates are available without applying them:
|
|
708
|
+
|
|
709
|
+
```markdown
|
|
710
|
+
Run ./agent/scripts/check-for-updates.sh to see if ACP updates are available.
|
|
711
|
+
```
|
|
712
|
+
|
|
713
|
+
**Purpose**:
|
|
714
|
+
- Non-destructive check for updates
|
|
715
|
+
- Shows what changed via CHANGELOG
|
|
716
|
+
- Informs user of available improvements
|
|
717
|
+
|
|
718
|
+
### Uninstall Prompt
|
|
719
|
+
|
|
720
|
+
**Trigger**: `AGENT.md: Uninstall`
|
|
721
|
+
|
|
722
|
+
Removes all ACP files from the project:
|
|
723
|
+
|
|
724
|
+
```markdown
|
|
725
|
+
Run ./agent/scripts/uninstall.sh to remove all ACP files (agent/ directory and AGENT.md) from this project.
|
|
726
|
+
```
|
|
727
|
+
|
|
728
|
+
**Note**: This script requires user confirmation. If the user confirms they want to uninstall, run:
|
|
729
|
+
```bash
|
|
730
|
+
./agent/scripts/uninstall.sh -y
|
|
731
|
+
```
|
|
732
|
+
|
|
733
|
+
**Purpose**:
|
|
734
|
+
- Complete removal of ACP
|
|
735
|
+
- Clean project state
|
|
736
|
+
- Reversible via git
|
|
737
|
+
|
|
738
|
+
---
|
|
739
|
+
|
|
740
|
+
## Instructions for Future Agents
|
|
741
|
+
|
|
742
|
+
### When You First Encounter ACP
|
|
743
|
+
|
|
744
|
+
1. **Read progress.yaml**
|
|
745
|
+
- This tells you where the project is
|
|
746
|
+
- What milestone is current
|
|
747
|
+
- What task is next
|
|
748
|
+
|
|
749
|
+
2. **Read requirements.md**
|
|
750
|
+
- Understand project goals
|
|
751
|
+
- Learn constraints
|
|
752
|
+
- Know success criteria
|
|
753
|
+
|
|
754
|
+
3. **Review current milestone**
|
|
755
|
+
- Understand current phase
|
|
756
|
+
- Know deliverables
|
|
757
|
+
- Check success criteria
|
|
758
|
+
|
|
759
|
+
4. **Read next task**
|
|
760
|
+
- Understand what to do
|
|
761
|
+
- Follow steps
|
|
762
|
+
- Verify completion
|
|
763
|
+
|
|
764
|
+
5. **Check relevant patterns**
|
|
765
|
+
- Learn coding standards
|
|
766
|
+
- Understand architectural patterns
|
|
767
|
+
- Follow best practices
|
|
768
|
+
|
|
769
|
+
### When Working on a Task
|
|
770
|
+
|
|
771
|
+
1. **Read the task document completely**
|
|
772
|
+
- Understand objective
|
|
773
|
+
- Review all steps
|
|
774
|
+
- Note verification criteria
|
|
775
|
+
|
|
776
|
+
2. **Check related design documents**
|
|
777
|
+
- Look for design docs mentioned in task
|
|
778
|
+
- Understand architectural context
|
|
779
|
+
- Follow specified patterns
|
|
780
|
+
|
|
781
|
+
3. **Execute task steps**
|
|
782
|
+
- Follow steps in order
|
|
783
|
+
- Don't skip steps
|
|
784
|
+
- Document any deviations
|
|
785
|
+
|
|
786
|
+
4. **Verify completion**
|
|
787
|
+
- Check all verification items
|
|
788
|
+
- Run tests
|
|
789
|
+
- Ensure quality standards met
|
|
790
|
+
|
|
791
|
+
5. **Update progress.yaml**
|
|
792
|
+
- Mark task as completed
|
|
793
|
+
- Add completion date
|
|
794
|
+
- Update milestone progress
|
|
795
|
+
- Add notes about work done
|
|
796
|
+
|
|
797
|
+
### When Creating New Features
|
|
798
|
+
|
|
799
|
+
1. **Create design document first**
|
|
800
|
+
- Document problem and solution
|
|
801
|
+
- Include implementation details
|
|
802
|
+
- Get approval before coding
|
|
803
|
+
|
|
804
|
+
2. **Update or create milestone**
|
|
805
|
+
- Add to existing milestone if fits
|
|
806
|
+
- Create new milestone if major feature
|
|
807
|
+
- Update progress.yaml
|
|
808
|
+
|
|
809
|
+
3. **Break into tasks**
|
|
810
|
+
- Create task documents
|
|
811
|
+
- Each task 1-4 hours
|
|
812
|
+
- Include verification steps
|
|
813
|
+
|
|
814
|
+
4. **Document patterns**
|
|
815
|
+
- If introducing new patterns, document them
|
|
816
|
+
- Update existing patterns if needed
|
|
817
|
+
- Include code examples
|
|
818
|
+
|
|
819
|
+
5. **Implement and verify**
|
|
820
|
+
- Follow task steps
|
|
821
|
+
- Verify each task
|
|
822
|
+
- Update progress tracking
|
|
823
|
+
|
|
824
|
+
### When You Encounter Problems
|
|
825
|
+
|
|
826
|
+
1. **Check design documents**
|
|
827
|
+
- Look for relevant design decisions
|
|
828
|
+
- Understand constraints
|
|
829
|
+
- Follow established patterns
|
|
830
|
+
|
|
831
|
+
2. **Review patterns**
|
|
832
|
+
- Check if pattern exists for this problem
|
|
833
|
+
- Follow pattern guidelines
|
|
834
|
+
- Don't reinvent solutions
|
|
835
|
+
|
|
836
|
+
3. **Document new solutions**
|
|
837
|
+
- If you solve a new problem, document it
|
|
838
|
+
- Create design document
|
|
839
|
+
- Add to patterns if reusable
|
|
840
|
+
|
|
841
|
+
4. **Update progress.yaml**
|
|
842
|
+
- Add blocker if stuck
|
|
843
|
+
- Document workarounds
|
|
844
|
+
- Note any deviations from plan
|
|
845
|
+
|
|
846
|
+
### Best Practices for Agents
|
|
847
|
+
|
|
848
|
+
1. **Always read before writing**
|
|
849
|
+
- Understand context first
|
|
850
|
+
- Check existing patterns
|
|
851
|
+
- Follow established conventions
|
|
852
|
+
|
|
853
|
+
2. **Document as you go**
|
|
854
|
+
- Update progress.yaml frequently
|
|
855
|
+
- Add notes about decisions
|
|
856
|
+
- Document new patterns
|
|
857
|
+
|
|
858
|
+
3. **Verify everything**
|
|
859
|
+
- Check all verification steps
|
|
860
|
+
- Run tests
|
|
861
|
+
- Ensure quality standards
|
|
862
|
+
|
|
863
|
+
4. **Be explicit**
|
|
864
|
+
- Don't assume future agents will know context
|
|
865
|
+
- Document rationale for decisions
|
|
866
|
+
- Include code examples
|
|
867
|
+
|
|
868
|
+
5. **Keep it organized**
|
|
869
|
+
- Follow directory structure
|
|
870
|
+
- Use consistent naming
|
|
871
|
+
- Link related documents
|
|
872
|
+
|
|
873
|
+
6. **Update progress tracking**
|
|
874
|
+
- Mark tasks complete
|
|
875
|
+
- Update percentages
|
|
876
|
+
- Add recent work notes
|
|
877
|
+
|
|
878
|
+
7. **CRITICAL: Always update CHANGELOG.md for version changes**
|
|
879
|
+
- ❌ **DO NOT** commit version changes without updating CHANGELOG.md
|
|
880
|
+
- ❌ **DO NOT** forget to update version numbers in all project files
|
|
881
|
+
- ✅ **DO** use [`@git.commit`](agent/commands/git.commit.md) for version-aware commits
|
|
882
|
+
- ✅ **DO** detect version impact: major (breaking), minor (features), patch (fixes)
|
|
883
|
+
- ✅ **DO** update CHANGELOG.md with clear, user-focused descriptions
|
|
884
|
+
- ✅ **DO** update all version files (package.json, AGENT.md, etc.)
|
|
885
|
+
- ✅ **DO** use Conventional Commits format for commit messages
|
|
886
|
+
- **Rationale**: CHANGELOG.md is the primary communication tool for users. Every version change must be documented with clear descriptions of what changed, why it changed, and how it affects users. Forgetting to update CHANGELOG.md breaks the project's version history and makes it impossible for users to understand what changed between versions.
|
|
887
|
+
|
|
888
|
+
8. **NEVER handle secrets or sensitive data**
|
|
889
|
+
- ❌ **DO NOT** read `.env` files, `.env.local`, or any environment files
|
|
890
|
+
- ❌ **DO NOT** read files containing API keys, tokens, passwords, or credentials
|
|
891
|
+
- ❌ **DO NOT** include secrets in messages, documentation, or code examples
|
|
892
|
+
- ❌ **DO NOT** read files like `secrets.yaml`, `credentials.json`, or similar
|
|
893
|
+
- ✅ **DO** use placeholder values like `YOUR_API_KEY_HERE` in examples
|
|
894
|
+
- ✅ **DO** document that users need to configure secrets separately
|
|
895
|
+
- ✅ **DO** reference environment variable names without reading their values
|
|
896
|
+
- ✅ **DO** create `.env.example` files with placeholder values only
|
|
897
|
+
- **Rationale**: Secrets must never be exposed in chat logs, documentation, or version control. Agents should treat all credential files as off-limits to prevent accidental exposure.
|
|
898
|
+
|
|
899
|
+
9. **CRITICAL: Respect user's intentional file edits**
|
|
900
|
+
- ❌ **DO NOT** assume missing content needs to be added back
|
|
901
|
+
- ❌ **DO NOT** revert changes without confirming with user
|
|
902
|
+
- ✅ **DO** read files before editing to see current state
|
|
903
|
+
- ✅ **DO** ask user if unexpected changes were intentional
|
|
904
|
+
- ✅ **DO** confirm before reverting user's manual edits
|
|
905
|
+
- **Rationale**: If you read a file and it is missing contents or has changed contents (i.e., it does not contain what you expect), assume or confirm with the user if they made intentional updates that you should not revert. Do not assume "The file is missing <xyz>, I need to add it back". The user may have edited files manually with intention.
|
|
906
|
+
|
|
907
|
+
---
|
|
908
|
+
|
|
909
|
+
## Best Practices
|
|
910
|
+
|
|
911
|
+
### Documentation
|
|
912
|
+
|
|
913
|
+
1. **Write for agents, not humans**
|
|
914
|
+
- Be explicit, not implicit
|
|
915
|
+
- Include code examples
|
|
916
|
+
- Document rationale, not just decisions
|
|
917
|
+
|
|
918
|
+
2. **Keep documents focused**
|
|
919
|
+
- One topic per document
|
|
920
|
+
- Clear structure
|
|
921
|
+
- Scannable headings
|
|
922
|
+
|
|
923
|
+
3. **Link related documents**
|
|
924
|
+
- Reference other docs
|
|
925
|
+
- Create knowledge graph
|
|
926
|
+
- Make navigation easy
|
|
927
|
+
|
|
928
|
+
4. **Update as you go**
|
|
929
|
+
- Don't wait until end
|
|
930
|
+
- Document decisions when made
|
|
931
|
+
- Keep progress.yaml current
|
|
932
|
+
|
|
933
|
+
### Organization
|
|
934
|
+
|
|
935
|
+
1. **Follow naming conventions**
|
|
936
|
+
- `{feature}-design.md` for designs
|
|
937
|
+
- `milestone-{N}-{name}.md` for milestones
|
|
938
|
+
- `task-{N}-{name}.md` for tasks
|
|
939
|
+
- `{pattern-name}.md` for patterns
|
|
940
|
+
|
|
941
|
+
2. **Use consistent structure**
|
|
942
|
+
- Same sections in similar documents
|
|
943
|
+
- Standard YAML format
|
|
944
|
+
- Predictable organization
|
|
945
|
+
|
|
946
|
+
3. **Keep it DRY**
|
|
947
|
+
- Don't duplicate information
|
|
948
|
+
- Link to canonical source
|
|
949
|
+
- Update in one place
|
|
950
|
+
|
|
951
|
+
### Progress Tracking
|
|
952
|
+
|
|
953
|
+
1. **Update frequently**
|
|
954
|
+
- After each task
|
|
955
|
+
- When blockers arise
|
|
956
|
+
- When plans change
|
|
957
|
+
|
|
958
|
+
2. **Be objective**
|
|
959
|
+
- Use measurable metrics
|
|
960
|
+
- Track actual vs estimated
|
|
961
|
+
- Document deviations
|
|
962
|
+
|
|
963
|
+
3. **Look forward and back**
|
|
964
|
+
- Document recent work
|
|
965
|
+
- List next steps
|
|
966
|
+
- Note blockers
|
|
967
|
+
|
|
968
|
+
### Quality
|
|
969
|
+
|
|
970
|
+
1. **Include verification steps**
|
|
971
|
+
- Every task has checklist
|
|
972
|
+
- Objective criteria
|
|
973
|
+
- Automated where possible
|
|
974
|
+
|
|
975
|
+
2. **Document patterns**
|
|
976
|
+
- Capture reusable solutions
|
|
977
|
+
- Include anti-patterns
|
|
978
|
+
- Provide examples
|
|
979
|
+
|
|
980
|
+
3. **Review and refine**
|
|
981
|
+
- Update docs as understanding improves
|
|
982
|
+
- Fix errors immediately
|
|
983
|
+
- Keep docs accurate
|
|
984
|
+
|
|
985
|
+
---
|
|
986
|
+
|
|
987
|
+
## Keeping ACP Updated
|
|
988
|
+
|
|
989
|
+
This repository is actively maintained with improvements to the ACP methodology and documentation. To keep your project's AGENT.md current:
|
|
990
|
+
|
|
991
|
+
```bash
|
|
992
|
+
# Run from your project root (if you have the update script installed)
|
|
993
|
+
./agent/scripts/update.sh
|
|
994
|
+
|
|
995
|
+
# Or download and run directly
|
|
996
|
+
curl -fsSL https://raw.githubusercontent.com/prmichaelsen/agent-context-protocol/mainline/agent/scripts/update.sh | bash
|
|
997
|
+
```
|
|
998
|
+
|
|
999
|
+
The update script will:
|
|
1000
|
+
1. Create a backup of your current AGENT.md
|
|
1001
|
+
2. Download the latest version
|
|
1002
|
+
3. Show you the changes
|
|
1003
|
+
4. Ask for confirmation before applying
|
|
1004
|
+
|
|
1005
|
+
See [CHANGELOG.md](https://github.com/prmichaelsen/agent-context-protocol/blob/main/CHANGELOG.md) for version history and changes.
|
|
1006
|
+
|
|
1007
|
+
---
|
|
1008
|
+
|
|
1009
|
+
## Conclusion
|
|
1010
|
+
|
|
1011
|
+
The Agent Directory Pattern transforms software development from an implicit, memory-dependent process into an explicit, documented system that enables AI agents to work effectively on complex projects.
|
|
1012
|
+
|
|
1013
|
+
**Key Takeaways**:
|
|
1014
|
+
|
|
1015
|
+
1. **Documentation is Infrastructure** - Treat it with the same care as code
|
|
1016
|
+
2. **Explicit Over Implicit** - Document everything that matters
|
|
1017
|
+
3. **Structure Enables Scale** - Organization makes complexity manageable
|
|
1018
|
+
4. **Agents Need Context** - Provide complete, accessible context
|
|
1019
|
+
5. **Progress is Measurable** - Track objectively with YAML
|
|
1020
|
+
6. **Patterns Ensure Quality** - Document and follow best practices
|
|
1021
|
+
7. **Knowledge Persists** - No more lost tribal knowledge
|
|
1022
|
+
|
|
1023
|
+
**When to Use This Pattern**:
|
|
1024
|
+
- ✅ Complex projects (>1 month)
|
|
1025
|
+
- ✅ Multiple contributors (agents or humans)
|
|
1026
|
+
- ✅ Long-term maintenance required
|
|
1027
|
+
- ✅ Quality and consistency critical
|
|
1028
|
+
- ✅ Knowledge preservation important
|
|
1029
|
+
|
|
1030
|
+
**When NOT to Use**:
|
|
1031
|
+
- ❌ Trivial scripts (<100 lines)
|
|
1032
|
+
- ❌ One-off prototypes
|
|
1033
|
+
- ❌ Throwaway code
|
|
1034
|
+
- ❌ Simple, well-understood problems
|
|
1035
|
+
|
|
1036
|
+
---
|
|
1037
|
+
|
|
1038
|
+
## What NOT to Do
|
|
1039
|
+
|
|
1040
|
+
### ❌ CRITICAL: Don't Create Summary Documents
|
|
1041
|
+
|
|
1042
|
+
**NEVER create these files under ANY circumstances:**
|
|
1043
|
+
- `TASK_SUMMARY.md`
|
|
1044
|
+
- `PROJECT_SUMMARY.md`
|
|
1045
|
+
- `MILESTONE_SUMMARY.md`
|
|
1046
|
+
- `PROGRESS_SUMMARY.md`
|
|
1047
|
+
- Any file with `SUMMARY` in the name
|
|
1048
|
+
|
|
1049
|
+
**Why**: All summary information belongs in [`progress.yaml`](agent/progress.yaml). Creating separate summary documents:
|
|
1050
|
+
- Duplicates information
|
|
1051
|
+
- Creates inconsistency
|
|
1052
|
+
- Requires maintaining multiple files
|
|
1053
|
+
- Defeats the purpose of structured progress tracking
|
|
1054
|
+
|
|
1055
|
+
**Instead**: Update [`progress.yaml`](agent/progress.yaml):
|
|
1056
|
+
```yaml
|
|
1057
|
+
recent_work:
|
|
1058
|
+
- date: 2026-02-13
|
|
1059
|
+
description: Summary of work completed
|
|
1060
|
+
items:
|
|
1061
|
+
- ✅ Completed task 1
|
|
1062
|
+
- ✅ Completed task 2
|
|
1063
|
+
```
|
|
1064
|
+
|
|
1065
|
+
### ❌ CRITICAL: Don't Create Variant Task Documents
|
|
1066
|
+
|
|
1067
|
+
**NEVER create these files under ANY circumstances:**
|
|
1068
|
+
- `task-1-simplified.md`
|
|
1069
|
+
- `task-1-revised.md`
|
|
1070
|
+
- `task-1-v2.md`
|
|
1071
|
+
- `task-1-updated.md`
|
|
1072
|
+
- `task-1-alternative.md`
|
|
1073
|
+
|
|
1074
|
+
**Why**: Task documents are living documents that should be updated in place. Creating variants:
|
|
1075
|
+
- Creates confusion about which is current
|
|
1076
|
+
- Scatters information across multiple files
|
|
1077
|
+
- Makes progress tracking impossible
|
|
1078
|
+
- Violates single source of truth principle
|
|
1079
|
+
|
|
1080
|
+
**Instead**: Modify the existing task document directly:
|
|
1081
|
+
```markdown
|
|
1082
|
+
# Task 1: Setup Project
|
|
1083
|
+
|
|
1084
|
+
**Status**: In Progress (Updated 2026-02-13)
|
|
1085
|
+
|
|
1086
|
+
## Steps
|
|
1087
|
+
1. Create directory ✅ (Completed)
|
|
1088
|
+
2. Install dependencies ✅ (Completed)
|
|
1089
|
+
3. Configure build (Updated: Changed from webpack to esbuild)
|
|
1090
|
+
|
|
1091
|
+
## Notes
|
|
1092
|
+
- Originally planned to use webpack
|
|
1093
|
+
- Switched to esbuild for better performance
|
|
1094
|
+
- Updated configuration accordingly
|
|
1095
|
+
```
|
|
1096
|
+
|
|
1097
|
+
### ✅ Correct Approach
|
|
1098
|
+
|
|
1099
|
+
1. **For summaries**: Update [`progress.yaml`](agent/progress.yaml)
|
|
1100
|
+
2. **For task changes**: Modify existing task documents in place
|
|
1101
|
+
3. **For major changes**: Update the task and note the changes in [`progress.yaml`](agent/progress.yaml)
|
|
1102
|
+
4. **For new work**: Create new task documents with new numbers
|
|
1103
|
+
|
|
1104
|
+
---
|
|
1105
|
+
|
|
1106
|
+
## IMPORTANT: CHANGELOG.md Guidelines
|
|
1107
|
+
|
|
1108
|
+
### ❌ CRITICAL: Keep CHANGELOG.md Pure
|
|
1109
|
+
|
|
1110
|
+
**CHANGELOG.md must ONLY contain:**
|
|
1111
|
+
- Version numbers and dates
|
|
1112
|
+
- Added features
|
|
1113
|
+
- Changed functionality
|
|
1114
|
+
- Removed features
|
|
1115
|
+
- Fixed bugs
|
|
1116
|
+
|
|
1117
|
+
**NEVER include in CHANGELOG.md:**
|
|
1118
|
+
- ❌ Future enhancements or roadmap
|
|
1119
|
+
- ❌ How-to instructions or usage guides
|
|
1120
|
+
- ❌ Installation instructions
|
|
1121
|
+
- ❌ Configuration examples
|
|
1122
|
+
- ❌ Detailed documentation
|
|
1123
|
+
|
|
1124
|
+
**Why**: CHANGELOG.md is a historical record of what changed, not a documentation file. Mixing concerns makes it harder to:
|
|
1125
|
+
- Understand version history
|
|
1126
|
+
- Track actual changes
|
|
1127
|
+
- Maintain the changelog
|
|
1128
|
+
- Find relevant information
|
|
1129
|
+
|
|
1130
|
+
**Correct CHANGELOG.md format:**
|
|
1131
|
+
```markdown
|
|
1132
|
+
## [1.0.4] - 2026-02-13
|
|
1133
|
+
|
|
1134
|
+
### Added
|
|
1135
|
+
- New feature X
|
|
1136
|
+
- New feature Y
|
|
1137
|
+
|
|
1138
|
+
### Changed
|
|
1139
|
+
- Modified behavior of Z
|
|
1140
|
+
|
|
1141
|
+
### Removed
|
|
1142
|
+
- Deprecated feature A
|
|
1143
|
+
```
|
|
1144
|
+
|
|
1145
|
+
**Wrong CHANGELOG.md format:**
|
|
1146
|
+
```markdown
|
|
1147
|
+
## [1.0.4] - 2026-02-13
|
|
1148
|
+
|
|
1149
|
+
### Added
|
|
1150
|
+
- New feature X
|
|
1151
|
+
|
|
1152
|
+
### How to Use Feature X
|
|
1153
|
+
[Installation instructions...] # ❌ WRONG - belongs in README
|
|
1154
|
+
|
|
1155
|
+
### Future Enhancements
|
|
1156
|
+
- Plan to add Y # ❌ WRONG - belongs in design docs or issues
|
|
1157
|
+
```
|
|
1158
|
+
|
|
1159
|
+
---
|
|
1160
|
+
|
|
1161
|
+
**The Agent Pattern is not just documentation—it's a development methodology that makes complex software projects tractable for AI agents.**
|
|
1162
|
+
|
|
1163
|
+
---
|
|
1164
|
+
|
|
1165
|
+
*For questions or improvements to this pattern, please contribute to the repository or create an issue.*
|