maestro-flow 0.4.11 → 0.4.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 (253) hide show
  1. package/.agents/agents/cli-explore-agent.md +1 -3
  2. package/.agents/agents/cross-role-reviewer.md +173 -0
  3. package/.agents/agents/role-design-author.md +220 -0
  4. package/.agents/agents/ui-design-agent.md +1 -18
  5. package/.agents/agents/workflow-analyzer.md +1 -1
  6. package/.agents/agents/workflow-external-researcher.md +1 -1
  7. package/.agents/skills/learn-decompose/SKILL.md +6 -6
  8. package/.agents/skills/learn-follow/SKILL.md +4 -4
  9. package/.agents/skills/learn-investigate/SKILL.md +6 -6
  10. package/.agents/skills/learn-retro/SKILL.md +7 -7
  11. package/.agents/skills/learn-second-opinion/SKILL.md +4 -4
  12. package/.agents/skills/maestro/SKILL.md +61 -27
  13. package/.agents/skills/maestro-amend/SKILL.md +1 -0
  14. package/.agents/skills/maestro-analyze/SKILL.md +37 -4
  15. package/.agents/skills/maestro-blueprint/SKILL.md +133 -0
  16. package/.agents/skills/maestro-brainstorm/SKILL.md +120 -103
  17. package/.agents/skills/maestro-fork/SKILL.md +1 -1
  18. package/.agents/skills/maestro-guard/SKILL.md +3 -2
  19. package/.agents/skills/maestro-help/SKILL.md +48 -14
  20. package/.agents/skills/maestro-help/index/catalog.json +29 -11
  21. package/.agents/skills/maestro-help/phases/01-parse-intent.md +1 -1
  22. package/.agents/skills/maestro-help/phases/02-search-present.md +6 -4
  23. package/.agents/skills/maestro-help/phases/03-workflow-guide.md +60 -33
  24. package/.agents/skills/maestro-impeccable/SKILL.md +13 -11
  25. package/.agents/skills/maestro-init/SKILL.md +3 -3
  26. package/.agents/skills/maestro-milestone-audit/SKILL.md +5 -3
  27. package/.agents/skills/maestro-milestone-complete/SKILL.md +7 -5
  28. package/.agents/skills/maestro-milestone-release/SKILL.md +1 -1
  29. package/.agents/skills/maestro-plan/SKILL.md +16 -4
  30. package/.agents/skills/maestro-ralph/SKILL.md +297 -226
  31. package/.agents/skills/maestro-ralph-execute/SKILL.md +82 -67
  32. package/.agents/skills/maestro-roadmap/SKILL.md +43 -81
  33. package/.agents/skills/manage-harvest/SKILL.md +1 -0
  34. package/.agents/skills/manage-issue-discover/SKILL.md +1 -1
  35. package/.agents/skills/manage-knowhow/SKILL.md +1 -1
  36. package/.agents/skills/manage-learn/SKILL.md +4 -4
  37. package/.agents/skills/quality-auto-test/SKILL.md +6 -6
  38. package/.agents/skills/quality-refactor/SKILL.md +1 -1
  39. package/.agents/skills/quality-retrospective/SKILL.md +2 -2
  40. package/.agents/skills/security-audit/SKILL.md +24 -0
  41. package/.agents/skills/spec-remove/SKILL.md +6 -2
  42. package/.agents/skills/team-lifecycle-v4/roles/analyst/role.md +1 -1
  43. package/.agents/skills/team-lifecycle-v4/roles/reviewer/commands/review-spec.md +2 -2
  44. package/.agents/skills/team-lifecycle-v4/roles/writer/role.md +1 -1
  45. package/.agents/skills/team-lifecycle-v4/templates/architecture.md +3 -3
  46. package/.agents/skills/team-lifecycle-v4/templates/epics.md +2 -2
  47. package/.agents/skills/team-lifecycle-v4/templates/product-brief.md +3 -3
  48. package/.agents/skills/team-lifecycle-v4/templates/requirements.md +2 -2
  49. package/.agy/agents/cli-explore-agent.md +1 -3
  50. package/.agy/agents/cross-role-reviewer.md +170 -0
  51. package/.agy/agents/role-design-author.md +217 -0
  52. package/.agy/agents/ui-design-agent.md +1 -18
  53. package/.agy/agents/workflow-analyzer.md +1 -1
  54. package/.agy/agents/workflow-external-researcher.md +1 -1
  55. package/.agy/skills/learn-decompose/SKILL.md +6 -6
  56. package/.agy/skills/learn-follow/SKILL.md +4 -4
  57. package/.agy/skills/learn-investigate/SKILL.md +6 -6
  58. package/.agy/skills/learn-retro/SKILL.md +7 -7
  59. package/.agy/skills/learn-second-opinion/SKILL.md +4 -4
  60. package/.agy/skills/maestro/SKILL.md +61 -27
  61. package/.agy/skills/maestro-amend/SKILL.md +1 -0
  62. package/.agy/skills/maestro-analyze/SKILL.md +37 -4
  63. package/.agy/skills/maestro-blueprint/SKILL.md +133 -0
  64. package/.agy/skills/maestro-brainstorm/SKILL.md +120 -103
  65. package/.agy/skills/maestro-fork/SKILL.md +1 -1
  66. package/.agy/skills/maestro-guard/SKILL.md +3 -2
  67. package/.agy/skills/maestro-help/SKILL.md +48 -14
  68. package/.agy/skills/maestro-help/index/catalog.json +29 -11
  69. package/.agy/skills/maestro-help/phases/01-parse-intent.md +1 -1
  70. package/.agy/skills/maestro-help/phases/02-search-present.md +6 -4
  71. package/.agy/skills/maestro-help/phases/03-workflow-guide.md +60 -33
  72. package/.agy/skills/maestro-impeccable/SKILL.md +13 -11
  73. package/.agy/skills/maestro-init/SKILL.md +3 -3
  74. package/.agy/skills/maestro-milestone-audit/SKILL.md +5 -3
  75. package/.agy/skills/maestro-milestone-complete/SKILL.md +7 -5
  76. package/.agy/skills/maestro-milestone-release/SKILL.md +1 -1
  77. package/.agy/skills/maestro-plan/SKILL.md +16 -4
  78. package/.agy/skills/maestro-ralph/SKILL.md +297 -226
  79. package/.agy/skills/maestro-ralph-execute/SKILL.md +82 -67
  80. package/.agy/skills/maestro-roadmap/SKILL.md +43 -81
  81. package/.agy/skills/manage-harvest/SKILL.md +1 -0
  82. package/.agy/skills/manage-issue-discover/SKILL.md +1 -1
  83. package/.agy/skills/manage-knowhow/SKILL.md +1 -1
  84. package/.agy/skills/manage-learn/SKILL.md +4 -4
  85. package/.agy/skills/quality-auto-test/SKILL.md +6 -6
  86. package/.agy/skills/quality-refactor/SKILL.md +1 -1
  87. package/.agy/skills/quality-retrospective/SKILL.md +2 -2
  88. package/.agy/skills/security-audit/SKILL.md +24 -0
  89. package/.agy/skills/spec-remove/SKILL.md +6 -2
  90. package/.agy/skills/team-lifecycle-v4/roles/analyst/role.md +1 -1
  91. package/.agy/skills/team-lifecycle-v4/roles/reviewer/commands/review-spec.md +2 -2
  92. package/.agy/skills/team-lifecycle-v4/roles/writer/role.md +1 -1
  93. package/.agy/skills/team-lifecycle-v4/templates/architecture.md +3 -3
  94. package/.agy/skills/team-lifecycle-v4/templates/epics.md +2 -2
  95. package/.agy/skills/team-lifecycle-v4/templates/product-brief.md +3 -3
  96. package/.agy/skills/team-lifecycle-v4/templates/requirements.md +2 -2
  97. package/.claude/agents/cli-explore-agent.md +1 -3
  98. package/.claude/agents/cross-role-reviewer.md +171 -0
  99. package/.claude/agents/role-design-author.md +218 -0
  100. package/.claude/agents/ui-design-agent.md +1 -18
  101. package/.claude/agents/workflow-analyzer.md +1 -1
  102. package/.claude/agents/workflow-external-researcher.md +1 -1
  103. package/.claude/commands/learn-decompose.md +6 -6
  104. package/.claude/commands/learn-follow.md +4 -4
  105. package/.claude/commands/learn-investigate.md +6 -6
  106. package/.claude/commands/learn-retro.md +7 -7
  107. package/.claude/commands/learn-second-opinion.md +4 -4
  108. package/.claude/commands/maestro-amend.md +1 -0
  109. package/.claude/commands/maestro-analyze.md +37 -4
  110. package/.claude/commands/maestro-blueprint.md +131 -0
  111. package/.claude/commands/maestro-brainstorm.md +133 -116
  112. package/.claude/commands/maestro-fork.md +1 -1
  113. package/.claude/commands/maestro-guard.md +3 -2
  114. package/.claude/commands/maestro-impeccable.md +13 -11
  115. package/.claude/commands/maestro-init.md +3 -3
  116. package/.claude/commands/maestro-milestone-audit.md +5 -3
  117. package/.claude/commands/maestro-milestone-complete.md +7 -5
  118. package/.claude/commands/maestro-milestone-release.md +1 -1
  119. package/.claude/commands/maestro-plan.md +16 -4
  120. package/.claude/commands/maestro-ralph-execute.md +82 -67
  121. package/.claude/commands/maestro-ralph.md +297 -226
  122. package/.claude/commands/maestro-roadmap.md +43 -81
  123. package/.claude/commands/maestro.md +61 -27
  124. package/.claude/commands/manage-harvest.md +1 -0
  125. package/.claude/commands/manage-issue-discover.md +1 -1
  126. package/.claude/commands/manage-knowhow.md +1 -1
  127. package/.claude/commands/manage-learn.md +4 -4
  128. package/.claude/commands/quality-auto-test.md +6 -6
  129. package/.claude/commands/quality-refactor.md +1 -1
  130. package/.claude/commands/quality-retrospective.md +2 -2
  131. package/.claude/commands/security-audit.md +24 -0
  132. package/.claude/commands/spec-remove.md +6 -2
  133. package/.claude/skills/maestro-help/SKILL.md +48 -14
  134. package/.claude/skills/maestro-help/index/catalog.json +29 -11
  135. package/.claude/skills/maestro-help/phases/01-parse-intent.md +1 -1
  136. package/.claude/skills/maestro-help/phases/02-search-present.md +6 -4
  137. package/.claude/skills/maestro-help/phases/03-workflow-guide.md +60 -33
  138. package/.claude/skills/team-lifecycle-v4/roles/analyst/role.md +1 -1
  139. package/.claude/skills/team-lifecycle-v4/roles/reviewer/commands/review-spec.md +2 -2
  140. package/.claude/skills/team-lifecycle-v4/roles/writer/role.md +1 -1
  141. package/.claude/skills/team-lifecycle-v4/templates/architecture.md +3 -3
  142. package/.claude/skills/team-lifecycle-v4/templates/epics.md +2 -2
  143. package/.claude/skills/team-lifecycle-v4/templates/product-brief.md +3 -3
  144. package/.claude/skills/team-lifecycle-v4/templates/requirements.md +2 -2
  145. package/.codex/skills/learn-decompose/SKILL.md +4 -4
  146. package/.codex/skills/learn-follow/SKILL.md +3 -3
  147. package/.codex/skills/learn-investigate/SKILL.md +3 -3
  148. package/.codex/skills/learn-retro/SKILL.md +3 -3
  149. package/.codex/skills/learn-second-opinion/SKILL.md +3 -3
  150. package/.codex/skills/maestro/SKILL.md +75 -38
  151. package/.codex/skills/maestro-amend/SKILL.md +157 -0
  152. package/.codex/skills/maestro-analyze/SKILL.md +72 -23
  153. package/.codex/skills/maestro-blueprint/SKILL.md +123 -0
  154. package/.codex/skills/maestro-brainstorm/SKILL.md +277 -46
  155. package/.codex/skills/maestro-composer/SKILL.md +1 -1
  156. package/.codex/skills/maestro-execute/SKILL.md +13 -4
  157. package/.codex/skills/maestro-fork/SKILL.md +2 -0
  158. package/.codex/skills/maestro-guard/SKILL.md +3 -2
  159. package/.codex/skills/maestro-help/SKILL.md +28 -18
  160. package/.codex/skills/maestro-help/catalog.json +29 -11
  161. package/.codex/skills/maestro-impeccable/SKILL.md +13 -11
  162. package/.codex/skills/maestro-init/SKILL.md +7 -7
  163. package/.codex/skills/maestro-plan/SKILL.md +27 -9
  164. package/.codex/skills/maestro-ralph/SKILL.md +740 -601
  165. package/.codex/skills/maestro-roadmap/SKILL.md +56 -72
  166. package/.codex/skills/maestro-update/SKILL.md +169 -0
  167. package/.codex/skills/maestro-verify/SKILL.md +11 -2
  168. package/.codex/skills/manage-codebase-rebuild/SKILL.md +9 -5
  169. package/.codex/skills/manage-harvest/SKILL.md +11 -3
  170. package/.codex/skills/manage-issue-discover/SKILL.md +1 -1
  171. package/.codex/skills/manage-knowhow/SKILL.md +1 -1
  172. package/.codex/skills/manage-learn/SKILL.md +3 -3
  173. package/.codex/skills/quality-refactor/SKILL.md +2 -2
  174. package/.codex/skills/quality-retrospective/SKILL.md +12 -5
  175. package/.codex/skills/security-audit/SKILL.md +24 -0
  176. package/.codex/skills/spec-remove/SKILL.md +8 -2
  177. package/.codex/skills/team-lifecycle-v4/roles/analyst/role.md +2 -2
  178. package/.codex/skills/team-lifecycle-v4/roles/reviewer/commands/review-spec.md +2 -2
  179. package/.codex/skills/team-lifecycle-v4/roles/writer/role.md +1 -1
  180. package/.codex/skills/team-lifecycle-v4/templates/architecture.md +3 -3
  181. package/.codex/skills/team-lifecycle-v4/templates/epics.md +2 -2
  182. package/.codex/skills/team-lifecycle-v4/templates/product-brief.md +3 -3
  183. package/.codex/skills/team-lifecycle-v4/templates/requirements.md +2 -2
  184. package/README.md +8 -8
  185. package/README.zh-CN.md +8 -8
  186. package/dashboard/dist-server/dashboard/src/server/routes/settings.js +3 -3
  187. package/dashboard/dist-server/dashboard/src/server/routes/settings.js.map +1 -1
  188. package/dist/src/agents/cli-agent-runner.d.ts.map +1 -1
  189. package/dist/src/agents/cli-agent-runner.js +13 -7
  190. package/dist/src/agents/cli-agent-runner.js.map +1 -1
  191. package/dist/src/commands/spec.d.ts.map +1 -1
  192. package/dist/src/commands/spec.js +8 -1
  193. package/dist/src/commands/spec.js.map +1 -1
  194. package/dist/src/tools/spec-init.d.ts +16 -2
  195. package/dist/src/tools/spec-init.d.ts.map +1 -1
  196. package/dist/src/tools/spec-init.js +58 -187
  197. package/dist/src/tools/spec-init.js.map +1 -1
  198. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  199. package/dist/src/tools/spec-loader.js +16 -16
  200. package/dist/src/tools/spec-loader.js.map +1 -1
  201. package/dist/src/tools/spec-seeds.d.ts +33 -0
  202. package/dist/src/tools/spec-seeds.d.ts.map +1 -0
  203. package/dist/src/tools/spec-seeds.js +200 -0
  204. package/dist/src/tools/spec-seeds.js.map +1 -0
  205. package/dist/src/tools/spec-writer.d.ts.map +1 -1
  206. package/dist/src/tools/spec-writer.js +7 -9
  207. package/dist/src/tools/spec-writer.js.map +1 -1
  208. package/dist/src/utils/update-notices.js +12 -0
  209. package/dist/src/utils/update-notices.js.map +1 -1
  210. package/package.json +1 -1
  211. package/templates/business-test-report.json +1 -1
  212. package/templates/index.json +1 -1
  213. package/templates/roadmap.md +15 -9
  214. package/templates/state.json +18 -17
  215. package/workflows/agy-instructions.md +2 -0
  216. package/workflows/analyze.md +79 -11
  217. package/workflows/auto-test.md +12 -7
  218. package/workflows/blueprint.md +431 -0
  219. package/workflows/brainstorm.md +617 -496
  220. package/workflows/business-test.md +7 -7
  221. package/workflows/claude-instructions.md +2 -0
  222. package/workflows/codebase-rebuild.md +4 -4
  223. package/workflows/codex-instructions.md +16 -83
  224. package/workflows/debug.md +1 -1
  225. package/workflows/harvest.md +184 -10
  226. package/workflows/impeccable.md +2 -0
  227. package/workflows/init.md +9 -8
  228. package/workflows/issue-analyze.md +14 -100
  229. package/workflows/issue-discover.md +2 -3
  230. package/workflows/issue-execute.md +1 -1
  231. package/workflows/issue-gaps-analyze.md +2 -0
  232. package/workflows/learn.md +1 -1
  233. package/workflows/maestro-chain-execute.md +10 -228
  234. package/workflows/maestro.md +2 -1
  235. package/workflows/milestone-audit.md +12 -4
  236. package/workflows/milestone-complete.md +14 -9
  237. package/workflows/milestone-release.md +82 -0
  238. package/workflows/plan.md +91 -25
  239. package/workflows/retrospective.md +1 -1
  240. package/workflows/roadmap-common.md +1 -1
  241. package/workflows/roadmap.md +14 -4
  242. package/workflows/spec-generate.md +26 -13
  243. package/workflows/specs-add.md +6 -1
  244. package/workflows/specs-load.md +6 -1
  245. package/workflows/specs-setup.md +6 -1
  246. package/workflows/sync.md +13 -0
  247. package/workflows/tools-spec.md +4 -0
  248. package/workflows/ui-design.md +5 -5
  249. package/workflows/ui-style.md +1 -1
  250. package/workflows/wiki-manage.md +2 -0
  251. package/.agents/agents/conceptual-planning-agent.md +0 -247
  252. package/.agy/agents/conceptual-planning-agent.md +0 -244
  253. package/.claude/agents/conceptual-planning-agent.md +0 -245
@@ -1,66 +1,68 @@
1
1
  ---
2
2
  name: maestro-roadmap
3
- description: Generate roadmap from requirements (light or full mode)
4
- argument-hint: "\"<requirements>\" [--mode light|full] [-y|--yes] [-c] [--phases N] [--skip-research] [--from-brainstorm SESSION-ID] [--revise [instructions]] [--review]"
3
+ description: Generate milestone/phase roadmap from requirements or upstream context
4
+ argument-hint: "\"<requirements>\" [-m progressive|direct|auto] [-y|--yes] [-c] [--phases N] [--skip-research] [--from <source>] [--from-brainstorm SESSION-ID] [--revise [instructions]] [--review]"
5
5
  allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, request_user_input
6
6
  ---
7
7
 
8
8
  <purpose>
9
- Unified 2-wave roadmap generation using `spawn_agents_on_csv` with dual modes:
9
+ Generate a milestone/phase roadmap using `spawn_agents_on_csv` with 2-wave analysis:
10
10
 
11
- - **Light** (default): Wave 1 parallel analysis (scope, risk, dependency). Wave 2 assembly -> roadmap.md.
12
- - **Full** (`--mode full`): Wave 1 parallel research (domain, competitive, tech stack). Wave 2 synthesis -> 7-phase spec chain + roadmap.md.
11
+ Wave 1: parallel analysis (scope, risk, dependency). Wave 2: assembly -> roadmap.md with Milestone > Phase hierarchy.
13
12
 
14
13
  Additional: `--revise` (modify existing roadmap), `--review` (read-only health check).
14
+
15
+ For formal specification documents (Product Brief, PRD, Architecture, Epics), use `maestro-blueprint` instead.
15
16
  </purpose>
16
17
 
17
18
  <context>
18
19
  $ARGUMENTS -- requirement/idea text or @file reference, plus optional flags.
19
20
 
20
21
  **Flags**:
21
- - `--mode light|full`: Execution mode (default: light)
22
22
  - `-y, --yes`: Skip all confirmations
23
- - `-m progressive|direct|auto`: Decomposition strategy (default: auto, light only)
24
- - `--phases N`: Target phase count (light only)
25
- - `--revise [instructions]`: Revise existing roadmap preserving completed phases (light only)
26
- - `--review`: Read-only roadmap health assessment (light only)
27
- - `--skip-research`: Skip Wave 1, jump to doc generation (full only)
28
- - `--from-brainstorm SESSION-ID`: Import guidance-specification.md as seed
29
-
30
- **Session**: `.workflow/.csv-wave/{YYYYMMDD}-roadmap[-full]-{slug}/`
23
+ - `-m progressive|direct|auto`: Decomposition strategy (default: auto)
24
+ - `--phases N`: Target phase count
25
+ - `--revise [instructions]`: Revise existing roadmap preserving completed phases
26
+ - `--review`: Read-only roadmap health assessment
27
+ - `--from <source>`: Load upstream context package (brainstorm:ID, blueprint:BLP-xxx, analyze:ANL-xxx, @file, or path)
28
+ - `--from-brainstorm SESSION-ID`: (backward compat alias for `--from brainstorm:ID`)
29
+
30
+ **Session**: `.workflow/.csv-wave/{YYYYMMDD}-roadmap-{slug}/`
31
31
  **Output**: tasks.csv, results.csv, discoveries.ndjson, context.md, `.workflow/roadmap.md`
32
- **Full mode additional**: Spec package in `.workflow/.spec/SPEC-{slug}-{date}/`
33
32
  </context>
34
33
 
34
+ <interview_protocol>
35
+ Interview the user relentlessly until shared understanding is reached. Active only in interactive mode; skip when `-y/--yes`, `--revise`, `--review`, `-c`, or input is already specific (clear requirement + mode).
36
+
37
+ - One decision per turn via request_user_input with 2–4 options + a (Recommended) default. The user controls termination — keep interviewing until convergence; they can interrupt naturally at any time.
38
+ - Search-first when uncertain: before asking, resolve via `state.json`, existing `roadmap.md`, `project.md`, `maestro spec load`, `maestro wiki search`, Glob/Grep/Read, or — for open-ended multi-file scans — `maestro delegate ... --role explore`. Never ask what code or memory can verify; never bounce your own ambiguity back to the user — search first, then ask only what truly needs human judgment.
39
+ - Writeback cadence: each settled decision is immediately appended/updated in the `Roadmap Decisions` section at the top of `.workflow/roadmap.md` (create the section if absent). Do NOT batch writeback to the end — partial decisions must already be on disk before the next question.
40
+ - Walk the decision dependency tree strictly: mode → requirement scope → decomposition strategy → phase dependencies/order. Do not open the next branch until the current one is settled.
41
+ - Scope guard: only decide the shape of the roadmap. Do not pre-resolve intra-phase task breakdown — that belongs to `plan`.
42
+
43
+ Decision points: scope (MVP / complete / phased) → strategy (progressive / direct / auto) → milestone boundaries → phase dependencies and order.
44
+
45
+ Exit: on consensus or explicit user signal to proceed, finalize the `Roadmap Decisions` section (rows already populated incrementally). Schema:
46
+ `| # | Decision | Choice | Source (user / code / default) |`
47
+ </interview_protocol>
48
+
35
49
  <csv_schema>
36
50
 
37
- ### tasks.csv -- Light Mode
51
+ ### tasks.csv
38
52
 
39
53
  ```csv
40
54
  id,title,description,analysis_focus,deps,context_from,wave,status,findings,error
41
55
  "1","Scope Analysis","Identify features, MVP boundaries, must-have vs nice-to-have, size estimates.","scope","","","1","","",""
42
56
  "2","Risk Analysis","Technical/project risks, unknowns, feasibility, risk levels, mitigations.","risk","","","1","","",""
43
57
  "3","Dependency Analysis","Feature dependencies, ordering constraints, parallel-safe groups, external deps.","dependency","","","1","","",""
44
- "4","Roadmap Assembly","Synthesize findings into roadmap.md: phases, milestones, success criteria.","","1;2;3","1;2;3","2","","",""
58
+ "4","Roadmap Assembly","Synthesize findings into roadmap.md: Milestone > Phase hierarchy, success criteria.","","1;2;3","1;2;3","2","","",""
45
59
  ```
46
60
 
47
- ### tasks.csv -- Full Mode
48
-
49
- ```csv
50
- id,title,description,research_focus,doc_phase,deps,context_from,wave,status,findings,output_file,error
51
- "1","Domain Research","Target users, market needs, existing solutions, terminology.","domain","","","","1","","","",""
52
- "2","Competitive Analysis","Feature comparison, UX patterns, gaps, opportunities.","competitive","","","","1","","","",""
53
- "3","Tech Stack Analysis","Languages, frameworks, databases, constraints, scalability.","tech_stack","","","","1","","","",""
54
- "4","Document Chain","7-phase spec: Product Brief, PRD (REQ-*/NFR-*), Architecture (ADR-*), Data Model, API, UI Wireframes, Epic-to-Roadmap (EPIC-*). + glossary.json.","","1-7","1;2;3","1;2;3","2","","","",""
55
- ```
56
-
57
- **Shared column semantics**:
58
- - Input: id (unique string), title, description (detailed instructions), deps (semicolon-sep IDs), context_from (IDs whose findings needed), wave (1=analysis/research, 2=assembly/synthesis)
61
+ **Column semantics**:
62
+ - Input: id (unique string), title, description (detailed instructions), analysis_focus (scope/risk/dependency), deps (semicolon-sep IDs), context_from (IDs whose findings needed), wave (1=analysis, 2=assembly)
59
63
  - Output: status (pending->completed/failed/skipped), findings (max 500 chars), error
60
- - Light-only: analysis_focus (scope/risk/dependency)
61
- - Full-only: research_focus (domain/competitive/tech_stack), doc_phase (1-7), output_file
62
64
 
63
- Wave 1: 3 analysis/research rows (parallel). Wave 2: 1 assembly/synthesis row.
65
+ Wave 1: 3 analysis rows (parallel). Wave 2: 1 assembly row.
64
66
  </csv_schema>
65
67
 
66
68
  <invariants>
@@ -74,12 +76,11 @@ Wave 1: 3 analysis/research rows (parallel). Wave 2: 1 assembly/synthesis row.
74
76
  <state_machine>
75
77
 
76
78
  <states>
77
- S_PARSE -- 解析参数、检测 mode/operation PERSIST: --
78
- S_INPUT -- 解析输入(text/@file/brainstorm PERSIST: --
79
+ S_PARSE -- 解析参数、检测 operation PERSIST: --
80
+ S_INPUT -- 解析输入(text/@file/upstream context PERSIST: --
79
81
  S_CSV_GEN -- 生成 tasks.csv PERSIST: tasks.csv
80
- S_WAVE_1 -- Analysis/Research (parallel spawn) PERSIST: findings + tasks.csv
81
- S_WAVE_2 -- Assembly/Synthesis (single agent spawn) PERSIST: roadmap.md [+ spec package]
82
- S_SPEC_GEN -- Spec package generation (full mode only) PERSIST: .workflow/.spec/SPEC-*/
82
+ S_WAVE_1 -- Analysis (parallel spawn) PERSIST: findings + tasks.csv
83
+ S_WAVE_2 -- Assembly (single agent spawn) PERSIST: roadmap.md
83
84
  S_AGGREGATE -- 精炼、评估、输出 PERSIST: context.md + .workflow/roadmap.md
84
85
  </states>
85
86
 
@@ -91,21 +92,16 @@ S_PARSE:
91
92
  -> REVIEW_FLOW WHEN: --review (read-only health assessment)
92
93
 
93
94
  S_INPUT:
94
- -> S_CSV_GEN DO: parse requirement (text/@file), import brainstorm if --from-brainstorm, codebase detection, load specs
95
+ -> S_CSV_GEN DO: parse requirement (text/@file), load context-package.json if --from, codebase detection, load specs
95
96
 
96
97
  S_CSV_GEN:
97
- -> S_WAVE_1 WHEN: normal pipeline DO: generate mode-specific CSV
98
- -> S_WAVE_2 WHEN: --skip-research DO: generate wave 2 only
98
+ -> S_WAVE_1 DO: generate analysis CSV
99
99
 
100
100
  S_WAVE_1:
101
101
  -> S_WAVE_2 DO: A_SPAWN_WAVE_1
102
102
 
103
103
  S_WAVE_2:
104
- -> S_SPEC_GEN WHEN: full mode DO: A_SPAWN_WAVE_2
105
- -> S_AGGREGATE WHEN: light mode DO: A_SPAWN_WAVE_2
106
-
107
- S_SPEC_GEN:
108
- -> S_AGGREGATE DO: generate 7-phase spec package per spec-generate.md
104
+ -> S_AGGREGATE DO: A_SPAWN_WAVE_2
109
105
 
110
106
  S_AGGREGATE:
111
107
  -> END DO: A_AGGREGATE_RESULTS
@@ -118,16 +114,15 @@ S_AGGREGATE:
118
114
 
119
115
  Filter wave==1 -> write wave-1.csv -> `spawn_agents_on_csv`.
120
116
 
121
- **Light mode agents**: scope analysis (feature inventory + priority), risk analysis (unknowns + mitigations), dependency analysis (dependency graph + critical path).
122
- **Full mode agents**: domain research (users, market, solutions), competitive analysis (feature matrix, gaps), tech stack analysis (feasibility, constraints).
117
+ **Agents**: scope analysis (feature inventory + priority), risk analysis (unknowns + mitigations), dependency analysis (dependency graph + critical path).
123
118
 
124
119
  Merge results -> master tasks.csv.
125
120
 
126
121
  ### A_SPAWN_WAVE_2
127
122
 
128
- Build prev_context from wave 1. Inject strategy + --phases constraint (light mode). Spawn.
123
+ Build prev_context from wave 1. Inject strategy + `--phases` constraint. Spawn.
129
124
 
130
- **Light mode**: Assembly agent produces roadmap.md with phases (goal, depends-on, requirements, success criteria), milestones, scope decisions.
125
+ Assembly agent produces roadmap.md with Milestone > Phase hierarchy (goal, depends-on, requirements, success criteria), scope decisions.
131
126
 
132
127
  **Strategy selection** via uncertainty assessment (5 factors):
133
128
  | Factor | Low | Medium | High |
@@ -139,26 +134,15 @@ Build prev_context from wave 1. Inject strategy + --phases constraint (light mod
139
134
  | Requirement stability | locked | some flux | evolving |
140
135
 
141
136
  >=3 high -> progressive, >=3 low -> direct, else -> ask (or auto if -y).
142
- **Full mode**: Document chain agent produces 7-phase spec package + glossary.json.
143
137
 
144
138
  ### A_AGGREGATE_RESULTS
145
139
 
146
140
  1. Export results.csv
147
141
  2. Interactive refinement (max 3 rounds, skip if -y): Approve / Refine / Regenerate
148
- 3. **Full mode readiness** (4 dimensions, 25% each): Completeness, Consistency, Traceability, Depth. Gate: >=80% pass, 60-79% review with caveats, <60% auto-fix attempt
149
- 4. Generate context.md (light: summary + analysis findings + roadmap stats; full: research findings + doc chain status + readiness scores)
150
- 5. Write .workflow/roadmap.md (both modes)
151
- 6. Write spec package to .workflow/.spec/SPEC-{slug}-{date}/ (full mode):
152
- ```
153
- SPEC-{slug}-{date}/
154
- +-- spec-config.json, product-brief.md, glossary.json, spec-summary.md
155
- +-- requirements/ (_index.md, REQ-NNN-{slug}.md, NFR-{type}-NNN-{slug}.md)
156
- +-- architecture/ (_index.md, ADR-NNN-{slug}.md)
157
- +-- epics/ (_index.md, EPIC-NNN-{slug}.md)
158
- +-- readiness-report.md
159
- ```
160
- 7. Update state.json milestones + current_milestone
161
- 8. Next-step routing: need analysis -> maestro-analyze; ready to plan -> maestro-plan; UI first -> maestro-impeccable build; full mode setup -> maestro-init
142
+ 3. Generate context.md (summary + analysis findings + roadmap stats)
143
+ 4. Write .workflow/roadmap.md with Milestone > Phase hierarchy
144
+ 5. Update state.json milestones + current_milestone
145
+ 6. Next-step routing: need analysis -> maestro-analyze; ready to plan -> maestro-plan; UI first -> maestro-impeccable build; need formal specs -> maestro-blueprint
162
146
 
163
147
  </actions>
164
148
 
@@ -182,20 +166,20 @@ Protocol: read before analysis, append-only, dedup by type+key.
182
166
  | Condition | Recovery |
183
167
  |-----------|----------|
184
168
  | No requirement text provided | Abort: "Requirement text or @file required" |
185
- | Brainstorm session not found | Abort with available sessions list |
169
+ | Context source not found (--from / --from-brainstorm) | Abort with available sessions/sources list |
186
170
  | roadmap.md not found (--revise/--review) | Run maestro-roadmap first |
187
171
  | All Wave 1 agents failed | Wave 2 in degraded mode (seed only) |
188
- | Wave 2 agent failed (light) | Abort: "Roadmap generation failed" |
189
- | Wave 2 agent failed (full) | Export partial output, log issues |
190
- | Readiness < 60% (full) | Log issues, proceed with available output |
172
+ | Wave 2 agent failed | Abort: "Roadmap generation failed" |
173
+ | Readiness < 60% | Log issues, proceed with available output |
191
174
  </error_codes>
192
175
 
193
176
  <success_criteria>
177
+ - [ ] Interactive mode: interview decision table appended to `.workflow/roadmap.md` "Roadmap Decisions" section
194
178
  - [ ] Wave 1 agents completed (analysis or research)
195
- - [ ] Wave 2 produced output (roadmap.md + optional spec package)
196
- - [ ] .workflow/roadmap.md written, state.json updated
179
+ - [ ] Wave 2 produced output (roadmap.md)
180
+ - [ ] .workflow/roadmap.md written with Milestone > Phase hierarchy, state.json updated
197
181
  - [ ] context.md generated
198
- - [ ] Light: uncertainty assessed, strategy selected, phases with milestones + success criteria
199
- - [ ] Full: spec package in .workflow/.spec/, readiness scored on 4 dimensions
182
+ - [ ] Uncertainty assessed, strategy selected, milestones with phases + success criteria
183
+ - [ ] Artifact registered in state.json with milestone entries
200
184
  </success_criteria>
201
185
  </output>
@@ -0,0 +1,169 @@
1
+ ---
2
+ name: maestro-update
3
+ description: Detect version, preview changes, apply workflow upgrades
4
+ argument-hint: "[--dry-run] [--force]"
5
+ allowed-tools: Read, Write, Edit, Bash, Glob, Grep, request_user_input
6
+ ---
7
+ <purpose>
8
+ Detect the current `.workflow/` schema version, show available migrations, and interactively apply them step-by-step. Uses a migration registry that supports incremental version upgrades (e.g., 1.0 → 2.0 → 3.0).
9
+
10
+ Each migration step is previewed before execution. The user confirms each step in a loop.
11
+ </purpose>
12
+
13
+ <context>
14
+ $ARGUMENTS — optional flags.
15
+
16
+ **Flags:**
17
+ - `--dry-run` -- Preview migration plan without executing
18
+ - `--force` -- Skip confirmation prompts (apply all pending migrations)
19
+
20
+ **Migration registry:** `src/migrations/`
21
+ - Each migration is a standalone file (e.g., `v1-to-v2.ts`) exporting a `MigrationDef`
22
+ - All migrations are registered via `src/migrations/index.ts`
23
+ - Registry auto-chains: detects current version → walks chain → applies in order
24
+ - To add a new migration: create `src/migrations/v{N}-to-v{N+1}.ts`, register in `index.ts`
25
+
26
+ **CLI runner:** `src/migrations/run.ts`
27
+ - Executable entrypoint: `npx tsx src/migrations/run.ts [root] [--dry-run] [--force] [--json]`
28
+ - Outputs JSON (with `--json`) or human-readable text
29
+
30
+ **State version source:** `.workflow/state.json` → `version` field
31
+ </context>
32
+
33
+ <execution>
34
+
35
+ ### Step 1: Detect Current State
36
+
37
+ ```
38
+ 1. Read .workflow/state.json
39
+ 2. Extract version field (default "1.0" if missing)
40
+ 3. Display:
41
+
42
+ === Maestro Workflow Update ===
43
+ Project: {project_name}
44
+ Version: {version}
45
+ Location: {.workflow/ path}
46
+ ```
47
+
48
+ ### Step 2: Dry-Run Preview
49
+
50
+ Run the migration CLI in dry-run + JSON mode to get the full plan:
51
+
52
+ ```bash
53
+ npx tsx src/migrations/run.ts "$(pwd)" --dry-run --json
54
+ ```
55
+
56
+ Parse the JSON output. If status is `up-to-date`:
57
+ ```
58
+ Already up to date (v{version})
59
+ ```
60
+ → EXIT
61
+
62
+ Otherwise display the migration plan:
63
+ ```
64
+ Pending Migrations ({N} step(s)):
65
+
66
+ 1. [v{from} → v{to}] {name}
67
+ {description}
68
+
69
+ 2. [v{from} → v{to}] {name}
70
+ {description}
71
+ ```
72
+
73
+ If `--dry-run` flag was passed by user → display plan and EXIT.
74
+
75
+ ### Step 3: Interactive Confirmation Loop
76
+
77
+ For each migration step (unless `--force`):
78
+
79
+ ```
80
+ LOOP for step_index = 1 to N:
81
+
82
+ Display:
83
+ --- Step {step_index}/{N}: {name} ---
84
+ Version: v{from} → v{to}
85
+
86
+ Changes:
87
+ {description, indented}
88
+
89
+ IF NOT --force:
90
+ AskUserQuestion: "Apply this migration?"
91
+ Options: [yes / skip / abort]
92
+
93
+ - "yes" → proceed to Step 4 (execute)
94
+ - "skip" → WARN "Skipping may break the migration chain"
95
+ continue to next step
96
+ - "abort" → display summary of what was applied so far → EXIT
97
+
98
+ IF --force:
99
+ → proceed to Step 4 (execute)
100
+ ```
101
+
102
+ ### Step 4: Execute Single Migration
103
+
104
+ ```
105
+ 1. Create backup:
106
+ Bash: cp .workflow/state.json .workflow/state.json.backup-v{from}-{timestamp}
107
+
108
+ 2. Run migration:
109
+ Bash: npx tsx src/migrations/run.ts "$(pwd)" --json
110
+
111
+ NOTE: The runner executes ALL pending migrations. For step-by-step control,
112
+ read state.json, call the migration function directly, or use the runner
113
+ which stops on first failure.
114
+
115
+ 3. Parse result JSON and display:
116
+
117
+ {status_icon} Step {N} completed: {name}
118
+ Summary: {summary}
119
+ Changes:
120
+ - {change_1}
121
+ - {change_2}
122
+ - ...
123
+
124
+ 4. If failed:
125
+ Display: "Migration failed: {summary}"
126
+ Display: "Backup available at: {backup_path}"
127
+ Display: "Restore with: cp {backup_path} .workflow/state.json"
128
+ → EXIT
129
+
130
+ 5. Continue loop to next step
131
+ ```
132
+
133
+ ### Step 5: Summary
134
+
135
+ After all steps completed (or user aborted):
136
+
137
+ ```
138
+ === Migration Complete ===
139
+ Applied: {applied_count} / {total_count} migration(s)
140
+ Skipped: {skipped_count}
141
+ Version: v{original} → v{final}
142
+ Backup: .workflow/state.json.backup-v{original}-{timestamp}
143
+
144
+ Next steps:
145
+ /manage-status -- Verify project state
146
+ /maestro -- Continue workflow
147
+ ```
148
+
149
+ </execution>
150
+
151
+ <error_codes>
152
+ | Code | Severity | Condition | Recovery |
153
+ |------|----------|-----------|----------|
154
+ | E001 | error | .workflow/state.json not found | Run /maestro-init first |
155
+ | E002 | error | state.json parse error | Check file for corruption |
156
+ | E003 | error | Migration function failed | Restore from backup |
157
+ | W001 | warning | Skipped migration may break version chain | Re-run /maestro-update later |
158
+ | W002 | warning | tsx not available | Install tsx: npm i -D tsx |
159
+ </error_codes>
160
+
161
+ <success_criteria>
162
+ - [ ] Current version detected from state.json
163
+ - [ ] Dry-run preview shows full migration plan without execution
164
+ - [ ] Each step confirmed interactively (unless --force)
165
+ - [ ] Backup created before each migration
166
+ - [ ] Migration executed and result displayed with change list
167
+ - [ ] Abort stops cleanly with partial summary
168
+ - [ ] Summary shows applied/skipped counts and version change
169
+ </success_criteria>
@@ -94,9 +94,18 @@ S_AGGREGATE -- 生成报告、创建 issues、修复计划 PERSIST:
94
94
  <transitions>
95
95
 
96
96
  S_PARSE:
97
- -> S_MUST_HAVE WHEN: phase resolved DO: load index.json, plan.json, TASK-*.json, summaries, uat.md, ARCHITECTURE.md
97
+ -> S_MUST_HAVE WHEN: phase resolved DO: load index.json, plan.json, TASK-*.json, summaries, uat.md, ARCHITECTURE.md; **D-007 milestone reverse lookup** for numeric phase
98
98
  -> ERROR WHEN: phase not found
99
99
 
100
+ **D-007 milestone reverse lookup** (numeric phase arg):
101
+ ```
102
+ resolve_milestone(phase_number):
103
+ for ms in state.json.milestones[]:
104
+ if str(phase_number) in ms.phase_slugs: return ms.id
105
+ return state.json.current_milestone # fallback
106
+ ```
107
+ Write resolved milestone into `session.milestone` and VRF artifact registration. NEVER read `current_milestone` directly for phase-scoped runs.
108
+
100
109
  S_MUST_HAVE:
101
110
  -> S_CSV_GEN DO: establish must-haves from success_criteria (primary), convergence.criteria (per-task), derived behaviors (fallback). Decompose into truth/artifact/wiring layers.
102
111
 
@@ -202,7 +211,7 @@ Protocol: read before analysis, append-only, dedup by type+key.
202
211
  - [ ] Issues auto-created for gaps + blocker anti-patterns
203
212
  - [ ] Post-verify knowledge inquiry triggered when applicable
204
213
  - [ ] Phase index.json updated with verification status
205
- - [ ] VRF artifact registered in state.json
214
+ - [ ] VRF artifact registered in state.json (numeric scope: milestone resolved via D-007 `phase_slugs` reverse lookup, NOT direct `current_milestone` read)
206
215
  - [ ] Gap-fix closure loop documented: gaps → plan --gaps → execute → verify (re-run)
207
216
  - [ ] Next step routed (quality-review if passed, plan --gaps if gaps, quality-auto-test if low coverage)
208
217
  - [ ] discoveries.ndjson append-only throughout
@@ -81,13 +81,15 @@ When `--yes` or `-y`: Auto-confirm rebuild (implies --force), skip all prompts.
81
81
 
82
82
  ```csv
83
83
  id,title,description,doc_dimension,output_path,deps,context_from,wave
84
- "1","Component Scanner","Scan all source directories for components: models, services, controllers, utils, types, config, middleware, core modules. For each component extract exported symbols, determine type, record code locations. Output JSON array of component entries with id (TC-NNN), name, type, code_locations, symbols.","components",".workflow/codebase/doc-index.json#components","","","1"
85
- "2","Feature Mapper","Group discovered components by domain/functional area using directory proximity, naming patterns, and import relationships. Map features to requirements if .workflow/.spec/ exists. Output JSON array of feature entries with id (FT-NNN), name, status, component_ids, requirement_ids, phase.","features",".workflow/codebase/doc-index.json#features","","","1"
86
- "3","Requirement Linker","If .workflow/.spec/ exists, scan SPEC-*/requirements/REQ-*.md files. Parse requirement metadata (title, priority, acceptance_criteria). Match requirements to features by keyword analysis. Also scan for ADR-*.md architecture decisions. Output JSON arrays for requirements and architecture_decisions.","requirements",".workflow/codebase/doc-index.json#requirements","","","1"
87
- "4","Tech Registry Writer","For each component discovered, generate a markdown documentation file in .workflow/codebase/tech-registry/{slug}.md with: ID, type, features, code locations, exported symbols, dependencies. Generate _index.md with component table. Output file count and paths.","tech-registry",".workflow/codebase/tech-registry/","","","1"
88
- "5","Feature Map Writer","For each feature discovered, generate a markdown documentation file in .workflow/codebase/feature-maps/{slug}.md with: ID, status, phase, requirements, component table. Generate _index.md with feature table. Output file count and paths.","feature-maps",".workflow/codebase/feature-maps/","","","1"
84
+ "1","Component Scanner","Scan all source directories for components: models, services, controllers, utils, types, config, middleware, core modules. For each component extract exported symbols, determine type, record code locations. Return JSON array of component entries with id (TC-NNN), name, type, code_locations, symbols via output_schema. Do NOT write files — orchestrator assembles doc-index.json in Phase 3.","components","<ABS_WORKFLOW>/codebase/doc-index.json#components","","","1"
85
+ "2","Feature Mapper","Group discovered components by domain/functional area using directory proximity, naming patterns, and import relationships. Map features to requirements if <ABS_WORKFLOW>/blueprint/ exists. Return JSON array of feature entries with id (FT-NNN), name, status, component_ids, requirement_ids, phase via output_schema. Do NOT write files.","features","<ABS_WORKFLOW>/codebase/doc-index.json#features","","","1"
86
+ "3","Requirement Linker","If <ABS_WORKFLOW>/blueprint/ exists, scan BLP-*/requirements/REQ-*.md files. Parse requirement metadata (title, priority, acceptance_criteria). Match requirements to features by keyword analysis. Also scan for ADR-*.md architecture decisions. Return JSON arrays for requirements and architecture_decisions via output_schema. Do NOT write files.","requirements","<ABS_WORKFLOW>/codebase/doc-index.json#requirements","","","1"
87
+ "4","Tech Registry Writer","For each component discovered, use the Write tool to create a markdown documentation file at <ABS_WORKFLOW>/codebase/tech-registry/{slug}.md with: ID, type, features, code locations, exported symbols, dependencies. Also write <ABS_WORKFLOW>/codebase/tech-registry/_index.md with the component table. After all writes, verify every intended file exists with Glob and return file count + absolute paths via output_schema. MUST use the Write tool — files on disk are the deliverable, do NOT return file content as text.","tech-registry","<ABS_WORKFLOW>/codebase/tech-registry/","","","1"
88
+ "5","Feature Map Writer","For each feature discovered, use the Write tool to create a markdown documentation file at <ABS_WORKFLOW>/codebase/feature-maps/{slug}.md with: ID, status, phase, requirements, component table. Also write <ABS_WORKFLOW>/codebase/feature-maps/_index.md with the feature table. After all writes, verify every intended file exists with Glob and return file count + absolute paths via output_schema. MUST use the Write tool — files on disk are the deliverable, do NOT return file content as text.","feature-maps","<ABS_WORKFLOW>/codebase/feature-maps/","","","1"
89
89
  ```
90
90
 
91
+ **Path resolution (orchestrator MUST do BEFORE writing tasks.csv)**: substitute `<ABS_WORKFLOW>` with the absolute path to the project's `.workflow/` directory (e.g. `D:/maestro2/.workflow`). Agent Write tool requires absolute paths — passing relative `.workflow/...` literals will fail.
92
+
91
93
  **Columns**:
92
94
 
93
95
  | Column | Phase | Description |
@@ -125,6 +127,8 @@ Single wave generates `wave-1.csv`. No `prev_context` needed (all tasks independ
125
127
  6. **Single Wave**: All generators are independent, no wave ordering needed
126
128
  7. **Cleanup Temp Files**: Remove wave-1.csv after results are merged
127
129
  8. **DO NOT STOP**: Execute until all generators complete or fail
130
+ 9. **Absolute Paths Only**: All paths in `description` and `output_path` MUST be absolute before tasks.csv is written. Orchestrator substitutes `<ABS_WORKFLOW>` placeholder; never let it leak into a spawned agent's prompt.
131
+ 10. **Writer vs Returner Split**: Tasks 1-3 return data via `output_schema` (no file writes). Tasks 4-5 MUST write files via Write tool + verify with Glob. Mixing the two contracts (e.g., returning markdown content as text from tasks 4-5) is a contract violation.
128
132
  </invariants>
129
133
 
130
134
  <execution>
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: manage-harvest
3
3
  description: Extract knowledge from artifacts into wiki/spec/issues
4
- argument-hint: "[<session-id|path>] [--to wiki|spec|issue|auto] [--source <type>] [--recent N] [--dry-run] [-y]"
4
+ argument-hint: "[<session-id|path>] [--to wiki|spec|issue|auto] [--source <type>] [--recent N] [--dry-run] [-y] [--prune] [--age N]"
5
5
  allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
6
6
  ---
7
7
 
@@ -31,6 +31,8 @@ $ARGUMENTS — session-id, path, or empty for scan mode.
31
31
  - `--dry-run` — Preview without writing
32
32
  - `-y` — Skip confirmations
33
33
  - `--min-confidence N` — Minimum 0.0-1.0 (default: 0.5)
34
+ - `--prune` — State hygiene mode: classify artifacts, graduate harvested → knowhow, archive from state.json, prune accumulated_context
35
+ - `--age N` — Graduation age threshold in days (default: 14). Used with `--prune`
34
36
 
35
37
  **Source registry:**
36
38
  | Source | Scan Path | Key Files |
@@ -46,7 +48,7 @@ $ARGUMENTS — session-id, path, or empty for scan mode.
46
48
  </context>
47
49
 
48
50
  <execution>
49
- Follow '~/.maestro/workflows/harvest.md' Stages 1–8.
51
+ Follow '~/.maestro/workflows/harvest.md' Stages 1–8 (standard mode) or Stage 9 (`--prune` mode).
50
52
 
51
53
  **Key invariants:**
52
54
  1. **Read-only until Stage 6** — extraction/classification in-memory only
@@ -62,9 +64,11 @@ Follow '~/.maestro/workflows/harvest.md' Stages 1–8.
62
64
  - Quality enforcement rules → `quality` category
63
65
  - Wiki: `maestro wiki create --type <type> --slug harvest-<source_type>-<short_id>`
64
66
  - Spec: `maestro wiki append spec-<file> --body "<content>" --keywords "<kws>"` (unified write path) or `Skill({ skill: "spec-add", args: "<category> <content>" })`
65
- - Issue: append to `issues.jsonl` matching canonical schema
67
+ - Issue: append to `issues.jsonl` matching canonical schema, with `source: "harvest"` field (distinguishes from `manage-issue-discover`, which uses `source: "discover"` — required for cross-skill dedup when both write concurrently)
66
68
 
67
69
  **Next steps:** `/manage-wiki health`, `maestro wiki list --type note`, `/wiki-connect --fix`, `/wiki-digest`, `/manage-issue list --source harvest`
70
+
71
+ **Prune mode** (`--prune`): Classifies artifacts (active/graduated/stale/protected), graduates harvested artifacts to wiki knowhow, archives from `artifacts[]` → `artifact_archive[]`, prunes resolved entries from accumulated_context. Files on disk are never deleted. Always backs up state.json before writing.
68
72
  </execution>
69
73
 
70
74
  <error_codes>
@@ -88,4 +92,8 @@ Follow '~/.maestro/workflows/harvest.md' Stages 1–8.
88
92
  - [ ] harvest-log.jsonl updated with provenance
89
93
  - [ ] harvest-report-{date}.md written
90
94
  - [ ] No source artifacts modified
95
+ - [ ] If --prune: artifacts classified (active/graduated/stale/protected)
96
+ - [ ] If --prune: graduated artifacts → knowhow + artifact_archive[]
97
+ - [ ] If --prune: accumulated_context pruned (resolved deferred/blockers, deduplicated decisions)
98
+ - [ ] If --prune: state.json backed up before modification
91
99
  </success_criteria>
@@ -155,7 +155,7 @@ Also writes to:
155
155
  5. **Discovery Board is Append-Only**: Never clear, modify, or recreate discoveries.ndjson
156
156
  6. **Skip on Failure**: If all perspective agents failed, skip dedup
157
157
  7. **Evidence Required**: Every finding must have file:line reference -- no speculative issues
158
- 8. **Dedup Before Create**: Never append to issues.jsonl without deduplication
158
+ 8. **Dedup Before Create**: Never append to issues.jsonl without deduplication. Every appended record MUST include `source: "discover"` so concurrent writers (e.g. `manage-harvest` uses `source: "harvest"`) can be safely distinguished and deduplicated cross-skill.
159
159
  9. **Cleanup Temp Files**: Remove wave-{N}.csv after results are merged
160
160
  10. **DO NOT STOP**: Continuous execution until all waves complete
161
161
  </invariants>
@@ -73,7 +73,7 @@ After write operations, verify:
73
73
  <error_codes>
74
74
  | Code | Severity | Description |
75
75
  |------|----------|-------------|
76
- | E001 | error | No stores found — run `Skill({ skill: "manage-knowhow-capture" })` or create MEMORY.md |
76
+ | E001 | error | No stores found — for workflow store run `Skill({ skill: "manage-knowhow-capture" })`; for system store run `Skill({ skill: "manage-memory-capture" })` or create MEMORY.md |
77
77
  | E002 | error | Entry ID or filename not found |
78
78
  | E003 | error | Prune requires at least one filter flag |
79
79
  | E004 | error | Cannot delete MEMORY.md — use `edit` subcommand instead |
@@ -6,7 +6,7 @@ allowed-tools: Read, Write, Edit, Bash, Glob, Grep
6
6
  ---
7
7
 
8
8
  <purpose>
9
- Pure file-operation CRUD skill for the workflow knowhow library. No agent spawning, no CLI calls, no LLM inference — just parse-infer-append-confirm. Complements `quality-retrospective`: where retrospective extracts insights in bulk from completed phases, `manage-learn` captures one timeless insight at a time during active work. Both write to the same `specs/learnings.md` store, disambiguated by `source` and `lens` fields.
9
+ Pure file-operation CRUD skill for the workflow knowhow library. No agent spawning, no CLI calls, no LLM inference — just parse-infer-append-confirm. Complements `quality-retrospective`: where retrospective extracts insights in bulk from completed phases, `manage-learn` captures one timeless insight at a time during active work. Both write to the same `.workflow/specs/learnings.md` store, disambiguated by `source` and `lens` fields.
10
10
 
11
11
  ```
12
12
  Parse Mode → Bootstrap Store → Execute Mode → Confirm
@@ -94,7 +94,7 @@ Verify `.workflow/` exists (E001 if not). If `.workflow/specs/learnings.md` miss
94
94
  2. **Auto-link phase** from `state.json` artifact registry. `--phase 0` forces null.
95
95
  3. **Generate INS-id**: `INS-{8 hex}` from `hash(insightText + timestamp)`.
96
96
  4. **Build row** with fields: id, title (first 80 chars), summary, source="manual", lens=null, category, tags (includes "manual"), phase, phase_slug, confidence, routed_to=null, created_at.
97
- 5. **Append** entry to `specs/learnings.md` (append-only, never rewrite).
97
+ 5. **Append** entry to `.workflow/specs/learnings.md` (append-only, never rewrite).
98
98
  6. WikiIndexer auto-indexes the new entry (no manual index update needed).
99
99
 
100
100
  #### List Mode
@@ -129,7 +129,7 @@ Capture mode: display ID, category, phase, confidence, tags, and next-step comma
129
129
  - [ ] Mode parsed correctly (capture, list, search, show)
130
130
  - [ ] Learning store bootstrapped on first use
131
131
  - [ ] Capture: category inferred from keywords, phase auto-linked, INS-id generated
132
- - [ ] Capture: entry appended to specs/learnings.md (append-only)
132
+ - [ ] Capture: entry appended to .workflow/specs/learnings.md (append-only)
133
133
  - [ ] List: filters applied, newest-first, respects --limit
134
134
  - [ ] Search: grep with weighted ranking across title/tags/summary
135
135
  - [ ] Show: full record displayed for valid INS-id
@@ -223,9 +223,9 @@ Display report: scope, tasks completed/blocked, reflection rounds, strategy adju
223
223
  | Result | Next Step |
224
224
  |--------|-----------|
225
225
  | All tests pass, refactoring complete | `$quality-sync` (update codebase docs) |
226
- | Test failures remain after refactor | `$quality-debug "{scope}"` |
226
+ | Test failures remain after refactor | `$quality-debug "test failures in {scope} after refactor"` (debug expects bug description, not raw scope) |
227
227
  | No test suite available for scope | `$quality-auto-test "{phase}"` |
228
- | Partial completion (some blocked) | `$quality-debug "{scope}"` for blocked tasks |
228
+ | Partial completion (some blocked) | `$quality-debug "blocked refactor tasks in {scope}: <task titles>"` |
229
229
  </execution>
230
230
 
231
231
  <error_codes>
@@ -8,7 +8,7 @@ allowed-tools: Read, Write, Edit, Bash, Glob, Grep
8
8
  <purpose>
9
9
  Multi-lens retrospective for completed phases. Context-Agent Fork loads phase artifacts once;
10
10
  four parallel lens agents (technical, process, quality, decision) analyze independently;
11
- synthesizer distills insights; outputs are routed to spec stubs, knowhow tips, issues, and specs/learnings.md.
11
+ synthesizer distills insights; outputs are routed to spec stubs, knowhow tips, issues, and .workflow/specs/learnings.md.
12
12
 
13
13
  ```
14
14
  +------------------------------------------------------------------+
@@ -76,9 +76,16 @@ When `-y`: Accept all routing recommendations without prompting. Route all insig
76
76
 
77
77
  **Storage read (never modified)** — all resolved via `state.json.artifacts[]`:
78
78
  ```
79
+ # D-007 milestone reverse lookup — phase N may belong to a milestone different from current
80
+ target_milestone = resolve_milestone(target_phase) # see below
79
81
  related = artifacts.filter(a =>
80
- a.phase === target_phase && a.milestone === current_milestone
82
+ a.phase === target_phase && a.milestone === target_milestone
81
83
  ).sort_by(completed_at asc)
84
+
85
+ resolve_milestone(phase_number):
86
+ for ms in state.json.milestones[]:
87
+ if str(phase_number) in ms.phase_slugs: return ms.id
88
+ return state.json.current_milestone # fallback
82
89
  ```
83
90
  Each artifact's type determines its outputs at `.workflow/{a.path}/`:
84
91
  - **execute** → index.json, plan.json, .task/TASK-*.json, .summaries/TASK-*-summary.md
@@ -125,7 +132,7 @@ Each artifact's type determines its outputs at `.workflow/{a.path}/`:
125
132
  7. **Archive before overwrite**: Move existing retrospective.{md,json} to `.history/` with timestamp before writing new ones
126
133
  8. **Spec learnings.md backward-compat**: Append to it only if it already exists -- never create it
127
134
  9. **Route confirmation**: Unless `-y`, present routing table and ask per-group before writing spec/issue/knowhow
128
- 10. **Lessons always written**: Append to `specs/learnings.md` regardless of `--no-route` -- routing only controls spec/issue/knowhow creation
135
+ 10. **Lessons always written**: Append to `.workflow/specs/learnings.md` regardless of `--no-route` -- routing only controls spec/issue/knowhow creation
129
136
  </invariants>
130
137
 
131
138
  <execution>
@@ -168,7 +175,7 @@ spawn_agent({
168
175
  task_name: "ctx",
169
176
  fork_turns: "none",
170
177
  message: `Load and summarize all phase ${targetPhase} artifacts for retrospective.
171
- 1. Query state.json artifacts[] for phase === ${targetPhase} && milestone === current_milestone
178
+ 1. Query state.json artifacts[] for phase === ${targetPhase} && milestone === resolve_milestone(${targetPhase}) [D-007 reverse lookup via state.json.milestones[].phase_slugs; fallback to current_milestone if phase unmatched]
172
179
  2. Load per-artifact outputs (execute→index/plan/tasks/summaries, verify→verification.json, review→review.json, debug→understanding/evidence, test→uat/tests)
173
180
  3. Filter issues.jsonl for this phase; read state.json for project context
174
181
  EXPECTED: Goals vs outcomes, completion rates, verification/review/UAT results, issue counts, key metrics`
@@ -287,6 +294,6 @@ Next steps: `$manage-status`, `$manage-issue "list --source retrospective"`, `$m
287
294
  - [ ] Synthesizer produces deduplicated insights with stable INS-ids
288
295
  - [ ] Routing applied per insight (spec/issue/knowhow/none) with confirmation
289
296
  - [ ] retrospective.{md,json} written to phase directory
290
- - [ ] Lessons appended to specs/learnings.md regardless of --no-route flag
297
+ - [ ] Lessons appended to .workflow/specs/learnings.md regardless of --no-route flag
291
298
  - [ ] Existing retrospective archived before overwrite
292
299
  </success_criteria>