maestro-flow 0.3.33 → 0.3.34

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 (206) hide show
  1. package/.codex/skills/maestro-ralph/SKILL.md +154 -153
  2. package/dashboard/dist-server/src/config/cli-tools-config.js +5 -20
  3. package/dashboard/dist-server/src/config/cli-tools-config.js.map +1 -1
  4. package/dashboard/dist-server/src/config/cli-tools-defaults.json +17 -0
  5. package/dist/src/commands/config.d.ts.map +1 -1
  6. package/dist/src/commands/config.js +168 -32
  7. package/dist/src/commands/config.js.map +1 -1
  8. package/dist/src/commands/hooks.d.ts +9 -0
  9. package/dist/src/commands/hooks.d.ts.map +1 -1
  10. package/dist/src/commands/hooks.js +1 -1
  11. package/dist/src/commands/hooks.js.map +1 -1
  12. package/dist/src/commands/install.js +1 -1
  13. package/dist/src/commands/install.js.map +1 -1
  14. package/dist/src/commands/overlay.js +1 -1
  15. package/dist/src/commands/overlay.js.map +1 -1
  16. package/dist/src/commands/tools.d.ts.map +1 -1
  17. package/dist/src/commands/tools.js +7 -17
  18. package/dist/src/commands/tools.js.map +1 -1
  19. package/dist/src/commands/uninstall.js +1 -1
  20. package/dist/src/commands/uninstall.js.map +1 -1
  21. package/dist/src/config/cli-tools-config.d.ts.map +1 -1
  22. package/dist/src/config/cli-tools-config.js +5 -20
  23. package/dist/src/config/cli-tools-config.js.map +1 -1
  24. package/dist/src/config/cli-tools-defaults.json +17 -0
  25. package/dist/src/tui/config-ui/ConfigHub.d.ts +14 -0
  26. package/dist/src/tui/config-ui/ConfigHub.d.ts.map +1 -0
  27. package/dist/src/tui/config-ui/ConfigHub.js +125 -0
  28. package/dist/src/tui/config-ui/ConfigHub.js.map +1 -0
  29. package/dist/src/tui/config-ui/ConfigSourcesView.d.ts +6 -0
  30. package/dist/src/tui/config-ui/ConfigSourcesView.d.ts.map +1 -0
  31. package/dist/src/tui/config-ui/ConfigSourcesView.js +25 -0
  32. package/dist/src/tui/config-ui/ConfigSourcesView.js.map +1 -0
  33. package/dist/src/tui/config-ui/HooksPanel.d.ts +6 -0
  34. package/dist/src/tui/config-ui/HooksPanel.d.ts.map +1 -0
  35. package/dist/src/tui/config-ui/HooksPanel.js +92 -0
  36. package/dist/src/tui/config-ui/HooksPanel.js.map +1 -0
  37. package/dist/src/tui/config-ui/SkillConfigDashboard.d.ts +9 -0
  38. package/dist/src/tui/config-ui/SkillConfigDashboard.d.ts.map +1 -0
  39. package/dist/src/tui/config-ui/SkillConfigDashboard.js +64 -0
  40. package/dist/src/tui/config-ui/SkillConfigDashboard.js.map +1 -0
  41. package/dist/src/tui/config-ui/SkillParamEditor.d.ts +12 -0
  42. package/dist/src/tui/config-ui/SkillParamEditor.d.ts.map +1 -0
  43. package/dist/src/tui/config-ui/SkillParamEditor.js +162 -0
  44. package/dist/src/tui/config-ui/SkillParamEditor.js.map +1 -0
  45. package/dist/src/tui/config-ui/SkillsList.d.ts +12 -0
  46. package/dist/src/tui/config-ui/SkillsList.d.ts.map +1 -0
  47. package/dist/src/tui/config-ui/SkillsList.js +91 -0
  48. package/dist/src/tui/config-ui/SkillsList.js.map +1 -0
  49. package/dist/src/tui/config-ui/SpecPanel.d.ts +6 -0
  50. package/dist/src/tui/config-ui/SpecPanel.d.ts.map +1 -0
  51. package/dist/src/tui/config-ui/SpecPanel.js +79 -0
  52. package/dist/src/tui/config-ui/SpecPanel.js.map +1 -0
  53. package/dist/src/tui/config-ui/index.d.ts +23 -0
  54. package/dist/src/tui/config-ui/index.d.ts.map +1 -0
  55. package/dist/src/tui/config-ui/index.js +34 -0
  56. package/dist/src/tui/config-ui/index.js.map +1 -0
  57. package/dist/src/tui/index.d.ts +7 -0
  58. package/dist/src/tui/index.d.ts.map +1 -0
  59. package/dist/src/tui/index.js +10 -0
  60. package/dist/src/tui/index.js.map +1 -0
  61. package/dist/src/tui/install-ui/BackupConfig.d.ts +10 -0
  62. package/dist/src/tui/install-ui/BackupConfig.d.ts.map +1 -0
  63. package/dist/src/tui/install-ui/BackupConfig.js +46 -0
  64. package/dist/src/tui/install-ui/BackupConfig.js.map +1 -0
  65. package/dist/src/tui/install-ui/BlueprintPreview.d.ts +9 -0
  66. package/dist/src/tui/install-ui/BlueprintPreview.d.ts.map +1 -0
  67. package/dist/src/tui/install-ui/BlueprintPreview.js +65 -0
  68. package/dist/src/tui/install-ui/BlueprintPreview.js.map +1 -0
  69. package/dist/src/tui/install-ui/BlueprintPreview.logic.d.ts +33 -0
  70. package/dist/src/tui/install-ui/BlueprintPreview.logic.d.ts.map +1 -0
  71. package/dist/src/tui/install-ui/BlueprintPreview.logic.js +51 -0
  72. package/dist/src/tui/install-ui/BlueprintPreview.logic.js.map +1 -0
  73. package/dist/src/tui/install-ui/ComponentGrid.d.ts +13 -0
  74. package/dist/src/tui/install-ui/ComponentGrid.d.ts.map +1 -0
  75. package/dist/src/tui/install-ui/ComponentGrid.js +75 -0
  76. package/dist/src/tui/install-ui/ComponentGrid.js.map +1 -0
  77. package/dist/src/tui/install-ui/ComponentGrid.logic.d.ts +31 -0
  78. package/dist/src/tui/install-ui/ComponentGrid.logic.d.ts.map +1 -0
  79. package/dist/src/tui/install-ui/ComponentGrid.logic.js +58 -0
  80. package/dist/src/tui/install-ui/ComponentGrid.logic.js.map +1 -0
  81. package/dist/src/tui/install-ui/ConfigPanel.d.ts +11 -0
  82. package/dist/src/tui/install-ui/ConfigPanel.d.ts.map +1 -0
  83. package/dist/src/tui/install-ui/ConfigPanel.js +35 -0
  84. package/dist/src/tui/install-ui/ConfigPanel.js.map +1 -0
  85. package/dist/src/tui/install-ui/CyberItem.d.ts +18 -0
  86. package/dist/src/tui/install-ui/CyberItem.d.ts.map +1 -0
  87. package/dist/src/tui/install-ui/CyberItem.js +33 -0
  88. package/dist/src/tui/install-ui/CyberItem.js.map +1 -0
  89. package/dist/src/tui/install-ui/CyberdeckBlueprint.d.ts +7 -0
  90. package/dist/src/tui/install-ui/CyberdeckBlueprint.d.ts.map +1 -0
  91. package/dist/src/tui/install-ui/CyberdeckBlueprint.js +91 -0
  92. package/dist/src/tui/install-ui/CyberdeckBlueprint.js.map +1 -0
  93. package/dist/src/tui/install-ui/ExecutionView.d.ts +12 -0
  94. package/dist/src/tui/install-ui/ExecutionView.d.ts.map +1 -0
  95. package/dist/src/tui/install-ui/ExecutionView.js +154 -0
  96. package/dist/src/tui/install-ui/ExecutionView.js.map +1 -0
  97. package/dist/src/tui/install-ui/GradientHeader.d.ts +8 -0
  98. package/dist/src/tui/install-ui/GradientHeader.d.ts.map +1 -0
  99. package/dist/src/tui/install-ui/GradientHeader.js +18 -0
  100. package/dist/src/tui/install-ui/GradientHeader.js.map +1 -0
  101. package/dist/src/tui/install-ui/HooksConfig.d.ts +8 -0
  102. package/dist/src/tui/install-ui/HooksConfig.d.ts.map +1 -0
  103. package/dist/src/tui/install-ui/HooksConfig.js +35 -0
  104. package/dist/src/tui/install-ui/HooksConfig.js.map +1 -0
  105. package/dist/src/tui/install-ui/InstallConfirm.d.ts +27 -0
  106. package/dist/src/tui/install-ui/InstallConfirm.d.ts.map +1 -0
  107. package/dist/src/tui/install-ui/InstallConfirm.js +25 -0
  108. package/dist/src/tui/install-ui/InstallConfirm.js.map +1 -0
  109. package/dist/src/tui/install-ui/InstallExecution.d.ts +21 -0
  110. package/dist/src/tui/install-ui/InstallExecution.d.ts.map +1 -0
  111. package/dist/src/tui/install-ui/InstallExecution.js +154 -0
  112. package/dist/src/tui/install-ui/InstallExecution.js.map +1 -0
  113. package/dist/src/tui/install-ui/InstallFlow.d.ts +14 -0
  114. package/dist/src/tui/install-ui/InstallFlow.d.ts.map +1 -0
  115. package/dist/src/tui/install-ui/InstallFlow.js +186 -0
  116. package/dist/src/tui/install-ui/InstallFlow.js.map +1 -0
  117. package/dist/src/tui/install-ui/InstallHub.d.ts +33 -0
  118. package/dist/src/tui/install-ui/InstallHub.d.ts.map +1 -0
  119. package/dist/src/tui/install-ui/InstallHub.js +97 -0
  120. package/dist/src/tui/install-ui/InstallHub.js.map +1 -0
  121. package/dist/src/tui/install-ui/InstallResult.d.ts +7 -0
  122. package/dist/src/tui/install-ui/InstallResult.d.ts.map +1 -0
  123. package/dist/src/tui/install-ui/InstallResult.js +15 -0
  124. package/dist/src/tui/install-ui/InstallResult.js.map +1 -0
  125. package/dist/src/tui/install-ui/McpConfig.d.ts +12 -0
  126. package/dist/src/tui/install-ui/McpConfig.d.ts.map +1 -0
  127. package/dist/src/tui/install-ui/McpConfig.js +69 -0
  128. package/dist/src/tui/install-ui/McpConfig.js.map +1 -0
  129. package/dist/src/tui/install-ui/ResultDashboard.d.ts +8 -0
  130. package/dist/src/tui/install-ui/ResultDashboard.d.ts.map +1 -0
  131. package/dist/src/tui/install-ui/ResultDashboard.js +17 -0
  132. package/dist/src/tui/install-ui/ResultDashboard.js.map +1 -0
  133. package/dist/src/tui/install-ui/ReviewPanel.d.ts +19 -0
  134. package/dist/src/tui/install-ui/ReviewPanel.d.ts.map +1 -0
  135. package/dist/src/tui/install-ui/ReviewPanel.js +25 -0
  136. package/dist/src/tui/install-ui/ReviewPanel.js.map +1 -0
  137. package/dist/src/tui/install-ui/ShortcutFooter.d.ts +7 -0
  138. package/dist/src/tui/install-ui/ShortcutFooter.d.ts.map +1 -0
  139. package/dist/src/tui/install-ui/ShortcutFooter.js +15 -0
  140. package/dist/src/tui/install-ui/ShortcutFooter.js.map +1 -0
  141. package/dist/src/tui/install-ui/StatuslineConfig.d.ts +11 -0
  142. package/dist/src/tui/install-ui/StatuslineConfig.d.ts.map +1 -0
  143. package/dist/src/tui/install-ui/StatuslineConfig.js +39 -0
  144. package/dist/src/tui/install-ui/StatuslineConfig.js.map +1 -0
  145. package/dist/src/tui/install-ui/StepSelector.d.ts +14 -0
  146. package/dist/src/tui/install-ui/StepSelector.d.ts.map +1 -0
  147. package/dist/src/tui/install-ui/StepSelector.js +46 -0
  148. package/dist/src/tui/install-ui/StepSelector.js.map +1 -0
  149. package/dist/src/tui/install-ui/index.d.ts +8 -0
  150. package/dist/src/tui/install-ui/index.d.ts.map +1 -0
  151. package/dist/src/tui/install-ui/index.js +10 -0
  152. package/dist/src/tui/install-ui/index.js.map +1 -0
  153. package/dist/src/tui/install-ui/types.d.ts +35 -0
  154. package/dist/src/tui/install-ui/types.d.ts.map +1 -0
  155. package/dist/src/tui/install-ui/types.js +25 -0
  156. package/dist/src/tui/install-ui/types.js.map +1 -0
  157. package/dist/src/tui/overlay-ui/OverlayList.d.ts +37 -0
  158. package/dist/src/tui/overlay-ui/OverlayList.d.ts.map +1 -0
  159. package/dist/src/tui/overlay-ui/OverlayList.js +146 -0
  160. package/dist/src/tui/overlay-ui/OverlayList.js.map +1 -0
  161. package/dist/src/tui/overlay-ui/index.d.ts +18 -0
  162. package/dist/src/tui/overlay-ui/index.d.ts.map +1 -0
  163. package/dist/src/tui/overlay-ui/index.js +204 -0
  164. package/dist/src/tui/overlay-ui/index.js.map +1 -0
  165. package/dist/src/tui/render.d.ts +13 -0
  166. package/dist/src/tui/render.d.ts.map +1 -0
  167. package/dist/src/tui/render.js +31 -0
  168. package/dist/src/tui/render.js.map +1 -0
  169. package/dist/src/tui/tools-ui/CommandReference.d.ts +7 -0
  170. package/dist/src/tui/tools-ui/CommandReference.d.ts.map +1 -0
  171. package/dist/src/tui/tools-ui/CommandReference.js +33 -0
  172. package/dist/src/tui/tools-ui/CommandReference.js.map +1 -0
  173. package/dist/src/tui/tools-ui/ConfigSources.d.ts +6 -0
  174. package/dist/src/tui/tools-ui/ConfigSources.d.ts.map +1 -0
  175. package/dist/src/tui/tools-ui/ConfigSources.js +27 -0
  176. package/dist/src/tui/tools-ui/ConfigSources.js.map +1 -0
  177. package/dist/src/tui/tools-ui/RegisterSettings.d.ts +8 -0
  178. package/dist/src/tui/tools-ui/RegisterSettings.d.ts.map +1 -0
  179. package/dist/src/tui/tools-ui/RegisterSettings.js +125 -0
  180. package/dist/src/tui/tools-ui/RegisterSettings.js.map +1 -0
  181. package/dist/src/tui/tools-ui/RoleMappings.d.ts +9 -0
  182. package/dist/src/tui/tools-ui/RoleMappings.d.ts.map +1 -0
  183. package/dist/src/tui/tools-ui/RoleMappings.js +104 -0
  184. package/dist/src/tui/tools-ui/RoleMappings.js.map +1 -0
  185. package/dist/src/tui/tools-ui/ToolsDashboard.d.ts +8 -0
  186. package/dist/src/tui/tools-ui/ToolsDashboard.d.ts.map +1 -0
  187. package/dist/src/tui/tools-ui/ToolsDashboard.js +60 -0
  188. package/dist/src/tui/tools-ui/ToolsDashboard.js.map +1 -0
  189. package/dist/src/tui/tools-ui/ToolsOverview.d.ts +9 -0
  190. package/dist/src/tui/tools-ui/ToolsOverview.d.ts.map +1 -0
  191. package/dist/src/tui/tools-ui/ToolsOverview.js +84 -0
  192. package/dist/src/tui/tools-ui/ToolsOverview.js.map +1 -0
  193. package/dist/src/tui/tools-ui/index.d.ts +3 -0
  194. package/dist/src/tui/tools-ui/index.d.ts.map +1 -0
  195. package/dist/src/tui/tools-ui/index.js +6 -0
  196. package/dist/src/tui/tools-ui/index.js.map +1 -0
  197. package/dist/src/tui/uninstall-ui/UninstallFlow.d.ts +7 -0
  198. package/dist/src/tui/uninstall-ui/UninstallFlow.d.ts.map +1 -0
  199. package/dist/src/tui/uninstall-ui/UninstallFlow.js +189 -0
  200. package/dist/src/tui/uninstall-ui/UninstallFlow.js.map +1 -0
  201. package/dist/src/tui/uninstall-ui/index.d.ts +3 -0
  202. package/dist/src/tui/uninstall-ui/index.d.ts.map +1 -0
  203. package/dist/src/tui/uninstall-ui/index.js +6 -0
  204. package/dist/src/tui/uninstall-ui/index.js.map +1 -0
  205. package/package.json +1 -1
  206. package/.codex/skills/maestro-ralph-execute/SKILL.md +0 -219
@@ -7,21 +7,22 @@ allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, AskUser
7
7
 
8
8
  <purpose>
9
9
  Closed-loop decision engine for the maestro workflow lifecycle.
10
- Two entry points with distinct roles:
10
+ Coordinator assembles fully-resolved skill calls and spawns them via `spawn_agents_on_csv` —
11
+ never executes skills directly. Uses `functions.update_plan()` for progress tracking.
11
12
 
12
- - **`$maestro-ralph "intent"`** — Decision mode: read state → infer position → build/expand chain → write status.json → execute first wave(s) until a decision node → STOP
13
- - **`$maestro-ralph execute`** — Execute mode: resume from status.jsonrun next wave(s) until a decision node → STOP
13
+ Entry points:
14
+ - **`$maestro-ralph "intent"`** — Read state infer positionbuild chain execute waves until decision node → STOP
15
+ - **`$maestro-ralph execute`** — Resume from status.json → run next wave(s) until decision node → STOP
14
16
  - **`$maestro-ralph status`** — Display session progress
15
- - **`$maestro-ralph continue`** — Alias for `execute` (resume after decision)
17
+ - **`$maestro-ralph continue`** — Alias for `execute`
16
18
 
17
19
  Key difference from maestro coordinator:
18
20
  - maestro: static chain → run all waves to completion
19
21
  - ralph: living chain → decision nodes pause execution → ralph re-evaluates → chain grows/shrinks dynamically
20
22
 
21
- Three node types in the chain:
22
- - **decision**: Barrier that STOPS execution. Ralph re-reads result files, decides whether to expand chain.
23
- - **skill**: Executed via `spawn_agents_on_csv`. Barrier skills (analyze, plan, execute, brainstorm) run solo. Non-barriers can parallel.
24
- - **cli**: Executed via `maestro delegate` (轻量替代,如 quick 模式的 review)。单步执行,不进 CSV wave。
23
+ Two node types:
24
+ - **skill**: Executed via `spawn_agents_on_csv`. Barrier skills run solo; non-barriers can parallel.
25
+ - **decision**: Coordinator evaluates result files, decides whether to expand chain, then STOPs.
25
26
 
26
27
  Session at `.workflow/.maestro/ralph-{YYYYMMDD-HHmmss}/status.json`.
27
28
  </purpose>
@@ -37,13 +38,13 @@ otherwise → handleNew(). Start from Phase 1.
37
38
  ```
38
39
 
39
40
  **Flags:**
40
- - `-y` / `--yes` — Auto mode: skip confirmation, decision nodes auto-evaluate并继续(不 STOP),错误自动重试一次后跳过。`-y` 存入 `session.auto_mode`,传播到 ralph-execute 及下游 skill。
41
+ - `-y` / `--yes` — Auto mode: skip confirmation, decision nodes auto-evaluate 并继续(不 STOP),错误自动重试一次后跳过。
41
42
 
42
- **`-y` 传播链:**
43
+ **`-y` 传播:**
43
44
  ```
44
45
  ralph -y → session.auto_mode = true
45
- wave CSV skill_call 附加 -y: $maestro-ralph-execute -y "$skill_call"
46
- ralph-execute 解析 -y,附加到目标 skill: $maestro-plan -y 1
46
+ buildSkillCall() 按传播表直接附加 auto flag 到最终 skill_call
47
+ CSV 写入完整命令: $maestro-plan 1 -y
47
48
  ```
48
49
 
49
50
  **`-y` 下游传播表:**
@@ -71,16 +72,17 @@ If status.json has a pending decision node as next step → Phase 2b (evaluate),
71
72
  </context>
72
73
 
73
74
  <invariants>
74
- 1. **Skills via spawn_agents_on_csv, CLI via delegate**: Coordinator NEVER executes skills directly. CLI steps use `maestro delegate`.
75
- 2. **Decision nodes STOP execution**: After processing a decision node, coordinator writes status.json and STOPS. User must call `$maestro-ralph execute` to resume. **例外:`-y` 模式下 decision 自动评估后继续,不 STOP(post-debug-escalate 除外)。**
76
- 3. **Barrier = solo wave**: barrier skills (analyze, plan, execute, brainstorm, roadmap) always run alone.
77
- 4. **Non-barriers can parallel**: consecutive non-barrier + non-decision steps grouped into one wave.
78
- 5. **Decision = barrier + conditional stop**: decision node is always solo. 默认 STOP;`-y` 模式自动继续。
79
- 6. **Wave-by-wave**: never start wave N+1 before wave N results are read.
80
- 7. **Coordinator owns context**: sub-agents never read prior results.
81
- 8. **Abort on failure**: failed step `-y` 模式重试一次后跳过并继续;非 `-y` 模式 mark remaining skipped pause session.
82
- 9. **Quality mode governs steps**: quality_mode (full/standard/quick) 决定哪些质量步骤被包含。
83
- 10. **passed_gates skip**: 重试循环中已通过的质量门不重复执行(除非代码变更影响了其检查范围)。
75
+ 1. **ALL skills via spawn_agents_on_csv**: Every skill invocation MUST go through `spawn_agents_on_csv`. Coordinator NEVER executes skills directly. No exceptions.
76
+ 2. **Coordinator = prompt assembler**: Classify intent enrich args build CSV spawn read results assemble next CSV. Never runs skill logic itself.
77
+ 3. **Decision nodes STOP execution**: After processing a decision node, coordinator writes status.json and STOPS. User must call `$maestro-ralph execute` to resume. **例外:`-y` 模式下 decision 自动评估后继续,不 STOP(post-debug-escalate 除外)。**
78
+ 4. **Barrier = solo wave**: barrier skills (analyze, plan, execute, brainstorm, roadmap) always run alone.
79
+ 5. **Non-barriers can parallel**: consecutive non-barrier + non-decision steps grouped into one wave.
80
+ 6. **Decision = barrier + conditional stop**: decision node is always solo. 默认 STOP;`-y` 模式自动继续。
81
+ 7. **Wave-by-wave**: never start wave N+1 before wave N results are read.
82
+ 8. **Coordinator owns context**: sub-agents never read prior results coordinator assembles full skill_call with resolved args.
83
+ 9. **Abort on failure**: failed step → `-y` 模式重试一次后跳过并继续;非 `-y` 模式 mark remaining skipped → pause session.
84
+ 10. **Quality mode governs steps**: quality_mode (full/standard/quick) 决定哪些质量步骤被包含。
85
+ 11. **passed_gates skip**: 重试循环中已通过的质量门不重复执行(除非代码变更影响了其检查范围)。
84
86
  </invariants>
85
87
 
86
88
  <execution>
@@ -171,7 +173,7 @@ Fallback: glob .workflow/scratch/*-P{phase}-*/ sorted by date DESC, take first
171
173
  |------|------|----------|
172
174
  | `full` | 全量质量管线 | verify → business-test → review → test-gen → test |
173
175
  | `standard` | 标准管线(默认) | verify → review → test(跳过 business-test、test-gen 按条件) |
174
- | `quick` | 轻量验证 | verify → CLI-review(跳过 business-test、test-gen、test) |
176
+ | `quick` | 轻量验证 | verify → review --tier quick(跳过 business-test、test-gen、test) |
175
177
 
176
178
  Mode 选择逻辑(Phase 1a 后自动推断,可被用户覆盖):
177
179
  ```
@@ -192,8 +194,7 @@ plan maestro-plan {phase} yes —
192
194
  execute maestro-execute {phase} yes — always
193
195
  verify maestro-verify {phase} no decision:post-verify always
194
196
  business-test quality-auto-test {phase} no decision:post-biz-test full only ①
195
- review quality-review {phase} no decision:post-review full/standard
196
- └─ CLI alt delegate --role review — decision:post-review quick ②
197
+ review quality-review {phase} no decision:post-review always
197
198
  test-gen quality-auto-test {phase} no — full; standard 按条件 ③
198
199
  test quality-test {phase} no decision:post-test full/standard ④
199
200
  milestone-audit maestro-milestone-audit no — always
@@ -201,21 +202,10 @@ milestone-complete maestro-milestone-complete no decision:post-milesto
201
202
  ```
202
203
 
203
204
  **条件说明:**
204
- - ① `business-test`: 仅 full 模式。与 `quality-test` 有 40% 重叠(PRD 正向 vs 代码反向),full 模式两者互补覆盖,standard/quick 模式省略
205
- - ② `review`: full/standard 用完整 skill spawn(6 维度并行);quick 模式改用 CLI delegate(轻量代码审查)
206
- - ③ `test-gen`: full 模式始终执行;standard 模式仅在 `validation.json` 覆盖率 < 80% 或不存在时执行
207
- - ④ `test`: full/standard 执行;quick 模式跳过(依赖 verify + CLI-review 即可)
208
-
209
- **CLI review 替代(quick 模式):**
210
- ```json
211
- {
212
- "type": "cli",
213
- "skill": "maestro delegate",
214
- "args": "\"review changed files in phase {phase}\" --role review --mode analysis --rule analysis-review-code-quality",
215
- "output_file": "{artifact_dir}/review.json"
216
- }
217
- ```
218
- CLI review 输出需符合 review.json schema(verdict + issues[]),供 post-review 决策节点消费。
205
+ - ① `business-test`: 仅 full 模式
206
+ - ② `review`: 所有模式均通过 skill spawnquick 模式附加 `--tier quick`
207
+ - ③ `test-gen`: full 模式始终执行;standard 模式仅在覆盖率 < 80% 时执行
208
+ - ④ `test`: full/standard 执行;quick 模式跳过
219
209
 
220
210
  **条件步骤的链构建:**
221
211
  ```
@@ -226,11 +216,10 @@ buildSteps(position, target, quality_mode):
226
216
  if quality_mode != "full":
227
217
  remove business-test + decision:post-biz-test
228
218
  if quality_mode == "quick":
229
- replace review skill CLI review
219
+ review skill 附加 --tier quick
230
220
  remove test-gen
231
221
  remove test + decision:post-test
232
222
  if quality_mode == "standard":
233
- # test-gen 延迟决定:在 post-verify 决策后检查覆盖率
234
223
  mark test-gen as conditional: "check_coverage"
235
224
 
236
225
  return steps
@@ -242,7 +231,7 @@ Generate `steps[]` from current position to target. Decision nodes use:
242
231
  ```
243
232
  Conditional steps use:
244
233
  ```json
245
- { "type": "skill", "skill": "quality-auto-test {phase}", "condition": "check_coverage", "threshold": 80 }
234
+ { "type": "skill", "skill": "quality-auto-test", "args": "{phase}", "condition": "check_coverage", "threshold": 80 }
246
235
  ```
247
236
 
248
237
  ### 1d: Create session
@@ -262,7 +251,6 @@ Write `.workflow/.maestro/ralph-{YYYYMMDD-HHmmss}/status.json`:
262
251
  "phase": null,
263
252
  "milestone": null,
264
253
  "auto_mode": false,
265
- "cli_tool": "gemini",
266
254
  "quality_mode": "standard",
267
255
  "passed_gates": [],
268
256
  "context": {
@@ -281,8 +269,23 @@ Write `.workflow/.maestro/ralph-{YYYYMMDD-HHmmss}/status.json`:
281
269
  }
282
270
  ```
283
271
 
284
- ### 1e: Display plan + confirm
272
+ ### 1e: Initialize plan tracking + confirm
273
+
274
+ ```
275
+ functions.update_plan({
276
+ explanation: "Ralph lifecycle: {position} → milestone-complete",
277
+ plan: steps.map((step, i) => ({
278
+ step: stepLabel(step),
279
+ status: "pending"
280
+ }))
281
+ })
282
+ ```
283
+
284
+ `stepLabel(step)`:
285
+ - skill: `[{i+1}/{total}] ${step.skill} ${step.args}` + barrier 标 `[BARRIER]`
286
+ - decision: `[{i+1}/{total}] ◆ ${decision_type} [DECISION]`
285
287
 
288
+ Display plan:
286
289
  ```
287
290
  ============================================================
288
291
  RALPH DECISION ENGINE
@@ -296,13 +299,9 @@ Write `.workflow/.maestro/ralph-{YYYYMMDD-HHmmss}/status.json`:
296
299
  [ ] 1. maestro-execute {phase} [skill/barrier]
297
300
  [ ] 2. maestro-verify {phase} [skill]
298
301
  [ ] 3. ◆ post-verify [decision] ← STOP
299
- [ ] 4. quality-review {phase} [skill] ← standard
300
- [ ] 4. quality-review {phase} [cli/delegate] ← quick
302
+ [ ] 4. quality-review {phase} [skill]
301
303
  [ ] 5. ◆ post-review [decision] ← STOP
302
304
  ...
303
- ── skipped (standard mode) ──────────────────────────────
304
- [~] _. quality-auto-test {phase} [skip: standard]
305
- [?] _. quality-auto-test {phase} [conditional: coverage < 80%]
306
305
  ============================================================
307
306
  ```
308
307
 
@@ -317,7 +316,8 @@ If auto (`-y`): skip confirmation, proceed directly
317
316
 
318
317
  ### 2a: Load session
319
318
 
320
- Read status.json. Find first pending step.
319
+ Read status.json. Rebuild `update_plan` from current step statuses.
320
+ Find first pending step.
321
321
 
322
322
  If first pending step is a decision node → go to Phase 2b.
323
323
  Otherwise → go to Phase 2c.
@@ -354,27 +354,23 @@ Check: gaps[] array and passed field
354
354
  If gaps found (passed == false or gaps[].length > 0):
355
355
  If meta.retry_count >= meta.max_retries:
356
356
  → Insert: [quality-debug "{gap_summary}", decision:post-debug-escalate]
357
- → Display: ◆ post-verify: max retries reached, escalating to debug
358
357
  Else:
359
358
  → Insert: [quality-debug "{gap_summary}", maestro-plan --gaps {phase},
360
359
  maestro-execute {phase}, maestro-verify {phase},
361
360
  decision:post-verify(retry+1)]
362
- → Display: ◆ post-verify: gaps detected, inserting debug+fix loop (retry {N}/{max})
363
361
 
364
362
  If no gaps (passed == true):
365
363
  → Add "verify" to passed_gates
366
364
  → 条件检查 test-gen(standard 模式):
367
365
  Read {artifact_dir}/validation.json
368
- If coverage < 80% or validation.json not found:
369
- activate conditional test-gen step (set condition = "met")
370
- Else:
371
- skip test-gen step (set status = "skipped")
366
+ If coverage < 80% or not found → activate conditional test-gen step
367
+ Else skip test-gen step
372
368
  → No insertion, proceed
373
369
  ```
374
370
 
375
371
  **post-biz-test (仅 full 模式):**
376
372
  ```
377
- Read {artifact_dir}/business-test-results.json or scan for business test output
373
+ Read {artifact_dir}/business-test-results.json
378
374
  Check: failures[] or passed field
379
375
 
380
376
  If failures found:
@@ -388,8 +384,7 @@ If failures found:
388
384
  quality-auto-test {phase}, decision:post-biz-test(retry+1)]
389
385
 
390
386
  If all pass:
391
- → Add "business-test" to passed_gates
392
- → No insertion, proceed
387
+ → Add "business-test" to passed_gates, proceed
393
388
  ```
394
389
 
395
390
  **post-review:**
@@ -405,75 +400,47 @@ If verdict == "BLOCK" or any issue.severity == "critical":
405
400
  → Insert: [quality-debug "{block_issues}",
406
401
  maestro-plan --gaps {phase}, maestro-execute {phase},
407
402
  quality-review {phase}, decision:post-review(retry+1)]
408
- 注:review 失败只重跑 review,不回滚到 verify(verify 已通过且代码仅修复 review 问题)
409
403
 
410
404
  If verdict == "PASS" or "WARN":
411
- → Add "review" to passed_gates
412
- → No insertion, proceed
405
+ → Add "review" to passed_gates, proceed
413
406
  ```
414
407
 
415
408
  **post-test (仅 full/standard 模式):**
416
409
  ```
417
- Read {artifact_dir}/uat.md (parse frontmatter + gap sections)
418
- Read {artifact_dir}/.tests/test-results.json if exists
410
+ Read {artifact_dir}/uat.md + {artifact_dir}/.tests/test-results.json
419
411
 
420
- If failures found (any test result != pass, or gaps with severity >= high):
412
+ If failures found:
421
413
  If meta.retry_count >= meta.max_retries:
422
414
  → Insert: [quality-debug --from-uat {phase}, decision:post-debug-escalate]
423
415
  Else:
424
416
  → Clear passed_gates (code will change)
425
- → 轻量重试:仅重新执行 verify + 未通过的质量门
426
417
  → Insert: [quality-debug --from-uat {phase},
427
418
  maestro-plan --gaps {phase}, maestro-execute {phase},
428
419
  maestro-verify {phase}, decision:post-verify(retry:0),
429
- // 对 passed_gates 中的每个门:对比修改文件列表与该门的检查范围
430
- // 有交集 → 重新插入该门 + 对应 decision
431
- // 无交集 → 跳过(不插入)
432
420
  quality-test {phase}, decision:post-test(retry+1)]
433
- 注:不再重新插入整条管线。verify 始终重跑(代码已变),其余门按影响范围判断。
434
421
 
435
422
  If all pass:
436
- → Add "test" to passed_gates
437
- → No insertion, proceed
423
+ → Add "test" to passed_gates, proceed
438
424
  ```
439
425
 
440
426
  **post-milestone:**
441
427
  ```
442
- Re-read .workflow/state.json (milestone-complete will have updated it).
443
- Check: state.milestones[] for next milestone with status == "pending" or "active"
428
+ Re-read .workflow/state.json.
429
+ Check: next milestone with status == "pending" or "active"
444
430
 
445
431
  If next milestone found:
446
- next_m = next milestone
447
- first_phase = next_m.phases[0]
448
- Update ralph session: milestone = next_m.name, phase = first_phase
449
-
450
- → Reset passed_gates = []
451
- → Re-infer quality_mode for next milestone (check REQ-*.md existence)
452
- → Insert lifecycle for next milestone (按 quality_mode 过滤):
453
- [maestro-analyze {first_phase} [barrier],
454
- maestro-plan {first_phase} [barrier],
455
- maestro-execute {first_phase} [barrier],
456
- maestro-verify {first_phase},
457
- decision:post-verify(retry:0),
458
- ...quality steps per quality_mode (see 1c buildSteps)...,
459
- maestro-milestone-audit,
460
- maestro-milestone-complete,
461
- decision:post-milestone]
462
- 注:使用 buildSteps() 按当前 quality_mode 生成质量步骤,不硬编码完整管线
463
-
464
- → Display: ◆ post-milestone: {completed_m.name} done → advancing to {next_m.name} Phase {first_phase}
432
+ Update session: milestone, phase, reset passed_gates
433
+ Re-infer quality_mode
434
+ Insert lifecycle via buildSteps() for next milestone
465
435
 
466
436
  If no next milestone:
467
- No insertion — session will complete naturally
468
- → Display: ◆ post-milestone: all milestones complete!
437
+ Session will complete naturally
469
438
  ```
470
439
 
471
440
  **post-debug-escalate:**
472
441
  ```
473
- This is a terminal escalation — debug was run but we exceeded max retries.
474
442
  → Set session status = "paused"
475
443
  → Display: ◆ 已达最大重试次数,debug 已执行。请人工介入检查结果。
476
- → Display: 使用 $maestro-ralph execute 在处理后恢复
477
444
  → STOP
478
445
  ```
479
446
 
@@ -481,10 +448,11 @@ After evaluation:
481
448
  1. Mark decision step as "completed"
482
449
  2. Reindex steps if inserted
483
450
  3. Write status.json
484
- 4. Display: `◆ Decision: {type} {outcome}`
485
- 5. **STOP 判定:**
486
- - `post-debug-escalate` → 始终 STOP(无论 `-y` 与否)
487
- - `auto_mode == true` (`-y`) STOP,直接 fall through to Phase 2c
451
+ 4. Sync `update_plan` with current step statuses
452
+ 5. Display: `◆ Decision: {type} → {outcome}`
453
+ 6. **STOP 判定:**
454
+ - `post-debug-escalate` → 始终 STOP
455
+ - `auto_mode == true` → 不 STOP,fall through to Phase 2c
488
456
  - `auto_mode == false` → STOP。Display: `⏸ 到达决策节点。使用 $maestro-ralph execute 继续。`
489
457
 
490
458
  ### 2c: Build and Execute Next Wave
@@ -495,43 +463,70 @@ After evaluation:
495
463
  - If conditional step with condition not met → mark "skipped", advance to next
496
464
  - If barrier → solo wave
497
465
  - If non-barrier → collect consecutive non-barrier, non-decision steps
498
- - Stop at first decision node (it will be processed in next `execute` call)
466
+ - Stop at first decision node
467
+
468
+ 2. **buildSkillCall(step, ctx)** — Assemble fully-resolved skill_call:
499
469
 
500
- 2. **Assemble args** (placeholder resolution):
470
+ **Placeholder resolution:**
501
471
  ```
502
- {phase} → status.phase
503
- {intent} → status.intent
472
+ {phase} → ctx.phase
473
+ {intent} → ctx.intent
504
474
  {scratch_dir} → from latest artifact path
505
- {plan_dir} → status.context.plan_dir
506
- {analysis_dir}→ status.context.analysis_dir
475
+ {plan_dir} → ctx.plan_dir
476
+ {analysis_dir}→ ctx.analysis_dir
507
477
  ```
508
478
 
509
- 3. **Route by step type:**
479
+ **Per-skill arg enrichment** (coordinator does this, not sub-agent):
480
+ ```
481
+ maestro-brainstorm: args empty → '"{intent}"'
482
+ maestro-roadmap: args empty → '"{intent}"'
483
+ maestro-analyze: args empty → '{phase}'
484
+ maestro-plan: needs dir → resolve latest analyze artifact → --dir .workflow/scratch/{path}
485
+ maestro-execute: needs dir → resolve latest plan artifact → --dir .workflow/scratch/{path}
486
+ quality-debug: from verify → append gap summary from verification.json
487
+ from test → append --from-uat {phase}
488
+ from biz → append --from-business-test {phase}
489
+ quality-* (review, test, auto-test): args empty → '{phase}'
490
+ maestro-verify, milestone-*: args empty → '{phase}' or empty
491
+ ```
510
492
 
511
- **type == "skill"** Write wave CSV: `{sessionDir}/wave-{N}.csv`
512
- Each row spawns a `$maestro-ralph-execute` agent with the target skill_call as argument:
513
- ```csv
514
- id,skill_call,topic
515
- "3","$maestro-ralph-execute \"$maestro-verify 1\"","Ralph step 3/14: verify phase 1"
493
+ **Auto flag 附加** (when `session.auto_mode == true`):
516
494
  ```
517
- `session.auto_mode == true` 时,skill_call 附加 `-y`:
495
+ auto_flag_map = {
496
+ "maestro-init": "-y",
497
+ "maestro-analyze": "-y",
498
+ "maestro-brainstorm": "-y",
499
+ "maestro-roadmap": "-y",
500
+ "maestro-plan": "-y",
501
+ "maestro-execute": "-y",
502
+ "quality-auto-test": "-y",
503
+ "quality-test": "-y --auto-fix",
504
+ "quality-retrospective": "-y",
505
+ "maestro-milestone-complete": "-y"
506
+ }
507
+ ```
508
+
509
+ **Result**: `$<skill-name> <enriched-args> [auto-flag]`
510
+
511
+ 3. **Write wave CSV**: `{sessionDir}/wave-{N}.csv`
518
512
  ```csv
519
- "3","$maestro-ralph-execute -y \"$maestro-verify 1\"","Ralph step 3/14: verify phase 1"
513
+ id,skill_call,topic
514
+ "3","$maestro-verify 1","Ralph step 3/14: verify phase 1"
515
+ "4","$quality-review 1","Ralph step 4/14: review phase 1"
520
516
  ```
521
- ralph-execute 解析 `-y` 后,按传播表对目标 skill 附加对应 auto flag。
522
- The inner `$maestro-verify 1` is the actual skill; `$maestro-ralph-execute` is the worker wrapper.
523
517
 
524
- **type == "cli"** CLI delegate 执行(quick 模式 review 等):
518
+ 4. **Update plan** (mark wave steps as in_progress):
525
519
  ```
526
- Bash({
527
- command: 'maestro delegate "{step.args}" --mode analysis',
528
- run_in_background: true
520
+ functions.update_plan({
521
+ explanation: "Wave {N}: executing {skill_names}",
522
+ plan: steps.map((step, i) => ({
523
+ step: stepLabel(step),
524
+ status: mapStatus(step.status) // pending→pending, running→in_progress, completed→completed
525
+ }))
529
526
  })
530
527
  ```
531
- 等待回调 → `maestro delegate output <id>` → 解析输出写入 `{artifact_dir}/{output_file}`
532
- CLI 步骤始终单步执行,不进 CSV wave。
533
528
 
534
- 4. **Spawn** (仅 skill 类型):
529
+ 5. **Spawn**:
535
530
  ```
536
531
  spawn_agents_on_csv({
537
532
  csv_path: "{sessionDir}/wave-{N}.csv",
@@ -544,9 +539,9 @@ After evaluation:
544
539
  })
545
540
  ```
546
541
 
547
- 5. **Read results**: Update step status from results CSV (skill) or delegate output (cli)
542
+ 6. **Read results**: Update step status from results CSV
548
543
 
549
- 6. **Barrier check**: If wave was a barrier skill, read artifacts, update context:
544
+ 7. **Barrier check**: If wave was a barrier skill, read artifacts, update context:
550
545
  | Barrier | Read | Update |
551
546
  |---------|------|--------|
552
547
  | maestro-analyze | context.md, state.json | context.analysis_dir, context.gaps |
@@ -555,30 +550,33 @@ After evaluation:
555
550
  | maestro-brainstorm | .brainstorming/ | context.brainstorm_dir |
556
551
  | maestro-roadmap | specs/ | context.spec_session_id |
557
552
 
558
- 7. **Persist**: Write status.json with updated steps, waves, context
553
+ 8. **Persist**: Write status.json + sync `update_plan`
559
554
 
560
- 8. **Failure check**: Any step failed → mark remaining skipped, pause session, STOP
555
+ 9. **Failure check**: Any step failed → mark remaining skipped, pause session, STOP
561
556
 
562
- 9. **Decision check**: If next pending step is a decision node:
563
- - `auto_mode == true` → STOP,直接进入 Phase 2b 评估该决策节点,然后继续循环
564
- - `auto_mode == false` → STOP。Display: `⏸ 到达决策节点: {decision_type}。使用 $maestro-ralph execute 继续。`
557
+ 10. **Decision check**: If next pending step is a decision node:
558
+ - `auto_mode == true` → 进入 Phase 2b 评估,然后继续循环
559
+ - `auto_mode == false` → STOP
565
560
 
566
- 10. **Continue**: If next pending is not decision, loop back to step 1
561
+ 11. **Continue**: If next pending is not decision, loop back to step 1
567
562
 
568
563
  ### Sub-Agent Instruction Template
569
564
 
570
565
  ```
571
- 你是 Ralph 执行器子 agent。
566
+ 你是 CSV job agent。
567
+
568
+ 先原样执行这一段技能调用:
569
+ {skill_call}
572
570
 
573
- skill_call 列包含 $maestro-ralph-execute 调用,它会解析内部的目标 skill 并执行。
574
- 直接运行 skill_call 中的命令即可。
571
+ 然后基于结果完成这一行任务说明:
572
+ {topic}
575
573
 
576
574
  限制:
577
- - 不要修改 .workflow/.maestro/ 下的文件
578
- - ralph-execute 内部处理 skill 路由和执行
575
+ - 不要修改 .workflow/.maestro/ 下的 status 文件
576
+ - skill 内部有自己的 session 管理,按 skill SKILL.md 执行即可
579
577
 
580
- 完成后调用 report_agent_job_result,返回:
581
- {"status":"completed|failed","skill_call":"{skill_call}","summary":"一句话结果","artifacts":"产物路径或空","error":"失败原因或空"}
578
+ 最后必须调用 `report_agent_job_result`,返回 JSON:
579
+ {"status":"completed|failed","skill_call":"{skill_call}","summary":"一句话结果","artifacts":"产物路径或空字符串","error":"失败原因或空字符串"}
582
580
  ```
583
581
 
584
582
  ### Result Schema
@@ -594,6 +592,14 @@ status.status = "completed"
594
592
  status.updated_at = now
595
593
  Write status.json
596
594
 
595
+ functions.update_plan({
596
+ explanation: "Ralph lifecycle complete",
597
+ plan: steps.map((step, i) => ({
598
+ step: stepLabel(step),
599
+ status: step.status === "skipped" ? "completed" : "completed"
600
+ }))
601
+ })
602
+
597
603
  ============================================================
598
604
  RALPH COMPLETE
599
605
  ============================================================
@@ -620,20 +626,19 @@ Write status.json
620
626
  <csv_schema>
621
627
  ### wave-{N}.csv
622
628
 
623
- All skill execution goes through `$maestro-ralph-execute` as the worker wrapper:
629
+ CSV 直接包含目标 skill 调用(coordinator 已完成 arg 组装 + auto flag 附加):
624
630
 
625
631
  ```csv
626
632
  id,skill_call,topic
627
- "3","$maestro-ralph-execute \"$maestro-verify 1\"","Ralph step 3/14: verify phase 1"
628
- "4","$maestro-ralph-execute \"$quality-auto-test 1\"","Ralph step 4/14: auto test phase 1"
633
+ "3","$maestro-verify 1","Ralph step 3/14: verify phase 1"
634
+ "4","$quality-review 1 --tier quick","Ralph step 4/14: review phase 1"
629
635
  ```
630
636
 
631
- - `skill_call` column: `$maestro-ralph-execute [-y] "<inner_skill_call>"`(`session.auto_mode` 时附加 `-y`)
637
+ - `skill_call` column: 完整的 `$<skill> <args> [auto-flag]`,由 `buildSkillCall()` 组装
632
638
  - `topic` column: human-readable step description
633
639
  - Non-barrier + non-decision steps can be grouped in one wave CSV with multiple rows
634
640
  - Barrier steps always solo (one row per CSV)
635
641
  - Decision steps are NEVER in CSV — processed by ralph directly
636
- - CLI steps (type=="cli") are NEVER in CSV — processed by ralph via maestro delegate
637
642
  </csv_schema>
638
643
 
639
644
  <error_codes>
@@ -652,22 +657,18 @@ id,skill_call,topic
652
657
 
653
658
  <success_criteria>
654
659
  - [ ] state.json artifacts correctly read with actual schema (type, path, scope, milestone, depends_on)
655
- - [ ] Lifecycle position inferred from artifacts + result files (verification.json, review.json, uat.md)
660
+ - [ ] Lifecycle position inferred from artifacts + result files
656
661
  - [ ] Artifact dir resolved via resolve_artifact_dir() with fallback globs
657
662
  - [ ] Quality mode (full/standard/quick) 正确推断并影响步骤生成
658
- - [ ] Conditional steps: business-test full 模式,test-gen 按覆盖率条件
659
- - [ ] CLI 替代: quick 模式 review 走 delegate 而非 skill spawn
663
+ - [ ] buildSkillCall() 完成 arg enrichment + auto flag 附加,CSV 直接包含完整命令
660
664
  - [ ] Decision nodes at: post-verify, post-biz-test (full only), post-review, post-test (full/standard), post-milestone
661
665
  - [ ] Every decision failure path starts with quality-debug before plan --gaps
662
666
  - [ ] passed_gates[] 正确追踪,重试时跳过已通过的质量门
663
- - [ ] 重试循环轻量化:post-test 失败不重跑整条管线,仅重跑未通过的门
664
667
  - [ ] retry_count tracked per decision node, max_retries enforced
665
- - [ ] Max retries post-debug-escalate session paused for human intervention
666
- - [ ] Skills via spawn_agents_on_csv, CLI via delegate — coordinator never executes directly
668
+ - [ ] ALL skills via spawn_agents_on_csv coordinator never executes directly
667
669
  - [ ] Decision nodes STOP execution — user must call `execute` to resume
668
670
  - [ ] Barrier skills run solo, non-barriers grouped in parallel waves
669
- - [ ] Placeholder args resolved before CSV assembly ({phase}, {intent}, {scratch_dir})
670
- - [ ] post-milestone 用 buildSteps() 生成下一个 milestone 的步骤(按 quality_mode)
671
+ - [ ] functions.update_plan() Phase 1e 初始化,每 wave 后同步,Phase 3 完成
671
672
  - [ ] status.json persisted after every wave
672
673
  - [ ] Command insertion + reindex works correctly after decision expansion
673
674
  </success_criteria>
@@ -8,6 +8,7 @@ import { writeFileSync, mkdirSync, existsSync } from 'node:fs';
8
8
  import { execSync } from 'node:child_process';
9
9
  import { homedir } from 'node:os';
10
10
  import { join, dirname } from 'node:path';
11
+ import cliToolsDefaults from './cli-tools-defaults.json' with { type: 'json' };
11
12
  // ---------------------------------------------------------------------------
12
13
  // Types
13
14
  // ---------------------------------------------------------------------------
@@ -22,19 +23,8 @@ export const DOMAIN_TAGS = [
22
23
  export const DELEGATE_ROLES = [
23
24
  'analyze', 'explore', 'review', 'implement', 'plan', 'brainstorm', 'research',
24
25
  ];
25
- // Default strengths (codex high priority):
26
- // codex — analyze, plan, implement, review, debug (preferred)
27
- // gemini — analyze, plan, frontend, brainstorm, research
28
- // claude — analyze, plan, implement
29
- const DEFAULT_ROLE_MAPPINGS = {
30
- analyze: { fallbackChain: ['codex', 'gemini', 'claude'] },
31
- explore: { fallbackChain: ['codex', 'gemini', 'claude'] },
32
- review: { fallbackChain: ['codex', 'gemini', 'claude'] },
33
- implement: { fallbackChain: ['codex', 'claude', 'gemini'] },
34
- plan: { fallbackChain: ['codex', 'gemini', 'claude'] },
35
- brainstorm: { fallbackChain: ['gemini', 'codex', 'claude'] },
36
- research: { fallbackChain: ['gemini', 'codex', 'claude'] },
37
- };
26
+ // Loaded from cli-tools-defaults.json edit that file to change defaults.
27
+ const DEFAULT_ROLE_MAPPINGS = cliToolsDefaults.roleMappings;
38
28
  // ---------------------------------------------------------------------------
39
29
  // Defaults
40
30
  // ---------------------------------------------------------------------------
@@ -220,13 +210,8 @@ export async function loadConfigSources(workDir) {
220
210
  // ---------------------------------------------------------------------------
221
211
  // Initialization
222
212
  // ---------------------------------------------------------------------------
223
- /** CLI tool definitions with detection commands. */
224
- const TOOL_DEFS = [
225
- { name: 'gemini', cmd: 'gemini', primaryModel: 'gemini-2.5-pro', tags: ['fullstack', 'frontend'], type: 'builtin' },
226
- { name: 'claude', cmd: 'claude', primaryModel: 'claude-sonnet-4-20250514', tags: ['fullstack'], type: 'builtin' },
227
- { name: 'codex', cmd: 'codex', primaryModel: 'o3', tags: ['fullstack', 'backend'], type: 'builtin' },
228
- { name: 'opencode', cmd: 'opencode', primaryModel: '', tags: ['fullstack'], type: 'builtin' },
229
- ];
213
+ /** CLI tool definitions loaded from cli-tools-defaults.json. */
214
+ const TOOL_DEFS = cliToolsDefaults.tools;
230
215
  function isCliAvailable(cmd) {
231
216
  try {
232
217
  execSync(`${cmd} --version`, { stdio: 'ignore', timeout: 5000 });