maestro-flow 0.5.47 → 0.5.49

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 (212) hide show
  1. package/.agents/agents/ralph-executor.md +14 -24
  2. package/.agents/skills/maestro-analyze/SKILL.md +13 -13
  3. package/.agents/skills/maestro-composer/SKILL.md +1 -1
  4. package/.agents/skills/maestro-help/SKILL.md +2 -0
  5. package/.agents/skills/maestro-help/index/catalog.json +7 -7
  6. package/.agents/skills/maestro-init/SKILL.md +1 -1
  7. package/.agents/skills/maestro-milestone-audit/SKILL.md +2 -2
  8. package/.agents/skills/maestro-milestone-release/SKILL.md +1 -1
  9. package/.agents/skills/maestro-next/SKILL.md +2 -2
  10. package/.agents/skills/maestro-plan/SKILL.md +31 -9
  11. package/.agents/skills/maestro-ralph-v2/SKILL.md +26 -50
  12. package/.agents/skills/maestro-roadmap/SKILL.md +2 -2
  13. package/.agents/skills/manage-harvest/SKILL.md +4 -2
  14. package/.agents/skills/manage-knowledge-audit/SKILL.md +7 -2
  15. package/.agents/skills/quality-auto-test/SKILL.md +1 -1
  16. package/.agents/skills/quality-review/SKILL.md +2 -2
  17. package/.agents/skills/spec-add/SKILL.md +4 -0
  18. package/.agy/agents/ralph-executor.md +14 -23
  19. package/.agy/skills/maestro-analyze/SKILL.md +13 -13
  20. package/.agy/skills/maestro-composer/SKILL.md +1 -1
  21. package/.agy/skills/maestro-help/SKILL.md +2 -0
  22. package/.agy/skills/maestro-help/index/catalog.json +7 -7
  23. package/.agy/skills/maestro-init/SKILL.md +1 -1
  24. package/.agy/skills/maestro-milestone-audit/SKILL.md +2 -2
  25. package/.agy/skills/maestro-milestone-release/SKILL.md +1 -1
  26. package/.agy/skills/maestro-next/SKILL.md +2 -2
  27. package/.agy/skills/maestro-plan/SKILL.md +31 -9
  28. package/.agy/skills/maestro-ralph-v2/SKILL.md +26 -50
  29. package/.agy/skills/maestro-roadmap/SKILL.md +2 -2
  30. package/.agy/skills/manage-harvest/SKILL.md +4 -2
  31. package/.agy/skills/manage-knowledge-audit/SKILL.md +7 -2
  32. package/.agy/skills/quality-auto-test/SKILL.md +1 -1
  33. package/.agy/skills/quality-review/SKILL.md +2 -2
  34. package/.agy/skills/spec-add/SKILL.md +4 -0
  35. package/.claude/agents/ralph-executor.md +14 -24
  36. package/.claude/commands/maestro-analyze.md +13 -13
  37. package/.claude/commands/maestro-composer.md +1 -1
  38. package/.claude/commands/maestro-init.md +1 -1
  39. package/.claude/commands/maestro-milestone-audit.md +2 -2
  40. package/.claude/commands/maestro-milestone-release.md +1 -1
  41. package/.claude/commands/maestro-next.md +2 -2
  42. package/.claude/commands/maestro-plan.md +31 -9
  43. package/.claude/commands/maestro-ralph-v2.md +26 -50
  44. package/.claude/commands/maestro-roadmap.md +2 -2
  45. package/.claude/commands/manage-harvest.md +4 -2
  46. package/.claude/commands/manage-knowledge-audit.md +7 -2
  47. package/.claude/commands/quality-auto-test.md +1 -1
  48. package/.claude/commands/quality-review.md +2 -2
  49. package/.claude/commands/spec-add.md +4 -0
  50. package/.claude/skills/maestro-help/SKILL.md +2 -0
  51. package/.claude/skills/maestro-help/index/catalog.json +7 -7
  52. package/.codex/skills/maestro/SKILL.md +6 -5
  53. package/.codex/skills/maestro-analyze/SKILL.md +13 -18
  54. package/.codex/skills/maestro-help/catalog.json +7 -7
  55. package/.codex/skills/maestro-next/SKILL.md +2 -2
  56. package/.codex/skills/maestro-plan/SKILL.md +13 -16
  57. package/.codex/skills/maestro-ralph/SKILL.md +11 -11
  58. package/.codex/skills/maestro-ralph-execute/SKILL.md +8 -8
  59. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.d.ts +2 -2
  60. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js +45 -37
  61. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js.map +1 -1
  62. package/dashboard/dist-server/dashboard/src/server/wiki/graph-analysis.d.ts +0 -34
  63. package/dashboard/dist-server/dashboard/src/server/wiki/graph-analysis.js +0 -126
  64. package/dashboard/dist-server/dashboard/src/server/wiki/graph-analysis.js.map +1 -1
  65. package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.d.ts +6 -0
  66. package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.js +17 -1
  67. package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.js.map +1 -1
  68. package/dashboard/dist-server/dashboard/src/server/wiki/time-decay.d.ts +28 -0
  69. package/dashboard/dist-server/dashboard/src/server/wiki/time-decay.js +70 -0
  70. package/dashboard/dist-server/dashboard/src/server/wiki/time-decay.js.map +1 -0
  71. package/dashboard/dist-server/dashboard/src/server/wiki/time-decay.test.d.ts +1 -0
  72. package/dashboard/dist-server/dashboard/src/server/wiki/time-decay.test.js +78 -0
  73. package/dashboard/dist-server/dashboard/src/server/wiki/time-decay.test.js.map +1 -0
  74. package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.js +6 -1
  75. package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.js.map +1 -1
  76. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.d.ts +1 -0
  77. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +104 -29
  78. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
  79. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.test.js +2 -2
  80. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.test.js.map +1 -1
  81. package/dashboard/dist-server/dashboard/src/server/wiki/writer.js +8 -5
  82. package/dashboard/dist-server/dashboard/src/server/wiki/writer.js.map +1 -1
  83. package/dashboard/dist-server/src/graph/kg/embedding/code-embedding.js +2 -0
  84. package/dashboard/dist-server/src/graph/kg/embedding/code-embedding.js.map +1 -1
  85. package/dashboard/dist-server/src/graph/kg/engine.js +5 -1
  86. package/dashboard/dist-server/src/graph/kg/engine.js.map +1 -1
  87. package/dashboard/dist-server/src/hooks/kg-sync-hook.js +5 -3
  88. package/dashboard/dist-server/src/hooks/kg-sync-hook.js.map +1 -1
  89. package/dashboard/dist-server/src/hooks/session-context.js +3 -1
  90. package/dashboard/dist-server/src/hooks/session-context.js.map +1 -1
  91. package/dashboard/dist-server/src/search/daemon-client.js +5 -3
  92. package/dashboard/dist-server/src/search/daemon-client.js.map +1 -1
  93. package/dashboard/dist-server/src/tools/spec-entry-parser.d.ts +42 -1
  94. package/dashboard/dist-server/src/tools/spec-entry-parser.js +22 -2
  95. package/dashboard/dist-server/src/tools/spec-entry-parser.js.map +1 -1
  96. package/dashboard/dist-server/src/tools/spec-loader.js +10 -3
  97. package/dashboard/dist-server/src/tools/spec-loader.js.map +1 -1
  98. package/dist/src/agents/api-explore/agent-loop.d.ts +2 -0
  99. package/dist/src/agents/api-explore/agent-loop.d.ts.map +1 -1
  100. package/dist/src/agents/api-explore/agent-loop.js +1 -1
  101. package/dist/src/agents/api-explore/agent-loop.js.map +1 -1
  102. package/dist/src/agents/api-explore/circuit-breaker.d.ts +52 -0
  103. package/dist/src/agents/api-explore/circuit-breaker.d.ts.map +1 -0
  104. package/dist/src/agents/api-explore/circuit-breaker.js +151 -0
  105. package/dist/src/agents/api-explore/circuit-breaker.js.map +1 -0
  106. package/dist/src/agents/api-explore/config.d.ts +10 -39
  107. package/dist/src/agents/api-explore/config.d.ts.map +1 -1
  108. package/dist/src/agents/api-explore/config.js +7 -33
  109. package/dist/src/agents/api-explore/config.js.map +1 -1
  110. package/dist/src/agents/api-explore/index.js +2 -2
  111. package/dist/src/agents/api-explore/index.js.map +1 -1
  112. package/dist/src/agents/api-explore/llm.d.ts +5 -0
  113. package/dist/src/agents/api-explore/llm.d.ts.map +1 -1
  114. package/dist/src/agents/api-explore/llm.js +31 -0
  115. package/dist/src/agents/api-explore/llm.js.map +1 -1
  116. package/dist/src/agents/api-explore/runner.d.ts +5 -0
  117. package/dist/src/agents/api-explore/runner.d.ts.map +1 -1
  118. package/dist/src/agents/api-explore/runner.js +103 -8
  119. package/dist/src/agents/api-explore/runner.js.map +1 -1
  120. package/dist/src/commands/explore.d.ts.map +1 -1
  121. package/dist/src/commands/explore.js +4 -2
  122. package/dist/src/commands/explore.js.map +1 -1
  123. package/dist/src/commands/install.d.ts.map +1 -1
  124. package/dist/src/commands/install.js +59 -4
  125. package/dist/src/commands/install.js.map +1 -1
  126. package/dist/src/commands/moa.js +1 -1
  127. package/dist/src/commands/moa.js.map +1 -1
  128. package/dist/src/commands/search.d.ts +4 -0
  129. package/dist/src/commands/search.d.ts.map +1 -1
  130. package/dist/src/commands/search.js +18 -3
  131. package/dist/src/commands/search.js.map +1 -1
  132. package/dist/src/commands/spec.d.ts.map +1 -1
  133. package/dist/src/commands/spec.js +113 -0
  134. package/dist/src/commands/spec.js.map +1 -1
  135. package/dist/src/commands/wiki.js +2 -2
  136. package/dist/src/commands/wiki.js.map +1 -1
  137. package/dist/src/config/api-config.d.ts +61 -0
  138. package/dist/src/config/api-config.d.ts.map +1 -0
  139. package/dist/src/config/api-config.js +59 -0
  140. package/dist/src/config/api-config.js.map +1 -0
  141. package/dist/src/config/cli-tools-config.d.ts +1 -0
  142. package/dist/src/config/cli-tools-config.d.ts.map +1 -1
  143. package/dist/src/config/cli-tools-config.js +22 -1
  144. package/dist/src/config/cli-tools-config.js.map +1 -1
  145. package/dist/src/graph/kg/embedding/code-embedding.d.ts.map +1 -1
  146. package/dist/src/graph/kg/embedding/code-embedding.js +2 -0
  147. package/dist/src/graph/kg/embedding/code-embedding.js.map +1 -1
  148. package/dist/src/graph/kg/engine.d.ts.map +1 -1
  149. package/dist/src/graph/kg/engine.js +5 -1
  150. package/dist/src/graph/kg/engine.js.map +1 -1
  151. package/dist/src/hooks/kg-sync-hook.d.ts.map +1 -1
  152. package/dist/src/hooks/kg-sync-hook.js +5 -3
  153. package/dist/src/hooks/kg-sync-hook.js.map +1 -1
  154. package/dist/src/hooks/session-context.js +3 -1
  155. package/dist/src/hooks/session-context.js.map +1 -1
  156. package/dist/src/search/daemon-client.d.ts.map +1 -1
  157. package/dist/src/search/daemon-client.js +5 -3
  158. package/dist/src/search/daemon-client.js.map +1 -1
  159. package/dist/src/search/daemon.d.ts.map +1 -1
  160. package/dist/src/search/daemon.js +17 -0
  161. package/dist/src/search/daemon.js.map +1 -1
  162. package/dist/src/tools/spec-conflict-marker.d.ts +62 -0
  163. package/dist/src/tools/spec-conflict-marker.d.ts.map +1 -1
  164. package/dist/src/tools/spec-conflict-marker.js +280 -1
  165. package/dist/src/tools/spec-conflict-marker.js.map +1 -1
  166. package/dist/src/tools/spec-entry-parser.d.ts +42 -1
  167. package/dist/src/tools/spec-entry-parser.d.ts.map +1 -1
  168. package/dist/src/tools/spec-entry-parser.js +22 -2
  169. package/dist/src/tools/spec-entry-parser.js.map +1 -1
  170. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  171. package/dist/src/tools/spec-loader.js +10 -3
  172. package/dist/src/tools/spec-loader.js.map +1 -1
  173. package/dist/src/tools/spec-writer.d.ts +2 -0
  174. package/dist/src/tools/spec-writer.d.ts.map +1 -1
  175. package/dist/src/tools/spec-writer.js +8 -6
  176. package/dist/src/tools/spec-writer.js.map +1 -1
  177. package/dist/src/tui/install-ui/EmbeddingConfig.d.ts +25 -0
  178. package/dist/src/tui/install-ui/EmbeddingConfig.d.ts.map +1 -0
  179. package/dist/src/tui/install-ui/EmbeddingConfig.js +58 -0
  180. package/dist/src/tui/install-ui/EmbeddingConfig.js.map +1 -0
  181. package/dist/src/tui/install-ui/EmbeddingPanel.d.ts +6 -0
  182. package/dist/src/tui/install-ui/EmbeddingPanel.d.ts.map +1 -0
  183. package/dist/src/tui/install-ui/EmbeddingPanel.js +101 -0
  184. package/dist/src/tui/install-ui/EmbeddingPanel.js.map +1 -0
  185. package/dist/src/tui/install-ui/GroupedHub.d.ts +2 -0
  186. package/dist/src/tui/install-ui/GroupedHub.d.ts.map +1 -1
  187. package/dist/src/tui/install-ui/GroupedHub.js +8 -1
  188. package/dist/src/tui/install-ui/GroupedHub.js.map +1 -1
  189. package/dist/src/tui/install-ui/InstallFlow.d.ts.map +1 -1
  190. package/dist/src/tui/install-ui/InstallFlow.js +4 -2
  191. package/dist/src/tui/install-ui/InstallFlow.js.map +1 -1
  192. package/dist/src/tui/install-ui/embedding-status.d.ts +12 -0
  193. package/dist/src/tui/install-ui/embedding-status.d.ts.map +1 -0
  194. package/dist/src/tui/install-ui/embedding-status.js +82 -0
  195. package/dist/src/tui/install-ui/embedding-status.js.map +1 -0
  196. package/dist/src/tui/install-ui/useInstallFlowState.d.ts +1 -1
  197. package/dist/src/tui/install-ui/useInstallFlowState.d.ts.map +1 -1
  198. package/dist/src/tui/install-ui/useInstallFlowState.js +52 -2
  199. package/dist/src/tui/install-ui/useInstallFlowState.js.map +1 -1
  200. package/dist/src/tui/shared/tokens.d.ts +1 -1
  201. package/dist/src/tui/shared/tokens.js +1 -1
  202. package/dist/src/utils/update-notices.js +23 -0
  203. package/dist/src/utils/update-notices.js.map +1 -1
  204. package/package.json +1 -1
  205. package/workflows/agy-instructions.md +14 -5
  206. package/workflows/analyze.md +13 -15
  207. package/workflows/claude-instructions.md +25 -3
  208. package/workflows/codex-instructions.md +14 -5
  209. package/workflows/finish-work.md +65 -86
  210. package/workflows/knowledge-audit.md +2 -1
  211. package/workflows/plan.md +33 -21
  212. package/workflows/specs-add.md +7 -3
@@ -64,7 +64,7 @@ Each artifact's type determines its outputs at `.workflow/{a.path}/`:
64
64
  3. **Verdict is data-driven** — NEVER change verdict severity to accommodate user preference without new evidence. Verdicts flow from findings, not negotiation.
65
65
  4. **Dimension independence** — each review dimension produces findings independently. One dimension's results MUST NOT suppress or override another's.
66
66
  5. **Prior review delta** — when a prior review.json exists for the same phase, findings MUST be compared. Do NOT re-report already-resolved findings as new.
67
- 6. **Spec conflict integrity** — if code contradicts a spec entry, flag via `maestro spec conflict mark`. NEVER silently accept the contradiction or edit the spec inline.
67
+ 6. **Spec conflict integrity** — if code contradicts a spec entry: if the code is the evolved practice (spec outdated), suggest `maestro spec supersede`; if genuinely disputed, flag via `maestro spec conflict mark`. NEVER silently accept the contradiction or edit the spec inline.
68
68
  </invariants>
69
69
 
70
70
  <execution>
@@ -85,7 +85,7 @@ Follow '~/.maestro/workflows/review.md' completely.
85
85
  - REQUIRED: review.json written with findings, severity distribution, and verdict.
86
86
  - REQUIRED: Issues auto-created based on level thresholds.
87
87
  - REQUIRED: index.json updated with review status.
88
- - REQUIRED: Spec conflict check — if any finding directly contradicts a loaded spec entry (code behavior ≠ spec rule), suggest `maestro spec conflict mark` on the spec entry. Code is the single source of truth.
88
+ - REQUIRED: Spec conflict check — if any finding directly contradicts a loaded spec entry (code behavior ≠ spec rule): if spec is outdated (code evolved), suggest `maestro spec supersede`; if genuinely disputed, suggest `maestro spec conflict mark`. Code is the single source of truth.
89
89
 
90
90
  **Output writes to REVIEW_DIR** (not EXEC_DIR):
91
91
  - `REVIEW_DIR/review.json` — findings, severity distribution, verdict
@@ -23,6 +23,7 @@ $ARGUMENTS -- expects `[--scope <scope>] [--uid <uid>] <category> <content>`
23
23
 
24
24
  **Options:**
25
25
  - `--description <desc>` — One-line description for search results (falls back to content[:240])
26
+ - `--json` — Output JSON with generated `sid` (needed for supersession: `maestro spec supersede <old-sid> --by <new-sid>`)
26
27
  - `--ref <path>` — Create as index entry referencing a knowhow document. If the path exists, only creates the spec index entry. If path doesn't exist, also creates the knowhow file.
27
28
  - `--knowhow-type <type>` — Knowhow document type when creating with --ref (asset, blueprint, document, template, recipe, reference, decision)
28
29
 
@@ -102,6 +103,9 @@ Follow '~/.maestro/workflows/specs-add.md' completely.
102
103
  | Condition | Suggestion |
103
104
  |-----------|-----------|
104
105
  | Verify entry added | `maestro load --type spec --scope <scope> --keyword {keyword}` |
106
+ | New entry replaces old one | `maestro spec supersede <old-sid> --by <new-sid>` |
107
+ | View evolution chain | `maestro spec history <sid>` |
105
108
  | Add more entries | `/spec-add <category>` |
106
109
  | View all specs | `/spec-load --category <category>` |
110
+ | Check knowledge health | `maestro spec health` |
107
111
  </completion>
@@ -292,6 +292,8 @@ Odyssey 长周期循环(独立路径)
292
292
  | 长周期改进 | Odyssey 深度循环 | `/odyssey-improve "改进目标"` |
293
293
  | 需求迭代 | Odyssey 深度循环 | `/odyssey-planex "需求描述"` |
294
294
 
295
+ > 注:Path A/B 中 `analyze 1` / `plan 1` 的数字 `1` 指 **milestone 编号**(第 1 个里程碑),下游以 milestone 为入口。
296
+
295
297
  ## Core Rules
296
298
 
297
299
  1. **Catalog First**: 先查 catalog.json,再按需读 source 文件
@@ -9,8 +9,8 @@
9
9
  {"name": "maestro-init", "command": "/maestro-init", "category": "core", "description": "项目初始化 — 创建 .workflow/ 目录结构和状态文件", "source": "../../commands/maestro-init.md"},
10
10
  {"name": "maestro-brainstorm", "command": "/maestro-brainstorm", "category": "core", "description": "头脑风暴 — 发散探索,多角色创意,上游起源命令", "source": "../../commands/maestro-brainstorm.md"},
11
11
  {"name": "maestro-blueprint", "command": "/maestro-blueprint", "category": "core", "description": "正式规格文档化 — 7-phase 收敛规格链,上游起源命令,产出 .workflow/blueprint/", "source": "../../commands/maestro-blueprint.md"},
12
- {"name": "maestro-roadmap", "command": "/maestro-roadmap", "category": "core", "description": "路线图编排 — 消费上游 context,纯 Milestone > Phase 分解(不做技术探索)", "source": "../../commands/maestro-roadmap.md"},
13
- {"name": "maestro-quick", "command": "/maestro-quick", "category": "core", "description": "快速任务 — 跳过 Phase 管线直接完成,支持 --full/--discuss 模式", "source": "../../commands/maestro-quick.md"},
12
+ {"name": "maestro-roadmap", "command": "/maestro-roadmap", "category": "core", "description": "路线图编排 — Milestone > Phase 分解,下游以 milestone 为入口", "source": "../../commands/maestro-roadmap.md"},
13
+ {"name": "maestro-quick", "command": "/maestro-quick", "category": "core", "description": "快速任务 — 跳过管线直接完成,支持 --full/--discuss 模式", "source": "../../commands/maestro-quick.md"},
14
14
  {"name": "maestro-overlay", "command": "/maestro-overlay", "category": "core", "description": "Overlay 管理 — 创建、查看、删除命令补丁", "source": "../../commands/maestro-overlay.md"},
15
15
  {"name": "maestro-amend", "command": "/maestro-amend", "category": "core", "description": "修正补丁 — 从工作流信号自动生成 overlay", "source": "../../commands/maestro-amend.md"},
16
16
  {"name": "maestro-composer", "command": "/maestro-composer", "category": "core", "description": "编排器 — compose + play 工作流组合执行", "source": "../../commands/maestro-composer.md"},
@@ -27,7 +27,7 @@
27
27
  {"name": "maestro-plan", "command": "/maestro-plan", "category": "pipeline", "description": "任务规划 — 支持 --from analyze:ANL-xxx 直达、碰撞检测、gap 修复计划", "source": "../../commands/maestro-plan.md"},
28
28
  {"name": "maestro-execute", "command": "/maestro-execute", "category": "pipeline", "description": "任务执行 — wave 并行执行、delegate 编排、自动提交", "source": "../../commands/maestro-execute.md"},
29
29
 
30
- {"name": "maestro-milestone-audit", "command": "/maestro-milestone-audit", "category": "milestone", "description": "里程碑审计 — 检查 Phase 完成度和质量", "source": "../../commands/maestro-milestone-audit.md"},
30
+ {"name": "maestro-milestone-audit", "command": "/maestro-milestone-audit", "category": "milestone", "description": "里程碑审计 — 检查里程碑完成度和质量", "source": "../../commands/maestro-milestone-audit.md"},
31
31
  {"name": "maestro-milestone-complete", "command": "/maestro-milestone-complete", "category": "milestone", "description": "里程碑完成 — 归档里程碑并推进下一个", "source": "../../commands/maestro-milestone-complete.md"},
32
32
  {"name": "maestro-milestone-release", "command": "/maestro-milestone-release", "category": "milestone", "description": "里程碑发布 — 生成发布说明和变更日志", "source": "../../commands/maestro-milestone-release.md"},
33
33
 
@@ -218,17 +218,17 @@
218
218
  ],
219
219
  "workflows": {
220
220
  "topology": {
221
- "hierarchy": "Roadmap > Milestone > Phase > Task",
221
+ "hierarchy": "Roadmap > Milestone > Phase | Plan > Task > Wave",
222
222
  "layers": {
223
223
  "upstream_origin": ["brainstorm (发散/轻量)", "blueprint (收敛/重型)"],
224
- "understanding": "analyze 双层: 宏观(文本参数) + 微观(数字参数)",
224
+ "understanding": "analyze 双层: 宏观(文本参数) + 微观(milestone 数字参数)",
225
225
  "orchestration": "roadmap (可选,消费上游 context)",
226
226
  "execution": ["plan", "execute"]
227
227
  }
228
228
  },
229
229
  "paths": {
230
- "A_full_project": "brainstorm → blueprint(可选) → analyze 宏观 → roadmap → analyze 微观 → plan → execute",
231
- "B_large_feature": "analyze 宏观 → roadmap → analyze 微观 → plan → execute",
230
+ "A_full_project": "brainstorm → blueprint(可选) → analyze 宏观 → roadmap → analyze {milestone} → plan {milestone} → execute",
231
+ "B_large_feature": "analyze 宏观 → roadmap → analyze {milestone} → plan {milestone} → execute",
232
232
  "C_medium_feature": "analyze 宏观 → plan --from analyze:ANL-xxx → execute",
233
233
  "D_small_fix": "plan → execute",
234
234
  "E_spec_only": "blueprint → (供人阅读)",
@@ -349,6 +349,7 @@ Direct in-context skill invocation — **replaces the old spawn/wave/CSV mechani
349
349
  | Placeholder | Source |
350
350
  |-------------|--------|
351
351
  | `{phase}` | session.phase |
352
+ | `{milestone}` | session.milestone |
352
353
  | `{plan_dir}` | session.context.plan_dir |
353
354
  | `{analysis_dir}` | session.context.analysis_dir |
354
355
  | `{brainstorm_dir}` | session.context.brainstorm_dir |
@@ -358,7 +359,7 @@ Direct in-context skill invocation — **replaces the old spawn/wave/CSV mechani
358
359
  | `{BLP}` | session.blueprint_id |
359
360
  | `{intent}` | session.intent |
360
361
 
361
- **--from auto-injection**: 当 step 是 `maestro-plan`,args 含 `{phase}` 但无 `--from` 且无 `--dir`,且 `session.context.analysis_dir` 已填充 → 查 state.json 同 phase+milestone 最新 completed analyze artifact → 注入 `--from analyze:{id}`,写 `step.source_artifact_ref`
362
+ **--from auto-injection**: 当 step 是 `maestro-plan`,args 含 `{milestone}` 但无 `--from` 且无 `--dir`,且 `session.context.analysis_dir` 已填充 → 查 state.json 同 milestone 最新 completed analyze artifact → 注入 `--from analyze:{id}`,写 `step.source_artifact_ref`
362
363
  2. Mark step `status="running"`, persist status.json + `update_plan` (this step → in_progress)
363
364
  3. **Invoke the skill directly**: execute `Skill(skill_name, resolved_args)` in coordinator context (NO spawn). Read its produced artifacts directly
364
365
  4. On success: mark step `status="done"`. **Structured completion**: `Bash("maestro ralph complete {idx} --status DONE --summary \"...\" [--decisions \"...\"] [--caveats \"...\"] [--deferred \"...\"]")`(`--summary` MUST,动词开头 ≤100 字)。**Barrier-context update** (when step is a context-producing skill):
@@ -424,9 +425,9 @@ S_DECISION_EVAL 入口;镜像 maestro-ralph `A_GOAL_AUDIT_EVALUATE`。Condense
424
425
  | `init` | `maestro-init` |
425
426
  | `blueprint` | `maestro-blueprint "{intent}"` |
426
427
  | `analyze_macro` | `maestro-analyze "{intent}"` |
427
- | `analyze` | `maestro-analyze {phase}` |
428
+ | `analyze` | `maestro-analyze {milestone}` |
428
429
  | `ui_design` | `maestro-impeccable build "{phase}"` |
429
- | `plan` | `maestro-plan {phase}` |
430
+ | `plan` | `maestro-plan {milestone}` |
430
431
  | `plan_from_analyze` | `maestro-plan --from analyze:{analyze_macro_id}` |
431
432
  | `plan_from_blueprint` | `maestro-plan --from blueprint:{blueprint_id}` |
432
433
  | `execute` | `maestro-execute {phase}` |
@@ -482,7 +483,7 @@ S_DECISION_EVAL 入口;镜像 maestro-ralph `A_GOAL_AUDIT_EVALUATE`。Condense
482
483
  | `quality-fix` | [B] maestro-analyze --gaps → [B] maestro-plan --gaps → [B] maestro-execute → quality-review |
483
484
  | `deploy` | quality-review → maestro-milestone-release |
484
485
  | `blueprint-driven` | maestro-init → [B] maestro-blueprint → [B] maestro-plan --from blueprint:{BLP} → [B] maestro-execute → quality-review → manage-harvest --auto |
485
- | `analyze-macro-driven` | [B] maestro-analyze "{intent}" → ◆ post-analyze-scope → (large: [B] maestro-roadmap --from analyze:{ANL} → [B] maestro-analyze {phase} → [B] maestro-plan {phase}) / (medium\|small: [B] maestro-plan --from analyze:{ANL}) → [B] maestro-execute → quality-review → manage-harvest --auto |
486
+ | `analyze-macro-driven` | [B] maestro-analyze "{intent}" → ◆ post-analyze-scope → (large: [B] maestro-roadmap --from analyze:{ANL} → [B] maestro-analyze {milestone} → [B] maestro-plan {milestone}) / (medium\|small: [B] maestro-plan --from analyze:{ANL}) → [B] maestro-execute → quality-review → manage-harvest --auto |
486
487
  | `grill-brainstorm` | [B] maestro-grill → [B] maestro-brainstorm --from grill:{GRL} → [B] maestro-plan → [B] maestro-execute → quality-review → manage-harvest --auto (**auto_mode: grill 透传 `-y`,Auto mode 代码代答**) |
487
488
  | `brainstorm-driven` | [B] maestro-brainstorm → [B] maestro-plan → [B] maestro-execute → quality-review → manage-harvest --auto |
488
489
  | `ui-craft-build` | maestro-impeccable build → [B] maestro-plan → [B] maestro-execute → quality-review → manage-harvest --auto |
@@ -542,7 +543,7 @@ S_DECISION_EVAL 入口;镜像 maestro-ralph `A_GOAL_AUDIT_EVALUATE`。Condense
542
543
  - [ ] Intent classified and chain resolved
543
544
  - [ ] Chain catalog 覆盖 blueprint / analyze_macro / plan_from_analyze / plan_from_blueprint / blueprint-driven / analyze-macro-driven 等新拓扑路径
544
545
  - [ ] D-007: 数字 phase 步骤的 `milestone_id` 通过 `state.json.milestones[].phase_slugs` 反查;写入 step
545
- - [ ] plan step args 支持 `{phase}` / `--from analyze:{ANL_ID}` / `--from blueprint:{BLP_ID}` 三路径,`source_artifact_ref` 写入
546
+ - [ ] plan step args 支持 `{milestone}` / `--from analyze:{ANL_ID}` / `--from blueprint:{BLP_ID}` 三路径,`source_artifact_ref` 写入
546
547
  - [ ] Broad lifecycle intents decomposed (≤3 boundary questions); narrow/single-step skip
547
548
  - [ ] Goal registered via built-in `create_goal`; status.json decomposition fields additive-only
548
549
  - [ ] status.json 唯一真源;无 markdown 清单
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: maestro-analyze
3
3
  description: Use when a topic needs structured multi-dimensional investigation before planning or decision-making
4
- argument-hint: "[-y|--yes] [--concurrency N] [-c|--continue] [--from <source>] \"<phase|topic> [-q|--quick] [--gaps [ISS-ID]]\""
4
+ argument-hint: "[-y|--yes] [--concurrency N] [-c|--continue] [--from <source>] \"<milestone|topic> [-q|--quick] [--gaps [ISS-ID]]\""
5
5
  allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, request_user_input
6
6
  ---
7
7
 
@@ -13,11 +13,11 @@ Wave 1 (CLI exploration, parallel) -> Wave 2 (6-dimension scoring, parallel) ->
13
13
 
14
14
  **Dual-layer scope (D-003)**:
15
15
  - **Macro layer** (text argument, e.g. `analyze "auth refactor"`): broad impact exploration. Produces `scope_verdict ∈ {small, medium, large}` to drive downstream routing (roadmap vs plan).
16
- - **Phase layer** (numeric argument, e.g. `analyze 1`): phase-scoped deep analysis under `current_milestone`. Milestone resolved via D-007 `phase_slugs` reverse lookup, NEVER direct `current_milestone` read.
16
+ - **Milestone layer** (numeric argument, e.g. `analyze 1`): milestone-level deep analysis covering all phases under the milestone. `analyze 1` = Milestone 1.
17
17
  </purpose>
18
18
 
19
19
  <context>
20
- $ARGUMENTS -- phase number, topic text, and optional flags.
20
+ $ARGUMENTS -- milestone number, topic text, and optional flags.
21
21
 
22
22
  **Flags**:
23
23
  - `-y, --yes`: Skip all confirmations (auto mode)
@@ -94,7 +94,7 @@ Available exploration dimensions: architecture, implementation, performance, sec
94
94
  6. **Gaps mode pipeline**: --gaps follows: Load issues from issues.jsonl -> Classify & group by location/component -> CSV gen (W1: 1 explore row per issue, W2: 1 synthesis per group) -> Execute waves -> Write issue.analysis record per issue -> Append history `{ action: "analyzed", at: <ISO>, by: "maestro-analyze --gaps" }` -> Output context.md for plan --gaps
95
95
  7. **Graceful degradation**: Missing exploration reduces scoring quality; missing scoring reduces synthesis quality
96
96
  8. **Tri-output**: context.md + context-package.json always. analysis.md (full only) + conclusions.json (full + quick — quick writes minimal with `scope_verdict` + `implementation_scope[]`). Gaps mode writes to issues.jsonl + context.md + context-package.json
97
- 9. **D-007 milestone resolution**: numeric scope MUST reverse-lookup `state.json.milestones[].phase_slugs`. NEVER read `current_milestone` directly for phase-scoped artifact registration.
97
+ 9. **Milestone resolution**: numeric scope directly specifies the milestone number. Resolve from `state.json.milestones[]` by ID.
98
98
  10. **scope_verdict mandatory** (D-003): macro/adhoc/standalone scopes MUST produce `scope_verdict ∈ {small, medium, large}` in conclusions.json. Drives downstream chain (roadmap vs plan).
99
99
  11. **Invariant violation = BLOCK** — violating any invariant above blocks the current operation. Do NOT bypass for "efficiency" or "clear intent" reasons.
100
100
  12. **Evidence required on decisions** — every decision in context.md MUST cite evidence from Wave 1 exploration findings or Wave 2 scores. Decisions citing only orchestrator's manual file reading are flagged LOW CONFIDENCE. **Degradation exception**: when invariant 7 activates and evidence is incomplete, decisions MAY proceed but MUST inherit LOW CONFIDENCE flag per invariant 13 — this is not a violation of the MUST, it is the defined degraded behavior.
@@ -119,24 +119,19 @@ S_PARSE:
119
119
  -> S_CONTEXT WHEN: scope resolved (milestone/phase/macro/adhoc/standalone/gaps)
120
120
  -> ERROR(E001) WHEN: no args and no roadmap
121
121
 
122
- **Scope routing** (text → macro layer, numeric → phase layer per D-003):
122
+ **Scope routing** (text → macro layer, numeric → milestone layer per D-003):
123
123
  | Condition | Scope | Layer | Slug |
124
124
  |-----------|-------|-------|------|
125
125
  | --gaps flag | gaps | — | ISS-ID slugified or "issue-gaps" |
126
- | Empty subject + milestone + roadmap | milestone | phase | milestone name slugified |
126
+ | Empty subject + milestone + roadmap | milestone | milestone | milestone name slugified |
127
127
  | Empty subject, no roadmap | ERROR E001 | — | -- |
128
- | Numeric + milestone + roadmap | phase | phase | phase slug from roadmap |
128
+ | Numeric + roadmap | milestone | milestone | milestone name slugified |
129
129
  | Text subject + milestone | macro | macro | subject slugified (max 40) |
130
130
  | Text subject, no milestone | macro | macro | subject slugified (max 40) |
131
131
 
132
- **D-007 milestone reverse lookup** (numeric scope only):
133
- ```
134
- resolve_milestone(phase_number):
135
- for ms in state.json.milestones[]:
136
- if str(phase_number) in ms.phase_slugs: return ms.id
137
- return state.json.current_milestone # fallback (standalone)
138
- ```
139
- Write resolved milestone into `session.milestone` and artifact registration; NEVER use `current_milestone` directly for phase-scoped runs.
132
+ **Milestone resolution** (numeric scope only):
133
+ target_milestone = specified milestone number
134
+ IF not found in state.json.milestones[]: ERROR
140
135
 
141
136
  S_CONTEXT:
142
137
  -> S_CSV_GEN DO: load project.md, roadmap.md, state.json, prior artifacts, specs, upstream context-package (if --from)
@@ -252,7 +247,7 @@ Filter `wave==3 AND status=="pending"` -> build prev_context from wave 2 scores
252
247
  | `medium` | 1-2 subsystems, parallel-safe |
253
248
  | `small` | Single file or few files, directly executable |
254
249
 
255
- Write to `conclusions.json.scope_verdict` (all modes that produce conclusions); mirror into `context.md` and `context-package.json.source.scope_verdict`. Phase-scoped runs may omit (default null).
250
+ Write to `conclusions.json.scope_verdict` (all modes that produce conclusions); mirror into `context.md` and `context-package.json.source.scope_verdict`. Milestone-scoped runs may omit (default null).
256
251
 
257
252
  Gray area detection: domain-aware (things users SEE/CALL/RUN/READ), phase-specific (skip prior decided areas).
258
253
 
@@ -286,7 +281,7 @@ Non-blocking: conflicts produce warnings, pipeline continues.
286
281
  | Scope | Condition | Suggested |
287
282
  |-------|-----------|-----------|
288
283
  | Phase/Milestone | Go + UI work needed | `$maestro-impeccable build {target}` |
289
- | Phase/Milestone | Go + ready to plan | `$maestro-plan` or `$maestro-plan {phase}` |
284
+ | Phase/Milestone | Go + ready to plan | `$maestro-plan` or `$maestro-plan {milestone}` |
290
285
  | Phase/Milestone | No-Go | `$maestro-brainstorm {topic}` |
291
286
  | Macro/Adhoc/Standalone | `scope_verdict == "large"` | `$maestro-roadmap --from analyze:{ANL_ID}` |
292
287
  | Macro/Adhoc/Standalone | `scope_verdict == "medium"` | `$maestro-plan --from analyze:{ANL_ID}` |
@@ -341,7 +336,7 @@ Protocol: read before analysis, append-only, dedup by type+key.
341
336
  - [ ] context.md produced (all modes); analysis.md (full mode); conclusions.json (full mode AND quick mode with at minimum `scope_verdict` + `implementation_scope[]`)
342
337
  - [ ] context-package.json produced (all modes) with constraints, requirements, insights, open_questions
343
338
  - [ ] `scope_verdict ∈ {small, medium, large}` written into conclusions.json + context.md (macro/adhoc/standalone scopes)
344
- - [ ] D-007 milestone reverse lookup applied for numeric scope; `session.milestone` populated via `phase_slugs`, never via direct `current_milestone` read
339
+ - [ ] Milestone resolved directly from numeric arg; `session.milestone` populated from state.json.milestones[]
345
340
  - [ ] context.md contains all decisions classified as Locked/Free/Deferred
346
341
  - [ ] Decision Recording Protocol applied to all decisions
347
342
  - [ ] Confidence scored per dimension with factor-based model (full mode)
@@ -7,19 +7,19 @@
7
7
  "commands": [
8
8
  {"name": "maestro", "command": "/maestro", "category": "core", "description": "智能协调器 — 根据意图和项目状态自动选择最优命令链", "source": "../../commands/maestro.md"},
9
9
  {"name": "maestro-init", "command": "/maestro-init", "category": "core", "description": "项目初始化 — 创建 .workflow/ 目录结构和状态文件", "source": "../../commands/maestro-init.md"},
10
- {"name": "maestro-roadmap", "command": "/maestro-roadmap", "category": "core", "description": "路线图编排 — 消费上游 context,纯 Milestone > Phase 分解(不做技术探索)", "source": "../../commands/maestro-roadmap.md"},
10
+ {"name": "maestro-roadmap", "command": "/maestro-roadmap", "category": "core", "description": "路线图编排 — Milestone > Phase 分解,下游以 milestone 为入口", "source": "../../commands/maestro-roadmap.md"},
11
11
  {"name": "maestro-brainstorm", "command": "/maestro-brainstorm", "category": "core", "description": "头脑风暴 — 发散探索,多角色创意,上游起源命令", "source": "../../commands/maestro-brainstorm.md"},
12
12
  {"name": "maestro-blueprint", "command": "/maestro-blueprint", "category": "core", "description": "正式规格文档化 — 7-phase 收敛规格链,上游起源命令,产出 .workflow/blueprint/", "source": "../../commands/maestro-blueprint.md"},
13
13
  {"name": "maestro-analyze", "command": "/maestro-analyze", "category": "pipeline", "description": "双层分析 — 宏观(文本参数)探索影响面+scope_verdict / 微观(数字参数)Phase 级深入", "source": "../../commands/maestro-analyze.md"},
14
14
  {"name": "maestro-plan", "command": "/maestro-plan", "category": "pipeline", "description": "任务规划 — 支持 --from analyze:ANL-xxx 直达、碰撞检测、gap 修复计划", "source": "../../commands/maestro-plan.md"},
15
15
  {"name": "maestro-execute", "command": "/maestro-execute", "category": "pipeline", "description": "任务执行 — wave 并行执行、delegate 编排、自动提交", "source": "../../commands/maestro-execute.md"},
16
- {"name": "maestro-quick", "command": "/maestro-quick", "category": "core", "description": "快速任务 — 跳过 Phase 管线直接完成,支持 --full/--discuss 模式", "source": "../../commands/maestro-quick.md"},
16
+ {"name": "maestro-quick", "command": "/maestro-quick", "category": "core", "description": "快速任务 — 跳过管线直接完成,支持 --full/--discuss 模式", "source": "../../commands/maestro-quick.md"},
17
17
  {"name": "maestro-overlay", "command": "/maestro-overlay", "category": "core", "description": "Overlay 管理 — 创建、查看、删除命令补丁", "source": "../../commands/maestro-overlay.md"},
18
18
  {"name": "maestro-amend", "command": "/maestro-amend", "category": "core", "description": "修正补丁 — 从工作流信号自动生成 overlay", "source": "../../commands/maestro-amend.md"},
19
19
  {"name": "maestro-fork", "command": "/maestro-fork", "category": "worktree", "description": "Worktree 分叉 — 基于 milestone 创建隔离开发环境", "source": "../../commands/maestro-fork.md"},
20
20
  {"name": "maestro-merge", "command": "/maestro-merge", "category": "worktree", "description": "Worktree 合并 — 同步变更回主线", "source": "../../commands/maestro-merge.md"},
21
21
  {"name": "maestro-collab", "command": "/maestro-collab", "category": "team", "description": "人类团队协作 — .workflow/collab/ 目录管理", "source": "../../commands/maestro-collab.md"},
22
- {"name": "maestro-milestone-audit", "command": "/maestro-milestone-audit", "category": "milestone", "description": "里程碑审计 — 检查 Phase 完成度和质量", "source": "../../commands/maestro-milestone-audit.md"},
22
+ {"name": "maestro-milestone-audit", "command": "/maestro-milestone-audit", "category": "milestone", "description": "里程碑审计 — 检查里程碑完成度和质量", "source": "../../commands/maestro-milestone-audit.md"},
23
23
  {"name": "maestro-milestone-complete", "command": "/maestro-milestone-complete", "category": "milestone", "description": "里程碑完成 — 归档里程碑并推进下一个", "source": "../../commands/maestro-milestone-complete.md"},
24
24
  {"name": "maestro-milestone-release", "command": "/maestro-milestone-release", "category": "milestone", "description": "里程碑发布 — 生成发布说明和变更日志", "source": "../../commands/maestro-milestone-release.md"},
25
25
  {"name": "maestro-composer", "command": "/maestro-composer", "category": "core", "description": "编排器 — compose + play 工作流组合执行", "source": "../../commands/maestro-composer.md"},
@@ -157,17 +157,17 @@
157
157
  ],
158
158
  "workflows": {
159
159
  "topology": {
160
- "hierarchy": "Roadmap > Milestone > Phase > Task",
160
+ "hierarchy": "Roadmap > Milestone > Phase | Plan > Task > Wave",
161
161
  "layers": {
162
162
  "upstream_origin": ["brainstorm (发散/轻量)", "blueprint (收敛/重型)"],
163
- "understanding": "analyze 双层: 宏观(文本参数) + 微观(数字参数)",
163
+ "understanding": "analyze 双层: 宏观(文本参数) + 微观(milestone 数字参数)",
164
164
  "orchestration": "roadmap (可选,消费上游 context)",
165
165
  "execution": ["plan", "execute", "verify"]
166
166
  }
167
167
  },
168
168
  "paths": {
169
- "A_full_project": "brainstorm → blueprint(可选) → analyze 宏观 → roadmap → analyze 微观 → plan → execute → quality-review",
170
- "B_large_feature": "analyze 宏观 → roadmap → analyze 微观 → plan → execute → quality-review",
169
+ "A_full_project": "brainstorm → blueprint(可选) → analyze 宏观 → roadmap → analyze {milestone} → plan {milestone} → execute → quality-review",
170
+ "B_large_feature": "analyze 宏观 → roadmap → analyze {milestone} → plan {milestone} → execute → quality-review",
171
171
  "C_medium_feature": "analyze 宏观 → plan --from analyze:ANL-xxx → execute → quality-review",
172
172
  "D_small_fix": "plan → execute → quality-review",
173
173
  "E_spec_only": "blueprint → (供人阅读)",
@@ -123,8 +123,8 @@ ls -la .workflow/.maestro/ 2>/dev/null | head -5 # 进行中的 session
123
123
  | 无 `.workflow/` + 有源码 | init | `maestro-init` |
124
124
  | 有 state.json,无 roadmap,无 milestones | analyze-macro | `maestro-analyze` (宏观调研) |
125
125
  | 有 macro analyze artifact,无 roadmap | roadmap | `maestro-roadmap` |
126
- | 有 roadmap,未启动 phase | analyze | `maestro-analyze {phase}` |
127
- | 最新 artifact = analyze | plan | `maestro-plan {phase}` |
126
+ | 有 roadmap,未启动 phase | analyze | `maestro-analyze {milestone}` |
127
+ | 最新 artifact = analyze | plan | `maestro-plan {milestone}` |
128
128
  | 最新 artifact = plan | execute | `maestro-execute {phase}` |
129
129
  | 最新 artifact = execute | review | `quality-review {phase}` |
130
130
  | review verdict=PASS | test-gen | `quality-auto-test {phase}` |
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: maestro-plan
3
- description: Use when creating, revising, or verifying an execution plan for a phase or task
4
- argument-hint: "[-y|--yes] [--concurrency N] [-c|--continue] \"<phase> [--dir <path>] [--from <source>] [--gaps] [--spec SPEC-xxx] [--collab]\""
3
+ description: Use when creating, revising, or verifying an execution plan for a milestone or task
4
+ argument-hint: "[-y|--yes] [--concurrency N] [-c|--continue] \"<milestone> [--dir <path>] [--from <source>] [--gaps] [--spec SPEC-xxx]\""
5
5
  allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, request_user_input
6
6
  ---
7
7
 
@@ -63,27 +63,24 @@ All mean: **follow the cycle anyway**.
63
63
  </tdd_mode>
64
64
 
65
65
  <context>
66
- $ARGUMENTS — phase number/text and optional flags.
66
+ $ARGUMENTS — milestone number/text and optional flags.
67
67
 
68
- **Flags**: `-y` (auto), `--concurrency N` (default 4), `-c`/`--continue` (resume), `--dir <path>`, `--from <source>` (load upstream context directly: analyze:ANL-xxx, blueprint:BLP-xxx, brainstorm:ID, @file, path), `--gaps` (issue-linked), `--spec SPEC-xxx`, `--collab`, `--revise`, `--check`, `--tdd` (RED-GREEN-REFACTOR task chains)
68
+ **Flags**: `-y` (auto), `--concurrency N` (default 4), `-c`/`--continue` (resume), `--dir <path>`, `--from <source>` (load upstream context directly: analyze:ANL-xxx, blueprint:BLP-xxx, brainstorm:ID, @file, path), `--gaps` (issue-linked), `--spec SPEC-xxx`, `--revise`, `--check`, `--tdd` (RED-GREEN-REFACTOR task chains)
69
+
70
+ > **`--collab` removed**: multi-agent collaborative planning is now automatic — milestones spanning >3 modules auto-trigger a 2+1 agent model (2 parallel planners scoped to 2-3 modules each + 1 synthesis agent that merges, runs DAG/cycle/conflict analysis, and produces a unified plan.json).
69
71
 
70
72
  **Scope routing** (priority, per redesign §5.2):
71
73
  1. `--from analyze:ANL-xxx` → CONTEXT_DIR = ANL artifact path; scope=`standalone`
72
74
  2. `--from blueprint:BLP-xxx` → CONTEXT_DIR = BLP path; scope=`standalone`
73
75
  3. `--dir <path>` → CONTEXT_DIR = path; scope=`standalone`
74
- 4. Numeric arg + roadmap → scope=`phase`; D-007 reverse-lookup milestone via `state.json.milestones[].phase_slugs`
76
+ 4. Numeric arg + roadmap → scope=`milestone`; resolve milestone from roadmap
75
77
  5. No args + roadmap → scope=`milestone` (plans all pending phases in current milestone)
76
78
  6. No args + no roadmap → search `state.json.artifacts[]` for latest `type=="analyze"` (DESC by created_at). Found → scope=`standalone`, CONTEXT_DIR = artifact.path. None → ERROR E001.
77
79
  7. Text arg + no upstream → scope=`adhoc/standalone`
78
80
 
79
- **D-007 milestone reverse lookup** (numeric scope only):
80
- ```
81
- resolve_milestone(phase_number):
82
- for ms in state.json.milestones[]:
83
- if str(phase_number) in ms.phase_slugs: return ms.id
84
- return state.json.current_milestone # fallback
85
- ```
86
- Write resolved milestone into PLN artifact registration and `plan.json.milestone`; NEVER read `current_milestone` directly for phase-scoped runs.
81
+ **Milestone resolution** (numeric scope only):
82
+ target_milestone = specified milestone number
83
+ IF not found in state.json.milestones[]: ERROR
87
84
 
88
85
  **Session**: `.workflow/.csv-wave/{YYYYMMDD}-plan-P{N}-{slug}/`
89
86
  **Scratch**: `.workflow/scratch/{YYYYMMDD}-plan-P{N}-{slug}/` (.task/ subdir)
@@ -139,7 +136,7 @@ S_REGISTER — 注册 PLN artifact、更新 index.json PERSIST: sta
139
136
 
140
137
  <transitions>
141
138
  S_PARSE → S_RESUME WHEN: --continue
142
- S_PARSE → S_CONTEXT WHEN: phase/dir/--from resolved (D-007 reverse lookup for numeric)
139
+ S_PARSE → S_CONTEXT WHEN: milestone/dir/--from resolved
143
140
  S_PARSE → S_CONTEXT WHEN: no args + no roadmap AND latest analyze artifact found in state.json (scope=standalone). Interactive mode: confirm the auto-discovered artifact with user ("Using analyze artifact ANL-xxx from {date}. Proceed?"). -y mode: auto-proceed with log.
144
141
  S_PARSE → ERROR WHEN: no args + no roadmap + no analyze artifact
145
142
 
@@ -253,7 +250,7 @@ Collision detection against same-milestone plans.
253
250
  1. Register PLN artifact in state.json (scope, milestone, phase, depends_on)
254
251
  2. Update index.json with plan metadata
255
252
  3. If --gaps: link TASK files back to issues bidirectionally (task_refs[], task_plan_dir in issues.jsonl)
256
- 4. Display: phase, task count, wave count, check status, confidence
253
+ 4. Display: milestone, task count, wave count, check status, confidence
257
254
  5. **Next-step suggestion** (suggest only, NEVER auto-execute): display recommended next command (e.g., `maestro-execute {phase}`). The user decides whether to proceed.
258
255
 
259
256
  </actions>
@@ -292,7 +289,7 @@ Collision detection against same-milestone plans.
292
289
  - [ ] Pressure pass completed on highest-complexity task
293
290
  - [ ] Collision detection against same-milestone plans (non-blocking)
294
291
  - [ ] Plan-checker passed (or minor issues acknowledged, max 3 iterations)
295
- - [ ] PLN artifact registered in state.json (numeric scope: milestone resolved via D-007 `phase_slugs` reverse lookup, NOT direct `current_milestone` read)
292
+ - [ ] PLN artifact registered in state.json (numeric scope: milestone resolved directly from arg)
296
293
  - [ ] No-args fallback honored: latest analyze artifact auto-discovered when roadmap absent (§5.2 priority 6)
297
294
  - [ ] If --gaps: issues linked bidirectionally (task_refs[], task_plan_dir in issues.jsonl)
298
295
  </success_criteria>
@@ -90,7 +90,7 @@ Remaining → intent (amend_mode 时为 change_request)
90
90
  7. **command_path 在 A_BUILD_STEPS 解析** — 通过 `maestro ralph skills --platform codex --json --quiet` 预校验(project 覆盖 global,限定 `.codex/skills/`),命中即写绝对路径到 status.json;未命中标 `command_scope = "missing"`
91
91
  8. **执行 step 加载契约** — 由 `maestro ralph next` CLI 在执行期完成:解析 frontmatter + `<required_reading>` + `<deferred_reading>`,自动读取 required 文件全文并拼入 prompt;缺失 required → 退出码 1(E007),pause session。ralph build 阶段只通过 `maestro ralph skills --platform codex` 校验路径存在性,不读 SKILL.md 内容
92
92
  9. **Decomposition is outcome-oriented** — sub-goals 为可观测交付,禁止 lifecycle 复刻;通过 `create_goal` 绑定目标,`update_goal` 在收敛时释放
93
- 10. **planning_mode governs arg granularity** — `unified` → skill args 无 `{phase}`;`independent` → `{phase}`
93
+ 10. **planning_mode governs arg granularity** — `unified` → skill args 无 phase/milestone 占位符;`independent` → analyze/plan `{milestone}`,execute/quality 用 `{phase}`
94
94
  11. **task_decomposition 驱动 steps[] 动态生长** — `post-goal-audit` 按 unmet 子目标插入 scoped mini-loop;字段可选/累加,既有字段不删不改
95
95
  12. **Platform** — `session.platform = "codex"`;CLI 调用一律带 `--platform codex`
96
96
  13. **Invariant violation = BLOCK** — violating any invariant above blocks the current operation. Do NOT bypass for "efficiency" or "clear intent" reasons. Especially invariants about ralph never executing steps and completion_confirmed by CLI.
@@ -426,8 +426,8 @@ Generate steps from `session.lifecycle_position` to `milestone-complete`(`sess
426
426
  | init | `maestro-init` | *(same)* | — | all |
427
427
  | analyze-macro | `maestro-analyze "{intent}"` | *(same)* | `post-analyze-scope` | all |
428
428
  | roadmap | `maestro-roadmap --from analyze:{analyze_macro_id}` | *(same)* | — | all |
429
- | analyze | `maestro-analyze {phase}` | `maestro-analyze` | — | all |
430
- | plan | `maestro-plan {phase}` *(scope=phase)* / `maestro-plan --from analyze:{analyze_macro_id}` *(scope=standalone)* / `maestro-plan --from blueprint:{blueprint_id}` *(scope=standalone)* | `maestro-plan` | — | all |
429
+ | analyze | `maestro-analyze {milestone}` | `maestro-analyze` | — | all |
430
+ | plan | `maestro-plan {milestone}` *(scope=phase)* / `maestro-plan --from analyze:{analyze_macro_id}` *(scope=standalone)* / `maestro-plan --from blueprint:{blueprint_id}` *(scope=standalone)* | `maestro-plan` | — | all |
431
431
  | execute | `maestro-execute {phase}` | `maestro-execute` | `post-execute` | all |
432
432
  | business-test | `quality-auto-test {phase}` | `quality-auto-test` | `post-business-test` | full only |
433
433
  | review | `quality-review {phase}` | `quality-review` | `post-review` | all (quick: append `--tier quick`) |
@@ -471,9 +471,9 @@ Generate steps from `session.lifecycle_position` to `milestone-complete`(`sess
471
471
  - `analyze_macro_id` 存在且当前 step 是 `roadmap` → args 改为 `--from analyze:{analyze_macro_id}`
472
472
  - `analyze_macro_id` 存在且 `scope_verdict ∈ {medium, small}` 且当前 step 是 `plan` → args 改为 `--from analyze:{analyze_macro_id}`
473
473
  - `blueprint_id` 存在 → 当前 step 是 `plan` → args 改为 `--from blueprint:{blueprint_id}`(优先级低于 phase 数字参数)
474
- - **phase-level deferred chaining**(独立模式,step 含 `{phase}` 占位符):build 阶段前序 artifact 尚未产出,由 A_RESOLVE_ARGS(ralph-execute)运行时从 state.json 查找同 phase+milestone 最新 completed artifact 注入:
475
- - `plan` step `--from analyze:{phase_analyze_id}`,写 `source_artifact_ref`
476
- - `execute` step `--dir {plan_path}`(现有逻辑),写 `source_artifact_ref = "plan:{id}"`
474
+ - **deferred chaining**(独立模式):build 阶段前序 artifact 尚未产出,由 A_RESOLVE_ARGS(ralph-execute)运行时从 state.json 查找并注入:
475
+ - `plan` step(含 `{milestone}` 占位符)→ 查同 milestone 最新 completed analyze artifact,`--from analyze:{milestone_analyze_id}`,写 `source_artifact_ref`
476
+ - `execute` step(含 `{phase}` 占位符)→ 查同 phase+milestone 最新 completed plan artifact,`--dir {plan_path}`(现有逻辑),写 `source_artifact_ref = "plan:{id}"`
477
477
  - 写入 `step.source_artifact_ref` 以便审计
478
478
  13. **D-007 Milestone-ref 标注**:每个含 `{phase}` 占位符的 step → `step.milestone_id = session.milestone`(由 A_RESOLVE_PHASE 反查得出),禁止读 `current_milestone`
479
479
  14. **动态插入步骤**(A_APPLY_*)同样应用规则 7-13
@@ -875,9 +875,9 @@ Decomposition 产出后通过 Codex 内置工具管理目标(由 A_DECOMPOSE_T
875
875
  - [ ] Intent overrides 识别 grill / brainstorm / blueprint / analyze-macro
876
876
  - [ ] auto_confirm=true 时 grill step args 追加 `-y`(Auto mode 代码代答,stage 不跳过)
877
877
  - [ ] A_RESOLVE_SCOPE_VERDICT 读 macro analyze conclusions.scope_verdict,写入 session.scope_verdict + analyze_macro_id
878
- - [ ] 链路起点 = analyze-macro 时:large→roadmap+analyze+plan(phase);medium/small→直跳 plan --from analyze:{ANL_ID}(跳过 roadmap+analyze)
878
+ - [ ] 链路起点 = analyze-macro 时:large→roadmap+analyze+plan(milestone);medium/small→直跳 plan --from analyze:{ANL_ID}(跳过 roadmap+analyze)
879
879
  - [ ] post-analyze-scope decision 节点在 macro analyze 之后插入;A_SCOPE_EVALUATE/A_APPLY_SCOPE_VERDICT 重塑链路
880
- - [ ] plan step args 支持三路径:`{phase}` / `--from analyze:{ANL_ID}` / `--from blueprint:{BLP_ID}`,写入 step.source_artifact_ref
880
+ - [ ] plan step args 支持三路径:`{milestone}` / `--from analyze:{ANL_ID}` / `--from blueprint:{BLP_ID}`,写入 step.source_artifact_ref
881
881
  - [ ] roadmap step args 自动注入 `--from analyze:{analyze_macro_id}`(若存在)
882
882
  - [ ] artifact 过滤按 session.phase;unified 按 milestone
883
883
  - [ ] quality_mode 由 A_DETERMINE_QUALITY_MODE 决定,过滤 build steps
@@ -889,13 +889,13 @@ Decomposition 产出后通过 Codex 内置工具管理目标(由 A_DECOMPOSE_T
889
889
  - [ ] 每个 sub-goal 含 `completion_confirmed`(初始 false)
890
890
  - [ ] post-goal-audit decision 仅在 decomposed 时插入,位于 milestone-complete 之前
891
891
  - [ ] Unmet sub-goals 动态 grow steps[](goal_ref tagged);max retries → escalate
892
- - [ ] planning_mode 显式决定;unified=无 `{phase}`, independent=带 `{phase}`
892
+ - [ ] planning_mode 显式决定;unified=无占位符, independent=analyze/plan 带 `{milestone}`、execute/quality `{phase}`
893
893
  - [ ] Chain 必须以 `milestone-complete` 结尾
894
894
  - [ ] Decision nodes 由 maestro delegate --role analyze 评估
895
895
  - [ ] Ralph 不执行 step,只 evaluate;`Skill(maestro-ralph-execute)` 直调 handoff
896
896
  - [ ] session.platform = "codex";所有 CLI 调用携带 `--platform codex`
897
- - [ ] Phase-level deferred chaining:plan/execute step 的 `--from`/`--dir` 注入由 A_RESOLVE_ARGS(ralph-execute)运行时完成;build 阶段标记意图,不预知 artifact ID
898
- - [ ] Phase-level plan step 运行时获得 `--from analyze:{phase_analyze_id}`(由 ralph-execute 从 state.json 查找注入)
897
+ - [ ] Deferred chaining:plan/execute step 的 `--from`/`--dir` 注入由 A_RESOLVE_ARGS(ralph-execute)运行时完成;build 阶段标记意图,不预知 artifact ID
898
+ - [ ] Milestone-level plan step 运行时获得 `--from analyze:{milestone_analyze_id}`(由 ralph-execute 从 state.json 查找注入)
899
899
  - [ ] Phase-level execute step 运行时获得 `source_artifact_ref = "plan:{id}"`
900
900
  - [ ] 每个 step 含 `completion_summary` + `completion_decisions` + `completion_caveats` + `completion_deferred`(初始 null)
901
901
  - [ ] `completion_summary` 在 DONE/DONE_WITH_CONCERNS 时为 MUST(由 CLI `--summary` 参数传入)
@@ -147,22 +147,22 @@ S_FALLBACK:
147
147
  |-------|-----------------|--------|
148
148
  | maestro-brainstorm | topic | `"{intent}"` |
149
149
  | maestro-roadmap | description | `"{intent}"` |
150
- | maestro-analyze | phase or topic | `{phase}` or `"{intent}"` |
151
- | maestro-plan | phase, --from, or --dir | see --from auto-injection below |
150
+ | maestro-analyze | milestone or topic | `{milestone}` or `"{intent}"` |
151
+ | maestro-plan | milestone, --from, or --dir | see --from auto-injection below |
152
152
  | maestro-execute | phase or --dir | see --from auto-injection below |
153
153
  | quality-debug | gap context | Read previous step's error/gap |
154
154
  | quality-* | phase | `{phase}` |
155
155
 
156
- **--from auto-injection (phase-level artifact chaining):**
156
+ **--from auto-injection (artifact chaining):**
157
157
 
158
- Phase-level steps 在 build 阶段无法预知前序 artifact ID。A_RESOLVE_ARGS 运行时从 state.json 查找并注入显式引用,打通 analyze→plan→execute 数据管道:
158
+ Steps 在 build 阶段无法预知前序 artifact ID。A_RESOLVE_ARGS 运行时从 state.json 查找并注入显式引用,打通 analyze→plan→execute 数据管道:
159
159
 
160
160
  ```
161
161
  Read state.json.artifacts(含 milestone_history 内归档 artifacts)
162
- → filter by milestone={session.milestone} + phase={session.phase} + status=="completed"
162
+ → filter by milestone={session.milestone} (+ phase={session.phase} for execute-step lookups) + status=="completed"
163
163
 
164
- plan step(含 {phase} 占位符,args 无 --from 且无 --dir):
165
- 1. 查同 phase+milestone 最新 completed type=="analyze" artifact → id = ANL-xxx
164
+ plan step(含 {milestone} 占位符,args 无 --from 且无 --dir):
165
+ 1. 查同 milestone 最新 completed type=="analyze" artifact → id = ANL-xxx
166
166
  2. 命中 → args 追加 --from analyze:{id}
167
167
  3. 写 step.source_artifact_ref = "analyze:{id}"
168
168
 
@@ -366,7 +366,7 @@ Display: `[{index}/{total}] ✗ {step.skill} 失败,会话已暂停。Skill(ma
366
366
  - [ ] Auto mode: retry 一次后 pause;interactive 提供 retry/skip/abort
367
367
  - [ ] 自调用持续到全部 completion_confirmed 或 paused
368
368
  - [ ] 只处理 session.platform == "codex" 的会话
369
- - [ ] --from auto-injection:phase-level plan step 运行时从 state.json 查找同 phase+milestone 最新 completed analyze artifact → 注入 `--from analyze:{id}`,写 `source_artifact_ref`
369
+ - [ ] --from auto-injection:milestone-level plan step 运行时从 state.json 查找同 milestone 最新 completed analyze artifact → 注入 `--from analyze:{id}`,写 `source_artifact_ref`
370
370
  - [ ] --from auto-injection:phase-level execute step 运行时查找同 phase+milestone 最新 completed plan artifact → 注入 `--dir`,写 `source_artifact_ref`
371
371
  - [ ] Goal context injection:`ralph_protocol_version < "2"` → 前置 `<goal_context>` block;`>= "2"` → skip(session_anchor 覆盖)
372
372
  - [ ] Goal context 包含 sub-goal description、done_when、boundary、evidence、execution_criteria
@@ -100,7 +100,7 @@ export declare function vectorSearch(queryVector: Float32Array, index: Embedding
100
100
  * Falls back to flat cosine scan when zvec is unavailable or feature flag is set.
101
101
  */
102
102
  export declare function vectorSearchZvec(queryVector: Float32Array, dir: string, limit: number): Promise<VectorSearchResult[]>;
103
- export declare function saveEmbeddingIndex(index: EmbeddingIndex, dir: string): void;
103
+ export declare function saveEmbeddingIndex(index: EmbeddingIndex, dir: string): Promise<void>;
104
104
  export declare function loadEmbeddingIndex(dir: string): EmbeddingIndex | null;
105
105
  export interface DocForEmbedding {
106
106
  id: string;
@@ -109,7 +109,7 @@ export interface DocForEmbedding {
109
109
  tags: string[];
110
110
  body?: string;
111
111
  }
112
- export declare function hashDocContent(d: DocForEmbedding): string;
112
+ export declare function hashDocContent(d: DocForEmbedding, enrichedText?: string): string;
113
113
  /**
114
114
  * Split a document into multiple chunks for embedding.
115
115
  * Short docs (<500 chars body) produce a single chunk.