maestro-flow 0.3.12 → 0.3.13

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 (235) hide show
  1. package/.claude/CLAUDE.md +7 -0
  2. package/.claude/agents/workflow-analyzer.md +0 -1
  3. package/.claude/agents/workflow-collab-planner.md +0 -1
  4. package/.claude/agents/workflow-debugger.md +0 -1
  5. package/.claude/agents/workflow-integration-checker.md +2 -2
  6. package/.claude/agents/workflow-nyquist-auditor.md +0 -1
  7. package/.claude/agents/workflow-phase-researcher.md +2 -2
  8. package/.claude/agents/workflow-plan-checker.md +1 -1
  9. package/.claude/agents/workflow-planner.md +1 -2
  10. package/.claude/agents/workflow-roadmapper.md +1 -1
  11. package/.claude/agents/workflow-verifier.md +0 -1
  12. package/.claude/commands/learn-retro.md +2 -2
  13. package/.claude/commands/learn-second-opinion.md +2 -2
  14. package/.claude/commands/maestro-analyze.md +10 -2
  15. package/.claude/commands/maestro-brainstorm.md +1 -1
  16. package/.claude/commands/maestro-execute.md +21 -4
  17. package/.claude/commands/maestro-milestone-complete.md +14 -0
  18. package/.claude/commands/maestro-plan.md +12 -6
  19. package/.claude/commands/maestro-roadmap.md +1 -1
  20. package/.claude/commands/maestro-ui-design.md +7 -7
  21. package/.claude/commands/maestro-update.md +176 -0
  22. package/.claude/commands/maestro-verify.md +18 -3
  23. package/.claude/commands/manage-codebase-rebuild.md +0 -1
  24. package/.claude/commands/manage-harvest.md +1 -1
  25. package/.claude/commands/manage-learn.md +5 -5
  26. package/.claude/commands/manage-memory-capture.md +4 -4
  27. package/.claude/commands/manage-memory.md +1 -1
  28. package/.claude/commands/manage-wiki.md +62 -0
  29. package/.claude/commands/quality-business-test.md +2 -2
  30. package/.claude/commands/quality-debug.md +53 -7
  31. package/.claude/commands/quality-retrospective.md +5 -5
  32. package/.claude/commands/quality-review.md +39 -7
  33. package/.claude/commands/quality-sync.md +1 -1
  34. package/.claude/commands/quality-test-gen.md +1 -1
  35. package/.claude/commands/quality-test.md +45 -12
  36. package/.claude/commands/spec-remove.md +51 -0
  37. package/.claude/commands/spec-setup.md +1 -3
  38. package/.claude/commands/wiki-connect.md +9 -5
  39. package/.claude/commands/wiki-digest.md +6 -3
  40. package/.codex/skills/maestro/SKILL.md +2 -2
  41. package/.codex/skills/maestro-analyze/SKILL.md +4 -4
  42. package/.codex/skills/maestro-brainstorm/SKILL.md +4 -4
  43. package/.codex/skills/maestro-coordinate/SKILL.md +2 -2
  44. package/.codex/skills/maestro-execute/SKILL.md +15 -5
  45. package/.codex/skills/maestro-init/SKILL.md +1 -1
  46. package/.codex/skills/maestro-milestone-complete/SKILL.md +18 -1
  47. package/.codex/skills/maestro-plan/SKILL.md +6 -6
  48. package/.codex/skills/maestro-roadmap/SKILL.md +3 -4
  49. package/.codex/skills/maestro-spec-generate/SKILL.md +2 -2
  50. package/.codex/skills/maestro-ui-design/SKILL.md +6 -6
  51. package/.codex/skills/maestro-verify/SKILL.md +20 -11
  52. package/.codex/skills/manage-codebase-rebuild/SKILL.md +4 -4
  53. package/.codex/skills/manage-harvest/SKILL.md +10 -1
  54. package/.codex/skills/manage-issue-discover/SKILL.md +3 -3
  55. package/.codex/skills/manage-learn/SKILL.md +3 -2
  56. package/.codex/skills/manage-memory/SKILL.md +3 -3
  57. package/.codex/skills/manage-memory-capture/SKILL.md +8 -14
  58. package/.codex/skills/manage-status/SKILL.md +9 -4
  59. package/.codex/skills/manage-wiki/SKILL.md +55 -0
  60. package/.codex/skills/quality-business-test/SKILL.md +8 -6
  61. package/.codex/skills/quality-debug/SKILL.md +22 -9
  62. package/.codex/skills/quality-integration-test/SKILL.md +11 -7
  63. package/.codex/skills/quality-retrospective/SKILL.md +45 -26
  64. package/.codex/skills/quality-review/SKILL.md +10 -7
  65. package/.codex/skills/quality-test/SKILL.md +9 -4
  66. package/.codex/skills/quality-test-gen/SKILL.md +13 -9
  67. package/.codex/skills/spec-add/SKILL.md +11 -3
  68. package/.codex/skills/spec-load/SKILL.md +7 -0
  69. package/.codex/skills/spec-map/SKILL.md +2 -2
  70. package/.codex/skills/spec-remove/SKILL.md +101 -0
  71. package/.codex/skills/spec-setup/SKILL.md +4 -8
  72. package/.codex/skills/wiki-connect/SKILL.md +6 -5
  73. package/.codex/skills/wiki-digest/SKILL.md +2 -2
  74. package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.d.ts +9 -0
  75. package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js +109 -9
  76. package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js.map +1 -1
  77. package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.test.js +49 -0
  78. package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.test.js.map +1 -1
  79. package/dashboard/dist-server/dashboard/src/server/routes/index.js +5 -4
  80. package/dashboard/dist-server/dashboard/src/server/routes/index.js.map +1 -1
  81. package/dashboard/dist-server/dashboard/src/server/routes/specs.d.ts +5 -13
  82. package/dashboard/dist-server/dashboard/src/server/routes/specs.js +97 -155
  83. package/dashboard/dist-server/dashboard/src/server/routes/specs.js.map +1 -1
  84. package/dashboard/dist-server/dashboard/src/server/routes/wiki.d.ts +11 -1
  85. package/dashboard/dist-server/dashboard/src/server/routes/wiki.integration.test.js +27 -6
  86. package/dashboard/dist-server/dashboard/src/server/routes/wiki.integration.test.js.map +1 -1
  87. package/dashboard/dist-server/dashboard/src/server/routes/wiki.js +25 -7
  88. package/dashboard/dist-server/dashboard/src/server/routes/wiki.js.map +1 -1
  89. package/dashboard/dist-server/dashboard/src/server/wiki/graph-analysis.js +8 -0
  90. package/dashboard/dist-server/dashboard/src/server/wiki/graph-analysis.js.map +1 -1
  91. package/dashboard/dist-server/dashboard/src/server/wiki/search.js +1 -0
  92. package/dashboard/dist-server/dashboard/src/server/wiki/search.js.map +1 -1
  93. package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.d.ts +29 -0
  94. package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.js +148 -0
  95. package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.js.map +1 -0
  96. package/dashboard/dist-server/dashboard/src/server/wiki/stress.test.js +4 -2
  97. package/dashboard/dist-server/dashboard/src/server/wiki/stress.test.js.map +1 -1
  98. package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.js +8 -2
  99. package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.js.map +1 -1
  100. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.d.ts +5 -0
  101. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +80 -38
  102. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
  103. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.test.js +8 -6
  104. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.test.js.map +1 -1
  105. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-types.d.ts +40 -5
  106. package/dashboard/dist-server/dashboard/src/server/wiki/writer-stress.test.js +21 -23
  107. package/dashboard/dist-server/dashboard/src/server/wiki/writer-stress.test.js.map +1 -1
  108. package/dashboard/dist-server/dashboard/src/server/wiki/writer.d.ts +33 -3
  109. package/dashboard/dist-server/dashboard/src/server/wiki/writer.js +184 -12
  110. package/dashboard/dist-server/dashboard/src/server/wiki/writer.js.map +1 -1
  111. package/dashboard/dist-server/src/commands/delegate.js +26 -0
  112. package/dashboard/dist-server/src/commands/delegate.js.map +1 -1
  113. package/dashboard/dist-server/src/coordinator/graph-types.d.ts +11 -1
  114. package/dashboard/dist-server/src/coordinator/graph-walker.js +29 -2
  115. package/dashboard/dist-server/src/coordinator/graph-walker.js.map +1 -1
  116. package/dashboard/dist-server/src/coordinator/prompt-assembler.js +3 -2
  117. package/dashboard/dist-server/src/coordinator/prompt-assembler.js.map +1 -1
  118. package/dashboard/dist-server/src/hooks/constants.d.ts +29 -60
  119. package/dashboard/dist-server/src/hooks/constants.js +105 -82
  120. package/dashboard/dist-server/src/hooks/constants.js.map +1 -1
  121. package/dashboard/dist-server/src/types/index.d.ts +2 -1
  122. package/dist/src/commands/delegate.d.ts.map +1 -1
  123. package/dist/src/commands/delegate.js +26 -0
  124. package/dist/src/commands/delegate.js.map +1 -1
  125. package/dist/src/commands/hooks.d.ts +2 -4
  126. package/dist/src/commands/hooks.d.ts.map +1 -1
  127. package/dist/src/commands/hooks.js +4 -7
  128. package/dist/src/commands/hooks.js.map +1 -1
  129. package/dist/src/commands/install-ui/InstallConfirm.d.ts +2 -3
  130. package/dist/src/commands/install-ui/InstallConfirm.d.ts.map +1 -1
  131. package/dist/src/commands/install-ui/InstallConfirm.js +1 -1
  132. package/dist/src/commands/install-ui/InstallConfirm.js.map +1 -1
  133. package/dist/src/commands/install-ui/InstallExecution.d.ts.map +1 -1
  134. package/dist/src/commands/install-ui/InstallExecution.js +1 -2
  135. package/dist/src/commands/install-ui/InstallExecution.js.map +1 -1
  136. package/dist/src/commands/install-ui/InstallFlow.d.ts.map +1 -1
  137. package/dist/src/commands/install-ui/InstallFlow.js +5 -7
  138. package/dist/src/commands/install-ui/InstallFlow.js.map +1 -1
  139. package/dist/src/commands/install-ui/StatuslineConfig.d.ts +3 -6
  140. package/dist/src/commands/install-ui/StatuslineConfig.d.ts.map +1 -1
  141. package/dist/src/commands/install-ui/StatuslineConfig.js +21 -17
  142. package/dist/src/commands/install-ui/StatuslineConfig.js.map +1 -1
  143. package/dist/src/commands/update.d.ts.map +1 -1
  144. package/dist/src/commands/update.js +95 -0
  145. package/dist/src/commands/update.js.map +1 -1
  146. package/dist/src/commands/wiki.d.ts.map +1 -1
  147. package/dist/src/commands/wiki.js +75 -11
  148. package/dist/src/commands/wiki.js.map +1 -1
  149. package/dist/src/coordinator/graph-types.d.ts +11 -1
  150. package/dist/src/coordinator/graph-types.d.ts.map +1 -1
  151. package/dist/src/coordinator/graph-walker.d.ts.map +1 -1
  152. package/dist/src/coordinator/graph-walker.js +29 -2
  153. package/dist/src/coordinator/graph-walker.js.map +1 -1
  154. package/dist/src/coordinator/prompt-assembler.d.ts.map +1 -1
  155. package/dist/src/coordinator/prompt-assembler.js +3 -2
  156. package/dist/src/coordinator/prompt-assembler.js.map +1 -1
  157. package/dist/src/hooks/__tests__/statusline-visual-test.d.ts +4 -1
  158. package/dist/src/hooks/__tests__/statusline-visual-test.d.ts.map +1 -1
  159. package/dist/src/hooks/__tests__/statusline-visual-test.js +55 -174
  160. package/dist/src/hooks/__tests__/statusline-visual-test.js.map +1 -1
  161. package/dist/src/hooks/constants.d.ts +29 -60
  162. package/dist/src/hooks/constants.d.ts.map +1 -1
  163. package/dist/src/hooks/constants.js +105 -82
  164. package/dist/src/hooks/constants.js.map +1 -1
  165. package/dist/src/hooks/skill-context.d.ts.map +1 -1
  166. package/dist/src/hooks/skill-context.js +54 -6
  167. package/dist/src/hooks/skill-context.js.map +1 -1
  168. package/dist/src/hooks/statusline.d.ts +11 -8
  169. package/dist/src/hooks/statusline.d.ts.map +1 -1
  170. package/dist/src/hooks/statusline.js +284 -182
  171. package/dist/src/hooks/statusline.js.map +1 -1
  172. package/dist/src/hooks/workspace.d.ts.map +1 -1
  173. package/dist/src/hooks/workspace.js +2 -1
  174. package/dist/src/hooks/workspace.js.map +1 -1
  175. package/dist/src/migrations/_template.d.ts +12 -0
  176. package/dist/src/migrations/_template.d.ts.map +1 -0
  177. package/dist/src/migrations/_template.js +55 -0
  178. package/dist/src/migrations/_template.js.map +1 -0
  179. package/dist/src/migrations/index.d.ts +14 -0
  180. package/dist/src/migrations/index.d.ts.map +1 -0
  181. package/dist/src/migrations/index.js +20 -0
  182. package/dist/src/migrations/index.js.map +1 -0
  183. package/dist/src/migrations/run.d.ts +12 -0
  184. package/dist/src/migrations/run.d.ts.map +1 -0
  185. package/dist/src/migrations/run.js +119 -0
  186. package/dist/src/migrations/run.js.map +1 -0
  187. package/dist/src/migrations/v1-to-v2.d.ts +10 -0
  188. package/dist/src/migrations/v1-to-v2.d.ts.map +1 -0
  189. package/dist/src/migrations/v1-to-v2.js +71 -0
  190. package/dist/src/migrations/v1-to-v2.js.map +1 -0
  191. package/dist/src/tools/team-activity.d.ts.map +1 -1
  192. package/dist/src/tools/team-activity.js +22 -0
  193. package/dist/src/tools/team-activity.js.map +1 -1
  194. package/dist/src/tools/transition-recorder.d.ts +2 -17
  195. package/dist/src/tools/transition-recorder.d.ts.map +1 -1
  196. package/dist/src/tools/transition-recorder.js +6 -3
  197. package/dist/src/tools/transition-recorder.js.map +1 -1
  198. package/dist/src/types/index.d.ts +2 -1
  199. package/dist/src/types/index.d.ts.map +1 -1
  200. package/dist/src/utils/migration-registry.d.ts +65 -0
  201. package/dist/src/utils/migration-registry.d.ts.map +1 -0
  202. package/dist/src/utils/migration-registry.js +117 -0
  203. package/dist/src/utils/migration-registry.js.map +1 -0
  204. package/dist/src/utils/state-schema.d.ts +153 -0
  205. package/dist/src/utils/state-schema.d.ts.map +1 -0
  206. package/dist/src/utils/state-schema.js +329 -0
  207. package/dist/src/utils/state-schema.js.map +1 -0
  208. package/package.json +1 -1
  209. package/templates/state.json +17 -39
  210. package/workflows/brainstorm.md +3 -3
  211. package/workflows/codebase-rebuild.md +2 -12
  212. package/workflows/debug.md +7 -8
  213. package/workflows/execute.md +18 -4
  214. package/workflows/fork.md +37 -86
  215. package/workflows/init.md +1 -4
  216. package/workflows/integration-test.md +4 -5
  217. package/workflows/issue.md +3 -9
  218. package/workflows/learn.md +20 -19
  219. package/workflows/maestro.codex.md +8 -1
  220. package/workflows/maestro.md +12 -3
  221. package/workflows/memory.md +26 -71
  222. package/workflows/merge.md +45 -107
  223. package/workflows/milestone-complete.md +24 -7
  224. package/workflows/retrospective.md +77 -109
  225. package/workflows/review.md +5 -12
  226. package/workflows/specs-remove.md +115 -0
  227. package/workflows/specs-setup.md +10 -32
  228. package/workflows/status.md +291 -290
  229. package/workflows/sync.md +5 -5
  230. package/workflows/test.md +4 -5
  231. package/workflows/ui-style.md +3 -4
  232. package/workflows/verify.md +2 -2
  233. package/workflows/wiki-connect.md +188 -0
  234. package/workflows/wiki-digest.md +221 -0
  235. package/workflows/wiki-manage.md +204 -0
@@ -51,7 +51,7 @@ $quality-business-test "3 --auto" # skip plan confirmation
51
51
 
52
52
  `--auto` skips interactive confirmation of test plan. `--dry-run` extracts scenarios only without execution.
53
53
 
54
- **Output**: `{phase_dir}/.tests/business/business-test-plan.json` + `business-test-report.json` + `business-test-summary.md`
54
+ **Output**: `{artifact_dir}/.tests/business/business-test-plan.json` + `business-test-report.json` + `business-test-summary.md`
55
55
  </context>
56
56
 
57
57
  <invariants>
@@ -71,8 +71,9 @@ $quality-business-test "3 --auto" # skip plan confirmation
71
71
  ### Step 1: Resolve Target & Load Spec Package
72
72
 
73
73
  1. Parse `$ARGUMENTS` for phase number and flags
74
- 2. Resolve `PHASE_DIR` via artifact registry in `state.json` to `.workflow/scratch/{type}-{slug}-{date}/`; legacy fallback to `.workflow/phases/{NN}-{slug}/`
75
- 3. Load `index.json` -> find `spec_ref` -> locate `.workflow/.spec/SPEC-xxx/`
74
+ 2. Resolve `PHASE_DIR` via artifact registry in `state.json` to `.workflow/scratch/{YYYYMMDD}-{type}-{slug}/`
75
+ 3. **Related session discovery**: Query `state.json.artifacts[]` for all artifacts matching `phase === target_phase && milestone === current_milestone`. Each artifact's type determines its outputs: review → review.json (findings inform which business rules need extra scrutiny), debug → understanding.md (root causes map to specific requirement failures), test → uat.md (prior UAT gaps identify untested business scenarios). Extract conclusions that may affect business test scenario priorities.
76
+ 4. Load `index.json` -> find `spec_ref` -> locate `.workflow/.spec/SPEC-xxx/`
76
77
  4. **Full mode**: Read `requirements/_index.md` + all `REQ-*.md` + `NFR-*.md` + `architecture/_index.md` + `epics/EPIC-*.md`
77
78
  5. **Degraded mode** (no spec package): Read `index.json.success_criteria` + `plan.json` convergence criteria + `.summaries/TASK-*.md`
78
79
  6. If `--re-run`: load previous `business-test-report.json`, filter to failed/blocked scenarios
@@ -129,7 +130,7 @@ Three tiers:
129
130
 
130
131
  ### Step 5: Generate Test Code (if --gen-code)
131
132
 
132
- Detect project tech stack from `.workflow/specs/project-tech.json` or codebase scan.
133
+ Detect project tech stack from `.workflow/project.md` Tech Stack section or codebase scan.
133
134
 
134
135
  | Stack | L1 | L2 | L3 |
135
136
  |-------|----|----|-----|
@@ -190,7 +191,8 @@ FOR each REQ:
190
191
 
191
192
  1. Auto-create issues from failures in `.workflow/issues/issues.jsonl` (each with `req_ref`, `source: "business-test"`)
192
193
  2. Report results
193
- 3. Route next step:
194
+ 3. **Register artifact**: Append to `state.json.artifacts[]` with `type: "test"`, `id: TST-NNN`, `path: "scratch/{YYYYMMDD}-business-test-P{N}-{slug}"`, `depends_on: exec_art.id`.
195
+ 4. Route next step:
194
196
 
195
197
  | Result | Suggestion |
196
198
  |--------|------------|
@@ -206,7 +208,7 @@ FOR each REQ:
206
208
  | Code | Severity | Condition | Recovery |
207
209
  |------|----------|-----------|----------|
208
210
  | E001 | error | Phase number required | Prompt user for phase number |
209
- | E002 | error | Phase directory not found | Resolve via state.json artifact registry; legacy fallback to `.workflow/phases/` |
211
+ | E002 | error | Phase directory not found | Resolve via state.json artifact registry |
210
212
  | E003 | error | No spec package AND no success_criteria | Run maestro-spec-generate or maestro-plan first |
211
213
  | E004 | error | L1 critical failures block L2/L3 | Fix blockers via quality-debug |
212
214
  | W001 | warning | Degraded mode (no spec package) | Consider running maestro-spec-generate |
@@ -52,7 +52,7 @@ Wave-based hypothesis-driven debugging using `spawn_agents_on_csv`. Wave 1 explo
52
52
  $quality-debug "Login button throws 500 error on click"
53
53
  $quality-debug -y "JWT token not refreshed --from-uat 3"
54
54
  $quality-debug -c 4 "Navigation crash --from-uat 3 --parallel"
55
- $quality-debug --continue "debug-jwt-expiry-20260318"
55
+ $quality-debug --continue "20260318-debug-P3-jwt-expiry"
56
56
  ```
57
57
 
58
58
  **Flags**:
@@ -115,7 +115,7 @@ Each wave generates `wave-{N}.csv` with extra `prev_context` column.
115
115
  ### Session Structure
116
116
 
117
117
  ```
118
- .workflow/.csv-wave/debug-{slug}-{date}/
118
+ .workflow/.csv-wave/{YYYYMMDD}-debug-P{N}-{slug}/
119
119
  +-- tasks.csv
120
120
  +-- results.csv
121
121
  +-- discoveries.ndjson
@@ -159,7 +159,7 @@ const bugDescription = $ARGUMENTS
159
159
 
160
160
  const slug = bugDescription.toLowerCase().replace(/[^a-z0-9]+/g, '-').substring(0, 40)
161
161
  const dateStr = getUtc8ISOString().substring(0, 10).replace(/-/g, '')
162
- const sessionId = `debug-${slug}-${dateStr}`
162
+ const sessionId = fromUatMatch ? `${dateStr}-debug-P${fromUatMatch[1]}-${slug}` : `${dateStr}-debug-${slug}`
163
163
  const sessionFolder = `.workflow/.csv-wave/${sessionId}`
164
164
 
165
165
  Bash(`mkdir -p ${sessionFolder}`)
@@ -179,13 +179,15 @@ Bash(`mkdir -p ${sessionFolder}`)
179
179
  | `--parallel` flag present | parallel (implies from-uat, one agent per gap cluster) |
180
180
  | Neither flag | standalone (gather symptoms interactively) |
181
181
 
182
- 2. **Symptom collection**:
182
+ 2. **Related session discovery**: Query `state.json.artifacts[]` for all artifacts matching `phase === target_phase && milestone === current_milestone`. Each artifact's type determines its outputs: execute → .summaries/.task/, review → review.json (findings guide hypothesis formation), debug → understanding.md (avoid re-investigation), test → uat.md. Extract conclusions that may affect this debug session.
183
+
184
+ 3. **Symptom collection**:
183
185
 
184
186
  | Mode | Source | Action |
185
187
  |------|--------|--------|
186
188
  | standalone | User input | Ask 5 questions: expected, actual, errors, timeline, reproduction |
187
- | from-uat | `{phase_dir}/uat.md` | Parse Gaps section, cluster by component |
188
- | parallel | `{phase_dir}/uat.md` | Same as from-uat, one investigation per cluster |
189
+ | from-uat | test artifact's uat.md (via registry) | Parse Gaps section, cluster by component |
190
+ | parallel | test artifact's uat.md (via registry) | Same as from-uat, one investigation per cluster |
189
191
 
190
192
  3. **Hypothesis generation**: For each symptom cluster or bug description:
191
193
  - Analyze code patterns around affected area
@@ -322,12 +324,23 @@ spawn_agents_on_csv({
322
324
  ```
323
325
 
324
326
  4. **UAT update** (if --from-uat): For each confirmed hypothesis with fix:
325
- - Update `{phase_dir}/uat.md` gaps with `root_cause`, `fix_direction`, `affected_files`
327
+ - Update `{artifact_dir}/uat.md` gaps with `root_cause`, `fix_direction`, `affected_files`
326
328
 
327
329
  5. **Issue update**: If `.workflow/issues/issues.jsonl` exists:
328
330
  - Update matching issues with status `diagnosed`, add `context.suggested_fix` and `context.notes`
329
331
 
330
- 6. **Next step routing**:
332
+ 6. **Register artifact** (phase-scoped only): Append to `state.json.artifacts[]` with `type: "debug"`, `id: DBG-NNN`, `path: "scratch/{YYYYMMDD}-debug-P{N}-{slug}"`, `depends_on: triggering_review_id || exec_art.id`. Output directory is independent scratch.
333
+
334
+ 7. **Post-debug Knowledge Inquiry** (after root causes confirmed):
335
+ - **Recurring pattern**: If root cause matches a recurring pattern (similar to prior debug sessions):
336
+ → Ask: "This root cause pattern has appeared before. Should it be documented in `debug-notes.md` to prevent recurrence? (`/spec-add debug`)"
337
+ - **Non-obvious fix**: If fix involved a non-obvious approach or workaround:
338
+ → Ask: "This fix used a non-obvious strategy. Should it be recorded as a learning? (`/spec-add learning`)"
339
+ - **Architectural gap**: If root cause traces to architectural boundary violation or missing constraint:
340
+ → Ask: "Root cause points to an architectural gap. Should `architecture-constraints.md` be updated? (`/spec-add arch`)"
341
+ - If user confirms, append `<spec-entry>` to matching category file via `spec-add` mechanism
342
+
343
+ 8. **Next step routing**:
331
344
 
332
345
  | Result | Suggestion |
333
346
  |--------|------------|
@@ -337,7 +350,7 @@ spawn_agents_on_csv({
337
350
  | All inconclusive | Resume with more context or manual investigation |
338
351
  | From UAT, all diagnosed | `Skill({ skill: "quality-test", args: "{phase} --auto-fix" })` |
339
352
 
340
- 7. Display summary.
353
+ 9. Display summary.
341
354
 
342
355
  ### Shared Discovery Board Protocol
343
356
 
@@ -62,7 +62,7 @@ Linear pipeline test execution using `spawn_agents_on_csv`. Progressive L0 -> L1
62
62
  $quality-integration-test "3"
63
63
  $quality-integration-test -c 4 "3 --max-iterations 8"
64
64
  $quality-integration-test -y "3 --target-coverage 90"
65
- $quality-integration-test --continue "integration-test-phase3-20260318"
65
+ $quality-integration-test --continue "20260318-integration-test-P3-auth"
66
66
  ```
67
67
 
68
68
  **Flags**:
@@ -129,7 +129,7 @@ Each wave generates `wave-{N}.csv` with extra `prev_context` column populated fr
129
129
  ### Session Structure
130
130
 
131
131
  ```
132
- .workflow/.csv-wave/integration-test-{phase}-{date}/
132
+ .workflow/.csv-wave/{YYYYMMDD}-integration-test-P{N}-{slug}/
133
133
  +-- tasks.csv
134
134
  +-- results.csv
135
135
  +-- discoveries.ndjson
@@ -183,7 +183,7 @@ const phaseArg = $ARGUMENTS
183
183
  .trim()
184
184
 
185
185
  const dateStr = getUtc8ISOString().substring(0, 10).replace(/-/g, '')
186
- const sessionId = `integration-test-phase${phaseArg}-${dateStr}`
186
+ const sessionId = `${dateStr}-integration-test-P${phaseArg}-${phaseSlug}` // phaseSlug from index.json or roadmap
187
187
  const sessionFolder = `.workflow/.csv-wave/${sessionId}`
188
188
 
189
189
  Bash(`mkdir -p ${sessionFolder}`)
@@ -213,9 +213,11 @@ Write(`${sessionFolder}/reflection-log.md`,
213
213
 
214
214
  **Decomposition Rules**:
215
215
 
216
- 1. **Phase resolution**: Resolve `{phaseArg}` via artifact registry in `state.json` to `.workflow/scratch/{type}-{slug}-{date}/`; legacy fallback to `.workflow/phases/{NN}-{slug}/`
216
+ 1. **Phase resolution**: Resolve `{phaseArg}` via artifact registry in `state.json` to `.workflow/scratch/{YYYYMMDD}-{type}-{slug}/`
217
217
 
218
- 2. **Codebase exploration**:
218
+ 2. **Related session discovery**: Query `state.json.artifacts[]` for all artifacts matching `phase === target_phase && milestone === current_milestone`. Each artifact's type determines its outputs: review → review.json (critical findings inform integration test focus), debug → understanding.md (root causes guide regression test layers), test → uat.md/.tests/ (prior results inform layer priorities). Extract conclusions that may affect integration test strategy.
219
+
220
+ 3. **Codebase exploration**:
219
221
  - Cross-module imports and dependencies
220
222
  - API endpoints and route definitions
221
223
  - Database interactions and queries
@@ -228,7 +230,7 @@ Write(`${sessionFolder}/reflection-log.md`,
228
230
  - Identify test utilities, fixtures, DB seed scripts
229
231
 
230
232
  4. **Pre-generated test loading**:
231
- Check `{phase_dir}/.tests/test-gen-report.json` for tests from `quality-test-gen`. Merge integration/e2e tests into plan (execute but don't re-generate).
233
+ Check `{artifact_dir}/.tests/test-gen-report.json` for tests from `quality-test-gen`. Merge integration/e2e tests into plan (execute but don't re-generate).
232
234
 
233
235
  5. **Layer design**:
234
236
 
@@ -455,7 +457,9 @@ Update `state.json` with new strategy and iteration count.
455
457
 
456
458
  6. Update `index.json` with integration test status.
457
459
 
458
- 7. Display summary.
460
+ 7. **Register artifact**: Append to `state.json.artifacts[]` with `type: "test"`, `id: TST-NNN`, `path: "scratch/{YYYYMMDD}-integration-test-P{N}-{slug}"`, `depends_on: exec_art.id`. Output directory is independent scratch.
461
+
462
+ 8. Display summary.
459
463
 
460
464
  **Next step routing**:
461
465
 
@@ -66,18 +66,27 @@ $quality-retrospective "3 --compare 2 --auto-yes"
66
66
  When `--auto-yes`: Accept all routing recommendations without prompting. Route all insights automatically.
67
67
 
68
68
  **Storage written**:
69
- - `{target_dir}/retrospective.md` -- human-readable record (target_dir resolved via state.json artifact registry to `.workflow/scratch/{type}-{slug}-{date}/`; legacy fallback to `.workflow/phases/{NN}-{slug}/`)
69
+ - `{target_dir}/retrospective.md` -- human-readable record (target_dir resolved via state.json artifact registry to `.workflow/scratch/{YYYYMMDD}-{type}-{slug}/`)
70
70
  - `{target_dir}/retrospective.json` -- structured record
71
- - `.workflow/specs/SPEC-retro-*.md` -- spec stubs (one per spec-routed insight)
71
+ - `.workflow/specs/{category-file}.md` -- `<spec-entry>` entries appended to matching category files (one per spec-routed insight)
72
72
  - `.workflow/issues/issues.jsonl` -- appended issue rows (`source: "retrospective"`)
73
73
  - `.workflow/memory/TIP-*.md` -- memory tips (via `manage-memory-capture` skill)
74
74
  - `.workflow/learning/lessons.jsonl` -- append-only insight log
75
75
  - `.workflow/learning/learning-index.json` -- updated searchable index
76
76
 
77
- **Storage read (never modified)**:
78
- - `{target_dir}/index.json`, `plan.json`, `verification.json`, `review.json`, `uat.md`
79
- - `{target_dir}/.task/TASK-*.json`, `.summaries/TASK-*-summary.md`
80
- - `.workflow/issues/issues.jsonl`, `.workflow/state.json`
77
+ **Storage read (never modified)** — all resolved via `state.json.artifacts[]`:
78
+ ```
79
+ related = artifacts.filter(a =>
80
+ a.phase === target_phase && a.milestone === current_milestone
81
+ ).sort_by(completed_at asc)
82
+ ```
83
+ Each artifact's type determines its outputs at `.workflow/{a.path}/`:
84
+ - **execute** → index.json, plan.json, .task/TASK-*.json, .summaries/TASK-*-summary.md
85
+ - **verify** → verification.json
86
+ - **review** → review.json (findings, verdict, severity distribution)
87
+ - **debug** → understanding.md, evidence.ndjson (root causes, fix directions)
88
+ - **test** → uat.md, .tests/ (UAT results, gaps, coverage)
89
+ - Also reads: `.workflow/issues/issues.jsonl`, `.workflow/state.json`
81
90
 
82
91
  ### Agent Registry
83
92
 
@@ -151,7 +160,7 @@ functions.update_plan({
151
160
  Validate `--lens` values. If `--compare <M>` present, require single mode.
152
161
 
153
162
  **Stage 2: Validate phase artifacts**. For each target phase:
154
- - Phase directory must exist (resolved via state.json artifact registry to `.workflow/scratch/{type}-{slug}-{date}/`; legacy fallback to `.workflow/phases/{NN}-{slug}/`)
163
+ - Phase directory must exist (resolved via state.json artifact registry to `.workflow/scratch/{YYYYMMDD}-{type}-{slug}/`)
155
164
  - `index.json` must show `status: "completed"`
156
165
  - `.task/` directory must exist with at least one `TASK-*.json`
157
166
  - If existing `retrospective.json` found and not `--all`: emit W002, prompt overwrite
@@ -175,7 +184,7 @@ functions.update_plan({
175
184
  ### Stage 4: Context-Agent Fork + Parallel Lens Analysis
176
185
 
177
186
  **Archive if overwriting**:
178
- If existing `retrospective.{md,json}` present, move to `{phase_dir}/.history/` with timestamp suffix before spawning.
187
+ If existing `retrospective.{md,json}` present, move to `{artifact_dir}/.history/` with timestamp suffix before spawning.
179
188
 
180
189
  **Step 4a: Spawn context agent**
181
190
  ```javascript
@@ -190,13 +199,18 @@ spawn_agent({
190
199
  ---
191
200
 
192
201
  Goal: Load and summarize all phase artifacts for retrospective analysis.
193
- Phase: ${phaseDir}
202
+ Phase: ${targetPhase}
194
203
 
195
204
  TASK:
196
- 1. Read ${phaseDir}/index.json, plan.json, verification.json, review.json, uat.md
197
- 2. Read all .task/TASK-*.json and .summaries/TASK-*-summary.md
205
+ 1. Read .workflow/state.json -- query artifacts[] for all entries matching phase === ${targetPhase} && milestone === current_milestone
206
+ 2. For each artifact, load outputs from .workflow/{artifact.path}/:
207
+ - execute artifacts → index.json, plan.json, .task/TASK-*.json, .summaries/TASK-*-summary.md
208
+ - verify artifacts → verification.json
209
+ - review artifacts → review.json (findings, verdict, severity distribution)
210
+ - debug artifacts → understanding.md, evidence.ndjson (root causes, fix directions)
211
+ - test artifacts → uat.md, .tests/ (UAT results, gaps, coverage)
198
212
  3. Read .workflow/issues/issues.jsonl -- filter rows with phase link to this phase
199
- 4. Read .workflow/state.json for project context
213
+ 4. Read .workflow/state.json for project context (milestones, accumulated_context)
200
214
 
201
215
  EXPECTED: Comprehensive artifact summary covering:
202
216
  - Phase goals and outcomes (from plan.json vs verification.json)
@@ -357,18 +371,21 @@ If `--no-route`: skip this stage.
357
371
  For each insight in `synthResult.insights`, route based on `routing` field:
358
372
 
359
373
  **Spec routing** (`routing: "spec"`):
360
- ```javascript
361
- functions.apply_patch:
362
- *** Begin Patch
363
- *** Add File: .workflow/specs/SPEC-retro-<INS-id>.md
364
- +---
365
- +id: <INS-id>
366
- +source: retrospective
367
- +phase: <N>
368
- +category: <category>
369
- +---
370
- +
371
- +# <title>
374
+
375
+ Map insight type to spec category: pattern/convention → `coding`, architecture → `arch`, quality → `quality`.
376
+ Append `<spec-entry>` to matching category file:
377
+
378
+ ```markdown
379
+ <spec-entry category="{category}" keywords="{auto-extracted}" date="{YYYY-MM-DD}" source="retrospective">
380
+
381
+ ### <title>
382
+
383
+ <summary>
384
+
385
+ **Evidence:** <evidence_refs>
386
+ **Phase:** <N> | **Lens:** <lens> | **Insight:** <INS-id>
387
+
388
+ </spec-entry>
372
389
  +
373
390
  +<summary>
374
391
  +
@@ -441,7 +458,7 @@ functions.apply_patch:
441
458
 
442
459
  Append each insight to `.workflow/learning/lessons.jsonl` and update `learning-index.json`.
443
460
 
444
- If `.workflow/specs/learnings.md` already exists, append a one-line summary per insight (never create it).
461
+ If `.workflow/specs/learnings.md` already exists, append each insight using `<spec-entry>` closed-tag format (category=`learning`, auto-extract keywords, date=today, source=`retrospective`). Never create the file — only append if it exists.
445
462
 
446
463
  ```javascript
447
464
  functions.update_plan({
@@ -466,7 +483,7 @@ Lenses: technical, process, quality, decision
466
483
  Insights: <total> (<N> new, <N> duplicates merged)
467
484
 
468
485
  ROUTING:
469
- Spec stubs: <N> -> .workflow/specs/SPEC-retro-*.md
486
+ Spec entries: <N> -> .workflow/specs/{category-file}.md
470
487
  Issues: <N> -> .workflow/issues/issues.jsonl
471
488
  Memory tips: <N> -> .workflow/memory/TIP-*.md
472
489
  Lessons: <N> -> .workflow/learning/lessons.jsonl
@@ -480,6 +497,8 @@ Next:
480
497
  $manage-status
481
498
  $manage-issue "list --source retrospective"
482
499
  $manage-learn "list --phase <N>"
500
+ $manage-wiki health
501
+ $wiki-digest "<phase-topic>"
483
502
  ```
484
503
  </execution>
485
504
 
@@ -52,7 +52,7 @@ Wave-based multi-dimensional code review using `spawn_agents_on_csv`. Decomposes
52
52
  $quality-review "3"
53
53
  $quality-review -c 6 "3 --level deep"
54
54
  $quality-review -y "3 --dimensions security,performance"
55
- $quality-review --continue "review-phase3-20260318"
55
+ $quality-review --continue "20260318-review-P3-auth"
56
56
  ```
57
57
 
58
58
  **Flags**:
@@ -119,7 +119,7 @@ Each wave generates `wave-{N}.csv` with extra `prev_context` column.
119
119
  ### Session Structure
120
120
 
121
121
  ```
122
- .workflow/.csv-wave/review-{phase}-{date}/
122
+ .workflow/.csv-wave/{YYYYMMDD}-review-P{N}-{slug}/
123
123
  +-- tasks.csv
124
124
  +-- results.csv
125
125
  +-- discoveries.ndjson
@@ -163,7 +163,7 @@ const phaseArg = $ARGUMENTS
163
163
  .trim()
164
164
 
165
165
  const dateStr = getUtc8ISOString().substring(0, 10).replace(/-/g, '')
166
- const sessionId = `review-phase${phaseArg}-${dateStr}`
166
+ const sessionId = `${dateStr}-review-P${phaseArg}-${phaseSlug}` // phaseSlug from index.json or roadmap
167
167
  const sessionFolder = `.workflow/.csv-wave/${sessionId}`
168
168
 
169
169
  Bash(`mkdir -p ${sessionFolder}`)
@@ -175,8 +175,9 @@ Bash(`mkdir -p ${sessionFolder}`)
175
175
 
176
176
  **Decomposition Rules**:
177
177
 
178
- 1. **Phase resolution**: Resolve `{phaseArg}` via artifact registry in `state.json` to `.workflow/scratch/{type}-{slug}-{date}/`; legacy fallback to `.workflow/phases/{NN}-{slug}/`
179
- 2. **File collection**: Read `.task/TASK-*.json` -> collect all `files[].path` where action != "read"
178
+ 1. **Phase resolution**: Resolve `{phaseArg}` via artifact registry in `state.json` to `.workflow/scratch/{YYYYMMDD}-{type}-{slug}/`
179
+ 2. **Related session discovery**: Query `state.json.artifacts[]` for all artifacts matching `phase === target_phase && milestone === current_milestone`. Each artifact's type determines its outputs: execute → .summaries/.task/, review review.json, debug → understanding.md, test → uat.md. Extract conclusions that may affect this review (prior verdicts, root causes, UAT gaps) and pass as prior quality context to reviewer agents.
180
+ 3. **File collection**: Read `.task/TASK-*.json` -> collect all `files[].path` where action != "read"
180
181
  3. **Level detection**:
181
182
 
182
183
  | Condition | Level |
@@ -332,9 +333,11 @@ spawn_agents_on_csv({
332
333
  | standard | critical + high |
333
334
  | deep | critical + high + medium |
334
335
 
335
- 7. **Phase index update**: Update `{phase_dir}/index.json` with review status.
336
+ 7. **Phase index update**: Update `{artifact_dir}/index.json` with review status.
336
337
 
337
- 8. Display summary.
338
+ 8. **Register artifact**: Append to `state.json.artifacts[]` with `type: "review"`, `id: REV-NNN`, `path: "scratch/{YYYYMMDD}-review-P{N}-{slug}"`, `depends_on: exec_art.id`. Output directory is independent scratch, not shared with plan.
339
+
340
+ 9. Display summary.
338
341
 
339
342
  ### Shared Discovery Board Protocol
340
343
 
@@ -49,7 +49,7 @@ No auto mode -- UAT is inherently interactive. `--auto-fix` only automates gap c
49
49
  ### Step 1: Resolve Target
50
50
 
51
51
  1. Parse `$ARGUMENTS` for phase number, scratch task ID, or flags
52
- 2. **Phase mode**: resolve `PHASE_DIR` via artifact registry in `state.json` to `.workflow/scratch/{type}-{slug}-{date}/`; legacy fallback to `.workflow/phases/{NN}-{slug}/`
52
+ 2. **Phase mode**: resolve `PHASE_DIR` via artifact registry in `state.json` to `.workflow/scratch/{YYYYMMDD}-{type}-{slug}/`
53
53
  3. **Scratch mode**: set `SCRATCH_DIR = .workflow/scratch/{id}/`
54
54
  4. Validate target exists and has `verification.json` -- if missing: **E002**
55
55
 
@@ -71,7 +71,11 @@ If any smoke fails: **E003** -- abort, suggest Skill({ skill: "quality-debug" })
71
71
 
72
72
  ### Step 4: Load Verification Context
73
73
 
74
- Read from target directory: verification.json, validation.json, index.json, plan.json, `.summaries/TASK-*.md`. Build testable list from user-observable outcomes.
74
+ Read from target directory (resolved via artifact registry): verification.json, validation.json, index.json, plan.json, `.summaries/TASK-*.md`. Build testable list from user-observable outcomes.
75
+
76
+ ### Step 4.5: Load Quality Context
77
+
78
+ Query `state.json.artifacts[]` for all artifacts matching `phase === target_phase && milestone === current_milestone`. Each artifact's type determines its outputs: review → review.json (findings become additional test scenarios), debug → understanding.md (confirmed root causes become regression tests). Extract conclusions that may affect test scenario design.
75
79
 
76
80
  ### Step 5: Design Test Scenarios
77
81
 
@@ -132,8 +136,9 @@ Read `uat.md`, find first `result: [pending]` test, announce progress, continue
132
136
  2. Archive previous result artifacts to `.history/`
133
137
  3. Write `.tests/test-results.json` and `.tests/coverage-report.json`
134
138
  4. Update `index.json` with UAT results
135
- 5. If no issues: go to Step 13
136
- 6. If issues found: go to Step 11
139
+ 5. **Register artifact**: Append to `state.json.artifacts[]` with `type: "test"`, `id: TST-NNN`, `path: "scratch/{YYYYMMDD}-test-P{N}-{slug}"`, `depends_on: exec_art.id`. Output directory is independent scratch.
140
+ 6. If no issues: go to Step 13
141
+ 7. If issues found: go to Step 11
137
142
 
138
143
  ### Step 11: Auto-Diagnose
139
144
 
@@ -49,7 +49,7 @@ Wave-based test generation using `spawn_agents_on_csv`. Each source file/module
49
49
  $quality-test-gen "3"
50
50
  $quality-test-gen -c 4 "3 --type unit"
51
51
  $quality-test-gen -y "3 --type e2e --framework vitest"
52
- $quality-test-gen --continue "test-gen-phase3-20260318"
52
+ $quality-test-gen --continue "20260318-testgen-P3-auth"
53
53
  ```
54
54
 
55
55
  **Flags**:
@@ -113,7 +113,7 @@ Each wave generates `wave-{N}.csv` with extra `prev_context` column (empty for w
113
113
  ### Session Structure
114
114
 
115
115
  ```
116
- .workflow/.csv-wave/test-gen-{phase}-{date}/
116
+ .workflow/.csv-wave/{YYYYMMDD}-testgen-P{N}-{slug}/
117
117
  +-- tasks.csv
118
118
  +-- results.csv
119
119
  +-- discoveries.ndjson
@@ -158,7 +158,7 @@ const phaseArg = $ARGUMENTS
158
158
  .trim()
159
159
 
160
160
  const dateStr = getUtc8ISOString().substring(0, 10).replace(/-/g, '')
161
- const sessionId = `test-gen-phase${phaseArg}-${dateStr}`
161
+ const sessionId = `${dateStr}-testgen-P${phaseArg}-${phaseSlug}` // phaseSlug from index.json or roadmap
162
162
  const sessionFolder = `.workflow/.csv-wave/${sessionId}`
163
163
 
164
164
  Bash(`mkdir -p ${sessionFolder}`)
@@ -170,9 +170,11 @@ Bash(`mkdir -p ${sessionFolder}`)
170
170
 
171
171
  **Decomposition Rules**:
172
172
 
173
- 1. **Phase resolution**: Resolve `{phaseArg}` via artifact registry in `state.json` to `.workflow/scratch/{type}-{slug}-{date}/`; legacy fallback to `.workflow/phases/{NN}-{slug}/`
173
+ 1. **Phase resolution**: Resolve `{phaseArg}` via artifact registry in `state.json` to `.workflow/scratch/{YYYYMMDD}-{type}-{slug}/`
174
174
 
175
- 2. **Test infrastructure discovery**:
175
+ 2. **Related session discovery**: Query `state.json.artifacts[]` for all artifacts matching `phase === target_phase && milestone === current_milestone`. Each artifact's type determines its outputs: review → review.json (critical findings become focused test targets), debug → understanding.md (confirmed root causes become regression test targets), test → uat.md (UAT gaps inform which behaviors need tests). Extract conclusions that may affect test generation priorities.
176
+
177
+ 3. **Test infrastructure discovery**:
176
178
  - Find config files: `jest.config.*`, `vitest.config.*`, `pytest.ini`, `.mocharc.*`
177
179
  - Find existing test files: `*.test.*`, `*.spec.*`, `test_*`
178
180
  - Find test utilities: `test-utils.*`, `testHelper*`, `conftest.py`
@@ -277,9 +279,9 @@ Each agent receives:
277
279
 
278
280
  4. **Archive previous artifacts** before writing:
279
281
  ```
280
- IF file exists "{phase_dir}/.tests/test-gen-report.json":
281
- mkdir -p "{phase_dir}/.history"
282
- mv to "{phase_dir}/.history/test-gen-report-{TIMESTAMP}.json"
282
+ IF file exists "{artifact_dir}/.tests/test-gen-report.json":
283
+ mkdir -p "{artifact_dir}/.history"
284
+ mv to "{artifact_dir}/.history/test-gen-report-{TIMESTAMP}.json"
283
285
  ```
284
286
 
285
287
  5. Build `test-gen-report.json`:
@@ -362,7 +364,9 @@ Each agent receives:
362
364
 
363
365
  8. Copy `test-gen-report.json` to phase `.tests/` directory.
364
366
 
365
- 9. Display summary.
367
+ 9. **Register artifact**: Append to `state.json.artifacts[]` with `type: "test"`, `id: TST-NNN`, `path: "scratch/{YYYYMMDD}-testgen-P{N}-{slug}"`, `depends_on: exec_art.id`. Output directory is independent scratch.
368
+
369
+ 10. Display summary.
366
370
 
367
371
  **Next step routing**:
368
372
 
@@ -15,7 +15,7 @@ $spec-add "arch Use Zod for runtime validation over io-ts"
15
15
  $spec-add "quality All API endpoints must return structured error objects"
16
16
  ```
17
17
 
18
- **Valid categories**: coding, arch, quality, debug, test, review, learning.
18
+ **Valid categories**: coding, arch, quality, debug, test, review, learning, bug, pattern, decision, rule, validation.
19
19
  </purpose>
20
20
 
21
21
  <context>
@@ -31,6 +31,13 @@ $ARGUMENTS — `<category> <content>` where category selects the target file.
31
31
  | `test` | `test-conventions.md` |
32
32
  | `review` | `review-standards.md` |
33
33
  | `learning` | `learnings.md` |
34
+ | `bug` | `learnings.md` |
35
+ | `pattern` | `coding-conventions.md` |
36
+ | `decision` | `architecture-constraints.md` |
37
+ | `rule` | `quality-rules.md` |
38
+ | `validation` | `quality-rules.md` |
39
+
40
+ Extended types (`bug`, `pattern`, `decision`, `rule`, `validation`) are stored in the file of their closest core category but retain their specific category in the `<spec-entry>` tag.
34
41
  </context>
35
42
 
36
43
  <execution>
@@ -38,7 +45,7 @@ $ARGUMENTS — `<category> <content>` where category selects the target file.
38
45
  ### Step 1: Parse Input
39
46
 
40
47
  Extract category (first token) and content (remainder) from arguments.
41
- - Validate category is one of: coding, arch, quality, debug, test, review, learning (E003 if invalid)
48
+ - Validate category is one of: coding, arch, quality, debug, test, review, learning, bug, pattern, decision, rule, validation (E003 if invalid)
42
49
  - Validate content is non-empty (E001 if missing)
43
50
 
44
51
  ### Step 2: Validate Specs Directory
@@ -78,6 +85,7 @@ Append `<spec-entry>` closed-tag block to target file:
78
85
  Added [{category}] to {target_file}
79
86
  Keywords: {kw1}, {kw2}, {kw3}
80
87
  Verify: /spec-load --keyword {kw1}
88
+ Remove: /spec-remove <entry-id>
81
89
  ```
82
90
  </execution>
83
91
 
@@ -86,7 +94,7 @@ Verify: /spec-load --keyword {kw1}
86
94
  |------|----------|-------------|
87
95
  | E001 | fatal | Category and content are both required |
88
96
  | E002 | fatal | `.workflow/specs/` not initialized -- run `Skill({ skill: "spec-setup" })` first |
89
- | E003 | fatal | Invalid category -- must be one of: coding, arch, quality, debug, test, review, learning |
97
+ | E003 | fatal | Invalid category -- must be one of: coding, arch, quality, debug, test, review, learning, bug, pattern, decision, rule, validation |
90
98
  </error_codes>
91
99
 
92
100
  <success_criteria>
@@ -30,8 +30,15 @@ $spec-load "--category coding --keyword naming"
30
30
  | `test` | `test-conventions.md` |
31
31
  | `review` | `review-standards.md` |
32
32
  | `learning` | `learnings.md` |
33
+ | `bug` | `learnings.md` |
34
+ | `pattern` | `coding-conventions.md` |
35
+ | `decision` | `architecture-constraints.md` |
36
+ | `rule` | `quality-rules.md` |
37
+ | `validation` | `quality-rules.md` |
33
38
  | `all` (default) | All spec files |
34
39
 
40
+ Extended types (`bug`, `pattern`, `decision`, `rule`, `validation`) are stored in their closest core category's file but retain their specific category in the `<spec-entry>` tag.
41
+
35
42
  **Keyword filtering**: When `--keyword` is provided, only entries with matching keyword in their `<spec-entry keywords="...">` attribute are returned. Legacy entries (heading format) are filtered by text grep.
36
43
  </context>
37
44
 
@@ -43,7 +43,7 @@ Single-wave parallel execution — 4 independent mapper agents each analyze a di
43
43
  $spec-map ""
44
44
  $spec-map "auth"
45
45
  $spec-map -c 4 "api layer"
46
- $spec-map --continue "map-auth-20260318"
46
+ $spec-map --continue "20260318-map-auth"
47
47
  ```
48
48
 
49
49
  **Flags**:
@@ -102,7 +102,7 @@ id,title,description,focus_area,output_file,deps,context_from,wave,status,findin
102
102
  const AUTO_YES = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
103
103
  const focusArea = $ARGUMENTS.replace(/--yes|-y|--continue|--concurrency\s+\d+|-c\s+\d+/g, '').trim() || 'full'
104
104
  const dateStr = new Date(Date.now() + 8*60*60*1000).toISOString().substring(0,10).replace(/-/g,'')
105
- const sessionId = `map-${focusArea.substring(0,20)}-${dateStr}`
105
+ const sessionId = `${dateStr}-map-${focusArea.substring(0,20)}`
106
106
  const sessionFolder = `.workflow/.csv-wave/${sessionId}`
107
107
 
108
108
  Bash(`mkdir -p ${sessionFolder}`)