maestro-flow 0.5.37 → 0.5.39

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 (216) hide show
  1. package/.agents/skills/maestro/SKILL.md +11 -5
  2. package/.agents/skills/maestro-ralph/SKILL.md +80 -12
  3. package/.agents/skills/maestro-ralph-execute/SKILL.md +17 -6
  4. package/.agents/skills/manage-drift-realign/SKILL.md +153 -0
  5. package/.agents/skills/odyssey-debug/SKILL.md +90 -269
  6. package/.agents/skills/odyssey-improve/SKILL.md +39 -240
  7. package/.agents/skills/odyssey-planex/SKILL.md +21 -105
  8. package/.agents/skills/odyssey-review-test-fix/SKILL.md +98 -318
  9. package/.agents/skills/odyssey-ui/SKILL.md +82 -265
  10. package/.agy/skills/maestro/SKILL.md +11 -5
  11. package/.agy/skills/maestro-ralph/SKILL.md +80 -12
  12. package/.agy/skills/maestro-ralph-execute/SKILL.md +17 -6
  13. package/.agy/skills/manage-drift-realign/SKILL.md +153 -0
  14. package/.agy/skills/odyssey-debug/SKILL.md +90 -269
  15. package/.agy/skills/odyssey-improve/SKILL.md +39 -240
  16. package/.agy/skills/odyssey-planex/SKILL.md +21 -105
  17. package/.agy/skills/odyssey-review-test-fix/SKILL.md +98 -318
  18. package/.agy/skills/odyssey-ui/SKILL.md +82 -265
  19. package/.claude/commands/maestro-ralph-execute.md +17 -6
  20. package/.claude/commands/maestro-ralph.md +80 -12
  21. package/.claude/commands/maestro.md +11 -5
  22. package/.claude/commands/manage-drift-realign.md +151 -0
  23. package/.claude/commands/odyssey-debug.md +90 -269
  24. package/.claude/commands/odyssey-improve.md +39 -240
  25. package/.claude/commands/odyssey-planex.md +21 -105
  26. package/.claude/commands/odyssey-review-test-fix.md +98 -318
  27. package/.claude/commands/odyssey-ui.md +82 -265
  28. package/.codex/skills/maestro/SKILL.md +16 -8
  29. package/.codex/skills/maestro-ralph/SKILL.md +138 -11
  30. package/.codex/skills/maestro-ralph-execute/SKILL.md +17 -6
  31. package/.codex/skills/manage-drift-realign/SKILL.md +471 -0
  32. package/.codex/skills/odyssey-debug/SKILL.md +167 -338
  33. package/.codex/skills/odyssey-improve/SKILL.md +226 -395
  34. package/.codex/skills/odyssey-planex/SKILL.md +317 -159
  35. package/.codex/skills/odyssey-review-test-fix/SKILL.md +137 -255
  36. package/.codex/skills/odyssey-ui/SKILL.md +197 -338
  37. package/README.md +25 -8
  38. package/README.zh-CN.md +6 -6
  39. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.d.ts +23 -2
  40. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js +242 -26
  41. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js.map +1 -1
  42. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.d.ts +2 -0
  43. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +92 -29
  44. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
  45. package/dashboard/dist-server/src/commands/hooks.d.ts +2 -1
  46. package/dashboard/dist-server/src/commands/hooks.js +16 -9
  47. package/dashboard/dist-server/src/commands/hooks.js.map +1 -1
  48. package/dashboard/dist-server/src/commands/install-backend.d.ts +10 -0
  49. package/dashboard/dist-server/src/commands/install-backend.js +69 -0
  50. package/dashboard/dist-server/src/commands/install-backend.js.map +1 -1
  51. package/dashboard/dist-server/src/core/component-defs.d.ts +11 -0
  52. package/dashboard/dist-server/src/core/component-defs.js +34 -2
  53. package/dashboard/dist-server/src/core/component-defs.js.map +1 -1
  54. package/dashboard/dist-server/src/hooks/kg-sync-hook.js +5 -0
  55. package/dashboard/dist-server/src/hooks/kg-sync-hook.js.map +1 -1
  56. package/dashboard/dist-server/src/hooks/session-context.js +276 -3
  57. package/dashboard/dist-server/src/hooks/session-context.js.map +1 -1
  58. package/dashboard/dist-server/src/search/daemon-client.d.ts +8 -3
  59. package/dashboard/dist-server/src/search/daemon-client.js +20 -0
  60. package/dashboard/dist-server/src/search/daemon-client.js.map +1 -1
  61. package/dist/src/cli.js +3 -2
  62. package/dist/src/cli.js.map +1 -1
  63. package/dist/src/commands/domain.d.ts.map +1 -1
  64. package/dist/src/commands/domain.js +12 -3
  65. package/dist/src/commands/domain.js.map +1 -1
  66. package/dist/src/commands/hooks.d.ts +2 -1
  67. package/dist/src/commands/hooks.d.ts.map +1 -1
  68. package/dist/src/commands/hooks.js +16 -9
  69. package/dist/src/commands/hooks.js.map +1 -1
  70. package/dist/src/commands/install-backend.d.ts +10 -0
  71. package/dist/src/commands/install-backend.d.ts.map +1 -1
  72. package/dist/src/commands/install-backend.js +69 -0
  73. package/dist/src/commands/install-backend.js.map +1 -1
  74. package/dist/src/commands/install.js +34 -2
  75. package/dist/src/commands/install.js.map +1 -1
  76. package/dist/src/commands/ralph.d.ts.map +1 -1
  77. package/dist/src/commands/ralph.js +8 -0
  78. package/dist/src/commands/ralph.js.map +1 -1
  79. package/dist/src/commands/search.d.ts.map +1 -1
  80. package/dist/src/commands/search.js +59 -6
  81. package/dist/src/commands/search.js.map +1 -1
  82. package/dist/src/commands/spec.d.ts.map +1 -1
  83. package/dist/src/commands/spec.js +15 -0
  84. package/dist/src/commands/spec.js.map +1 -1
  85. package/dist/src/commands/timeline.d.ts +14 -0
  86. package/dist/src/commands/timeline.d.ts.map +1 -0
  87. package/dist/src/commands/timeline.js +377 -0
  88. package/dist/src/commands/timeline.js.map +1 -0
  89. package/dist/src/core/component-defs.d.ts +11 -0
  90. package/dist/src/core/component-defs.d.ts.map +1 -1
  91. package/dist/src/core/component-defs.js +34 -2
  92. package/dist/src/core/component-defs.js.map +1 -1
  93. package/dist/src/core/install-executor.d.ts.map +1 -1
  94. package/dist/src/core/install-executor.js +11 -1
  95. package/dist/src/core/install-executor.js.map +1 -1
  96. package/dist/src/core/install-profile.d.ts.map +1 -1
  97. package/dist/src/core/install-profile.js +52 -17
  98. package/dist/src/core/install-profile.js.map +1 -1
  99. package/dist/src/hooks/kg-sync-hook.d.ts.map +1 -1
  100. package/dist/src/hooks/kg-sync-hook.js +5 -0
  101. package/dist/src/hooks/kg-sync-hook.js.map +1 -1
  102. package/dist/src/hooks/session-context.d.ts.map +1 -1
  103. package/dist/src/hooks/session-context.js +276 -3
  104. package/dist/src/hooks/session-context.js.map +1 -1
  105. package/dist/src/i18n/locales/en.d.ts.map +1 -1
  106. package/dist/src/i18n/locales/en.js +4 -1
  107. package/dist/src/i18n/locales/en.js.map +1 -1
  108. package/dist/src/i18n/locales/zh.d.ts.map +1 -1
  109. package/dist/src/i18n/locales/zh.js +4 -1
  110. package/dist/src/i18n/locales/zh.js.map +1 -1
  111. package/dist/src/i18n/types.d.ts +3 -0
  112. package/dist/src/i18n/types.d.ts.map +1 -1
  113. package/dist/src/ralph/cmd-complete.d.ts +4 -0
  114. package/dist/src/ralph/cmd-complete.d.ts.map +1 -1
  115. package/dist/src/ralph/cmd-complete.js +8 -0
  116. package/dist/src/ralph/cmd-complete.js.map +1 -1
  117. package/dist/src/ralph/cmd-next.js +58 -8
  118. package/dist/src/ralph/cmd-next.js.map +1 -1
  119. package/dist/src/ralph/status-schema.d.ts +29 -2
  120. package/dist/src/ralph/status-schema.d.ts.map +1 -1
  121. package/dist/src/ralph/status-schema.js +1 -1
  122. package/dist/src/search/daemon-client.d.ts +8 -3
  123. package/dist/src/search/daemon-client.d.ts.map +1 -1
  124. package/dist/src/search/daemon-client.js +20 -0
  125. package/dist/src/search/daemon-client.js.map +1 -1
  126. package/dist/src/search/daemon.d.ts +3 -3
  127. package/dist/src/search/daemon.d.ts.map +1 -1
  128. package/dist/src/search/daemon.js +9 -3
  129. package/dist/src/search/daemon.js.map +1 -1
  130. package/dist/src/tui/install-ui/ComponentGrid.d.ts.map +1 -1
  131. package/dist/src/tui/install-ui/ComponentGrid.js +71 -38
  132. package/dist/src/tui/install-ui/ComponentGrid.js.map +1 -1
  133. package/dist/src/tui/install-ui/ComponentGrid.logic.d.ts +12 -3
  134. package/dist/src/tui/install-ui/ComponentGrid.logic.d.ts.map +1 -1
  135. package/dist/src/tui/install-ui/ComponentGrid.logic.js +21 -4
  136. package/dist/src/tui/install-ui/ComponentGrid.logic.js.map +1 -1
  137. package/dist/src/tui/install-ui/CyberItem.d.ts +3 -1
  138. package/dist/src/tui/install-ui/CyberItem.d.ts.map +1 -1
  139. package/dist/src/tui/install-ui/CyberItem.js +6 -5
  140. package/dist/src/tui/install-ui/CyberItem.js.map +1 -1
  141. package/dist/src/tui/install-ui/GroupedHub.d.ts +9 -0
  142. package/dist/src/tui/install-ui/GroupedHub.d.ts.map +1 -1
  143. package/dist/src/tui/install-ui/GroupedHub.js +54 -47
  144. package/dist/src/tui/install-ui/GroupedHub.js.map +1 -1
  145. package/dist/src/tui/install-ui/InstallConfirm.js +1 -1
  146. package/dist/src/tui/install-ui/InstallConfirm.js.map +1 -1
  147. package/dist/src/tui/install-ui/InstallFlow.d.ts.map +1 -1
  148. package/dist/src/tui/install-ui/InstallFlow.js +54 -5
  149. package/dist/src/tui/install-ui/InstallFlow.js.map +1 -1
  150. package/dist/src/tui/install-ui/types.d.ts +1 -0
  151. package/dist/src/tui/install-ui/types.d.ts.map +1 -1
  152. package/dist/src/tui/install-ui/types.js.map +1 -1
  153. package/dist/src/tui/install-ui/useInstallFlowState.d.ts +8 -2
  154. package/dist/src/tui/install-ui/useInstallFlowState.d.ts.map +1 -1
  155. package/dist/src/tui/install-ui/useInstallFlowState.js +145 -15
  156. package/dist/src/tui/install-ui/useInstallFlowState.js.map +1 -1
  157. package/dist/src/utils/update-notices.js +12 -0
  158. package/dist/src/utils/update-notices.js.map +1 -1
  159. package/package.json +1 -1
  160. package/workflows/agy-instructions.md +127 -88
  161. package/workflows/analyze.md +2 -2
  162. package/workflows/auto-test.md +7 -1
  163. package/workflows/blueprint.md +22 -19
  164. package/workflows/brainstorm.md +11 -3
  165. package/workflows/business-test.md +4 -0
  166. package/workflows/codebase-rebuild.md +8 -1
  167. package/workflows/codebase-refresh.md +7 -1
  168. package/workflows/codex-instructions.md +1 -1
  169. package/workflows/debug.md +5 -2
  170. package/workflows/domain-add.md +6 -0
  171. package/workflows/drift-realign.md +396 -0
  172. package/workflows/execute.md +5 -4
  173. package/workflows/explore-usage.md +2 -2
  174. package/workflows/finish-work.md +6 -6
  175. package/workflows/fork.md +2 -2
  176. package/workflows/grill.md +6 -5
  177. package/workflows/harvest.md +2 -2
  178. package/workflows/impeccable.md +3 -2
  179. package/workflows/init.md +7 -7
  180. package/workflows/integration-test.md +1 -0
  181. package/workflows/issue-gaps-analyze.codex.md +2 -0
  182. package/workflows/issue-gaps-analyze.md +4 -4
  183. package/workflows/issue-plan.md +1 -1
  184. package/workflows/knowhow.md +7 -1
  185. package/workflows/knowledge-audit.md +1 -1
  186. package/workflows/maestro-super.md +2 -2
  187. package/workflows/maestro.md +3 -3
  188. package/workflows/map.md +2 -2
  189. package/workflows/milestone-audit.md +1 -1
  190. package/workflows/milestone-complete.md +1 -1
  191. package/workflows/odyssey-base.md +258 -0
  192. package/workflows/plan.md +7 -6
  193. package/workflows/quick.md +8 -6
  194. package/workflows/ralph-amend-goal.md +177 -0
  195. package/workflows/refactor.md +2 -0
  196. package/workflows/retrospective.md +7 -3
  197. package/workflows/review.md +6 -4
  198. package/workflows/roadmap-common.md +3 -3
  199. package/workflows/roadmap.md +8 -5
  200. package/workflows/spec-generate.md +23 -18
  201. package/workflows/specs-load.md +1 -1
  202. package/workflows/specs-setup.md +2 -0
  203. package/workflows/sync.md +4 -2
  204. package/workflows/test-gen.md +1 -1
  205. package/workflows/test.md +1 -1
  206. package/workflows/ui-codify-extract.md +1 -0
  207. package/workflows/ui-codify-knowhow.md +1 -1
  208. package/workflows/ui-codify-package.md +1 -1
  209. package/workflows/ui-codify.md +9 -7
  210. package/workflows/ui-design.md +9 -7
  211. package/workflows/ui-style.md +6 -4
  212. package/workflows/verify.md +4 -4
  213. package/workflows/wiki-connect.md +2 -0
  214. package/workflows/wiki-digest.md +5 -3
  215. package/workflows/wiki-manage.md +4 -0
  216. package/workflows/maestro.codex.md +0 -365
@@ -0,0 +1,177 @@
1
+ # Ralph Goal Amendment Flow
2
+
3
+ `A_AMEND_GOAL` 详细流程。加载方式:`maestro-ralph.md` S_AMEND_GOAL via `<deferred_reading>`。
4
+
5
+ 触发:`/maestro-ralph --amend [change_request]`
6
+ GUARD: running ralph session 存在
7
+
8
+ ---
9
+
10
+ ## Phase 1 — 快照
11
+
12
+ 1. 定位最新 running ralph session
13
+ 2. Read: `task_decomposition` WHERE `status != "superseded"`, `boundary_contract`, completed steps `completion_summary`
14
+ 3. Display:
15
+ ```
16
+ 📍 Session: {session_id}
17
+ 进度: {completed}/{total} steps
18
+ 目标:
19
+ {for g in active_goals:}
20
+ [{status_icon}] {g.id}: {g.goal} — done_when: {g.done_when}
21
+ {end for}
22
+ 边界: in_scope={count}, out_of_scope={count}
23
+ 修改历史: {goal_changelog.length} 次
24
+ ```
25
+
26
+ ## Phase 2 — 解析
27
+
28
+ | Condition | 行为 |
29
+ |-----------|------|
30
+ | `change_request` 非空 | 直接使用 |
31
+ | `change_request` 为空 | AskUserQuestion(4 选项 + 自由输入追加) |
32
+
33
+ AskUserQuestion options:
34
+
35
+ | label | description |
36
+ |-------|-------------|
37
+ | 修改现有目标 | 调整子目标范围或完成条件 |
38
+ | 新增目标 | 追加新子目标 |
39
+ | 移除目标 | 取消未完成子目标 |
40
+ | 调整边界 | 修改 in_scope / out_of_scope / constraints |
41
+
42
+ ## Phase 3 — Mini Grill
43
+
44
+ MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: Delegate (run_in_background, STOP, wait):
45
+
46
+ ```
47
+ maestro delegate "PURPOSE: 评估目标变更影响
48
+ TASK:
49
+ 1. 对比 current_goals 与 change_request,识别冲突/缺口
50
+ 2. 判定已完成 steps 在新目标下是否有效(基于 completion_summary + completion_decisions)
51
+ 3. 判定 pending steps 是否需重建/跳过
52
+ 4. 评估 risk_level
53
+ CONTEXT:
54
+ intent = {session.intent}
55
+ current_goals = {task_decomposition where status != superseded}
56
+ completed_steps = [{index, skill, stage, completion_summary, completion_decisions}]
57
+ pending_steps = [{index, skill, stage, goal_ref}]
58
+ boundary_contract = {boundary_contract}
59
+ change_request = {change_request}
60
+ EXPECTED:
61
+ ---IMPACT---
62
+ CHANGE_TYPE=modify|add|remove|boundary
63
+ AFFECTED_GOALS=[{id, action: modify|supersede|keep, new_goal?, new_done_when?}]
64
+ INVALIDATED_STEPS=[{index, reason}]
65
+ NEW_GAPS=[{goal_id, description, suggested_stages: [analyze|plan|execute|...]}]
66
+ BOUNDARY_CHANGES={in_scope_add:[], out_of_scope_add:[], constraints_add:[]}
67
+ RISK_LEVEL=low|medium|high
68
+ RISK_REASON=...
69
+ ---END---
70
+ CONSTRAINTS:
71
+ - 只评估不修改
72
+ - high: 已完成工作与新目标直接冲突
73
+ - medium: 部分 steps 需跳过/重建,已完成工作可保留
74
+ - low: 纯增量,已有工作不受影响"
75
+ --role analyze --mode analysis
76
+ ```
77
+
78
+ **GATE Phase 3→4**: REQUIRED impact_assessment complete; BLOCKED if delegate output missing
79
+
80
+ ## Phase 4 — 确认
81
+
82
+ Display: 影响摘要(risk_level, affected, invalidated, new_gaps)。AskUserQuestion:
83
+
84
+ | label | description |
85
+ |-------|-------------|
86
+ | 应用并继续 | 归档旧目标 → 写入新目标 → 重建链路 → handoff |
87
+ | 仅改目标 | 更新目标,保留链路不变 |
88
+ | 取消 | 无修改 |
89
+
90
+ GUARD: `RISK_LEVEL == high` → auto_confirm 无效
91
+
92
+ ## Phase 5 — 应用
93
+
94
+ ### 5.1 Changelog entry
95
+
96
+ Append to `session.goal_changelog[]`:
97
+
98
+ ```json
99
+ {
100
+ "id": "CHG-{NNN}",
101
+ "timestamp": "{ISO}",
102
+ "change_type": "{CHANGE_TYPE}",
103
+ "reason": "{change_request}",
104
+ "impact_assessment": { "risk_level": "...", "invalidated_steps": [...], "new_steps_inserted": 0, "evidence_source": "delegate impact assessment output" },
105
+ "before": { "goals": [{"id":"...","goal":"...","done_when":"..."}] },
106
+ "after": { "goals": [{"id":"...","goal":"...","done_when":"..."}] }
107
+ }
108
+ ```
109
+
110
+ `NNN` = `(goal_changelog.length + 1).toString().padStart(3, '0')`
111
+
112
+ **GATE 5.1→5.2**: REQUIRED goal_changelog written; BLOCKED if changelog entry missing
113
+
114
+ ### 5.2 归档
115
+
116
+ 对 AFFECTED_GOALS 中 `action ∈ {modify, supersede}` 的条目:
117
+ - Set `status: "superseded"`, `superseded_by: "CHG-{NNN}"`, `superseded_at: now`
118
+ - GUARD: `status == "done"` 的目标不可 supersede(skip + warn)
119
+
120
+ ### 5.3 写入新目标
121
+
122
+ | action | 处理 |
123
+ |--------|------|
124
+ | `modify` | 新条目 `id: "{original_id}v{version}"`, `origin: "CHG-{NNN}"`, `status: "pending"` |
125
+ | `add` | 新条目 `id: "G{next_num}"`, `origin: "CHG-{NNN}"`, `status: "pending"` |
126
+ | `remove` | 仅 supersede,不新增 |
127
+ | `keep` | 不变 |
128
+
129
+ ### 5.4 重建链路
130
+
131
+ GUARD: 用户选"应用并继续"
132
+
133
+ 1. INVALIDATED_STEPS 中 pending step → set `status: "skipped"`
134
+ 2. NEW_GAPS → 按 `suggested_stages` 插入 steps + decision nodes
135
+ - 按 A_BUILD_STEPS 规则构建(goal_ref + command_path 解析 + command_scope 校验)
136
+ - 插入位置:当前 active step 之后、`post-goal-audit` 之前
137
+ 3. 原链路有 `post-goal-audit` → 保留
138
+ 4. 原链路无 `post-goal-audit` AND `task_decomposition` 存在 → 在 `milestone-complete` 前插入
139
+ 5. Reindex all steps
140
+
141
+ ### 5.5 Boundary
142
+
143
+ `BOUNDARY_CHANGES` 非空时:
144
+ - `in_scope_add` → append to `boundary_contract.in_scope`
145
+ - `out_of_scope_add` → append to `boundary_contract.out_of_scope`
146
+ - `constraints_add` → append to `boundary_contract.constraints`
147
+
148
+ ### 5.6 Persist + Handoff
149
+
150
+ 1. Write status.json
151
+ 2. Display:
152
+ ```
153
+ ◆ Goal amendment: {CHG-NNN}
154
+ {change_type} — {reason}
155
+ Risk: {RISK_LEVEL} | Superseded: {n} | Added: {n} | Skipped steps: {n} | Inserted steps: {n}
156
+ ```
157
+ 3. Handoff → maestro-ralph-execute(平台适配:Claude 用 `Skill()`,Codex 用 `$` 直调)
158
+
159
+ ---
160
+
161
+ ## Anchor 呈现规则
162
+
163
+ Goals Overview 输出格式(CLI `buildSessionAnchor` 自动生成):
164
+
165
+ ```
166
+ **Goals Overview**:
167
+ - [✓] G1: 实现搜索 API — done_when: 测试通过
168
+ - [superseded] G2: 前端搜索页 → 被 CHG-001 替换
169
+ - [○] G2v2: 前端搜索页+迁移兼容 — done_when: 新旧数据均可检索 (via CHG-001)
170
+ - [○] G3: 旧数据迁移脚本 — done_when: 全量测试通过 (via CHG-001)
171
+ - Course corrections: 1 applied
172
+ ```
173
+
174
+ 规则:
175
+ - `superseded` 目标 → 单行标注,不展开细节
176
+ - 新目标 → 标注 `(via CHG-xxx)`
177
+ - re-grounding / goal-audit → 仅取 `status != "superseded"`
@@ -79,6 +79,8 @@ Run full test suite. Record final state in reflection-log.md.
79
79
 
80
80
  ### Step 7: Complete
81
81
 
82
+ Glob plan.json AND .summaries/ MUST exist before marking completed; BLOCKED if missing.
83
+
82
84
  Update index.json: `status="completed"`.
83
85
 
84
86
  Present: tasks completed/blocked, reflection rounds, strategy adjustments, test status, key learnings. If regressions: list affected tests, suggest quality-debug.
@@ -135,7 +135,7 @@ delta = { vs_phase, tasks_completed, gaps_found, issues_opened, rework_iteration
135
135
 
136
136
  ## Stage 4: multi_lens_analysis
137
137
 
138
- Spawn one Agent per active lens **in parallel** (`run_in_background: false`). Each returns JSON.
138
+ MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: Spawn one Agent per active lens **in parallel** (`run_in_background: false`). Each returns JSON.
139
139
 
140
140
  ### Lens registry
141
141
 
@@ -233,10 +233,12 @@ Return ONLY a single JSON object, no prose, matching this schema:
233
233
 
234
234
  ### Spawn pattern
235
235
 
236
- Spawn all lenses in parallel. Collect into `lens_results`. If any fails, log W001, proceed with successful lenses.
236
+ Spawn all lenses in parallel. Collect into `lens_results`. If any fails, log W001, proceed with successful lenses; flag retrospective as [LOW CONFIDENCE] (partial lenses).
237
237
 
238
238
  ---
239
239
 
240
+ **GATE Stage 4→5**: REQUIRED lens analyses complete BEFORE synthesis; BLOCKED if lens_results missing
241
+
240
242
  ## Stage 5: synthesize
241
243
 
242
244
  ### Generate insight IDs
@@ -253,6 +255,8 @@ Sections: Header (tweetable, metadata) → Metrics table → Delta table (if --c
253
255
 
254
256
  Write both to `{artifact_dir}/`.
255
257
 
258
+ Glob `{artifact_dir}/retrospective.json` AND `retrospective.md` MUST exist before Stage 8 complete; BLOCKED if missing.
259
+
256
260
  ---
257
261
 
258
262
  ## Stage 6: route_outputs
@@ -307,7 +311,7 @@ Invoke manage-learn tip with:
307
311
  insight.routed_id = "TIP-{captured_id}"
308
312
  ```
309
313
 
310
- Fallback: if skill ID cannot be captured, write tip file directly per `workflows/knowhow.md` Part B Step 3 and update `wiki-index.json` per Step 4.
314
+ Fallback: if skill ID cannot be captured, write tip file directly per `workflows/knowhow.md` Part B Step 3 and update `wiki-index.json` per Step 4; flag tip as [LOW CONFIDENCE] (skill not captured).
311
315
 
312
316
  #### Target: issue
313
317
 
@@ -161,7 +161,7 @@ Each finding: { id: "{PREFIX}-{NNN}", dimension, severity, title, file, line, sn
161
161
  ### Standard Level — Parallel Agent Review
162
162
 
163
163
  ```
164
- Per dimension → spawn workflow-reviewer agent (all parallel):
164
+ MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: Per dimension → spawn workflow-reviewer agent (all parallel):
165
165
  Context: dimension, phase_name, phase_goal, review_files, success_criteria,
166
166
  tech_stack, specs_content, verification_gaps
167
167
  Instructions:
@@ -172,7 +172,7 @@ Per dimension → spawn workflow-reviewer agent (all parallel):
172
172
  - Top 20 findings by severity, each with file:line evidence
173
173
  ```
174
174
 
175
- Launch ALL dimension agents in a single message. Collect dimension_results (JSON findings array). Log W001 on agent failure, continue with partial results.
175
+ Launch ALL dimension agents in a single message. Collect dimension_results (JSON findings array). Log W001 on agent failure, continue with partial results; flag review as [LOW CONFIDENCE] (partial results).
176
176
 
177
177
  ### Deep Level — Enhanced Agent Review
178
178
 
@@ -234,6 +234,7 @@ IF cli_targets.length == 0: skip to Step 7
234
234
  # Build concise review prompt from findings
235
235
  finding_summary = cli_targets.map(f => "${f.id}: [${f.severity}] ${f.file}:${f.line} — ${f.title}").join("\n")
236
236
 
237
+ MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep:
237
238
  Bash({
238
239
  command: 'maestro delegate "PURPOSE: Cross-verify code review findings and identify missed issues
239
240
  TASK: For each finding, verify severity is accurate | Check for false positives | Identify any critical issues missed by initial review in the same files
@@ -286,7 +287,7 @@ deep_dive_targets:
286
287
  ```
287
288
  Iterate up to max_iterations (deep=3, standard=1) over unresolved targets:
288
289
 
289
- Per target → spawn workflow-reviewer agent:
290
+ MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: Per target → spawn workflow-reviewer agent:
290
291
  Context: original finding JSON, previous analysis (if iteration > 1)
291
292
  Tasks: read affected file, find callers/imports, check test coverage
292
293
  Analyze: root cause, impact radius, remediation (with code example), risk if unfixed
@@ -369,6 +370,7 @@ Write ${PHASE_DIR}/review.json:
369
370
 
370
371
  ```
371
372
  Update index.json.updated_at = now()
373
+ Glob review.json MUST exist before Step 10 complete; BLOCKED if missing.
372
374
  Set index.json.review = { level, verdict, reviewed_at, severity_distribution,
373
375
  findings_count, issues_created count }
374
376
  ```
@@ -433,7 +435,7 @@ Next steps:
433
435
  | No changed files | Abort: "No changed files detected in this phase." |
434
436
  | Reviewer agent fails | Log W001, continue with available dimension results |
435
437
  | All agents fail | Abort: "Review could not complete — all dimension agents failed." |
436
- | Deep-dive agent fails | Log finding as unresolved, skip enrichment |
438
+ | Deep-dive agent fails | Log finding as unresolved, skip enrichment; flag finding as [LOW CONFIDENCE] (enrichment skipped) |
437
439
 
438
440
  ---
439
441
 
@@ -47,7 +47,7 @@ Read project artifacts to understand what has already been built:
47
47
  ## Codebase Exploration (conditional)
48
48
 
49
49
  - Detect if project has source files
50
- - If yes: spawn `cli-explore-agent` for context discovery
50
+ - MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: If yes: spawn `cli-explore-agent` for context discovery
51
51
  - If `project_context.already_shipped` exists: include as "feature audit" directive — agent should verify which shipped features are present in code and identify integration points for new work
52
52
  - Output: relevant files, patterns, tech stack, feature_audit
53
53
 
@@ -55,7 +55,7 @@ Read project artifacts to understand what has already been built:
55
55
 
56
56
  ## External Research — API & Technology Details (Optional)
57
57
 
58
- Spawn `workflow-external-researcher` agent when requirement mentions specific technologies, APIs, or external services.
58
+ MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: Spawn `workflow-external-researcher` agent when requirement mentions specific technologies, APIs, or external services.
59
59
 
60
60
  **Trigger**: Technology keywords detected in requirement or codebase exploration found external dependencies. Auto-trigger in auto mode (`-y`). Skip if requirement is purely organizational/conceptual.
61
61
 
@@ -66,7 +66,7 @@ If topics found → spawn `workflow-external-researcher` agent for API research:
66
66
  - Focus on details affecting phase decomposition and dependency ordering
67
67
  - Output → `apiResearchContext` (in-memory)
68
68
 
69
- If no topics or research fails → `apiResearchContext = null`, continue.
69
+ If no topics or research fails → `apiResearchContext = null`, continue; flag roadmap as [LOW CONFIDENCE] (no external research).
70
70
 
71
71
  ---
72
72
 
@@ -1,6 +1,6 @@
1
1
  # Workflow: Roadmap (Light Mode)
2
2
 
3
- Lightweight requirements-to-roadmap path. Shared logic: `@roadmap-common.md`.
3
+ Lightweight requirements-to-roadmap path. Shared logic: `@~/.maestro/workflows/roadmap-common.md`.
4
4
 
5
5
  ---
6
6
 
@@ -27,9 +27,9 @@ Parse flags from `$ARGUMENTS`:
27
27
  - `--from`: enrich from context-package (`requirements`, `constraints[locked]`, `domain`, `non_goals`, `insights`, `open_questions`)
28
28
  - `project_context`: cross-reference `already_shipped`, promote `deferred` items, apply `locked_decisions`
29
29
 
30
- 2. **Codebase Exploration** — follow roadmap-common.md
30
+ 2. **Codebase Exploration** — MANDATORY: execute ~/.maestro/workflows/roadmap-common.md Codebase Exploration logic; REQUIRED produce: codebase context summary; BLOCKED if missing
31
31
 
32
- 3. **External Research** — follow roadmap-common.md
32
+ 3. **External Research** — MANDATORY: execute ~/.maestro/workflows/roadmap-common.md External Research logic; REQUIRED produce: apiResearchContext (or [LOW CONFIDENCE] if none)
33
33
 
34
34
  `apiResearchContext` is passed into:
35
35
  - Step 3 (Decomposition): technology complexity informs phase sizing and ordering
@@ -43,7 +43,7 @@ Parse flags from `$ARGUMENTS`:
43
43
 
44
44
  ## Step 3: Decomposition
45
45
 
46
- Spawn `cli-roadmap-plan-agent` (include `apiResearchContext` if set). Apply **Minimum-Phase Principle** from roadmap-common.md.
46
+ MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: Spawn `cli-roadmap-plan-agent` (include `apiResearchContext` if set). Apply **Minimum-Phase Principle** from ~/.maestro/workflows/roadmap-common.md.
47
47
 
48
48
  ---
49
49
 
@@ -58,10 +58,13 @@ Spawn `cli-roadmap-plan-agent` (include `apiResearchContext` if set). Apply **Mi
58
58
 
59
59
  ## Step 5: Write Outputs
60
60
 
61
- Follow roadmap-common.md **Roadmap Write Logic** (overwrite vs edit rules, state.json update, scratch directory).
61
+ MANDATORY: apply ~/.maestro/workflows/roadmap-common.md **Roadmap Write Logic** (overwrite vs edit rules, state.json update, scratch directory); REQUIRED produce: .workflow/roadmap.md; BLOCKED if missing
62
62
 
63
63
  ---
64
64
 
65
+ **GATE Step 5→6**: REQUIRED roadmap.md written BEFORE handoff.
66
+ Glob .workflow/roadmap.md MUST exist before Step 6 handoff; BLOCKED if missing.
67
+
65
68
  ## Step 6: Handoff
66
69
 
67
70
  Display summary and next steps: `maestro-blueprint` | `maestro-plan 1` | `maestro-brainstorm 1` | `manage-status`
@@ -2,7 +2,7 @@
2
2
 
3
3
  Specification document chain producing a complete specification package (Product Brief, PRD, Architecture, Epics, Roadmap) through 7 sequential phases with multi-CLI analysis and interactive refinement. Pure documentation — no code generation.
4
4
 
5
- **Shared logic**: `@roadmap-common.md` (worktree guard, context loading, codebase exploration, external research, minimum-phase principle, roadmap write logic)
5
+ **Shared logic**: `@~/.maestro/workflows/roadmap-common.md` (worktree guard, context loading, codebase exploration, external research, minimum-phase principle, roadmap write logic)
6
6
 
7
7
  ## Pipeline Position
8
8
 
@@ -70,7 +70,7 @@ Load specification and template documents:
70
70
  | Quality gates | Per-phase quality criteria and scoring | P0 - must read |
71
71
  | Templates | product-brief, requirements-prd, architecture-doc, epics-template | Read on-demand per phase |
72
72
 
73
- **Load project specs and history**: Follow roadmap-common.md "Load Project Context".
73
+ **Load project specs and history**: MANDATORY: execute ~/.maestro/workflows/roadmap-common.md "Load Project Context"; REQUIRED produce: specs+history loaded.
74
74
 
75
75
  Additional full-mode rules:
76
76
  - Features in `already_shipped` are EXCLUDED from spec generation scope
@@ -109,15 +109,15 @@ Session ID: SPEC-{slug}-{YYYY-MM-DD}
109
109
  Output dir: .workflow/.spec/{session_id}/
110
110
  ```
111
111
 
112
- **Step 2.3: Seed Analysis via CLI**
112
+ **Step 2.3: Seed Analysis via CLI** (MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep)
113
113
  - Spawn CLI analysis to extract: problem_statement, target_users, domain, constraints, dimensions (3-5)
114
114
  - Assess complexity: simple (1-2 components) / moderate (3-5) / complex (6+)
115
115
  - For context-package input: enrich with feature decomposition data
116
116
 
117
- **Step 2.4: Codebase Exploration** — follow roadmap-common.md
117
+ **Step 2.4: Codebase Exploration** — MANDATORY: execute ~/.maestro/workflows/roadmap-common.md Codebase Exploration logic; REQUIRED produce: discovery-context.json (codebase context)
118
118
  - Output: `discovery-context.json` with relevant_files, patterns, tech_stack
119
119
 
120
- **Step 2.5: External Research** — follow roadmap-common.md
120
+ **Step 2.5: External Research** — MANDATORY: execute ~/.maestro/workflows/roadmap-common.md External Research logic; REQUIRED produce: apiResearchContext (or [LOW CONFIDENCE] if none)
121
121
 
122
122
  `apiResearchContext` is passed into:
123
123
  - Step 4 (Product Brief): technology feasibility assessment
@@ -166,7 +166,7 @@ Generate product brief through multi-perspective CLI analysis.
166
166
  - Read discovery-context.json (if codebase detected)
167
167
  - For context-package input: read context-package.json domain and requirements sections
168
168
 
169
- **Step 4.2: Multi-CLI Parallel Analysis (3 perspectives)**
169
+ **Step 4.2: Multi-CLI Parallel Analysis (3 perspectives)** (MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep)
170
170
 
171
171
  | Perspective | Role | Focus |
172
172
  |-------------|------|-------|
@@ -191,6 +191,8 @@ Generate product brief through multi-perspective CLI analysis.
191
191
 
192
192
  **Output**: `product-brief.md`, `glossary.json`
193
193
 
194
+ **GATE P2→P3**: REQUIRED product-brief.md written; BLOCKED if missing
195
+
194
196
  ### Step 5: Requirements / PRD (Phase 3)
195
197
 
196
198
  Generate detailed PRD with functional/non-functional requirements.
@@ -216,11 +218,13 @@ Generate detailed PRD with functional/non-functional requirements.
216
218
 
217
219
  **Output**: `requirements/` directory (index + individual files)
218
220
 
221
+ **GATE P3→P4**: REQUIRED requirements/_index.md with MoSCoW table; BLOCKED if missing
222
+
219
223
  ### Step 6: Architecture (Phase 4)
220
224
 
221
225
  Generate architecture decisions, component design, and technology selections.
222
226
 
223
- **Step 6.1: Architecture Analysis via CLI (role: review)**
227
+ **Step 6.1: Architecture Analysis via CLI (role: review)** (MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep)
224
228
  - System architecture style with justification
225
229
  - Core components and responsibilities
226
230
  - Component interaction diagram (Mermaid graph TD)
@@ -340,7 +344,7 @@ Convert Epics into an interactive roadmap with user confirmation.
340
344
  - Read individual `EPIC-NNN-{slug}.md` for Stories and acceptance criteria
341
345
  - Read `architecture/_index.md` for technical constraints (ADR decisions)
342
346
 
343
- Apply **Minimum-Phase Principle** from roadmap-common.md for Epic→Phase mapping:
347
+ Apply **Minimum-Phase Principle** from ~/.maestro/workflows/roadmap-common.md for Epic→Phase mapping:
344
348
  - Default: ALL Epics → 1 Phase (wave DAG orders tasks by Epic dependencies)
345
349
  - Only split if hard dependency conditions are all met
346
350
  - MVP-tagged Epics → Milestone 1, Post-MVP → Milestone 2+
@@ -350,7 +354,7 @@ Apply **Minimum-Phase Principle** from roadmap-common.md for Epic→Phase mappin
350
354
  - ADR decisions → phase technical constraints
351
355
 
352
356
  **Step 11.2: Generate Draft Roadmap**
353
- Follow roadmap-common.md **Roadmap Template** format. For full mode, populate from product-brief.md vision and Epic→Stories acceptance criteria.
357
+ MANDATORY: apply ~/.maestro/workflows/roadmap-common.md **Roadmap Template** format. For full mode, populate from product-brief.md vision and Epic→Stories acceptance criteria; REQUIRED produce: roadmap section.
354
358
 
355
359
  **Step 11.3: Interactive Refinement (max 3 rounds)**
356
360
  - Present roadmap overview: phase count, milestone structure, dependency graph
@@ -364,9 +368,9 @@ Follow roadmap-common.md **Roadmap Template** format. For full mode, populate fr
364
368
 
365
369
  **Step 11.4: Write Outputs**
366
370
  - Write `roadmap.md` to spec directory: `{spec_dir}/roadmap.md`
367
- - Write `.workflow/roadmap.md` — follow roadmap-common.md **Overwrite vs Edit Rules**
371
+ - MANDATORY: apply ~/.maestro/workflows/roadmap-common.md **Overwrite vs Edit Rules**; REQUIRED produce: .workflow/roadmap.md; BLOCKED if missing
368
372
  - Update `spec-config.json`: add Phase 7 completion
369
- - Update `state.json` — follow roadmap-common.md **state.json Update Rules**
373
+ - MANDATORY: apply ~/.maestro/workflows/roadmap-common.md **state.json Update Rules**; REQUIRED produce: state.json updated
370
374
 
371
375
  **Step 11.5: Handoff Options (AskUserQuestion)**
372
376
 
@@ -380,6 +384,7 @@ Follow roadmap-common.md **Roadmap Template** format. For full mode, populate fr
380
384
  ### Step 12: Final Report
381
385
 
382
386
  ```
387
+ Glob product-brief.md AND requirements/ AND architecture/ AND epics/ MUST exist before final report; BLOCKED if missing.
383
388
  == spec-generate complete ==
384
389
  Session: SPEC-{slug}-{date} | Quality: {score}% ({gate}) | Phases: {completed_count}/7
385
390
  Output: .workflow/.spec/{session_id}/
@@ -457,14 +462,14 @@ Init detects existing `.workflow/roadmap.md` and skips roadmap creation.
457
462
  | Phase | Error | Blocking? | Action |
458
463
  |-------|-------|-----------|--------|
459
464
  | Phase 1 | Empty input | Yes | Error and exit |
460
- | Phase 1 | CLI analysis fails | No | Basic parsing fallback |
465
+ | Phase 1 | CLI analysis fails | No | Basic parsing fallback; flag seed analysis as [LOW CONFIDENCE] (basic parsing) |
461
466
  | Phase 1.5 | Gap analysis fails | No | Skip to basic prompts |
462
- | Phase 2 | Single CLI fails | No | Continue with available |
463
- | Phase 3 | Gemini fails | No | Codex fallback |
464
- | Phase 4 | Review fails | No | Skip review |
467
+ | Phase 2 | Single CLI fails | No | Continue with available; flag product-brief as [LOW CONFIDENCE] (N-1 perspectives) |
468
+ | Phase 3 | Gemini fails | No | Codex fallback; flag requirements as [LOW CONFIDENCE] (fallback tool) |
469
+ | Phase 4 | Review fails | No | Skip review; flag architecture/ as [LOW CONFIDENCE] (review skipped) |
465
470
  | Phase 5 | Story generation fails | No | Generate epics only |
466
- | Phase 6 | Validation fails | No | Partial report |
471
+ | Phase 6 | Validation fails | No | Partial report; flag readiness-report as [LOW CONFIDENCE] (validation incomplete) |
467
472
  | Phase 6.5 | Max iterations (2) | No | Force handoff |
468
- | Step 2.5 | External research fails | No | apiResearchContext = null, continue |
473
+ | Step 2.5 | External research fails | No | apiResearchContext = null, continue; flag Phase 2-5 outputs as [LOW CONFIDENCE] (no external research) |
469
474
 
470
- CLI Fallback Chain: Role-based resolution → degraded mode (local only)
475
+ CLI Fallback Chain: Role-based resolution → degraded mode (local only); flag all affected outputs as [LOW CONFIDENCE] (degraded local-only mode)
@@ -59,7 +59,7 @@ Extract `--scope`, `--uid`, `--category <category>` and remaining text (keyword
59
59
  maestro spec load --scope <scope> [--uid <uid>] [--category <category>] [--keyword <word>]
60
60
  ```
61
61
 
62
- If `maestro spec load` CLI is unavailable, read files directly from the resolved directory.
62
+ If `maestro spec load` CLI is unavailable, read files directly from the resolved directory; flag loaded specs as [LOW CONFIDENCE] (CLI unavailable, direct file read).
63
63
 
64
64
  ### Step 3: Keyword Filter (optional)
65
65
 
@@ -285,6 +285,8 @@ source: spec-setup
285
285
 
286
286
  ### Step 7: Summary
287
287
 
288
+ Glob created spec/recipe files MUST exist before Step 7 summary; BLOCKED if missing.
289
+
288
290
  Display list of all created files grouped by destination:
289
291
 
290
292
  ```
package/workflows/sync.md CHANGED
@@ -36,8 +36,8 @@ No files changed → emit W001, exit
36
36
  Read .workflow/codebase/doc-index.json
37
37
  Extract: components[], features[], requirements[], architecture_decisions[]
38
38
 
39
- If missing: prompt → (a) run /manage-codebase-rebuild then re-run (recommended)
40
- or → (b) DEGRADED_MODE: git-diff-only, skip Steps 3-5
39
+ If missing: prompt → (a) MUST run /manage-codebase-rebuild then re-run
40
+ or → (b) DEGRADED_MODE: git-diff-only, skip Steps 3-5; flag sync as [LOW CONFIDENCE] (git-diff-only, Steps 3-5 skipped)
41
41
  ```
42
42
 
43
43
  ### Step 4: Impact Chain Traversal
@@ -50,6 +50,8 @@ Traverse impact chain: file → components (via code_locations match)
50
50
  Aggregate deduplicated: { files, components, features, requirements }
51
51
  ```
52
52
 
53
+ GATE Step 4→5: impact_chain non-empty BEFORE update index; BLOCKED if impact_chain empty (no affected components/features/requirements identified)
54
+
53
55
  ### Step 5: Update Doc Index (skip if --dry-run)
54
56
 
55
57
  ```
@@ -12,7 +12,7 @@ Tests expose bugs -- fixing is for quality-debug or maestro-execute.
12
12
  specs_content = maestro spec load --category test
13
13
  ```
14
14
 
15
- Follow project test conventions in Step 4 (Generate Test Plan) and Step 5 (Write Tests).
15
+ Apply project test conventions (from Step 0 specs) when generating the plan (Step 4) and writing tests (Step 5); REQUIRED: tests conform to loaded spec conventions.
16
16
 
17
17
  ---
18
18
 
package/workflows/test.md CHANGED
@@ -275,7 +275,7 @@ issues == 0 → Step 13. issues > 0 → Step 11.
275
275
  ### Step 11: Auto-Diagnose
276
276
 
277
277
  1. **Cluster gaps** by component/area (same file/module → one cluster, same flow → one cluster)
278
- 2. **Spawn one debug agent per cluster** (parallel, `run_in_background: false`): pre-filled symptoms, `goal: find_root_cause`. Include `issue_id` refs.
278
+ 2. MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: **Spawn one debug agent per cluster** (parallel, `run_in_background: false`): pre-filled symptoms, `goal: find_root_cause`. Include `issue_id` refs.
279
279
  3. **Collect results**, update uat.md gaps:
280
280
  ```yaml
281
281
  - test: {N}
@@ -350,6 +350,7 @@ Task(subagent_type="ui-design-agent",
350
350
  ```bash
351
351
  # Agents run in parallel and write separate output files
352
352
  # Each agent generates its own JSON directly
353
+ Glob ${temp_dir}/style-extraction/style-1/design-tokens.json, ${temp_dir}/animation-extraction/animation-tokens.json, ${temp_dir}/layout-extraction/layout-templates.json MUST exist before Phase 2 complete; BLOCKED if missing
353
354
  echo "[Phase 2] Parallel agent analysis complete"
354
355
  ```
355
356
 
@@ -203,7 +203,7 @@ echo " knowhow-manifest.json written to ${package_dir}"
203
203
  通过 Skill tool 调用 codify-to-knowhow:
204
204
 
205
205
  ```javascript
206
- Skill("codify-to-knowhow", args="${package_dir}")
206
+ MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: Skill("codify-to-knowhow", args="${package_dir}")
207
207
  ```
208
208
 
209
209
  等待 codify-to-knowhow 完成。它将:
@@ -50,7 +50,7 @@ echo "[Phase 3] Token files prepared"
50
50
  **Agent Task**:
51
51
 
52
52
  ```javascript
53
- Agent(ui-design-agent): `
53
+ MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: Agent(ui-design-agent): `
54
54
  [PREVIEW_SHOWCASE_GENERATION]
55
55
  Generate interactive multi-component showcase panel for reference package
56
56
 
@@ -130,7 +130,7 @@ echo " Output: $package_dir"
130
130
 
131
131
  ## Phase 2: Parallel Agent Extraction (Deferred)
132
132
 
133
- **Read** `@~/.maestro/workflows/ui-codify-extract.md` then execute.
133
+ MANDATORY: execute ui-codify-extract.md steps; REQUIRED produce: design-tokens.json, animation-tokens.json, layout-templates.json; BLOCKED if missing.
134
134
 
135
135
  Variables available to Phase 2:
136
136
  - `source_path` — absolute path to source directory
@@ -147,7 +147,7 @@ Phase 2 writes:
147
147
 
148
148
  ## Phase 3: Reference Package Generation (Deferred)
149
149
 
150
- **Read** `@~/.maestro/workflows/ui-codify-package.md` then execute.
150
+ MANDATORY: execute ui-codify-package.md steps; REQUIRED produce: preview.html, preview.css, token files copied to package_dir; BLOCKED if missing.
151
151
 
152
152
  Variables available to Phase 3:
153
153
  - `temp_dir` — temporary workspace with extraction results
@@ -167,7 +167,7 @@ Phase 3 writes:
167
167
 
168
168
  ## Phase 4: Knowledge Asset Generation (Deferred)
169
169
 
170
- **Read** `@~/.maestro/workflows/ui-codify-knowhow.md` then execute.
170
+ MANDATORY: execute ui-codify-knowhow.md steps; REQUIRED produce: knowhow-manifest.json, knowhow files, spec entries; BLOCKED if missing.
171
171
 
172
172
  Variables available to Phase 4:
173
173
  - `package_dir` — package directory with all token files
@@ -189,15 +189,17 @@ Phase 4 writes:
189
189
  | 1 | E001: Missing source path | Report usage, exit |
190
190
  | 1 | E002: Source not found | Report path, exit |
191
191
  | 1 | E003: Package exists | Suggest --overwrite, exit |
192
- | 2 | Agent failure | Report which agent failed, continue with partial results |
192
+ | 2 | Agent failure | Report which agent failed, continue with partial results; flag partial results as [LOW CONFIDENCE] (agent failure) |
193
193
  | 2 | No files discovered | Report empty discovery, exit |
194
194
  | 3 | Token copy failed | Report missing file, exit |
195
- | 3 | Preview generation failed | Report error, continue (preview is non-critical) |
196
- | 4 | Manifest build failed | Report error, package still usable without knowhow |
197
- | 4 | codify-to-knowhow failed | Report error, manifest remains for manual retry |
195
+ | 3 | Preview generation failed | Report error, continue (preview is non-critical); flag preview.html/css as [LOW CONFIDENCE] (preview generation failed) |
196
+ | 4 | Manifest build failed | Report error, package still usable without knowhow; flag knowhow assets as [LOW CONFIDENCE] (manifest build failed) |
197
+ | 4 | codify-to-knowhow failed | Report error, manifest remains for manual retry; flag knowhow/spec entries as [LOW CONFIDENCE] (codify-to-knowhow failed) |
198
198
 
199
199
  ## Completion Message
200
200
 
201
+ Glob all listed output files MUST exist before completion message; BLOCKED if missing.
202
+
201
203
  ```
202
204
  UI Design System Codified!
203
205