maestro-flow 0.3.9 → 0.3.11
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.
- package/.claude/agents/workflow-collab-planner.md +1 -1
- package/.claude/agents/workflow-executor.md +1 -1
- package/.claude/agents/workflow-plan-checker.md +1 -1
- package/.claude/agents/workflow-planner.md +1 -1
- package/.claude/commands/learn-decompose.md +176 -176
- package/.claude/commands/learn-follow.md +167 -167
- package/.claude/commands/learn-retro.md +1 -1
- package/.claude/commands/maestro-analyze.md +46 -3
- package/.claude/commands/maestro-coordinate.md +1 -3
- package/.claude/commands/maestro-execute.md +14 -0
- package/.claude/commands/maestro-plan.md +16 -0
- package/.claude/commands/manage-harvest.md +131 -131
- package/.claude/commands/manage-issue-discover.md +2 -2
- package/.claude/commands/manage-issue.md +5 -5
- package/.claude/commands/spec-add.md +67 -56
- package/.claude/commands/spec-load.md +66 -64
- package/.claude/commands/spec-setup.md +5 -9
- package/.codex/skills/learn-decompose/SKILL.md +119 -0
- package/.codex/skills/learn-follow/SKILL.md +83 -0
- package/.codex/skills/learn-investigate/SKILL.md +83 -0
- package/.codex/skills/learn-retro/SKILL.md +83 -0
- package/.codex/skills/learn-second-opinion/SKILL.md +86 -0
- package/.codex/skills/maestro/SKILL.md +335 -0
- package/.codex/skills/maestro-analyze/SKILL.md +84 -75
- package/.codex/skills/maestro-brainstorm/SKILL.md +452 -463
- package/.codex/skills/maestro-chain/SKILL.md +233 -0
- package/.codex/skills/maestro-coordinate/SKILL.md +167 -278
- package/.codex/skills/maestro-execute/SKILL.md +435 -438
- package/.codex/skills/maestro-fork/SKILL.md +68 -0
- package/.codex/skills/maestro-init/SKILL.md +171 -167
- package/.codex/skills/maestro-learn/SKILL.md +80 -0
- package/.codex/skills/maestro-link-coordinate/SKILL.md +224 -220
- package/.codex/skills/maestro-merge/SKILL.md +62 -0
- package/.codex/skills/maestro-milestone-audit/SKILL.md +108 -103
- package/.codex/skills/maestro-milestone-complete/SKILL.md +155 -149
- package/.codex/skills/maestro-milestone-release/SKILL.md +70 -0
- package/.codex/skills/maestro-overlay/SKILL.md +188 -185
- package/.codex/skills/maestro-plan/SKILL.md +66 -69
- package/.codex/skills/maestro-quick/SKILL.md +26 -23
- package/.codex/skills/maestro-roadmap/SKILL.md +65 -73
- package/.codex/skills/maestro-spec-generate/SKILL.md +66 -74
- package/.codex/skills/maestro-ui-design/SKILL.md +34 -31
- package/.codex/skills/maestro-verify/SKILL.md +556 -566
- package/.codex/skills/manage-codebase-rebuild/SKILL.md +397 -405
- package/.codex/skills/manage-codebase-refresh/SKILL.md +93 -82
- package/.codex/skills/manage-harvest/SKILL.md +82 -0
- package/.codex/skills/manage-issue/SKILL.md +80 -65
- package/.codex/skills/manage-issue-discover/SKILL.md +491 -503
- package/.codex/skills/manage-learn/SKILL.md +190 -186
- package/.codex/skills/manage-memory/SKILL.md +95 -72
- package/.codex/skills/manage-memory-capture/SKILL.md +99 -86
- package/.codex/skills/manage-status/SKILL.md +102 -89
- package/.codex/skills/quality-business-test/SKILL.md +228 -223
- package/.codex/skills/quality-debug/SKILL.md +54 -66
- package/.codex/skills/quality-integration-test/SKILL.md +532 -544
- package/.codex/skills/quality-refactor/SKILL.md +197 -191
- package/.codex/skills/quality-retrospective/SKILL.md +512 -505
- package/.codex/skills/quality-review/SKILL.md +93 -105
- package/.codex/skills/quality-sync/SKILL.md +101 -89
- package/.codex/skills/quality-test/SKILL.md +202 -198
- package/.codex/skills/quality-test-gen/SKILL.md +93 -104
- package/.codex/skills/spec-add/SKILL.md +58 -39
- package/.codex/skills/spec-load/SKILL.md +45 -40
- package/.codex/skills/spec-map/SKILL.md +180 -182
- package/.codex/skills/spec-setup/SKILL.md +94 -76
- package/.codex/skills/team-coordinate/SKILL.md +346 -357
- package/.codex/skills/team-executor/SKILL.md +70 -112
- package/.codex/skills/team-lifecycle-v4/SKILL.md +311 -299
- package/.codex/skills/team-quality-assurance/SKILL.md +234 -227
- package/.codex/skills/team-review/SKILL.md +232 -225
- package/.codex/skills/team-tech-debt/SKILL.md +78 -100
- package/.codex/skills/team-testing/SKILL.md +242 -235
- package/.codex/skills/wiki-connect/SKILL.md +75 -0
- package/.codex/skills/wiki-digest/SKILL.md +87 -0
- package/README.md +14 -11
- package/README.zh-CN.md +14 -11
- package/chains/issue-lifecycle.json +13 -13
- package/chains/singles/issue-analyze.json +3 -3
- package/chains/singles/issue-execute.json +3 -3
- package/chains/singles/issue-plan.json +3 -3
- package/dashboard/dist-server/dashboard/src/server/commander/commander-agent.js +2 -2
- package/dashboard/dist-server/dashboard/src/server/commander/commander-agent.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/coordinator/chain-map.js +3 -3
- package/dashboard/dist-server/dashboard/src/server/coordinator/chain-map.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/routes/issues.js +34 -0
- package/dashboard/dist-server/dashboard/src/server/routes/issues.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/routes/specs.d.ts +1 -1
- package/dashboard/dist-server/dashboard/src/server/routes/specs.js +75 -30
- package/dashboard/dist-server/dashboard/src/server/routes/specs.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/state/event-bus.d.ts +5 -0
- package/dashboard/dist-server/dashboard/src/server/state/event-bus.js +5 -0
- package/dashboard/dist-server/dashboard/src/server/state/event-bus.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/ws/handlers/execution-handler.js +2 -3
- package/dashboard/dist-server/dashboard/src/server/ws/handlers/execution-handler.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/shared/constants.js +5 -0
- package/dashboard/dist-server/dashboard/src/shared/constants.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/shared/issue-types.d.ts +5 -0
- package/dashboard/dist-server/dashboard/src/shared/issue-types.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/shared/normalize-task.d.ts +2 -0
- package/dashboard/dist-server/dashboard/src/shared/normalize-task.js +75 -0
- package/dashboard/dist-server/dashboard/src/shared/normalize-task.js.map +1 -0
- package/dashboard/dist-server/dashboard/src/shared/team-types.d.ts +21 -0
- package/dashboard/dist-server/dashboard/src/shared/team-types.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/shared/types.d.ts +3 -2
- package/dashboard/dist-server/dashboard/src/shared/ws-protocol.d.ts +1 -1
- package/dashboard/dist-server/dashboard/src/shared/ws-protocol.js.map +1 -1
- package/dashboard/dist-server/src/hooks/constants.d.ts +92 -12
- package/dashboard/dist-server/src/hooks/constants.js +151 -16
- package/dashboard/dist-server/src/hooks/constants.js.map +1 -1
- package/dashboard/dist-server/src/types/index.d.ts +5 -0
- package/dist/src/commands/collab.d.ts +1 -34
- package/dist/src/commands/collab.d.ts.map +1 -1
- package/dist/src/commands/collab.js +8 -76
- package/dist/src/commands/collab.js.map +1 -1
- package/dist/src/commands/hooks.d.ts +5 -1
- package/dist/src/commands/hooks.d.ts.map +1 -1
- package/dist/src/commands/hooks.js +115 -10
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/install-ui/InstallConfirm.d.ts +3 -1
- package/dist/src/commands/install-ui/InstallConfirm.d.ts.map +1 -1
- package/dist/src/commands/install-ui/InstallConfirm.js +3 -1
- package/dist/src/commands/install-ui/InstallConfirm.js.map +1 -1
- package/dist/src/commands/install-ui/InstallExecution.d.ts.map +1 -1
- package/dist/src/commands/install-ui/InstallExecution.js +5 -1
- package/dist/src/commands/install-ui/InstallExecution.js.map +1 -1
- package/dist/src/commands/install-ui/InstallFlow.d.ts.map +1 -1
- package/dist/src/commands/install-ui/InstallFlow.js +7 -3
- package/dist/src/commands/install-ui/InstallFlow.js.map +1 -1
- package/dist/src/commands/install-ui/StatuslineConfig.d.ts +6 -1
- package/dist/src/commands/install-ui/StatuslineConfig.d.ts.map +1 -1
- package/dist/src/commands/install-ui/StatuslineConfig.js +27 -5
- package/dist/src/commands/install-ui/StatuslineConfig.js.map +1 -1
- package/dist/src/commands/spec.d.ts.map +1 -1
- package/dist/src/commands/spec.js +7 -2
- package/dist/src/commands/spec.js.map +1 -1
- package/dist/src/hooks/__tests__/statusline-visual-test.d.ts +7 -0
- package/dist/src/hooks/__tests__/statusline-visual-test.d.ts.map +1 -0
- package/dist/src/hooks/__tests__/statusline-visual-test.js +236 -0
- package/dist/src/hooks/__tests__/statusline-visual-test.js.map +1 -0
- package/dist/src/hooks/constants.d.ts +92 -12
- package/dist/src/hooks/constants.d.ts.map +1 -1
- package/dist/src/hooks/constants.js +151 -16
- package/dist/src/hooks/constants.js.map +1 -1
- package/dist/src/hooks/guards/index.d.ts +2 -0
- package/dist/src/hooks/guards/index.d.ts.map +1 -1
- package/dist/src/hooks/guards/index.js +2 -0
- package/dist/src/hooks/guards/index.js.map +1 -1
- package/dist/src/hooks/guards/preflight-guard.d.ts +29 -0
- package/dist/src/hooks/guards/preflight-guard.d.ts.map +1 -0
- package/dist/src/hooks/guards/preflight-guard.js +95 -0
- package/dist/src/hooks/guards/preflight-guard.js.map +1 -0
- package/dist/src/hooks/guards/spec-validator.d.ts +25 -0
- package/dist/src/hooks/guards/spec-validator.d.ts.map +1 -0
- package/dist/src/hooks/guards/spec-validator.js +66 -0
- package/dist/src/hooks/guards/spec-validator.js.map +1 -0
- package/dist/src/hooks/index.d.ts +1 -0
- package/dist/src/hooks/index.d.ts.map +1 -1
- package/dist/src/hooks/index.js +1 -0
- package/dist/src/hooks/index.js.map +1 -1
- package/dist/src/hooks/keyword-spec-injector.d.ts +21 -0
- package/dist/src/hooks/keyword-spec-injector.d.ts.map +1 -0
- package/dist/src/hooks/keyword-spec-injector.js +96 -0
- package/dist/src/hooks/keyword-spec-injector.js.map +1 -0
- package/dist/src/hooks/plugins/spec-injection-plugin.d.ts +2 -1
- package/dist/src/hooks/plugins/spec-injection-plugin.d.ts.map +1 -1
- package/dist/src/hooks/plugins/spec-injection-plugin.js +21 -12
- package/dist/src/hooks/plugins/spec-injection-plugin.js.map +1 -1
- package/dist/src/hooks/preflight-core.d.ts +37 -0
- package/dist/src/hooks/preflight-core.d.ts.map +1 -0
- package/dist/src/hooks/preflight-core.js +86 -0
- package/dist/src/hooks/preflight-core.js.map +1 -0
- package/dist/src/hooks/spec-bridge.d.ts +40 -0
- package/dist/src/hooks/spec-bridge.d.ts.map +1 -0
- package/dist/src/hooks/spec-bridge.js +97 -0
- package/dist/src/hooks/spec-bridge.js.map +1 -0
- package/dist/src/hooks/spec-injector.d.ts.map +1 -1
- package/dist/src/hooks/spec-injector.js +18 -12
- package/dist/src/hooks/spec-injector.js.map +1 -1
- package/dist/src/hooks/statusline.d.ts +8 -17
- package/dist/src/hooks/statusline.d.ts.map +1 -1
- package/dist/src/hooks/statusline.js +269 -112
- package/dist/src/hooks/statusline.js.map +1 -1
- package/dist/src/i18n/locales/en.d.ts.map +1 -1
- package/dist/src/i18n/locales/en.js +5 -0
- package/dist/src/i18n/locales/en.js.map +1 -1
- package/dist/src/i18n/locales/zh.d.ts.map +1 -1
- package/dist/src/i18n/locales/zh.js +5 -0
- package/dist/src/i18n/locales/zh.js.map +1 -1
- package/dist/src/i18n/types.d.ts +5 -0
- package/dist/src/i18n/types.d.ts.map +1 -1
- package/dist/src/team/phase-orchestrator.d.ts +52 -0
- package/dist/src/team/phase-orchestrator.d.ts.map +1 -0
- package/dist/src/team/phase-orchestrator.js +165 -0
- package/dist/src/team/phase-orchestrator.js.map +1 -0
- package/dist/src/team/phase-types.d.ts +51 -0
- package/dist/src/team/phase-types.d.ts.map +1 -0
- package/dist/src/team/phase-types.js +41 -0
- package/dist/src/team/phase-types.js.map +1 -0
- package/dist/src/tools/collab-adapter.d.ts +17 -0
- package/dist/src/tools/collab-adapter.d.ts.map +1 -1
- package/dist/src/tools/collab-adapter.js +138 -0
- package/dist/src/tools/collab-adapter.js.map +1 -1
- package/dist/src/tools/index.d.ts.map +1 -1
- package/dist/src/tools/index.js +6 -0
- package/dist/src/tools/index.js.map +1 -1
- package/dist/src/tools/merge-validator.d.ts +24 -0
- package/dist/src/tools/merge-validator.d.ts.map +1 -0
- package/dist/src/tools/merge-validator.js +220 -0
- package/dist/src/tools/merge-validator.js.map +1 -0
- package/dist/src/tools/spec-entry-parser.d.ts +56 -0
- package/dist/src/tools/spec-entry-parser.d.ts.map +1 -0
- package/dist/src/tools/spec-entry-parser.js +196 -0
- package/dist/src/tools/spec-entry-parser.js.map +1 -0
- package/dist/src/tools/spec-init.d.ts.map +1 -1
- package/dist/src/tools/spec-init.js +66 -92
- package/dist/src/tools/spec-init.js.map +1 -1
- package/dist/src/tools/spec-keyword-index.d.ts +30 -0
- package/dist/src/tools/spec-keyword-index.d.ts.map +1 -0
- package/dist/src/tools/spec-keyword-index.js +101 -0
- package/dist/src/tools/spec-keyword-index.js.map +1 -0
- package/dist/src/tools/spec-loader.d.ts +3 -3
- package/dist/src/tools/spec-loader.d.ts.map +1 -1
- package/dist/src/tools/spec-loader.js +49 -23
- package/dist/src/tools/spec-loader.js.map +1 -1
- package/dist/src/tools/team-agents.d.ts +27 -0
- package/dist/src/tools/team-agents.d.ts.map +1 -0
- package/dist/src/tools/team-agents.js +362 -0
- package/dist/src/tools/team-agents.js.map +1 -0
- package/dist/src/tools/team-mailbox.d.ts +40 -0
- package/dist/src/tools/team-mailbox.d.ts.map +1 -0
- package/dist/src/tools/team-mailbox.js +384 -0
- package/dist/src/tools/team-mailbox.js.map +1 -0
- package/dist/src/tools/team-msg.d.ts +17 -8
- package/dist/src/tools/team-msg.d.ts.map +1 -1
- package/dist/src/tools/team-msg.js +110 -13
- package/dist/src/tools/team-msg.js.map +1 -1
- package/dist/src/tools/team-tasks-mcp.d.ts +27 -0
- package/dist/src/tools/team-tasks-mcp.d.ts.map +1 -0
- package/dist/src/tools/team-tasks-mcp.js +408 -0
- package/dist/src/tools/team-tasks-mcp.js.map +1 -0
- package/dist/src/types/index.d.ts +5 -0
- package/dist/src/types/index.d.ts.map +1 -1
- package/package.json +2 -1
- package/templates/cli/prompts/workflow-skill-conflict-patterns.txt +3 -3
- package/templates/cli/prompts/workflow-skill-lessons-learned.txt +3 -3
- package/templates/search-tools.md +1 -1
- package/workflows/analyze.md +816 -816
- package/workflows/brainstorm.md +471 -471
- package/workflows/cli-tools-usage.md +44 -27
- package/workflows/codebase-rebuild.md +332 -332
- package/workflows/codebase-refresh.md +240 -240
- package/workflows/delegate-usage.md +3 -3
- package/workflows/execute.md +1 -1
- package/workflows/harvest.md +420 -420
- package/workflows/integration-test.md +343 -343
- package/workflows/issue-analyze.md +6 -2
- package/workflows/issue-discover.md +414 -414
- package/workflows/issue-execute.md +6 -3
- package/workflows/issue-plan.md +5 -2
- package/workflows/maestro-coordinate.codex.md +281 -470
- package/workflows/maestro-coordinate.md +14 -14
- package/workflows/maestro-link-coordinate.md +2 -2
- package/workflows/maestro.codex.md +710 -0
- package/workflows/maestro.md +10 -11
- package/workflows/map.md +111 -111
- package/workflows/milestone-complete.md +176 -176
- package/workflows/plan.md +1 -1
- package/workflows/quick.md +497 -497
- package/workflows/refactor.md +300 -300
- package/workflows/retrospective.md +1 -1
- package/workflows/roadmap.md +335 -335
- package/workflows/spec-generate.md +640 -640
- package/workflows/specs-add.md +46 -81
- package/workflows/specs-load.md +15 -17
- package/workflows/specs-setup.md +40 -161
- package/.claude/commands/manage-issue-analyze.md +0 -62
- package/.claude/commands/manage-issue-execute.md +0 -73
- package/.claude/commands/manage-issue-plan.md +0 -62
- package/.codex/skills/manage-issue-analyze/SKILL.md +0 -207
- package/.codex/skills/manage-issue-execute/SKILL.md +0 -200
- package/.codex/skills/manage-issue-plan/SKILL.md +0 -186
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: maestro
|
|
3
|
+
description: Intelligent coordinator — analyze intent, read project state, select chain, execute wave-by-wave via spawn_agents_on_csv. Coordinator only assembles prompts and reads artifacts — never executes skills directly.
|
|
4
|
+
argument-hint: "\"intent text\" [-y] [-c|--continue] [--dry-run] [--chain <name>]"
|
|
5
|
+
allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<purpose>
|
|
9
|
+
Wave-based pipeline coordinator. All skill execution happens exclusively in spawned sub-agents
|
|
10
|
+
via `spawn_agents_on_csv` — the coordinator never executes skills directly.
|
|
11
|
+
|
|
12
|
+
Coordinator loop: classify intent → resolve chain → build wave CSV → spawn → read results →
|
|
13
|
+
(barrier: read artifacts, update context, assemble next skill_call args) → next wave → report.
|
|
14
|
+
|
|
15
|
+
Each wave = 1 barrier task (solo) or N parallel non-barrier tasks.
|
|
16
|
+
</purpose>
|
|
17
|
+
|
|
18
|
+
<required_reading>
|
|
19
|
+
@~/.maestro/workflows/maestro.codex.md — authoritative `detectTaskType`, `detectNextAction`, `chainMap` (35+ intent patterns, 40+ chain types). Read before executing any step.
|
|
20
|
+
</required_reading>
|
|
21
|
+
|
|
22
|
+
<context>
|
|
23
|
+
$ARGUMENTS — user intent text, or special flags.
|
|
24
|
+
|
|
25
|
+
**Flags:**
|
|
26
|
+
- `-y, --yes` — Auto mode: skip all prompts; propagate `-y` to each skill
|
|
27
|
+
- `--continue` — Resume latest paused session from last incomplete wave
|
|
28
|
+
- `--dry-run` — Display planned chain without executing
|
|
29
|
+
- `--chain <name>` — Force specific chain (skips intent classification)
|
|
30
|
+
|
|
31
|
+
**Session state**: `.workflow/.maestro-coordinate/{session-id}/`
|
|
32
|
+
**Core output**: `tasks.csv` (master) + `wave-{N}-results.csv` (per wave) + `context.md` (report)
|
|
33
|
+
</context>
|
|
34
|
+
|
|
35
|
+
<invariants>
|
|
36
|
+
1. **ALL skills via spawn_agents_on_csv**: Every skill invocation — barrier or non-barrier — MUST go through `spawn_agents_on_csv`. Coordinator NEVER directly executes any skill. No exceptions.
|
|
37
|
+
2. **Coordinator = prompt assembler only**: Classify intent → build CSV → spawn → read results → assemble next CSV. It never runs skill logic itself.
|
|
38
|
+
3. **Barrier ≠ execution**: Barrier designation only means the coordinator **pauses after the wave** to read artifacts and assemble the next wave's prompt args. Coordinator role at barrier: **discover artifacts → read → update context → assemble next skill_call args**. Nothing more.
|
|
39
|
+
4. **Barrier = solo wave**: A barrier skill always executes alone in its wave (wave size = 1).
|
|
40
|
+
5. **Non-barriers can parallel**: Consecutive non-barrier skills grouped into one wave (`max_workers = N`).
|
|
41
|
+
6. **Wave-by-wave**: Never start wave N+1 before wave N results are read and analyzed.
|
|
42
|
+
7. **Coordinator owns context**: Sub-agents never read prior results — coordinator assembles the full `skill_call` with resolved args.
|
|
43
|
+
8. **Simple instruction**: Sub-agent instruction is minimal — just "execute {skill_call}, report result".
|
|
44
|
+
9. **Abort on failure**: Failed step → mark remaining as skipped → report.
|
|
45
|
+
10. **Resume from wave**: `--continue` finds last completed wave, resumes from next pending step.
|
|
46
|
+
</invariants>
|
|
47
|
+
|
|
48
|
+
<chain_map>
|
|
49
|
+
| Intent keywords | Chain | Steps (skills, in order) |
|
|
50
|
+
|----------------|-------|--------------------------|
|
|
51
|
+
| fix, bug, error, broken, crash | `quality-fix` | $maestro-analyze --gaps → $maestro-plan --gaps → $maestro-execute → $maestro-verify |
|
|
52
|
+
| test, spec, coverage | `quality-test` | $quality-test |
|
|
53
|
+
| refactor, cleanup, debt | `quality-refactor` | $quality-refactor |
|
|
54
|
+
| feature, implement, add, build | `feature` | $maestro-plan → $maestro-execute → $maestro-verify |
|
|
55
|
+
| review, check, audit | `quality-review` | $quality-review |
|
|
56
|
+
| deploy, release, ship | `deploy` | $maestro-verify → $maestro-execute |
|
|
57
|
+
</chain_map>
|
|
58
|
+
|
|
59
|
+
<barrier_skills>
|
|
60
|
+
Skills that produce artifacts the coordinator must read before assembling the next wave.
|
|
61
|
+
After a barrier skill completes **in its spawned sub-agent**, coordinator reads output and updates `state.context`.
|
|
62
|
+
|
|
63
|
+
| Skill | Artifacts to Read | Context Updates |
|
|
64
|
+
|-------|------------------|-----------------|
|
|
65
|
+
| `maestro-analyze` | `.workflow/.csv-wave/*/context.md`, `state.json` | `gaps`, `phase`, `analysis_dir` |
|
|
66
|
+
| `maestro-plan` | `{phase_dir}/plan.json`, `{phase_dir}/.task/TASK-*.json` | `plan_dir`, `task_count`, `wave_count` |
|
|
67
|
+
| `maestro-brainstorm` | `.workflow/.csv-wave/*/.brainstorming/` | `brainstorm_dir`, `features` |
|
|
68
|
+
| `maestro-spec-generate` | `.workflow/.csv-wave/*/specs/` | `spec_session_id` |
|
|
69
|
+
| `maestro-execute` | `.workflow/.csv-wave/*/results.csv` | `exec_status`, `completed_tasks`, `failed_tasks` |
|
|
70
|
+
|
|
71
|
+
**Non-barrier skills** (groupable into multi-task waves): `maestro-verify`, `quality-review`, `quality-test`, `quality-debug`, `quality-refactor`, `quality-sync`, `manage-*`
|
|
72
|
+
|
|
73
|
+
### Barrier Analysis Logic
|
|
74
|
+
|
|
75
|
+
```javascript
|
|
76
|
+
function analyzeBarrierArtifacts(step, result, ctx) {
|
|
77
|
+
const artifactPath = result.artifacts;
|
|
78
|
+
switch (step.skill) {
|
|
79
|
+
case 'maestro-analyze':
|
|
80
|
+
const contextMd = Read(`${artifactPath}/context.md`);
|
|
81
|
+
ctx.analysis_dir = artifactPath;
|
|
82
|
+
ctx.gaps = extractGaps(contextMd);
|
|
83
|
+
if (!ctx.phase) ctx.phase = extractPhase(contextMd);
|
|
84
|
+
break;
|
|
85
|
+
case 'maestro-plan':
|
|
86
|
+
const planJson = JSON.parse(Read(`${artifactPath}/plan.json`));
|
|
87
|
+
ctx.plan_dir = artifactPath;
|
|
88
|
+
ctx.task_count = planJson.tasks?.length ?? 0;
|
|
89
|
+
ctx.wave_count = planJson.waves?.length ?? 0;
|
|
90
|
+
break;
|
|
91
|
+
case 'maestro-brainstorm':
|
|
92
|
+
ctx.brainstorm_dir = artifactPath;
|
|
93
|
+
break;
|
|
94
|
+
case 'maestro-spec-generate':
|
|
95
|
+
ctx.spec_session_id = extractSpecId(artifactPath);
|
|
96
|
+
break;
|
|
97
|
+
case 'maestro-execute':
|
|
98
|
+
const execResults = Read(`${artifactPath}/results.csv`);
|
|
99
|
+
ctx.exec_completed = countStatus(execResults, 'completed');
|
|
100
|
+
ctx.exec_failed = countStatus(execResults, 'failed');
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
</barrier_skills>
|
|
106
|
+
|
|
107
|
+
<execution>
|
|
108
|
+
|
|
109
|
+
### Phase 1: Resolve Intent and Chain
|
|
110
|
+
|
|
111
|
+
**`--continue`**: Glob `.workflow/.maestro-coordinate/MCC-*/state.json` sorted desc; load most recent; resume from first pending wave.
|
|
112
|
+
|
|
113
|
+
**Fresh mode**:
|
|
114
|
+
1. Read `.workflow/state.json` for project context (`current_phase`, `workflow_name`)
|
|
115
|
+
2. If `--chain` given, use directly
|
|
116
|
+
3. Otherwise classify intent via keyword heuristics (see chain_map)
|
|
117
|
+
4. No match + not AUTO_YES → one clarifying question via `AskUserQuestion`
|
|
118
|
+
5. Resolve chain's skill list
|
|
119
|
+
6. Write `state.json`:
|
|
120
|
+
|
|
121
|
+
```javascript
|
|
122
|
+
const sessionId = `MCC-${dateStr}-${timeStr}`;
|
|
123
|
+
const sessionDir = `.workflow/.maestro-coordinate/${sessionId}`;
|
|
124
|
+
|
|
125
|
+
Write(`${sessionDir}/state.json`, JSON.stringify({
|
|
126
|
+
id: sessionId, intent, chain: resolvedChain, auto_yes: AUTO_YES,
|
|
127
|
+
status: "in_progress", started_at: new Date().toISOString(),
|
|
128
|
+
context: { phase: null, plan_dir: null, analysis_dir: null,
|
|
129
|
+
brainstorm_dir: null, spec_session_id: null, gaps: null },
|
|
130
|
+
waves: [],
|
|
131
|
+
steps: chain.map((skill, i) => ({
|
|
132
|
+
step_n: i + 1, skill: skill.cmd, args: skill.args ?? '',
|
|
133
|
+
status: "pending", wave_n: null
|
|
134
|
+
}))
|
|
135
|
+
}, null, 2));
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**`--dry-run`**: Display chain with `[BARRIER]` markers, stop.
|
|
139
|
+
|
|
140
|
+
**User confirmation** (skip if AUTO_YES): Display plan, prompt `Proceed? (yes/no)`.
|
|
141
|
+
|
|
142
|
+
### Phase 2: Wave Execution Loop
|
|
143
|
+
|
|
144
|
+
```javascript
|
|
145
|
+
let waveNum = 0;
|
|
146
|
+
while (state.steps.some(s => s.status === 'pending')) {
|
|
147
|
+
waveNum++;
|
|
148
|
+
const waveSteps = buildNextWave(state.steps);
|
|
149
|
+
|
|
150
|
+
// Build CSV — coordinator assembles skill_call, sub-agent executes verbatim
|
|
151
|
+
const csvContent = 'id,skill_call,topic\n' + waveSteps.map(step =>
|
|
152
|
+
`"${step.step_n}","${buildSkillCall(step, state.context).replace(/"/g, '""')}","Chain \"${state.chain}\" step ${step.step_n}/${state.steps.length}"`
|
|
153
|
+
).join('\n');
|
|
154
|
+
Write(`${sessionDir}/wave-${waveNum}.csv`, csvContent);
|
|
155
|
+
|
|
156
|
+
// Spawn — ALL execution via spawn_agents_on_csv, never direct
|
|
157
|
+
spawn_agents_on_csv({
|
|
158
|
+
csv_path: `${sessionDir}/wave-${waveNum}.csv`,
|
|
159
|
+
id_column: "id", instruction: WAVE_INSTRUCTION,
|
|
160
|
+
max_workers: waveSteps.length > 1 ? waveSteps.length : 1,
|
|
161
|
+
max_runtime_seconds: 1800,
|
|
162
|
+
output_csv_path: `${sessionDir}/wave-${waveNum}-results.csv`,
|
|
163
|
+
output_schema: RESULT_SCHEMA
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
// Read results, update status
|
|
167
|
+
const results = readCSV(`${sessionDir}/wave-${waveNum}-results.csv`);
|
|
168
|
+
for (const row of results) {
|
|
169
|
+
const step = state.steps.find(s => s.step_n === parseInt(row.id));
|
|
170
|
+
step.status = row.status; step.findings = row.findings; step.wave_n = waveNum;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// Barrier: read artifacts, update context (NOT execute — skill already ran in sub-agent)
|
|
174
|
+
if (isBarrier(waveSteps[0].skill)) {
|
|
175
|
+
analyzeBarrierArtifacts(waveSteps[0], results[0], state.context);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// Persist + abort check
|
|
179
|
+
state.waves.push({ wave_n: waveNum, steps: waveSteps.map(s => s.step_n), results });
|
|
180
|
+
Write(`${sessionDir}/state.json`, JSON.stringify(state, null, 2));
|
|
181
|
+
|
|
182
|
+
if (results.some(r => r.status === 'failed')) {
|
|
183
|
+
state.status = 'aborted';
|
|
184
|
+
state.steps.filter(s => s.status === 'pending').forEach(s => s.status = 'skipped');
|
|
185
|
+
Write(`${sessionDir}/state.json`, JSON.stringify(state, null, 2));
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Skill Call Assembly
|
|
192
|
+
|
|
193
|
+
```javascript
|
|
194
|
+
const BARRIER_SKILLS = new Set([
|
|
195
|
+
'maestro-analyze', 'maestro-plan', 'maestro-brainstorm',
|
|
196
|
+
'maestro-spec-generate', 'maestro-execute'
|
|
197
|
+
]);
|
|
198
|
+
const AUTO_FLAG_MAP = {
|
|
199
|
+
'maestro-analyze': '-y', 'maestro-brainstorm': '-y',
|
|
200
|
+
'maestro-ui-design': '-y', 'maestro-plan': '--auto',
|
|
201
|
+
'maestro-spec-generate': '-y', 'quality-test': '--auto-fix',
|
|
202
|
+
'quality-retrospective': '--auto-yes',
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
function buildSkillCall(step, ctx) {
|
|
206
|
+
let args = (step.args ?? '')
|
|
207
|
+
.replace(/{phase}/g, ctx.phase ?? '')
|
|
208
|
+
.replace(/{description}/g, state.intent ?? '')
|
|
209
|
+
.replace(/{issue_id}/g, ctx.issue_id ?? '')
|
|
210
|
+
.replace(/{plan_dir}/g, ctx.plan_dir ?? '')
|
|
211
|
+
.replace(/{analysis_dir}/g, ctx.analysis_dir ?? '')
|
|
212
|
+
.replace(/{brainstorm_dir}/g, ctx.brainstorm_dir ?? '')
|
|
213
|
+
.replace(/{spec_session_id}/g, ctx.spec_session_id ?? '');
|
|
214
|
+
if (state.auto_yes) {
|
|
215
|
+
const flag = AUTO_FLAG_MAP[step.skill];
|
|
216
|
+
if (flag && !args.includes(flag)) args = args ? `${args} ${flag}` : flag;
|
|
217
|
+
}
|
|
218
|
+
return `$${step.skill} ${args}`.trim();
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function buildNextWave(steps) {
|
|
222
|
+
const pending = steps.filter(s => s.status === 'pending');
|
|
223
|
+
if (!pending.length) return [];
|
|
224
|
+
if (BARRIER_SKILLS.has(pending[0].skill)) return [pending[0]];
|
|
225
|
+
const wave = [pending[0]];
|
|
226
|
+
for (let i = 1; i < pending.length; i++) {
|
|
227
|
+
if (BARRIER_SKILLS.has(pending[i].skill)) break;
|
|
228
|
+
wave.push(pending[i]);
|
|
229
|
+
}
|
|
230
|
+
return wave;
|
|
231
|
+
}
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Sub-Agent Instruction Template
|
|
235
|
+
|
|
236
|
+
```
|
|
237
|
+
你是 CSV job 子 agent。
|
|
238
|
+
|
|
239
|
+
先原样执行这一段技能调用:
|
|
240
|
+
{skill_call}
|
|
241
|
+
|
|
242
|
+
然后基于结果完成这一行任务说明:
|
|
243
|
+
{topic}
|
|
244
|
+
|
|
245
|
+
限制:
|
|
246
|
+
- 不要修改 .workflow/.maestro-coordinate/ 下的 state 文件
|
|
247
|
+
- skill 内部有自己的 session 管理,按 skill SKILL.md 执行即可
|
|
248
|
+
|
|
249
|
+
最后必须调用 `report_agent_job_result`,返回 JSON:
|
|
250
|
+
{"status":"completed|failed","skill_call":"{skill_call}","summary":"一句话结果","artifacts":"产物路径或空字符串","error":"失败原因或空字符串"}
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### Result Schema
|
|
254
|
+
|
|
255
|
+
```javascript
|
|
256
|
+
const RESULT_SCHEMA = {
|
|
257
|
+
type: "object",
|
|
258
|
+
properties: {
|
|
259
|
+
status: { type: "string", enum: ["completed", "failed"] },
|
|
260
|
+
skill_call: { type: "string" },
|
|
261
|
+
summary: { type: "string" },
|
|
262
|
+
artifacts: { type: "string" },
|
|
263
|
+
error: { type: "string" }
|
|
264
|
+
},
|
|
265
|
+
required: ["status", "skill_call", "summary", "artifacts", "error"]
|
|
266
|
+
};
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### Phase 3: Completion Report
|
|
270
|
+
|
|
271
|
+
```
|
|
272
|
+
=== COORDINATE COMPLETE ===
|
|
273
|
+
Session: <sessionId>
|
|
274
|
+
Chain: <chain>
|
|
275
|
+
Waves: <N> executed
|
|
276
|
+
Steps: <completed>/<total>
|
|
277
|
+
|
|
278
|
+
WAVE RESULTS:
|
|
279
|
+
[W1] $maestro-analyze --gaps → ✓ found 3 gaps
|
|
280
|
+
[W2] $maestro-plan --gaps → ✓ 12 tasks in 3 waves
|
|
281
|
+
[W3] $maestro-execute → ✓ 12/12 tasks done
|
|
282
|
+
[W4] $maestro-verify → ✓ all criteria met
|
|
283
|
+
|
|
284
|
+
State: .workflow/.maestro-coordinate/<sessionId>/state.json
|
|
285
|
+
Resume: $maestro --continue
|
|
286
|
+
```
|
|
287
|
+
</execution>
|
|
288
|
+
|
|
289
|
+
<csv_schema>
|
|
290
|
+
### wave-{N}.csv (Per-Wave Input)
|
|
291
|
+
|
|
292
|
+
```csv
|
|
293
|
+
id,skill_call,topic
|
|
294
|
+
"1","$maestro-analyze --gaps \"fix auth\" -y","Chain \"quality-fix\" step 1/4"
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
| Column | Description |
|
|
298
|
+
|--------|-------------|
|
|
299
|
+
| `id` | Step number from chain (string) |
|
|
300
|
+
| `skill_call` | Full skill invocation assembled by coordinator with resolved context |
|
|
301
|
+
| `topic` | Brief description for the agent |
|
|
302
|
+
|
|
303
|
+
### tasks.csv (Master State)
|
|
304
|
+
|
|
305
|
+
```csv
|
|
306
|
+
id,skill,args,wave_n,status,findings,artifacts,error
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
Accumulated across all waves. Updated after each wave completes.
|
|
310
|
+
</csv_schema>
|
|
311
|
+
|
|
312
|
+
<error_codes>
|
|
313
|
+
| Code | Severity | Condition | Recovery |
|
|
314
|
+
|------|----------|-----------|----------|
|
|
315
|
+
| E001 | error | Intent unclassifiable after clarification | Default to `feature` chain |
|
|
316
|
+
| E002 | error | `--chain` value not in chain map | List valid chains, abort |
|
|
317
|
+
| E003 | error | Wave timeout (max_runtime_seconds) | Mark step `failed`, abort chain |
|
|
318
|
+
| E004 | error | Barrier artifact not found | Retry wave once, then abort |
|
|
319
|
+
| E005 | error | `--continue`: no session found | List sessions, prompt |
|
|
320
|
+
| W001 | warning | Barrier artifact partial | Continue with available context |
|
|
321
|
+
</error_codes>
|
|
322
|
+
|
|
323
|
+
<success_criteria>
|
|
324
|
+
- [ ] Intent classified and chain resolved (keyword heuristics or `--chain`)
|
|
325
|
+
- [ ] Session dir initialized with `state.json` before first wave
|
|
326
|
+
- [ ] Every skill invocation goes through `spawn_agents_on_csv` — none executed in coordinator
|
|
327
|
+
- [ ] Barrier skills execute solo in their wave; coordinator only reads artifacts afterward
|
|
328
|
+
- [ ] Non-barrier skills grouped into parallel waves where possible
|
|
329
|
+
- [ ] Each wave: CSV built → spawned → results read → state updated
|
|
330
|
+
- [ ] Barrier artifacts read and context updated before assembling next wave's skill_call args
|
|
331
|
+
- [ ] Failed step → remaining marked skipped → abort reported
|
|
332
|
+
- [ ] Completion report with per-wave status written to `context.md`
|
|
333
|
+
- [ ] `--dry-run` shows chain with [BARRIER] markers, no execution
|
|
334
|
+
- [ ] `--continue` resumes from last incomplete wave
|
|
335
|
+
</success_criteria>
|
|
@@ -1,43 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: maestro-analyze
|
|
3
|
-
description: Multi-dimensional analysis via CSV wave pipeline. Diamond topology — CLI exploration agents (Wave 1), 6-dimension scoring agents (Wave 2), decision synthesis agent (Wave 3). Supports dual depth with -q quick mode. Replaces maestro-analyze command.
|
|
4
|
-
argument-hint: "[-y|--yes] [-c|--concurrency N] [--continue] \"<phase|topic> [-q|--quick]\""
|
|
3
|
+
description: Multi-dimensional analysis via CSV wave pipeline. Diamond topology — CLI exploration agents (Wave 1), 6-dimension scoring agents (Wave 2), decision synthesis agent (Wave 3). Supports dual depth with -q quick mode and --gaps issue root cause analysis. Replaces maestro-analyze command.
|
|
4
|
+
argument-hint: "[-y|--yes] [-c|--concurrency N] [--continue] \"<phase|topic> [-q|--quick] [--gaps [ISS-ID]]\""
|
|
5
5
|
allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
When `--yes` or `-y`: Auto-confirm dimension selection, skip interactive scoping, use defaults for perspectives and depth, auto-deepen for up to 3 rounds.
|
|
11
|
-
|
|
12
|
-
# Maestro Analyze (CSV Wave)
|
|
13
|
-
|
|
14
|
-
## Usage
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
$maestro-analyze "3"
|
|
18
|
-
$maestro-analyze -y "microservices vs monolith"
|
|
19
|
-
$maestro-analyze -c 6 "3 -q"
|
|
20
|
-
$maestro-analyze --continue "analyze-microservices-20260318"
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
**Flags**:
|
|
24
|
-
- `-y, --yes`: Skip all confirmations (auto mode)
|
|
25
|
-
- `-c, --concurrency N`: Max concurrent agents within each wave (default: 6)
|
|
26
|
-
- `--continue`: Resume existing session
|
|
27
|
-
- `-q, --quick`: Quick mode -- skip exploration + scoring, go straight to decision extraction (Wave 3 only)
|
|
28
|
-
|
|
29
|
-
**Output Directory**: `.workflow/.csv-wave/{session-id}/`
|
|
30
|
-
**Core Output**: `tasks.csv` (master state) + `results.csv` (final) + `discoveries.ndjson` (shared exploration) + `context.md` (decision extraction report) + `analysis.md` (6-dimension scoring summary)
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## Overview
|
|
35
|
-
|
|
8
|
+
<purpose>
|
|
36
9
|
Wave-based multi-dimensional analysis using `spawn_agents_on_csv`. Diamond topology: CLI exploration agents gather codebase context (Wave 1), 6-dimension scoring agents evaluate in parallel (Wave 2), then decision synthesis agent compiles final decisions and context.md (Wave 3).
|
|
37
10
|
|
|
38
11
|
**Core workflow**: Parse Subject -> CLI Exploration -> 6-Dimension Scoring -> Decision Synthesis
|
|
39
12
|
|
|
40
|
-
**
|
|
13
|
+
**Tri-depth**: Full mode (all 3 waves), Quick mode (`-q`, Wave 3 only), or Gaps mode (`--gaps`, issue root cause analysis pipeline).
|
|
41
14
|
|
|
42
15
|
```
|
|
43
16
|
+---------------------------------------------------------------------------+
|
|
@@ -81,10 +54,30 @@ Wave-based multi-dimensional analysis using `spawn_agents_on_csv`. Diamond topol
|
|
|
81
54
|
| |
|
|
82
55
|
+---------------------------------------------------------------------------+
|
|
83
56
|
```
|
|
57
|
+
</purpose>
|
|
84
58
|
|
|
85
|
-
|
|
59
|
+
<context>
|
|
60
|
+
```bash
|
|
61
|
+
$maestro-analyze "3"
|
|
62
|
+
$maestro-analyze -y "microservices vs monolith"
|
|
63
|
+
$maestro-analyze -c 6 "3 -q"
|
|
64
|
+
$maestro-analyze --continue "analyze-microservices-20260318"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**Flags**:
|
|
68
|
+
- `-y, --yes`: Skip all confirmations (auto mode)
|
|
69
|
+
- `-c, --concurrency N`: Max concurrent agents within each wave (default: 6)
|
|
70
|
+
- `--continue`: Resume existing session
|
|
71
|
+
- `-q, --quick`: Quick mode -- skip exploration + scoring, go straight to decision extraction (Wave 3 only)
|
|
72
|
+
- `--gaps [ISS-ID]`: Issue root cause analysis mode. If ISS-ID provided, analyze single issue. If omitted, analyze all open/registered issues from issues.jsonl. Replaces manage-issue-analyze.
|
|
73
|
+
|
|
74
|
+
When `--yes` or `-y`: Auto-confirm dimension selection, skip interactive scoping, use defaults for perspectives and depth, auto-deepen for up to 3 rounds.
|
|
75
|
+
|
|
76
|
+
**Output Directory**: `.workflow/.csv-wave/{session-id}/`
|
|
77
|
+
**Core Output**: `tasks.csv` (master state) + `results.csv` (final) + `discoveries.ndjson` (shared exploration) + `context.md` (decision extraction report) + `analysis.md` (6-dimension scoring summary)
|
|
78
|
+
</context>
|
|
86
79
|
|
|
87
|
-
|
|
80
|
+
<csv_schema>
|
|
88
81
|
|
|
89
82
|
### tasks.csv (Master State)
|
|
90
83
|
|
|
@@ -124,9 +117,7 @@ id,title,description,dimension,analysis_type,deps,context_from,wave,status,findi
|
|
|
124
117
|
|
|
125
118
|
Each wave generates `wave-{N}.csv` with extra `prev_context` column.
|
|
126
119
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
## Output Artifacts
|
|
120
|
+
### Output Artifacts
|
|
130
121
|
|
|
131
122
|
| File | Purpose | Lifecycle |
|
|
132
123
|
|------|---------|-----------|
|
|
@@ -138,9 +129,7 @@ Each wave generates `wave-{N}.csv` with extra `prev_context` column.
|
|
|
138
129
|
| `analysis.md` | 6-dimension scoring summary + risk matrix + Go/No-Go | Created in Phase 3 (full mode only) |
|
|
139
130
|
| `conclusions.json` | Structured conclusions with decision trail | Created in Phase 3 (full mode only) |
|
|
140
131
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
## Session Structure
|
|
132
|
+
### Session Structure
|
|
144
133
|
|
|
145
134
|
```
|
|
146
135
|
.workflow/.csv-wave/analyze-{slug}-{date}/
|
|
@@ -152,10 +141,23 @@ Each wave generates `wave-{N}.csv` with extra `prev_context` column.
|
|
|
152
141
|
+-- conclusions.json
|
|
153
142
|
+-- wave-{N}.csv (temporary)
|
|
154
143
|
```
|
|
144
|
+
</csv_schema>
|
|
155
145
|
|
|
156
|
-
|
|
146
|
+
<invariants>
|
|
147
|
+
1. **Start Immediately**: First action is session initialization, then Phase 1
|
|
148
|
+
2. **Wave Order is Sacred**: Never execute wave 2 before wave 1 completes and results are merged
|
|
149
|
+
3. **CSV is Source of Truth**: Master tasks.csv holds all state
|
|
150
|
+
4. **Context Propagation**: prev_context built from master CSV, not from memory
|
|
151
|
+
5. **Discovery Board is Append-Only**: Never clear, modify, or recreate discoveries.ndjson
|
|
152
|
+
6. **Quick Mode Shortcut**: With -q flag, generate only wave 3 task, skip exploration and scoring
|
|
153
|
+
6b. **Gaps Mode Pipeline**: With --gaps flag, load issues, explore per issue, write analysis records back to issues.jsonl, output context.md for plan --gaps
|
|
154
|
+
7. **Skip on Failure**: Degrade gracefully -- missing exploration reduces scoring quality, missing scoring reduces synthesis quality
|
|
155
|
+
8. **Cleanup Temp Files**: Remove wave-{N}.csv after results are merged
|
|
156
|
+
9. **DO NOT STOP**: Continuous execution until all waves complete
|
|
157
|
+
10. **Tri-Output**: context.md is ALWAYS produced (all modes). analysis.md + conclusions.json are full-mode only. Gaps mode writes analysis records to issues.jsonl + context.md for plan --gaps.
|
|
158
|
+
</invariants>
|
|
157
159
|
|
|
158
|
-
|
|
160
|
+
<execution>
|
|
159
161
|
|
|
160
162
|
### Session Initialization
|
|
161
163
|
|
|
@@ -170,10 +172,13 @@ const maxConcurrency = concurrencyMatch ? parseInt(concurrencyMatch[1]) : 6
|
|
|
170
172
|
|
|
171
173
|
// Parse analyze-specific flags
|
|
172
174
|
const QUICK_MODE = $ARGUMENTS.includes('-q') || $ARGUMENTS.includes('--quick')
|
|
175
|
+
const GAPS_MODE = $ARGUMENTS.includes('--gaps')
|
|
176
|
+
const gapsIssueMatch = $ARGUMENTS.match(/--gaps\s+(ISS-\S+)/)
|
|
177
|
+
const gapsIssueId = gapsIssueMatch ? gapsIssueMatch[1] : null
|
|
173
178
|
|
|
174
179
|
// Clean subject text
|
|
175
180
|
const subjectArg = $ARGUMENTS
|
|
176
|
-
.replace(/--yes|-y|--continue|--concurrency\s+\d+|-c\s+\d+|-q|--quick/g, '')
|
|
181
|
+
.replace(/--yes|-y|--continue|--concurrency\s+\d+|-c\s+\d+|-q|--quick|--gaps\s+ISS-\S+|--gaps/g, '')
|
|
177
182
|
.trim()
|
|
178
183
|
|
|
179
184
|
// Auto-bootstrap state.json if missing
|
|
@@ -186,7 +191,11 @@ if (!fileExists('.workflow/state.json')) {
|
|
|
186
191
|
const state = JSON.parse(Read('.workflow/state.json'))
|
|
187
192
|
let scope, slug, phaseNum = null
|
|
188
193
|
|
|
189
|
-
if (
|
|
194
|
+
if (GAPS_MODE) {
|
|
195
|
+
// --gaps → issue root cause analysis
|
|
196
|
+
scope = 'gaps'
|
|
197
|
+
slug = gapsIssueId ? gapsIssueId.toLowerCase().replace(/[^a-z0-9]+/g, '-') : 'issue-gaps'
|
|
198
|
+
} else if (subjectArg === '') {
|
|
190
199
|
// No args → milestone-wide
|
|
191
200
|
if (state.current_milestone && fileExists('.workflow/roadmap.md')) {
|
|
192
201
|
scope = 'milestone'
|
|
@@ -218,8 +227,6 @@ Bash(`mkdir -p ${sessionFolder}`)
|
|
|
218
227
|
Bash(`mkdir -p ${scratchDir}`)
|
|
219
228
|
```
|
|
220
229
|
|
|
221
|
-
---
|
|
222
|
-
|
|
223
230
|
### Phase 1: Subject Resolution -> CSV
|
|
224
231
|
|
|
225
232
|
**Objective**: Parse subject, load context, select dimensions, generate tasks.csv.
|
|
@@ -233,10 +240,20 @@ Bash(`mkdir -p ${scratchDir}`)
|
|
|
233
240
|
- Read `.workflow/state.json` → `current_milestone`, `artifacts[]`, `accumulated_context`
|
|
234
241
|
- Find prior analyze artifacts from `state.json.artifacts[]` (type=analyze, same milestone) → load their `context.md`
|
|
235
242
|
- Find brainstorm artifacts from `state.json.artifacts[]` (type=brainstorm, same milestone) → load `guidance-specification.md`
|
|
236
|
-
- Load project specs: `maestro spec load --category
|
|
243
|
+
- Load project specs: `maestro spec load --category arch`
|
|
237
244
|
|
|
238
245
|
3. **Quick mode routing**: If QUICK_MODE, generate only wave 3 (synthesis/decide) task in CSV. Skip exploration and scoring.
|
|
239
246
|
|
|
247
|
+
3b. **Gaps mode routing** (if GAPS_MODE):
|
|
248
|
+
- Load issues from `.workflow/issues/issues.jsonl`
|
|
249
|
+
- If `gapsIssueId`: load single issue, validate existence
|
|
250
|
+
- If no ISS-ID: filter `status == "open" || status == "registered"`
|
|
251
|
+
- For each issue, generate an exploration task (wave 1) focused on issue context
|
|
252
|
+
- Generate a synthesis task (wave 2) that writes analysis records back to issues.jsonl
|
|
253
|
+
- Skip standard dimension scoring (wave 2 in normal mode)
|
|
254
|
+
- Pipeline: Load Issues → CLI Exploration per issue → Root Cause Synthesis → Write issue.analysis → Output context.md
|
|
255
|
+
- On completion: append history entry `{ action: "analyzed", at: <ISO>, by: "maestro-analyze --gaps" }` per issue
|
|
256
|
+
|
|
240
257
|
4. **Dimension and perspective selection** (full mode):
|
|
241
258
|
|
|
242
259
|
| Depth | Exploration Dimensions | Scoring Dimensions |
|
|
@@ -255,8 +272,6 @@ Available exploration dimensions:
|
|
|
255
272
|
|
|
256
273
|
**User validation**: Display task breakdown (skip if AUTO_YES).
|
|
257
274
|
|
|
258
|
-
---
|
|
259
|
-
|
|
260
275
|
### Phase 2: Wave Execution Engine
|
|
261
276
|
|
|
262
277
|
**Objective**: Execute analysis pipeline wave-by-wave via spawn_agents_on_csv.
|
|
@@ -386,8 +401,6 @@ Each score MUST include specific evidence (code refs, data points from explorati
|
|
|
386
401
|
- Generate Locked/Free/Deferred decisions for context.md
|
|
387
402
|
- Build conclusions.json (full mode) with decision trail and recommendations
|
|
388
403
|
|
|
389
|
-
---
|
|
390
|
-
|
|
391
404
|
### Phase 3: Results Aggregation
|
|
392
405
|
|
|
393
406
|
**Objective**: Generate final results and output artifacts.
|
|
@@ -498,11 +511,9 @@ IF deferred_items.length > 0:
|
|
|
498
511
|
8. Copy final outputs (context.md, analysis.md, conclusions.json) from CSV session folder to `scratchDir`
|
|
499
512
|
9. Display summary
|
|
500
513
|
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
## Shared Discovery Board Protocol
|
|
514
|
+
### Shared Discovery Board Protocol
|
|
504
515
|
|
|
505
|
-
|
|
516
|
+
#### Standard Discovery Types
|
|
506
517
|
|
|
507
518
|
| Type | Dedup Key | Data Schema | Description |
|
|
508
519
|
|------|-----------|-------------|-------------|
|
|
@@ -512,7 +523,7 @@ IF deferred_items.length > 0:
|
|
|
512
523
|
| `blocker` | `data.issue` | `{issue, severity, impact}` | Blocking issue found |
|
|
513
524
|
| `tech_stack` | singleton | `{framework, language, tools[]}` | Technology stack info |
|
|
514
525
|
|
|
515
|
-
|
|
526
|
+
#### Domain Discovery Types
|
|
516
527
|
|
|
517
528
|
| Type | Dedup Key | Data Schema | Description |
|
|
518
529
|
|------|-----------|-------------|-------------|
|
|
@@ -522,7 +533,7 @@ IF deferred_items.length > 0:
|
|
|
522
533
|
| `decision_candidate` | `data.area` | `{area, options[], recommendation, classification}` | Gray area for decision |
|
|
523
534
|
| `alternative` | `data.name` | `{name, description, pros[], cons[], fit_score}` | Alternative approach |
|
|
524
535
|
|
|
525
|
-
|
|
536
|
+
#### Protocol
|
|
526
537
|
|
|
527
538
|
1. **Read** `{session_folder}/discoveries.ndjson` before own analysis
|
|
528
539
|
2. **Skip covered**: If discovery of same type + dedup key exists, skip
|
|
@@ -533,14 +544,15 @@ IF deferred_items.length > 0:
|
|
|
533
544
|
```bash
|
|
534
545
|
echo '{"ts":"<ISO>","worker":"{id}","type":"exploration_finding","data":{"file":"src/auth/login.ts","line":42,"snippet":"export async function verifyToken(...)","dimension":"architecture","significance":"Core auth entry point"}}' >> {session_folder}/discoveries.ndjson
|
|
535
546
|
```
|
|
547
|
+
</execution>
|
|
536
548
|
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
## Error Handling
|
|
549
|
+
<error_codes>
|
|
540
550
|
|
|
541
551
|
| Error | Resolution |
|
|
542
552
|
|-------|------------|
|
|
543
|
-
| Subject argument missing | Abort with error: "Analysis subject required (phase number or topic text)" |
|
|
553
|
+
| Subject argument missing (non-gaps) | Abort with error: "Analysis subject required (phase number or topic text)" |
|
|
554
|
+
| --gaps but no issues found | Abort with error: "No open/registered issues in issues.jsonl" |
|
|
555
|
+
| --gaps ISS-ID not found | Abort with error: "Issue {ISS-ID} not found — run manage-issue list" |
|
|
544
556
|
| Phase directory not found | List available phases, abort with error |
|
|
545
557
|
| No prior context for quick mode | Warn: limited context, proceed with available information |
|
|
546
558
|
| Exploration agent timeout | Mark as failed, continue with remaining exploration agents |
|
|
@@ -551,18 +563,15 @@ echo '{"ts":"<ISO>","worker":"{id}","type":"exploration_finding","data":{"file":
|
|
|
551
563
|
| CSV parse error | Validate format, show line number |
|
|
552
564
|
| discoveries.ndjson corrupt | Ignore malformed lines |
|
|
553
565
|
| Continue mode: no session found | List available sessions |
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
8. **Cleanup Temp Files**: Remove wave-{N}.csv after results are merged
|
|
567
|
-
9. **DO NOT STOP**: Continuous execution until all waves complete
|
|
568
|
-
10. **Dual Output**: context.md is ALWAYS produced (both modes). analysis.md + conclusions.json are full-mode only.
|
|
566
|
+
</error_codes>
|
|
567
|
+
|
|
568
|
+
<success_criteria>
|
|
569
|
+
- [ ] Session folder created with valid tasks.csv
|
|
570
|
+
- [ ] All waves executed in order (or skipped per mode)
|
|
571
|
+
- [ ] context.md produced (all modes)
|
|
572
|
+
- [ ] analysis.md + conclusions.json produced (full mode only)
|
|
573
|
+
- [ ] Deferred items auto-created as issues
|
|
574
|
+
- [ ] Artifact registered in state.json
|
|
575
|
+
- [ ] Final outputs copied to scratchDir
|
|
576
|
+
- [ ] discoveries.ndjson append-only throughout
|
|
577
|
+
</success_criteria>
|