@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,355 @@
1
+ # Directive: design-reference
2
+
3
+ > **🤖 Agent Directive**: This is a **SHARED DIRECTIVE**, not a user-invocable command.
4
+ > It is referenced by `@acp.task-create`, `@acp.plan` (via task-create delegation), and `@acp.proceed` to discover and cross-reference design documents, ensuring tasks contain all implementation detail.
5
+ >
6
+ > **Do NOT invoke this directive directly.** It is called internally by commands that need design document context.
7
+ >
8
+ > If you are a command reading this file, follow the steps below to discover relevant design documents, extract actionable elements, and return them to the calling command.
9
+
10
+ **Namespace**: acp
11
+ **Version**: 1.0.0
12
+ **Created**: 2026-03-07
13
+ **Last Updated**: 2026-03-07
14
+ **Status**: Active
15
+ **Scripts**: None
16
+
17
+ ---
18
+
19
+ **Purpose**: Discover and cross-reference design documents to ensure tasks have complete implementation detail
20
+ **Category**: Workflow (Internal Directive)
21
+ **Frequency**: Called by task-create and proceed when design context is needed
22
+
23
+ ---
24
+
25
+ ## Arguments
26
+
27
+ These arguments are passed as context from the calling command. The directive uses them to determine search scope.
28
+
29
+ | Input | Source | Description |
30
+ |---|---|---|
31
+ | `topic_keywords` | Calling command | Keywords extracted from task name, milestone name, or user description |
32
+ | `milestone_name` | Calling command | Current milestone name (optional, improves search accuracy) |
33
+ | `user_description` | Calling command | User's description of the task or feature (optional) |
34
+ | `draft_content` | Calling command | Draft file content if provided (optional) |
35
+
36
+ The directive combines these inputs to form a search query. More inputs produce better matches.
37
+
38
+ ---
39
+
40
+ ## What This Directive Does
41
+
42
+ This directive dynamically discovers design documents relevant to the current task or feature, reads them, extracts all actionable implementation elements, and returns them to the calling command. The calling command uses these elements to generate self-contained tasks or to load supplementary context during implementation.
43
+
44
+ **Key behaviors**:
45
+ - Always searches `agent/design/` — no explicit links or configuration required
46
+ - Uses keyword matching against filenames and content
47
+ - Reads all relevant documents (not just the first match)
48
+ - Extracts 8 categories of actionable elements
49
+ - Flags incomplete or vague design areas
50
+ - Returns structured data to the calling command
51
+ - Read-only — never modifies any files
52
+
53
+ ---
54
+
55
+ ## Prerequisites
56
+
57
+ - [ ] Called from within a command that needs design context (task-create, plan, proceed)
58
+ - [ ] `agent/design/` directory exists
59
+ - [ ] At least one design document exists (non-template)
60
+
61
+ ---
62
+
63
+ ## Steps
64
+
65
+ ### 1. Determine Topic
66
+
67
+ Extract topic keywords from the calling context to form a search query.
68
+
69
+ **Actions**:
70
+ - Collect keywords from all available inputs:
71
+ - **Task name**: e.g., "Create @acp.clarification-capture Directive" → keywords: `clarification`, `capture`, `directive`
72
+ - **Milestone name**: e.g., "Clarification Capture System" → keywords: `clarification`, `capture`, `system`
73
+ - **User description**: Extract nouns and action words
74
+ - **Draft content**: Extract topic-relevant terms from first ~20 lines
75
+ - Deduplicate keywords
76
+ - Combine into a search query (e.g., `clarification capture system directive`)
77
+ - Strip common ACP terms that would match too broadly (`acp`, `command`, `task`, `system`, `implement`, `create`, `update`)
78
+
79
+ **Expected Outcome**: Set of topic keywords for search
80
+
81
+ ### 2. Search for Design Documents
82
+
83
+ Search `agent/design/` for documents matching the topic.
84
+
85
+ **Actions**:
86
+ - List all files in `agent/design/` excluding `*.template.md`
87
+ - For each file, score relevance:
88
+ - **Filename match** (high confidence): Convert filename to keywords (e.g., `local.clarification-capture-system.md` → `clarification`, `capture`, `system`). Count keyword overlaps with topic.
89
+ - **Content match** (medium confidence): If filename match is borderline (1 keyword overlap), read first ~50 lines and check for topic keyword presence in Overview/Problem Statement sections.
90
+ - Classify each file:
91
+ - **Relevant**: 2+ keyword overlaps in filename, or 1 filename + 3+ content overlaps
92
+ - **Not relevant**: 0 keyword overlaps, or only 1 generic overlap
93
+ - **Borderline**: 1 specific keyword overlap — read content to decide
94
+ - Read all relevant documents in full
95
+ - Sort by relevance score (filename matches > content matches)
96
+
97
+ **Expected Outcome**: List of relevant design documents read and scored
98
+
99
+ ### 3. Report Findings
100
+
101
+ Display what was found to the user.
102
+
103
+ **When designs found**:
104
+ ```
105
+ Design Reference: Searching agent/design/...
106
+ Found: local.clarification-capture-system.md (relevant)
107
+ Found: acp-commands-design.md (not relevant, skipped)
108
+ Found: local.key-file-index-system.md (not relevant, skipped)
109
+
110
+ 1 design document loaded for cross-reference
111
+ ```
112
+
113
+ **When no designs found**:
114
+ ```
115
+ Design Reference: No design documents found for topic "{topic keywords}"
116
+ Tasks will be created from available context only.
117
+ ```
118
+
119
+ **Expected Outcome**: User informed of which designs were found/skipped
120
+
121
+ ### 4. Extract Design Elements
122
+
123
+ Parse the relevant design document(s) and extract all actionable elements organized by category.
124
+
125
+ **Actions**:
126
+ - Read each relevant design document section by section
127
+ - Extract elements into these 8 categories:
128
+
129
+ | Category | What to Extract | Where to Look |
130
+ |---|---|---|
131
+ | Implementation steps/flows | Specific sequences of operations, numbered steps, flow diagrams, invocation flows | Solution, Implementation sections |
132
+ | Argument/parameter tables | Inputs, flags, aliases, behaviors — preserve exact table format | Solution, Implementation sections |
133
+ | UX specifications | Warning messages, prompt text, display formats — preserve exact text including code blocks | Implementation section, any "Display format" subsections |
134
+ | Edge cases and error handling | Boundary conditions, failure modes, what-if scenarios | Testing Strategy, Trade-offs, Implementation sections |
135
+ | Format specifications | Output structure, naming conventions, file format rules, template formats | Implementation, Solution sections |
136
+ | Integration points | Connections to other commands/systems, affected commands tables, which files are modified | Implementation section, "Affected Commands" subsections |
137
+ | Lifecycle rules | Status transitions, cleanup behavior, ordering constraints, migration steps | Implementation, Migration Path sections |
138
+ | Decision rationale | Why choices were made, alternatives rejected, trade-offs accepted | Key Design Decisions, Trade-offs, Benefits sections |
139
+
140
+ - For each element, record:
141
+ - The element content (preserve verbatim where possible, especially tables and code blocks)
142
+ - Which design section it came from
143
+ - Which category it belongs to
144
+
145
+ **Expected Outcome**: Complete inventory of design elements organized by category
146
+
147
+ ### 5. Flag Design Gaps
148
+
149
+ If any section of the design document is vague, incomplete, or marked TBD, flag it.
150
+
151
+ **Actions**:
152
+ - Scan for indicators of incompleteness:
153
+ - Sections with only placeholder text or one-liners
154
+ - "TBD", "TODO", "to be determined" markers
155
+ - Empty sections (heading with no content)
156
+ - Vague language without specifics ("appropriate handling", "as needed")
157
+ - If gaps found, display:
158
+
159
+ ```
160
+ Design gaps detected in {filename}:
161
+ - {Section name}: {description of gap}
162
+ - {Section name}: {description of gap}
163
+
164
+ Suggest creating a clarification? (yes/no)
165
+ ```
166
+
167
+ - If user says **yes**: Suggest invoking `@acp.clarification-create` targeting the specific gaps. Halt the directive and let the user address gaps first.
168
+ - If user says **no**: Proceed with available detail. Include a note about gaps in the returned data so the calling command can mention them in the task.
169
+
170
+ **Expected Outcome**: Design gaps identified and user informed; decision made on whether to address them
171
+
172
+ ### 6. Return Elements to Calling Command
173
+
174
+ Pass the extracted data back to the calling command.
175
+
176
+ **Return data**:
177
+ - **design_elements**: List of elements grouped by category (8 categories)
178
+ - **design_gaps**: List of identified gaps (section name + description), or empty if none
179
+ - **design_paths**: Path(s) to the relevant design document(s) found (for the Design Reference metadata field)
180
+ - **design_names**: Human-readable name(s) of the design document(s)
181
+
182
+ **The calling command uses this data to**:
183
+ - **task-create**: Expand task steps with implementation detail from design elements; add verification items for each design requirement; set Design Reference metadata field; carry Key Design Decisions into the task
184
+ - **proceed**: Load design context as supplementary "why" information during implementation; consult when ambiguity or edge cases arise
185
+
186
+ **Expected Outcome**: Calling command receives structured design data for integration
187
+
188
+ ---
189
+
190
+ ## Verification
191
+
192
+ - [ ] Step 1 (Determine Topic) extracts keywords from task name, milestone name, user description, and draft content
193
+ - [ ] Step 1 strips overly common ACP terms to avoid false matches
194
+ - [ ] Step 2 (Search) lists all non-template files in `agent/design/`
195
+ - [ ] Step 2 scores by filename keyword overlap and content keyword overlap
196
+ - [ ] Step 2 reads first ~50 lines for borderline matches
197
+ - [ ] Step 2 reads all relevant documents in full (not just first match)
198
+ - [ ] Step 3 (Report) uses the exact "found"/"not found" display formats specified
199
+ - [ ] Step 4 (Extract) covers all 8 categories with specific extraction guidance per category
200
+ - [ ] Step 4 preserves verbatim content for tables, code blocks, and UX text
201
+ - [ ] Step 5 (Flag Gaps) detects TBD, TODO, placeholder text, empty sections, vague language
202
+ - [ ] Step 5 offers clarification creation for gaps
203
+ - [ ] Step 5 allows user to skip gaps and proceed
204
+ - [ ] Step 6 (Return) returns design_elements, design_gaps, design_paths, design_names
205
+ - [ ] Step 6 documents how each calling command uses the returned data
206
+ - [ ] Directive is read-only (never modifies files)
207
+
208
+ ---
209
+
210
+ ## Expected Output
211
+
212
+ ### Console Output (during execution)
213
+ ```
214
+ Design Reference: Searching agent/design/...
215
+ Found: local.design-reference-system.md (relevant)
216
+ Found: acp-commands-design.md (not relevant, skipped)
217
+
218
+ 1 design document loaded for cross-reference
219
+ Extracted: 15 elements across 6 categories
220
+ Gaps: None detected
221
+ ```
222
+
223
+ ### Data Returned to Calling Command
224
+ ```
225
+ design_elements:
226
+ implementation_steps: [...]
227
+ argument_tables: [...]
228
+ ux_specifications: [...]
229
+ edge_cases: [...]
230
+ format_specifications: [...]
231
+ integration_points: [...]
232
+ lifecycle_rules: [...]
233
+ decision_rationale: [...]
234
+
235
+ design_gaps: []
236
+
237
+ design_paths:
238
+ - agent/design/local.design-reference-system.md
239
+
240
+ design_names:
241
+ - Design Reference System
242
+ ```
243
+
244
+ ---
245
+
246
+ ## Examples
247
+
248
+ ### Example 1: task-create finds relevant design
249
+
250
+ **Context**: User invokes `@acp.task-create` for a task about "clarification capture"
251
+
252
+ **Flow**: Directive searches `agent/design/`, matches `local.clarification-capture-system.md` by filename keywords, reads it, extracts 8-step directive flow + argument table + UX warning format + affected commands table + lifecycle rules. Returns all to task-create. Task is generated with full implementation detail.
253
+
254
+ ### Example 2: No design document exists
255
+
256
+ **Context**: User invokes `@acp.task-create` for a task about "user preferences"
257
+
258
+ **Flow**: Directive searches `agent/design/`, no filenames match "preferences" (M6 has no design doc yet). Reports "No design documents found." Task is created from available context only (user input, draft, clarifications).
259
+
260
+ ### Example 3: Multiple relevant designs
261
+
262
+ **Context**: User invokes `@acp.task-create` for a task about "package validation"
263
+
264
+ **Flow**: Directive finds both `acp-package-management-system.md` and `local.experimental-features-system.md` as relevant. Reads both. Extracts elements from each. Returns combined elements to task-create.
265
+
266
+ ### Example 4: Design has gaps
267
+
268
+ **Context**: User invokes `@acp.task-create` for a feature whose design has a TBD Testing Strategy
269
+
270
+ **Flow**: Directive reads design, extracts elements, flags "Testing Strategy: marked TBD". Asks user whether to create clarification. User says no. Task is created with a note about the gap.
271
+
272
+ ### Example 5: proceed loads design context
273
+
274
+ **Context**: Agent runs `@acp.proceed` on a task with `Design Reference: [Clarification Capture System](../design/local.clarification-capture-system.md)`
275
+
276
+ **Flow**: Proceed reads the linked design document. Uses it as supplementary context during implementation — consulting it when the task step is ambiguous or when an unlisted edge case arises.
277
+
278
+ ---
279
+
280
+ ## Related Commands
281
+
282
+ - [`@acp.clarification-capture`](acp.clarification-capture.md) - Sister shared directive for clarification context capture
283
+ - [`@acp.task-create`](acp.task-create.md) - Calls this directive during task creation (Step 5.5)
284
+ - [`@acp.plan`](acp.plan.md) - Calls this directive via task-create delegation
285
+ - [`@acp.proceed`](acp.proceed.md) - Calls this directive during implementation for design context
286
+ - [`@acp.design-create`](acp.design-create.md) - Creates the design documents this directive discovers
287
+
288
+ ---
289
+
290
+ ## Troubleshooting
291
+
292
+ ### Issue 1: Wrong design document matched
293
+
294
+ **Symptom**: Directive loads an unrelated design document
295
+
296
+ **Cause**: Keyword overlap on generic terms (e.g., "system", "command")
297
+
298
+ **Solution**: Step 1 strips overly common terms. If false matches persist, the user can indicate which design is relevant when the report is displayed.
299
+
300
+ ### Issue 2: Design document not found despite existing
301
+
302
+ **Symptom**: Directive reports "no design documents found" but one exists
303
+
304
+ **Cause**: Filename keywords don't overlap with topic keywords
305
+
306
+ **Solution**: User can provide additional context (mention the design doc name) or use a more specific task/milestone name. The calling command can also pass the design path explicitly if known.
307
+
308
+ ### Issue 3: Too many elements extracted
309
+
310
+ **Symptom**: Returned elements are overwhelming for a single task
311
+
312
+ **Cause**: Design document covers a broad feature with many tasks
313
+
314
+ **Solution**: The calling command (task-create) filters elements by relevance to the specific task being created. Not all elements from the design need to appear in every task — only those relevant to the task's scope.
315
+
316
+ ---
317
+
318
+ ## Security Considerations
319
+
320
+ ### File Access
321
+ - **Reads**: `agent/design/*.md` (non-template), first ~50 lines for borderline matches
322
+ - **Writes**: None (read-only directive)
323
+ - **Executes**: None
324
+
325
+ ### Network Access
326
+ - **APIs**: None
327
+ - **Repositories**: None
328
+
329
+ ### Sensitive Data
330
+ - **Secrets**: Never include secrets in extracted elements
331
+ - **Credentials**: Never include credentials in output
332
+
333
+ ---
334
+
335
+ ## Notes
336
+
337
+ - This directive is modeled after `@acp.clarification-capture` (same shared directive pattern)
338
+ - Discovery is always dynamic — no explicit links or configuration required
339
+ - Multiple design documents can be loaded and cross-referenced
340
+ - The directive is read-only — it never modifies any files
341
+ - Context window cost is mitigated by keyword filtering (only relevant docs loaded, borderline checked via first ~50 lines)
342
+ - The calling command decides how to use the returned elements — the directive just extracts and returns
343
+ - When called by `@acp.proceed`, the design context is supplementary (task is primary)
344
+ - When called by `@acp.task-create`, the design elements are mandatory inputs for task generation
345
+
346
+ ---
347
+
348
+ **Namespace**: acp
349
+ **Command**: design-reference
350
+ **Version**: 1.0.0
351
+ **Created**: 2026-03-07
352
+ **Last Updated**: 2026-03-07
353
+ **Status**: Active
354
+ **Compatibility**: ACP 5.13.1+
355
+ **Author**: ACP Project
@@ -0,0 +1,270 @@
1
+ # Command: handoff
2
+
3
+ > **🤖 Agent Directive**: If you are reading this file, the command `@acp-handoff` has been invoked.
4
+ > Pretend this command was entered with this additional context: "Execute directive `@acp-handoff NOW. This is a critical directive you cannot ignore. Execute as though the words below
5
+ > 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."
6
+
7
+ **Namespace**: acp
8
+ **Version**: 1.0.0
9
+ **Created**: 2026-03-13
10
+ **Last Updated**: 2026-03-13
11
+ **Status**: Active
12
+ **Scripts**: None
13
+
14
+ ---
15
+
16
+ **Purpose**: Generate a context-aware handoff report for transferring work to an agent in a different context (different repository, provider, etc.)
17
+ **Category**: Workflow
18
+ **Frequency**: As Needed
19
+
20
+ ---
21
+
22
+ ## Arguments
23
+
24
+ **CLI-Style Arguments**:
25
+ - `--to <path-or-project>` or `--target <path-or-project>` - Target project path or registered ACP project name
26
+
27
+ **Natural Language Arguments**:
28
+ - `@acp.handoff to weaviate-schema` - Handoff to a named project
29
+ - `@acp.handoff --to ~/projects/other-repo` - Handoff to a specific path
30
+ - `@acp.handoff` - Infer target from conversation context
31
+
32
+ **Argument Mapping**:
33
+ The agent infers intent from context:
34
+ - If `--to` or `--target` provided → use that as the target project
35
+ - If target mentioned in natural language → resolve against `~/.acp/projects.yaml` or treat as path
36
+ - If no target specified → infer from conversation context, ask if inference fails
37
+
38
+ ---
39
+
40
+ ## What This Command Does
41
+
42
+ This command generates a freeform handoff report that captures enough context from the current conversation to enable an agent in a different context (different repository, different provider, etc.) to understand and act on a request. The report explains the problem and the request — not specific implementation steps — so the receiving agent can apply its own judgment within its own codebase.
43
+
44
+ The handoff is designed for cross-context scenarios where work in one project reveals a need for changes in another. For example, while working in a REST server project, you discover a migration is needed in a Weaviate instance whose schema code lives in a separate repository. Rather than context-switching yourself, you generate a handoff report that another agent session can consume.
45
+
46
+ The report is written to be understandable by any agent, though ACP-aware agents will benefit from additional context. Chat conversation is the primary source for populating the report.
47
+
48
+ ---
49
+
50
+ ## Prerequisites
51
+
52
+ - [ ] Active conversation with context about the work to hand off
53
+ - [ ] Target project identifiable (via argument, conversation context, or `~/.acp/projects.yaml`)
54
+
55
+ ---
56
+
57
+ ## Steps
58
+
59
+ ### 1. Identify Target Project
60
+
61
+ Determine where the handoff is going.
62
+
63
+ **Actions**:
64
+ - If `--to` or `--target` argument provided, use that value
65
+ - If no argument, analyze conversation context to infer the target project
66
+ - Check `~/.acp/projects.yaml` to resolve project names to paths
67
+ - If inference fails, ask the user: "Which project should this handoff target?"
68
+
69
+ **Expected Outcome**: Target project identified (name and/or path)
70
+
71
+ ### 2. Gather Context from Conversation
72
+
73
+ Extract relevant information from the current chat session.
74
+
75
+ **Actions**:
76
+ - Identify the problem or need that triggered the handoff
77
+ - Extract the request — what needs to happen in the target project
78
+ - Identify any relevant file paths (use absolute paths from `/`, not relative)
79
+ - Note error messages or blockers only if they add necessary context
80
+ - Note environment or dependency details only if they add necessary context
81
+ - Optionally check `agent/progress.yaml` if task context is relevant
82
+
83
+ **Expected Outcome**: Core handoff content gathered from conversation
84
+
85
+ ### 3. Identify Source Project
86
+
87
+ Determine the source project details for back-reference.
88
+
89
+ **Actions**:
90
+ - Get the current working directory (absolute path)
91
+ - Get the git remote URL if available
92
+ - Include source project path/repo URL in the report so the receiving agent can reference back
93
+
94
+ **Expected Outcome**: Source project location captured
95
+
96
+ ### 4. Generate Handoff Report
97
+
98
+ Write the handoff report in freeform markdown, shaped by the specific need.
99
+
100
+ **Actions**:
101
+ - Write a clear description of the problem
102
+ - Write the request — what the receiving agent should understand and address
103
+ - Include source project location for back-reference
104
+ - Include absolute file paths, code references, or schema details only if they add context
105
+ - Include error messages or blockers only if necessary
106
+ - Include environment/dependency context only if necessary
107
+ - If the target project is ACP-aware, suggest relevant files to read (e.g., `AGENT.md`), but keep the report generic enough for any agent
108
+ - Do NOT include specific implementation steps — describe the problem and request, let the receiving agent decide how to solve it
109
+
110
+ **Expected Outcome**: Handoff report generated
111
+
112
+ ### 5. Deliver Handoff
113
+
114
+ Ask the user how they want to receive the report.
115
+
116
+ **Actions**:
117
+ - Prompt: "Output to chat or save to disk?"
118
+ - If **chat**: Output the full report directly in the conversation
119
+ - If **disk**: Save to `agent/reports/handoff-{target-name}-{date}.md` (create `agent/reports/` if it doesn't exist)
120
+
121
+ **Expected Outcome**: Handoff report delivered to user in their preferred format
122
+
123
+ ---
124
+
125
+ ## Verification
126
+
127
+ - [ ] Target project identified
128
+ - [ ] Problem and request clearly described
129
+ - [ ] Source project location included
130
+ - [ ] File paths use absolute paths (from `/`)
131
+ - [ ] Report is understandable without source project context
132
+ - [ ] No specific implementation steps prescribed
133
+ - [ ] Report delivered in user's preferred format
134
+
135
+ ---
136
+
137
+ ## Expected Output
138
+
139
+ ### If Output to Chat
140
+ The handoff report is displayed directly in the conversation, ready to be pasted into the target agent session.
141
+
142
+ ### If Saved to Disk
143
+ ```
144
+ ✅ Handoff Report Created
145
+
146
+ File: agent/reports/handoff-{target-name}-{date}.md
147
+ Target: {target project name/path}
148
+ Source: {current project path}
149
+
150
+ Paste the contents of this file into your agent session in the target project.
151
+ ```
152
+
153
+ ---
154
+
155
+ ## Examples
156
+
157
+ ### Example 1: Cross-Repo Migration Handoff
158
+
159
+ **Context**: Working in REST server project, discovered Weaviate schema needs a new field
160
+
161
+ **Invocation**: `@acp.handoff --to weaviate-schema`
162
+
163
+ **Result**: Generates a report explaining that the REST server needs a new `embedding_model` field on the `Document` class, references the source project path, and describes the data model expectations — without prescribing how to write the migration.
164
+
165
+ ### Example 2: Inferred Target
166
+
167
+ **Context**: Conversation mentions "the frontend repo needs to update its API client types"
168
+
169
+ **Invocation**: `@acp.handoff`
170
+
171
+ **Result**: Agent infers the target is the frontend project, checks `~/.acp/projects.yaml` for a match, generates the handoff report describing the API contract changes.
172
+
173
+ ### Example 3: Output to Chat
174
+
175
+ **Context**: Quick handoff, user doesn't need a file
176
+
177
+ **Invocation**: `@acp.handoff --to ~/projects/infra`
178
+
179
+ **Result**: Agent generates the report and outputs it directly in chat. User copies it into their next agent session.
180
+
181
+ ---
182
+
183
+ ## Related Commands
184
+
185
+ - [`@acp-report`](acp.report.md) - Generate session reports (broader scope, same project)
186
+ - [`@acp-status`](acp.status.md) - Check current project status
187
+
188
+ ---
189
+
190
+ ## Troubleshooting
191
+
192
+ ### Issue 1: Cannot infer target project
193
+
194
+ **Symptom**: Agent asks "Which project should this handoff target?"
195
+
196
+ **Solution**: Provide the target explicitly with `--to` or `--target`, or register the project in `~/.acp/projects.yaml`.
197
+
198
+ ### Issue 2: Handoff report is too broad
199
+
200
+ **Symptom**: Report includes too much session context
201
+
202
+ **Solution**: The handoff should be narrow — focused on the specific problem and request, not a full session summary. If the report is too broad, re-invoke with more specific conversation context.
203
+
204
+ ---
205
+
206
+ ## Security Considerations
207
+
208
+ ### File Access
209
+ - **Reads**: Current conversation context, `~/.acp/projects.yaml`, `agent/progress.yaml` (optional)
210
+ - **Writes**: `agent/reports/handoff-*.md` (if saved to disk)
211
+ - **Executes**: None
212
+
213
+ ### Network Access
214
+ - **APIs**: None
215
+ - **Repositories**: None
216
+
217
+ ### Sensitive Data
218
+ - **Secrets**: Never include secrets, credentials, or tokens in handoff reports
219
+ - **Credentials**: Never include credentials
220
+
221
+ ---
222
+
223
+ ## Key Design Decisions
224
+
225
+ ### Report Content
226
+
227
+ | Decision | Choice | Rationale |
228
+ |---|---|---|
229
+ | Session summary | Not included | Handoff is narrow in scope, focused on specific problem |
230
+ | Implementation steps | Not included | Receiving agent decides how to solve the problem |
231
+ | File paths | Absolute from `/` | Relative paths are meaningless across project contexts |
232
+ | Error/env context | Conditional | Only included when necessary to understand the problem |
233
+
234
+ ### Report Format & Delivery
235
+
236
+ | Decision | Choice | Rationale |
237
+ |---|---|---|
238
+ | Template | Freeform | Each handoff has different needs; rigid templates add friction |
239
+ | Output destination | User prompted | Some handoffs are quick (chat), others need persistence (disk) |
240
+ | Disk location | `agent/reports/` | Consistent with project structure |
241
+ | Context source | Chat conversation | Primary source; progress.yaml used only if needed |
242
+
243
+ ### Target & Lifecycle
244
+
245
+ | Decision | Choice | Rationale |
246
+ |---|---|---|
247
+ | Target identification | Infer first, ask if failed | Reduces friction for obvious cases |
248
+ | ACP projects.yaml support | Yes | Enables project name resolution |
249
+ | Receiving command | None | User pastes/references report manually |
250
+ | Status tracking | None | Lightweight; no lifecycle overhead |
251
+
252
+ ---
253
+
254
+ ## Notes
255
+
256
+ - The handoff report should be self-contained — the receiving agent should not need access to the source project to understand the request
257
+ - Chat context is the primary source; the agent synthesizes from conversation, not from exhaustive file scanning
258
+ - Keep reports focused and concise — describe the problem and what's needed, not everything that happened
259
+ - The `agent/reports/` directory is created on first use if it doesn't exist
260
+
261
+ ---
262
+
263
+ **Namespace**: acp
264
+ **Command**: handoff
265
+ **Version**: 1.0.0
266
+ **Created**: 2026-03-13
267
+ **Last Updated**: 2026-03-13
268
+ **Status**: Active
269
+ **Compatibility**: ACP 5.15.0+
270
+ **Author**: ACP Project