maestro-flow 0.3.7 → 0.3.9
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/commands/learn-decompose.md +3 -3
- package/.claude/commands/learn-follow.md +5 -5
- package/.claude/commands/learn-investigate.md +3 -3
- package/.claude/commands/learn-retro.md +303 -0
- package/.claude/commands/learn-second-opinion.md +3 -3
- package/.claude/commands/maestro-analyze.md +123 -99
- package/.claude/commands/maestro-brainstorm.md +2 -2
- package/.claude/commands/maestro-execute.md +137 -96
- package/.claude/commands/maestro-fork.md +111 -0
- package/.claude/commands/maestro-init.md +6 -6
- package/.claude/commands/maestro-learn.md +74 -298
- package/.claude/commands/maestro-merge.md +77 -0
- package/.claude/commands/maestro-milestone-audit.md +72 -60
- package/.claude/commands/maestro-milestone-complete.md +67 -59
- package/.claude/commands/maestro-milestone-release.md +6 -6
- package/.claude/commands/maestro-plan.md +151 -130
- package/.claude/commands/maestro-quick.md +4 -4
- package/.claude/commands/maestro-roadmap.md +5 -5
- package/.claude/commands/maestro-spec-generate.md +5 -5
- package/.claude/commands/maestro-ui-design.md +3 -3
- package/.claude/commands/maestro-verify.md +106 -87
- package/.claude/commands/maestro.md +10 -4
- package/.claude/commands/manage-codebase-rebuild.md +4 -4
- package/.claude/commands/manage-codebase-refresh.md +1 -1
- package/.claude/commands/manage-harvest.md +5 -5
- package/.claude/commands/manage-issue-discover.md +1 -1
- package/.claude/commands/manage-issue-execute.md +6 -6
- package/.claude/commands/manage-issue.md +6 -6
- package/.claude/commands/manage-learn.md +23 -17
- package/.claude/commands/manage-memory-capture.md +15 -17
- package/.claude/commands/manage-memory.md +3 -3
- package/.claude/commands/manage-status.md +24 -24
- package/.claude/commands/quality-business-test.md +5 -5
- package/.claude/commands/quality-debug.md +4 -4
- package/.claude/commands/quality-integration-test.md +4 -4
- package/.claude/commands/quality-refactor.md +3 -3
- package/.claude/commands/quality-retrospective.md +7 -7
- package/.claude/commands/quality-review.md +4 -4
- package/.claude/commands/quality-sync.md +3 -3
- package/.claude/commands/quality-test-gen.md +4 -4
- package/.claude/commands/quality-test.md +9 -9
- package/.claude/commands/spec-add.md +2 -2
- package/.claude/commands/spec-load.md +8 -3
- package/.claude/commands/spec-setup.md +5 -5
- package/.claude/commands/wiki-connect.md +3 -3
- package/.claude/commands/wiki-digest.md +30 -5
- package/.codex/skills/maestro-analyze/SKILL.md +52 -14
- package/.codex/skills/maestro-execute/SKILL.md +27 -26
- package/.codex/skills/maestro-milestone-audit/SKILL.md +103 -209
- package/.codex/skills/maestro-milestone-complete/SKILL.md +149 -158
- package/.codex/skills/maestro-plan/SKILL.md +47 -17
- package/.codex/skills/maestro-roadmap/SKILL.md +3 -2
- package/.codex/skills/team-coordinate/roles/coordinator/commands/monitor.md +2 -2
- package/.codex/skills/team-executor/roles/executor/commands/monitor.md +1 -1
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +2 -2
- package/.codex/skills/team-lifecycle-v4/specs/knowledge-transfer.md +2 -2
- package/.codex/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +1 -1
- package/.codex/skills/team-review/roles/coordinator/commands/monitor.md +1 -1
- package/.codex/skills/team-tech-debt/roles/coordinator/commands/monitor.md +1 -1
- package/.codex/skills/team-testing/roles/coordinator/commands/monitor.md +1 -1
- package/README.md +115 -227
- package/README.zh-CN.md +169 -187
- package/bin/maestro-mcp.js +1 -1
- package/chains/_intent-map.json +21 -9
- package/chains/_router.json +30 -77
- package/chains/brainstorm-driven.json +17 -6
- package/chains/full-lifecycle.json +22 -23
- package/chains/milestone-close.json +20 -7
- package/chains/milestone-fork-merge.json +50 -0
- package/chains/roadmap-driven.json +17 -6
- package/chains/spec-driven.json +17 -6
- package/dashboard/dist/assets/{ArtifactsPage-A9yzYtpj.js → ArtifactsPage-DZNCi6tn.js} +12 -7
- package/dashboard/dist/assets/ChatInput-Bvr-FeEq.js +49 -0
- package/dashboard/dist/assets/ChatPage-D9zTkJZo.js +22 -0
- package/dashboard/dist/assets/CollabPage-B4NAHXS2.js +1 -0
- package/dashboard/dist/assets/ExecutionPanel-CFt4LJyq.js +1 -0
- package/dashboard/dist/assets/KanbanPage-C8USth6H.js +21 -0
- package/dashboard/dist/assets/{MarkdownRenderer-CCXHaut3.js → MarkdownRenderer-X4af_WNb.js} +1 -1
- package/dashboard/dist/assets/McpPage-BKfCVIyU.js +21 -0
- package/dashboard/dist/assets/OutputPanel-BlBQFJSW.js +1 -0
- package/dashboard/dist/assets/ProblemsPanel-De3DLvoI.js +1 -0
- package/dashboard/dist/assets/{RequirementBoardPage-CEOvppGn.js → RequirementBoardPage-Bf1trzqs.js} +2 -2
- package/dashboard/dist/assets/{RequirementPage-DpnbTEqY.js → RequirementPage-Bllxe2XI.js} +10 -5
- package/dashboard/dist/assets/{SpecsPage-CYqOfFkB.js → SpecsPage-9lwxKT27.js} +2 -2
- package/dashboard/dist/assets/{SupervisorPage-B2sZwkq8.js → SupervisorPage-SusdfHFq.js} +1 -1
- package/dashboard/dist/assets/{TeamsPage-CkZdCAVZ.js → TeamsPage-DsuM6OwC.js} +2 -2
- package/dashboard/dist/assets/TreeBrowser-Q12qobZs.js +6 -0
- package/dashboard/dist/assets/WorkflowPage-D_Fzdy3_.js +6 -0
- package/dashboard/dist/assets/{arrow-left-6fktHyjN.js → arrow-left-Bqtb2hle.js} +1 -1
- package/dashboard/dist/assets/{check-Cbxq2l1-.js → check-u6fGOwQO.js} +1 -1
- package/dashboard/dist/assets/{chevron-right-Yts3bi8p.js → chevron-right-Csu22t58.js} +1 -1
- package/dashboard/dist/assets/{circle-4Ci4Xolf.js → circle-CMrkbRNg.js} +1 -1
- package/dashboard/dist/assets/{circle-alert-B25g9BTL.js → circle-alert-c3tH1P4z.js} +1 -1
- package/dashboard/dist/assets/{circle-check-big-DzO2BlL7.js → circle-check-big-TDSeWstm.js} +1 -1
- package/dashboard/dist/assets/{circle-check-BA5_XqeV.js → circle-check-gYxxSYuH.js} +1 -1
- package/dashboard/dist/assets/{code-zxwuybO8.js → code-CFN2uX9V.js} +1 -1
- package/dashboard/dist/assets/{columns-3-DV4oeCfU.js → columns-3-38xIDlzy.js} +1 -1
- package/dashboard/dist/assets/{download-CXCyQw8M.js → download-DC7KkKyP.js} +1 -1
- package/dashboard/dist/assets/{folder-Bvjj8Vn9.js → folder-CWq_lAnf.js} +1 -1
- package/dashboard/dist/assets/index-DWG-WrzT.js +231 -0
- package/dashboard/dist/assets/{index-BvScJmJM.js → index-Do71weNR.js} +1 -1
- package/dashboard/dist/assets/index-GUNJodSR.css +1 -0
- package/dashboard/dist/assets/{list-Dj4i9N75.js → list-CgIP_2A-.js} +1 -1
- package/dashboard/dist/assets/{minus-DwlFabsT.js → minus-DYoN5UGk.js} +1 -1
- package/dashboard/dist/assets/{pen-line-D7UzECt6.js → pen-line-Bh_WKYHm.js} +1 -1
- package/dashboard/dist/assets/{proxy-B9XRqHD9.js → proxy-BKxDAKTj.js} +1 -1
- package/dashboard/dist/assets/{search-BQbBTIYl.js → search-SieXnOgr.js} +1 -1
- package/dashboard/dist/assets/{shallow-Clb1Lyd_.js → shallow-Bme1JY57.js} +1 -1
- package/dashboard/dist/assets/{table-BqxCXid2.js → table-llyEtj-7.js} +1 -1
- package/dashboard/dist/assets/terminal-BB3Xfuv5.js +6 -0
- package/dashboard/dist/assets/{trash-2-6rN9B-EQ.js → trash-2-C8f4vFFM.js} +1 -1
- package/dashboard/dist/assets/{zap-DxUhG-gk.js → zap-4uwlzVm0.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dashboard/dist-server/dashboard/src/server/agents/agent-sdk-adapter.d.ts +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/agent-sdk-adapter.js +5 -4
- package/dashboard/dist-server/dashboard/src/server/agents/agent-sdk-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js +8 -4
- package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/entry-normalizer.d.ts +1 -0
- package/dashboard/dist-server/dashboard/src/server/agents/entry-normalizer.js +2 -1
- package/dashboard/dist-server/dashboard/src/server/agents/entry-normalizer.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js +20 -10
- package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/tools/issue-mcp-server.d.ts +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/tools/issue-mcp-server.js +3 -4
- package/dashboard/dist-server/dashboard/src/server/agents/tools/issue-mcp-server.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/tools/issue-mcp-server.test.js +4 -4
- package/dashboard/dist-server/dashboard/src/server/agents/tools/issue-mcp-server.test.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/commander/commander-agent.js +4 -3
- package/dashboard/dist-server/dashboard/src/server/commander/commander-agent.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/commander/commander-agent.test.js +20 -7
- package/dashboard/dist-server/dashboard/src/server/commander/commander-agent.test.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/execution/wave-executor.d.ts +1 -1
- package/dashboard/dist-server/dashboard/src/server/execution/wave-executor.js +4 -4
- package/dashboard/dist-server/dashboard/src/server/execution/wave-executor.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/index.js +2 -1
- package/dashboard/dist-server/dashboard/src/server/index.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/routes/git.d.ts +2 -0
- package/dashboard/dist-server/dashboard/src/server/routes/git.js +79 -0
- package/dashboard/dist-server/dashboard/src/server/routes/git.js.map +1 -0
- package/dashboard/dist-server/dashboard/src/server/routes/index.js +3 -0
- package/dashboard/dist-server/dashboard/src/server/routes/index.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/routes/issues.js +14 -14
- package/dashboard/dist-server/dashboard/src/server/routes/issues.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/routes/linear.js +7 -5
- package/dashboard/dist-server/dashboard/src/server/routes/linear.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/routes/workspace.js +43 -0
- package/dashboard/dist-server/dashboard/src/server/routes/workspace.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/state/state-manager.js +186 -25
- package/dashboard/dist-server/dashboard/src/server/state/state-manager.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/utils/issue-store.d.ts +6 -0
- package/dashboard/dist-server/dashboard/src/server/utils/issue-store.js +24 -2
- package/dashboard/dist-server/dashboard/src/server/utils/issue-store.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/ws/handlers/execution-handler.js +4 -7
- package/dashboard/dist-server/dashboard/src/server/ws/handlers/execution-handler.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/shared/constants.js +2 -1
- package/dashboard/dist-server/dashboard/src/shared/constants.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/shared/constants.test.js +5 -5
- package/dashboard/dist-server/dashboard/src/shared/constants.test.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/shared/issue-types.test.js +4 -4
- package/dashboard/dist-server/dashboard/src/shared/issue-types.test.js.map +1 -1
- package/dashboard/dist-server/src/commands/delegate.js +7 -1
- package/dashboard/dist-server/src/commands/delegate.js.map +1 -1
- package/dashboard/package.json +59 -59
- package/dist/src/cli.js +3 -1
- package/dist/src/cli.js.map +1 -1
- package/dist/src/commands/{team.d.ts → collab.d.ts} +2 -2
- package/dist/src/commands/collab.d.ts.map +1 -0
- package/dist/src/commands/{team.js → collab.js} +391 -24
- package/dist/src/commands/collab.js.map +1 -0
- package/dist/src/commands/delegate.d.ts.map +1 -1
- package/dist/src/commands/delegate.js +7 -1
- package/dist/src/commands/delegate.js.map +1 -1
- package/dist/src/commands/msg.d.ts.map +1 -1
- package/dist/src/commands/msg.js +4 -3
- package/dist/src/commands/msg.js.map +1 -1
- package/dist/src/hooks/team-monitor.d.ts.map +1 -1
- package/dist/src/hooks/team-monitor.js +16 -0
- package/dist/src/hooks/team-monitor.js.map +1 -1
- package/dist/src/tools/collab-adapter.d.ts +85 -0
- package/dist/src/tools/collab-adapter.d.ts.map +1 -0
- package/dist/src/tools/collab-adapter.js +320 -0
- package/dist/src/tools/collab-adapter.js.map +1 -0
- package/dist/src/tools/namespace-guard.d.ts +2 -0
- package/dist/src/tools/namespace-guard.d.ts.map +1 -1
- package/dist/src/tools/namespace-guard.js +12 -0
- package/dist/src/tools/namespace-guard.js.map +1 -1
- package/dist/src/tools/phase-gate-evaluator.d.ts +45 -0
- package/dist/src/tools/phase-gate-evaluator.d.ts.map +1 -0
- package/dist/src/tools/phase-gate-evaluator.js +42 -0
- package/dist/src/tools/phase-gate-evaluator.js.map +1 -0
- package/dist/src/tools/team-members.d.ts +18 -0
- package/dist/src/tools/team-members.d.ts.map +1 -1
- package/dist/src/tools/team-members.js +50 -0
- package/dist/src/tools/team-members.js.map +1 -1
- package/dist/src/tools/team-tasks.d.ts +120 -0
- package/dist/src/tools/team-tasks.d.ts.map +1 -0
- package/dist/src/tools/team-tasks.js +365 -0
- package/dist/src/tools/team-tasks.js.map +1 -0
- package/dist/src/tools/transition-recorder.d.ts +3 -0
- package/dist/src/tools/transition-recorder.d.ts.map +1 -1
- package/dist/src/tools/transition-recorder.js +52 -1
- package/dist/src/tools/transition-recorder.js.map +1 -1
- package/dist/src/utils/get-version.d.ts.map +1 -1
- package/dist/src/utils/get-version.js +15 -4
- package/dist/src/utils/get-version.js.map +1 -1
- package/package.json +1 -1
- package/templates/config.json +7 -0
- package/templates/worktree-scope.json +10 -0
- package/templates/worktrees.json +27 -0
- package/workflows/analyze.md +86 -36
- package/workflows/brainstorm.md +17 -37
- package/workflows/delegate-usage.md +39 -41
- package/workflows/execute.md +247 -61
- package/workflows/fork.md +309 -0
- package/workflows/init.md +11 -2
- package/workflows/issue.md +66 -7
- package/workflows/maestro-coordinate.codex.md +1 -1
- package/workflows/maestro-coordinate.md +24 -17
- package/workflows/maestro.md +54 -37
- package/workflows/memory.md +2 -1
- package/workflows/merge.md +285 -0
- package/workflows/milestone-audit.md +89 -70
- package/workflows/milestone-complete.md +89 -156
- package/workflows/plan.md +131 -19
- package/workflows/retrospective.md +5 -5
- package/workflows/roadmap.md +12 -4
- package/workflows/spec-generate.md +9 -0
- package/workflows/status.md +76 -27
- package/workflows/ui-design.md +14 -12
- package/workflows/verify.md +44 -8
- package/.claude/commands/learn-retro-decision.md +0 -198
- package/.claude/commands/learn-retro-git.md +0 -160
- package/.claude/commands/maestro-phase-add.md +0 -63
- package/.claude/commands/maestro-phase-transition.md +0 -75
- package/.codex/skills/maestro-phase-add/SKILL.md +0 -154
- package/.codex/skills/maestro-phase-transition/SKILL.md +0 -173
- package/chains/singles/phase-add.json +0 -31
- package/chains/singles/phase-transition.json +0 -23
- package/dashboard/dist/assets/ChatInput-PuCvZZ3y.js +0 -67
- package/dashboard/dist/assets/ChatPage-v19GURYH.js +0 -8
- package/dashboard/dist/assets/CollabPage-I5k_mCbG.js +0 -1
- package/dashboard/dist/assets/KanbanPage-PDDBv5-9.js +0 -16
- package/dashboard/dist/assets/McpPage-CiqXpCHg.js +0 -16
- package/dashboard/dist/assets/TreeBrowser-0VIMWclo.js +0 -11
- package/dashboard/dist/assets/WorkflowPage-Csm23wUS.js +0 -6
- package/dashboard/dist/assets/git-branch-DL8p9kVC.js +0 -6
- package/dashboard/dist/assets/index-11DuhKhc.js +0 -231
- package/dashboard/dist/assets/index-D2Mtyw7I.css +0 -1
- package/dashboard/dist/assets/wrench-BScEJFqC.js +0 -11
- package/dist/src/commands/team.d.ts.map +0 -1
- package/dist/src/commands/team.js.map +0 -1
- package/workflows/phase-add.md +0 -252
- package/workflows/phase-transition.md +0 -399
package/workflows/execute.md
CHANGED
|
@@ -2,32 +2,59 @@
|
|
|
2
2
|
|
|
3
3
|
Wave-based parallel execution with atomic commits, breakpoint resume, and optional sync/reflection.
|
|
4
4
|
|
|
5
|
+
Core principle: **Execute per-plan, not per-phase.** Each plan's wave DAG runs independently. Multiple plans execute sequentially.
|
|
6
|
+
|
|
5
7
|
---
|
|
6
8
|
|
|
7
9
|
## Prerequisites
|
|
8
10
|
|
|
9
|
-
-
|
|
10
|
-
- `index.json` present with `plan.waves` populated
|
|
11
|
+
- Plan exists in scratch directory: `plan.json` + `.task/TASK-*.json`
|
|
11
12
|
- OR: executionContext handoff received from `/workflow:plan`
|
|
12
13
|
|
|
13
14
|
---
|
|
14
15
|
|
|
15
|
-
##
|
|
16
|
+
## Plan Resolution
|
|
16
17
|
|
|
17
18
|
```
|
|
18
|
-
Input:
|
|
19
|
+
Input: [phase] argument OR --dir <path>
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
# Worktree scope check
|
|
22
|
+
IF file_exists(".workflow/worktree-scope.json"):
|
|
23
|
+
scope = read(".workflow/worktree-scope.json")
|
|
24
|
+
IF <phase> is a number AND <phase> NOT IN scope.owned_phases:
|
|
25
|
+
ERROR "Phase {phase} not owned by this worktree. Owned: {scope.owned_phases}"
|
|
26
|
+
EXIT
|
|
27
|
+
|
|
28
|
+
# Auto-bootstrap state.json if missing
|
|
29
|
+
IF NOT file_exists(".workflow/state.json"):
|
|
30
|
+
mkdir -p .workflow/scratch/
|
|
31
|
+
Write minimal state.json
|
|
25
32
|
|
|
26
|
-
|
|
27
|
-
1.
|
|
28
|
-
2.
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
IF --dir <path> is provided:
|
|
34
|
+
1. Set PLAN_DIRS = [<path>] // single plan
|
|
35
|
+
2. Validate directory exists and contains plan.json
|
|
36
|
+
|
|
37
|
+
ELSE IF no arguments:
|
|
38
|
+
// Find all pending plans for current milestone
|
|
39
|
+
1. Read state.json.artifacts
|
|
40
|
+
2. Filter: milestone == current_milestone, type == "plan", status == "completed"
|
|
41
|
+
3. Exclude plans that already have a corresponding EXC artifact (same path)
|
|
42
|
+
4. Sort by phase order (from roadmap), adhoc plans last
|
|
43
|
+
5. Set PLAN_DIRS = filtered plan paths
|
|
44
|
+
6. If empty: ERROR E001 "No pending plans found"
|
|
45
|
+
|
|
46
|
+
ELSE IF argument is a number:
|
|
47
|
+
// Find pending plans for specific phase
|
|
48
|
+
1. Read state.json.artifacts
|
|
49
|
+
2. Filter: milestone == current_milestone, type == "plan", status == "completed", phase == arg
|
|
50
|
+
3. Exclude plans with existing EXC artifacts
|
|
51
|
+
4. Set PLAN_DIRS = filtered plan paths
|
|
52
|
+
|
|
53
|
+
// Execute plans sequentially
|
|
54
|
+
FOR each PLAN_DIR IN PLAN_DIRS:
|
|
55
|
+
execute_single_plan(PLAN_DIR)
|
|
56
|
+
register_exc_artifact(PLAN_DIR)
|
|
57
|
+
extract_incremental_learnings(PLAN_DIR)
|
|
31
58
|
```
|
|
32
59
|
|
|
33
60
|
---
|
|
@@ -37,41 +64,45 @@ ELSE (standard phase resolution):
|
|
|
37
64
|
| Flag | Effect |
|
|
38
65
|
|------|--------|
|
|
39
66
|
| `--auto-commit` | Override config: commit after each task completion |
|
|
40
|
-
| `--method agent\|cli` | Override execution method (default: config.json.execution.method) |
|
|
67
|
+
| `--method agent\|cli\|auto` | Override execution method (default: config.json.execution.method) |
|
|
68
|
+
| `--executor <tool>` | Default CLI tool: gemini\|codex\|qwen\|opencode\|claude (default: first enabled in cli-tools.json) |
|
|
41
69
|
| `--dir <path>` | Use arbitrary directory instead of phase resolution (skip roadmap validation) |
|
|
42
70
|
|
|
43
71
|
---
|
|
44
72
|
|
|
45
|
-
## E1: Load Plan
|
|
73
|
+
## E1: Load Plan (per PLAN_DIR)
|
|
46
74
|
|
|
47
|
-
**Purpose:** Build or receive the execution queue.
|
|
75
|
+
**Purpose:** Build or receive the execution queue for a single plan.
|
|
48
76
|
|
|
49
|
-
### From executionContext handoff (preferred)
|
|
77
|
+
### From executionContext handoff (preferred, first plan only)
|
|
50
78
|
|
|
51
79
|
```
|
|
52
80
|
If executionContext is available in memory:
|
|
53
81
|
planObject = executionContext.planObject
|
|
54
82
|
explorations = executionContext.explorations
|
|
55
83
|
clarifications = executionContext.clarifications
|
|
56
|
-
executionMethod = executionContext.executionMethod
|
|
84
|
+
executionMethod = --method flag || executionContext.executionMethod
|
|
85
|
+
defaultExecutor = --executor flag || executionContext.defaultExecutor
|
|
86
|
+
executorAssignments = executionContext.executorAssignments || {}
|
|
57
87
|
Skip disk reload
|
|
58
88
|
```
|
|
59
89
|
|
|
60
|
-
### From disk (fallback / resume)
|
|
90
|
+
### From disk (fallback / resume / subsequent plans)
|
|
61
91
|
|
|
62
92
|
```
|
|
63
|
-
Read ${
|
|
64
|
-
Read ${PHASE_DIR}/plan.json
|
|
93
|
+
Read ${PLAN_DIR}/plan.json
|
|
65
94
|
|
|
66
95
|
executionMethod = --method flag || config.json.execution.method || "agent"
|
|
96
|
+
defaultExecutor = --executor flag || config.json.execution.default_executor || "gemini"
|
|
97
|
+
executorAssignments = plan.json.executor_assignments || {}
|
|
67
98
|
```
|
|
68
99
|
|
|
69
100
|
### Detect completed tasks (breakpoint resume)
|
|
70
101
|
|
|
71
102
|
```
|
|
72
103
|
completed_tasks = []
|
|
73
|
-
For each task_id in
|
|
74
|
-
Read
|
|
104
|
+
For each task_id in plan.json.task_ids:
|
|
105
|
+
Read ${PLAN_DIR}/.task/${task_id}.json
|
|
75
106
|
If status == "completed":
|
|
76
107
|
completed_tasks.push(task_id)
|
|
77
108
|
|
|
@@ -84,7 +115,7 @@ If completed_tasks.length > 0:
|
|
|
84
115
|
### Build wave execution queue
|
|
85
116
|
|
|
86
117
|
```
|
|
87
|
-
waves = plan.json.waves
|
|
118
|
+
waves = plan.json.waves
|
|
88
119
|
|
|
89
120
|
execution_queue = []
|
|
90
121
|
For each wave in waves:
|
|
@@ -110,7 +141,69 @@ Pass specs_content to each executor agent in E2.
|
|
|
110
141
|
|
|
111
142
|
## E2: Wave Parallel Execution
|
|
112
143
|
|
|
113
|
-
**Purpose:** Execute tasks wave by wave, parallel within each wave.
|
|
144
|
+
**Purpose:** Execute tasks wave by wave, parallel within each wave. Supports multi-backend dispatch — tasks route to Agent or CLI tools (via `maestro delegate`) based on executor resolution.
|
|
145
|
+
|
|
146
|
+
### Executor Resolution
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
# Priority: per-task assignment > global method > auto fallback
|
|
150
|
+
function resolveTaskExecutor(task_id):
|
|
151
|
+
If executorAssignments[task_id]:
|
|
152
|
+
return executorAssignments[task_id].executor # "agent"|"gemini"|"codex"|"qwen"|"opencode"|"claude"
|
|
153
|
+
If executionMethod == "agent":
|
|
154
|
+
return "agent"
|
|
155
|
+
If executionMethod == "cli":
|
|
156
|
+
return defaultExecutor # e.g., "gemini"
|
|
157
|
+
# executionMethod == "auto":
|
|
158
|
+
task = loaded task definition
|
|
159
|
+
# Heuristic: tasks with many files or multi-step implementation → agent; otherwise → CLI
|
|
160
|
+
return (task.files.length > 5 || task.implementation.length > 8) ? "agent" : defaultExecutor
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Delegate Prompt Builder
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
# Unified prompt for CLI backends (maestro delegate). Same task info as Agent path.
|
|
167
|
+
function buildDelegatePrompt(task_def, phase_context, specs_content, prior_summaries):
|
|
168
|
+
return """
|
|
169
|
+
PURPOSE: Implement task ${task_def.id}: ${task_def.title}; success = all convergence criteria pass
|
|
170
|
+
TASK: ${task_def.action} | Read existing code first | Verify convergence criteria after changes
|
|
171
|
+
MODE: write
|
|
172
|
+
CONTEXT: @${task_def.scope}/**/* | Phase: ${phase_context.goal}
|
|
173
|
+
EXPECTED: Working code changes, all convergence criteria verified, summary of what was done
|
|
174
|
+
CONSTRAINTS: Scope limited to task files | Follow project specs
|
|
175
|
+
|
|
176
|
+
## Task Definition
|
|
177
|
+
|
|
178
|
+
**Scope**: ${task_def.scope} | **Action**: ${task_def.action}
|
|
179
|
+
|
|
180
|
+
### Files
|
|
181
|
+
${task_def.files.map(f => '- ' + f.path + ' → ' + f.target + ': ' + f.change).join('\n')}
|
|
182
|
+
|
|
183
|
+
### Read First
|
|
184
|
+
${task_def.read_first.map(f => '- ' + f).join('\n')}
|
|
185
|
+
|
|
186
|
+
### Implementation Steps
|
|
187
|
+
${task_def.implementation.map(s => '- ' + s).join('\n')}
|
|
188
|
+
|
|
189
|
+
### Convergence Criteria
|
|
190
|
+
${task_def.convergence.criteria.map(c => '- [ ] ' + c).join('\n')}
|
|
191
|
+
|
|
192
|
+
### Reference
|
|
193
|
+
- Pattern: ${task_def.reference?.pattern || 'N/A'}
|
|
194
|
+
- Files: ${task_def.reference?.files?.join(', ') || 'N/A'}
|
|
195
|
+
|
|
196
|
+
## Phase Context
|
|
197
|
+
- Goal: ${phase_context.goal}
|
|
198
|
+
- Success criteria: ${phase_context.success_criteria}
|
|
199
|
+
|
|
200
|
+
## Project Specs
|
|
201
|
+
${specs_content}
|
|
202
|
+
|
|
203
|
+
## Prior Task Summaries
|
|
204
|
+
${prior_summaries}
|
|
205
|
+
"""
|
|
206
|
+
```
|
|
114
207
|
|
|
115
208
|
### Execution Loop
|
|
116
209
|
|
|
@@ -128,7 +221,9 @@ For each wave in execution_queue (sequential):
|
|
|
128
221
|
Read .workflow/state.json
|
|
129
222
|
If state.json.status != "executing":
|
|
130
223
|
state.json.status = "executing"
|
|
131
|
-
|
|
224
|
+
# Worktree mode: skip phases_summary (reconciled on merge)
|
|
225
|
+
IF NOT file_exists(".workflow/worktree-scope.json"):
|
|
226
|
+
state.json.phases_summary.in_progress += 1
|
|
132
227
|
state.json.last_updated = now()
|
|
133
228
|
Write .workflow/state.json
|
|
134
229
|
|
|
@@ -146,31 +241,59 @@ For each wave in execution_queue (sequential):
|
|
|
146
241
|
1. Load task definition
|
|
147
242
|
Read .task/${task_id}.json (lazy loading)
|
|
148
243
|
|
|
149
|
-
2.
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
244
|
+
2. Resolve executor and dispatch
|
|
245
|
+
executor = resolveTaskExecutor(task_id)
|
|
246
|
+
|
|
247
|
+
IF executor == "agent":
|
|
248
|
+
# --- Agent path (existing) ---
|
|
249
|
+
Spawn workflow-executor agent (fresh 200k context)
|
|
250
|
+
Input:
|
|
251
|
+
- Task definition (.task/${task_id}.json)
|
|
252
|
+
- Phase context (index.json goal, success_criteria)
|
|
253
|
+
- Relevant summaries from prior waves (.summaries/ of deps)
|
|
254
|
+
- Project specs (specs_content from E1.5)
|
|
255
|
+
- Phase context decisions (context.md)
|
|
256
|
+
- Phase analysis scores (analysis.md)
|
|
257
|
+
|
|
258
|
+
Agent responsibilities:
|
|
259
|
+
a. Read task definition (read_first, files, action, convergence.criteria)
|
|
260
|
+
b. Implement the task (create/modify files per task.files)
|
|
261
|
+
c. Verify convergence.criteria pass
|
|
262
|
+
d. If verification fails: auto-fix (max 3 attempts)
|
|
263
|
+
e. If auto-fix fails: write checkpoint, mark task as "blocked"
|
|
264
|
+
f. Atomic commit (if auto-commit enabled):
|
|
265
|
+
git add <task files>
|
|
266
|
+
git commit -m "{type}({slug}): {task.title}"
|
|
267
|
+
g. Write .summaries/${task_id}-summary.md
|
|
268
|
+
h. Update .task/${task_id}.json:
|
|
269
|
+
status = "completed" | "blocked"
|
|
270
|
+
|
|
271
|
+
ELSE:
|
|
272
|
+
# --- CLI path (via maestro delegate) ---
|
|
273
|
+
fixedId = "${PHASE_NUM || 'scratch'}-${PHASE_SLUG}-${task_id}"
|
|
274
|
+
prompt = buildDelegatePrompt(task_def, phase_context, specs_content, prior_summaries)
|
|
275
|
+
|
|
276
|
+
# Store delegate ID for resume tracking
|
|
277
|
+
index.json.execution.delegate_ids[task_id] = fixedId
|
|
278
|
+
|
|
279
|
+
# Dispatch — synchronous, returns when done
|
|
280
|
+
Bash("maestro delegate \"${prompt}\" --to ${executor} --mode write --id ${fixedId}")
|
|
281
|
+
|
|
282
|
+
# Post-dispatch processing (CLI tools don't do this internally):
|
|
283
|
+
a. Verify convergence criteria against actual file state
|
|
284
|
+
For each criterion in task_def.convergence.criteria:
|
|
285
|
+
Check file contents / grep / test command
|
|
286
|
+
b. Determine status:
|
|
287
|
+
If all criteria pass: status = "completed"
|
|
288
|
+
Else: status = "blocked", log which criteria failed
|
|
289
|
+
c. Write .summaries/${task_id}-summary.md (from delegate output + verification result)
|
|
290
|
+
d. Update .task/${task_id}.json: status = status
|
|
291
|
+
e. Auto-commit (if --auto-commit and status == "completed"):
|
|
166
292
|
git add <task files>
|
|
167
293
|
git commit -m "{type}({slug}): {task.title}"
|
|
168
|
-
g. Write .summaries/${task_id}-summary.md
|
|
169
|
-
h. Update .task/${task_id}.json:
|
|
170
|
-
status = "completed" | "blocked"
|
|
171
294
|
|
|
172
295
|
3. Collect result
|
|
173
|
-
result = { task_id, status, summary_path, commit_hash }
|
|
296
|
+
result = { task_id, status, executor, summary_path, commit_hash, delegate_id }
|
|
174
297
|
|
|
175
298
|
4. Clear current_task_id in state.json
|
|
176
299
|
Read .workflow/state.json
|
|
@@ -198,20 +321,36 @@ For each wave in execution_queue (sequential):
|
|
|
198
321
|
Log "=== Wave {wave.wave} complete ==="
|
|
199
322
|
```
|
|
200
323
|
|
|
324
|
+
### Parallel Dispatch Rules
|
|
325
|
+
|
|
326
|
+
```
|
|
327
|
+
Within a wave, tasks execute in parallel regardless of executor type:
|
|
328
|
+
- Agent tasks: multiple Agent() calls in single message (run_in_background: false)
|
|
329
|
+
- CLI tasks: multiple Bash("maestro delegate ...") calls in single message (run_in_background: true)
|
|
330
|
+
- Mixed: Agent() + Bash() calls together in single message
|
|
331
|
+
- Each task = one independent dispatch (never merge tasks into one delegate prompt)
|
|
332
|
+
```
|
|
333
|
+
|
|
201
334
|
### Deviation Rule
|
|
202
335
|
|
|
203
336
|
```
|
|
204
337
|
Per task, max 3 auto-fix attempts:
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
338
|
+
|
|
339
|
+
Agent path: auto-fix handled internally by workflow-executor agent.
|
|
340
|
+
|
|
341
|
+
CLI path: auto-fix via session resume:
|
|
342
|
+
Attempt 1: Re-dispatch with --resume ${fixedId}
|
|
343
|
+
Attempt 2: Re-dispatch with simplified prompt (reduce to core action + criteria)
|
|
344
|
+
Attempt 3: Fallback to agent executor for this task
|
|
208
345
|
|
|
209
346
|
If all 3 fail:
|
|
210
347
|
Mark task as "blocked" with checkpoint data:
|
|
211
348
|
.task/${task_id}.json.meta.checkpoint = {
|
|
212
349
|
attempt: 3,
|
|
213
350
|
last_error: "...",
|
|
214
|
-
partial_files: [...]
|
|
351
|
+
partial_files: [...],
|
|
352
|
+
executor: executor,
|
|
353
|
+
delegate_id: fixedId
|
|
215
354
|
}
|
|
216
355
|
Continue wave (other tasks unaffected)
|
|
217
356
|
```
|
|
@@ -355,7 +494,7 @@ If config.json.workflow.reflection == true:
|
|
|
355
494
|
- Any blocked tasks?
|
|
356
495
|
- Patterns observed?
|
|
357
496
|
|
|
358
|
-
Append to ${
|
|
497
|
+
Append to ${PLAN_DIR}/reflection-log.md:
|
|
359
498
|
## Reflection - Wave Execution {timestamp}
|
|
360
499
|
- Strategy adjustments: [...]
|
|
361
500
|
- Patterns noted: [...]
|
|
@@ -395,14 +534,53 @@ If NOT SCRATCH_MODE:
|
|
|
395
534
|
|
|
396
535
|
---
|
|
397
536
|
|
|
537
|
+
## E5: Register Artifact & Extract Learnings (per PLAN_DIR)
|
|
538
|
+
|
|
539
|
+
**Purpose:** Register execution completion and extract incremental learnings.
|
|
540
|
+
|
|
541
|
+
```
|
|
542
|
+
// Register EXC artifact
|
|
543
|
+
Read .workflow/state.json
|
|
544
|
+
plan_artifact = state.json.artifacts.find(a => a.type == "plan" && a.path == PLAN_DIR_relative)
|
|
545
|
+
next_id = max(artifacts.filter(a => a.type == "execute").map(a => parseInt(a.id.replace("EXC-","")))) + 1
|
|
546
|
+
|
|
547
|
+
artifact = {
|
|
548
|
+
id: "EXC-{next_id padded to 3}",
|
|
549
|
+
type: "execute",
|
|
550
|
+
milestone: plan_artifact.milestone,
|
|
551
|
+
phase: plan_artifact.phase,
|
|
552
|
+
scope: plan_artifact.scope,
|
|
553
|
+
path: plan_artifact.path, // same path — execute writes into plan dir
|
|
554
|
+
status: "completed",
|
|
555
|
+
depends_on: plan_artifact.id,
|
|
556
|
+
harvested: false,
|
|
557
|
+
created_at: execution_start_time,
|
|
558
|
+
completed_at: now()
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
state.json.artifacts.push(artifact)
|
|
562
|
+
state.json.last_updated = now()
|
|
563
|
+
Write state.json (atomic)
|
|
564
|
+
|
|
565
|
+
// Incremental learning extraction
|
|
566
|
+
Read all ${PLAN_DIR}/.summaries/TASK-*-summary.md
|
|
567
|
+
Extract: strategy adjustments, patterns discovered, pitfalls encountered
|
|
568
|
+
Append to .workflow/specs/learnings.md under "## Entries"
|
|
569
|
+
Mark artifact.harvested = true
|
|
570
|
+
Write state.json (atomic)
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
---
|
|
574
|
+
|
|
398
575
|
## Error Handling
|
|
399
576
|
|
|
400
577
|
| Error | Action |
|
|
401
578
|
|-------|--------|
|
|
402
|
-
|
|
|
403
|
-
|
|
|
579
|
+
| No pending plans found | Abort: "No pending plans. Run /workflow:plan first." |
|
|
580
|
+
| Plan directory not found | Abort: "Plan dir not found." |
|
|
404
581
|
| Task file missing | Skip task, log error, continue wave |
|
|
405
582
|
| Agent spawn fails | Retry once, then mark task as "blocked" |
|
|
583
|
+
| Delegate fails | Resume with `--resume ${fixedId}`, then fallback to agent |
|
|
406
584
|
| Git commit fails | Log warning, continue (task still marked completed) |
|
|
407
585
|
| All tasks in wave blocked | Stop execution, report blocked wave |
|
|
408
586
|
|
|
@@ -414,14 +592,22 @@ The execute workflow is fully resumable:
|
|
|
414
592
|
|
|
415
593
|
```
|
|
416
594
|
State tracking in index.json.execution:
|
|
417
|
-
tasks_completed: N
|
|
418
|
-
current_wave: W
|
|
419
|
-
commits: [...]
|
|
595
|
+
tasks_completed: N # Count of finished tasks
|
|
596
|
+
current_wave: W # Last active wave
|
|
597
|
+
commits: [...] # All commits made
|
|
598
|
+
method: "agent"|"cli"|"auto" # Execution method used
|
|
599
|
+
default_executor: "gemini"|... # CLI tool used (if method != "agent")
|
|
600
|
+
delegate_ids: { task_id: fixedId, ... } # CLI task delegate IDs
|
|
420
601
|
|
|
421
602
|
Re-running /workflow:execute <phase>:
|
|
422
603
|
1. Reads index.json.execution.tasks_completed
|
|
423
604
|
2. Checks each .task/TASK-*.json status
|
|
424
|
-
3.
|
|
425
|
-
|
|
426
|
-
|
|
605
|
+
3. For CLI-dispatched tasks with status "in-progress":
|
|
606
|
+
fixedId = index.json.execution.delegate_ids[task_id]
|
|
607
|
+
Check maestro delegate status ${fixedId}
|
|
608
|
+
If completed: retrieve output, process as completed
|
|
609
|
+
If failed: add to retry queue with --resume ${fixedId}
|
|
610
|
+
4. Builds queue of remaining tasks
|
|
611
|
+
5. Continues from next pending wave
|
|
612
|
+
6. No duplicate execution of completed tasks
|
|
427
613
|
```
|