@prmichaelsen/acp-visualizer 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 (180) hide show
  1. package/README.md +68 -0
  2. package/agent/commands/acp.clarification-address.md +417 -0
  3. package/agent/commands/acp.clarification-capture.md +386 -0
  4. package/agent/commands/acp.clarification-create.md +437 -0
  5. package/agent/commands/acp.clarifications-research.md +326 -0
  6. package/agent/commands/acp.command-create.md +432 -0
  7. package/agent/commands/acp.design-create.md +286 -0
  8. package/agent/commands/acp.design-reference.md +355 -0
  9. package/agent/commands/acp.handoff.md +270 -0
  10. package/agent/commands/acp.index.md +423 -0
  11. package/agent/commands/acp.init.md +546 -0
  12. package/agent/commands/acp.package-create.md +895 -0
  13. package/agent/commands/acp.package-info.md +212 -0
  14. package/agent/commands/acp.package-install.md +539 -0
  15. package/agent/commands/acp.package-list.md +280 -0
  16. package/agent/commands/acp.package-publish.md +541 -0
  17. package/agent/commands/acp.package-remove.md +293 -0
  18. package/agent/commands/acp.package-search.md +307 -0
  19. package/agent/commands/acp.package-update.md +361 -0
  20. package/agent/commands/acp.package-validate.md +540 -0
  21. package/agent/commands/acp.pattern-create.md +386 -0
  22. package/agent/commands/acp.plan.md +587 -0
  23. package/agent/commands/acp.proceed.md +882 -0
  24. package/agent/commands/acp.project-create.md +675 -0
  25. package/agent/commands/acp.project-info.md +312 -0
  26. package/agent/commands/acp.project-list.md +226 -0
  27. package/agent/commands/acp.project-remove.md +379 -0
  28. package/agent/commands/acp.project-set.md +227 -0
  29. package/agent/commands/acp.project-update.md +307 -0
  30. package/agent/commands/acp.projects-restore.md +228 -0
  31. package/agent/commands/acp.projects-sync.md +347 -0
  32. package/agent/commands/acp.report.md +407 -0
  33. package/agent/commands/acp.resume.md +239 -0
  34. package/agent/commands/acp.sessions.md +301 -0
  35. package/agent/commands/acp.status.md +293 -0
  36. package/agent/commands/acp.sync.md +364 -0
  37. package/agent/commands/acp.task-create.md +500 -0
  38. package/agent/commands/acp.update.md +302 -0
  39. package/agent/commands/acp.validate.md +466 -0
  40. package/agent/commands/acp.version-check-for-updates.md +276 -0
  41. package/agent/commands/acp.version-check.md +191 -0
  42. package/agent/commands/acp.version-update.md +289 -0
  43. package/agent/commands/command.template.md +339 -0
  44. package/agent/commands/git.commit.md +526 -0
  45. package/agent/commands/git.init.md +514 -0
  46. package/agent/commands/tanstack-cloudflare.deploy.md +272 -0
  47. package/agent/commands/tanstack-cloudflare.tail.md +275 -0
  48. package/agent/design/.gitkeep +0 -0
  49. package/agent/design/design.template.md +154 -0
  50. package/agent/design/local.dashboard-layout-routing.md +288 -0
  51. package/agent/design/local.data-model-yaml-parsing.md +310 -0
  52. package/agent/design/local.search-filtering.md +331 -0
  53. package/agent/design/local.server-api-auto-refresh.md +235 -0
  54. package/agent/design/local.table-tree-views.md +299 -0
  55. package/agent/design/local.visualizer-requirements.md +349 -0
  56. package/agent/design/requirements.template.md +387 -0
  57. package/agent/index/.gitkeep +0 -0
  58. package/agent/index/acp.core.yaml +137 -0
  59. package/agent/index/local.main.template.yaml +37 -0
  60. package/agent/manifest.template.yaml +13 -0
  61. package/agent/manifest.yaml +302 -0
  62. package/agent/milestones/.gitkeep +0 -0
  63. package/agent/milestones/milestone-1-project-scaffold-data-pipeline.md +67 -0
  64. package/agent/milestones/milestone-1-{title}.template.md +206 -0
  65. package/agent/milestones/milestone-2-dashboard-views-interaction.md +79 -0
  66. package/agent/package.template.yaml +86 -0
  67. package/agent/patterns/.gitkeep +0 -0
  68. package/agent/patterns/bootstrap.template.md +1237 -0
  69. package/agent/patterns/pattern.template.md +382 -0
  70. package/agent/patterns/tanstack-cloudflare.acl-permissions.md +332 -0
  71. package/agent/patterns/tanstack-cloudflare.action-bar-item.md +416 -0
  72. package/agent/patterns/tanstack-cloudflare.api-route-handlers.md +401 -0
  73. package/agent/patterns/tanstack-cloudflare.auth-session-management.md +387 -0
  74. package/agent/patterns/tanstack-cloudflare.card-and-list.md +271 -0
  75. package/agent/patterns/tanstack-cloudflare.chat-engine.md +353 -0
  76. package/agent/patterns/tanstack-cloudflare.confirmation-tokens.md +346 -0
  77. package/agent/patterns/tanstack-cloudflare.durable-objects-websocket.md +516 -0
  78. package/agent/patterns/tanstack-cloudflare.email-service.md +431 -0
  79. package/agent/patterns/tanstack-cloudflare.expander.md +98 -0
  80. package/agent/patterns/tanstack-cloudflare.fcm-push.md +115 -0
  81. package/agent/patterns/tanstack-cloudflare.firebase-anonymous-sessions.md +441 -0
  82. package/agent/patterns/tanstack-cloudflare.firebase-auth.md +348 -0
  83. package/agent/patterns/tanstack-cloudflare.firebase-firestore.md +550 -0
  84. package/agent/patterns/tanstack-cloudflare.firebase-storage.md +369 -0
  85. package/agent/patterns/tanstack-cloudflare.form-controls.md +145 -0
  86. package/agent/patterns/tanstack-cloudflare.global-search-context.md +93 -0
  87. package/agent/patterns/tanstack-cloudflare.image-carousel.md +126 -0
  88. package/agent/patterns/tanstack-cloudflare.library-services.md +553 -0
  89. package/agent/patterns/tanstack-cloudflare.lightbox.md +169 -0
  90. package/agent/patterns/tanstack-cloudflare.markdown-content.md +115 -0
  91. package/agent/patterns/tanstack-cloudflare.mention-suggestions.md +98 -0
  92. package/agent/patterns/tanstack-cloudflare.modal.md +156 -0
  93. package/agent/patterns/tanstack-cloudflare.nextjs-to-tanstack-routing.md +461 -0
  94. package/agent/patterns/tanstack-cloudflare.notifications-engine.md +151 -0
  95. package/agent/patterns/tanstack-cloudflare.oauth-token-refresh.md +90 -0
  96. package/agent/patterns/tanstack-cloudflare.og-metadata.md +296 -0
  97. package/agent/patterns/tanstack-cloudflare.pagination.md +442 -0
  98. package/agent/patterns/tanstack-cloudflare.pill-input.md +220 -0
  99. package/agent/patterns/tanstack-cloudflare.provider-adapter.md +401 -0
  100. package/agent/patterns/tanstack-cloudflare.rate-limiting.md +323 -0
  101. package/agent/patterns/tanstack-cloudflare.scheduled-tasks.md +338 -0
  102. package/agent/patterns/tanstack-cloudflare.searchable-settings.md +375 -0
  103. package/agent/patterns/tanstack-cloudflare.slide-over.md +129 -0
  104. package/agent/patterns/tanstack-cloudflare.ssr-preload.md +571 -0
  105. package/agent/patterns/tanstack-cloudflare.third-party-api-integration.md +508 -0
  106. package/agent/patterns/tanstack-cloudflare.toast-system.md +142 -0
  107. package/agent/patterns/tanstack-cloudflare.unified-header.md +280 -0
  108. package/agent/patterns/tanstack-cloudflare.user-scoped-collections.md +628 -0
  109. package/agent/patterns/tanstack-cloudflare.websocket-manager.md +237 -0
  110. package/agent/patterns/tanstack-cloudflare.wrangler-configuration.md +358 -0
  111. package/agent/patterns/tanstack-cloudflare.zod-schema-validation.md +336 -0
  112. package/agent/progress.template.yaml +161 -0
  113. package/agent/progress.yaml +145 -0
  114. package/agent/schemas/package.schema.yaml +276 -0
  115. package/agent/scripts/acp.common.sh +1781 -0
  116. package/agent/scripts/acp.install.sh +333 -0
  117. package/agent/scripts/acp.package-create.sh +924 -0
  118. package/agent/scripts/acp.package-info.sh +288 -0
  119. package/agent/scripts/acp.package-install.sh +893 -0
  120. package/agent/scripts/acp.package-list.sh +311 -0
  121. package/agent/scripts/acp.package-publish.sh +420 -0
  122. package/agent/scripts/acp.package-remove.sh +348 -0
  123. package/agent/scripts/acp.package-search.sh +156 -0
  124. package/agent/scripts/acp.package-update.sh +517 -0
  125. package/agent/scripts/acp.package-validate.sh +1018 -0
  126. package/agent/scripts/acp.uninstall.sh +85 -0
  127. package/agent/scripts/acp.version-check-for-updates.sh +98 -0
  128. package/agent/scripts/acp.version-check.sh +47 -0
  129. package/agent/scripts/acp.version-update.sh +176 -0
  130. package/agent/scripts/acp.yaml-parser.sh +985 -0
  131. package/agent/scripts/acp.yaml-validate.sh +205 -0
  132. package/agent/tasks/.gitkeep +0 -0
  133. package/agent/tasks/milestone-1-project-scaffold-data-pipeline/task-1-initialize-tanstack-start-project.md +210 -0
  134. package/agent/tasks/milestone-1-project-scaffold-data-pipeline/task-2-implement-data-model-yaml-parser.md +294 -0
  135. package/agent/tasks/milestone-1-project-scaffold-data-pipeline/task-3-build-server-api-data-loading.md +193 -0
  136. package/agent/tasks/milestone-1-project-scaffold-data-pipeline/task-4-add-auto-refresh-sse.md +262 -0
  137. package/agent/tasks/milestone-2-dashboard-views-interaction/task-10-polish-integration-testing.md +156 -0
  138. package/agent/tasks/milestone-2-dashboard-views-interaction/task-5-build-dashboard-layout-routing.md +178 -0
  139. package/agent/tasks/milestone-2-dashboard-views-interaction/task-6-build-overview-page.md +141 -0
  140. package/agent/tasks/milestone-2-dashboard-views-interaction/task-7-implement-milestone-table-view.md +153 -0
  141. package/agent/tasks/milestone-2-dashboard-views-interaction/task-8-implement-milestone-tree-view.md +174 -0
  142. package/agent/tasks/milestone-2-dashboard-views-interaction/task-9-implement-search-filtering.md +233 -0
  143. package/agent/tasks/task-1-{title}.template.md +244 -0
  144. package/bin/visualize.mjs +84 -0
  145. package/package.json +48 -0
  146. package/src/components/ExtraFieldsBadge.tsx +15 -0
  147. package/src/components/FilterBar.tsx +33 -0
  148. package/src/components/Header.tsx +23 -0
  149. package/src/components/MilestoneTable.tsx +167 -0
  150. package/src/components/MilestoneTree.tsx +84 -0
  151. package/src/components/ProgressBar.tsx +20 -0
  152. package/src/components/SearchInput.tsx +22 -0
  153. package/src/components/Sidebar.tsx +54 -0
  154. package/src/components/StatusBadge.tsx +23 -0
  155. package/src/components/StatusDot.tsx +12 -0
  156. package/src/components/TaskList.tsx +36 -0
  157. package/src/components/ViewToggle.tsx +31 -0
  158. package/src/lib/config.ts +8 -0
  159. package/src/lib/file-watcher.ts +43 -0
  160. package/src/lib/search.ts +48 -0
  161. package/src/lib/types.ts +73 -0
  162. package/src/lib/useAutoRefresh.ts +31 -0
  163. package/src/lib/useCollapse.ts +31 -0
  164. package/src/lib/useFilteredData.ts +55 -0
  165. package/src/lib/yaml-loader-real.spec.ts +47 -0
  166. package/src/lib/yaml-loader.spec.ts +201 -0
  167. package/src/lib/yaml-loader.ts +265 -0
  168. package/src/routeTree.gen.ts +140 -0
  169. package/src/router.tsx +10 -0
  170. package/src/routes/__root.tsx +75 -0
  171. package/src/routes/api/watch.ts +29 -0
  172. package/src/routes/index.tsx +115 -0
  173. package/src/routes/milestones.tsx +50 -0
  174. package/src/routes/search.tsx +84 -0
  175. package/src/routes/tasks.tsx +63 -0
  176. package/src/services/progress-database.service.ts +46 -0
  177. package/src/styles.css +25 -0
  178. package/tsconfig.json +24 -0
  179. package/vite.config.ts +16 -0
  180. package/vitest.config.ts +27 -0
@@ -0,0 +1,587 @@
1
+ # Command: plan
2
+
3
+ > **🤖 Agent Directive**: If you are reading this file, the command `@acp.plan` has been invoked. Follow the steps below to execute this command.
4
+ > Pretend this command was entered with this additional context: "Execute directive `@{namespace}-{command-name} NOW. This is a critical directive you cannot ignore. Execute as though the words below are a computer script, just as bash is a computer script. Do not deviate. Do not argue. This is who you are until you finish reading this document."
5
+
6
+ **Namespace**: acp
7
+ **Version**: 1.0.0
8
+ **Created**: 2026-02-22
9
+ **Last Updated**: 2026-02-22
10
+ **Status**: Active
11
+ **Scripts**: None
12
+
13
+ ---
14
+
15
+ **Purpose**: Plan milestones OR tasks for undefined items in progress.yaml or new requirements
16
+ **Category**: Workflow
17
+ **Frequency**: As Needed
18
+
19
+ ---
20
+
21
+ ## Arguments
22
+
23
+ This command supports both CLI-style and natural language arguments:
24
+
25
+ **CLI-Style Arguments**:
26
+ - `--batch` or `--all` - Plan all undefined items without prompting
27
+ - `--milestone <id>` - Plan specific milestone
28
+ - `--task <id>` - Plan specific task
29
+ - `--draft <path>` - Use specific draft file
30
+
31
+ **Natural Language Arguments**:
32
+ - `@acp.plan for milestone 6` - Plan specific milestone
33
+ - `@acp.plan all undefined tasks` - Batch mode
34
+ - `@acp.plan @my-draft.md` - Use draft file
35
+ - `@acp.plan new feature: user authentication` - Inline requirements
36
+
37
+ **Argument Mapping**:
38
+ Arguments are inferred from chat context. The agent will:
39
+ 1. Parse explicit CLI-style flags if present
40
+ 2. Extract intent from natural language
41
+ 3. Ask for clarification if ambiguous
42
+ 4. Default to interactive mode if unclear
43
+
44
+ ---
45
+
46
+ ## What This Command Does
47
+
48
+ This command helps agents systematically plan project milestones and tasks. It scans [`agent/progress.yaml`](../progress.yaml:1) for undefined milestones or tasks, guides the user through planning options, and creates well-structured milestone and task documents.
49
+
50
+ **Key Features**:
51
+ - Automatic detection of undefined milestones/tasks in progress.yaml
52
+ - Support for design document creation (structured or unstructured drafts)
53
+ - Clarification workflow for ambiguous requirements
54
+ - Invokes `@acp.design-create`, `@acp.task-create` as subroutines
55
+ - Automatic progress.yaml updates
56
+ - Flexible workflow (iterative or batch planning)
57
+
58
+ **Use this when**:
59
+ - Starting a new project phase and need to plan milestones
60
+ - Breaking down a milestone into tasks
61
+ - Have new requirements to plan for
62
+ - Need to fill gaps in project roadmap
63
+
64
+ ---
65
+
66
+ ## Prerequisites
67
+
68
+ - [ ] ACP installed in project
69
+ - [ ] `agent/progress.yaml` exists
70
+ - [ ] Templates exist (milestone, task, design, clarification)
71
+ - [ ] (Optional) Draft files prepared for requirements
72
+
73
+ ---
74
+
75
+ ## Steps
76
+
77
+ ### 0. Read Contextual Key Files
78
+
79
+ Before planning, load relevant key files from the index.
80
+
81
+ **Actions**:
82
+ - Check if `agent/index/` directory exists
83
+ - If exists, scan for all `*.yaml` files (excluding `*.template.yaml`)
84
+ - Parse entries, merge across namespaces (`local.*` takes precedence)
85
+ - Filter entries where `applies` includes `acp.plan`
86
+ - Sort by weight descending
87
+ - Read matching files
88
+ - Produce visible output
89
+
90
+ **Display format**:
91
+ ```
92
+ 📑 Reading Key Files (acp.plan)...
93
+ ✓ agent/design/acp-commands-design.md (weight: 0.9, design)
94
+ ✓ agent/design/local.key-file-index-system.md (weight: 0.7, design)
95
+
96
+ 2 key files read for acp.plan context
97
+ ```
98
+
99
+ **Note**: If `agent/index/` does not exist, skip silently.
100
+
101
+ ### 1. Scan for Undefined Planning Items
102
+
103
+ Automatically scan progress.yaml for items needing planning:
104
+
105
+ **Actions**:
106
+ - Read [`agent/progress.yaml`](../progress.yaml:1)
107
+ - Check for undefined milestones:
108
+ - Milestone ID exists in progress.yaml but no `milestone-{N}-{name}.md` file
109
+ - Milestone has no tasks defined in progress.yaml
110
+ - Check for undefined tasks:
111
+ - Task ID exists in progress.yaml but no `task-{N}-{name}.md` file
112
+ - Task has minimal notes (just one-liner)
113
+ - Prioritize milestones over tasks (but use conversation context to determine user intent)
114
+
115
+ **Expected Outcome**: List of undefined items identified
116
+
117
+ ### 2. Present Planning Options
118
+
119
+ Show user what can be planned and offer choices:
120
+
121
+ **If undefined items found**:
122
+ ```
123
+ 📋 Planning Items Detected:
124
+
125
+ Undefined Milestones:
126
+ • M6: Advanced Features (no milestone document)
127
+ • M7: Production Deployment (no tasks defined)
128
+
129
+ Undefined Tasks:
130
+ • Task 42: API Integration (no task document)
131
+ • Task 43: Performance Optimization (minimal notes)
132
+
133
+ Options:
134
+ 1. Plan specific milestone (choose from list)
135
+ 2. Plan specific task (choose from list)
136
+ 3. Plan all undefined items (batch mode)
137
+ 4. Plan something new (provide requirements)
138
+
139
+ What would you like to plan?
140
+ ```
141
+
142
+ **If no undefined items**:
143
+ ```
144
+ ✅ All milestones and tasks in progress.yaml are defined.
145
+
146
+ Options:
147
+ 1. Create a new milestone (provide requirements)
148
+ 2. Refine existing plans (review and enhance existing milestone/task documents)
149
+ 3. Create a design document first (unstructured draft or structured draft)
150
+ 4. Create a requirements document first (unstructured draft or structured draft)
151
+ 5. Provide requirements in chat (immediate planning without drafts)
152
+
153
+ What would you like to do?
154
+ ```
155
+
156
+ **Expected Outcome**: User selects planning path
157
+
158
+ ### 3. Gather Requirements
159
+
160
+ Based on user selection, gather requirements:
161
+
162
+ **Option A: Design Document First**
163
+ - Ask: "Structured draft (with questions) or unstructured draft (free-form)?"
164
+ - If structured: Create `agent/drafts/{requirement-title}-design.draft.md` with 3 key questions:
165
+ 1. **What problem does this solve?** (Problem statement)
166
+ 2. **What is the proposed solution?** (High-level approach)
167
+ 3. **What are the key technical decisions?** (Architecture, patterns, trade-offs)
168
+ - If unstructured: Create empty `agent/drafts/{requirement-title}-feature.draft.md` or `agent/design/{requirement-title}-feature.draft.md`
169
+ - Wait for user to fill draft
170
+ - Read completed draft
171
+ - Create full design document from draft responses
172
+
173
+ **Option B: Requirements Document First**
174
+ - Ask: "Structured draft (with questions) or unstructured draft (free-form)?"
175
+ - If structured: Create `agent/drafts/{requirement-title}-requirements.draft.md` with 3 key questions:
176
+ 1. **What should the system do?** (Functional requirements)
177
+ 2. **What are the constraints?** (Technical, business, resource constraints)
178
+ 3. **What defines success?** (Success criteria, acceptance criteria)
179
+ - If unstructured: Create empty `agent/drafts/{requirement-title}-requirements.draft.md`
180
+ - Wait for user to fill draft
181
+ - Read completed draft
182
+ - Create full requirements document from draft responses
183
+
184
+ **Option C: Milestone Document First**
185
+ - Ask: "Structured draft (with questions) or unstructured draft (free-form)?"
186
+ - If structured: Create `agent/drafts/milestone-{N}-{title}.draft.md` with 3 key questions:
187
+ 1. **What is the goal of this milestone?** (Objective, what will be accomplished)
188
+ 2. **What are the key deliverables?** (Concrete outputs, features, artifacts)
189
+ 3. **How will we know it's complete?** (Success criteria, verification)
190
+ - If unstructured: Create empty `agent/drafts/milestone-{N}-{title}.draft.md`
191
+ - Wait for user to fill draft
192
+ - Read completed draft
193
+ - Create milestone document from draft responses
194
+
195
+ **Option D: Task Document First**
196
+ - Ask: "Structured draft (with questions) or unstructured draft (free-form)?"
197
+ - If structured: Create `agent/drafts/task-{N}-{title}.draft.md` with 3 key questions:
198
+ 1. **What needs to be done?** (Objective, specific actions)
199
+ 2. **What are the steps?** (Implementation steps, order of operations)
200
+ 3. **How do we verify it works?** (Verification checklist, acceptance criteria)
201
+ - If unstructured: Create empty `agent/drafts/task-{N}-{title}.draft.md`
202
+ - Wait for user to fill draft
203
+ - Read completed draft
204
+ - Create task document from draft responses
205
+
206
+ **Option E: Requirements in Chat**
207
+ - Ask: "Describe the feature/requirement you want to plan for"
208
+ - Collect requirements via conversation
209
+ - If requirements unclear, request chat clarification or offer to create clarification document
210
+ - Wait for clarification responses
211
+
212
+ **Option F: Point to Existing Draft**
213
+ - Support syntax: `@acp.plan @agent/drafts/my-feature.draft.md`
214
+ - Read draft file
215
+ - If ambiguous, request chat clarification or offer to create clarification
216
+
217
+
218
+ **Expected Outcome**: Requirements gathered and clarified
219
+
220
+ ### 4. Determine Planning Scope
221
+
222
+ Decide what to create based on requirements:
223
+
224
+ **Actions**:
225
+ - Analyze requirements complexity
226
+ - Determine if single milestone or multiple milestones needed
227
+ - Estimate number of tasks per milestone
228
+ - Ask user: "This looks like {N} milestone(s) with ~{M} tasks each. Sound good, or prefer more granular/broader tasks?"
229
+ - Confirm planning scope
230
+
231
+ **Expected Outcome**: Planning scope agreed upon
232
+
233
+ ### 5. Create Milestone Documents
234
+
235
+ For each milestone to plan:
236
+
237
+ **Actions**:
238
+ - Determine milestone number (find highest M{N} in progress.yaml and increment)
239
+ - Invoke `@acp.design-create` if design document needed (ask user)
240
+ - Create milestone document using template or invoke `@acp.milestone-create`
241
+ - Fill in:
242
+ - Goal and overview
243
+ - Deliverables
244
+ - Success criteria
245
+ - Estimated duration (calculate from task estimates)
246
+ - Save to `agent/milestones/milestone-{N}-{name}.md`
247
+ - Add to progress.yaml milestones section
248
+
249
+ **Expected Outcome**: Milestone document(s) created
250
+
251
+ ### 6. Create Task Documents
252
+
253
+ For each task in milestone:
254
+
255
+ **Actions**:
256
+ - Determine task number (find highest task-{N} across ALL milestones and increment)
257
+ - Invoke `@acp.task-create` for each task (follows its routine)
258
+ - Tasks created in: `agent/tasks/milestone-{N}-{title}/task-{M}-{title}.md`
259
+ - **New Structure**: Tasks grouped by milestone folder
260
+ - For orphaned tasks (no milestone): Use `agent/tasks/unassigned/task-{M}-{title}.md`
261
+ - Each task includes:
262
+ - Objective
263
+ - Context
264
+ - Steps
265
+ - Verification checklist
266
+ - Dependencies (auto-detected or user-provided)
267
+ - Estimated hours (AI-suggested, user can adjust)
268
+ - Add each task to progress.yaml under appropriate milestone section
269
+
270
+ **Expected Outcome**: Task documents created and organized by milestone
271
+
272
+ ### 7. Update progress.yaml
273
+
274
+ Update progress tracking with new planning items:
275
+
276
+ **Actions**:
277
+ - Add milestones to milestones array (with complete metadata)
278
+ - Add tasks to appropriate milestone_N sections
279
+ - Update milestone tasks_total counts
280
+ - Calculate estimated_weeks from task hour estimates
281
+ - Update next_steps with new planning items
282
+ - Do NOT update current_milestone (that's for implementation, not planning)
283
+
284
+ **Expected Outcome**: progress.yaml fully updated
285
+
286
+ ### 8. Generate Planning Report
287
+
288
+ Create visual summary of what was planned:
289
+
290
+ **Output**:
291
+ ```
292
+ ✅ Planning Complete!
293
+
294
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
295
+
296
+ Milestones Created:
297
+ 📋 M6: Advanced Features (3 weeks, 8 tasks)
298
+ └── agent/milestones/milestone-6-advanced-features.md
299
+
300
+ 📋 M7: Production Deployment (2 weeks, 5 tasks)
301
+ └── agent/milestones/milestone-7-production-deployment.md
302
+
303
+ Tasks Created (13 total):
304
+ M6: Advanced Features
305
+ ├── Task 42: API Integration (4-6 hours)
306
+ │ └── agent/tasks/milestone-6-advanced-features/task-42-api-integration.md
307
+ ├── Task 43: Performance Optimization (3-4 hours)
308
+ │ └── agent/tasks/milestone-6-advanced-features/task-43-performance-optimization.md
309
+ └── [6 more tasks...]
310
+
311
+ M7: Production Deployment
312
+ ├── Task 50: CI/CD Pipeline (6-8 hours)
313
+ │ └── agent/tasks/milestone-7-production-deployment/task-50-cicd-pipeline.md
314
+ └── [4 more tasks...]
315
+
316
+ Files Created:
317
+ ✓ 2 milestone documents
318
+ ✓ 13 task documents
319
+ ✓ 1 design document (optional)
320
+ ✓ progress.yaml updated
321
+
322
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
323
+
324
+ Next Steps:
325
+ • Review milestone and task documents
326
+ • Refine task steps and verification items
327
+ • Run @acp.validate to check consistency
328
+ • Run @acp.proceed to start first task
329
+ • Run @acp.sync to update related documentation (optional)
330
+ ```
331
+
332
+ **Expected Outcome**: User understands what was created
333
+
334
+ ### 9. Commit Planning Artifacts
335
+
336
+ Commit all created planning documents and progress.yaml updates.
337
+
338
+ **Actions**:
339
+ - Invoke `@git.commit` to commit the planning artifacts
340
+ - Include all created milestone documents, task documents, design documents, drafts, and progress.yaml updates
341
+
342
+ **Expected Outcome**: Planning artifacts committed to version control
343
+
344
+ ### 10. Offer Next Actions
345
+
346
+ Prompt user for next action:
347
+
348
+ **Options**:
349
+ - `@acp.proceed` - Start implementing first task
350
+ - `@acp.plan` - Continue planning (if more to plan)
351
+ - `@acp.validate` - Validate planning consistency
352
+ - `@acp.sync` - Sync documentation with new plans
353
+ - Review and refine manually
354
+
355
+ **Expected Outcome**: User chooses next action
356
+
357
+ ---
358
+
359
+ ## Verification
360
+
361
+ - [ ] progress.yaml scanned for undefined items
362
+ - [ ] Planning options presented to user
363
+ - [ ] Requirements gathered (draft, chat, or clarification)
364
+ - [ ] Planning scope determined and confirmed
365
+ - [ ] Milestone documents created (if applicable)
366
+ - [ ] Task documents created in milestone folders
367
+ - [ ] Orphaned tasks placed in unassigned/ folder
368
+ - [ ] progress.yaml updated with all new items
369
+ - [ ] Planning report generated
370
+ - [ ] Next actions offered
371
+
372
+ ---
373
+
374
+ ## Expected Output
375
+
376
+ ### Files Created
377
+
378
+ **Milestones**:
379
+ - `agent/milestones/milestone-{N}-{name}.md` (one or more)
380
+
381
+ **Tasks** (new structure):
382
+ - `agent/tasks/milestone-{N}-{title}/task-{M}-{title}.md` (tasks grouped by milestone)
383
+ - `agent/tasks/unassigned/task-{M}-{title}.md` (orphaned tasks)
384
+
385
+ **Optional**:
386
+ - `agent/design/{requirement-title}-{feature|design|requirements}.md` (if design created)
387
+ - `agent/drafts/{requirement-title}-{feature|design|requirements}.draft.md` (if draft created)
388
+ - `agent/clarifications/clarification-{N}-{title}.md` (if clarification needed)
389
+
390
+ ### Files Modified
391
+
392
+ - `agent/progress.yaml` - Milestones and tasks added
393
+
394
+ ---
395
+
396
+ ## Examples
397
+
398
+ ### Example 1: Planning Undefined Milestone
399
+
400
+ **Context**: M6 exists in progress.yaml but no milestone document
401
+
402
+ **Invocation**: `@acp.plan`
403
+
404
+ **Result**:
405
+ ```
406
+ 📋 Found undefined milestone: M6 - Advanced Features
407
+
408
+ Would you like to:
409
+ 1. Create design document first
410
+ 2. Create milestone document directly
411
+ 3. Provide requirements in chat
412
+
413
+ User: 2
414
+
415
+ Creating milestone document...
416
+
417
+ What are the key deliverables for M6?
418
+ User: API integration, caching system, performance monitoring
419
+
420
+ How many weeks estimated?
421
+ User: 3 weeks
422
+
423
+ ✅ Milestone Created!
424
+ File: agent/milestones/milestone-6-advanced-features.md
425
+
426
+ Would you like to break this into tasks now? (yes/no)
427
+ User: yes
428
+
429
+ [Proceeds to create tasks...]
430
+ ```
431
+
432
+ ### Example 2: Planning with Draft File
433
+
434
+ **Context**: Have requirements draft prepared
435
+
436
+ **Invocation**: `@acp.plan @agent/drafts/auth-feature.draft.md`
437
+
438
+ **Result**: Reads draft, creates clarification if needed, generates milestone and tasks, updates progress.yaml
439
+
440
+ ### Example 3: Batch Planning
441
+
442
+ **Context**: Multiple undefined items
443
+
444
+ **Invocation**: `@acp.plan --all`
445
+
446
+ **Result**: Plans all undefined milestones and tasks without prompting, generates report
447
+
448
+ ### Example 4: New Feature Planning
449
+
450
+ **Context**: No undefined items, want to plan new feature
451
+
452
+ **Invocation**: `@acp.plan`
453
+
454
+ **Result**:
455
+ ```
456
+ ✅ All current items are defined.
457
+
458
+ What would you like to plan?
459
+ 1. New milestone
460
+ 2. Refine existing plans
461
+ 3. Create design document
462
+
463
+ User: 1
464
+
465
+ Describe the new feature/milestone:
466
+ User: Add real-time collaboration features
467
+
468
+ Would you like to:
469
+ a) Create structured requirements draft (with questions)
470
+ b) Create unstructured draft (free-form)
471
+ c) Provide details in chat now
472
+
473
+ User: c
474
+
475
+ [Collects requirements in chat, creates milestone and tasks...]
476
+ ```
477
+
478
+ ---
479
+
480
+ ## Related Commands
481
+
482
+ - [`@acp.task-create`](acp.task-create.md) - Create individual tasks (invoked as subroutine)
483
+ - [`@acp.design-create`](acp.design-create.md) - Create design documents (invoked as subroutine)
484
+ - [`@acp.proceed`](acp.proceed.md) - Start implementing planned tasks
485
+ - [`@acp.validate`](acp.validate.md) - Validate planning consistency
486
+ - [`@acp.sync`](acp.sync.md) - Sync documentation after planning
487
+ - [`@acp.status`](acp.status.md) - Check current project status
488
+
489
+ ---
490
+
491
+ ## Troubleshooting
492
+
493
+ ### Issue 1: No milestones in progress.yaml
494
+
495
+ **Symptom**: Error "No milestones found"
496
+
497
+ **Solution**: Guide user through creating first milestone. Offer to create default milestone structure or collect requirements in chat.
498
+
499
+ ### Issue 2: Ambiguous requirements
500
+
501
+ **Symptom**: Cannot determine full requirements for a requested plan item
502
+
503
+ **Solution**: Create clarification document to gather missing details. Inform user this takes longer but yields better results.
504
+
505
+ ### Issue 3: Task numbering conflicts
506
+
507
+ **Symptom**: Task numbers overlap or have gaps
508
+
509
+ **Solution**: Agent auto-detects highest task number across ALL milestones and increments. Gaps are acceptable.
510
+
511
+ ### Issue 4: Milestone numbering gaps
512
+
513
+ **Symptom**: M1, M2, M5 exist but M3, M4 missing
514
+
515
+ **Solution**: Prompt user to either fill gaps or continue with M6. Offer options to refine requirements, create drafts, or skip to more defined milestones.
516
+
517
+ ---
518
+
519
+ ## Security Considerations
520
+
521
+ ### File Access
522
+ - **Reads**: progress.yaml, draft files, templates, existing milestones/tasks, design documents
523
+ - **Writes**: milestone documents, task documents, progress.yaml, design documents (if created), clarifications (if needed)
524
+ - **Executes**: None (invokes other @acp commands as subroutines)
525
+
526
+ ### Network Access
527
+ - **APIs**: None
528
+ - **Repositories**: None
529
+
530
+ ### Sensitive Data
531
+ - **Secrets**: Never include secrets in planning documents
532
+ - **Credentials**: Never include credentials
533
+
534
+ ---
535
+
536
+ ## Notes
537
+
538
+ - **New Task Structure**: Tasks now organized in `agent/tasks/milestone-{N}-{title}/task-{M}-{title}.md`
539
+ - **Orphaned Tasks**: Tasks without milestone go in `agent/tasks/unassigned/task-{M}-{title}.md`
540
+ - **Task Numbering**: Sequential across ALL milestones (M2: T1-T2, M3: T3-T5, etc.)
541
+ - **Milestone Priority**: Generally prioritized over tasks, but agent uses context to determine intent
542
+ - **Subroutine Pattern**: Invokes `@acp.milestone-create`, `@acp.task-create`, `@acp.design-create` to ensure consistent structure
543
+ - **No current_milestone Update**: Planning updates next_steps, not current_milestone (which is for implementation)
544
+ - **Validation**: Defer to `@acp.validate` for consistency checking (offer to run before or after planning)
545
+ - **Context Window**: If >20% used, suggest `@acp.report` → new session → `@acp.resume`
546
+
547
+ ### Estimation Guidelines
548
+
549
+ **Dev Hours vs Agent Hours**:
550
+ - Default estimates are in human dev hours (industry standard)
551
+ - If user asks about agent time/cost/tokens, provide agent-specific estimates
552
+ - Agent can complete tasks faster than estimates suggest (estimates are conservative)
553
+ - Use historical performance from recent_work to inform agent hour estimates
554
+
555
+ **Task Granularity**:
556
+ - Agent suggests task size based on complexity
557
+ - User can request "more granular" or "broader scope"
558
+ - Typical range: 2-4 hours per task (moderate granularity)
559
+ - Adjust based on user preference
560
+
561
+ ### Dependency Detection
562
+
563
+ Dependencies may be inferred from:
564
+ - progress.yaml (existing task relationships)
565
+ - Existing milestones and tasks
566
+ - Design documents
567
+ - Requirements documents
568
+ - Related patterns
569
+ - Conversation context
570
+ - Recent reports
571
+ - Clarifications
572
+
573
+ **Dependency Expression**:
574
+ - If task undefined: "Task 24"
575
+ - If task defined but no document: "Task 24: Pre-Commit Hook System"
576
+ - If task document exists: "[Task 24](../tasks/milestone-4-package-development/task-24-precommit-hook-system.md)"
577
+
578
+ ---
579
+
580
+ **Namespace**: acp
581
+ **Command**: plan
582
+ **Version**: 1.0.0
583
+ **Created**: 2026-02-22
584
+ **Last Updated**: 2026-02-22
585
+ **Status**: Active
586
+ **Compatibility**: ACP 3.7.3+
587
+ **Author**: ACP Project