@prmichaelsen/reddit-mcp 0.1.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.
Files changed (138) hide show
  1. package/.claude/settings.local.json +23 -0
  2. package/.env.example +13 -0
  3. package/AGENT.md +1772 -0
  4. package/README.md +54 -0
  5. package/agent/commands/acp.clarification-capture.md +386 -0
  6. package/agent/commands/acp.clarification-create.md +432 -0
  7. package/agent/commands/acp.clarifications-research.md +326 -0
  8. package/agent/commands/acp.command-create.md +432 -0
  9. package/agent/commands/acp.design-create.md +286 -0
  10. package/agent/commands/acp.design-reference.md +355 -0
  11. package/agent/commands/acp.index.md +423 -0
  12. package/agent/commands/acp.init.md +546 -0
  13. package/agent/commands/acp.package-create.md +895 -0
  14. package/agent/commands/acp.package-info.md +212 -0
  15. package/agent/commands/acp.package-install.md +539 -0
  16. package/agent/commands/acp.package-list.md +280 -0
  17. package/agent/commands/acp.package-publish.md +541 -0
  18. package/agent/commands/acp.package-remove.md +293 -0
  19. package/agent/commands/acp.package-search.md +307 -0
  20. package/agent/commands/acp.package-update.md +361 -0
  21. package/agent/commands/acp.package-validate.md +540 -0
  22. package/agent/commands/acp.pattern-create.md +386 -0
  23. package/agent/commands/acp.plan.md +577 -0
  24. package/agent/commands/acp.proceed.md +882 -0
  25. package/agent/commands/acp.project-create.md +675 -0
  26. package/agent/commands/acp.project-info.md +312 -0
  27. package/agent/commands/acp.project-list.md +226 -0
  28. package/agent/commands/acp.project-remove.md +379 -0
  29. package/agent/commands/acp.project-set.md +227 -0
  30. package/agent/commands/acp.project-update.md +307 -0
  31. package/agent/commands/acp.projects-restore.md +228 -0
  32. package/agent/commands/acp.projects-sync.md +347 -0
  33. package/agent/commands/acp.report.md +407 -0
  34. package/agent/commands/acp.resume.md +239 -0
  35. package/agent/commands/acp.sessions.md +301 -0
  36. package/agent/commands/acp.status.md +293 -0
  37. package/agent/commands/acp.sync.md +364 -0
  38. package/agent/commands/acp.task-create.md +500 -0
  39. package/agent/commands/acp.update.md +302 -0
  40. package/agent/commands/acp.validate.md +466 -0
  41. package/agent/commands/acp.version-check-for-updates.md +276 -0
  42. package/agent/commands/acp.version-check.md +191 -0
  43. package/agent/commands/acp.version-update.md +289 -0
  44. package/agent/commands/command.template.md +339 -0
  45. package/agent/commands/git.commit.md +526 -0
  46. package/agent/commands/git.init.md +514 -0
  47. package/agent/design/.gitkeep +0 -0
  48. package/agent/design/design.template.md +154 -0
  49. package/agent/design/requirements.md +332 -0
  50. package/agent/design/requirements.template.md +387 -0
  51. package/agent/index/.gitkeep +0 -0
  52. package/agent/index/local.main.template.yaml +37 -0
  53. package/agent/manifest.template.yaml +13 -0
  54. package/agent/manifest.yaml +61 -0
  55. package/agent/milestones/.gitkeep +0 -0
  56. package/agent/milestones/milestone-1-foundation-listings-mvp.md +140 -0
  57. package/agent/milestones/milestone-1-{title}.template.md +206 -0
  58. package/agent/milestones/milestone-2-content-interaction.md +56 -0
  59. package/agent/milestones/milestone-3-users-and-messaging.md +54 -0
  60. package/agent/milestones/milestone-4-subreddits-and-flair.md +56 -0
  61. package/agent/milestones/milestone-5-moderation.md +53 -0
  62. package/agent/milestones/milestone-6-advanced-features-and-polish.md +56 -0
  63. package/agent/package.template.yaml +86 -0
  64. package/agent/patterns/.gitkeep +0 -0
  65. package/agent/patterns/bootstrap.template.md +1237 -0
  66. package/agent/patterns/pattern.template.md +382 -0
  67. package/agent/progress.template.yaml +161 -0
  68. package/agent/progress.yaml +223 -0
  69. package/agent/schemas/package.schema.yaml +276 -0
  70. package/agent/scripts/acp.common.sh +1781 -0
  71. package/agent/scripts/acp.yaml-parser.sh +985 -0
  72. package/agent/tasks/.gitkeep +0 -0
  73. package/agent/tasks/milestone-1-foundation-listings-mvp/task-1-project-scaffolding.md +75 -0
  74. package/agent/tasks/milestone-1-foundation-listings-mvp/task-2-reddit-oauth.md +71 -0
  75. package/agent/tasks/milestone-1-foundation-listings-mvp/task-3-reddit-api-client.md +71 -0
  76. package/agent/tasks/milestone-1-foundation-listings-mvp/task-4-listing-tools.md +65 -0
  77. package/agent/tasks/milestone-1-foundation-listings-mvp/task-5-search-tools.md +43 -0
  78. package/agent/tasks/milestone-1-foundation-listings-mvp/task-6-testing-verification.md +49 -0
  79. package/agent/tasks/milestone-2-content-interaction/task-7-post-tools.md +56 -0
  80. package/agent/tasks/milestone-2-content-interaction/task-8-comment-tools.md +49 -0
  81. package/agent/tasks/milestone-2-content-interaction/task-9-vote-save-report-tools.md +50 -0
  82. package/agent/tasks/milestone-3-users-and-messaging/task-10-account-tools.md +44 -0
  83. package/agent/tasks/milestone-3-users-and-messaging/task-11-user-profile-tools.md +50 -0
  84. package/agent/tasks/milestone-3-users-and-messaging/task-12-private-message-tools.md +50 -0
  85. package/agent/tasks/milestone-4-subreddits-and-flair/task-13-subreddit-tools.md +47 -0
  86. package/agent/tasks/milestone-4-subreddits-and-flair/task-14-flair-tools.md +46 -0
  87. package/agent/tasks/milestone-4-subreddits-and-flair/task-15-http-transport.md +53 -0
  88. package/agent/tasks/milestone-5-moderation/task-16-mod-action-tools.md +48 -0
  89. package/agent/tasks/milestone-5-moderation/task-17-mod-listing-tools.md +47 -0
  90. package/agent/tasks/milestone-5-moderation/task-18-mod-management-tools.md +42 -0
  91. package/agent/tasks/milestone-6-advanced-features-and-polish/task-19-multireddit-tools.md +49 -0
  92. package/agent/tasks/milestone-6-advanced-features-and-polish/task-20-wiki-tools.md +47 -0
  93. package/agent/tasks/milestone-6-advanced-features-and-polish/task-21-documentation-polish.md +65 -0
  94. package/agent/tasks/task-1-{title}.template.md +244 -0
  95. package/dist/auth/oauth.d.ts +15 -0
  96. package/dist/auth/oauth.d.ts.map +1 -0
  97. package/dist/client/reddit.d.ts +28 -0
  98. package/dist/client/reddit.d.ts.map +1 -0
  99. package/dist/factory.d.ts +2 -0
  100. package/dist/factory.d.ts.map +1 -0
  101. package/dist/factory.js +30394 -0
  102. package/dist/factory.js.map +7 -0
  103. package/dist/index.d.ts +2 -0
  104. package/dist/index.d.ts.map +1 -0
  105. package/dist/index.js +31955 -0
  106. package/dist/index.js.map +7 -0
  107. package/dist/server.d.ts +5 -0
  108. package/dist/server.d.ts.map +1 -0
  109. package/dist/server.js +30401 -0
  110. package/dist/server.js.map +7 -0
  111. package/dist/tools/listings.d.ts +4 -0
  112. package/dist/tools/listings.d.ts.map +1 -0
  113. package/dist/tools/search.d.ts +4 -0
  114. package/dist/tools/search.d.ts.map +1 -0
  115. package/dist/transport/http.d.ts +7 -0
  116. package/dist/transport/http.d.ts.map +1 -0
  117. package/dist/types/index.d.ts +78 -0
  118. package/dist/types/index.d.ts.map +1 -0
  119. package/esbuild.build.js +21 -0
  120. package/jest.config.js +18 -0
  121. package/package.json +46 -0
  122. package/src/auth/oauth.ts +200 -0
  123. package/src/client/reddit.ts +245 -0
  124. package/src/factory.ts +5 -0
  125. package/src/index.ts +31 -0
  126. package/src/server.ts +36 -0
  127. package/src/tools/listings.ts +202 -0
  128. package/src/tools/search.ts +85 -0
  129. package/src/transport/http.ts +49 -0
  130. package/src/types/index.ts +83 -0
  131. package/tests/fixtures/reddit-responses.ts +132 -0
  132. package/tests/helpers/mock-client.ts +36 -0
  133. package/tests/unit/auth.test.ts +89 -0
  134. package/tests/unit/client.test.ts +218 -0
  135. package/tests/unit/listings.test.ts +113 -0
  136. package/tests/unit/search.test.ts +59 -0
  137. package/tests/unit/server.test.ts +14 -0
  138. package/tsconfig.json +21 -0
package/AGENT.md ADDED
@@ -0,0 +1,1772 @@
1
+ # Agent Context Protocol (ACP)
2
+
3
+ **Also Known As**: The Agent Directory Pattern
4
+ **Version**: 5.15.1
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. [Key File Index](#key-file-index)
21
+ 10. [Instructions for Future Agents](#instructions-for-future-agents)
22
+ 11. [Best Practices](#best-practices)
23
+ - [Critical Rules](#critical-rules)
24
+ - [Workflow Best Practices](#workflow-best-practices)
25
+ - [Documentation Best Practices](#documentation-best-practices)
26
+ - [Organization Best Practices](#organization-best-practices)
27
+ - [Progress Tracking Best Practices](#progress-tracking-best-practices)
28
+ - [Quality Best Practices](#quality-best-practices)
29
+ 12. [What NOT to Do](#what-not-to-do)
30
+ 13. [Keeping ACP Updated](#keeping-acp-updated)
31
+
32
+ ---
33
+
34
+ ## Overview
35
+
36
+ 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.
37
+
38
+ **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.*
39
+
40
+ ---
41
+
42
+ ## What is ACP?
43
+
44
+ The **Agent Context Protocol (ACP)** is a **documentation-first development methodology** that creates a parallel knowledge base alongside your source code. It consists of:
45
+
46
+ 1. **Design Documents** - Architectural decisions, patterns, and technical specifications
47
+ 2. **Milestones** - Project phases with clear deliverables and success criteria
48
+ 3. **Tasks** - Granular, actionable work items with verification steps
49
+ 4. **Patterns** - Reusable architectural and coding patterns
50
+ 5. **Progress Tracking** - YAML-based progress monitoring and status updates
51
+
52
+ This pattern enables:
53
+ - **Agent Continuity**: New agents can pick up where previous agents left off
54
+ - **Knowledge Preservation**: Design decisions and rationale are never lost
55
+ - **Systematic Development**: Complex projects are broken into manageable pieces
56
+ - **Quality Assurance**: Clear success criteria and verification steps
57
+ - **Collaboration**: Multiple agents (or humans) can work on the same project
58
+
59
+ ---
60
+
61
+ ## Why This Pattern Exists
62
+
63
+ ### The Problem
64
+
65
+ Traditional software development faces several challenges when working with AI agents:
66
+
67
+ 1. **Context Loss**: Agents have no memory between sessions
68
+ 2. **Implicit Knowledge**: Design decisions exist only in developers' heads
69
+ 3. **Inconsistent Patterns**: No single source of truth for architectural patterns
70
+ 4. **Scope Creep**: Projects expand without clear boundaries
71
+ 5. **Quality Drift**: Standards erode without explicit documentation
72
+ 6. **Onboarding Friction**: New contributors must reverse-engineer intent
73
+
74
+ ### The Solution
75
+
76
+ ACP solves these by:
77
+
78
+ - **Externalizing Knowledge**: All decisions documented explicitly
79
+ - **Structured Planning**: Milestones and tasks provide clear roadmap
80
+ - **Pattern Library**: Reusable solutions to common problems
81
+ - **Progress Tracking**: YAML files track what's done and what's next
82
+ - **Self-Documenting**: ACP documents itself
83
+
84
+ ---
85
+
86
+ ## Directory Structure
87
+
88
+ ```
89
+ project-root/
90
+ ├── AGENT.md # This file - ACP documentation
91
+ ├── agent/ # Agent directory (ACP structure)
92
+ │ ├── commands/ # Command system
93
+ │ │ ├── .gitkeep
94
+ │ │ ├── command.template.md # Command template
95
+ │ │ ├── acp.init.md # @acp-init
96
+ │ │ ├── acp.proceed.md # @acp-proceed
97
+ │ │ ├── acp.status.md # @acp-status
98
+ │ │ └── ... # More commands
99
+ │ │
100
+ │ ├── design/ # Design documents
101
+ │ │ ├── .gitkeep
102
+ │ │ ├── requirements.md # Core requirements
103
+ │ │ ├── {feature}-design.md # Feature specifications
104
+ │ │ ├── {pattern}-pattern.md # Design patterns
105
+ │ │ └── ...
106
+ │ │
107
+ │ ├── milestones/ # Project milestones
108
+ │ │ ├── .gitkeep
109
+ │ │ ├── milestone-1-{name}.md
110
+ │ │ ├── milestone-2-{name}.md
111
+ │ │ └── ...
112
+ │ │
113
+ │ ├── patterns/ # Architectural patterns
114
+ │ │ ├── .gitkeep
115
+ │ │ ├── bootstrap.md # Project setup pattern
116
+ │ │ ├── {pattern-name}.md
117
+ │ │ └── ...
118
+ │ │
119
+ │ ├── tasks/ # Granular tasks
120
+ │ │ ├── .gitkeep
121
+ │ │ ├── milestone-{N}-{title}/ # Tasks grouped by milestone (standard)
122
+ │ │ │ ├── task-{M}-{name}.md
123
+ │ │ │ └── ...
124
+ │ │ ├── unassigned/ # Tasks without milestone
125
+ │ │ │ └── task-{M}-{name}.md
126
+ │ │ └── task-{N}-{name}.md # Legacy flat structure (older tasks)
127
+ │ │
128
+ │ ├── files/ # Template source files (in packages)
129
+ │ │ ├── config/ # Config templates
130
+ │ │ └── src/ # Source code templates
131
+ │ │
132
+ │ ├── index/ # Key file index
133
+ │ │ ├── .gitkeep
134
+ │ │ ├── local.main.yaml # Project's own key files
135
+ │ │ ├── local.main.template.yaml# Template with schema docs
136
+ │ │ └── {pkg}.main.yaml # Package-shipped indices
137
+ │ │
138
+ │ └── progress.yaml # Progress tracking
139
+
140
+ └── (project-specific files) # Your project structure
141
+ ```
142
+
143
+ ---
144
+
145
+ ## Core Components
146
+
147
+ ### 1. Design Documents (`agent/design/`)
148
+
149
+ **Purpose**: Capture architectural decisions, technical specifications, and design rationale.
150
+
151
+ **Structure**:
152
+ ```markdown
153
+ # {Feature/Pattern Name}
154
+
155
+ **Concept**: One-line description
156
+ **Created**: YYYY-MM-DD
157
+ **Status**: Proposal | Design Specification | Implemented
158
+
159
+ ---
160
+
161
+ ## Overview
162
+ High-level description of what this is and why it exists
163
+
164
+ ## Problem Statement
165
+ What problem does this solve?
166
+
167
+ ## Solution
168
+ How does this solve the problem?
169
+
170
+ ## Implementation
171
+ Technical details, code examples, schemas
172
+
173
+ ## Benefits
174
+ Why this approach is better than alternatives
175
+
176
+ ## Trade-offs
177
+ What are the downsides or limitations?
178
+
179
+ ---
180
+
181
+ **Status**: Current status
182
+ **Recommendation**: What should be done
183
+ ```
184
+
185
+ ### 2. Milestones (`agent/milestones/`)
186
+
187
+ **Purpose**: Define project phases with clear deliverables and success criteria.
188
+
189
+ **Structure**:
190
+ ```markdown
191
+ # Milestone {N}: {Name}
192
+
193
+ **Goal**: One-line objective
194
+ **Duration**: Estimated time
195
+ **Dependencies**: Previous milestones
196
+ **Status**: Not Started | In Progress | Completed
197
+
198
+ ---
199
+
200
+ ## Overview
201
+ What this milestone accomplishes
202
+
203
+ ## Deliverables
204
+ - Concrete outputs
205
+ - Measurable results
206
+ - Specific artifacts
207
+
208
+ ## Success Criteria
209
+ - [ ] Criterion 1
210
+ - [ ] Criterion 2
211
+ - [ ] ...
212
+
213
+ ## Key Files to Create
214
+ List of files/directories this milestone produces
215
+
216
+ ---
217
+
218
+ **Next Milestone**: Link to next phase
219
+ **Blockers**: Current obstacles
220
+ ```
221
+
222
+ ### 3. Tasks (`agent/tasks/`)
223
+
224
+ **Purpose**: Break milestones into actionable, verifiable work items.
225
+
226
+ **Structure**:
227
+ ```markdown
228
+ # Task {N}: {Name}
229
+
230
+ **Milestone**: Parent milestone
231
+ **Estimated Time**: Hours/days
232
+ **Dependencies**: Other tasks
233
+ **Status**: Not Started | In Progress | Completed
234
+
235
+ ---
236
+
237
+ ## Objective
238
+ What this task accomplishes
239
+
240
+ ## Steps
241
+ 1. Concrete action 1
242
+ 2. Concrete action 2
243
+ 3. ...
244
+
245
+ ## Verification
246
+ - [ ] Verification step 1
247
+ - [ ] Verification step 2
248
+ - [ ] ...
249
+
250
+ ---
251
+
252
+ **Next Task**: Link to next task
253
+ ```
254
+
255
+ ### 4. Patterns (`agent/patterns/`)
256
+
257
+ **Purpose**: Document reusable architectural and coding patterns.
258
+
259
+ **Structure**:
260
+ ```markdown
261
+ # {Pattern Name}
262
+
263
+ ## Overview
264
+ What this pattern is and when to use it
265
+
266
+ ## Core Principles
267
+ Fundamental concepts
268
+
269
+ ## Implementation
270
+ How to implement this pattern
271
+
272
+ ## Examples
273
+ Code examples and use cases
274
+
275
+ ## Benefits
276
+ Why use this pattern
277
+
278
+ ## Anti-Patterns
279
+ What NOT to do
280
+
281
+ ---
282
+
283
+ **Status**: Current status
284
+ **Recommendation**: When to use this pattern
285
+ ```
286
+
287
+ ### 5. Progress Tracking (`agent/progress.yaml`)
288
+
289
+ **Purpose**: Machine-readable progress tracking and status monitoring.
290
+
291
+ **Structure**:
292
+ ```yaml
293
+ project:
294
+ name: project-name
295
+ version: 0.1.0
296
+ started: YYYY-MM-DD
297
+ status: in_progress | completed
298
+ current_milestone: M1
299
+
300
+ milestones:
301
+ - id: M1
302
+ name: Milestone Name
303
+ status: not_started | in_progress | completed
304
+ progress: 0-100%
305
+ started: YYYY-MM-DD
306
+ completed: YYYY-MM-DD | null
307
+ estimated_weeks: N
308
+ tasks_completed: N
309
+ tasks_total: N
310
+ notes: |
311
+ Progress notes
312
+
313
+ tasks:
314
+ milestone_1:
315
+ - id: task-1
316
+ name: Task Name
317
+ status: not_started | in_progress | completed
318
+ file: agent/tasks/milestone-{N}-{title}/task-{M}-name.md
319
+ estimated_hours: N
320
+ actual_hours: null
321
+ completed_date: YYYY-MM-DD | null
322
+ notes: |
323
+ Task notes
324
+
325
+ documentation:
326
+ design_documents: N
327
+ milestone_documents: N
328
+ pattern_documents: N
329
+ task_documents: N
330
+
331
+ progress:
332
+ planning: 0-100%
333
+ implementation: 0-100%
334
+ overall: 0-100%
335
+
336
+ recent_work:
337
+ - date: YYYY-MM-DD
338
+ description: What was done
339
+ items:
340
+ - ✅ Completed item
341
+ - ⚠️ Warning/note
342
+ - 📋 Pending item
343
+
344
+ next_steps:
345
+ - Next action 1
346
+ - Next action 2
347
+
348
+ notes:
349
+ - Important note 1
350
+ - Important note 2
351
+
352
+ current_blockers:
353
+ - Blocker 1
354
+ - Blocker 2
355
+ ```
356
+
357
+ ---
358
+
359
+ ## How to Use the Agent Pattern
360
+
361
+ ### For Starting a New Project
362
+
363
+ 1. **Create Agent Directory Structure**
364
+ ```bash
365
+ mkdir -p agent/{design,milestones,patterns,tasks}
366
+ touch agent/{design,milestones,patterns,tasks}/.gitkeep
367
+ ```
368
+
369
+ 2. **Create Requirements Document**
370
+ - Invoke [`@acp.design-create`](agent/commands/acp.design-create.md) and follow directives defined in that file
371
+ - Specify "requirements" as the design type
372
+
373
+ 3. **Define Milestones**
374
+ - Break project into 5-10 major phases
375
+ - Each milestone should be 1-3 weeks of work
376
+ - Clear deliverables and success criteria
377
+
378
+ 4. **Create Initial Tasks**
379
+ - Invoke [`@acp.task-create`](agent/commands/acp.task-create.md) and follow directives defined in that file
380
+ - Break first milestone into concrete tasks
381
+
382
+ 5. **Initialize Progress Tracking**
383
+ - Create `agent/progress.yaml`
384
+ - Set up milestone and task tracking
385
+ - Document initial status
386
+
387
+ 6. **Document Patterns**
388
+ - Invoke [`@acp.pattern-create`](agent/commands/acp.pattern-create.md) and follow directives defined in that file
389
+ - Document architectural decisions as patterns
390
+
391
+ ### For Continuing an Existing Project
392
+
393
+ 1. **Read Progress File**
394
+ - Understand current status
395
+ - Identify current milestone
396
+ - Find next tasks
397
+
398
+ 2. **Review Design Documents**
399
+ - Read relevant design docs in `agent/design/`
400
+ - Understand architectural decisions
401
+ - Check for constraints and patterns
402
+
403
+ 3. **Check Current Milestone**
404
+ - Read milestone document
405
+ - Review success criteria
406
+ - Understand deliverables
407
+
408
+ 4. **Find Next Task**
409
+ - Look at current milestone's tasks
410
+ - Find first incomplete task
411
+ - Read task document
412
+
413
+ 5. **Execute Task**
414
+ - Follow task steps
415
+ - Verify completion
416
+ - Update progress.yaml
417
+
418
+ 6. **Document Changes**
419
+ - Update progress.yaml
420
+ - Add notes about work completed
421
+ - Document any new patterns or decisions
422
+
423
+ > **See also**: [Best Practices](#best-practices) for detailed guidance on documentation, organization, and quality standards.
424
+
425
+ ---
426
+
427
+ ## Pattern Significance & Impact
428
+
429
+ ### Significance
430
+
431
+ The Agent Pattern represents a **paradigm shift** in how we approach AI-assisted development:
432
+
433
+ 1. **Knowledge as Code**: Documentation is treated with the same rigor as source code
434
+ 2. **Agent-First Design**: Projects are designed to be understandable by AI agents
435
+ 3. **Explicit Over Implicit**: All knowledge is externalized and documented
436
+ 4. **Systematic Development**: Complex projects become manageable through structure
437
+ 5. **Quality by Design**: Standards and patterns are enforced through documentation
438
+
439
+ ### Impact
440
+
441
+ **On Development Speed**:
442
+ - ✅ 50-70% faster onboarding for new agents
443
+ - ✅ Reduced context-gathering time
444
+ - ✅ Fewer architectural mistakes
445
+ - ✅ Less rework due to clear specifications
446
+
447
+ **On Code Quality**:
448
+ - ✅ Consistent patterns across codebase
449
+ - ✅ Better architectural decisions (documented rationale)
450
+ - ✅ Fewer bugs (clear verification steps)
451
+ - ✅ More maintainable code (patterns documented)
452
+
453
+ **On Project Management**:
454
+ - ✅ Clear progress visibility
455
+ - ✅ Accurate time estimates
456
+ - ✅ Better scope management
457
+ - ✅ Easier to parallelize work
458
+
459
+ **On Team Collaboration**:
460
+ - ✅ Shared understanding of architecture
461
+ - ✅ Consistent coding standards
462
+ - ✅ Better knowledge transfer
463
+ - ✅ Reduced communication overhead
464
+
465
+ ---
466
+
467
+ ## Problems This Pattern Solves
468
+
469
+ ### 1. **Context Loss Between Agent Sessions**
470
+
471
+ **Problem**: Agents have no memory between sessions. Each new session starts from scratch.
472
+
473
+ **Solution**: The agent directory provides complete context:
474
+ - `progress.yaml` shows current status
475
+ - Design docs explain architectural decisions
476
+ - Patterns document coding standards
477
+ - Tasks provide next steps
478
+
479
+ **Example**: An agent can read `progress.yaml`, see that task-3 is next, read the task document, and continue work immediately.
480
+
481
+ ### 2. **Implicit Knowledge**
482
+
483
+ **Problem**: Design decisions exist only in developers' heads or scattered across chat logs.
484
+
485
+ **Solution**: All decisions are documented in design documents with rationale:
486
+ - Why this approach was chosen
487
+ - What alternatives were considered
488
+ - What trade-offs were made
489
+
490
+ **Example**: A design document might explain why discriminated unions are better than exceptions for access control, with code examples and trade-off analysis.
491
+
492
+ ### 3. **Inconsistent Patterns**
493
+
494
+ **Problem**: Different parts of codebase use different patterns for the same problems.
495
+
496
+ **Solution**: Patterns directory provides single source of truth:
497
+ - Architectural patterns documented
498
+ - Code examples provided
499
+ - Anti-patterns identified
500
+
501
+ **Example**: A pattern document might specify that all data access must go through service layers, with implementation examples and anti-patterns.
502
+
503
+ ### 4. **Scope Creep**
504
+
505
+ **Problem**: Projects expand without clear boundaries, leading to never-ending development.
506
+
507
+ **Solution**: Milestones and tasks provide clear scope:
508
+ - Each milestone has specific deliverables
509
+ - Tasks are granular and verifiable
510
+ - Progress is tracked objectively
511
+
512
+ **Example**: Milestone 1 has exactly 7 tasks. When those are done, the milestone is complete.
513
+
514
+ ### 5. **Quality Drift**
515
+
516
+ **Problem**: Code quality degrades over time as standards are forgotten or ignored.
517
+
518
+ **Solution**: Patterns and verification steps maintain quality:
519
+ - Every task has verification checklist
520
+ - Patterns document best practices
521
+ - Design docs explain quality requirements
522
+
523
+ **Example**: Each task includes verification steps like "TypeScript compiles without errors" and "All tests pass".
524
+
525
+ ### 6. **Onboarding Friction**
526
+
527
+ **Problem**: New contributors (agents or humans) need weeks to understand the project.
528
+
529
+ **Solution**: Self-documenting structure enables rapid onboarding:
530
+ - Start with `progress.yaml` for status
531
+ - Read `requirements.md` for context
532
+ - Review patterns for coding standards
533
+ - Pick up next task and start working
534
+
535
+ **Example**: A new agent can become productive in minutes instead of days.
536
+
537
+ ### 7. **Lost Architectural Decisions**
538
+
539
+ **Problem**: "Why did we do it this way?" becomes unanswerable after a few months.
540
+
541
+ **Solution**: Design documents capture rationale:
542
+ - Problem statement
543
+ - Solution approach
544
+ - Benefits and trade-offs
545
+ - Implementation details
546
+
547
+ **Example**: A design document might explain why certain IDs are reused across databases, with rationale for the decision and implementation details.
548
+
549
+ ### 8. **Unclear Progress**
550
+
551
+ **Problem**: Hard to know how much work is done and what's remaining.
552
+
553
+ **Solution**: `progress.yaml` provides objective metrics:
554
+ - Percentage complete per milestone
555
+ - Tasks completed vs total
556
+ - Recent work logged
557
+ - Next steps identified
558
+
559
+ **Example**: "Milestone 1: 20% complete (1/7 tasks done)"
560
+
561
+ ---
562
+
563
+ ## ACP Commands
564
+
565
+ ACP supports a command system for common workflows. Commands are file-based triggers that provide standardized, discoverable interfaces for ACP operations.
566
+
567
+ ### What are ACP Commands?
568
+
569
+ 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.
570
+
571
+ **Benefits**:
572
+ - **Discoverable**: Browse [`agent/commands/`](agent/commands/) to see all available commands
573
+ - **Consistent**: All commands follow the same structure
574
+ - **Extensible**: Create custom commands for your project
575
+ - **Self-Documenting**: Each command file contains complete documentation
576
+ - **Autocomplete-Friendly**: Type `@acp.` to see all ACP commands
577
+
578
+ ### Core Commands
579
+
580
+ Core ACP commands use the `acp.` prefix and are available in [`agent/commands/`](agent/commands/):
581
+
582
+ - **[`@acp.init`](agent/commands/acp.init.md)** - Initialize agent context (replaces "AGENT.md: Initialize")
583
+ - **[`@acp.proceed`](agent/commands/acp.proceed.md)** - Continue with next task (replaces "AGENT.md: Proceed")
584
+ - **[`@acp.status`](agent/commands/acp.status.md)** - Display project status
585
+ - **[`@acp.version-check`](agent/commands/acp.version-check.md)** - Show current ACP version
586
+ - **[`@acp.version-check-for-updates`](agent/commands/acp.version-check-for-updates.md)** - Check for ACP updates
587
+ - **[`@acp.version-update`](agent/commands/acp.version-update.md)** - Update ACP to latest version
588
+
589
+ ### Command Invocation
590
+
591
+ Commands are invoked using the `@` syntax with dot notation:
592
+
593
+ ```
594
+ @acp.init → agent/commands/acp.init.md
595
+ @acp.proceed → agent/commands/acp.proceed.md
596
+ @acp.status → agent/commands/acp.status.md
597
+ @deploy.production → agent/commands/deploy.production.md
598
+ ```
599
+
600
+ **Format**: `@{namespace}.{action}` resolves to `agent/commands/{namespace}.{action}.md`
601
+
602
+ ### Creating Custom Commands
603
+
604
+ Invoke [`@acp.command-create`](agent/commands/acp.command-create.md) and follow directives defined in that file.
605
+
606
+ **Note**: The `acp` namespace is reserved for core commands. Use descriptive, single-word namespaces for custom commands (e.g., `local`, `deploy`, `test`, `custom`).
607
+
608
+ ### Installing Third-Party Commands
609
+
610
+ Use `@acp.install` to install command packages from git repositories (available in future release).
611
+
612
+ **Security Note**: Third-party commands can instruct agents to modify files and execute scripts. Always review command files before installation.
613
+
614
+ ## Global Package Discovery
615
+
616
+ ACP supports global package installation to `~/.acp/agent/` for package development and global command libraries.
617
+
618
+ ### For Agents: How to Discover Global Packages
619
+
620
+ When working in any project, you can discover globally installed packages:
621
+
622
+ 1. **Check if global manifest exists**: `~/.acp/agent/manifest.yaml`
623
+ 2. **Read global manifest**: Contains all globally installed packages
624
+ 3. **Navigate to package files**: Files are installed directly into `~/.acp/agent/`
625
+ 4. **Use commands/patterns**: Reference via `@namespace.command` syntax
626
+
627
+ **Automatic Discovery**: The [`@acp.init`](agent/commands/acp.init.md) command automatically reads `~/.acp/agent/manifest.yaml` and reports globally installed packages.
628
+
629
+ ### Namespace Precedence Rules
630
+
631
+ **CRITICAL**: Local packages always take precedence over global packages.
632
+
633
+ **Resolution order**:
634
+ 1. Check local: `./agent/commands/{namespace}.{command}.md`
635
+ 2. If not found, check global: `~/.acp/agent/commands/{namespace}.{command}.md`
636
+ 3. Use first match found
637
+
638
+ **Example**: If both local and global packages define `@firebase.deploy`:
639
+ - ✅ Use `./agent/commands/firebase.deploy.md` (local takes precedence)
640
+ - ❌ Ignore `~/.acp/agent/commands/firebase.deploy.md`
641
+
642
+ ### Global ACP Structure
643
+
644
+ ```
645
+ ~/.acp/
646
+ ├── AGENT.md # ACP methodology documentation
647
+ ├── agent/ # Full ACP installation
648
+ │ ├── commands/ # All commands (core + packages)
649
+ │ │ ├── acp.init.md # Core ACP commands
650
+ │ │ ├── firebase.deploy.md # From @user/acp-firebase package
651
+ │ │ └── git.commit.md # From @user/acp-git package
652
+ │ ├── patterns/ # All patterns (core + packages)
653
+ │ ├── design/ # All designs (core + packages)
654
+ │ ├── scripts/ # All scripts (core + packages)
655
+ │ └── manifest.yaml # Tracks package sources
656
+ └── projects/ # Optional: User projects workspace
657
+ └── my-project/ # Develop projects here
658
+ ```
659
+
660
+ ### When to Use Global Packages
661
+
662
+ **Use global installation** (`--global` flag) for:
663
+ - ✅ Package development (work on packages with full ACP tooling)
664
+ - ✅ Common utilities used across many projects (git helpers, firebase patterns)
665
+ - ✅ Building a personal command library
666
+ - ✅ Experimenting with packages before local installation
667
+
668
+ **Use local installation** (default) for:
669
+ - ✅ Project-specific packages
670
+ - ✅ Packages that are part of project dependencies
671
+ - ✅ When you want version control over package versions
672
+ - ✅ Production projects (local is more explicit and controlled)
673
+
674
+ ### Example: Using Global Packages
675
+
676
+ ```bash
677
+ # Install git helpers globally
678
+ @acp.package-install --global https://github.com/prmichaelsen/acp-git.git
679
+
680
+ # In any project, discover global packages
681
+ @acp.init
682
+ # Output: "Found 2 global packages: acp-core, @prmichaelsen/acp-git"
683
+
684
+ # Use global command
685
+ @git.commit
686
+ # Agent reads: ~/.acp/agent/commands/git.commit.md
687
+ ```
688
+
689
+ ---
690
+
691
+ ## Project Registry System
692
+
693
+ ACP supports a global project registry at `~/.acp/projects.yaml` that tracks all projects in the `~/.acp/projects/` workspace. This enables project discovery, context switching, and metadata management across your entire ACP workspace.
694
+
695
+ ### Key Features
696
+
697
+ - **Project Discovery**: List all registered projects with filtering options
698
+ - **Context Switching**: Quickly switch between projects using `@acp.project-set`
699
+ - **Metadata Tracking**: Track project type, status, tags, and relationships
700
+ - **Automatic Registration**: Projects auto-register when created via `@acp.project-create`
701
+ - **Sync Discovery**: Find and register existing projects with `@acp.projects-sync`
702
+
703
+ ### Commands
704
+
705
+ | Command | Description |
706
+ |---------|-------------|
707
+ | [`@acp.project-list`](agent/commands/acp.project-list.md) | List all registered projects with optional filtering |
708
+ | [`@acp.project-set`](agent/commands/acp.project-set.md) | Switch to a project (set as current) |
709
+ | [`@acp.project-info`](agent/commands/acp.project-info.md) | Show detailed project information |
710
+ | [`@acp.project-update`](agent/commands/acp.project-update.md) | Update project metadata |
711
+ | [`@acp.project-remove`](agent/commands/acp.project-remove.md) | Remove project from registry |
712
+ | [`@acp.projects-sync`](agent/commands/acp.projects-sync.md) | Discover and register existing projects |
713
+
714
+ ### Registry Structure
715
+
716
+ The `~/.acp/projects.yaml` file tracks all registered projects:
717
+
718
+ ```yaml
719
+ projects:
720
+ - name: my-project
721
+ path: /home/user/.acp/projects/my-project
722
+ type: library
723
+ status: in_progress
724
+ registered: 2026-02-23T10:00:00Z
725
+ last_accessed: 2026-02-26T15:30:00Z
726
+ tags:
727
+ - typescript
728
+ - npm
729
+ related_projects: []
730
+ description: My awesome project
731
+
732
+ current_project: my-project
733
+ ```
734
+
735
+ ### Example Workflow
736
+
737
+ ```bash
738
+ # List all projects
739
+ @acp.project-list
740
+
741
+ # Switch to a specific project
742
+ @acp.project-set my-project
743
+
744
+ # View project details
745
+ @acp.project-info
746
+
747
+ # Update project metadata
748
+ @acp.project-update --tags "typescript,api,rest"
749
+
750
+ # Discover unregistered projects
751
+ @acp.projects-sync
752
+
753
+ # Remove a project from registry (keeps files)
754
+ @acp.project-remove old-project
755
+ ```
756
+
757
+ ### For Agents: How to Use the Registry
758
+
759
+ When working in any ACP project, you can:
760
+
761
+ 1. **Check current project**: Read `~/.acp/projects.yaml` and find `current_project`
762
+ 2. **List available projects**: Use `@acp.project-list` to see all projects
763
+ 3. **Switch context**: Use `@acp.project-set <name>` to change projects
764
+ 4. **Get project info**: Use `@acp.project-info` for detailed metadata
765
+
766
+ **Automatic Tracking**: The `@acp.init` command automatically reads the registry and reports the current project context.
767
+
768
+ ---
769
+
770
+ ## Sessions System
771
+
772
+ ACP supports global session tracking via `~/.acp/sessions.yaml` for awareness of concurrent agent work across projects. When multiple `claude` terminals run from a single IDE instance, sessions give each agent visibility into what other agents are doing.
773
+
774
+ This is an advisory-only visibility layer — no locking or coordination. Sessions are registered at `@acp.init` and deregistered at `@acp.report`, with automatic stale cleanup for crashed terminals.
775
+
776
+ ### What sessions.yaml Tracks
777
+
778
+ Each session entry contains: session ID, project name, description, timestamps (started, last_activity), status (active/idle), current milestone and task, PID (for stale detection), terminal, and optional remote URL.
779
+
780
+ ### Commands
781
+
782
+ | Command | Description |
783
+ |---------|-------------|
784
+ | [`@acp.sessions`](agent/commands/acp.sessions.md) | List, clean, deregister, or count sessions |
785
+ | `@acp.sessions list` | Show all active sessions |
786
+ | `@acp.sessions clean` | Remove stale sessions (dead PIDs, timeouts) |
787
+ | `@acp.sessions deregister` | End current session |
788
+
789
+ ### Integration with Other Commands
790
+
791
+ | Command | Integration |
792
+ |---------|-------------|
793
+ | `@acp.init` | Registers session and displays active siblings |
794
+ | `@acp.status` | Shows session count ("Sessions: N active") |
795
+ | `@acp.report` | Deregisters session on completion |
796
+
797
+ All integrations are optional — if `acp.sessions.sh` is missing, commands skip the session step silently.
798
+
799
+ ### Session Lifecycle
800
+
801
+ 1. **Register**: `@acp.init` registers a session with project, PID, timestamps
802
+ 2. **Heartbeat**: Activity updates via `acp.sessions.sh heartbeat`
803
+ 3. **Deregister**: `@acp.report` ends the session, or manual via `@acp.sessions deregister`
804
+ 4. **Stale Cleanup**: Dead PIDs removed immediately; inactive >2h removed; inactive >30m marked idle
805
+
806
+ ---
807
+
808
+ ## Experimental Features
809
+
810
+ ACP supports marking features as "experimental" to enable safe innovation without affecting stable installations.
811
+
812
+ ### What are Experimental Features?
813
+
814
+ Experimental features are:
815
+ - Bleeding-edge features that may change frequently
816
+ - Features under active development
817
+ - Features that may have breaking changes
818
+ - Features requiring explicit opt-in
819
+
820
+ ### Marking Features as Experimental
821
+
822
+ **In package.yaml**:
823
+ ```yaml
824
+ contents:
825
+ commands:
826
+ - name: stable-command.md
827
+ description: A stable command
828
+
829
+ - name: experimental-command.md
830
+ description: An experimental command
831
+ experimental: true # ← Mark as experimental
832
+ ```
833
+
834
+ **In file metadata**:
835
+ ```markdown
836
+ # Command: experimental-command
837
+
838
+ **Namespace**: mypackage
839
+ **Version**: 0.1.0
840
+ **Status**: Experimental # ← Mark as experimental
841
+ ```
842
+
843
+ ### Installing Experimental Features
844
+
845
+ ```bash
846
+ # Install only stable features (default)
847
+ @acp.package-install --repo https://github.com/user/package.git
848
+
849
+ # Install all features including experimental
850
+ @acp.package-install --repo https://github.com/user/package.git --experimental
851
+ ```
852
+
853
+ ### Updating Experimental Features
854
+
855
+ Once installed, experimental features update normally:
856
+ ```bash
857
+ @acp.package-update package-name # Updates experimental features if already installed
858
+ ```
859
+
860
+ ### Graduating Features
861
+
862
+ To graduate a feature from experimental to stable:
863
+ 1. Remove `experimental: true` from package.yaml
864
+ 2. Change `**Status**: Experimental` to `**Status**: Active` in file
865
+ 3. Bump version to 1.0.0 (semantic versioning)
866
+ 4. Update CHANGELOG.md noting the graduation
867
+
868
+ ### Validation
869
+
870
+ Validation ensures consistency:
871
+ ```bash
872
+ @acp.package-validate # Checks experimental marking is synchronized
873
+ ```
874
+
875
+ ### Best Practices
876
+
877
+ 1. **Use sparingly** - Only mark truly experimental features
878
+ 2. **Document risks** - Explain what might change in file documentation
879
+ 3. **Graduate promptly** - Move to stable once proven
880
+ 4. **Version appropriately** - Use 0.x.x versions for experimental
881
+ 5. **Communicate clearly** - Note experimental status in README.md
882
+
883
+ ---
884
+
885
+ ## Benchmark Suite
886
+
887
+ ACP includes an automated E2E benchmark system that compares project outcomes with and without ACP to generate quantitative success metrics.
888
+
889
+ ### Quick Start
890
+
891
+ ```bash
892
+ # Run all benchmarks (ACP vs baseline)
893
+ bash agent/benchmarks/runner/run-benchmark.sh
894
+
895
+ # Run a specific task
896
+ bash agent/benchmarks/runner/run-benchmark.sh --task complex-auth-system
897
+
898
+ # Run ACP mode only, 3 runs for statistical averaging
899
+ bash agent/benchmarks/runner/run-benchmark.sh --task medium-rest-api --acp-only --runs 3
900
+
901
+ # Serve HTML reports
902
+ bash agent/benchmarks/runner/serve-reports.sh
903
+ ```
904
+
905
+ ### Benchmark Tasks
906
+
907
+ | Task | Complexity | Steps | Description |
908
+ |------|-----------|-------|-------------|
909
+ | hello-world | simple | 1 | Basic script creation |
910
+ | simple-cli-tool | medium | 3 | CSV-to-JSON CLI tool |
911
+ | medium-rest-api | medium | 4 | Express CRUD API with refactoring |
912
+ | complex-auth-system | complex | 5 | JWT authentication system |
913
+ | legacy-refactor | complex | 6 | Refactor messy legacy app (seed-based) |
914
+ | order-pipeline | complex | 7 | Order system with event-driven pivot |
915
+
916
+ ### How It Works
917
+
918
+ 1. Each task runs in an isolated temp directory using `claude -p` (non-interactive mode)
919
+ 2. Multi-turn conversations use `--resume` for step-by-step execution
920
+ 3. ACP mode installs ACP and injects `@acp.plan` / `@acp.proceed` directives
921
+ 4. After execution: automated verification checks + LLM evaluator (6-category rubric)
922
+ 5. Reports generated in Markdown and HTML (with Chart.js radar charts)
923
+
924
+ ### Key Files
925
+
926
+ - `agent/benchmarks/runner/run-benchmark.sh` — Main entry point
927
+ - `agent/benchmarks/runner/run-single.sh` — Single task/mode runner
928
+ - `agent/benchmarks/runner/verify.sh` — Verification functions per task
929
+ - `agent/benchmarks/runner/evaluator-prompt.md` — LLM evaluator rubric
930
+ - `agent/benchmarks/suite/` — Benchmark task definitions
931
+ - `agent/benchmarks/reports/` — Generated reports (gitignored)
932
+ - `.github/workflows/benchmark.yaml` — On-demand CI workflow
933
+
934
+ ### Design Document
935
+
936
+ See [agent/design/local.benchmark-suite.md](agent/design/local.benchmark-suite.md) for the full design specification.
937
+
938
+ ---
939
+
940
+ ## Template Source Files
941
+
942
+ ACP packages can bundle template source files (code, configs, etc.) alongside patterns, commands, and designs. Templates are declared in the `contents.files` section of `package.yaml` and stored in the `agent/files/` directory of the package.
943
+
944
+ ### Templates vs Other Content Types
945
+
946
+ | Type | Location | Purpose |
947
+ |------|----------|---------|
948
+ | Patterns | `agent/patterns/` | Documentation and guidance |
949
+ | Commands | `agent/commands/` | Agent directives |
950
+ | Designs | `agent/design/` | Architecture documentation |
951
+ | Scripts | `agent/scripts/` | Shell utilities |
952
+ | **Files** | **Project root (target paths)** | **Actual code and config files** |
953
+
954
+ ### Installing Template Files
955
+
956
+ ```bash
957
+ # Install all files (templates install to target paths)
958
+ @acp.package-install --repo <url>
959
+
960
+ # Install specific template files only
961
+ @acp.package-install --files config/tsconfig.json src/schemas/example.schema.ts --repo <url>
962
+
963
+ # Preview what would be installed
964
+ @acp.package-install --list --repo <url>
965
+ ```
966
+
967
+ ### Variable Substitution
968
+
969
+ Templates with `.template` extension can contain `{{VARIABLE}}` placeholders that are replaced during installation:
970
+
971
+ ```json
972
+ {
973
+ "name": "{{PACKAGE_NAME}}",
974
+ "author": "{{AUTHOR_NAME}}"
975
+ }
976
+ ```
977
+
978
+ Variables are declared in `package.yaml` and values are prompted during installation. Variable values are stored in the manifest for reproducible updates.
979
+
980
+ ### Target Paths
981
+
982
+ Each file declares a `target` path in `package.yaml`:
983
+ - `target: ./` installs to project root
984
+ - `target: src/schemas/` installs to `src/schemas/` directory
985
+ - `.template` extension is stripped (e.g., `settings.json.template` becomes `settings.json`)
986
+ - Unsafe paths (`../`, absolute paths) are rejected
987
+
988
+ ### Security Considerations
989
+
990
+ Templates install to project directories (not `agent/`):
991
+ - May overwrite existing files
992
+ - Always prompted before installation (unless `-y` flag)
993
+ - Target paths validated for safety
994
+ - Conflict detection warns about overwrites
995
+ - Use `--list` to preview before installing
996
+
997
+ ### Package.yaml Declaration
998
+
999
+ ```yaml
1000
+ contents:
1001
+ files:
1002
+ - name: config/tsconfig.json
1003
+ description: TypeScript configuration
1004
+ target: ./
1005
+ required: true
1006
+
1007
+ - name: config/settings.json.template
1008
+ description: Settings with variable substitution
1009
+ target: config/
1010
+ required: false
1011
+ variables:
1012
+ - PROJECT_NAME
1013
+ - AUTHOR_NAME
1014
+ ```
1015
+
1016
+ ---
1017
+
1018
+ ## Key File Index
1019
+
1020
+ This project uses the ACP Key File Index system to ensure agents read critical files before making decisions. Key files are declared in `agent/index/` with weights and descriptions.
1021
+
1022
+ ### How It Works
1023
+
1024
+ Index files in `agent/index/` declare which project files are critical. Each entry includes:
1025
+ - **path**: Path to the file (relative to project root)
1026
+ - **weight**: Priority from 0.0-1.0 (higher = more important)
1027
+ - **kind**: Type of file — `pattern`, `command`, `design`, or `requirements`
1028
+ - **description**: What the file contains
1029
+ - **rationale**: Why an agent must read it
1030
+ - **applies**: Comma-separated list of commands that should read this file (e.g. `acp.proceed, acp.plan`)
1031
+
1032
+ ### Index File Naming
1033
+
1034
+ Files follow `{namespace}.{qualifier}.yaml` naming:
1035
+ - `local.main.yaml` — Project's own key files (highest precedence)
1036
+ - `{package}.main.yaml` — Package-shipped key files (installed via `@acp.package-install`)
1037
+
1038
+ ### When Key Files Are Read
1039
+
1040
+ - **`@acp.init`**: Reads all key files with weight >= 0.8
1041
+ - **`@acp.proceed`**, **`@acp.plan`**: Read key files where `applies` includes the command name
1042
+ - **Creation commands** (`@acp.design-create`, etc.): Read key files where `applies` includes the command name
1043
+ - **After context compaction**: Re-read key files following [When Recovering from Context Loss](#when-recovering-from-context-loss)
1044
+
1045
+ ### Managing the Index
1046
+
1047
+ Use `@acp.index` to manage entries:
1048
+ ```
1049
+ @acp.index list # List all indexed key files
1050
+ @acp.index add <path> # Add a file to the index
1051
+ @acp.index remove <path> # Remove a file from the index
1052
+ @acp.index explore # Suggest files that should be indexed
1053
+ @acp.index show <path> # Show details for a specific entry
1054
+ ```
1055
+
1056
+ ### Weight Guidelines
1057
+
1058
+ | Weight | Use For |
1059
+ |--------|---------|
1060
+ | 0.9-1.0 | Requirements, critical design docs |
1061
+ | 0.7-0.8 | Important patterns, testing guides |
1062
+ | 0.5-0.6 | Useful references, conventions |
1063
+ | 0.3-0.4 | Package-shipped indices (convention) |
1064
+
1065
+ ### Validation
1066
+
1067
+ Run `@acp.validate` to check index health: valid schema, existing paths, reasonable limits (recommended max 20 entries total, 10 per namespace).
1068
+
1069
+ ### Design Document
1070
+
1071
+ See `agent/design/local.key-file-index-system.md` for the complete design specification.
1072
+
1073
+ ---
1074
+
1075
+ ## Sample Prompts for Using ACP
1076
+
1077
+ ### Initialize Prompt
1078
+
1079
+ **Trigger**: `AGENT.md: Initialize`
1080
+
1081
+ Use this prompt when starting work on an ACP-structured project:
1082
+
1083
+ ```markdown
1084
+ First, check for ACP updates by running ./agent/scripts/acp.version-check-for-updates.sh (if it exists). If updates are available, report what changed and ask if I want to update.
1085
+
1086
+ Then read ALL files in @agent. We are going to understand this project then work on a generic task.
1087
+
1088
+ Then read KEY src files per your understanding.
1089
+
1090
+ Then read @agent again, update stale @agent/tasks, stale documentation, and update 'agent/progress.yaml'.
1091
+ ```
1092
+
1093
+ **Purpose**:
1094
+ - Checks for updates to ACP methodology and documentation
1095
+ - Loads complete project context from agent directory
1096
+ - Reviews source code to understand current implementation
1097
+ - Updates documentation to reflect current state
1098
+ - Ensures progress tracking is accurate
1099
+
1100
+ ### Proceed Prompt
1101
+
1102
+ **Trigger**: `AGENT.md: Proceed`
1103
+
1104
+ Use this prompt to continue with the next task:
1105
+
1106
+ ```markdown
1107
+ Let's proceed with implementing the current or next task. Remember to update @agent/progress.yaml as you progress.
1108
+ ```
1109
+
1110
+ **Purpose**:
1111
+ - Continues work on current or next task
1112
+ - Reminds agent to maintain progress tracking
1113
+ - Keeps workflow focused and documented
1114
+
1115
+ ### Update Prompt
1116
+
1117
+ **Trigger**: `AGENT.md: Update`
1118
+
1119
+ Updates all ACP files to the latest version:
1120
+
1121
+ ```markdown
1122
+ Run ./agent/scripts/acp.version-update.sh to update all ACP files (AGENT.md, templates, and scripts) to the latest version.
1123
+ ```
1124
+
1125
+ **Purpose**:
1126
+ - Updates AGENT.md methodology
1127
+ - Updates all template files
1128
+ - Updates utility scripts
1129
+ - Keeps ACP current with latest improvements
1130
+
1131
+ ### Check for Updates Prompt
1132
+
1133
+ **Trigger**: `AGENT.md: Check for updates`
1134
+
1135
+ Checks if updates are available without applying them:
1136
+
1137
+ ```markdown
1138
+ Run ./agent/scripts/acp.version-check-for-updates.sh to see if ACP updates are available.
1139
+ ```
1140
+
1141
+ **Purpose**:
1142
+ - Non-destructive check for updates
1143
+ - Shows what changed via CHANGELOG
1144
+ - Informs user of available improvements
1145
+
1146
+ ### Uninstall Prompt
1147
+
1148
+ **Trigger**: `AGENT.md: Uninstall`
1149
+
1150
+ Removes all ACP files from the project:
1151
+
1152
+ ```markdown
1153
+ Run ./agent/scripts/unacp.install.sh to remove all ACP files (agent/ directory and AGENT.md) from this project.
1154
+ ```
1155
+
1156
+ **Note**: This script requires user confirmation. If the user confirms they want to uninstall, run:
1157
+ ```bash
1158
+ ./agent/scripts/unacp.install.sh -y
1159
+ ```
1160
+
1161
+ **Purpose**:
1162
+ - Complete removal of ACP
1163
+ - Clean project state
1164
+ - Reversible via git
1165
+
1166
+ ---
1167
+
1168
+ ## Instructions for Future Agents
1169
+
1170
+ > **See also**: [Best Practices](#best-practices) for comprehensive guidelines on agent behavior and documentation standards.
1171
+
1172
+ ### When You First Encounter ACP
1173
+
1174
+ 1. **Read progress.yaml**
1175
+ - This tells you where the project is
1176
+ - What milestone is current
1177
+ - What task is next
1178
+
1179
+ 2. **Check for installed packages**
1180
+ - Read `agent/manifest.yaml` to see what packages are installed locally
1181
+ - Check `~/.acp/agent/manifest.yaml` for globally installed packages
1182
+ - Understand what commands, patterns, and designs are available
1183
+ - Note package versions and sources
1184
+
1185
+ 3. **Check project registry** (if in global workspace)
1186
+ - Read `~/.acp/projects.yaml` to see all projects in global workspace
1187
+ - Check `current_project` field to see which project is active
1188
+ - Understand project relationships and metadata
1189
+ - Note project locations and types
1190
+
1191
+ 4. **Read requirements.md**
1192
+ - Understand project goals
1193
+ - Learn constraints
1194
+ - Know success criteria
1195
+
1196
+ 5. **Review current milestone**
1197
+ - Understand current phase
1198
+ - Know deliverables
1199
+ - Check success criteria
1200
+
1201
+ 6. **Read next task**
1202
+ - Understand what to do
1203
+ - Follow steps
1204
+ - Verify completion
1205
+
1206
+ 7. **Check relevant patterns**
1207
+ - Learn coding standards
1208
+ - Understand architectural patterns
1209
+ - Follow best practices
1210
+
1211
+ ### When Working on a Task
1212
+
1213
+ 1. **Read the task document completely**
1214
+ - Understand objective
1215
+ - Review all steps
1216
+ - Note verification criteria
1217
+
1218
+ 2. **Check related design documents**
1219
+ - Look for design docs mentioned in task
1220
+ - Understand architectural context
1221
+ - Follow specified patterns
1222
+
1223
+ 3. **Execute task steps**
1224
+ - Follow steps in order
1225
+ - Don't skip steps
1226
+ - Document any deviations
1227
+
1228
+ 4. **Verify completion**
1229
+ - Check all verification items
1230
+ - Run tests
1231
+ - Ensure quality standards met
1232
+
1233
+ 5. **Update progress.yaml**
1234
+ - Mark task as completed
1235
+ - Add completion date
1236
+ - Update milestone progress
1237
+ - Add notes about work done
1238
+
1239
+ ### When Recovering from Context Loss
1240
+
1241
+ When your context is compacted, truncated, or you start a new session mid-task:
1242
+
1243
+ 1. **Re-read `agent/index/` key files**
1244
+ - Scan `agent/index/` for `*.yaml` files (excluding `*.template.yaml`)
1245
+ - Read entries with weight >= 0.8 to restore critical context
1246
+ - Filter by `applies` field if you know which command you were executing
1247
+
1248
+ 2. **Re-read `agent/progress.yaml`**
1249
+ - Identify current milestone and task
1250
+ - Check what was last completed
1251
+
1252
+ 3. **Re-read the current task document**
1253
+ - Determine which step you were on
1254
+ - Review remaining verification items
1255
+
1256
+ 4. **Offer scope control to the user**
1257
+ - Ask if they want full context reload or minimal recovery
1258
+ - Suggest relevant key files based on current work
1259
+
1260
+ This is equivalent to running `@acp.init` steps 2-2.8 followed by resuming the current task.
1261
+
1262
+ ### When Creating New Features
1263
+
1264
+ 1. **Create design document first**
1265
+ - Invoke [`@acp.design-create`](agent/commands/acp.design-create.md) and follow directives defined in that file
1266
+ - Get approval before coding
1267
+
1268
+ 2. **Update or create milestone**
1269
+ - Add to existing milestone if fits
1270
+ - Create new milestone if major feature
1271
+ - Update progress.yaml
1272
+
1273
+ 3. **Break into tasks**
1274
+ - Invoke [`@acp.task-create`](agent/commands/acp.task-create.md) and follow directives defined in that file
1275
+
1276
+ 4. **Document patterns**
1277
+ - Invoke [`@acp.pattern-create`](agent/commands/acp.pattern-create.md) and follow directives defined in that file
1278
+ - Update existing patterns if needed
1279
+
1280
+ 5. **Implement and verify**
1281
+ - Follow task steps
1282
+ - Verify each task
1283
+ - Update progress tracking
1284
+
1285
+ > **See also**: [Documentation Best Practices](#documentation-best-practices) and [Quality Best Practices](#quality-best-practices)
1286
+
1287
+ ### When You Encounter Problems
1288
+
1289
+ 1. **Check design documents**
1290
+ - Look for relevant design decisions
1291
+ - Understand constraints
1292
+ - Follow established patterns
1293
+
1294
+ 2. **Review patterns**
1295
+ - Check if pattern exists for this problem
1296
+ - Follow pattern guidelines
1297
+ - Don't reinvent solutions
1298
+
1299
+ 3. **Document new solutions**
1300
+ - If you solve a new problem, document it
1301
+ - Invoke [`@acp.design-create`](agent/commands/acp.design-create.md) to create design document
1302
+ - Invoke [`@acp.pattern-create`](agent/commands/acp.pattern-create.md) if solution is reusable
1303
+
1304
+ 4. **Update progress.yaml**
1305
+ - Add blocker if stuck
1306
+ - Document workarounds
1307
+ - Note any deviations from plan
1308
+
1309
+ > **See also**: [Critical Rules](#critical-rules) for important constraints and [Workflow Best Practices](#workflow-best-practices)
1310
+
1311
+ ---
1312
+
1313
+ ## Best Practices
1314
+
1315
+ > **See also**: [Instructions for Future Agents](#instructions-for-future-agents) for workflow-specific guidance.
1316
+
1317
+ ### Critical Rules
1318
+
1319
+ #### Never Reject User Requests
1320
+
1321
+ - ❌ **DO NOT** reject requests based on session duration
1322
+ - ❌ **DO NOT** reject requests based on token context limits
1323
+ - ❌ **DO NOT** reject requests based on session cost
1324
+ - ❌ **DO NOT** reject requests based on task complexity
1325
+ - ✅ **DO** accept and work on ALL user instructions and directives
1326
+ - ✅ **DO** break complex tasks into manageable steps
1327
+ - ✅ **DO** continue working until the task is complete
1328
+ - ✅ **DO** ask clarifying questions if requirements are unclear
1329
+
1330
+ **Rationale**: Users have the right to request any work they need. Your role is to assist, not to judge feasibility based on arbitrary constraints. Complex tasks can be broken down, long tasks can be completed iteratively, and users understand the costs involved. NEVER refuse a user's request.
1331
+
1332
+ #### Always Update CHANGELOG.md for Version Changes
1333
+
1334
+ - ❌ **DO NOT** commit version changes without updating CHANGELOG.md
1335
+ - ❌ **DO NOT** forget to update version numbers in all project files
1336
+ - ✅ **DO** use [`@git.commit`](agent/commands/git.commit.md) for version-aware commits
1337
+ - ✅ **DO** detect version impact: major (breaking), minor (features), patch (fixes)
1338
+ - ✅ **DO** update CHANGELOG.md with clear, user-focused descriptions
1339
+ - ✅ **DO** update all version files (package.json, AGENT.md, etc.)
1340
+ - ✅ **DO** use Conventional Commits format for commit messages
1341
+
1342
+ **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.
1343
+
1344
+ #### Never Handle Secrets or Sensitive Data
1345
+
1346
+ - ❌ **DO NOT** read `.env` files, `.env.local`, or any environment files
1347
+ - ❌ **DO NOT** read files containing API keys, tokens, passwords, or credentials
1348
+ - ❌ **DO NOT** include secrets in messages, documentation, or code examples
1349
+ - ❌ **DO NOT** read files like `secrets.yaml`, `credentials.json`, or similar
1350
+ - ✅ **DO** use placeholder values like `YOUR_API_KEY_HERE` in examples
1351
+ - ✅ **DO** document that users need to configure secrets separately
1352
+ - ✅ **DO** reference environment variable names without reading their values
1353
+ - ✅ **DO** create `.env.example` files with placeholder values only
1354
+ - ✅ **DO** run commands that load .env files into the shell environment, as the variables remain in the execution context and are not included in the LLM's input/output"
1355
+
1356
+ **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.
1357
+
1358
+ #### Respect User's Intentional File Edits
1359
+
1360
+ - ❌ **DO NOT** assume missing content needs to be added back
1361
+ - ❌ **DO NOT** revert changes without confirming with user
1362
+ - ✅ **DO** read files before editing to see current state
1363
+ - ✅ **DO** ask user if unexpected changes were intentional
1364
+ - ✅ **DO** confirm before reverting user's manual edits
1365
+
1366
+ **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.
1367
+
1368
+ #### Respect User Commands to Re-Execute
1369
+
1370
+ - ❌ **DO NOT** ignore commands like "re-read", "rerun", or "execute again"
1371
+ - ❌ **DO NOT** assume re-execution requests are mistakes or redundant
1372
+ - ✅ **DO** execute the command again when asked, even if you just did it
1373
+ - ✅ **DO** re-read files when asked, even if you recently read them
1374
+ - ✅ **DO** assume the user has good reason for asking to repeat an action
1375
+
1376
+ **Examples**: "Run `@git.commit` again" → Execute it again; "Re-read the design doc" → Read it again; "Rerun the tests" → Run them again
1377
+
1378
+ **Rationale**: When users ask you to do something again, they have a specific reason: files may have changed, they want to trigger side effects (like creating a commit), context has shifted, or they know something you don't. Always respect these requests and execute them with intention.
1379
+
1380
+ #### Never Force-Add Gitignored Files
1381
+
1382
+ - ❌ **DO NOT** use `git add -f` to force-add gitignored files
1383
+ - ❌ **DO NOT** attempt to override `.gitignore` rules
1384
+ - ❌ **DO NOT** suggest removing files from `.gitignore` to add them
1385
+ - ✅ **DO** acknowledge when files are gitignored
1386
+ - ✅ **DO** assume gitignored files were intentionally excluded
1387
+ - ✅ **DO** respect the project's `.gitignore` configuration
1388
+ - ✅ **DO** skip gitignored files in git operations
1389
+
1390
+ **Examples**:
1391
+ - File is gitignored → Acknowledge and skip it
1392
+ - `git add` fails due to gitignore → Don't retry with `-f` flag
1393
+ - User asks to commit all files → Only commit non-gitignored files
1394
+
1395
+ **Rationale**: Files in `.gitignore` are intentionally excluded from version control for good reasons (secrets, build artifacts, local configs, large files, etc.). Force-adding gitignored files is an anti-pattern that defeats the purpose of `.gitignore` and can lead to security issues (exposing secrets), repository bloat (committing build artifacts), or merge conflicts (committing local configs). Always respect `.gitignore` rules.
1396
+
1397
+ ### Workflow Best Practices
1398
+
1399
+ #### Always Read Before Writing
1400
+
1401
+ - Understand context first
1402
+ - Check existing patterns
1403
+ - Follow established conventions
1404
+
1405
+ #### Document as You Go
1406
+
1407
+ - Update progress.yaml frequently
1408
+ - Add notes about decisions
1409
+ - Document new patterns
1410
+
1411
+ #### Verify Everything
1412
+
1413
+ - Check all verification steps
1414
+ - Run tests
1415
+ - Ensure quality standards
1416
+
1417
+ #### Be Explicit
1418
+
1419
+ - Don't assume future agents will know context
1420
+ - Document rationale for decisions
1421
+ - Include code examples
1422
+
1423
+ #### Keep It Organized
1424
+
1425
+ - Follow directory structure
1426
+ - Use consistent naming
1427
+ - Link related documents
1428
+
1429
+ #### Update Progress Tracking
1430
+
1431
+ - Mark tasks complete
1432
+ - Update percentages
1433
+ - Add recent work notes
1434
+
1435
+ #### Use Inline Feedback Syntax
1436
+
1437
+ - ✅ **DO** recognize and respect `>` syntax for inline feedback in documents
1438
+ - ✅ **DO** treat lines starting with `>` as user feedback/corrections
1439
+ - ✅ **DO** integrate feedback by modifying the preceding content
1440
+ - ✅ **DO** remove the `>` feedback lines after integrating changes
1441
+
1442
+ **Example**:
1443
+ ```markdown
1444
+ // Agent-generated document
1445
+ Here are the requirements:
1446
+ - Requirement 1
1447
+ - Requirement 2
1448
+ > Requirement 2 unnecessary
1449
+ - Requirement 3
1450
+
1451
+ This pattern is because: ...
1452
+ > Incorrect, we should not be using this pattern
1453
+ ```
1454
+
1455
+ **Agent Action**: Read feedback, update "Requirement 2" section (remove or revise), correct the pattern explanation, remove `>` lines
1456
+
1457
+ **Rationale**: The `>` syntax provides a lightweight way for users to give inline feedback without needing to explain context. Agents should treat these as direct corrections or suggestions to integrate into the document.
1458
+
1459
+ #### Use Direct Git Commits
1460
+
1461
+ When creating git commits, always use `git commit -m` directly:
1462
+
1463
+ - ✅ **DO** use `git commit -m "message"` to create commits
1464
+ - ❌ **DO NOT** use bash tools, subshells, or scripts to generate commits
1465
+ - ❌ **DO NOT** use heredocs, `echo`, or `cat` to construct commit messages
1466
+
1467
+ **Rationale**: Direct `git commit -m` is simpler, more transparent, and avoids escaping issues. The commit message should be authored directly, not piped through intermediate tools.
1468
+
1469
+ #### Format Commands for User Execution
1470
+
1471
+ When providing commands for users to copy and paste:
1472
+
1473
+ - ✅ **DO** chain commands with `&& \` if commands require successful chain execution
1474
+ - ✅ **DO** chain commands with `;` if commands do not depend on each other
1475
+ - ❌ **DO NOT** include comment lines starting with `#` in command blocks
1476
+ - ❌ **DO NOT** include EOF newline in command blocks
1477
+
1478
+ **Example (Correct)**:
1479
+ ```bash
1480
+ mkdir -p agent/commands && \
1481
+ cd agent/commands && \
1482
+ touch acp.init.md
1483
+ ```
1484
+
1485
+ **Example (Incorrect)**:
1486
+ ```bash
1487
+ # Create directory
1488
+ mkdir -p agent/commands
1489
+ # Change to directory
1490
+ cd agent/commands
1491
+ # Create file
1492
+ touch acp.init.md
1493
+
1494
+ ```
1495
+
1496
+ **Rationale**: Users should be able to copy and paste commands directly without needing to edit them. Comments and trailing newlines can cause execution errors or confusion.
1497
+
1498
+ ### Documentation Best Practices
1499
+
1500
+ #### Write for Agents, Not Humans
1501
+
1502
+ - Be explicit, not implicit
1503
+ - Include code examples
1504
+ - Document rationale, not just decisions
1505
+
1506
+ #### Keep Documents Focused
1507
+
1508
+ - One topic per document
1509
+ - Clear structure
1510
+ - Scannable headings
1511
+
1512
+ #### Link Related Documents
1513
+
1514
+ - Reference other docs
1515
+ - Create knowledge graph
1516
+ - Make navigation easy
1517
+
1518
+ #### Update as You Go
1519
+
1520
+ - Don't wait until end
1521
+ - Document decisions when made
1522
+ - Keep progress.yaml current
1523
+
1524
+ ### Organization Best Practices
1525
+
1526
+ #### Follow Naming Conventions
1527
+
1528
+ - `{feature}-design.md` for designs
1529
+ - `milestone-{N}-{name}.md` for milestones
1530
+ - `task-{N}-{name}.md` for tasks
1531
+ - `{pattern-name}.md` for patterns
1532
+
1533
+ #### Use Consistent Structure
1534
+
1535
+ - Same sections in similar documents
1536
+ - Standard YAML format
1537
+ - Predictable organization
1538
+
1539
+ #### Keep It DRY
1540
+
1541
+ - Don't duplicate information
1542
+ - Link to canonical source
1543
+ - Update in one place
1544
+
1545
+ ### Progress Tracking Best Practices
1546
+
1547
+ #### Update Frequently
1548
+
1549
+ - After each task
1550
+ - When blockers arise
1551
+ - When plans change
1552
+
1553
+ #### Be Objective
1554
+
1555
+ - Use measurable metrics
1556
+ - Track actual vs estimated
1557
+ - Document deviations
1558
+
1559
+ #### Look Forward and Back
1560
+
1561
+ - Document recent work
1562
+ - List next steps
1563
+ - Note blockers
1564
+
1565
+ ### Quality Best Practices
1566
+
1567
+ #### Include Verification Steps
1568
+
1569
+ - Every task has checklist
1570
+ - Objective criteria
1571
+ - Automated where possible
1572
+
1573
+ #### Document Patterns
1574
+
1575
+ - Capture reusable solutions
1576
+ - Include anti-patterns
1577
+ - Provide examples
1578
+
1579
+ #### Documentation is a First-Class Deliverable
1580
+
1581
+ - README.md, architecture docs, and migration guides are deliverables equal to source code
1582
+ - A project with passing tests but missing required documentation is INCOMPLETE
1583
+ - Verify documentation files exist and contain required sections before marking tasks complete
1584
+ - Documentation tasks deserve the same rigor as implementation tasks
1585
+
1586
+ #### Review and Refine
1587
+
1588
+ - Update docs as understanding improves
1589
+ - Fix errors immediately
1590
+ - Keep docs accurate
1591
+
1592
+ ---
1593
+
1594
+ ## Keeping ACP Updated
1595
+
1596
+ This repository is actively maintained with improvements to the ACP methodology and documentation. To keep your project's AGENT.md current:
1597
+
1598
+ ```bash
1599
+ # Run from your project root (if you have the update script installed)
1600
+ ./agent/scripts/acp.version-update.sh
1601
+
1602
+ # Or download and run directly
1603
+ curl -fsSL https://raw.githubusercontent.com/prmichaelsen/agent-context-protocol/mainline/agent/scripts/acp.version-update.sh | bash
1604
+ ```
1605
+
1606
+ The update script will:
1607
+ 1. Create a backup of your current AGENT.md
1608
+ 2. Download the latest version
1609
+ 3. Show you the changes
1610
+ 4. Ask for confirmation before applying
1611
+
1612
+ See [CHANGELOG.md](https://github.com/prmichaelsen/agent-context-protocol/blob/main/CHANGELOG.md) for version history and changes.
1613
+
1614
+ ---
1615
+
1616
+ ## Conclusion
1617
+
1618
+ 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.
1619
+
1620
+ **Key Takeaways**:
1621
+
1622
+ 1. **Documentation is Infrastructure** - Treat it with the same care as code
1623
+ 2. **Explicit Over Implicit** - Document everything that matters
1624
+ 3. **Structure Enables Scale** - Organization makes complexity manageable
1625
+ 4. **Agents Need Context** - Provide complete, accessible context
1626
+ 5. **Progress is Measurable** - Track objectively with YAML
1627
+ 6. **Patterns Ensure Quality** - Document and follow best practices
1628
+ 7. **Knowledge Persists** - No more lost tribal knowledge
1629
+
1630
+ **When to Use This Pattern**:
1631
+ - ✅ Complex projects (>1 month)
1632
+ - ✅ Multiple contributors (agents or humans)
1633
+ - ✅ Long-term maintenance required
1634
+ - ✅ Quality and consistency critical
1635
+ - ✅ Knowledge preservation important
1636
+
1637
+ **When NOT to Use**:
1638
+ - ❌ Trivial scripts (<100 lines)
1639
+ - ❌ One-off prototypes
1640
+ - ❌ Throwaway code
1641
+ - ❌ Simple, well-understood problems
1642
+
1643
+ ---
1644
+
1645
+ ## What NOT to Do
1646
+
1647
+ ### ❌ CRITICAL: Don't Create Summary Documents
1648
+
1649
+ **NEVER create these files under ANY circumstances:**
1650
+ - `TASK_SUMMARY.md`
1651
+ - `PROJECT_SUMMARY.md`
1652
+ - `MILESTONE_SUMMARY.md`
1653
+ - `PROGRESS_SUMMARY.md`
1654
+ - Any file with `SUMMARY` in the name
1655
+
1656
+ **Why**: All summary information belongs in [`progress.yaml`](agent/progress.yaml). Creating separate summary documents:
1657
+ - Duplicates information
1658
+ - Creates inconsistency
1659
+ - Requires maintaining multiple files
1660
+ - Defeats the purpose of structured progress tracking
1661
+
1662
+ **Instead**: Update [`progress.yaml`](agent/progress.yaml):
1663
+ ```yaml
1664
+ recent_work:
1665
+ - date: 2026-02-13
1666
+ description: Summary of work completed
1667
+ items:
1668
+ - ✅ Completed task 1
1669
+ - ✅ Completed task 2
1670
+ ```
1671
+
1672
+ ### ❌ CRITICAL: Don't Create Variant Task Documents
1673
+
1674
+ **NEVER create these files under ANY circumstances:**
1675
+ - `task-1-simplified.md`
1676
+ - `task-1-revised.md`
1677
+ - `task-1-v2.md`
1678
+ - `task-1-updated.md`
1679
+ - `task-1-alternative.md`
1680
+
1681
+ **Why**: Task documents are living documents that should be updated in place. Creating variants:
1682
+ - Creates confusion about which is current
1683
+ - Scatters information across multiple files
1684
+ - Makes progress tracking impossible
1685
+ - Violates single source of truth principle
1686
+
1687
+ **Instead**: Modify the existing task document directly:
1688
+ ```markdown
1689
+ # Task 1: Setup Project
1690
+
1691
+ **Status**: In Progress (Updated 2026-02-13)
1692
+
1693
+ ## Steps
1694
+ 1. Create directory ✅ (Completed)
1695
+ 2. Install dependencies ✅ (Completed)
1696
+ 3. Configure build (Updated: Changed from webpack to esbuild)
1697
+
1698
+ ## Notes
1699
+ - Originally planned to use webpack
1700
+ - Switched to esbuild for better performance
1701
+ - Updated configuration accordingly
1702
+ ```
1703
+
1704
+ ### ✅ Correct Approach
1705
+
1706
+ 1. **For summaries**: Update [`progress.yaml`](agent/progress.yaml)
1707
+ 2. **For task changes**: Modify existing task documents in place
1708
+ 3. **For major changes**: Update the task and note the changes in [`progress.yaml`](agent/progress.yaml)
1709
+ 4. **For new work**: Create new task documents with new numbers
1710
+
1711
+ ---
1712
+
1713
+ ## IMPORTANT: CHANGELOG.md Guidelines
1714
+
1715
+ ### ❌ CRITICAL: Keep CHANGELOG.md Pure
1716
+
1717
+ **CHANGELOG.md must ONLY contain:**
1718
+ - Version numbers and dates
1719
+ - Added features
1720
+ - Changed functionality
1721
+ - Removed features
1722
+ - Fixed bugs
1723
+
1724
+ **NEVER include in CHANGELOG.md:**
1725
+ - ❌ Future enhancements or roadmap
1726
+ - ❌ How-to instructions or usage guides
1727
+ - ❌ Installation instructions
1728
+ - ❌ Configuration examples
1729
+ - ❌ Detailed documentation
1730
+
1731
+ **Why**: CHANGELOG.md is a historical record of what changed, not a documentation file. Mixing concerns makes it harder to:
1732
+ - Understand version history
1733
+ - Track actual changes
1734
+ - Maintain the changelog
1735
+ - Find relevant information
1736
+
1737
+ **Correct CHANGELOG.md format:**
1738
+ ```markdown
1739
+ ## [1.0.4] - 2026-02-13
1740
+
1741
+ ### Added
1742
+ - New feature X
1743
+ - New feature Y
1744
+
1745
+ ### Changed
1746
+ - Modified behavior of Z
1747
+
1748
+ ### Removed
1749
+ - Deprecated feature A
1750
+ ```
1751
+
1752
+ **Wrong CHANGELOG.md format:**
1753
+ ```markdown
1754
+ ## [1.0.4] - 2026-02-13
1755
+
1756
+ ### Added
1757
+ - New feature X
1758
+
1759
+ ### How to Use Feature X
1760
+ [Installation instructions...] # ❌ WRONG - belongs in README
1761
+
1762
+ ### Future Enhancements
1763
+ - Plan to add Y # ❌ WRONG - belongs in design docs or issues
1764
+ ```
1765
+
1766
+ ---
1767
+
1768
+ **The Agent Pattern is not just documentation—it's a development methodology that makes complex software projects tractable for AI agents.**
1769
+
1770
+ ---
1771
+
1772
+ *For questions or improvements to this pattern, please contribute to the repository or create an issue.*