@prmichaelsen/remember-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 (95) hide show
  1. package/.env.example +65 -0
  2. package/AGENT.md +840 -0
  3. package/README.md +72 -0
  4. package/agent/design/.gitkeep +0 -0
  5. package/agent/design/access-control-result-pattern.md +458 -0
  6. package/agent/design/action-audit-memory-types.md +637 -0
  7. package/agent/design/common-template-fields.md +282 -0
  8. package/agent/design/complete-tool-set.md +407 -0
  9. package/agent/design/content-types-expansion.md +521 -0
  10. package/agent/design/cross-database-id-strategy.md +358 -0
  11. package/agent/design/default-template-library.md +423 -0
  12. package/agent/design/firestore-wrapper-analysis.md +606 -0
  13. package/agent/design/llm-provider-abstraction.md +691 -0
  14. package/agent/design/location-handling-architecture.md +523 -0
  15. package/agent/design/memory-templates-design.md +364 -0
  16. package/agent/design/permissions-storage-architecture.md +680 -0
  17. package/agent/design/relationship-storage-strategy.md +361 -0
  18. package/agent/design/remember-mcp-implementation-tasks.md +417 -0
  19. package/agent/design/remember-mcp-progress.yaml +141 -0
  20. package/agent/design/requirements-enhancements.md +468 -0
  21. package/agent/design/requirements.md +56 -0
  22. package/agent/design/template-storage-strategy.md +412 -0
  23. package/agent/design/template-suggestion-system.md +853 -0
  24. package/agent/design/trust-escalation-prevention.md +343 -0
  25. package/agent/design/trust-system-implementation.md +592 -0
  26. package/agent/design/user-preferences.md +683 -0
  27. package/agent/design/weaviate-collection-strategy.md +461 -0
  28. package/agent/milestones/.gitkeep +0 -0
  29. package/agent/milestones/milestone-1-project-foundation.md +121 -0
  30. package/agent/milestones/milestone-2-core-memory-system.md +150 -0
  31. package/agent/milestones/milestone-3-relationships-graph.md +116 -0
  32. package/agent/milestones/milestone-4-user-preferences.md +103 -0
  33. package/agent/milestones/milestone-5-template-system.md +126 -0
  34. package/agent/milestones/milestone-6-auth-multi-tenancy.md +124 -0
  35. package/agent/milestones/milestone-7-trust-permissions.md +133 -0
  36. package/agent/milestones/milestone-8-testing-quality.md +137 -0
  37. package/agent/milestones/milestone-9-deployment-documentation.md +147 -0
  38. package/agent/patterns/.gitkeep +0 -0
  39. package/agent/patterns/bootstrap.md +1271 -0
  40. package/agent/patterns/firebase-admin-sdk-v8-usage.md +950 -0
  41. package/agent/patterns/firestore-users-pattern-best-practices.md +347 -0
  42. package/agent/patterns/library-services.md +454 -0
  43. package/agent/patterns/testing-colocated.md +316 -0
  44. package/agent/progress.yaml +395 -0
  45. package/agent/tasks/.gitkeep +0 -0
  46. package/agent/tasks/task-1-initialize-project-structure.md +266 -0
  47. package/agent/tasks/task-2-install-dependencies.md +199 -0
  48. package/agent/tasks/task-3-setup-weaviate-client.md +330 -0
  49. package/agent/tasks/task-4-setup-firestore-client.md +362 -0
  50. package/agent/tasks/task-5-create-basic-mcp-server.md +114 -0
  51. package/agent/tasks/task-6-create-integration-tests.md +195 -0
  52. package/agent/tasks/task-7-finalize-milestone-1.md +363 -0
  53. package/agent/tasks/task-8-setup-utility-scripts.md +382 -0
  54. package/agent/tasks/task-9-create-server-factory.md +404 -0
  55. package/dist/config.d.ts +26 -0
  56. package/dist/constants/content-types.d.ts +60 -0
  57. package/dist/firestore/init.d.ts +14 -0
  58. package/dist/firestore/paths.d.ts +53 -0
  59. package/dist/firestore/paths.spec.d.ts +2 -0
  60. package/dist/server-factory.d.ts +40 -0
  61. package/dist/server-factory.js +1741 -0
  62. package/dist/server-factory.spec.d.ts +2 -0
  63. package/dist/server.d.ts +3 -0
  64. package/dist/server.js +1690 -0
  65. package/dist/tools/create-memory.d.ts +94 -0
  66. package/dist/tools/delete-memory.d.ts +47 -0
  67. package/dist/tools/search-memory.d.ts +88 -0
  68. package/dist/types/memory.d.ts +183 -0
  69. package/dist/utils/logger.d.ts +7 -0
  70. package/dist/weaviate/client.d.ts +39 -0
  71. package/dist/weaviate/client.spec.d.ts +2 -0
  72. package/dist/weaviate/schema.d.ts +29 -0
  73. package/esbuild.build.js +60 -0
  74. package/esbuild.watch.js +25 -0
  75. package/jest.config.js +31 -0
  76. package/jest.e2e.config.js +17 -0
  77. package/package.json +68 -0
  78. package/src/.gitkeep +0 -0
  79. package/src/config.ts +56 -0
  80. package/src/constants/content-types.ts +454 -0
  81. package/src/firestore/init.ts +68 -0
  82. package/src/firestore/paths.spec.ts +75 -0
  83. package/src/firestore/paths.ts +124 -0
  84. package/src/server-factory.spec.ts +60 -0
  85. package/src/server-factory.ts +215 -0
  86. package/src/server.ts +243 -0
  87. package/src/tools/create-memory.ts +198 -0
  88. package/src/tools/delete-memory.ts +126 -0
  89. package/src/tools/search-memory.ts +216 -0
  90. package/src/types/memory.ts +276 -0
  91. package/src/utils/logger.ts +42 -0
  92. package/src/weaviate/client.spec.ts +58 -0
  93. package/src/weaviate/client.ts +114 -0
  94. package/src/weaviate/schema.ts +288 -0
  95. package/tsconfig.json +26 -0
package/AGENT.md ADDED
@@ -0,0 +1,840 @@
1
+ # Agent Context Protocol (ACP)
2
+
3
+ **Also Known As**: The Agent Directory Pattern
4
+ **Version**: 1.0.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
+ │ ├── design/ # Design documents
85
+ │ │ ├── .gitkeep
86
+ │ │ ├── requirements.md # Core requirements
87
+ │ │ ├── {feature}-design.md # Feature specifications
88
+ │ │ ├── {pattern}-pattern.md # Design patterns
89
+ │ │ └── ...
90
+ │ │
91
+ │ ├── milestones/ # Project milestones
92
+ │ │ ├── .gitkeep
93
+ │ │ ├── milestone-1-{name}.md
94
+ │ │ ├── milestone-2-{name}.md
95
+ │ │ └── ...
96
+ │ │
97
+ │ ├── patterns/ # Architectural patterns
98
+ │ │ ├── .gitkeep
99
+ │ │ ├── bootstrap.md # Project setup pattern
100
+ │ │ ├── {pattern-name}.md
101
+ │ │ └── ...
102
+ │ │
103
+ │ ├── tasks/ # Granular tasks
104
+ │ │ ├── .gitkeep
105
+ │ │ ├── task-1-{name}.md
106
+ │ │ ├── task-2-{name}.md
107
+ │ │ └── ...
108
+ │ │
109
+ │ └── progress.yaml # Progress tracking
110
+
111
+ └── (project-specific files) # Your project structure
112
+ ```
113
+
114
+ ---
115
+
116
+ ## Core Components
117
+
118
+ ### 1. Design Documents (`agent/design/`)
119
+
120
+ **Purpose**: Capture architectural decisions, technical specifications, and design rationale.
121
+
122
+ **Structure**:
123
+ ```markdown
124
+ # {Feature/Pattern Name}
125
+
126
+ **Concept**: One-line description
127
+ **Created**: YYYY-MM-DD
128
+ **Status**: Proposal | Design Specification | Implemented
129
+
130
+ ---
131
+
132
+ ## Overview
133
+ High-level description of what this is and why it exists
134
+
135
+ ## Problem Statement
136
+ What problem does this solve?
137
+
138
+ ## Solution
139
+ How does this solve the problem?
140
+
141
+ ## Implementation
142
+ Technical details, code examples, schemas
143
+
144
+ ## Benefits
145
+ Why this approach is better than alternatives
146
+
147
+ ## Trade-offs
148
+ What are the downsides or limitations?
149
+
150
+ ---
151
+
152
+ **Status**: Current status
153
+ **Recommendation**: What should be done
154
+ ```
155
+
156
+ ### 2. Milestones (`agent/milestones/`)
157
+
158
+ **Purpose**: Define project phases with clear deliverables and success criteria.
159
+
160
+ **Structure**:
161
+ ```markdown
162
+ # Milestone {N}: {Name}
163
+
164
+ **Goal**: One-line objective
165
+ **Duration**: Estimated time
166
+ **Dependencies**: Previous milestones
167
+ **Status**: Not Started | In Progress | Completed
168
+
169
+ ---
170
+
171
+ ## Overview
172
+ What this milestone accomplishes
173
+
174
+ ## Deliverables
175
+ - Concrete outputs
176
+ - Measurable results
177
+ - Specific artifacts
178
+
179
+ ## Success Criteria
180
+ - [ ] Criterion 1
181
+ - [ ] Criterion 2
182
+ - [ ] ...
183
+
184
+ ## Key Files to Create
185
+ List of files/directories this milestone produces
186
+
187
+ ---
188
+
189
+ **Next Milestone**: Link to next phase
190
+ **Blockers**: Current obstacles
191
+ ```
192
+
193
+ ### 3. Tasks (`agent/tasks/`)
194
+
195
+ **Purpose**: Break milestones into actionable, verifiable work items.
196
+
197
+ **Structure**:
198
+ ```markdown
199
+ # Task {N}: {Name}
200
+
201
+ **Milestone**: Parent milestone
202
+ **Estimated Time**: Hours/days
203
+ **Dependencies**: Other tasks
204
+ **Status**: Not Started | In Progress | Completed
205
+
206
+ ---
207
+
208
+ ## Objective
209
+ What this task accomplishes
210
+
211
+ ## Steps
212
+ 1. Concrete action 1
213
+ 2. Concrete action 2
214
+ 3. ...
215
+
216
+ ## Verification
217
+ - [ ] Verification step 1
218
+ - [ ] Verification step 2
219
+ - [ ] ...
220
+
221
+ ---
222
+
223
+ **Next Task**: Link to next task
224
+ ```
225
+
226
+ ### 4. Patterns (`agent/patterns/`)
227
+
228
+ **Purpose**: Document reusable architectural and coding patterns.
229
+
230
+ **Structure**:
231
+ ```markdown
232
+ # {Pattern Name}
233
+
234
+ ## Overview
235
+ What this pattern is and when to use it
236
+
237
+ ## Core Principles
238
+ Fundamental concepts
239
+
240
+ ## Implementation
241
+ How to implement this pattern
242
+
243
+ ## Examples
244
+ Code examples and use cases
245
+
246
+ ## Benefits
247
+ Why use this pattern
248
+
249
+ ## Anti-Patterns
250
+ What NOT to do
251
+
252
+ ---
253
+
254
+ **Status**: Current status
255
+ **Recommendation**: When to use this pattern
256
+ ```
257
+
258
+ ### 5. Progress Tracking (`agent/progress.yaml`)
259
+
260
+ **Purpose**: Machine-readable progress tracking and status monitoring.
261
+
262
+ **Structure**:
263
+ ```yaml
264
+ project:
265
+ name: project-name
266
+ version: 0.1.0
267
+ started: YYYY-MM-DD
268
+ status: in_progress | completed
269
+ current_milestone: M1
270
+
271
+ milestones:
272
+ - id: M1
273
+ name: Milestone Name
274
+ status: not_started | in_progress | completed
275
+ progress: 0-100%
276
+ started: YYYY-MM-DD
277
+ completed: YYYY-MM-DD | null
278
+ estimated_weeks: N
279
+ tasks_completed: N
280
+ tasks_total: N
281
+ notes: |
282
+ Progress notes
283
+
284
+ tasks:
285
+ milestone_1:
286
+ - id: task-1
287
+ name: Task Name
288
+ status: not_started | in_progress | completed
289
+ file: agent/tasks/task-1-name.md
290
+ estimated_hours: N
291
+ completed_date: YYYY-MM-DD | null
292
+ notes: |
293
+ Task notes
294
+
295
+ documentation:
296
+ design_documents: N
297
+ milestone_documents: N
298
+ pattern_documents: N
299
+ task_documents: N
300
+
301
+ progress:
302
+ planning: 0-100%
303
+ implementation: 0-100%
304
+ overall: 0-100%
305
+
306
+ recent_work:
307
+ - date: YYYY-MM-DD
308
+ description: What was done
309
+ items:
310
+ - ✅ Completed item
311
+ - ⚠️ Warning/note
312
+ - 📋 Pending item
313
+
314
+ next_steps:
315
+ - Next action 1
316
+ - Next action 2
317
+
318
+ notes:
319
+ - Important note 1
320
+ - Important note 2
321
+
322
+ current_blockers:
323
+ - Blocker 1
324
+ - Blocker 2
325
+ ```
326
+
327
+ ---
328
+
329
+ ## How to Use the Agent Pattern
330
+
331
+ ### For Starting a New Project
332
+
333
+ 1. **Create Agent Directory Structure**
334
+ ```bash
335
+ mkdir -p agent/{design,milestones,patterns,tasks}
336
+ touch agent/{design,milestones,patterns,tasks}/.gitkeep
337
+ ```
338
+
339
+ 2. **Write Requirements Document**
340
+ - Create `agent/design/requirements.md`
341
+ - Document core requirements, constraints, and goals
342
+ - Define success criteria
343
+
344
+ 3. **Define Milestones**
345
+ - Break project into 5-10 major phases
346
+ - Each milestone should be 1-3 weeks of work
347
+ - Clear deliverables and success criteria
348
+
349
+ 4. **Create Initial Tasks**
350
+ - Break first milestone into concrete tasks
351
+ - Each task should be 1-4 hours of work
352
+ - Include verification steps
353
+
354
+ 5. **Initialize Progress Tracking**
355
+ - Create `agent/progress.yaml`
356
+ - Set up milestone and task tracking
357
+ - Document initial status
358
+
359
+ 6. **Document Patterns**
360
+ - Create `agent/patterns/bootstrap.md` with setup instructions
361
+ - Document architectural decisions as patterns
362
+ - Include code examples
363
+
364
+ ### For Continuing an Existing Project
365
+
366
+ 1. **Read Progress File**
367
+ - Understand current status
368
+ - Identify current milestone
369
+ - Find next tasks
370
+
371
+ 2. **Review Design Documents**
372
+ - Read relevant design docs in `agent/design/`
373
+ - Understand architectural decisions
374
+ - Check for constraints and patterns
375
+
376
+ 3. **Check Current Milestone**
377
+ - Read milestone document
378
+ - Review success criteria
379
+ - Understand deliverables
380
+
381
+ 4. **Find Next Task**
382
+ - Look at current milestone's tasks
383
+ - Find first incomplete task
384
+ - Read task document
385
+
386
+ 5. **Execute Task**
387
+ - Follow task steps
388
+ - Verify completion
389
+ - Update progress.yaml
390
+
391
+ 6. **Document Changes**
392
+ - Update progress.yaml
393
+ - Add notes about work completed
394
+ - Document any new patterns or decisions
395
+
396
+ ### For Adding New Features
397
+
398
+ 1. **Create Design Document**
399
+ - Document in `agent/design/{feature}-design.md`
400
+ - Include problem, solution, implementation
401
+ - Get approval before proceeding
402
+
403
+ 2. **Update Milestones**
404
+ - Add new milestone or extend existing
405
+ - Update progress.yaml
406
+
407
+ 3. **Create Tasks**
408
+ - Break feature into tasks
409
+ - Add to appropriate milestone
410
+ - Include verification steps
411
+
412
+ 4. **Document Patterns**
413
+ - If feature introduces new patterns, document them
414
+ - Update existing patterns if needed
415
+
416
+ ---
417
+
418
+ ## Pattern Significance & Impact
419
+
420
+ ### Significance
421
+
422
+ The Agent Pattern represents a **paradigm shift** in how we approach AI-assisted development:
423
+
424
+ 1. **Knowledge as Code**: Documentation is treated with the same rigor as source code
425
+ 2. **Agent-First Design**: Projects are designed to be understandable by AI agents
426
+ 3. **Explicit Over Implicit**: All knowledge is externalized and documented
427
+ 4. **Systematic Development**: Complex projects become manageable through structure
428
+ 5. **Quality by Design**: Standards and patterns are enforced through documentation
429
+
430
+ ### Impact
431
+
432
+ **On Development Speed**:
433
+ - ✅ 50-70% faster onboarding for new agents
434
+ - ✅ Reduced context-gathering time
435
+ - ✅ Fewer architectural mistakes
436
+ - ✅ Less rework due to clear specifications
437
+
438
+ **On Code Quality**:
439
+ - ✅ Consistent patterns across codebase
440
+ - ✅ Better architectural decisions (documented rationale)
441
+ - ✅ Fewer bugs (clear verification steps)
442
+ - ✅ More maintainable code (patterns documented)
443
+
444
+ **On Project Management**:
445
+ - ✅ Clear progress visibility
446
+ - ✅ Accurate time estimates
447
+ - ✅ Better scope management
448
+ - ✅ Easier to parallelize work
449
+
450
+ **On Team Collaboration**:
451
+ - ✅ Shared understanding of architecture
452
+ - ✅ Consistent coding standards
453
+ - ✅ Better knowledge transfer
454
+ - ✅ Reduced communication overhead
455
+
456
+ ---
457
+
458
+ ## Problems This Pattern Solves
459
+
460
+ ### 1. **Context Loss Between Agent Sessions**
461
+
462
+ **Problem**: Agents have no memory between sessions. Each new session starts from scratch.
463
+
464
+ **Solution**: The agent directory provides complete context:
465
+ - `progress.yaml` shows current status
466
+ - Design docs explain architectural decisions
467
+ - Patterns document coding standards
468
+ - Tasks provide next steps
469
+
470
+ **Example**: An agent can read `progress.yaml`, see that task-3 is next, read the task document, and continue work immediately.
471
+
472
+ ### 2. **Implicit Knowledge**
473
+
474
+ **Problem**: Design decisions exist only in developers' heads or scattered across chat logs.
475
+
476
+ **Solution**: All decisions are documented in design documents with rationale:
477
+ - Why this approach was chosen
478
+ - What alternatives were considered
479
+ - What trade-offs were made
480
+
481
+ **Example**: A design document might explain why discriminated unions are better than exceptions for access control, with code examples and trade-off analysis.
482
+
483
+ ### 3. **Inconsistent Patterns**
484
+
485
+ **Problem**: Different parts of codebase use different patterns for the same problems.
486
+
487
+ **Solution**: Patterns directory provides single source of truth:
488
+ - Architectural patterns documented
489
+ - Code examples provided
490
+ - Anti-patterns identified
491
+
492
+ **Example**: A pattern document might specify that all data access must go through service layers, with implementation examples and anti-patterns.
493
+
494
+ ### 4. **Scope Creep**
495
+
496
+ **Problem**: Projects expand without clear boundaries, leading to never-ending development.
497
+
498
+ **Solution**: Milestones and tasks provide clear scope:
499
+ - Each milestone has specific deliverables
500
+ - Tasks are granular and verifiable
501
+ - Progress is tracked objectively
502
+
503
+ **Example**: Milestone 1 has exactly 7 tasks. When those are done, the milestone is complete.
504
+
505
+ ### 5. **Quality Drift**
506
+
507
+ **Problem**: Code quality degrades over time as standards are forgotten or ignored.
508
+
509
+ **Solution**: Patterns and verification steps maintain quality:
510
+ - Every task has verification checklist
511
+ - Patterns document best practices
512
+ - Design docs explain quality requirements
513
+
514
+ **Example**: Each task includes verification steps like "TypeScript compiles without errors" and "All tests pass".
515
+
516
+ ### 6. **Onboarding Friction**
517
+
518
+ **Problem**: New contributors (agents or humans) need weeks to understand the project.
519
+
520
+ **Solution**: Self-documenting structure enables rapid onboarding:
521
+ - Start with `progress.yaml` for status
522
+ - Read `requirements.md` for context
523
+ - Review patterns for coding standards
524
+ - Pick up next task and start working
525
+
526
+ **Example**: A new agent can become productive in minutes instead of days.
527
+
528
+ ### 7. **Lost Architectural Decisions**
529
+
530
+ **Problem**: "Why did we do it this way?" becomes unanswerable after a few months.
531
+
532
+ **Solution**: Design documents capture rationale:
533
+ - Problem statement
534
+ - Solution approach
535
+ - Benefits and trade-offs
536
+ - Implementation details
537
+
538
+ **Example**: A design document might explain why certain IDs are reused across databases, with rationale for the decision and implementation details.
539
+
540
+ ### 8. **Unclear Progress**
541
+
542
+ **Problem**: Hard to know how much work is done and what's remaining.
543
+
544
+ **Solution**: `progress.yaml` provides objective metrics:
545
+ - Percentage complete per milestone
546
+ - Tasks completed vs total
547
+ - Recent work logged
548
+ - Next steps identified
549
+
550
+ **Example**: "Milestone 1: 20% complete (1/7 tasks done)"
551
+
552
+ ---
553
+
554
+ ## Sample Prompts for Using ACP
555
+
556
+ ### Initialize Prompt
557
+
558
+ Use this prompt when starting work on an ACP-structured project:
559
+
560
+ ```markdown
561
+ Read ALL files in @agent. We are going to understand this project then work on a generic task.
562
+
563
+ Then read KEY src files per your understanding.
564
+
565
+ Then read @agent again, update stale @agent/tasks, stale documentation, and update 'agent/progress.yaml'.
566
+ ```
567
+
568
+ **Purpose**:
569
+ - Loads complete project context from agent directory
570
+ - Reviews source code to understand current implementation
571
+ - Updates documentation to reflect current state
572
+ - Ensures progress tracking is accurate
573
+
574
+ ### Proceed Prompt
575
+
576
+ Use this prompt to continue with the next task:
577
+
578
+ ```markdown
579
+ Let's proceed with implementing the current or next task. Remember to update @agent/progress.yaml as you progress.
580
+ ```
581
+
582
+ **Purpose**:
583
+ - Continues work on current or next task
584
+ - Reminds agent to maintain progress tracking
585
+ - Keeps workflow focused and documented
586
+
587
+ ---
588
+
589
+ ## Instructions for Future Agents
590
+
591
+ ### When You First Encounter ACP
592
+
593
+ 1. **Read progress.yaml**
594
+ - This tells you where the project is
595
+ - What milestone is current
596
+ - What task is next
597
+
598
+ 2. **Read requirements.md**
599
+ - Understand project goals
600
+ - Learn constraints
601
+ - Know success criteria
602
+
603
+ 3. **Review current milestone**
604
+ - Understand current phase
605
+ - Know deliverables
606
+ - Check success criteria
607
+
608
+ 4. **Read next task**
609
+ - Understand what to do
610
+ - Follow steps
611
+ - Verify completion
612
+
613
+ 5. **Check relevant patterns**
614
+ - Learn coding standards
615
+ - Understand architectural patterns
616
+ - Follow best practices
617
+
618
+ ### When Working on a Task
619
+
620
+ 1. **Read the task document completely**
621
+ - Understand objective
622
+ - Review all steps
623
+ - Note verification criteria
624
+
625
+ 2. **Check related design documents**
626
+ - Look for design docs mentioned in task
627
+ - Understand architectural context
628
+ - Follow specified patterns
629
+
630
+ 3. **Execute task steps**
631
+ - Follow steps in order
632
+ - Don't skip steps
633
+ - Document any deviations
634
+
635
+ 4. **Verify completion**
636
+ - Check all verification items
637
+ - Run tests
638
+ - Ensure quality standards met
639
+
640
+ 5. **Update progress.yaml**
641
+ - Mark task as completed
642
+ - Add completion date
643
+ - Update milestone progress
644
+ - Add notes about work done
645
+
646
+ ### When Creating New Features
647
+
648
+ 1. **Create design document first**
649
+ - Document problem and solution
650
+ - Include implementation details
651
+ - Get approval before coding
652
+
653
+ 2. **Update or create milestone**
654
+ - Add to existing milestone if fits
655
+ - Create new milestone if major feature
656
+ - Update progress.yaml
657
+
658
+ 3. **Break into tasks**
659
+ - Create task documents
660
+ - Each task 1-4 hours
661
+ - Include verification steps
662
+
663
+ 4. **Document patterns**
664
+ - If introducing new patterns, document them
665
+ - Update existing patterns if needed
666
+ - Include code examples
667
+
668
+ 5. **Implement and verify**
669
+ - Follow task steps
670
+ - Verify each task
671
+ - Update progress tracking
672
+
673
+ ### When You Encounter Problems
674
+
675
+ 1. **Check design documents**
676
+ - Look for relevant design decisions
677
+ - Understand constraints
678
+ - Follow established patterns
679
+
680
+ 2. **Review patterns**
681
+ - Check if pattern exists for this problem
682
+ - Follow pattern guidelines
683
+ - Don't reinvent solutions
684
+
685
+ 3. **Document new solutions**
686
+ - If you solve a new problem, document it
687
+ - Create design document
688
+ - Add to patterns if reusable
689
+
690
+ 4. **Update progress.yaml**
691
+ - Add blocker if stuck
692
+ - Document workarounds
693
+ - Note any deviations from plan
694
+
695
+ ### Best Practices for Agents
696
+
697
+ 1. **Always read before writing**
698
+ - Understand context first
699
+ - Check existing patterns
700
+ - Follow established conventions
701
+
702
+ 2. **Document as you go**
703
+ - Update progress.yaml frequently
704
+ - Add notes about decisions
705
+ - Document new patterns
706
+
707
+ 3. **Verify everything**
708
+ - Check all verification steps
709
+ - Run tests
710
+ - Ensure quality standards
711
+
712
+ 4. **Be explicit**
713
+ - Don't assume future agents will know context
714
+ - Document rationale for decisions
715
+ - Include code examples
716
+
717
+ 5. **Keep it organized**
718
+ - Follow directory structure
719
+ - Use consistent naming
720
+ - Link related documents
721
+
722
+ 6. **Update progress tracking**
723
+ - Mark tasks complete
724
+ - Update percentages
725
+ - Add recent work notes
726
+
727
+ ---
728
+
729
+ ## Best Practices
730
+
731
+ ### Documentation
732
+
733
+ 1. **Write for agents, not humans**
734
+ - Be explicit, not implicit
735
+ - Include code examples
736
+ - Document rationale, not just decisions
737
+
738
+ 2. **Keep documents focused**
739
+ - One topic per document
740
+ - Clear structure
741
+ - Scannable headings
742
+
743
+ 3. **Link related documents**
744
+ - Reference other docs
745
+ - Create knowledge graph
746
+ - Make navigation easy
747
+
748
+ 4. **Update as you go**
749
+ - Don't wait until end
750
+ - Document decisions when made
751
+ - Keep progress.yaml current
752
+
753
+ ### Organization
754
+
755
+ 1. **Follow naming conventions**
756
+ - `{feature}-design.md` for designs
757
+ - `milestone-{N}-{name}.md` for milestones
758
+ - `task-{N}-{name}.md` for tasks
759
+ - `{pattern-name}.md` for patterns
760
+
761
+ 2. **Use consistent structure**
762
+ - Same sections in similar documents
763
+ - Standard YAML format
764
+ - Predictable organization
765
+
766
+ 3. **Keep it DRY**
767
+ - Don't duplicate information
768
+ - Link to canonical source
769
+ - Update in one place
770
+
771
+ ### Progress Tracking
772
+
773
+ 1. **Update frequently**
774
+ - After each task
775
+ - When blockers arise
776
+ - When plans change
777
+
778
+ 2. **Be objective**
779
+ - Use measurable metrics
780
+ - Track actual vs estimated
781
+ - Document deviations
782
+
783
+ 3. **Look forward and back**
784
+ - Document recent work
785
+ - List next steps
786
+ - Note blockers
787
+
788
+ ### Quality
789
+
790
+ 1. **Include verification steps**
791
+ - Every task has checklist
792
+ - Objective criteria
793
+ - Automated where possible
794
+
795
+ 2. **Document patterns**
796
+ - Capture reusable solutions
797
+ - Include anti-patterns
798
+ - Provide examples
799
+
800
+ 3. **Review and refine**
801
+ - Update docs as understanding improves
802
+ - Fix errors immediately
803
+ - Keep docs accurate
804
+
805
+ ---
806
+
807
+ ## Conclusion
808
+
809
+ 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.
810
+
811
+ **Key Takeaways**:
812
+
813
+ 1. **Documentation is Infrastructure** - Treat it with the same care as code
814
+ 2. **Explicit Over Implicit** - Document everything that matters
815
+ 3. **Structure Enables Scale** - Organization makes complexity manageable
816
+ 4. **Agents Need Context** - Provide complete, accessible context
817
+ 5. **Progress is Measurable** - Track objectively with YAML
818
+ 6. **Patterns Ensure Quality** - Document and follow best practices
819
+ 7. **Knowledge Persists** - No more lost tribal knowledge
820
+
821
+ **When to Use This Pattern**:
822
+ - ✅ Complex projects (>1 month)
823
+ - ✅ Multiple contributors (agents or humans)
824
+ - ✅ Long-term maintenance required
825
+ - ✅ Quality and consistency critical
826
+ - ✅ Knowledge preservation important
827
+
828
+ **When NOT to Use**:
829
+ - ❌ Trivial scripts (<100 lines)
830
+ - ❌ One-off prototypes
831
+ - ❌ Throwaway code
832
+ - ❌ Simple, well-understood problems
833
+
834
+ ---
835
+
836
+ **The Agent Pattern is not just documentation—it's a development methodology that makes complex software projects tractable for AI agents.**
837
+
838
+ ---
839
+
840
+ *For questions or improvements to this pattern, please contribute to the repository or create an issue.*