maestro-flow 0.5.45 → 0.5.46

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 (116) hide show
  1. package/.agents/agents/ralph-executor.md +51 -6
  2. package/.agents/skills/maestro-ralph-v2/SKILL.md +124 -61
  3. package/.agents/skills/odyssey-debug/SKILL.md +338 -253
  4. package/.agents/skills/odyssey-improve/SKILL.md +367 -281
  5. package/.agents/skills/odyssey-planex/SKILL.md +490 -420
  6. package/.agents/skills/odyssey-review-test-fix/SKILL.md +336 -251
  7. package/.agents/skills/odyssey-ui/SKILL.md +332 -247
  8. package/.agy/agents/ralph-executor.md +53 -6
  9. package/.agy/skills/maestro-ralph-v2/SKILL.md +123 -61
  10. package/.agy/skills/odyssey-debug/SKILL.md +338 -253
  11. package/.agy/skills/odyssey-improve/SKILL.md +367 -281
  12. package/.agy/skills/odyssey-planex/SKILL.md +490 -420
  13. package/.agy/skills/odyssey-review-test-fix/SKILL.md +336 -251
  14. package/.agy/skills/odyssey-ui/SKILL.md +332 -247
  15. package/.claude/agents/ralph-executor.md +51 -6
  16. package/.claude/commands/maestro-ralph-v2.md +124 -61
  17. package/.claude/commands/odyssey-debug.md +352 -267
  18. package/.claude/commands/odyssey-improve.md +381 -295
  19. package/.claude/commands/odyssey-planex.md +504 -434
  20. package/.claude/commands/odyssey-review-test-fix.md +350 -265
  21. package/.claude/commands/odyssey-ui.md +346 -261
  22. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js +3 -3
  23. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js.map +1 -1
  24. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +4 -4
  25. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
  26. package/dashboard/dist-server/src/graph/kg/db/queries.d.ts +6 -0
  27. package/dashboard/dist-server/src/graph/kg/db/queries.js +141 -19
  28. package/dashboard/dist-server/src/graph/kg/db/queries.js.map +1 -1
  29. package/dashboard/dist-server/src/graph/kg/extraction/code/svelte-extractor.js +1 -1
  30. package/dashboard/dist-server/src/graph/kg/extraction/code/svelte-extractor.js.map +1 -1
  31. package/dashboard/dist-server/src/graph/kg/extraction/code/tree-sitter.js +2 -2
  32. package/dashboard/dist-server/src/graph/kg/extraction/code/tree-sitter.js.map +1 -1
  33. package/dashboard/dist-server/src/graph/kg/extraction/code/vue-extractor.js +1 -1
  34. package/dashboard/dist-server/src/graph/kg/extraction/code/vue-extractor.js.map +1 -1
  35. package/dashboard/dist-server/src/graph/kg/extraction/code/wasm-stability.js +1 -1
  36. package/dashboard/dist-server/src/graph/kg/extraction/code/wasm-stability.js.map +1 -1
  37. package/dashboard/dist-server/src/graph/kg/extraction/orchestrator.js +2 -2
  38. package/dashboard/dist-server/src/graph/kg/extraction/orchestrator.js.map +1 -1
  39. package/dashboard/dist-server/src/graph/kg/surface/hook-injector.js +1 -1
  40. package/dashboard/dist-server/src/graph/kg/surface/hook-injector.js.map +1 -1
  41. package/dashboard/dist-server/src/hooks/keyword-spec-injector.js +35 -0
  42. package/dashboard/dist-server/src/hooks/keyword-spec-injector.js.map +1 -1
  43. package/dashboard/dist-server/src/hooks/spec-analytics.d.ts +1 -0
  44. package/dashboard/dist-server/src/hooks/spec-analytics.js.map +1 -1
  45. package/dashboard/dist-server/src/hooks/wiki-search-bridge.d.ts +32 -0
  46. package/dashboard/dist-server/src/hooks/wiki-search-bridge.js +71 -0
  47. package/dashboard/dist-server/src/hooks/wiki-search-bridge.js.map +1 -0
  48. package/dist/src/agents/api-explore/agent-loop.d.ts +15 -2
  49. package/dist/src/agents/api-explore/agent-loop.d.ts.map +1 -1
  50. package/dist/src/agents/api-explore/agent-loop.js +6 -5
  51. package/dist/src/agents/api-explore/agent-loop.js.map +1 -1
  52. package/dist/src/agents/api-explore/config.d.ts +56 -0
  53. package/dist/src/agents/api-explore/config.d.ts.map +1 -1
  54. package/dist/src/agents/api-explore/config.js +34 -0
  55. package/dist/src/agents/api-explore/config.js.map +1 -1
  56. package/dist/src/agents/api-explore/llm.d.ts +5 -1
  57. package/dist/src/agents/api-explore/llm.d.ts.map +1 -1
  58. package/dist/src/agents/api-explore/llm.js +10 -8
  59. package/dist/src/agents/api-explore/llm.js.map +1 -1
  60. package/dist/src/agents/api-explore/moa-cache.d.ts +12 -0
  61. package/dist/src/agents/api-explore/moa-cache.d.ts.map +1 -0
  62. package/dist/src/agents/api-explore/moa-cache.js +50 -0
  63. package/dist/src/agents/api-explore/moa-cache.js.map +1 -0
  64. package/dist/src/agents/api-explore/moa-loop.d.ts +49 -0
  65. package/dist/src/agents/api-explore/moa-loop.d.ts.map +1 -0
  66. package/dist/src/agents/api-explore/moa-loop.js +43 -0
  67. package/dist/src/agents/api-explore/moa-loop.js.map +1 -0
  68. package/dist/src/agents/api-explore/moa-pipeline.d.ts +43 -0
  69. package/dist/src/agents/api-explore/moa-pipeline.d.ts.map +1 -0
  70. package/dist/src/agents/api-explore/moa-pipeline.js +276 -0
  71. package/dist/src/agents/api-explore/moa-pipeline.js.map +1 -0
  72. package/dist/src/agents/api-explore/runner.d.ts +3 -0
  73. package/dist/src/agents/api-explore/runner.d.ts.map +1 -1
  74. package/dist/src/agents/api-explore/runner.js +24 -7
  75. package/dist/src/agents/api-explore/runner.js.map +1 -1
  76. package/dist/src/agents/api-explore/session.d.ts +15 -0
  77. package/dist/src/agents/api-explore/session.d.ts.map +1 -1
  78. package/dist/src/agents/api-explore/session.js.map +1 -1
  79. package/dist/src/cli.js +1 -0
  80. package/dist/src/cli.js.map +1 -1
  81. package/dist/src/commands/explore.d.ts.map +1 -1
  82. package/dist/src/commands/explore.js +16 -1
  83. package/dist/src/commands/explore.js.map +1 -1
  84. package/dist/src/commands/moa.d.ts +3 -0
  85. package/dist/src/commands/moa.d.ts.map +1 -0
  86. package/dist/src/commands/moa.js +202 -0
  87. package/dist/src/commands/moa.js.map +1 -0
  88. package/dist/src/graph/kg/db/queries.d.ts +6 -0
  89. package/dist/src/graph/kg/db/queries.d.ts.map +1 -1
  90. package/dist/src/graph/kg/db/queries.js +141 -19
  91. package/dist/src/graph/kg/db/queries.js.map +1 -1
  92. package/dist/src/graph/kg/extraction/code/svelte-extractor.js +1 -1
  93. package/dist/src/graph/kg/extraction/code/svelte-extractor.js.map +1 -1
  94. package/dist/src/graph/kg/extraction/code/tree-sitter.js +2 -2
  95. package/dist/src/graph/kg/extraction/code/tree-sitter.js.map +1 -1
  96. package/dist/src/graph/kg/extraction/code/vue-extractor.js +1 -1
  97. package/dist/src/graph/kg/extraction/code/vue-extractor.js.map +1 -1
  98. package/dist/src/graph/kg/extraction/code/wasm-stability.js +1 -1
  99. package/dist/src/graph/kg/extraction/code/wasm-stability.js.map +1 -1
  100. package/dist/src/graph/kg/extraction/orchestrator.js +2 -2
  101. package/dist/src/graph/kg/extraction/orchestrator.js.map +1 -1
  102. package/dist/src/graph/kg/surface/hook-injector.js +1 -1
  103. package/dist/src/graph/kg/surface/hook-injector.js.map +1 -1
  104. package/dist/src/hooks/keyword-spec-injector.d.ts.map +1 -1
  105. package/dist/src/hooks/keyword-spec-injector.js +35 -0
  106. package/dist/src/hooks/keyword-spec-injector.js.map +1 -1
  107. package/dist/src/hooks/spec-analytics.d.ts +1 -0
  108. package/dist/src/hooks/spec-analytics.d.ts.map +1 -1
  109. package/dist/src/hooks/spec-analytics.js.map +1 -1
  110. package/dist/src/hooks/wiki-search-bridge.d.ts +33 -0
  111. package/dist/src/hooks/wiki-search-bridge.d.ts.map +1 -0
  112. package/dist/src/hooks/wiki-search-bridge.js +71 -0
  113. package/dist/src/hooks/wiki-search-bridge.js.map +1 -0
  114. package/dist/src/utils/update-notices.js +12 -0
  115. package/dist/src/utils/update-notices.js.map +1 -1
  116. package/package.json +1 -1
@@ -1,261 +1,346 @@
1
- ---
2
- name: odyssey-ui
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>] [--fix-threshold <severity>] [--skip-fix] [--skip-generalize] [--auto] [-y] [-c] [--heartbeat]"
5
- allowed-tools:
6
- - Read
7
- - Write
8
- - Edit
9
- - Bash
10
- - Glob
11
- - Grep
12
- - Agent
13
- - AskUserQuestion
14
- ---
15
- <base>@~/.maestro/workflows/odyssey-base.md</base>
16
-
17
- <purpose>
18
- survey → 6-dimension audit → divergent exploration → fix → verify → generalize → discover → persist.
19
- Exhaustive iteration until all findings addressed or deferred.
20
- </purpose>
21
-
22
- <boundary>
23
- **In scope:** Target component/page visual experience optimization — audit 6 dimensions, divergent exploration, fix, generalize to sibling components.
24
- **Out of scope:** Backend/data/API → `/odyssey-planex` | Deep bug investigation → `/odyssey-debug` | Code quality review → `/odyssey-review-test-fix`
25
-
26
- **Decision gate** — ONLY these qualify as decisions:
27
- - Brand/style direction requiring human creative judgment
28
- - Layout restructuring that changes user flow significantly
29
- - Requires new design tokens or breaking component API
30
- </boundary>
31
-
32
- <context>
33
- $ARGUMENTS
34
-
35
- **Target resolution:** Component path → audit component | Page/route → audit page | `staged`/`HEAD` → diff UI changes | Feature area → resolve to components/pages
36
-
37
- **Flags:** `--dimensions <list>` dimension subset | `--fix-threshold <severity>` | `--skip-fix` audit+diverge only | `--skip-generalize` skip generalize+discover | `--auto` no delegate confirmation | `-y` auto-confirm | `-c` resume | `--heartbeat` /loop heartbeat
38
-
39
- **Session**: `.workflow/scratch/{YYYYMMDD}-ui-odyssey-{slug}/`
40
- **Output**: `session.json` | `evidence.ndjson` | `understanding.md`
41
-
42
- **session.json — ui-specific fields:**
43
- ```json
44
- { "target": "", "dimensions": [],
45
- "audit_result": { "dimensions_audited": 0, "finding_count": 0, "severity_distribution": {} },
46
- "diverge_result": { "improvements_proposed": 0, "creative_ideas": 0 },
47
- "patterns": [], "confirmation": null, "generalization_stats": null }
48
- ```
49
-
50
- **evidence.ndjson phases:** `survey|audit|diverge|fix|discovery|decision|self-iteration`
51
-
52
- **phase_goals[]:**
53
-
54
- | ID | Goal | Phase | skip_when |
55
- |----|------|-------|-----------|
56
- | G1 | Survey completed | S_SURVEY | — |
57
- | G2 | Audit completed | S_AUDIT | — |
58
- | G3 | Divergent exploration done | S_DIVERGE | — |
59
- | G4 | Zero remaining: all findings/ideas fixed and verified | S_VERIFY | skip_fix |
60
- | G5 | Pattern generalized | S_GENERALIZE | skip_generalize |
61
- | G6 | Discoveries triaged | S_DISCOVER | skip_generalize |
62
- | G7 | Learnings persisted | S_RECORD | — |
63
-
64
- **understanding.md — 8 sections:**
65
- 1. Target & Design Context ← S_INTAKE | 2. Survey ← S_SURVEY | 3. Audit ← S_AUDIT
66
- 4. Diverge ← S_DIVERGE | 5. Verify ← S_VERIFY | 6. Generalize ← S_GENERALIZE
67
- 7. Discover ← S_DISCOVER | 8. Learnings ← S_RECORD
68
-
69
- **Knowledge Persistence categories (section 8):**
70
-
71
- | Category | Content | Follow-up |
72
- |----------|---------|-----------|
73
- | Design pattern | Component pattern + applicable scenarios + token references | `/spec-add ui` |
74
- | Interaction spec | State definitions + transition rules + feedback patterns | `/spec-add ui` |
75
- | Accessibility rule | WCAG requirement + implementation approach | `/spec-add ui` |
76
- | Reusable generalization pattern | Pattern signature + application scope | `/spec-add coding` |
77
- </context>
78
-
79
- <invariants>
80
- 1-5 in base. UI-specific:
81
- 6. **Browser is truth** — verify in real rendering, not just code review
82
- 7. **Diverge before converge** — explore creatively first, then implement methodically
83
- </invariants>
84
-
85
- <self_iteration>
86
- Applies to: **S_SURVEY, S_AUDIT, S_DIVERGE, S_GENERALIZE**. Logic in base.
87
- </self_iteration>
88
-
89
- <state_machine>
90
-
91
- <states>
92
- S_INTAKE → S_SURVEY → S_AUDIT → S_DIVERGE → S_FIX → S_VERIFY → S_GENERALIZE → S_DISCOVER → S_RECORD → END
93
- </states>
94
-
95
- <transitions>
96
- S_INTAKE → S_INTAKE : -c + session found → A_RESUME
97
- S_INTAKE → S_SURVEY : target resolvedA_INTAKE
98
- S_INTAKE → S_INTAKE : no target → AskUserQuestion
99
-
100
- S_SURVEY → S_AUDIT : complete
101
- S_AUDIT S_DIVERGE : complete
102
-
103
- S_DIVERGE → S_FIX : !skip_fix AND actionable findings/ideas
104
- S_DIVERGE → S_GENERALIZE : (skip_fix OR no actionable) AND !skip_generalize
105
- S_DIVERGE → S_RECORD : (skip_fix OR no actionable) AND skip_generalize
106
-
107
- S_FIX → S_VERIFY : fix implemented
108
- S_VERIFY S_GENERALIZE : verified, !skip_generalize
109
- S_VERIFY → S_RECORD : verified, skip_generalize
110
- S_VERIFY → S_FIX : needs_rework
111
-
112
- S_GENERALIZE → S_DISCOVER : similar code found
113
- S_GENERALIZE → S_RECORD : no similar code
114
-
115
- S_DISCOVER → S_AUDIT : new component to audit → cross_phase_loops++
116
- S_DISCOVER → S_FIX : fixable sibling, !skip_fix → cross_phase_loops++
117
- S_DISCOVER → S_RECORD : remaining_actionable == 0 OR loops >= max_loops log per-item reasons
118
-
119
- S_RECORD → END : complete
120
- </transitions>
121
-
122
- <actions>
123
-
124
- ### A_INTAKE
125
- 1. Parse arguments: target, flags, `--dimensions` subset
126
- 2. Generate slug, create SESSION_DIR
127
- 3. `maestro search` + Glob prior sessions + ARCHITECTURE.md + spec load ui/coding
128
- 4. Derive `phase_goals[]` from flags
129
- 5. Write `session.json` + `understanding.md` section 1, emit Goal Prompt
130
-
131
- Commit: `"odyssey-ui({slug}): INTAKE — parse target and load context"`
132
-
133
- ### A_RESUME
134
- Glob latest session → read `session.json` → jump to `current_state`.
135
-
136
- ### A_SURVEY
137
- 1. **Design system inventory**: Scan for design tokens, CSS variables, theme imports
138
- 2. **Current state analysis**: Styling patterns, layout strategy, component hierarchy
139
- 3. **CLI-assisted**: `maestro delegate --role analyze --mode analysis` survey tokens, spacing, typography, hierarchy, consistency
140
- 4. Append evidence phase=survey. Update section 2. Mark G1.
141
-
142
- Commit: `"odyssey-ui({slug}): SURVEY — design token inventory"`
143
-
144
- ### A_AUDIT
145
- Spawn 6 parallel Agents (one per dimension, or `--dimensions` subset):
146
-
147
- | Dimension | Focus |
148
- |-----------|-------|
149
- | visual_hierarchy | Spacing, typography scale, color contrast, alignment, whitespace, visual weight |
150
- | interaction_states | Hover, focus, active, disabled, loading, error, empty, selected states |
151
- | accessibility | WCAG AA contrast, focus management, aria labels, keyboard nav, screen reader |
152
- | responsiveness | Breakpoints, overflow, touch targets, fluid typography, container queries |
153
- | micro_interactions | Transitions, animations, feedback indicators, loading states, progress |
154
- | edge_cases | Long text truncation, empty data, error states, extreme values, i18n, RTL |
155
-
156
- Each returns `[{title, severity, file, line, description, suggestion, dimension}]`.
157
- Merge evidence phase=audit. Write `audit_result`. Update section 3 with severity matrix. Mark G2.
158
-
159
- Commit: `"odyssey-ui({slug}): AUDIT — 6-dimension review"`
160
-
161
- ### A_DIVERGE
162
- Goes beyond defect fixing — "what would make this delightful?"
163
-
164
- **Step 1 — 2 parallel Agents:**
165
- - **Polish Agent**: Shadows, borders, transitions, hover states, feedback, empty states, skeleton loading, scroll behavior
166
- - **Delight Agent**: Motion design, progressive disclosure, smart defaults, contextual hints, celebratory feedback, personality in copy
167
-
168
- Each returns `[{idea, category (polish|delight), impact, effort, description, inspiration}]`
169
-
170
- **Step 2 — CLI-assisted**: `maestro delegate --role analyze --mode analysis` — polish opportunities, micro-interactions, visual rhythm, delight moments
171
-
172
- **Step 3 — Consolidate**: Merge audit findings + divergent ideas → prioritized list (severity x impact x effort).
173
- Append evidence phase=diverge. Update section 4. Mark G3.
174
-
175
- Commit: `"odyssey-ui({slug}): DIVERGE — creative exploration"`
176
-
177
- ### A_FIX
178
- Skip if `--skip-fix`.
179
- 1. **Exhaustive fix**: ALL findings/ideas by priority tier (critical → high → medium → low + high-impact ideas). After each tier, re-review — new findings append.
180
- 2. Each fix → evidence phase=fix
181
- 3. Normal: AskUserQuestion per-fix | `-y`: auto-proceed, record `deferred`
182
-
183
- Commit: `"odyssey-ui({slug}): FIX — implement improvements"`
184
-
185
- ### A_VERIFY
186
- 1. Run tests (lint, unit, visual regression)
187
- 2. `maestro delegate --role review --mode analysis` — visual correctness, interaction states, accessibility, responsive
188
- 3. `needs_rework` S_FIX. `verified` mark G4. Update section 5, write `confirmation`.
189
-
190
- Commit: `"odyssey-ui({slug}): VERIFY — visual verification"`
191
-
192
- ### A_GENERALIZE, A_DISCOVER, A_RECORD
193
- Base shared_actions. UI overrides:
194
- - **A_GENERALIZE** pattern source: audit findings + diverge ideas (severity >= medium OR impact = high)
195
- - **A_RECORD** learnings per Knowledge Persistence table
196
-
197
- **Completion summary:**
198
- ```
199
- --- UI ODYSSEY COMPLETE ---
200
- Target: {target} | Dimensions: {dimensions_audited}
201
- Findings: {C}C {H}H {M}M {L}L | Diverge: {improvements} polish + {creative} delight
202
- Fix: {fixed_count} applied, verified={yes|skipped}
203
- Patterns: {extracted} ({by_layer})
204
- Scan hits: {total} ({cross_layer} cross-layer)
205
- Issues: {N} created
206
- Decisions: {N} resolved, {M} pending, {K} deferred
207
- Learnings: {N} persisted
208
- Self-iter: {N} rounds
209
- Goals: {done}/{total} ({skipped} skipped)
210
- ---
211
- ```
212
-
213
- </actions>
214
-
215
- <appendix>
216
-
217
- ### `-y` ui-specific points
218
-
219
- | Decision Point | Normal | `-y` |
220
- |---------------|--------|------|
221
- | A_FIX improvement confirmation | AskUserQuestion | auto-proceed, deferred |
222
-
223
- ### Goal Prompt convergence rules
224
-
225
- ```
226
- Stop when audit + diverge findings all addressed (fix/issue/decision),
227
- phase_goals_all_done=true. Fix by impact x severity per tier.
228
- Re-review after each tier — new findings append and continue.
229
- Pending decisions must AskUserQuestion no self-resolve.
230
- ```
231
-
232
- </appendix>
233
-
234
- </state_machine>
235
-
236
- <error_codes>
237
- | Code | Severity | Condition | Recovery |
238
- |------|----------|-----------|----------|
239
- | E001 | error | No target specified | Provide target |
240
- | E002 | error | Target path not found | Check path |
241
- | W001 | warning | No design system detected | Proceed with defaults |
242
- | W002 | warning | Some dimension agents failed | Partial coverage |
243
- </error_codes>
244
-
245
- <success_criteria>
246
- - [ ] 6-dimension audit with severity matrix + divergent exploration (polish + delight)
247
- - [ ] Improvements implemented and verified (unless --skip-fix)
248
- - [ ] Multi-layer generalization + discoveries classified (unless --skip-generalize)
249
- - [ ] Every unfixed finding has individual classification and reason
250
- - [ ] understanding.md section 8 finalized; phase_goals G1-G7 tracked; `-y` no blocking prompts
251
- </success_criteria>
252
-
253
- <next_step_routing>
254
- | Condition | Next |
255
- |-----------|------|
256
- | Finding needs deeper debug | `/odyssey-debug "<finding>"` |
257
- | Issues from discoveries | `/manage-issue list --source ui-odyssey` |
258
- | Design pattern to document | `/spec-add ui "..."` |
259
- | Full review of changes | `/odyssey-review-test-fix <changed-files>` |
260
- | Sibling components to polish | `/odyssey-ui "<sibling>"` |
261
- </next_step_routing>
1
+ ---
2
+ name: odyssey-ui
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>] [--fix-threshold <severity>] [--skip-fix] [--skip-generalize] [--auto] [-y] [-c] [--heartbeat]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ - Agent
13
+ - AskUserQuestion
14
+ ---
15
+ <base>@~/.maestro/workflows/odyssey-base.md</base>
16
+
17
+ <purpose>
18
+ survey → 6-dimension audit → divergent exploration → fix → verify → generalize → discover → persist.
19
+ Exhaustive iteration until all findings addressed or deferred.
20
+ </purpose>
21
+
22
+ <boundary>
23
+ **In scope:** Target component/page visual experience optimization — audit 6 dimensions, divergent exploration, fix, generalize to sibling components.
24
+ **Out of scope:** Backend/data/API → `/odyssey-planex` | Deep bug investigation → `/odyssey-debug` | Code quality review → `/odyssey-review-test-fix`
25
+
26
+ **Decision gate** — ONLY these qualify as decisions:
27
+ - Brand/style direction requiring human creative judgment
28
+ - Layout restructuring that changes user flow significantly
29
+ - Requires new design tokens or breaking component API
30
+ </boundary>
31
+
32
+ <context>
33
+ $ARGUMENTS
34
+
35
+ **Target resolution:** Component path → audit component | Page/route → audit page | `staged`/`HEAD` → diff UI changes | Feature area → resolve to components/pages
36
+
37
+ **Flags:** `--dimensions <list>` dimension subset | `--fix-threshold <severity>` | `--skip-fix` audit+diverge only | `--skip-generalize` skip generalize+discover | `--auto` no delegate confirmation | `-y` auto-confirm | `-c` resume | `--heartbeat` /loop heartbeat
38
+
39
+ **Session**: `.workflow/scratch/{YYYYMMDD}-ui-odyssey-{slug}/`
40
+ **Output**: `session.json` | `evidence.ndjson` | `understanding.md`
41
+
42
+ **session.json — ui-specific fields:**
43
+ ```json
44
+ { "target": "", "dimensions": [],
45
+ "audit_result": { "dimensions_audited": 0, "finding_count": 0, "severity_distribution": {} },
46
+ "diverge_result": { "improvements_proposed": 0, "creative_ideas": 0 },
47
+ "patterns": [], "confirmation": null, "generalization_stats": null }
48
+ ```
49
+
50
+ **evidence.ndjson phases:** `survey|audit|diverge|fix|discovery|decision|self-iteration`
51
+
52
+ **phase_goals[]:**
53
+
54
+ | ID | Goal | Phase | skip_when |
55
+ |----|------|-------|-----------|
56
+ | G1 | Survey completed | S_SURVEY | — |
57
+ | G2 | Audit completed | S_AUDIT | — |
58
+ | G3 | Divergent exploration done | S_DIVERGE | — |
59
+ | G4 | Zero remaining: all findings/ideas fixed and verified | S_VERIFY | skip_fix |
60
+ | G5 | Pattern generalized | S_GENERALIZE | skip_generalize |
61
+ | G6 | Discoveries triaged | S_DISCOVER | skip_generalize |
62
+ | G7 | Learnings persisted | S_RECORD | — |
63
+
64
+ **understanding.md — 8 sections:**
65
+ 1. Target & Design Context ← S_INTAKE | 2. Survey ← S_SURVEY | 3. Audit ← S_AUDIT
66
+ 4. Diverge ← S_DIVERGE | 5. Verify ← S_VERIFY | 6. Generalize ← S_GENERALIZE
67
+ 7. Discover ← S_DISCOVER | 8. Learnings ← S_RECORD
68
+
69
+ **Knowledge Persistence categories (section 8):**
70
+
71
+ | Category | Content | Follow-up |
72
+ |----------|---------|-----------|
73
+ | Design pattern | Component pattern + applicable scenarios + token references | `/spec-add ui` |
74
+ | Interaction spec | State definitions + transition rules + feedback patterns | `/spec-add ui` |
75
+ | Accessibility rule | WCAG requirement + implementation approach | `/spec-add ui` |
76
+ | Reusable generalization pattern | Pattern signature + application scope | `/spec-add coding` |
77
+ </context>
78
+
79
+ <invariants>
80
+ 1-5 in base. UI-specific:
81
+ 6. **Browser is truth** — verify in real rendering, not just code review
82
+ 7. **Diverge before converge** — explore creatively first, then implement methodically
83
+ 8. **Generalize is mandatory** — S_GENERALIZE and S_DISCOVER execute unless `skip_generalize == true`. "All verified" or context pressure are NOT valid reasons to skip. The phase itself determines whether patterns exist.
84
+ </invariants>
85
+
86
+ <self_iteration>
87
+ Applies to: **S_SURVEY, S_AUDIT, S_DIVERGE, S_GENERALIZE**. Logic in base.
88
+ </self_iteration>
89
+
90
+ <state_machine>
91
+
92
+ <states>
93
+ S_INTAKE → S_SURVEY → S_AUDIT → S_DIVERGE → S_FIX → S_VERIFY → S_GENERALIZE → S_DISCOVER → S_RECORD → END
94
+ </states>
95
+
96
+ <transitions>
97
+ S_INTAKE → S_INTAKE : -c + session found A_RESUME
98
+ S_INTAKE → S_SURVEY : target resolved A_INTAKE
99
+ S_INTAKE → S_INTAKE : no target → AskUserQuestion
100
+
101
+ S_SURVEY S_AUDIT : complete
102
+ S_AUDIT → S_DIVERGE : complete
103
+
104
+ S_DIVERGE → S_FIX : !skip_fix AND actionable findings/ideas
105
+ S_DIVERGE → S_GENERALIZE : (skip_fix OR no actionable) AND !skip_generalize
106
+ S_DIVERGE → S_RECORD : (skip_fix OR no actionable) AND skip_generalize
107
+
108
+ S_FIX S_VERIFY : fix implemented
109
+ S_VERIFY → S_GENERALIZE : verified, !skip_generalize
110
+ S_VERIFY → S_RECORD : verified, skip_generalize
111
+ S_VERIFY → S_FIX : needs_rework
112
+
113
+ S_GENERALIZE → S_DISCOVER : similar code found
114
+ S_GENERALIZE → S_RECORD : all 3 layers scanned with evidence, total_hits == 0
115
+
116
+ S_DISCOVER → S_AUDIT : new component to audit → cross_phase_loops++
117
+ S_DISCOVER → S_FIX : fixable sibling, !skip_fixcross_phase_loops++
118
+ S_DISCOVER → S_RECORD : remaining_actionable == 0 OR loops >= max_loops → log per-item reasons
119
+
120
+ S_RECORD → END : complete
121
+ </transitions>
122
+
123
+ <actions>
124
+
125
+ ### A_INTAKE
126
+ 1. Parse arguments: target, flags, `--dimensions` subset
127
+ 2. Generate slug, create SESSION_DIR
128
+ 3. `maestro search` + Glob prior sessions + ARCHITECTURE.md + spec load ui/coding
129
+ 4. Derive `phase_goals[]` from flags
130
+ 5. Write `session.json` + `understanding.md` section 1, emit Goal Prompt
131
+
132
+ Commit: `"odyssey-ui({slug}): INTAKE — parse target and load context"`
133
+
134
+ ### A_RESUME
135
+ Glob latest session → read `session.json` → jump to `current_state`.
136
+
137
+ ### A_SURVEY
138
+ 1. **Design system inventory**: Scan for design tokens, CSS variables, theme imports
139
+ 2. **Current state analysis**: Styling patterns, layout strategy, component hierarchy
140
+ 3. **CLI-assisted**: `maestro delegate --role analyze --mode analysis` — survey tokens, spacing, typography, hierarchy, consistency
141
+ 4. Append evidence phase=survey. Update section 2. Mark G1.
142
+
143
+ Commit: `"odyssey-ui({slug}): SURVEY — design token inventory"`
144
+
145
+ ### A_AUDIT
146
+ Spawn 6 parallel Agents (one per dimension, or `--dimensions` subset):
147
+
148
+ | Dimension | Focus |
149
+ |-----------|-------|
150
+ | visual_hierarchy | Spacing, typography scale, color contrast, alignment, whitespace, visual weight |
151
+ | interaction_states | Hover, focus, active, disabled, loading, error, empty, selected states |
152
+ | accessibility | WCAG AA contrast, focus management, aria labels, keyboard nav, screen reader |
153
+ | responsiveness | Breakpoints, overflow, touch targets, fluid typography, container queries |
154
+ | micro_interactions | Transitions, animations, feedback indicators, loading states, progress |
155
+ | edge_cases | Long text truncation, empty data, error states, extreme values, i18n, RTL |
156
+
157
+ Each returns `[{title, severity, file, line, description, suggestion, dimension}]`.
158
+ Merge → evidence phase=audit. Write `audit_result`. Update section 3 with severity matrix. Mark G2.
159
+
160
+ Commit: `"odyssey-ui({slug}): AUDIT — 6-dimension review"`
161
+
162
+ ### A_DIVERGE
163
+ Goes beyond defect fixing — "what would make this delightful?"
164
+
165
+ **Step 1 2 parallel Agents:**
166
+ - **Polish Agent**: Shadows, borders, transitions, hover states, feedback, empty states, skeleton loading, scroll behavior
167
+ - **Delight Agent**: Motion design, progressive disclosure, smart defaults, contextual hints, celebratory feedback, personality in copy
168
+
169
+ Each returns `[{idea, category (polish|delight), impact, effort, description, inspiration}]`
170
+
171
+ **Step 2 — CLI-assisted**: `maestro delegate --role analyze --mode analysis` — polish opportunities, micro-interactions, visual rhythm, delight moments
172
+
173
+ **Step 3 Consolidate**: Merge audit findings + divergent ideas → prioritized list (severity x impact x effort).
174
+ Append evidence phase=diverge. Update section 4. Mark G3.
175
+
176
+ Commit: `"odyssey-ui({slug}): DIVERGE — creative exploration"`
177
+
178
+ ### A_FIX
179
+ Skip if `--skip-fix`.
180
+ 1. **Exhaustive fix**: ALL findings/ideas by priority tier (critical high → medium → low + high-impact ideas). After each tier, re-review — new findings append.
181
+ 2. Each fix evidence phase=fix
182
+ 3. Normal: AskUserQuestion per-fix | `-y`: auto-proceed, record `deferred`
183
+
184
+ Commit: `"odyssey-ui({slug}): FIX — implement improvements"`
185
+
186
+ ### A_VERIFY
187
+ 1. Run tests (lint, unit, visual regression)
188
+ 2. `maestro delegate --role review --mode analysis` visual correctness, interaction states, accessibility, responsive
189
+ 3. `needs_rework` → S_FIX. `verified` → mark G4. Update section 5, write `confirmation`.
190
+
191
+ Commit: `"odyssey-ui({slug}): VERIFY — visual verification"`
192
+
193
+ ### A_GENERALIZE
194
+
195
+ **MANDATORY — executes unless `skip_generalize == true`. Prior-phase convergence, "all verified," or context pressure are NOT valid skip reasons.**
196
+
197
+ Pattern source: audit findings + diverge ideas (severity >= medium OR impact = high).
198
+
199
+ **Step 1 — 3-layer pattern extraction** from UI findings and creative improvements:
200
+
201
+ | Layer | Method | Targets |
202
+ |-------|--------|---------|
203
+ | Syntax | Build regex from fix diffs → Grep | Hardcoded px values, missing aria attributes, inline color values, raw z-index |
204
+ | Semantic | Understand UI anti-pattern → Agent scan | Inconsistent spacing scale, missing hover/focus states, keyboard nav gaps, contrast violations |
205
+ | Structural | Find components with same layout/state shape | Sibling components with same template, parallel page layouts, shared form patterns |
206
+
207
+ Write `session.json.patterns[]`: `[{id, source, layer, signature, description, risk, fix_template, confidence}]`
208
+
209
+ **Thoroughness floor:** ALL 3 layers must be attempted and logged. Each layer records search method, scope, hit count in evidence phase=generalization. "No hits" requires all 3 layers to return 0 with logged evidence.
210
+
211
+ **Step 2 — 4-agent concurrent scan** (single message, 4 Agents):
212
+
213
+ | Agent | Strategy | Scope |
214
+ |-------|----------|-------|
215
+ | Syntax grep | Grep regex from pattern signatures | Full project |
216
+ | Semantic scan | UI anti-pattern check (states, a11y, spacing) | Related components |
217
+ | Structural match | Find structurally similar components/pages | Full project |
218
+ | Historical grep | `git log -S` for pattern signatures | Git history |
219
+
220
+ **Step 3 — Cross-layer dedup:** multi-layer hit → boost | single-layer → `needs_review` | historically fixed → `regression_risk`
221
+
222
+ **Step 4 — Iterative deepening:** Component with ≥3 hits → targeted deep scan (max 1 round).
223
+
224
+ **Step 5 — Persist:** Update understanding.md section 6 + write `session.json.generalization_stats`:
225
+ ```json
226
+ {"patterns_extracted": 0, "total_hits": 0, "cross_layer_confirmed": 0, "regression_risks": 0, "by_layer": {"syntax": 0, "semantic": 0, "structural": 0}, "deepening_triggered": false}
227
+ ```
228
+
229
+ **Transition guard:** `S_GENERALIZE S_RECORD` requires `by_layer` has entries for all 3 layers with search evidence logged. Mark G5 done.
230
+
231
+ Commit: `"odyssey-ui({slug}): GENERALIZE — pattern scan complete"`
232
+
233
+ ### A_DISCOVER
234
+
235
+ **Executes whenever `total_hits > 0`. Cannot be skipped without `skip_generalize == true`.**
236
+
237
+ 1. **Triage** each hit with ±10 lines context → classify:
238
+ - `bug` — confirmed UI defect in sibling component (missing state, broken a11y, inconsistent token)
239
+ - `risk` potential visual/UX degradation
240
+ - `safe` false positive (must log individual reason blanket "pre-existing" forbidden)
241
+
242
+ 2. **Route:**
243
+
244
+ | Classification | Action |
245
+ |---------------|--------|
246
+ | new component needing audit | Route to S_AUDIT, `cross_phase_loops++` |
247
+ | fixable sibling (same pattern) | Immediate fix → back to S_FIX, `cross_phase_loops++` |
248
+ | risk + guard addable | Fix directly |
249
+ | risk + design decision needed | Create issue |
250
+ | safe | Skip with logged per-item reason |
251
+
252
+ Normal: AskUserQuestion per hit | `-y`: auto-fix with template, create issue for rest
253
+
254
+ 3. **Cross-phase loops:** `loops >= max_loops` → must log per-item reasons, advance to S_RECORD.
255
+
256
+ 4. Append evidence phase=discovery. Update understanding.md section 7. Mark G6 done.
257
+
258
+ Commit: `"odyssey-ui({slug}): DISCOVER sibling triage complete"`
259
+
260
+ ### A_RECORD
261
+
262
+ 1. Finalize understanding.md section 8 — learnings by Knowledge Persistence categories:
263
+ - Design pattern: component pattern + applicable scenarios + token references → `/spec-add ui`
264
+ - Interaction spec: state definitions + transition rules + feedback patterns → `/spec-add ui`
265
+ - Accessibility rule: WCAG requirement + implementation approach → `/spec-add ui`
266
+ - Reusable generalization pattern: signature + application scope → `/spec-add coding`
267
+
268
+ 2. Mark G7 done. Pending decisions: Normal → AskUserQuestion | `-y` → skip (show deferred count).
269
+
270
+ 3. **Goal audit (hardened):**
271
+ - `done` → confirmed
272
+ - `skipped` → confirmed ONLY if corresponding `skip_when` flag is true
273
+ - **Hard rule:** G5 and G6 CANNOT be `skipped` unless `skip_generalize == true`. Pending without flag → `failed` (Normal: AskUserQuestion | `-y`: record `failed`)
274
+ - `phase_goals_all_done = true` only when all goals pass this audit
275
+
276
+ 4. `current_state = "COMPLETED"`, emit completion summary.
277
+
278
+ **Completion summary:**
279
+ ```
280
+ --- UI ODYSSEY COMPLETE ---
281
+ Target: {target} | Dimensions: {dimensions_audited}
282
+ Findings: {C}C {H}H {M}M {L}L | Diverge: {improvements} polish + {creative} delight
283
+ Fix: {fixed_count} applied, verified={yes|skipped}
284
+ Patterns: {extracted} ({by_layer})
285
+ Scan hits: {total} ({cross_layer} cross-layer)
286
+ Issues: {N} created
287
+ Decisions: {N} resolved, {M} pending, {K} deferred
288
+ Learnings: {N} persisted
289
+ Self-iter: {N} rounds
290
+ Goals: {done}/{total} ({skipped} skipped)
291
+ ---
292
+ ```
293
+
294
+ Commit: `"odyssey-ui({slug}): RECORD — summary and knowledge persistence"`
295
+
296
+ </actions>
297
+
298
+ <appendix>
299
+
300
+ ### `-y` ui-specific points
301
+
302
+ | Decision Point | Normal | `-y` |
303
+ |---------------|--------|------|
304
+ | A_FIX improvement confirmation | AskUserQuestion | auto-proceed, deferred |
305
+ | A_DISCOVER hit routing | AskUserQuestion | auto-fix with template, create issue for rest |
306
+
307
+ ### Goal Prompt convergence rules
308
+
309
+ ```
310
+ Stop when audit + diverge findings all addressed (fix/issue/decision),
311
+ phase_goals_all_done=true. Fix by impact x severity per tier.
312
+ Re-review after each tier — new findings append and continue.
313
+ Pending decisions must AskUserQuestion — no self-resolve.
314
+ ```
315
+
316
+ </appendix>
317
+
318
+ </state_machine>
319
+
320
+ <error_codes>
321
+ | Code | Severity | Condition | Recovery |
322
+ |------|----------|-----------|----------|
323
+ | E001 | error | No target specified | Provide target |
324
+ | E002 | error | Target path not found | Check path |
325
+ | W001 | warning | No design system detected | Proceed with defaults |
326
+ | W002 | warning | Some dimension agents failed | Partial coverage |
327
+ | W003 | warning | Generalization 0 hits after full 3-layer scan | Advance to S_RECORD (requires all 3 layers attempted with evidence) |
328
+ </error_codes>
329
+
330
+ <success_criteria>
331
+ - [ ] 6-dimension audit with severity matrix + divergent exploration (polish + delight)
332
+ - [ ] Improvements implemented and verified (unless --skip-fix)
333
+ - [ ] Multi-layer generalization + discoveries classified (unless --skip-generalize)
334
+ - [ ] Every unfixed finding has individual classification and reason
335
+ - [ ] understanding.md section 8 finalized; phase_goals G1-G7 tracked; `-y` no blocking prompts
336
+ </success_criteria>
337
+
338
+ <next_step_routing>
339
+ | Condition | Next |
340
+ |-----------|------|
341
+ | Finding needs deeper debug | `/odyssey-debug "<finding>"` |
342
+ | Issues from discoveries | `/manage-issue list --source ui-odyssey` |
343
+ | Design pattern to document | `/spec-add ui "..."` |
344
+ | Full review of changes | `/odyssey-review-test-fix <changed-files>` |
345
+ | Sibling components to polish | `/odyssey-ui "<sibling>"` |
346
+ </next_step_routing>
@@ -334,7 +334,7 @@ const CACHE_FILE = 'embedding-index.json';
334
334
  let _pipeline = null;
335
335
  let _available = null;
336
336
  async function configureProxy() {
337
- const proxy = process.env.HTTPS_PROXY || process.env.HTTP_PROXY || process.env.ALL_PROXY;
337
+ const proxy = getApiProxy();
338
338
  if (!proxy)
339
339
  return;
340
340
  try {
@@ -627,7 +627,7 @@ export function loadEmbeddingIndex(dir) {
627
627
  return loadFromZvecMeta(zvecMetaPath, zvecCollPath);
628
628
  }
629
629
  catch (e) {
630
- if (process.env.DEBUG || process.env.MAESTRO_DEBUG) {
630
+ if (process.env.MAESTRO_DEBUG === '1') {
631
631
  console.warn(`[embedding] zvec index load failed, falling back: ${e instanceof Error ? e.message : e}`);
632
632
  }
633
633
  // Fall through to binary
@@ -640,7 +640,7 @@ export function loadEmbeddingIndex(dir) {
640
640
  return loadFromBinary(binPath);
641
641
  }
642
642
  catch (e) {
643
- if (process.env.DEBUG || process.env.MAESTRO_DEBUG) {
643
+ if (process.env.MAESTRO_DEBUG === '1') {
644
644
  console.warn(`[embedding] binary index corrupted, will rebuild: ${e instanceof Error ? e.message : e}`);
645
645
  }
646
646
  return null;