maestro-flow 0.5.38 → 0.5.40

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