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
|
@@ -1,324 +1,213 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: maestro-coordinate
|
|
3
|
-
description:
|
|
4
|
-
argument-hint: "\"intent text\" [-y] [-c
|
|
5
|
-
allowed-tools:
|
|
3
|
+
description: CLI-based coordinator — analyze intent → select command chain → execute sequentially via maestro delegate with auto-confirm. Async state machine with template-driven prompts and gemini analysis between steps.
|
|
4
|
+
argument-hint: "\"intent text\" [-y] [-c] [--dry-run] [--chain <name>]"
|
|
5
|
+
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
# Maestro Coordinate
|
|
13
|
-
|
|
14
|
-
## Usage
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
$maestro-coordinate "implement user authentication with JWT"
|
|
18
|
-
$maestro-coordinate -y "refactor the payment module"
|
|
19
|
-
$maestro-coordinate --continue
|
|
20
|
-
$maestro-coordinate --dry-run "add rate limiting to API endpoints"
|
|
21
|
-
$maestro-coordinate --chain feature "add dark mode toggle"
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
**Flags**:
|
|
25
|
-
- `-y, --yes` — Auto mode: skip all prompts; propagate `-y` to each skill
|
|
26
|
-
- `--continue` — Resume latest paused session from last incomplete step
|
|
27
|
-
- `--dry-run` — Display planned chain without spawning any agents
|
|
28
|
-
- `--chain <name>` — Force a specific chain (skips intent classification)
|
|
29
|
-
|
|
30
|
-
**Session state**: `.workflow/.maestro-coordinate/{session-id}/state.json`
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## Overview
|
|
35
|
-
|
|
36
|
-
Sequential pipeline coordinator (Pattern 2.5). Each chain step is one `spawn_agent` whose message contains a `$skill-name "intent"` invocation together with context accumulated from prior steps. The agent executes the skill and returns structured findings; those findings are injected into the next step's spawn message as `## Context from Previous Steps`.
|
|
8
|
+
<purpose>
|
|
9
|
+
Sequential CLI-delegate coordinator. Each chain step executes via `maestro delegate "prompt" --to <tool> --mode write`
|
|
10
|
+
with a template-driven prompt. After each step, gemini analysis evaluates output quality and generates
|
|
11
|
+
optimization hints for subsequent steps. All execution is background-async with hook callbacks.
|
|
37
12
|
|
|
38
13
|
```
|
|
39
|
-
Intent → Resolve Chain → Step 1 → Step 2 →
|
|
40
|
-
(chainMap)
|
|
41
|
-
|
|
42
|
-
close close close
|
|
43
|
-
│ │ │
|
|
44
|
-
findings → prev_context → prev_context
|
|
14
|
+
Intent → Resolve Chain → Step 1 → Analysis → Step 2 → Analysis → … → Report
|
|
15
|
+
(chainMap) delegate gemini delegate gemini
|
|
16
|
+
callback callback callback callback
|
|
45
17
|
```
|
|
18
|
+
</purpose>
|
|
46
19
|
|
|
47
|
-
|
|
20
|
+
<required_reading>
|
|
21
|
+
@~/.maestro/workflows/maestro-coordinate.codex.md — authoritative `detectTaskType`, `detectNextAction`, `chainMap` (35+ intent patterns, 40+ chain types). Read before executing any step.
|
|
22
|
+
</required_reading>
|
|
48
23
|
|
|
49
|
-
|
|
24
|
+
<deferred_reading>
|
|
25
|
+
- [coordinate template](~/.maestro/templates/cli/prompts/coordinate-step.txt) — read when filling step prompts
|
|
26
|
+
</deferred_reading>
|
|
50
27
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
| fix, bug, error, broken, crash | `quality-fix` | $manage-issue-analyze → $manage-issue-execute → $maestro-verify |
|
|
54
|
-
| test, spec, coverage | `quality-test` | $quality-test |
|
|
55
|
-
| refactor, cleanup, debt | `quality-refactor` | $quality-refactor |
|
|
56
|
-
| feature, implement, add, build | `feature` | $maestro-plan → $maestro-execute → $maestro-verify |
|
|
57
|
-
| review, check, audit | `quality-review` | $quality-review |
|
|
58
|
-
| deploy, release, ship | `deploy` | $maestro-verify → $maestro-execute |
|
|
28
|
+
<context>
|
|
29
|
+
$ARGUMENTS — user intent text, or special flags.
|
|
59
30
|
|
|
60
|
-
|
|
31
|
+
**Flags:**
|
|
32
|
+
- `-y, --yes` — Auto mode: skip all prompts, inject auto-confirm into delegates
|
|
33
|
+
- `-c, --continue` — Resume previous session from last incomplete step
|
|
34
|
+
- `--dry-run` — Show planned chain without executing
|
|
35
|
+
- `--chain <name>` — Force specific chain (skips intent classification)
|
|
61
36
|
|
|
62
|
-
|
|
37
|
+
**Session state**: `.workflow/.maestro-coordinate/{session-id}/state.json`
|
|
38
|
+
</context>
|
|
39
|
+
|
|
40
|
+
<invariants>
|
|
41
|
+
1. **STOP after each delegate call**: Background execution via `run_in_background: true`, wait for hook callback.
|
|
42
|
+
2. **State machine**: Advance via `current_step`, no sync loops for async operations.
|
|
43
|
+
3. **Template-driven**: All steps use `coordinate-step.txt`, no per-command prompt assembly.
|
|
44
|
+
4. **Context propagation**: Parse PHASE / spec session ID / scratch_dir / issue_id from each step output, feed to next step.
|
|
45
|
+
5. **Gemini analysis after each step**: Evaluate output quality, generate hints for next step, chain via `--resume`.
|
|
46
|
+
6. **Auto-confirm injection**: `{{AUTO_DIRECTIVE}}` in template prevents blocking during background execution.
|
|
47
|
+
7. **Resumable**: `-c` reads `state.json`, jumps to first pending step.
|
|
48
|
+
8. **Delegate tool**: `maestro delegate --to codex` for all execution steps; `--to gemini` only for post-step analysis.</invariants>
|
|
63
49
|
|
|
64
|
-
>
|
|
50
|
+
<execution>
|
|
65
51
|
|
|
66
|
-
###
|
|
52
|
+
### Step 1: Parse Arguments
|
|
67
53
|
|
|
68
54
|
```javascript
|
|
69
|
-
const
|
|
70
|
-
const
|
|
71
|
-
const
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
plan: [
|
|
79
|
-
{ step: "Phase 1: Resolve intent and chain", status: "in_progress" },
|
|
80
|
-
{ step: "Phase 2: Execute steps (pipeline)", status: "pending" },
|
|
81
|
-
{ step: "Phase 3: Completion report", status: "pending" }
|
|
82
|
-
]
|
|
83
|
-
})
|
|
55
|
+
const args = $ARGUMENTS.trim();
|
|
56
|
+
const AUTO_YES = /\b(-y|--yes)\b/.test(args);
|
|
57
|
+
const RESUME = /\b(-c|--continue)\b/.test(args);
|
|
58
|
+
const DRY_RUN = /\b--dry-run\b/.test(args);
|
|
59
|
+
const forcedChain = args.match(/--chain\s+(\S+)/)?.[1] || null;
|
|
60
|
+
const intent = args
|
|
61
|
+
.replace(/\b(-y|--yes|-c|--continue|--dry-run)\b/g, '')
|
|
62
|
+
.replace(/--chain\s+\S+/g, '')
|
|
63
|
+
.trim();
|
|
84
64
|
```
|
|
85
65
|
|
|
86
|
-
|
|
66
|
+
**If RESUME**: Find latest `state.json` in `.workflow/.maestro-coordinate/`, load → jump to Step 6.
|
|
87
67
|
|
|
88
|
-
|
|
68
|
+
### Step 2–4: Classify Intent → Confirm
|
|
89
69
|
|
|
90
|
-
|
|
70
|
+
1. Read `.workflow/state.json` + `.workflow/roadmap.md` + current phase
|
|
71
|
+
2. If `--chain` given → use directly; else classify via `detectTaskType` + `chainMap`
|
|
72
|
+
3. If clarity < 2 and not AUTO_YES → clarify via AskUserQuestion (max 2 rounds)
|
|
73
|
+
4. **`--dry-run`**: Display chain and exit
|
|
74
|
+
5. **User confirmation** (skip if AUTO_YES): Execute / Execute from step N / Cancel
|
|
91
75
|
|
|
92
|
-
|
|
93
|
-
2. If `--chain` is given, use it directly
|
|
94
|
-
3. Otherwise, classify intent with keyword heuristics (see Chain Map above)
|
|
95
|
-
4. If no keyword matches and not `AUTO_YES`: ask one clarifying question via `functions.request_user_input`
|
|
96
|
-
5. Resolve the chain's skill list from Chain Map
|
|
97
|
-
6. Write `state.json`:
|
|
76
|
+
### Step 5: Setup Session
|
|
98
77
|
|
|
99
78
|
```javascript
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
quality_score: null,
|
|
113
|
-
hints_for_next: null
|
|
79
|
+
const sessionId = `coord-${new Date().toISOString().replace(/[-:T]/g, '').slice(0, 15)}`;
|
|
80
|
+
const sessionDir = `.workflow/.maestro-coordinate/${sessionId}`;
|
|
81
|
+
|
|
82
|
+
const state = {
|
|
83
|
+
session_id: sessionId, status: 'running',
|
|
84
|
+
created_at: new Date().toISOString(),
|
|
85
|
+
intent, task_type: taskType, chain_name: chainName,
|
|
86
|
+
auto_mode: AUTO_YES, phase: resolvedPhase,
|
|
87
|
+
current_step: 0, gemini_session_id: null, step_analyses: [],
|
|
88
|
+
steps: chain.map((s, i) => ({
|
|
89
|
+
index: i, cmd: s.cmd, args: s.args || '',
|
|
90
|
+
status: 'pending', exec_id: null, analysis: null
|
|
114
91
|
}))
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
**`--dry-run`**: Display the chain plan and stop — no agents spawned.
|
|
119
|
-
|
|
120
|
-
```
|
|
121
|
-
Chain: <resolvedChain>
|
|
122
|
-
Steps:
|
|
123
|
-
1. <skill-1>
|
|
124
|
-
2. <skill-2>
|
|
125
|
-
3. <skill-3>
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
**User confirmation** (skip if `AUTO_YES`): Display the plan above and prompt `Proceed? (yes/no)`.
|
|
129
|
-
|
|
130
|
-
```javascript
|
|
131
|
-
functions.update_plan({
|
|
132
|
-
explanation: "Chain resolved, starting pipeline",
|
|
133
|
-
plan: [
|
|
134
|
-
{ step: "Phase 1: Resolve intent and chain", status: "completed" },
|
|
135
|
-
{ step: "Phase 2: Execute steps (pipeline)", status: "in_progress" },
|
|
136
|
-
{ step: "Phase 3: Completion report", status: "pending" }
|
|
137
|
-
]
|
|
138
|
-
})
|
|
92
|
+
};
|
|
93
|
+
Write(`${sessionDir}/state.json`, JSON.stringify(state, null, 2));
|
|
139
94
|
```
|
|
140
95
|
|
|
141
|
-
|
|
96
|
+
### Step 6: Execute Step via maestro delegate
|
|
142
97
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
Sequential loop — each step spawns one agent, waits for it, extracts findings, then closes it before spawning the next.
|
|
98
|
+
#### 6a: Assemble args
|
|
146
99
|
|
|
147
100
|
```javascript
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
// Spawn step agent
|
|
165
|
-
const agent = spawn_agent({ message: stepPrompt })
|
|
166
|
-
|
|
167
|
-
// Wait — initial spawn: 30 min
|
|
168
|
-
let result = wait_agent({ timeout_ms: 1800000 })
|
|
169
|
-
if (result.timed_out) {
|
|
170
|
-
// Step 1: Status probe (non-interrupting, 3 min)
|
|
171
|
-
followup_task({ target: agent, message: "STATUS_CHECK: Report current progress, findings so far, and estimated remaining work." })
|
|
172
|
-
const status = wait_agent({ timeout_ms: 180000 })
|
|
173
|
-
if (status.timed_out) {
|
|
174
|
-
// Step 2: Force finalize (interrupt, 3 min)
|
|
175
|
-
followup_task({ target: agent, message: "FINALIZE: Output all current findings immediately. Time limit reached.", interrupt: true })
|
|
176
|
-
const forced = wait_agent({ timeout_ms: 180000 })
|
|
177
|
-
if (forced.timed_out) {
|
|
178
|
-
// Step 3: Abort
|
|
179
|
-
close_agent({ target: agent })
|
|
180
|
-
} else {
|
|
181
|
-
result = forced
|
|
182
|
-
}
|
|
183
|
-
} else {
|
|
184
|
-
result = status
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
// Parse structured output from agent
|
|
189
|
-
const output = parseLastJSON(result.status[agent].completed) ?? {
|
|
190
|
-
quality_score: null,
|
|
191
|
-
findings: result.status[agent].completed?.slice(-500) ?? "(no output)",
|
|
192
|
-
hints_for_next: ""
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
close_agent({ target: agent })
|
|
196
|
-
|
|
197
|
-
// Persist step result
|
|
198
|
-
step.status = result.timed_out ? "failed" : "completed"
|
|
199
|
-
step.findings = output.findings
|
|
200
|
-
step.quality_score = output.quality_score
|
|
201
|
-
step.hints_for_next = output.hints_for_next
|
|
202
|
-
step.completed_at = new Date().toISOString()
|
|
203
|
-
Write(`${sessionDir}/state.json`, JSON.stringify(state, null, 2))
|
|
204
|
-
|
|
205
|
-
// Build prev_context for next step
|
|
206
|
-
prevContext += `\n\n## Step ${step.step_n}: ${step.skill}\nFindings: ${step.findings}\nHints: ${step.hints_for_next ?? ''}`
|
|
207
|
-
|
|
208
|
-
// Abort on failure — mark remaining steps as skipped
|
|
209
|
-
if (step.status === "failed") {
|
|
210
|
-
state.steps
|
|
211
|
-
.filter(s => s.status === 'pending')
|
|
212
|
-
.forEach(s => { s.status = 'skipped'; s.findings = `Blocked: step ${step.step_n} (${step.skill}) failed` })
|
|
213
|
-
state.status = "aborted"
|
|
214
|
-
Write(`${sessionDir}/state.json`, JSON.stringify(state, null, 2))
|
|
215
|
-
break
|
|
101
|
+
const AUTO_FLAG_MAP = {
|
|
102
|
+
'maestro-analyze': '-y', 'maestro-brainstorm': '-y', 'maestro-ui-design': '-y',
|
|
103
|
+
'maestro-plan': '--auto', 'maestro-spec-generate': '-y', 'quality-test': '--auto-fix',
|
|
104
|
+
'quality-retrospective': '--auto-yes',
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
function assembleArgs(step) {
|
|
108
|
+
let a = (step.args || '')
|
|
109
|
+
.replace(/\{phase\}/g, context.current_phase || '')
|
|
110
|
+
.replace(/\{description\}/g, context.user_intent || '')
|
|
111
|
+
.replace(/\{issue_id\}/g, context.issue_id || '')
|
|
112
|
+
.replace(/\{spec_session_id\}/g, context.spec_session_id || '')
|
|
113
|
+
.replace(/\{scratch_dir\}/g, context.scratch_dir || '');
|
|
114
|
+
if (state.auto_mode) {
|
|
115
|
+
const flag = AUTO_FLAG_MAP[step.cmd];
|
|
116
|
+
if (flag && !a.includes(flag)) a = a ? `${a} ${flag}` : flag;
|
|
216
117
|
}
|
|
118
|
+
return a.trim();
|
|
217
119
|
}
|
|
218
120
|
```
|
|
219
121
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
#### Step Agent Prompt Template (`buildStepPrompt`)
|
|
122
|
+
#### 6b: Build prompt from template + launch
|
|
223
123
|
|
|
224
|
-
|
|
124
|
+
Read `~/.maestro/templates/cli/prompts/coordinate-step.txt`, fill placeholders.
|
|
125
|
+
If previous step has analysis hints, inject as `{{ANALYSIS_HINTS}}`.
|
|
225
126
|
|
|
127
|
+
```javascript
|
|
128
|
+
const prompt = template
|
|
129
|
+
.replace('{{COMMAND}}', `/${step.cmd}`)
|
|
130
|
+
.replace('{{ARGS}}', assembledArgs)
|
|
131
|
+
.replace('{{STEP_N}}', `${state.current_step + 1}/${state.steps.length}`)
|
|
132
|
+
.replace('{{AUTO_DIRECTIVE}}', state.auto_mode ? 'Auto-confirm all prompts. No interactive questions.' : '')
|
|
133
|
+
.replace('{{CHAIN_NAME}}', state.chain_name)
|
|
134
|
+
.replace('{{ANALYSIS_HINTS}}', analysisHints);
|
|
135
|
+
|
|
136
|
+
Bash({
|
|
137
|
+
command: `maestro delegate ${escapeForShell(prompt)} --to codex --mode write`,
|
|
138
|
+
run_in_background: true, timeout: 600000
|
|
139
|
+
});
|
|
140
|
+
// ■ STOP — wait for hook callback
|
|
226
141
|
```
|
|
227
|
-
## TASK ASSIGNMENT
|
|
228
|
-
|
|
229
|
-
### MANDATORY FIRST STEPS
|
|
230
|
-
1. Read: ~/.maestro/workflows/maestro-coordinate.codex.md
|
|
231
|
-
2. Read: ~/.codex/skills/{skill}/SKILL.md
|
|
232
|
-
|
|
233
|
-
---
|
|
234
|
-
|
|
235
|
-
**Coordinate Chain: {chain} | Step {step_n} of {totalSteps}**
|
|
236
|
-
|
|
237
|
-
## Skill Invocation
|
|
238
|
-
Execute this skill call to complete your task:
|
|
239
|
-
|
|
240
|
-
${skill} "{intent}" {skillFlag}
|
|
241
|
-
|
|
242
|
-
Follow the Implementation section of the skill file you read in step 2.
|
|
243
|
-
The intent above is your driving goal.
|
|
244
|
-
|
|
245
|
-
{#if prevContext}
|
|
246
|
-
## Context from Previous Steps
|
|
247
|
-
{prevContext}
|
|
248
|
-
|
|
249
|
-
Use hints from the previous step to guide execution priorities.
|
|
250
|
-
{/if}
|
|
251
142
|
|
|
252
|
-
|
|
253
|
-
After execution complete, output exactly:
|
|
254
|
-
```json
|
|
255
|
-
{
|
|
256
|
-
"quality_score": <0-10>,
|
|
257
|
-
"findings": "<what was accomplished — max 500 chars>",
|
|
258
|
-
"hints_for_next": "<specific guidance for the next chain step>"
|
|
259
|
-
}
|
|
260
|
-
```
|
|
143
|
+
### Step 7: Post-Step Callback
|
|
261
144
|
|
|
262
|
-
|
|
145
|
+
```javascript
|
|
146
|
+
// Context propagation from output
|
|
147
|
+
const phaseMatch = output.match(/PHASE:\s*(\d+)/m);
|
|
148
|
+
if (phaseMatch) context.current_phase = phaseMatch[1];
|
|
149
|
+
const specMatch = output.match(/SPEC-[\w-]+/);
|
|
150
|
+
if (specMatch) context.spec_session_id = specMatch[0];
|
|
151
|
+
const scratchMatch = output.match(/scratch_dir:\s*(.+)/m);
|
|
152
|
+
if (scratchMatch) context.scratch_dir = scratchMatch[1].trim();
|
|
153
|
+
|
|
154
|
+
// Success/failure
|
|
155
|
+
const failed = /^STATUS:\s*FAILURE/m.test(output);
|
|
156
|
+
if (!failed) { step.status = 'completed'; }
|
|
157
|
+
else if (state.auto_mode && !step.retried) { step.retried = true; /* re-execute Step 6 */ return; }
|
|
158
|
+
else { step.status = 'skipped'; /* or AskUserQuestion: Retry / Skip / Abort */ }
|
|
159
|
+
|
|
160
|
+
Write(`${sessionDir}/step-${stepIdx + 1}-output.txt`, output);
|
|
161
|
+
// → Step 7b (gemini analysis) if completed + multi-step chain
|
|
162
|
+
// → else advance current_step, loop to Step 6 or Step 8
|
|
263
163
|
```
|
|
264
164
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
### Phase 3: Completion Report
|
|
165
|
+
### Step 7b: Analyze Step Output (via gemini)
|
|
268
166
|
|
|
269
167
|
```javascript
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
explanation: "Coordinate complete",
|
|
275
|
-
plan: [
|
|
276
|
-
{ step: "Phase 1: Resolve intent and chain", status: "completed" },
|
|
277
|
-
{ step: "Phase 2: Execute steps (pipeline)", status: "completed" },
|
|
278
|
-
{ step: "Phase 3: Completion report", status: "completed" }
|
|
279
|
-
]
|
|
280
|
-
})
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
Display:
|
|
168
|
+
let delegateCmd = `maestro delegate ${escapeForShell(analysisPrompt)} --to gemini --mode analysis --rule analysis-review-code-quality`;
|
|
169
|
+
if (state.gemini_session_id) delegateCmd += ` --resume ${state.gemini_session_id}`;
|
|
170
|
+
Bash({ command: delegateCmd, run_in_background: true, timeout: 300000 });
|
|
171
|
+
// ■ STOP — wait for hook callback
|
|
284
172
|
```
|
|
285
|
-
=== COORDINATE COMPLETE ===
|
|
286
|
-
Session: <sessionId>
|
|
287
|
-
Chain: <chain>
|
|
288
|
-
Steps: <N completed>/<total>
|
|
289
|
-
|
|
290
|
-
STEP RESULTS:
|
|
291
|
-
[1] <skill> — score: <N>/10 ✓ <findings summary>
|
|
292
|
-
[2] <skill> — score: <N>/10 ✓ <findings summary>
|
|
293
|
-
[3] <skill> — score: <N>/10 ✓ <findings summary>
|
|
294
|
-
|
|
295
|
-
State: .workflow/.maestro-coordinate/<sessionId>/state.json
|
|
296
|
-
Resume: $maestro-coordinate --continue
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
---
|
|
300
173
|
|
|
301
|
-
|
|
174
|
+
Post-analyze: store quality_score + issues + next_step_hints in `state.step_analyses[]`, chain gemini sessions via `--resume`.
|
|
302
175
|
|
|
303
|
-
|
|
304
|
-
|------|----------|-----------|----------|
|
|
305
|
-
| E001 | error | Intent unclassifiable after clarification | Default to `feature` chain; note in state.json |
|
|
306
|
-
| E002 | error | `--chain` value not in chain map | List valid chains, abort |
|
|
307
|
-
| E003 | error | Step agent timeout (4-step cascade exhausted) | Mark step `failed`; skip remaining steps; suggest `--continue` |
|
|
308
|
-
| E004 | error | Step agent failed (non-JSON output) | Mark step `failed`; preserve raw output in `findings`; skip remaining |
|
|
309
|
-
| E005 | error | `--continue`: no session found | Glob `.workflow/.maestro-coordinate/MCC-*/`, list sessions, prompt |
|
|
310
|
-
| W001 | warning | Step output JSON missing `hints_for_next` | Continue with empty hints; next step still gets `findings` |
|
|
176
|
+
### Step 8: Completion Report
|
|
311
177
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
178
|
+
```
|
|
179
|
+
============================================================
|
|
180
|
+
MAESTRO-COORDINATE COMPLETE
|
|
181
|
+
============================================================
|
|
182
|
+
Session: {session_id}
|
|
183
|
+
Chain: {chain_name} ({done}/{total})
|
|
184
|
+
|
|
185
|
+
Steps:
|
|
186
|
+
[✓] 1. maestro-plan — completed (quality: 85/100)
|
|
187
|
+
[✓] 2. maestro-execute — completed (quality: 78/100)
|
|
188
|
+
|
|
189
|
+
Avg Quality: {avg_score}/100
|
|
190
|
+
Next: $maestro-coordinate --continue
|
|
191
|
+
============================================================
|
|
192
|
+
```
|
|
193
|
+
</execution>
|
|
194
|
+
|
|
195
|
+
<error_codes>
|
|
196
|
+
| Code | Severity | Description | Recovery |
|
|
197
|
+
|------|----------|-------------|----------|
|
|
198
|
+
| E001 | error | No intent and project not initialized | Suggest $maestro-init |
|
|
199
|
+
| E002 | error | Clarity too low after 2 rounds | Ask to rephrase |
|
|
200
|
+
| E003 | error | Step failed + abort | Suggest resume with -c |
|
|
201
|
+
| E004 | error | Resume session not found | Show available sessions |
|
|
202
|
+
</error_codes>
|
|
203
|
+
|
|
204
|
+
<success_criteria>
|
|
205
|
+
- [ ] Intent classified and chain selected via detectTaskType + chainMap
|
|
206
|
+
- [ ] Each step executed via `maestro delegate` with coordinate-step template
|
|
207
|
+
- [ ] Auto-confirm injected, structured return parsed
|
|
208
|
+
- [ ] Each completed step analyzed via `maestro delegate --to gemini --mode analysis`
|
|
209
|
+
- [ ] Analysis hints injected into next step prompt via `{{ANALYSIS_HINTS}}`
|
|
210
|
+
- [ ] Gemini sessions chained via `--resume` for accumulated context
|
|
211
|
+
- [ ] Session state at .workflow/.maestro-coordinate/{session_id}/
|
|
212
|
+
- [ ] Completion report with per-step status and quality scores
|
|
213
|
+
</success_criteria>
|