maestro-flow 0.4.1 → 0.4.2

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 (41) hide show
  1. package/.claude/commands/maestro-impeccable.md +76 -73
  2. package/.codex/skills/maestro-impeccable/SKILL.md +75 -72
  3. package/dist/src/commands/hooks.d.ts +49 -0
  4. package/dist/src/commands/hooks.d.ts.map +1 -1
  5. package/dist/src/commands/hooks.js +197 -30
  6. package/dist/src/commands/hooks.js.map +1 -1
  7. package/dist/src/commands/install-backend.d.ts +2 -0
  8. package/dist/src/commands/install-backend.d.ts.map +1 -1
  9. package/dist/src/commands/install-backend.js +72 -0
  10. package/dist/src/commands/install-backend.js.map +1 -1
  11. package/dist/src/commands/install.d.ts.map +1 -1
  12. package/dist/src/commands/install.js +15 -2
  13. package/dist/src/commands/install.js.map +1 -1
  14. package/dist/src/i18n/locales/en.d.ts.map +1 -1
  15. package/dist/src/i18n/locales/en.js +13 -0
  16. package/dist/src/i18n/locales/en.js.map +1 -1
  17. package/dist/src/i18n/locales/zh.d.ts.map +1 -1
  18. package/dist/src/i18n/locales/zh.js +13 -0
  19. package/dist/src/i18n/locales/zh.js.map +1 -1
  20. package/dist/src/i18n/types.d.ts +7 -0
  21. package/dist/src/i18n/types.d.ts.map +1 -1
  22. package/dist/src/tui/install-ui/InstallConfirm.d.ts +5 -0
  23. package/dist/src/tui/install-ui/InstallConfirm.d.ts.map +1 -1
  24. package/dist/src/tui/install-ui/InstallConfirm.js +1 -1
  25. package/dist/src/tui/install-ui/InstallConfirm.js.map +1 -1
  26. package/dist/src/tui/install-ui/InstallExecution.d.ts +2 -0
  27. package/dist/src/tui/install-ui/InstallExecution.d.ts.map +1 -1
  28. package/dist/src/tui/install-ui/InstallExecution.js +22 -3
  29. package/dist/src/tui/install-ui/InstallExecution.js.map +1 -1
  30. package/dist/src/tui/install-ui/InstallFlow.d.ts +1 -1
  31. package/dist/src/tui/install-ui/InstallFlow.d.ts.map +1 -1
  32. package/dist/src/tui/install-ui/InstallFlow.js +25 -4
  33. package/dist/src/tui/install-ui/InstallFlow.js.map +1 -1
  34. package/dist/src/tui/install-ui/InstallHub.d.ts +5 -0
  35. package/dist/src/tui/install-ui/InstallHub.d.ts.map +1 -1
  36. package/dist/src/tui/install-ui/InstallHub.js +16 -0
  37. package/dist/src/tui/install-ui/InstallHub.js.map +1 -1
  38. package/dist/src/tui/install-ui/InstallResult.d.ts.map +1 -1
  39. package/dist/src/tui/install-ui/InstallResult.js +1 -1
  40. package/dist/src/tui/install-ui/InstallResult.js.map +1 -1
  41. package/package.json +1 -1
@@ -76,81 +76,84 @@ responsive-design.md, spatial-design.md, typography.md, ux-writing.md
76
76
 
77
77
  | Chain | Steps | Scenario |
78
78
  |-------|-------|----------|
79
- | build | teach? → explore? → shape → craft → critique → [refine] → audit → polish | 从零新建 |
80
- | redesign | document → explore → shape → craft → critique → [refine] → audit → polish | 基于现有代码重设计 |
81
- | improve | critique → [refine] → polish → audit | 迭代改进 |
82
- | enhance | {cmd...} → critique → [refine] → polish | 定向增强(支持多命令) |
83
- | launch | harden → adapt → optimize → audit → polish | 全方位上线准备 |
84
- | harden | harden → audit → polish | 边界加固 |
85
- | foundation | teach? → explore → document → extract | 纯设计系统建设 |
86
- | live | live | 实时迭代 |
79
+ | build | teach? → explore? → shape → craft → critique → [refine] → audit → polish | New from scratch |
80
+ | redesign | document → explore → shape → craft → critique → [refine] → audit → polish | Redesign existing code |
81
+ | improve | critique → [refine] → polish → audit | Iterative improvement |
82
+ | enhance | {cmd...} → critique → [refine] → polish | Targeted enhancement (multi-command) |
83
+ | launch | harden → adapt → optimize → audit → polish | Full production readiness |
84
+ | harden | harden → audit → polish | Edge case hardening |
85
+ | foundation | teach? → explore → document → extract | Design system setup |
86
+ | live | live | Real-time iteration |
87
87
 
88
88
  - `?` = conditional: teach if PRODUCT.md missing; explore if DESIGN.md missing and --skip-design not set
89
89
  - `[refine]` = quality gate loop: gate fails → auto-select fix commands from findings → re-gate
90
- - `{cmd...}` = enhance 支持多命令,逗号分隔:`enhance colorize,typeset landing-page`
90
+ - `{cmd...}` = enhance supports multiple commands, comma-separated: `enhance colorize,typeset landing-page`
91
91
 
92
92
  Chain flags: --threshold <N> (default 26/40), --max-loops <N> (default 3), --skip-design, --styles <N>, -y
93
93
 
94
94
  ## Free Text Routing
95
95
 
96
- Free text 按优先级三层匹配。命中即停,不继续向下。
96
+ Three-layer priority matching. Stop on first match — do not continue to lower layers.
97
97
 
98
- ### Layer 1: 意图匹配单个命令 → Direct
98
+ ### Layer 1: Single command intent → Direct
99
99
 
100
- 将用户描述与 Command Routing 表的 Description 列语义匹配。匹配最接近的**一个**命令。
100
+ Semantically match user description against the Command Routing table's Description column. Match the closest **single** command.
101
+
102
+ **Skip condition**: If the prompt also contains a Layer 2 chain keyword AND does not focus on a single design dimension, skip this layer.
103
+ Example: `enhance colors and typography` — "enhance" is a chain keyword + multiple design dimensions → skip to Layer 2.
101
104
 
102
105
  | Intent signal | Command |
103
106
  |---------------|---------|
104
- | 评审, review, 检查UX, 评分, heuristic | critique |
105
- | 审计, a11y, 可访问性, 技术检查, performance audit, 代码质量 | audit |
106
- | 加动画, 动效, transitions, micro-interactions, 过渡 | animate |
107
- | 配色, 颜色, palette, 色彩, OKLCH, contrast | colorize |
108
- | 字体, 排版, typography, font, 字号, 行高 | typeset |
109
- | 布局, 间距, spacing, grid, 对齐, alignment, 视觉层次 | layout |
110
- | 太花, 太吵, tone down, 视觉噪音, 简洁点 | quieter |
111
- | 太平淡, 加强, 更大胆, more personality, 更有个性 | bolder |
112
- | 太复杂, 简化, strip, 去掉多余, cognitive load | distill |
113
- | 打磨, 微调, pixel perfect, final pass, 最终润色 | polish |
114
- | 文案, copy, 标签, 错误提示, UX writing, microcopy | clarify |
115
- | 响应式, mobile, 适配, breakpoints, touch targets | adapt |
116
- | 性能, loading, bundle, 卡顿, jank, 速度 | optimize |
117
- | 边界, error states, i18n, 溢出, 空状态加固 | harden |
118
- | 引导, 新手, 首次使用, onboarding, empty state, 激活 | onboard |
119
- | 趣味, 惊喜, personality, memorable, joy | delight |
120
- | 炫酷, 极限, extraordinary, 超常规, 技术极限 | overdrive |
121
- | 规划, plan UX, wireframe, 信息架构, 视觉方向 | shape |
122
- | 多风格, 变体, variants, compare styles, 风格对比 | explore |
123
- | 品牌定义, PRODUCT.md, 产品上下文 | teach |
124
- | 提取设计, DESIGN.md, 设计文档化 | document |
125
- | 提取组件, pull tokens, 设计系统提取 | extract |
126
- | 实时, browser iteration, 浏览器迭代 | live |
127
-
128
- ### Layer 2: 具体构建任务Direct craft
129
-
130
- Layer 1 未命中,但意图是"构建/创建某个具体东西":
131
- - 包含具体文件路径或目标(`d:\path`, `src/pages/`, `index.html`)
132
- - 包含详细视觉规格(布局、风格、配色方案)
133
- - 包含参考素材(`参考...`, `based on...`, `like...`)
134
-
135
- → 路由到 **craft**(Direct)
136
-
137
- ### Layer 3: 项目意图 → Chain
138
-
139
- Layer 1+2 未命中,意图是泛泛的项目方向:
107
+ | review, check UX, score, heuristic, evaluate usability | critique |
108
+ | audit, a11y, accessibility, technical check, performance audit, code quality | audit |
109
+ | add animation, motion, transitions, micro-interactions | animate |
110
+ | color, palette, OKLCH, contrast, color scheme | colorize |
111
+ | font, typography, type scale, line height, font pairing | typeset |
112
+ | layout, spacing, grid, alignment, visual hierarchy | layout |
113
+ | too loud, tone down, visual noise, make it simpler, too busy | quieter |
114
+ | too bland, bolder, more personality, stronger, more contrast | bolder |
115
+ | too complex, simplify, strip, remove clutter, cognitive load | distill |
116
+ | polish, fine-tune, pixel perfect, final pass, refine details | polish |
117
+ | copy, labels, error messages, UX writing, microcopy, CTAs | clarify |
118
+ | responsive, mobile, adapt, breakpoints, touch targets | adapt |
119
+ | performance, loading, bundle, jank, speed, rendering | optimize |
120
+ | edge cases, error states, i18n, overflow, empty state hardening | harden |
121
+ | onboarding, first-run, empty state, activation, progressive disclosure | onboard |
122
+ | fun, surprise, personality, memorable, joy, delight | delight |
123
+ | extraordinary, push limits, ambitious effects, cutting-edge | overdrive |
124
+ | plan UX, wireframe, information architecture, visual direction | shape |
125
+ | multi-style, variants, compare styles, style comparison | explore |
126
+ | brand definition, PRODUCT.md, product context | teach |
127
+ | extract design, DESIGN.md, document design system | document |
128
+ | pull tokens, extract components, design system extraction | extract |
129
+ | real-time, browser iteration, live editing | live |
130
+
131
+ ### Layer 2: Project intent Chain
132
+
133
+ Layer 1 did not match. Check for chain-level keywords — even if the prompt also contains a specific target/path, chain matching takes priority.
140
134
 
141
135
  | Pattern | Chain |
142
136
  |---------|-------|
143
- | 新建, create, build, new, 从零开始 | build |
144
- | 重做, redesign, 重新设计, rethink, 换风格, 改版 | redesign |
145
- | 改进, improve, iterate, better, 迭代 | improve |
146
- | 增强, enhance, 视觉升级, visual upgrade | enhance |
147
- | 上线, launch, deploy, ship, 发布准备, production-ready | launch |
148
- | 加固, harden, 生产化, 边界情况 | harden |
149
- | 设计系统, design system, tokens, 设计规范, 设计基建 | foundation |
150
- | 实时, live, browser | live |
137
+ | new, create, build, from scratch, start fresh | build |
138
+ | redo, redesign, rethink, restyle, overhaul, revamp | redesign |
139
+ | improve, iterate, better, refine overall | improve |
140
+ | enhance, visual upgrade, level up | enhance |
141
+ | launch, deploy, ship, production-ready, go live | launch |
142
+ | harden, production-harden, edge cases | harden |
143
+ | design system, tokens, design foundation, design infrastructure | foundation |
144
+ | real-time, live, browser | live |
151
145
 
152
146
  Ambiguous + no `-y` → AskUserQuestion.
153
147
 
148
+ ### Layer 3: Concrete build task → Direct craft
149
+
150
+ Layer 1+2 both did not match, but intent is to build/create a specific thing:
151
+ - Contains a specific file path or target (`d:\path`, `src/pages/`, `index.html`)
152
+ - Contains detailed visual specs (layout, style, color scheme)
153
+ - Contains reference material (`based on...`, `like...`, `similar to...`)
154
+
155
+ → Route to **craft** (Direct)
156
+
154
157
  ## Prerequisites
155
158
 
156
159
  Before reading any command workflow:
@@ -162,23 +165,23 @@ Before reading any command workflow:
162
165
  ## Direct Execution
163
166
 
164
167
  1. Prerequisites ✓
165
- 2. **显示执行信息**:
168
+ 2. **Display execution info**:
166
169
  ```
167
170
  ── Command: {command} ────────────────────
168
171
  Category: {category} | Target: {target}
169
172
  ─────────────────────────────────────────
170
173
  ```
171
174
  3. Read `~/.maestro/workflows/impeccable/{command}.md`
172
- 4. **TodoWrite 跟踪**:按 workflow 文件中的主要阶段创建 todo
173
- - 格式:`[{command}] {phase description}`
174
- - 每个阶段完成后立即标记 completed
175
+ 4. **TodoWrite tracking**: create todo items for each major phase in the workflow file
176
+ - Format: `[{command}] {phase description}`
177
+ - Mark each phase completed immediately upon finishing
175
178
  5. Follow workflow file instructions
176
179
  6. Post: suggest logical next command (teach→shape, shape→craft, craft→critique, etc.)
177
180
 
178
181
  ## Chain Execution
179
182
 
180
183
  1. Prerequisites ✓
181
- 2. **显示执行链**:解析 chain 定义,输出完整步骤预览:
184
+ 2. **Display chain preview**: parse chain definition, output full step preview:
182
185
  ```
183
186
  ── Chain: build ──────────────────────────
184
187
  1. teach (conditional: PRODUCT.md missing)
@@ -192,31 +195,31 @@ Before reading any command workflow:
192
195
  ─────────────────────────────────────────
193
196
  Target: {target}
194
197
  ```
195
- - `◆` 标记 quality gate 步骤,显示阈值
196
- - `↺` 标记 refine loop,显示最大循环次数
197
- - conditional 步骤注明触发条件
198
- - 跳过的 conditional 步骤标记 `(skipped)`
198
+ - `◆` marks quality gate steps with threshold
199
+ - `↺` marks refine loop with max iteration count
200
+ - Conditional steps show trigger condition
201
+ - Skipped conditional steps marked `(skipped)`
199
202
  3. Create session: `.workflow/.maestro/ui-craft-{YYYYMMDD-HHmmss}/status.json`
200
203
  ```json
201
204
  { "chain_type": "...", "target": "...", "steps": [...], "current_step": 0,
202
205
  "gate_history": [], "loop_count": 0, "status": "running" }
203
206
  ```
204
- 4. **TodoWrite 初始化**:为 chain 所有步骤创建 todo
205
- - 每步一项,格式:`[chain] step N: {command} — {description}`
206
- - conditional 步骤若跳过,立即标记 completed
207
- - quality gate 步骤标注阈值:`[chain] step 5: critique ◆ gate ≥26/40`
207
+ 4. **TodoWrite init**: create todo items for all chain steps
208
+ - One item per step, format: `[chain] step N: {command} — {description}`
209
+ - If conditional step is skipped, immediately mark completed
210
+ - Quality gate steps include threshold: `[chain] step 5: critique ◆ gate ≥26/40`
208
211
  5. For each step:
209
212
  - Read `~/.maestro/workflows/impeccable/{command}.md` → execute
210
- - **步骤开始**:TodoWrite 标记当前步骤 in_progress
211
- - **步骤完成**:TodoWrite 标记 completed + update status.json (`current_step`, step `status`)
212
- - **步骤失败**:TodoWrite 标记 completed(with note) + 记录原因
213
+ - **Step start**: TodoWrite marks current step in_progress
214
+ - **Step done**: TodoWrite marks completed + update status.json (`current_step`, step `status`)
215
+ - **Step failed**: TodoWrite marks completed (with note) + record reason
213
216
  6. **Quality gate** (critique/audit steps):
214
217
  - Parse score: critique `**Total** | | **N/40**`, audit `**Total** | | **N/20**`
215
218
  - Count `[P0]` / `[P1]` tags
216
219
  - Pass: score ≥ threshold AND P0 == 0 → advance
217
220
  - Fail: collect suggested commands from findings → execute → re-gate
218
221
  - Max loops exceeded → force advance with warning
219
- - TodoWritegate 结果记入当前步骤备注(score, P0/P1 count, pass/fail
222
+ - TodoWrite: record gate result in current step notes (score, P0/P1 count, pass/fail)
220
223
  7. Final report: scores + trend + commands executed
221
224
 
222
225
  ## Resume
@@ -70,14 +70,14 @@ responsive-design.md, spatial-design.md, typography.md, ux-writing.md
70
70
 
71
71
  | Chain | Steps | Scenario |
72
72
  |-------|-------|----------|
73
- | build | teach? → explore? → shape → craft → critique → [refine] → audit → polish | 从零新建 |
74
- | redesign | document → explore → shape → craft → critique → [refine] → audit → polish | 基于现有代码重设计 |
75
- | improve | critique → [refine] → polish → audit | 迭代改进 |
76
- | enhance | {cmd...} → critique → [refine] → polish | 定向增强(支持多命令) |
77
- | launch | harden → adapt → optimize → audit → polish | 全方位上线准备 |
78
- | harden | harden → audit → polish | 边界加固 |
79
- | foundation | teach? → explore → document → extract | 纯设计系统建设 |
80
- | live | live | 实时迭代 |
73
+ | build | teach? → explore? → shape → craft → critique → [refine] → audit → polish | New from scratch |
74
+ | redesign | document → explore → shape → craft → critique → [refine] → audit → polish | Redesign existing code |
75
+ | improve | critique → [refine] → polish → audit | Iterative improvement |
76
+ | enhance | {cmd...} → critique → [refine] → polish | Targeted enhancement (multi-command) |
77
+ | launch | harden → adapt → optimize → audit → polish | Full production readiness |
78
+ | harden | harden → audit → polish | Edge case hardening |
79
+ | foundation | teach? → explore → document → extract | Design system setup |
80
+ | live | live | Real-time iteration |
81
81
 
82
82
  - `?` = conditional: teach if PRODUCT.md missing; explore if DESIGN.md missing and --skip-design not set
83
83
  - `[refine]` = quality gate loop: gate fails → auto-select fix commands from findings → re-gate
@@ -85,64 +85,67 @@ responsive-design.md, spatial-design.md, typography.md, ux-writing.md
85
85
 
86
86
  ## Free Text Routing
87
87
 
88
- Three-layer priority matching. Stop on first match.
88
+ Three-layer priority matching. Stop on first match — do not continue to lower layers.
89
89
 
90
- ### Layer 1: Intent matches single command → Direct
90
+ ### Layer 1: Single command intent → Direct
91
91
 
92
- Match user description against Command Routing descriptions. Route to the closest single command.
92
+ Semantically match user description against the Command Routing table's Description column. Match the closest **single** command.
93
+
94
+ **Skip condition**: If the prompt also contains a Layer 2 chain keyword AND does not focus on a single design dimension, skip this layer.
95
+ Example: `enhance colors and typography` — "enhance" is a chain keyword + multiple design dimensions → skip to Layer 2.
93
96
 
94
97
  | Intent signal | Command |
95
98
  |---------------|---------|
96
- | review, UX check, heuristic, 评审, 评分 | critique |
97
- | a11y, audit, accessibility, performance audit, 技术检查 | audit |
98
- | animation, motion, transitions, 动效, 加动画 | animate |
99
- | color, palette, contrast, OKLCH, 配色, 颜色 | colorize |
100
- | typography, font, type scale, 字体, 排版 | typeset |
101
- | layout, spacing, grid, alignment, 布局, 间距 | layout |
102
- | tone down, too loud, 太花, 视觉噪音 | quieter |
103
- | too bland, bolder, more personality, 太平淡 | bolder |
104
- | simplify, strip, too complex, cognitive load, 太复杂 | distill |
105
- | polish, micro-adjust, pixel perfect, 打磨 | polish |
106
- | copy, labels, error messages, UX writing, 文案 | clarify |
107
- | responsive, mobile, breakpoints, 适配 | adapt |
108
- | performance, loading, bundle, jank, 性能 | optimize |
109
- | edge cases, error states, i18n, overflow, 边界 | harden |
110
- | onboarding, first-run, empty state, 引导 | onboard |
111
- | delight, personality, joy, memorable, 趣味 | delight |
112
- | extraordinary, push limits, 炫酷, 极限 | overdrive |
113
- | plan UX, wireframe, information architecture, 规划 | shape |
114
- | variants, compare styles, multi-style, 多风格 | explore |
115
- | PRODUCT.md, brand definition, 品牌定义 | teach |
116
- | DESIGN.md, design documentation, 设计文档 | document |
117
- | pull tokens, extract components, 提取组件 | extract |
118
- | browser iteration, 实时迭代 | live |
119
-
120
- ### Layer 2: Concrete build task Direct craft
121
-
122
- Layer 1 missed, but intent is "build/create specific thing":
123
- - Has specific file path or target
124
- - Has detailed visual specs (layout, style, palette)
125
- - Has reference material
126
-
127
- → Route to **craft** (Direct)
128
-
129
- ### Layer 3: Project intent → Chain
130
-
131
- Layer 1+2 missed, broad project direction:
99
+ | review, check UX, score, heuristic, evaluate usability | critique |
100
+ | audit, a11y, accessibility, technical check, performance audit, code quality | audit |
101
+ | add animation, motion, transitions, micro-interactions | animate |
102
+ | color, palette, OKLCH, contrast, color scheme | colorize |
103
+ | font, typography, type scale, line height, font pairing | typeset |
104
+ | layout, spacing, grid, alignment, visual hierarchy | layout |
105
+ | too loud, tone down, visual noise, make it simpler, too busy | quieter |
106
+ | too bland, bolder, more personality, stronger, more contrast | bolder |
107
+ | too complex, simplify, strip, remove clutter, cognitive load | distill |
108
+ | polish, fine-tune, pixel perfect, final pass, refine details | polish |
109
+ | copy, labels, error messages, UX writing, microcopy, CTAs | clarify |
110
+ | responsive, mobile, adapt, breakpoints, touch targets | adapt |
111
+ | performance, loading, bundle, jank, speed, rendering | optimize |
112
+ | edge cases, error states, i18n, overflow, empty state hardening | harden |
113
+ | onboarding, first-run, empty state, activation, progressive disclosure | onboard |
114
+ | fun, surprise, personality, memorable, joy, delight | delight |
115
+ | extraordinary, push limits, ambitious effects, cutting-edge | overdrive |
116
+ | plan UX, wireframe, information architecture, visual direction | shape |
117
+ | multi-style, variants, compare styles, style comparison | explore |
118
+ | brand definition, PRODUCT.md, product context | teach |
119
+ | extract design, DESIGN.md, document design system | document |
120
+ | pull tokens, extract components, design system extraction | extract |
121
+ | real-time, browser iteration, live editing | live |
122
+
123
+ ### Layer 2: Project intentChain
124
+
125
+ Layer 1 did not match. Check for chain-level keywords — even if the prompt also contains a specific target/path, chain matching takes priority.
132
126
 
133
127
  | Pattern | Chain |
134
128
  |---------|-------|
135
- | create, build, new, from scratch | build |
136
- | redesign, rethink, restyle | redesign |
137
- | improve, iterate, better | improve |
138
- | enhance, visual upgrade | enhance |
139
- | launch, deploy, ship, production-ready | launch |
140
- | harden, production, edge cases | harden |
141
- | design system, tokens, design spec | foundation |
142
- | live, browser | live |
129
+ | new, create, build, from scratch, start fresh | build |
130
+ | redo, redesign, rethink, restyle, overhaul, revamp | redesign |
131
+ | improve, iterate, better, refine overall | improve |
132
+ | enhance, visual upgrade, level up | enhance |
133
+ | launch, deploy, ship, production-ready, go live | launch |
134
+ | harden, production-harden, edge cases | harden |
135
+ | design system, tokens, design foundation, design infrastructure | foundation |
136
+ | real-time, live, browser | live |
143
137
 
144
138
  Ambiguous + no `-y` → `request_user_input`.
145
139
 
140
+ ### Layer 3: Concrete build task → Direct craft
141
+
142
+ Layer 1+2 both did not match, but intent is to build/create a specific thing:
143
+ - Contains a specific file path or target (`d:\path`, `src/pages/`, `index.html`)
144
+ - Contains detailed visual specs (layout, style, color scheme)
145
+ - Contains reference material (`based on...`, `like...`, `similar to...`)
146
+
147
+ → Route to **craft** (Direct)
148
+
146
149
  <invariants>
147
150
  1. Prerequisites before any design work — never skip context loading or register detection
148
151
  2. Read workflow file before execution — never execute a command without loading its .md
@@ -161,23 +164,23 @@ Before reading any command workflow:
161
164
  ## Direct Execution
162
165
 
163
166
  1. Prerequisites ✓
164
- 2. **显示执行信息**:
167
+ 2. **Display execution info**:
165
168
  ```
166
169
  ── Command: {command} ────────────────────
167
170
  Category: {category} | Target: {target}
168
171
  ─────────────────────────────────────────
169
172
  ```
170
173
  3. Read `~/.maestro/workflows/impeccable/{command}.md`
171
- 4. **TodoWrite 跟踪**:按 workflow 文件中的主要阶段创建 todo
172
- - 格式:`[{command}] {phase description}`
173
- - 每个阶段完成后立即标记 completed
174
+ 4. **Progress tracking**: create todo items for each major phase in the workflow file
175
+ - Format: `[{command}] {phase description}`
176
+ - Mark each phase completed immediately upon finishing
174
177
  5. Follow workflow file instructions
175
178
  6. Post: suggest logical next command (teach→shape, shape→craft, craft→critique, etc.)
176
179
 
177
180
  ## Chain Execution
178
181
 
179
182
  1. Prerequisites ✓
180
- 2. **显示执行链**:解析 chain 定义,输出完整步骤预览:
183
+ 2. **Display chain preview**: parse chain definition, output full step preview:
181
184
  ```
182
185
  ── Chain: build ──────────────────────────
183
186
  1. teach (conditional: PRODUCT.md missing)
@@ -191,31 +194,31 @@ Before reading any command workflow:
191
194
  ─────────────────────────────────────────
192
195
  Target: {target}
193
196
  ```
194
- - `◆` 标记 quality gate 步骤,显示阈值
195
- - `↺` 标记 refine loop,显示最大循环次数
196
- - conditional 步骤注明触发条件
197
- - 跳过的 conditional 步骤标记 `(skipped)`
197
+ - `◆` marks quality gate steps with threshold
198
+ - `↺` marks refine loop with max iteration count
199
+ - Conditional steps show trigger condition
200
+ - Skipped conditional steps marked `(skipped)`
198
201
  3. Create session: `.workflow/.maestro/ui-craft-{YYYYMMDD-HHmmss}/status.json`
199
202
  ```json
200
203
  { "chain_type": "...", "target": "...", "steps": [...], "current_step": 0,
201
204
  "gate_history": [], "loop_count": 0, "status": "running" }
202
205
  ```
203
- 4. **TodoWrite 初始化**:为 chain 所有步骤创建 todo
204
- - 每步一项,格式:`[chain] step N: {command} — {description}`
205
- - conditional 步骤若跳过,立即标记 completed
206
- - quality gate 步骤标注阈值:`[chain] step 5: critique ◆ gate ≥26/40`
206
+ 4. **Init tracking**: create todo items for all chain steps
207
+ - One item per step, format: `[chain] step N: {command} — {description}`
208
+ - If conditional step is skipped, immediately mark completed
209
+ - Quality gate steps include threshold: `[chain] step 5: critique ◆ gate ≥26/40`
207
210
  5. For each step:
208
211
  - Read `~/.maestro/workflows/impeccable/{command}.md` → execute
209
- - **步骤开始**:TodoWrite 标记当前步骤 in_progress
210
- - **步骤完成**:TodoWrite 标记 completed + update status.json (`current_step`, step `status`)
211
- - **步骤失败**:TodoWrite 标记 completed(with note) + 记录原因
212
+ - **Step start**: mark current step in_progress
213
+ - **Step done**: mark completed + update status.json (`current_step`, step `status`)
214
+ - **Step failed**: mark completed (with note) + record reason
212
215
  6. **Quality gate** (critique/audit steps):
213
216
  - Parse score: critique `**Total** | | **N/40**`, audit `**Total** | | **N/20**`
214
217
  - Count `[P0]` / `[P1]` tags
215
218
  - Pass: score ≥ threshold AND P0 == 0 → advance
216
219
  - Fail: collect suggested commands from findings → execute → re-gate
217
220
  - Max loops exceeded → force advance with warning
218
- - TodoWrite:gate 结果记入当前步骤备注(score, P0/P1 count, pass/fail
221
+ - Record gate result in current step notes (score, P0/P1 count, pass/fail)
219
222
  7. Final report: scores + trend + commands executed
220
223
 
221
224
  ## Resume
@@ -39,6 +39,16 @@ export type HookLevel = 'none' | 'minimal' | 'standard' | 'full';
39
39
  export declare const HOOK_LEVELS: readonly HookLevel[];
40
40
  export declare const HOOK_LEVEL_DESCRIPTIONS: Record<HookLevel, string>;
41
41
  export declare const HOOK_DEFS: Record<string, HookDef>;
42
+ interface CodexHookDef {
43
+ event: 'SessionStart' | 'PreToolUse' | 'PostToolUse' | 'UserPromptSubmit' | 'Stop';
44
+ matcher?: string;
45
+ level: HookLevel;
46
+ requiresWorkspace?: boolean;
47
+ statusMessage?: string;
48
+ timeout?: number;
49
+ }
50
+ export declare const CODEX_HOOK_DEFS: Record<string, CodexHookDef>;
51
+ export declare const CODEX_HOOK_LEVEL_DESCRIPTIONS: Record<HookLevel, string>;
42
52
  export declare function getClaudeSettingsPath(): string;
43
53
  export declare function loadClaudeSettings(settingsPath: string): ClaudeSettings;
44
54
  export declare function removeMaestroHooks(settings: ClaudeSettings): void;
@@ -73,6 +83,45 @@ export declare function installHooksByLevel(level: HookLevel, opts?: {
73
83
  settingsPath?: string;
74
84
  skipStatusline?: boolean;
75
85
  }): InstallHooksResult;
86
+ interface CodexHookGroup {
87
+ matcher?: string;
88
+ hooks: Array<{
89
+ type: string;
90
+ command: string;
91
+ statusMessage?: string;
92
+ timeout?: number;
93
+ }>;
94
+ }
95
+ interface CodexHooksFile {
96
+ hooks?: {
97
+ SessionStart?: CodexHookGroup[];
98
+ PreToolUse?: CodexHookGroup[];
99
+ PostToolUse?: CodexHookGroup[];
100
+ UserPromptSubmit?: CodexHookGroup[];
101
+ Stop?: CodexHookGroup[];
102
+ [key: string]: unknown;
103
+ };
104
+ [key: string]: unknown;
105
+ }
106
+ export declare function getCodexHooksPath(opts?: {
107
+ project?: boolean;
108
+ }): string;
109
+ export declare function loadCodexHooks(hooksPath: string): CodexHooksFile;
110
+ export declare function removeCodexMaestroHooks(hooksFile: CodexHooksFile): void;
111
+ /**
112
+ * Check whether `codex_hooks = true` is set in config.toml.
113
+ * Returns true if the flag is found; prints a hint otherwise.
114
+ */
115
+ export declare function checkCodexHooksFeatureFlag(opts?: {
116
+ project?: boolean;
117
+ }): boolean;
118
+ /**
119
+ * Install hooks at the given level into Codex hooks.json.
120
+ */
121
+ export declare function installCodexHooksByLevel(level: HookLevel, opts?: {
122
+ project?: boolean;
123
+ hooksPath?: string;
124
+ }): InstallHooksResult;
76
125
  export declare function registerHooksCommand(program: Command): void;
77
126
  export {};
78
127
  //# sourceMappingURL=hooks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/commands/hooks.ts"],"names":[],"mapp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