maestro-flow 0.3.19 → 0.3.21

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 (64) hide show
  1. package/.claude/commands/learn-investigate.md +195 -195
  2. package/.claude/commands/learn-retro.md +303 -303
  3. package/.claude/commands/learn-second-opinion.md +167 -167
  4. package/.claude/commands/maestro-amend.md +300 -300
  5. package/.claude/commands/maestro-analyze.md +126 -126
  6. package/.claude/commands/maestro-composer.md +354 -354
  7. package/.claude/commands/maestro-execute.md +114 -114
  8. package/.claude/commands/maestro-learn.md +140 -140
  9. package/.claude/commands/maestro-milestone-audit.md +68 -68
  10. package/.claude/commands/maestro-milestone-complete.md +75 -75
  11. package/.claude/commands/maestro-milestone-release.md +96 -96
  12. package/.claude/commands/maestro-plan.md +138 -138
  13. package/.claude/commands/maestro-player.md +404 -404
  14. package/.claude/commands/maestro-update.md +176 -176
  15. package/.claude/commands/maestro-verify.md +90 -90
  16. package/.claude/commands/manage-codebase-rebuild.md +75 -75
  17. package/.claude/commands/manage-knowhow-capture.md +193 -193
  18. package/.claude/commands/manage-knowhow.md +77 -77
  19. package/.claude/commands/manage-learn.md +67 -67
  20. package/.claude/commands/manage-wiki.md +62 -62
  21. package/.claude/commands/quality-business-test.md +110 -110
  22. package/.claude/commands/quality-retrospective.md +78 -78
  23. package/.claude/commands/spec-add.md +49 -49
  24. package/.claude/commands/spec-load.md +51 -51
  25. package/.claude/commands/spec-remove.md +51 -51
  26. package/.claude/commands/wiki-connect.md +62 -62
  27. package/.claude/commands/wiki-digest.md +69 -69
  28. package/.codex/skills/maestro/SKILL.md +1 -1
  29. package/.codex/skills/maestro-analyze/SKILL.md +2 -2
  30. package/.codex/skills/maestro-brainstorm/SKILL.md +2 -2
  31. package/.codex/skills/maestro-execute/SKILL.md +1 -1
  32. package/.codex/skills/maestro-link-coordinate/SKILL.md +6 -6
  33. package/.codex/skills/maestro-plan/SKILL.md +2 -2
  34. package/.codex/skills/maestro-player/SKILL.md +6 -6
  35. package/.codex/skills/maestro-roadmap/SKILL.md +1 -1
  36. package/.codex/skills/maestro-spec-generate/SKILL.md +1 -1
  37. package/.codex/skills/maestro-verify/SKILL.md +1 -1
  38. package/.codex/skills/manage-codebase-rebuild/SKILL.md +1 -1
  39. package/.codex/skills/manage-issue-discover/SKILL.md +1 -1
  40. package/.codex/skills/quality-debug/SKILL.md +2 -2
  41. package/.codex/skills/quality-integration-test/SKILL.md +1 -1
  42. package/.codex/skills/quality-review/SKILL.md +1 -1
  43. package/.codex/skills/quality-test-gen/SKILL.md +1 -1
  44. package/.codex/skills/spec-map/SKILL.md +1 -1
  45. package/.codex/skills/team-coordinate/roles/coordinator/role.md +1 -0
  46. package/.codex/skills/team-executor/roles/executor/role.md +3 -0
  47. package/.codex/skills/team-lifecycle-v4/roles/coordinator/role.md +1 -0
  48. package/.codex/skills/team-quality-assurance/roles/coordinator/role.md +1 -0
  49. package/.codex/skills/team-review/roles/coordinator/role.md +1 -0
  50. package/.codex/skills/team-tech-debt/roles/coordinator/role.md +1 -0
  51. package/.codex/skills/team-testing/roles/coordinator/role.md +1 -0
  52. package/dashboard/dist-server/dashboard/src/server/coordinator/workflow-coordinator.js +3 -3
  53. package/dashboard/dist-server/dashboard/src/server/coordinator/workflow-coordinator.js.map +1 -1
  54. package/dashboard/dist-server/dashboard/src/server/execution/execution-scheduler.js +1 -1
  55. package/dashboard/dist-server/dashboard/src/server/execution/execution-scheduler.js.map +1 -1
  56. package/dist/src/commands/coordinate.js +2 -2
  57. package/dist/src/commands/coordinate.js.map +1 -1
  58. package/dist/src/hooks/coordinator-tracker.d.ts +1 -1
  59. package/dist/src/hooks/coordinator-tracker.js +3 -3
  60. package/dist/src/hooks/coordinator-tracker.js.map +1 -1
  61. package/package.json +1 -1
  62. package/workflows/maestro-link-coordinate.md +3 -3
  63. package/workflows/maestro.codex.md +2 -2
  64. package/workflows/maestro-coordinate.codex.md +0 -281
@@ -1,281 +0,0 @@
1
- # Workflow: Maestro-coordinate (Codex CLI-Delegate Edition)
2
-
3
- Autonomous CLI coordinator for Codex. Classifies intent, selects command chain, executes each step via `codex delegate` with template-driven prompts and async state machine. After each step, gemini evaluates output quality and generates optimization hints for subsequent steps.
4
-
5
- > Referenced by: `~/.codex/skills/maestro-coordinate/SKILL.md`
6
-
7
- ---
8
-
9
- ## Step 1: Parse Arguments
10
-
11
- Extract from `$ARGUMENTS`:
12
- - Flags: `-y`/`--yes` (autoYes), `-c`/`--continue` (resumeMode), `--dry-run`, `--chain <name>`, `--tool <name>` (default: codex)
13
- - `intent` = remaining text after flag removal
14
-
15
- **If resumeMode:** Load latest `.workflow/.maestro/*/status.json`, set `current_step` to first non-completed step, jump to **Step 6**.
16
-
17
- ---
18
-
19
- ## Step 2: Read Project State
20
-
21
- ```bash
22
- test -f .workflow/state.json && echo "exists" || echo "missing"
23
- ```
24
-
25
- **If exists:** Read `.workflow/state.json` + `.workflow/roadmap.md` + current phase `index.json`. Derive `projectState`: current_milestone, latest_artifact, milestone_progress, phase_artifacts (brainstorm/analysis/context/plan/verification/uat flags), execution (tasks_completed/total), verification_status, review_verdict (PASS|WARN|BLOCK|null), uat_status, phases_total/completed, has_blockers, accumulated_context.
26
-
27
- **If missing:** `projectState = { initialized: false }`. If intent also empty → **Error E001**.
28
-
29
- ---
30
-
31
- ## Step 3: Classify Intent & Select Chain
32
-
33
- ### 3a: Exact-match keywords (fast path)
34
-
35
- If `forcedChain` is set, validate and jump to **3c**.
36
-
37
- Exact-match keywords: `continue`/`next`/`go`/`继续`/`下一步` → `state_continue`; `status`/`状态`/`dashboard` → `status`. If matched, skip to **3c**.
38
-
39
- ### 3a-2: Structured intent extraction (LLM-native)
40
-
41
- Instead of regex, extract a structured intent tuple using LLM semantic understanding:
42
-
43
- ```json
44
- {
45
- "action": "<create|fix|analyze|plan|execute|verify|review|test|debug|refactor|explore|manage|transition|continue|sync|learn|retrospect>",
46
- "object": "<feature|bug|issue|code|test|spec|phase|milestone|doc|performance|security|ui|memory|codebase|config>",
47
- "scope": "<module/file/area or null>",
48
- "issue_id": "<ISS-XXXXXXXX-NNN if mentioned, else null>",
49
- "phase_ref": "<integer if mentioned, else null>",
50
- "urgency": "<low|normal|high>"
51
- }
52
- ```
53
-
54
- **Key disambiguation**: "问题"/"issue"/"problem" as something broken → `object: "bug"` (routes to debug). As a tracked item (with ISS-ID or management context) → `object: "issue"` (routes to issue management). When ambiguous, prefer `"bug"`.
55
-
56
- ### 3a-3: Route via action × object matrix
57
-
58
- Route via `action × object` matrix. If `issue_id` present → issue pipeline directly.
59
-
60
- | action | object-specific overrides | default |
61
- |--------|--------------------------|---------|
62
- | fix | bug/code/perf/security→debug, issue→issue | debug |
63
- | create | feature→quick, issue→issue, test→test_gen, spec→spec_generate, ui→ui_design, config→init, phase→roadmap | quick |
64
- | analyze | bug/code→analyze, issue→issue_analyze, codebase→spec_map | analyze |
65
- | explore | issue→issue_discover, feature/ui→brainstorm/ui_design | brainstorm |
66
- | plan | issue→issue_plan, spec→spec_generate | plan |
67
- | execute | issue→issue_execute | execute |
68
- | manage | issue→issue, milestone→milestone_audit, phase→milestone_close, memory/doc/codebase→memory/sync/codebase_refresh | status |
69
- | transition | phase→milestone_close, milestone→milestone_complete | milestone_close |
70
- | verify, review, test, debug, refactor, continue, sync, learn, retrospect | — | self-named |
71
-
72
- Clarity scoring: 3=action+object+scope, 2=action+object, 1=action only, 0=empty.
73
- If clarity < 2 and not autoYes: clarify via AskUserQuestion (max 2 rounds).
74
-
75
- ### 3b: State-based routing (task_type == `state_continue`)
76
-
77
- Returns `{ chain, steps }`. Steps are inline (unlike maestro.codex which uses chainMap lookup).
78
-
79
- | Condition | Chain | Steps |
80
- |-----------|-------|-------|
81
- | Not initialized | `init` | maestro-init |
82
- | No phases, no roadmap, has context | `next-milestone` | maestro-roadmap |
83
- | No phases | `brainstorm-driven` | brainstorm → plan → execute → verify |
84
- | pending + has context | `plan` | maestro-plan |
85
- | pending, no context | `analyze` | maestro-analyze |
86
- | exploring/planning + has plan | `execute-verify` | execute → verify |
87
- | exploring/planning, no plan | `plan` | maestro-plan |
88
- | executing, all tasks done | `verify` | maestro-verify |
89
- | executing, tasks remain | `execute` | maestro-execute |
90
- | verifying, passed + no review | `review` | quality-review |
91
- | verifying, passed + UAT pending | `test` | quality-test |
92
- | verifying, passed + UAT passed | `milestone-close` | audit → complete |
93
- | verifying, passed + UAT failed | `debug` | quality-debug |
94
- | verifying, not passed | `quality-loop-partial` | plan --gaps → execute → verify |
95
- | testing, UAT passed | `milestone-close` | audit → complete |
96
- | testing, UAT not passed | `debug` | quality-debug |
97
- | completed | `milestone-close` | audit → complete |
98
- | blocked | `debug` | quality-debug |
99
- | fallback | `status` | manage-status |
100
-
101
- ### 3c: Intent-based chain map
102
-
103
- ```javascript
104
- const chainMap = {
105
- // Single-step
106
- 'status': [{ cmd: 'manage-status' }],
107
- 'init': [{ cmd: 'maestro-init' }],
108
- 'analyze': [{ cmd: 'maestro-analyze', args: '{phase}' }],
109
- 'ui_design': [{ cmd: 'maestro-ui-design', args: '{phase}' }],
110
- 'plan': [{ cmd: 'maestro-plan', args: '{phase}' }],
111
- 'execute': [{ cmd: 'maestro-execute', args: '{phase}' }],
112
- 'verify': [{ cmd: 'maestro-verify', args: '{phase}' }],
113
- 'test_gen': [{ cmd: 'quality-test-gen', args: '{phase}' }],
114
- 'test': [{ cmd: 'quality-test', args: '{phase}' }],
115
- 'debug': [{ cmd: 'quality-debug', args: '"{description}"' }],
116
- 'integration_test': [{ cmd: 'quality-integration-test', args: '{phase}' }],
117
- 'refactor': [{ cmd: 'quality-refactor', args: '"{description}"' }],
118
- 'review': [{ cmd: 'quality-review', args: '{phase}' }],
119
- 'retrospective': [{ cmd: 'quality-retrospective', args: '{phase}' }],
120
- 'learn': [{ cmd: 'manage-learn', args: '"{description}"' }],
121
- 'sync': [{ cmd: 'quality-sync', args: '{phase}' }],
122
- 'milestone_close': [{ cmd: 'maestro-milestone-audit' }, { cmd: 'maestro-milestone-complete' }],
123
- 'roadmap': [{ cmd: 'maestro-roadmap', args: '"{description}"' }],
124
- 'milestone_audit': [{ cmd: 'maestro-milestone-audit' }],
125
- 'milestone_complete': [{ cmd: 'maestro-milestone-complete' }],
126
- 'codebase_rebuild': [{ cmd: 'manage-codebase-rebuild' }],
127
- 'codebase_refresh': [{ cmd: 'manage-codebase-refresh' }],
128
- 'spec_setup': [{ cmd: 'spec-setup' }],
129
- 'spec_add': [{ cmd: 'spec-add', args: '"{description}"' }],
130
- 'spec_load': [{ cmd: 'spec-load', args: '"{description}"' }],
131
- 'spec_map': [{ cmd: 'manage-codebase-rebuild' }],
132
- 'knowhow_capture': [{ cmd: 'manage-knowhow-capture', args: '"{description}"' }],
133
- 'knowhow': [{ cmd: 'manage-knowhow', args: '"{description}"' }],
134
- 'issue': [{ cmd: 'manage-issue', args: '"{description}"' }],
135
- 'issue_discover': [{ cmd: 'manage-issue-discover', args: '"{description}"' }],
136
- 'issue_analyze': [{ cmd: 'maestro-analyze', args: '--gaps "{description}"' }],
137
- 'issue_plan': [{ cmd: 'maestro-plan', args: '--gaps' }],
138
- 'issue_execute': [{ cmd: 'maestro-execute', args: '' }],
139
- 'quick': [{ cmd: 'maestro-quick', args: '"{description}"' }],
140
- 'fork': [{ cmd: 'maestro-fork', args: '-m {milestone_num}' }],
141
- 'merge': [{ cmd: 'maestro-merge', args: '-m {milestone_num}' }],
142
- // Multi-step chains
143
- 'spec-driven': [{ cmd: 'maestro-init' }, { cmd: 'maestro-spec-generate', args: '"{description}"' }, { cmd: 'maestro-plan', args: '{phase}' }, { cmd: 'maestro-execute', args: '{phase}' }, { cmd: 'maestro-verify', args: '{phase}' }],
144
- 'brainstorm-driven': [{ cmd: 'maestro-brainstorm', args: '"{description}"' }, { cmd: 'maestro-plan', args: '{phase}' }, { cmd: 'maestro-execute', args: '{phase}' }, { cmd: 'maestro-verify', args: '{phase}' }],
145
- 'ui-design-driven': [{ cmd: 'maestro-ui-design', args: '{phase}' }, { cmd: 'maestro-plan', args: '{phase}' }, { cmd: 'maestro-execute', args: '{phase}' }, { cmd: 'maestro-verify', args: '{phase}' }],
146
- 'full-lifecycle': [{ cmd: 'maestro-plan', args: '{phase}' }, { cmd: 'maestro-execute', args: '{phase}' }, { cmd: 'maestro-verify', args: '{phase}' }, { cmd: 'quality-review', args: '{phase}' }, { cmd: 'quality-test', args: '{phase}' }, { cmd: 'maestro-milestone-audit' }, { cmd: 'maestro-milestone-complete' }],
147
- 'execute-verify': [{ cmd: 'maestro-execute', args: '{phase}' }, { cmd: 'maestro-verify', args: '{phase}' }],
148
- 'quality-loop': [{ cmd: 'maestro-verify', args: '{phase}' }, { cmd: 'quality-review', args: '{phase}' }, { cmd: 'quality-test', args: '{phase}' }, { cmd: 'quality-debug', args: '--from-uat {phase}' }, { cmd: 'maestro-plan', args: '{phase} --gaps' }, { cmd: 'maestro-execute', args: '{phase}' }],
149
- 'milestone-close': [{ cmd: 'maestro-milestone-audit' }, { cmd: 'maestro-milestone-complete' }],
150
- 'roadmap-driven': [{ cmd: 'maestro-init' }, { cmd: 'maestro-roadmap', args: '"{description}"' }, { cmd: 'maestro-plan', args: '{phase}' }, { cmd: 'maestro-execute', args: '{phase}' }, { cmd: 'maestro-verify', args: '{phase}' }],
151
- 'next-milestone': [{ cmd: 'maestro-roadmap', args: '"{description}"' }, { cmd: 'maestro-plan', args: '{phase}' }, { cmd: 'maestro-execute', args: '{phase}' }, { cmd: 'maestro-verify', args: '{phase}' }],
152
- 'analyze-plan-execute': [{ cmd: 'maestro-analyze', args: '"{description}" -q' }, { cmd: 'maestro-plan', args: '--dir {scratch_dir}' }, { cmd: 'maestro-execute', args: '--dir {scratch_dir}' }],
153
- // Issue lifecycle chains (with quality gates)
154
- 'issue-full': [{ cmd: 'maestro-analyze', args: '--gaps {issue_id}' }, { cmd: 'maestro-plan', args: '--gaps' }, { cmd: 'maestro-execute', args: '' }, { cmd: 'quality-review', args: '--scope {affected_files}' }, { cmd: 'manage-issue', args: 'close {issue_id} --resolution fixed' }],
155
- 'issue-quick': [{ cmd: 'maestro-plan', args: '--gaps' }, { cmd: 'maestro-execute', args: '' }, { cmd: 'manage-issue', args: 'close {issue_id} --resolution fixed' }],
156
- };
157
-
158
- // Aliases: task type → named multi-step chain
159
- const taskToChain = {
160
- 'spec_generate': 'spec-driven',
161
- 'brainstorm': 'brainstorm-driven',
162
- 'issue_execute': 'issue-full', // issue execute always gets review gate
163
- };
164
- ```
165
-
166
- **Resolution order:**
167
- 1. `forcedChain` → `chainMap[forcedChain]`
168
- 2. `state_continue` → `detectNextAction(projectState)`
169
- 3. `taskToChain[taskType]` → named chain
170
- 4. `chainMap[taskType]` → direct lookup
171
-
172
- ### 3d: Resolve phase number and issue ID
173
-
174
- **Phase**: from structured extraction → fallback regex (`phase N` or bare number) → null (milestone-wide default).
175
- **Issue ID**: from structured extraction → regex match `ISS-*-NNN`.
176
-
177
- When executing issue chains, replace `{issue_id}` in step args with the resolved issue ID.
178
-
179
- ---
180
-
181
- ## Step 4: Confirm
182
-
183
- **If `dryRun`:** Display chain and exit.
184
-
185
- ```
186
- MAESTRO-COORDINATE: {chain_name} (dry run)
187
- 1. [{cmd}] {args}
188
- 2. [{cmd}] {args}
189
- ```
190
-
191
- **If not autoYes:** AskUserQuestion — Execute / Execute from step N / Cancel.
192
-
193
- ---
194
-
195
- ## Step 5: Setup Session
196
-
197
- Create session directory `.workflow/.maestro/maestro-{YYYYMMDD-HHMMSS}/`.
198
-
199
- Initialize `status.json` with: session_id, intent, task_type, chain_name, tool, auto_mode, phase, current_step=0, gemini_session_id=null, step_analyses=[], steps[] (each: index, skill, args, status=pending, exec_id=null, analysis=null).
200
-
201
- Build context: `{ resolved_phase, user_intent, issue_id, spec_session_id: null }`.
202
-
203
- ---
204
-
205
- ## Step 6: Execute Step via codex delegate
206
-
207
- ### 6a: Assemble args
208
-
209
- Replace template placeholders (`{phase}`, `{description}`, `{issue_id}`, `{spec_session_id}`, `{scratch_dir}`) from context. Inject auto-flags if auto_mode: analyze/brainstorm/ui-design/spec-generate → `-y`, plan → `--auto`, quality-test → `--auto-fix`, quality-retrospective → `--auto-yes`.
210
-
211
- ### 6b: Build prompt from template
212
-
213
- Read `~/.maestro/templates/cli/prompts/coordinate-step.txt`, fill placeholders: `{{COMMAND}}`, `{{ARGS}}`, `{{STEP_N}}`, `{{AUTO_DIRECTIVE}}`, `{{CHAIN_NAME}}`, `{{ANALYSIS_HINTS}}`.
214
-
215
- Analysis hints assembled from previous step's gemini evaluation: prompt_additions, cautions, context_to_carry.
216
-
217
- ### 6c: Launch via codex delegate
218
-
219
- Display step header. Mark step as running, persist state. Execute:
220
-
221
- ```bash
222
- codex delegate '<prompt>' --to {tool} --mode write
223
- ```
224
-
225
- Run in background (timeout 600s). **STOP** -- wait for callback.
226
-
227
- ---
228
-
229
- ## Step 7: Post-Step Callback
230
-
231
- On callback:
232
- 1. Capture exec_id from stderr `[CODEX_EXEC_ID=xxx]`
233
- 2. **Context propagation**: extract `PHASE:`, `SPEC-*`, `scratch_dir:` from output
234
- 3. **Success/failure**: if failed + auto_mode → retry once then skip; if failed + interactive → ask Retry/Skip/Abort
235
- 4. Save output to `step-{N}-output.txt`, persist state
236
- 5. If completed + multi-step chain → **Step 7b** (gemini analysis); otherwise advance to next step or **Step 8**
237
-
238
- ---
239
-
240
- ## Step 7b: Analyze Step Output (via gemini)
241
-
242
- After each completed step, delegate to gemini for quality evaluation. Prompt includes: step command/args, last 200 lines of output, prior step analyses, next step info.
243
-
244
- Expected JSON response: `{ quality_score, execution_assessment: { success, completeness, key_outputs, missing_outputs }, issues: [{ severity, description }], next_step_hints: { prompt_additions, cautions, context_to_carry }, step_summary }`.
245
-
246
- ```bash
247
- codex delegate '<analysis_prompt>' --to gemini --mode analysis --rule analysis-review-code-quality [--resume {gemini_session_id}]
248
- ```
249
-
250
- Run in background (timeout 300s). **STOP** -- wait for callback.
251
-
252
- ### Step 7c: Post-Analyze Callback
253
-
254
- Capture gemini session ID for resume chain. Store analysis result (quality_score, issues, next_step_hints, summary) in `step_analyses[]` and per-step `analysis` field. Write `step-{N}-analysis.json`.
255
-
256
- Advance `current_step`. If more steps remain → back to **Step 6**; otherwise → **Step 8**.
257
-
258
- ---
259
-
260
- ## Step 8: Completion Report
261
-
262
- Finalize state: status = `completed` or `completed_with_errors`, persist `status.json`.
263
-
264
- Display completion banner: session, chain, tool, per-step status with quality scores, average quality score, resume command.
265
-
266
- ---
267
-
268
- ## Core Rules
269
-
270
- 1. **Semantic routing** — LLM-native structured extraction (`action × object`) replaces regex; disambiguates "问题" by context
271
- 2. **STOP after each `codex delegate` call** — background execution, wait for hook callback
272
- 3. **State machine** — advance via `current_step`, no sync loops for async operations
273
- 4. **Template-driven** — all steps use `coordinate-step.txt`, no per-command prompt assembly
274
- 5. **Context propagation** — parse PHASE / spec session ID / scratch_dir / issue_id from each step output, feed to next step
275
- 6. **Quality gates** — issue chains auto-include review; `issue-full` is default for issue execution
276
- 7. **Tool fallback** — if `codex delegate` fails: retry with same tool once, then try `gemini` → `qwen`
277
- 8. **Auto-confirm injection** — `{{AUTO_DIRECTIVE}}` in template prevents blocking during background execution
278
- 9. **Resumable** — `-c` reads `status.json`, jumps to first pending step
279
- 10. **Gemini analysis after each step** — evaluate output quality via `codex delegate --to gemini --mode analysis`, chained via `--resume`. Analysis generates `next_step_hints` injected into next step's prompt as `{{ANALYSIS_HINTS}}`
280
- 11. **Session capture** — after each gemini callback, capture exec_id → `gemini_session_id` for resume chain
281
- 12. **Analysis skip conditions** — skip gemini analysis for: failed/skipped steps, single-step chains