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
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: odyssey-ui
3
3
  description: Long-running UI optimization cycle — visual survey, multi-dimensional audit, divergent exploration, fix, verify, generalize, and design knowledge persistence
4
- argument-hint: <target> [--dimensions <list>] [--skip-fix] [--skip-generalize] [--auto] [-y] [-c]
4
+ argument-hint: <target> [--dimensions <list>] [--skip-fix] [--skip-generalize] [--auto] [-y] [-c] [--heartbeat]
5
5
  allowed-tools:
6
6
  - ask_question
7
7
  - define_subagent
@@ -14,6 +14,8 @@ allowed-tools:
14
14
  - view_file
15
15
  - write_to_file
16
16
  ---
17
+ <base>@~/.maestro/workflows/odyssey-base.md</base>
18
+
17
19
  <purpose>
18
20
  Deep UI polish cycle: survey → 6-dimension audit → divergent creative exploration →
19
21
  fix → verify → generalize → discover → persist. Every pixel is a learning opportunity.
@@ -24,85 +26,35 @@ fix → verify → generalize → discover → persist. Every pixel is a learnin
24
26
  **范围外:** 后端逻辑 / 数据模型 / API 设计 / 业务规则 → `/odyssey-planex` | 深度 bug 调查 → `/odyssey-debug` | 代码质量审查 → `/odyssey-review-test-fix`
25
27
  **探索自由度:** 边界内最大自由 — S_DIVERGE 阶段鼓励发散思维,不设创意上限。审查 + 发散可发现任何视觉/交互/可访问性细节。在约束下尽可能完善每个像素。
26
28
  **Zero-residual principle:** Every finding/idea MUST have a concrete action (fix / issue / decision). "Report and shelve" is not allowed. "Pre-existing design debt" is not a valid skip reason — if discovered within scope, it must be addressed.
29
+ ⚠️ **Decision gate** — ONLY these qualify as decisions (not fixes):
30
+ - Brand/style direction requiring human creative judgment
31
+ - Layout restructuring that changes user flow significantly
32
+ - Requires new design tokens or breaking component API
33
+ ❌ "Unsure how to fix", "Large scope", "Pre-existing issue" are NOT valid decision reasons — either fix it, or explain specifically why it's unfixable
27
34
  </boundary>
28
35
 
29
- <execution_discipline>
30
- **三条铁律(所有阶段适用):**
31
-
32
- 1. **Phase auto-commit** — 每个阶段完成后**自动** `git commit`,无需用户确认
33
- - 代码变更 + understanding.md → `git add` → `git commit -m "odyssey-ui({slug}): {phase} — {摘要}"`
34
- - session.json / evidence.ndjson 为运行时状态,不纳入 commit
35
-
36
- 2. **Confident edits only, but must attempt** — only modify what you're confident about; record decisions only when genuinely requiring human judgment
37
- - High visual certainty (missing hover state, insufficient contrast, etc.) → fix directly
38
- - Design direction uncertain (color choices, layout restructure, etc.) → record decision for user judgment
39
- - No speculative changes, especially brand/style-level modifications
40
- - ⚠️ **Decision gate** — ONLY these qualify as decisions (not fixes):
41
- - Brand/style direction requiring human creative judgment
42
- - Layout restructuring that changes user flow significantly
43
- - Requires new design tokens or breaking component API
44
- - ❌ "Unsure how to fix", "Large scope", "Pre-existing issue" are NOT valid decision reasons — either fix it, or explain specifically why it's unfixable
45
-
46
- 3. **多 CLI 辅助** — 利用 `maestro delegate` 调用多个 CLI 工具交叉验证
47
- - survey 阶段: `--role explore` 发现设计系统用法
48
- - audit/diverge: `--role analyze` 获取多视角创意
49
- - fix 前后: `--role review` 确认视觉正确性
50
-
51
- 4. **禁止以上下文消耗为由中断** — harness 自动处理 context compression,以"上下文不足"或"已执行 N 个阶段"为由中断属于纪律违反;必须完整走完状态机直到 S_RECORD → END
52
- </execution_discipline>
53
-
54
36
  <context>
55
37
  $ARGUMENTS — target and optional flags.
56
38
 
57
- **Target resolution:**
58
- | Input | Resolution |
59
- |-------|-----------|
60
- | Component path | Audit that component |
61
- | Page/route path | Audit that page |
62
- | `staged` / `HEAD` | Review UI changes in diff |
63
- | Feature area name | Resolve to related components/pages |
39
+ **Target resolution:** Component path → audit component | Page/route → audit page | `staged`/`HEAD` → diff UI changes | Feature area → resolve to components/pages
64
40
 
65
41
  **Flags:**
66
42
  | Flag | Effect | Default |
67
43
  |------|--------|---------|
68
44
  | `--dimensions <list>` | Comma-separated subset of 6 dimensions | all 6 |
69
- | `--fix-threshold <severity>` | 修复到哪个 severity 为止(all = 全部修复)| all |
45
+ | `--fix-threshold <severity>` | 修复到哪个 severity 为止 | all |
70
46
  | `--skip-fix` | Audit + diverge only, no code changes | false |
71
47
  | `--skip-generalize` | Skip S_GENERALIZE and S_DISCOVER | false |
72
48
  | `--auto` | CLI delegates without confirmation | false |
73
49
  | `-y` | Auto-confirm all decisions (see appendix) | false |
74
50
  | `-c` | Resume most recent session | — |
51
+ | `--heartbeat` | Enable heartbeat progress reporting | false |
75
52
 
76
53
  **Session**: `SESSION_DIR = .workflow/scratch/{YYYYMMDD}-ui-odyssey-{slug}/`
77
54
 
78
- **Output — 3 files:**
79
- ```
80
- SESSION_DIR/
81
- ├── session.json # state + audit_result + diverge_result + patterns + phase_goals
82
- ├── evidence.ndjson # append-only (phase: survey|audit|diverge|fix|discovery|decision|self-iteration)
83
- └── understanding.md # 8-section evolving narrative
84
- ```
85
-
86
- **session.json schema:**
87
- ```json
88
- {
89
- "session_id": "ui-odyssey-{YYYYMMDD-HHmmss}",
90
- "target": "", "dimensions": [],
91
- "flags": { "skip_fix": false, "skip_generalize": false, "auto": false, "auto_confirm": false },
92
- "current_state": "S_INTAKE",
93
- "audit_result": { "dimensions_audited": [], "finding_count": 0, "severity_distribution": { "critical": 0, "high": 0, "medium": 0, "low": 0 } },
94
- "diverge_result": { "improvements_proposed": 0, "creative_ideas": 0 },
95
- "patterns": [{ "id": "P1", "source_finding": "F1", "layer": "syntax|semantic|structural", "signature": "", "description": "", "risk": "", "fix_template": "", "confidence": "high|medium|low" }],
96
- "confirmation": { "test_result": {}, "cli_review": {}, "overall": "confirmed|needs_rework" },
97
- "generalization_stats": { "patterns_extracted": 0, "total_hits": 0, "cross_layer_confirmed": 0, "regression_risks": 0, "by_layer": {}, "deepening_triggered": false },
98
- "phase_goals": [], "phase_goals_all_done": false,
99
- "self_iteration_log": [],
100
- "cross_phase_loops": 0, "max_loops": 5,
101
- "created_at": "", "updated_at": ""
102
- }
103
- ```
55
+ **Output — 3 files:** `session.json` (state + audit/diverge results + patterns + phase_goals) | `evidence.ndjson` (phases: survey, audit, diverge, fix, discovery, decision, self-iteration) | `understanding.md` (8-section narrative)
104
56
 
105
- **evidence.ndjson unified schema:** `{"ts":"","phase":"<phase>","type":"<type>","dimension":"","title":"","severity":"","file":"","line":0,"description":"","suggestion":"","category":"","impact":"","effort":""}`
57
+ **session.json unique fields:** `target`, `dimensions`, `audit_result` {dimensions_audited, finding_count, severity_distribution}, `diverge_result` {improvements_proposed, creative_ideas}, `patterns[]` {id, source_finding, layer, signature, description, risk, fix_template, confidence}, `confirmation` {test_result, cli_review, overall}, `generalization_stats` {patterns_extracted, total_hits, cross_layer_confirmed, regression_risks, by_layer, deepening_triggered}
106
58
 
107
59
  **phase_goals[]:**
108
60
  | ID | Goal | Phase | skip_when |
@@ -110,52 +62,27 @@ SESSION_DIR/
110
62
  | G1 | Survey completed | S_SURVEY | — |
111
63
  | G2 | Audit completed | S_AUDIT | — |
112
64
  | G3 | Divergent exploration done | S_DIVERGE | — |
113
- | G4 | Zero remaining: all findings/ideas fixed and verified | 0 remaining actionable within fix_threshold | S_VERIFY | skip_fix |
65
+ | G4 | Zero remaining: all findings/ideas fixed and verified | S_VERIFY | skip_fix |
114
66
  | G5 | Pattern generalized | S_GENERALIZE | skip_generalize |
115
67
  | G6 | Discoveries triaged | S_DISCOVER | skip_generalize |
116
68
  | G7 | Learnings persisted | S_RECORD | — |
117
69
 
118
- Lifecycle: `pending done | skipped | failed` (all set `completion_confirmed`)
70
+ **understanding.md:** §1 Target & Design Context | §2 Survey | §3 Audit | §4 Diverge | §5 Verify | §6 Generalize | §7 Discover | §8 Learnings
119
71
 
120
72
  ### Pre-load(可选,缺失不阻塞)
73
+ ARCHITECTURE.md | `maestro search "<target>" --json` (top 5) | `maestro load --type spec --category ui` | `maestro load --type spec --category coding` | `maestro search --category ui` → load knowhow | Glob prior sessions
121
74
 
122
- | 层级 | 命令 | 作用 |
123
- |------|------|------|
124
- | Codebase docs | Read `.workflow/codebase/ARCHITECTURE.md` | 模块边界,组件结构 |
125
- | Wiki search | `maestro search "<target keywords>" --json` | 先前 UI 决策(取 top 5) |
126
- | UI specs | `maestro load --type spec --category ui` | 设计规范、token、组件约定 |
127
- | Coding specs | `maestro load --type spec --category coding` | 编码规范 |
128
- | Role knowledge | `maestro search --category ui` → 选相关 → `maestro load --type knowhow --id <id>` | 累积设计知识 |
129
- | Prior sessions | `grep_search(".workflow/scratch/*-ui-odyssey-*")` | 相关会话 |
130
-
131
- ### Knowledge Persistence(S_RECORD 中写入产出文件)
132
-
133
- S_RECORD 阶段将可沉淀知识 **写入 understanding.md §8 Learnings**,按以下分类结构化:
134
-
75
+ ### Knowledge Persistence(S_RECORD 写入 understanding.md §8)
135
76
  | 分类 | 写入内容 | 后续建议命令 |
136
77
  |------|---------|-------------|
137
78
  | 设计 pattern | 组件模式 + 适用场景 + token 引用 | `/spec-add ui "..."` |
138
79
  | 交互规范 | 状态定义 + 转场规则 + 反馈模式 | `/spec-add ui "..."` |
139
80
  | 可访问性规则 | WCAG 要求 + 实现方案 | `/spec-add ui "..."` |
140
81
  | 可复用泛化 pattern | pattern 签名 + 应用范围 | `/spec-add coding "..."` |
141
-
142
- **两步模式:** 执行中写入产出文件(临时记录)→ 任务完成后用户通过 next_step_routing 沉淀为永久知识。执行过程中不调用外部 Skill。
143
82
  </context>
144
83
 
145
84
  <self_iteration>
146
- **Quality Gate** auto-evaluate after each analytical phase. Insufficient → re-enter (max **3 rounds**).
147
-
148
- | Dimension | Sufficient | Insufficient |
149
- |-----------|-----------|-------------|
150
- | Coverage | All target components/pages analyzed across dimensions | Missed files discoverable via grep/glob |
151
- | Depth | ≥80% findings have file:line evidence | Most findings lack specifics |
152
- | Actionability | Each conclusion has concrete improvement action | "Consider reviewing" without action |
153
-
154
- **Expansion:** Round 1 = widen scope (more components, deeper import chain, extra delegate angles). Round 2 = shift perspective (different CLI tool, reverse dependency trace, manual code reading). Round 3 = combine both + targeted deep-dive on remaining gaps.
155
-
156
- **Log:** `evidence.ndjson ← {"phase":"self-iteration","type":"quality-gate","stage":"S_XXX","round":N,"assessment":{},"expansion":""}`
157
-
158
- **Applicable stages:** S_SURVEY, S_AUDIT, S_DIVERGE, S_GENERALIZE
85
+ 适用阶段: S_SURVEY, S_AUDIT, S_DIVERGE, S_GENERALIZE
159
86
  </self_iteration>
160
87
 
161
88
  <state_machine>
@@ -179,7 +106,6 @@ S_INTAKE:
179
106
  → S_INTAKE WHEN no target DO ask_question
180
107
 
181
108
  S_SURVEY → S_AUDIT DO A_SURVEY
182
-
183
109
  S_AUDIT → S_DIVERGE DO A_AUDIT
184
110
 
185
111
  S_DIVERGE:
@@ -188,7 +114,6 @@ S_DIVERGE:
188
114
  → S_RECORD WHEN (skip_fix OR no actionable) AND skip_gen DO A_DIVERGE
189
115
 
190
116
  S_FIX → S_VERIFY DO A_FIX
191
-
192
117
  S_VERIFY:
193
118
  → S_GENERALIZE WHEN verified AND !skip_gen DO A_VERIFY
194
119
  → S_RECORD WHEN verified AND skip_gen DO A_VERIFY
@@ -198,213 +123,123 @@ S_GENERALIZE:
198
123
  → S_DISCOVER WHEN hits found DO A_GENERALIZE
199
124
  → S_RECORD WHEN no hits DO A_GENERALIZE
200
125
 
201
- S_DISCOVER → S_AUDIT : discovery reveals new component to audit → cross_phase_loops++
202
- S_DISCOVER → S_FIX : discovery finds fixable sibling, !skip_fix → cross_phase_loops++
203
- S_DISCOVER → S_RECORD : triage complete AND remaining_actionable == 0
204
- S_DISCOVER → S_RECORD : loops >= max_loops → MUST log each unfixed item with specific reason (blanket "pre-existing" is forbidden)
126
+ S_DISCOVER → S_AUDIT : new component to audit → cross_phase_loops++
127
+ S_DISCOVER → S_FIX : fixable sibling, !skip_fix → cross_phase_loops++
128
+ S_DISCOVER → S_RECORD : remaining_actionable == 0 OR loops >= max_loops (MUST log each unfixed item)
205
129
 
206
- S_RECORD → END DO A_RECORD
130
+ S_RECORD → END DO A_RECORD
207
131
  </transitions>
208
132
 
209
133
  <actions>
210
134
 
211
135
  ### A_INTAKE
212
- 1. Parse arguments: target description, flags, `--dimensions` subset
136
+ 1. Parse arguments: target, flags, `--dimensions` subset
213
137
  2. Generate slug, create `SESSION_DIR`
214
- 3. Search: `maestro search "<keywords>"` + Glob prior sessions + ARCHITECTURE.md + spec load ui/coding
138
+ 3. Pre-load: `maestro search` + Glob prior sessions + ARCHITECTURE.md + spec load ui/coding
215
139
  4. Derive `phase_goals[]` from flags (apply `skip_when`)
216
- 5. Write `session.json` + `understanding.md` §1 (Target & Design Context)
140
+ 5. Write `session.json` + `understanding.md` §1
217
141
  6. Emit Goal Prompt (see Appendix)
218
-
219
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-ui({slug}): INTAKE — 目标解析"`
142
+ 📌 `git commit -m "odyssey-ui({slug}): INTAKE — 目标解析"`
220
143
 
221
144
  ### A_RESUME
222
145
  Find latest session via Glob → read `session.json` → display summary → jump to `current_state`.
223
146
 
224
147
  ### A_SURVEY
225
- Visual landscape survey understand the current state before proposing changes.
226
-
227
- 1. **Design system inventory**: Scan target files for design tokens, CSS variables, theme imports. Catalog what's used.
228
- 2. **Current state analysis**: Read component code, identify styling patterns, layout strategy, component hierarchy.
229
- 3. **CLI-assisted survey** (optional):
230
- ```bash
231
- maestro delegate "PURPOSE: Survey UI design state of: {target}
232
- TASK: Identify design tokens in use | Catalog spacing/typography patterns | Map component hierarchy | Check consistency with design system
233
- MODE: analysis
234
- CONTEXT: @{target_files}
235
- EXPECTED: JSON {tokens_used, spacing_patterns, typography_scale, component_hierarchy, consistency_issues}
236
- " --role analyze --mode analysis
237
- ```
238
- Execute with `run_in_background: true`, then wait for callback (do NOT halt the Odyssey flow).
239
-
240
- 4. Append evidence.ndjson (phase: "survey"). Update `understanding.md` §2. Mark G1 done.
241
-
242
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-ui({slug}): SURVEY — 视觉调查"`
148
+ 1. **Design system inventory**: Scan for design tokens, CSS variables, theme imports
149
+ 2. **Current state analysis**: Styling patterns, layout strategy, component hierarchy
150
+ 3. **CLI-assisted** (optional): `maestro delegate` with `--role analyze` survey tokens, spacing, typography, hierarchy, consistency
151
+ 4. Append evidence (phase: "survey"). Update §2. Mark G1 done.
152
+ 📌 `git commit -m "odyssey-ui({slug}): SURVEY — 视觉调查"`
243
153
 
244
154
  ### A_AUDIT
245
155
  Spawn 6 parallel Agents (one per dimension, or `--dimensions` subset):
246
156
 
247
- | Agent | Dimension | Focus |
248
- |-------|-----------|-------|
249
- | Visual Hierarchy | visual_hierarchy | Spacing, typography scale, color contrast, alignment, whitespace, visual weight |
250
- | Interaction States | interaction_states | Hover, focus, active, disabled, loading, error, empty, selected states |
251
- | Accessibility | accessibility | WCAG AA contrast, focus management, aria labels, keyboard nav, screen reader |
252
- | Responsiveness | responsiveness | Breakpoints, overflow, touch targets, fluid typography, container queries |
253
- | Micro-interactions | micro_interactions | Transitions, animations, feedback indicators, loading states, progress |
254
- | Edge Cases | edge_cases | Long text truncation, empty data, error states, extreme values, i18n, RTL |
157
+ | Dimension | Focus |
158
+ |-----------|-------|
159
+ | visual_hierarchy | Spacing, typography scale, color contrast, alignment, whitespace, visual weight |
160
+ | interaction_states | Hover, focus, active, disabled, loading, error, empty, selected states |
161
+ | accessibility | WCAG AA contrast, focus management, aria labels, keyboard nav, screen reader |
162
+ | responsiveness | Breakpoints, overflow, touch targets, fluid typography, container queries |
163
+ | micro_interactions | Transitions, animations, feedback indicators, loading states, progress |
164
+ | edge_cases | Long text truncation, empty data, error states, extreme values, i18n, RTL |
255
165
 
256
166
  Each returns `[{title, severity, file, line, description, suggestion, dimension}]`.
257
- Merge → evidence.ndjson (phase: "audit"). Write `session.json.audit_result`.
258
- Update `understanding.md` §3 (findings by dimension + severity matrix). Mark G2 done.
259
-
260
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-ui({slug}): AUDIT — 多维审查"`
167
+ Merge → evidence (phase: "audit"). Write `audit_result`. Update §3 (severity matrix). Mark G2 done.
168
+ 📌 `git commit -m "odyssey-ui({slug}): AUDIT 多维审查"`
261
169
 
262
170
  ### A_DIVERGE
263
- **The unique phase** — divergent creative exploration. Goes beyond defect fixing to ask "what would make this delightful?"
264
-
265
- **Step 1 — Creative exploration (2 parallel Agents):**
266
-
267
- | Agent | Angle | Prompt Focus |
268
- |-------|-------|-------------|
269
- | Polish Agent | "What subtle details are missing?" | Shadows, borders, transitions, hover states, feedback, empty states, skeleton loading, scroll behavior |
270
- | Delight Agent | "What would make this experience memorable?" | Motion design, progressive disclosure, smart defaults, contextual hints, celebratory feedback, personality in copy |
171
+ Goes beyond defect fixing "what would make this delightful?"
271
172
 
272
- Each returns: `[{idea, category (polish|delight), impact (high|medium|low), effort (small|medium|large), description, inspiration}]`
173
+ **Step 1 2 parallel Agents:**
174
+ - **Polish Agent**: Shadows, borders, transitions, hover states, feedback, empty states, skeleton loading, scroll behavior
175
+ - **Delight Agent**: Motion design, progressive disclosure, smart defaults, contextual hints, celebratory feedback, personality in copy
273
176
 
274
- **Step 2 CLI-assisted design review** (optional):
275
- ```bash
276
- maestro delegate "PURPOSE: Creative UI review of: {target}
277
- TASK: Identify polish opportunities | Suggest micro-interaction improvements | Review visual rhythm and harmony | Propose delight moments
278
- MODE: analysis
279
- CONTEXT: @{target_files} | Audit summary: {audit_findings_summary}
280
- EXPECTED: JSON [{category, idea, rationale, reference}]
281
- " --role analyze --mode analysis
282
- ```
283
- Execute with `run_in_background: true`, then wait for callback (do NOT halt the Odyssey flow).
177
+ Each returns `[{idea, category (polish|delight), impact, effort, description, inspiration}]`
284
178
 
285
- **Step 3Consolidate**: Merge audit findings + divergent ideas prioritized improvement list (severity x impact x effort matrix).
286
- Append evidence.ndjson (phase: "diverge"). Update `understanding.md` §4. Mark G3 done.
179
+ **Step 2CLI-assisted** (optional): `maestro delegate` with `--role analyze` polish opportunities, micro-interactions, visual rhythm, delight moments
287
180
 
288
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-ui({slug}): DIVERGE 发散探索"`
181
+ **Step 3 — Consolidate**: Merge audit findings + divergent ideas prioritized list (severity x impact x effort).
182
+ Append evidence (phase: "diverge"). Update §4. Mark G3 done.
183
+ 📌 `git commit -m "odyssey-ui({slug}): DIVERGE — 发散探索"`
289
184
 
290
185
  ### A_FIX
291
- Skip if `--skip-fix`. Implement improvements prioritized by impact.
292
-
293
- 1. **穷尽修复**: Fix ALL findings/ideas by priority tier (critical→high→medium→low + high-impact ideas), not just top items. After each tier, re-review modified area — new findings append.
294
- 2. For each fix: implement append evidence.ndjson (phase: "fix")
295
- 3. **Normal**: ask_question per-fix confirmation. **`-y`**: auto-proceed, record `deferred`.
296
-
297
- 📌 **Auto-commit**: `git add -A && git commit -m "odyssey-ui({slug}): FIX — 优化实现"`
186
+ Skip if `--skip-fix`.
187
+ 1. **穷尽修复**: ALL findings/ideas by priority tier (critical→high→medium→low + high-impact ideas). After each tier, re-review — new findings append.
188
+ 2. Each fix evidence (phase: "fix")
189
+ 3. **Normal**: ask_question per-fix. **`-y`**: auto-proceed, record `deferred`.
190
+ 📌 `git commit -m "odyssey-ui({slug}): FIX 优化实现"`
298
191
 
299
192
  ### A_VERIFY
300
- Visual verification confirm improvements work in practice.
301
-
302
- 1. Run tests if applicable (lint, unit, visual regression)
303
- 2. **CLI-assisted visual review**:
304
- ```bash
305
- maestro delegate "PURPOSE: Verify UI improvements for: {target}
306
- TASK: Check visual correctness | Verify interaction states | Confirm accessibility | Test responsive behavior
307
- MODE: analysis
308
- CONTEXT: @{modified_files} | Improvements: {fix_summary}
309
- EXPECTED: JSON {verdict, verified_improvements, remaining_issues, regression_risk}
310
- " --role review --mode analysis
311
- ```
312
- Execute with `run_in_background: true`, then wait for callback (do NOT halt the Odyssey flow).
313
-
314
- 3. `needs_rework` → S_FIX. `verified` → mark G4 done, advance.
315
- 4. Update `understanding.md` §5. Write `session.json.confirmation`.
316
-
317
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-ui({slug}): VERIFY — 验证"`
193
+ 1. Run tests (lint, unit, visual regression)
194
+ 2. **CLI-assisted**: `maestro delegate` with `--role review` — visual correctness, interaction states, accessibility, responsive
195
+ 3. `needs_rework` S_FIX. `verified` mark G4 done. Update §5, write `confirmation`.
196
+ 📌 `git commit -m "odyssey-ui({slug}): VERIFY — 验证"`
318
197
 
319
198
  ### A_GENERALIZE
320
- Multi-layer pattern extraction from findings + improvements 4-agent scan cross-layer dedup.
321
-
322
- **Pattern extraction** from audit findings + diverge ideas (severity >= medium OR impact = high):
323
-
324
- | Layer | Method | Example |
325
- |-------|--------|---------|
326
- | Syntax | Regex → direct Grep | Missing `aria-label`, hardcoded px values, inline styles |
327
- | Semantic | Agent understands anti-pattern → scans | Inconsistent hover states, missing loading feedback |
328
- | Structural | File/module structure similarity | Same component type missing responsive treatment |
329
-
330
- Write `session.json.patterns[]`.
331
-
332
- **4-agent parallel scan** (single message):
333
-
334
- | Agent | Strategy | Scope |
335
- |-------|----------|-------|
336
- | Syntax grep | Grep CSS/style patterns matching found issues | Full project |
337
- | Semantic scan | Find components with same interaction pattern but missing states | Related modules |
338
- | Structural match | Find structurally similar components (same imports, layout) | Full project |
339
- | Historical grep | `git log -S "{pattern}"` for when similar UI patterns were introduced/fixed | Git history |
340
-
341
- **Cross-layer dedup**: Multi-layer hit → boost confidence. Single-layer → `needs_review`. Historical match on fixed code → `regression_risk`.
342
-
343
- **Iterative deepening**: Module with ≥3 hits → targeted deep scan (max 1 round).
344
-
345
- Update `understanding.md` §6 (per-pattern summary, cross-layer matrix). Write `session.json.generalization_stats`. Mark G5 done.
346
-
347
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-ui({slug}): GENERALIZE — 泛化扫描"`
199
+ base A_GENERALIZE 执行。Pattern 来源: audit findings + diverge ideas (severity >= medium OR impact = high)。Mark G5 done.
200
+ 📌 `git commit -m "odyssey-ui({slug}): GENERALIZE — 泛化扫描"`
348
201
 
349
202
  ### A_DISCOVER
350
- Classify each hit: `needs_treatment` / `low_risk` / `already_handled`.
351
- - `needs_treatment` + directly fixable **fix immediately** → back to S_FIX
352
- - `needs_treatment` + requires design direction decision → create issue (with fix suggestion)
353
- - `low_risk` → evaluate if a quick guard/improvement is feasible; if yes, fix it
354
- - `already_handled` → mark skip
355
-
356
- **Normal**: ask_question for routing ambiguity. **`-y`**: auto-fix what's fixable, create issue for rest.
357
- Append evidence (phase: "discovery" + "decision"). Update `understanding.md` §7. Mark G6 done.
358
-
359
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-ui({slug}): DISCOVER — 发现分类"`
203
+ base A_DISCOVER 执行。Mark G6 done.
204
+ 📌 `git commit -m "odyssey-ui({slug}): DISCOVER 发现分类"`
360
205
 
361
206
  ### A_RECORD
362
- 1. Finalize `understanding.md` §8: design learnings
363
- 2. Write learnings to understanding.md §8: Knowledge Persistence 表分类记录(临时),completion summary 列出建议的 `/spec-add` 命令
364
- 3. Pending decisions: **Normal** → ask_question. **`-y`** → skip, display deferred count
365
- 4. **Goal audit**: all `phase_goals[*].completion_confirmed` true `phase_goals_all_done = true`. Any false: **Normal** → ask_question (回退/跳过/接受) | **`-y`** → auto accept
366
- 5. Mark G7 done. `current_state = "COMPLETED"`. Emit completion summary:
207
+ 1. Finalize §8: Knowledge Persistence 表分类记录,completion summary 列出建议的 `/spec-add` 命令
208
+ 2. Pending decisions: **Normal** → ask_question. **`-y`** skip, show deferred count
209
+ 3. Goal audit: all confirmed → `phase_goals_all_done = true`. **Normal** → ask_question | **`-y`** → auto accept
210
+ 4. Mark G7 done. Emit completion summary:
367
211
  ```
368
212
  --- UI ODYSSEY COMPLETE ---
369
- Target: {target}
370
- Dimensions: {dimensions_audited}
371
- Findings: {C}C {H}H {M}M {L}L
372
- Diverge: {improvements} polish + {creative} delight ideas
373
- Fix: {fixed_count} applied, verified={yes|skipped}
374
- Patterns: {extracted} ({by_layer} distribution)
375
- Scan hits: {total} ({cross_layer} cross-layer confirmed)
376
- Issues: {N} created
377
- Decisions: {N} resolved, {M} pending, {K} deferred
378
- Learnings: {N} entries in understanding.md §8
379
- Self-iter: {N} quality gate rounds across {M} stages
380
- Goals: {done}/{total} ({skipped} skipped)
213
+ Target: {target} | Dimensions: {dimensions_audited}
214
+ Findings: {C}C {H}H {M}M {L}L | Diverge: {improvements} polish + {creative} delight
215
+ Fix: {fixed_count} applied, verified={yes|skipped}
216
+ Patterns: {extracted} ({by_layer}) | Scan hits: {total} ({cross_layer} cross-layer)
217
+ Issues: {N} | Decisions: {N} resolved, {M} pending, {K} deferred
218
+ Learnings: {N} entries | Self-iter: {N} rounds | Goals: {done}/{total} ({skipped} skipped)
381
219
  ---
382
220
  ```
383
-
384
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-ui({slug}): RECORD — 会话总结"`
221
+ 📌 `git commit -m "odyssey-ui({slug}): RECORD — 会话总结"`
385
222
 
386
223
  </actions>
387
224
 
388
225
  <appendix>
389
226
 
390
227
  ### Goal Prompt Template
391
- **⚠️ 时机守卫:仅在 A_INTAKE 完成后显示一次(session 创建后、开始 survey 前)。A_RECORD 完成时禁止重新显示。**
228
+ **⚠️ 仅在 A_INTAKE 完成后显示一次。A_RECORD 完成时禁止重新显示。**
392
229
 
393
230
  ```
394
- 📋 UI Odyssey 会话已创建。可随时复制以下 /goal 设定终止条件(执行过程中输入即可):
231
+ 📋 UI Odyssey 会话已创建。可随时复制以下 /goal 设定终止条件:
395
232
 
396
233
  /goal 完成以下目标:
397
234
  {for each G in phase_goals where status != "skipped":}
398
235
  - {G.id}: {G.goal} — 完成条件: {G.done_when}
399
236
  {end for}
400
- 穷尽迭代:直到 session.json 的 audit + diverge findings 均已处理(fix/issue/decision)
237
+ 穷尽迭代:直到 audit + diverge findings 均已处理(fix/issue/decision)
401
238
  且 phase_goals_all_done=true 才停。修复按 impact×severity 逐轮迭代。
402
239
  每轮修复后重审修改区域,新发现追加继续修。
403
240
  遇到 phase=decision 的 pending 必须 ask_question。不允许"只报告不处理"。
404
241
  ```
405
242
 
406
- 完成时仅输出 completion summary,不重复此提示。
407
-
408
243
  ### `-y` Auto-Confirm (5 decision points)
409
244
  | Decision Point | Normal | `-y` |
410
245
  |----------------|--------|------|
@@ -414,12 +249,7 @@ Goals: {done}/{total} ({skipped} skipped)
414
249
  | A_RECORD pending decisions | ask_question | skip, show deferred count |
415
250
  | A_RECORD goal audit | ask_question | auto accept |
416
251
 
417
- `deferred` items shown as "待决策" in completion summary; recoverable via `-c`.
418
-
419
- ### Phase Goal Lifecycle
420
- `pending → done (confirmed=true)` normal | `pending → skipped (confirmed=true)` flags/manual | `pending → failed (confirmed=false)` exception
421
-
422
- `phase_goals_all_done = true` only when ALL goals have `completion_confirmed == true`.
252
+ `deferred` "待决策" in completion summary; recoverable via `-c`.
423
253
 
424
254
  </appendix>
425
255
 
@@ -430,29 +260,16 @@ Goals: {done}/{total} ({skipped} skipped)
430
260
  |------|----------|-----------|----------|
431
261
  | E001 | error | No target specified | Provide target |
432
262
  | E002 | error | Target path not found | Check path |
433
- | E003 | error | Resume but no session found | Start new session |
434
263
  | W001 | warning | No design system detected | Proceed with defaults |
435
264
  | W002 | warning | Some dimension agents failed | Partial coverage |
436
- | W003 | warning | Generalization 0 hits | Skip discovery |
437
- | W004 | warning | Delegate parse failed | Use raw output |
438
265
  </error_codes>
439
266
 
440
267
  <success_criteria>
441
- - [ ] Target resolved and session created
442
- - [ ] Design system inventory captured in survey
443
- - [ ] All dimensions audited (6 parallel agents) with structured findings
444
- - [ ] Severity matrix produced
445
- - [ ] Divergent exploration: polish + delight ideas generated
268
+ - [ ] 6-dimension audit with severity matrix + divergent exploration (polish + delight)
446
269
  - [ ] Improvements implemented and verified (unless --skip-fix)
447
- - [ ] Multi-layer generalization scan + cross-layer dedup (unless --skip-generalize)
448
- - [ ] Quality Gate self-iteration triggered when insufficient
449
- - [ ] Discoveries classified and routed
450
- - [ ] **Every unfixed finding has individual classification and reason** — blanket "pre-existing" labels are forbidden
451
- - [ ] understanding.md §8 finalized with design learnings
452
- - [ ] phase_goals G1-G7 tracked and audited
453
- - [ ] Goal Prompt displayed once
454
- - [ ] `-y`: no blocking prompts, deferred counted
455
- - [ ] Session resumable via -c
270
+ - [ ] Multi-layer generalization + discoveries classified (unless --skip-generalize)
271
+ - [ ] Every unfixed finding has individual classification and reason
272
+ - [ ] understanding.md §8 finalized; phase_goals G1-G7 tracked; `-y` no blocking prompts
456
273
  </success_criteria>
457
274
 
458
275
  <next_step_routing>
@@ -187,7 +187,9 @@ Write enriched args + source_artifact_ref back to status.json.
187
187
  - 退出码 2 → 交给 S_LOCATE
188
188
  - 退出码 3 → active_step_index 已被占用
189
189
  - 退出码 1 → pause session
190
- 2. **Goal context pre-injection** — 若 A_RESOLVE_ARGS 产出了 `goal_snippet`(step.goal_ref 非空),在 ralph next stdout prompt **顶部前置**以下 block,使执行命令感知当前子目标和执行约束:
190
+ 2. **Goal context pre-injection**:
191
+ - GUARD: `ralph_protocol_version >= "2"` → skip(session_anchor 已含 goal context)
192
+ - WHEN `ralph_protocol_version < "2"` 或缺失 AND `step.goal_ref` 非空 → 在 stdout 顶部前置:
191
193
  ```
192
194
  <goal_context>
193
195
  Sub-goal: {goal.id} — {goal.goal}
@@ -197,13 +199,19 @@ Write enriched args + source_artifact_ref back to status.json.
197
199
  Execution criteria: {session.execution_criteria joined by '; '}
198
200
  </goal_context>
199
201
  ```
200
- goal_snippet 时跳过此步。goal_context block 不替换 ralph next stdout 内容,仅在其前方拼接。
201
- 3. **Inline execution** — 按 stdout(含 goal_context 前置)执行;deferred_reading 按需 Read
202
+ 3. **Inline execution** stdout 执行;deferred_reading 按需 Read
202
203
  4. **Complete**:
203
- - `Bash("maestro ralph complete N --status DONE [--evidence <path>]")`
204
- - `Bash("maestro ralph complete N --status DONE_WITH_CONCERNS --concerns \"...\"")`
204
+ - `Bash("maestro ralph complete N --status DONE --summary \"...\" [--evidence <path>] [--decisions \"...\"] [--caveats \"...\"] [--deferred \"...\"]")`
205
+ - `Bash("maestro ralph complete N --status DONE_WITH_CONCERNS --summary \"...\" --concerns \"...\"")`
205
206
  - `Bash("maestro ralph retry N")`
206
207
  - `Bash("maestro ralph complete N --status BLOCKED --reason \"...\"")`
208
+
209
+ | Param | 必填 | 格式 | 示例 |
210
+ |-------|------|------|------|
211
+ | `--summary` | MUST | 动词开头,≤100 字 | `"实现搜索 API 分页逻辑,新增 3 端点"` |
212
+ | `--decisions` | SHOULD(可多次) | 每条一个决策 | `"选择 ELK 布局而非 dagre"` |
213
+ | `--caveats` | SHOULD | 后续注意事项 | `"X 模块 e2e 暂未覆盖新端点"` |
214
+ | `--deferred` | SHOULD(可多次) | 推迟工作 | `"性能优化留到 review 后"` |
207
215
  5. **Propagate context signals** — 关键信号 (`PHASE: N` / `scratch_dir: path` / `BLP-xxx`) 写入 `status.json.context`
208
216
 
209
217
  完成后 S_LOCATE 触发 `Skill({ skill: "maestro-ralph-execute" })` 自调用。
@@ -282,8 +290,11 @@ Display: `[{index}/{total}] ✗ {step.skill} 失败,会话已暂停。/maestro
282
290
  - [ ] 自调用持续到全部 completion_confirmed 或 paused
283
291
  - [ ] --from auto-injection:phase-level plan step 运行时从 state.json 查找同 phase+milestone 最新 completed analyze artifact → 注入 `--from analyze:{id}`,写 `source_artifact_ref`
284
292
  - [ ] --from auto-injection:phase-level execute step 运行时查找同 phase+milestone 最新 completed plan artifact → 注入 `--dir`,写 `source_artifact_ref`
285
- - [ ] Goal context injection:step.goal_ref 非空时从 task_decomposition 提取 goal_snippet,A_EXEC_STEP ralph next stdout 顶部前置 `<goal_context>` block
293
+ - [ ] Goal context injection:`ralph_protocol_version < "2"` 前置 `<goal_context>` block;`>= "2"` skip(session_anchor 覆盖)
286
294
  - [ ] Goal context 包含 sub-goal description、done_when、boundary、evidence、execution_criteria
287
295
  - [ ] 已有 `--from` 或 `--dir` 的 step 不被 auto-injection 覆盖
296
+ - [ ] `--summary` 在 DONE/DONE_WITH_CONCERNS 时为 MUST(动词开头,≤100 字)
297
+ - [ ] `--decisions`/`--caveats`/`--deferred` 为 SHOULD;存在关键决策/注意事项/推迟工作时填写
298
+ - [ ] 结构化总结由 CLI 写入 status.json,session_anchor 自动聚合注入下游 step
288
299
 
289
300
  </appendix>