maestro-flow 0.3.8 → 0.3.10
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 +6 -6
- package/.claude/commands/learn-second-opinion.md +3 -3
- package/.claude/commands/maestro-analyze.md +166 -99
- package/.claude/commands/maestro-brainstorm.md +2 -2
- package/.claude/commands/maestro-execute.md +151 -97
- package/.claude/commands/maestro-fork.md +111 -0
- package/.claude/commands/maestro-init.md +6 -6
- 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 +167 -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 +6 -6
- package/.claude/commands/manage-issue-discover.md +2 -2
- package/.claude/commands/manage-issue.md +7 -7
- package/.claude/commands/manage-learn.md +2 -2
- package/.claude/commands/manage-memory-capture.md +4 -4
- package/.claude/commands/manage-memory.md +2 -2
- 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 +2 -2
- 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 +1 -1
- package/.claude/commands/spec-setup.md +5 -5
- package/.claude/commands/wiki-connect.md +3 -3
- package/.claude/commands/wiki-digest.md +4 -4
- package/.codex/skills/maestro/SKILL.md +463 -0
- package/.codex/skills/maestro-analyze/SKILL.md +79 -20
- package/.codex/skills/maestro-chain/SKILL.md +248 -0
- package/.codex/skills/maestro-coordinate/SKILL.md +279 -224
- package/.codex/skills/maestro-execute/SKILL.md +35 -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 +56 -18
- 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 +26 -21
- package/README.zh-CN.md +23 -19
- 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/issue-lifecycle.json +13 -13
- package/chains/milestone-close.json +20 -7
- package/chains/milestone-fork-merge.json +50 -0
- package/chains/roadmap-driven.json +17 -6
- 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/chains/spec-driven.json +17 -6
- package/dashboard/dist/assets/{ArtifactsPage-BmPOu8sO.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-BjZ43aSa.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-B7yRL0s_.js → RequirementBoardPage-Bf1trzqs.js} +2 -2
- package/dashboard/dist/assets/{RequirementPage-D8J_-b6O.js → RequirementPage-Bllxe2XI.js} +10 -5
- package/dashboard/dist/assets/{SpecsPage-6lO8v8_C.js → SpecsPage-9lwxKT27.js} +2 -2
- package/dashboard/dist/assets/{SupervisorPage-Ds5N378a.js → SupervisorPage-SusdfHFq.js} +1 -1
- package/dashboard/dist/assets/{TeamsPage-DrkKr17T.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-CadP5YgU.js → arrow-left-Bqtb2hle.js} +1 -1
- package/dashboard/dist/assets/{check-5xufDzS8.js → check-u6fGOwQO.js} +1 -1
- package/dashboard/dist/assets/{chevron-right-CYbpR4ev.js → chevron-right-Csu22t58.js} +1 -1
- package/dashboard/dist/assets/{circle-Bm-5Q-Yh.js → circle-CMrkbRNg.js} +1 -1
- package/dashboard/dist/assets/{circle-alert-BqcYuT7x.js → circle-alert-c3tH1P4z.js} +1 -1
- package/dashboard/dist/assets/{circle-check-big-yyzAFysU.js → circle-check-big-TDSeWstm.js} +1 -1
- package/dashboard/dist/assets/{circle-check-DEVzW_lm.js → circle-check-gYxxSYuH.js} +1 -1
- package/dashboard/dist/assets/{code-BBdC8Wmw.js → code-CFN2uX9V.js} +1 -1
- package/dashboard/dist/assets/{columns-3-CQ9Trztr.js → columns-3-38xIDlzy.js} +1 -1
- package/dashboard/dist/assets/{download-DayuF-sn.js → download-DC7KkKyP.js} +1 -1
- package/dashboard/dist/assets/{folder-CqXeSKeC.js → folder-CWq_lAnf.js} +1 -1
- package/dashboard/dist/assets/index-DWG-WrzT.js +231 -0
- package/dashboard/dist/assets/{index-Dru5HYy0.js → index-Do71weNR.js} +1 -1
- package/dashboard/dist/assets/index-GUNJodSR.css +1 -0
- package/dashboard/dist/assets/{list-DBOD6IUt.js → list-CgIP_2A-.js} +1 -1
- package/dashboard/dist/assets/{minus-fQI1Syn2.js → minus-DYoN5UGk.js} +1 -1
- package/dashboard/dist/assets/{pen-line-Bkbbngl5.js → pen-line-Bh_WKYHm.js} +1 -1
- package/dashboard/dist/assets/{proxy-teW12DdZ.js → proxy-BKxDAKTj.js} +1 -1
- package/dashboard/dist/assets/{search-Bq3ygFUW.js → search-SieXnOgr.js} +1 -1
- package/dashboard/dist/assets/{shallow-22ZN8sFt.js → shallow-Bme1JY57.js} +1 -1
- package/dashboard/dist/assets/{table-BEYtdWc4.js → table-llyEtj-7.js} +1 -1
- package/dashboard/dist/assets/terminal-BB3Xfuv5.js +6 -0
- package/dashboard/dist/assets/{trash-2-DMqGBgcF.js → trash-2-C8f4vFFM.js} +1 -1
- package/dashboard/dist/assets/{zap-9DVkGVtt.js → zap-4uwlzVm0.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- 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/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/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 +34 -0
- package/dashboard/dist-server/dashboard/src/server/routes/issues.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 +43 -3
- package/dashboard/dist-server/dashboard/src/server/state/state-manager.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/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/src/hooks/constants.d.ts +90 -12
- package/dashboard/dist-server/src/hooks/constants.js +149 -16
- package/dashboard/dist-server/src/hooks/constants.js.map +1 -1
- package/dashboard/dist-server/src/types/index.d.ts +5 -0
- 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/collab.d.ts +14 -0
- package/dist/src/commands/collab.d.ts.map +1 -0
- package/dist/src/commands/{team.js → collab.js} +395 -96
- package/dist/src/commands/collab.js.map +1 -0
- 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 +50 -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/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/__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 +90 -12
- package/dist/src/hooks/constants.d.ts.map +1 -1
- package/dist/src/hooks/constants.js +149 -16
- package/dist/src/hooks/constants.js.map +1 -1
- package/dist/src/hooks/guards/index.d.ts +1 -0
- package/dist/src/hooks/guards/index.d.ts.map +1 -1
- package/dist/src/hooks/guards/index.js +1 -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/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/{commands/team.d.ts → hooks/preflight-core.d.ts} +12 -22
- 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/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/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/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/tools/collab-adapter.d.ts +102 -0
- package/dist/src/tools/collab-adapter.d.ts.map +1 -0
- package/dist/src/tools/collab-adapter.js +458 -0
- package/dist/src/tools/collab-adapter.js.map +1 -0
- 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/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/types/index.d.ts +5 -0
- package/dist/src/types/index.d.ts.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/cli/prompts/workflow-skill-conflict-patterns.txt +3 -3
- package/templates/cli/prompts/workflow-skill-lessons-learned.txt +3 -3
- package/templates/config.json +7 -0
- package/templates/search-tools.md +1 -1
- 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/cli-tools-usage.md +44 -27
- package/workflows/delegate-usage.md +3 -3
- package/workflows/execute.md +94 -28
- package/workflows/fork.md +309 -0
- package/workflows/init.md +10 -1
- package/workflows/issue-analyze.md +6 -2
- package/workflows/issue-discover.md +4 -4
- package/workflows/issue-execute.md +6 -3
- package/workflows/issue-plan.md +5 -2
- package/workflows/issue.md +66 -7
- package/workflows/maestro-coordinate.codex.md +281 -470
- package/workflows/maestro-coordinate.md +37 -30
- package/workflows/maestro-link-coordinate.md +2 -2
- package/workflows/maestro.codex.md +710 -0
- package/workflows/maestro.md +62 -46
- package/workflows/merge.md +285 -0
- package/workflows/milestone-audit.md +89 -70
- package/workflows/milestone-complete.md +89 -156
- package/workflows/plan.md +122 -17
- package/workflows/retrospective.md +4 -4
- package/workflows/roadmap.md +11 -3
- 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/maestro-phase-add.md +0 -63
- package/.claude/commands/maestro-phase-transition.md +0 -75
- 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/maestro-phase-add/SKILL.md +0 -154
- package/.codex/skills/maestro-phase-transition/SKILL.md +0 -173
- 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
- package/chains/singles/phase-add.json +0 -31
- package/chains/singles/phase-transition.json +0 -23
- package/dashboard/dist/assets/ChatInput-CL8YDfOU.js +0 -67
- package/dashboard/dist/assets/ChatPage-CT-ozBK2.js +0 -8
- package/dashboard/dist/assets/CollabPage-C0rWMden.js +0 -1
- package/dashboard/dist/assets/KanbanPage-C6WbAlwI.js +0 -16
- package/dashboard/dist/assets/McpPage-BPIXADQi.js +0 -16
- package/dashboard/dist/assets/TreeBrowser-g_QUKemL.js +0 -11
- package/dashboard/dist/assets/WorkflowPage-X8aNkDEr.js +0 -6
- package/dashboard/dist/assets/git-branch-SqFf4Ru5.js +0 -6
- package/dashboard/dist/assets/index-D2Mtyw7I.css +0 -1
- package/dashboard/dist/assets/index-nufWop4p.js +0 -231
- package/dashboard/dist/assets/wrench-B84-zdLI.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
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
|
32
|
+
|
|
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
|
---
|
|
@@ -43,11 +70,11 @@ ELSE (standard phase resolution):
|
|
|
43
70
|
|
|
44
71
|
---
|
|
45
72
|
|
|
46
|
-
## E1: Load Plan
|
|
73
|
+
## E1: Load Plan (per PLAN_DIR)
|
|
47
74
|
|
|
48
|
-
**Purpose:** Build or receive the execution queue.
|
|
75
|
+
**Purpose:** Build or receive the execution queue for a single plan.
|
|
49
76
|
|
|
50
|
-
### From executionContext handoff (preferred)
|
|
77
|
+
### From executionContext handoff (preferred, first plan only)
|
|
51
78
|
|
|
52
79
|
```
|
|
53
80
|
If executionContext is available in memory:
|
|
@@ -60,23 +87,22 @@ If executionContext is available in memory:
|
|
|
60
87
|
Skip disk reload
|
|
61
88
|
```
|
|
62
89
|
|
|
63
|
-
### From disk (fallback / resume)
|
|
90
|
+
### From disk (fallback / resume / subsequent plans)
|
|
64
91
|
|
|
65
92
|
```
|
|
66
|
-
Read ${
|
|
67
|
-
Read ${PHASE_DIR}/plan.json
|
|
93
|
+
Read ${PLAN_DIR}/plan.json
|
|
68
94
|
|
|
69
95
|
executionMethod = --method flag || config.json.execution.method || "agent"
|
|
70
96
|
defaultExecutor = --executor flag || config.json.execution.default_executor || "gemini"
|
|
71
|
-
executorAssignments =
|
|
97
|
+
executorAssignments = plan.json.executor_assignments || {}
|
|
72
98
|
```
|
|
73
99
|
|
|
74
100
|
### Detect completed tasks (breakpoint resume)
|
|
75
101
|
|
|
76
102
|
```
|
|
77
103
|
completed_tasks = []
|
|
78
|
-
For each task_id in
|
|
79
|
-
Read
|
|
104
|
+
For each task_id in plan.json.task_ids:
|
|
105
|
+
Read ${PLAN_DIR}/.task/${task_id}.json
|
|
80
106
|
If status == "completed":
|
|
81
107
|
completed_tasks.push(task_id)
|
|
82
108
|
|
|
@@ -89,7 +115,7 @@ If completed_tasks.length > 0:
|
|
|
89
115
|
### Build wave execution queue
|
|
90
116
|
|
|
91
117
|
```
|
|
92
|
-
waves = plan.json.waves
|
|
118
|
+
waves = plan.json.waves
|
|
93
119
|
|
|
94
120
|
execution_queue = []
|
|
95
121
|
For each wave in waves:
|
|
@@ -195,7 +221,9 @@ For each wave in execution_queue (sequential):
|
|
|
195
221
|
Read .workflow/state.json
|
|
196
222
|
If state.json.status != "executing":
|
|
197
223
|
state.json.status = "executing"
|
|
198
|
-
|
|
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
|
|
199
227
|
state.json.last_updated = now()
|
|
200
228
|
Write .workflow/state.json
|
|
201
229
|
|
|
@@ -466,7 +494,7 @@ If config.json.workflow.reflection == true:
|
|
|
466
494
|
- Any blocked tasks?
|
|
467
495
|
- Patterns observed?
|
|
468
496
|
|
|
469
|
-
Append to ${
|
|
497
|
+
Append to ${PLAN_DIR}/reflection-log.md:
|
|
470
498
|
## Reflection - Wave Execution {timestamp}
|
|
471
499
|
- Strategy adjustments: [...]
|
|
472
500
|
- Patterns noted: [...]
|
|
@@ -506,12 +534,50 @@ If NOT SCRATCH_MODE:
|
|
|
506
534
|
|
|
507
535
|
---
|
|
508
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
|
+
|
|
509
575
|
## Error Handling
|
|
510
576
|
|
|
511
577
|
| Error | Action |
|
|
512
578
|
|-------|--------|
|
|
513
|
-
|
|
|
514
|
-
|
|
|
579
|
+
| No pending plans found | Abort: "No pending plans. Run /workflow:plan first." |
|
|
580
|
+
| Plan directory not found | Abort: "Plan dir not found." |
|
|
515
581
|
| Task file missing | Skip task, log error, continue wave |
|
|
516
582
|
| Agent spawn fails | Retry once, then mark task as "blocked" |
|
|
517
583
|
| Delegate fails | Resume with `--resume ${fixedId}`, then fallback to agent |
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
# Workflow: fork
|
|
2
|
+
|
|
3
|
+
Create a git worktree for an entire milestone, enabling inter-milestone parallel development. Copies `.workflow/` context into the worktree since `.workflow/` is gitignored.
|
|
4
|
+
|
|
5
|
+
Worktrees operate at the **milestone level** — all phases within a milestone are owned by one worktree and executed sequentially inside it. Per-phase parallelism within a milestone is not supported.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Step 1: Parse Arguments and Flags
|
|
10
|
+
|
|
11
|
+
```javascript
|
|
12
|
+
const getUtc8ISOString = () => new Date(Date.now() + 8 * 60 * 60 * 1000).toISOString()
|
|
13
|
+
|
|
14
|
+
// Parse flags
|
|
15
|
+
const syncMode = $ARGUMENTS.includes('--sync')
|
|
16
|
+
const baseMatch = $ARGUMENTS.match(/--base\s+(\S+)/)
|
|
17
|
+
const baseBranch = baseMatch ? baseMatch[1] : 'HEAD'
|
|
18
|
+
|
|
19
|
+
// Parse milestone number: -m <N> or bare <N>
|
|
20
|
+
const mFlagMatch = $ARGUMENTS.match(/-m\s+(\d+)/)
|
|
21
|
+
const cleaned = $ARGUMENTS
|
|
22
|
+
.replace(/--sync|--base\s+\S+|-m\s+\d+/g, '')
|
|
23
|
+
.trim()
|
|
24
|
+
const bareNumMatch = cleaned.match(/^(\d+)$/)
|
|
25
|
+
const milestoneNum = mFlagMatch
|
|
26
|
+
? parseInt(mFlagMatch[1])
|
|
27
|
+
: bareNumMatch
|
|
28
|
+
? parseInt(bareNumMatch[1])
|
|
29
|
+
: null
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Step 2: Validate Prerequisites
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
IF NOT file_exists(".workflow/state.json"):
|
|
38
|
+
ERROR E001: "Project not initialized. Run maestro-init first."
|
|
39
|
+
EXIT
|
|
40
|
+
|
|
41
|
+
IF NOT file_exists(".workflow/roadmap.md"):
|
|
42
|
+
ERROR E002: "No roadmap found. Run maestro-roadmap first."
|
|
43
|
+
EXIT
|
|
44
|
+
|
|
45
|
+
IF file_exists(".workflow/worktree-scope.json"):
|
|
46
|
+
ERROR E003: "Cannot fork from inside a worktree. Run from the main worktree."
|
|
47
|
+
EXIT
|
|
48
|
+
|
|
49
|
+
IF milestoneNum === null:
|
|
50
|
+
ERROR E004: "Milestone number required. Usage: maestro-fork -m <number>"
|
|
51
|
+
EXIT
|
|
52
|
+
|
|
53
|
+
Read .workflow/state.json → projectState
|
|
54
|
+
Read .workflow/config.json → config (if exists, else use defaults)
|
|
55
|
+
|
|
56
|
+
worktreeRoot = config.worktree?.root ?? ".worktrees"
|
|
57
|
+
branchPrefix = config.worktree?.branch_prefix ?? "milestone/"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Step 3: Resolve Milestone
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
// Lookup milestone by number from state.json.milestones[]
|
|
66
|
+
IF NOT projectState.milestones || NOT Array.isArray(projectState.milestones):
|
|
67
|
+
ERROR E005: "No milestones defined in state.json."
|
|
68
|
+
EXIT
|
|
69
|
+
|
|
70
|
+
// milestones[] is 0-indexed, milestoneNum is 1-based
|
|
71
|
+
milestoneEntry = projectState.milestones[milestoneNum - 1]
|
|
72
|
+
|
|
73
|
+
IF NOT milestoneEntry:
|
|
74
|
+
availableList = projectState.milestones
|
|
75
|
+
.map((m, i) => " M" + (i + 1) + ": " + m.name + " (" + m.title + ")")
|
|
76
|
+
.join("\n")
|
|
77
|
+
ERROR E006: "Milestone {milestoneNum} not found.\nAvailable:\n{availableList}"
|
|
78
|
+
EXIT
|
|
79
|
+
|
|
80
|
+
milestoneName = milestoneEntry.name // e.g. "Production"
|
|
81
|
+
milestoneTitle = milestoneEntry.title // e.g. "生产就绪"
|
|
82
|
+
milestonePhases = milestoneEntry.phases // e.g. [3, 4]
|
|
83
|
+
milestoneSlug = milestoneName.toLowerCase().replace(/[^a-z0-9]+/g, '-').substring(0, 40)
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Step 4: Sync Mode (--sync)
|
|
89
|
+
|
|
90
|
+
If `syncMode` is true, this is a sync operation on an existing worktree, not a fork.
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
IF syncMode:
|
|
94
|
+
Read .workflow/worktrees.json → registry
|
|
95
|
+
entry = registry.worktrees.find(w =>
|
|
96
|
+
w.milestone_num === milestoneNum && w.status === "active"
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
IF NOT entry:
|
|
100
|
+
ERROR E007: "No active worktree for milestone {milestoneNum} ({milestoneName})"
|
|
101
|
+
EXIT
|
|
102
|
+
|
|
103
|
+
// Step 4a: Pull source code
|
|
104
|
+
Bash("cd {entry.path} && git merge main")
|
|
105
|
+
IF conflict:
|
|
106
|
+
WARN "Merge conflict in worktree. Resolve in {entry.path} before continuing."
|
|
107
|
+
EXIT
|
|
108
|
+
|
|
109
|
+
// Step 4b: Re-copy shared context
|
|
110
|
+
Copy .workflow/project.md → {entry.path}/.workflow/project.md
|
|
111
|
+
Copy .workflow/roadmap.md → {entry.path}/.workflow/roadmap.md
|
|
112
|
+
Copy .workflow/config.json → {entry.path}/.workflow/config.json (if exists)
|
|
113
|
+
Copy .workflow/specs/ → {entry.path}/.workflow/specs/ (if exists)
|
|
114
|
+
|
|
115
|
+
Display "Worktree for M{milestoneNum} ({milestoneName}) synced with main."
|
|
116
|
+
EXIT (sync complete)
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Step 5: Validate & Confirm
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
// Load phase index files for all milestone phases
|
|
125
|
+
phaseList = []
|
|
126
|
+
for (phaseNum of milestonePhases):
|
|
127
|
+
Glob: .workflow/phases/{NN}-*/index.json where NN matches phaseNum
|
|
128
|
+
Read index.json → phaseIndex
|
|
129
|
+
phaseList.push(phaseIndex)
|
|
130
|
+
|
|
131
|
+
// Validate: milestone should have at least one non-completed phase
|
|
132
|
+
nonCompleted = phaseList.filter(p => p.status !== "completed")
|
|
133
|
+
IF nonCompleted.length === 0:
|
|
134
|
+
Display "All phases in M{milestoneNum} ({milestoneName}) are already completed. Nothing to fork."
|
|
135
|
+
EXIT
|
|
136
|
+
|
|
137
|
+
// Check for already-forked milestone
|
|
138
|
+
IF file_exists(".workflow/worktrees.json"):
|
|
139
|
+
Read .workflow/worktrees.json → existingRegistry
|
|
140
|
+
alreadyForked = existingRegistry.worktrees.find(w =>
|
|
141
|
+
w.milestone_num === milestoneNum && w.status === "active"
|
|
142
|
+
)
|
|
143
|
+
IF alreadyForked:
|
|
144
|
+
ERROR E008: "M{milestoneNum} already has an active worktree at {alreadyForked.path}. Merge or cleanup first."
|
|
145
|
+
EXIT
|
|
146
|
+
|
|
147
|
+
Display "Fork Milestone {milestoneNum}: {milestoneName} ({milestoneTitle})"
|
|
148
|
+
Display "Phases ({phaseList.length}):"
|
|
149
|
+
for (p of phaseList):
|
|
150
|
+
Display " Phase {p.phase}: {p.title} [{p.status}]"
|
|
151
|
+
|
|
152
|
+
AskUserQuestion: "Create worktree for this milestone? (y/n)"
|
|
153
|
+
IF response !== 'y': EXIT
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Step 6: Create Worktree
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
const forkSessionId = "fork-" + getUtc8ISOString().substring(0, 19).replace(/[-:T]/g, '')
|
|
162
|
+
const baseCommit = Bash("git rev-parse HEAD").trim()
|
|
163
|
+
const branch = branchPrefix + milestoneSlug
|
|
164
|
+
const wtPath = worktreeRoot + "/m" + milestoneNum + "-" + milestoneSlug
|
|
165
|
+
|
|
166
|
+
// 6a: Clean up stale worktree/branch if exists
|
|
167
|
+
IF directory_exists(wtPath):
|
|
168
|
+
Bash("git worktree remove --force {wtPath}") // ignore errors
|
|
169
|
+
Bash("git branch -D {branch}") // ignore errors (may not exist)
|
|
170
|
+
|
|
171
|
+
// 6b: Create worktree
|
|
172
|
+
Bash("git worktree add -b {branch} {wtPath} {baseBranch}")
|
|
173
|
+
|
|
174
|
+
// 6c: Create .workflow/ structure in worktree
|
|
175
|
+
Bash("mkdir -p {wtPath}/.workflow/phases")
|
|
176
|
+
|
|
177
|
+
// 6d: Copy shared context (read-only)
|
|
178
|
+
Copy .workflow/project.md → {wtPath}/.workflow/project.md
|
|
179
|
+
Copy .workflow/roadmap.md → {wtPath}/.workflow/roadmap.md
|
|
180
|
+
IF file_exists(".workflow/config.json"):
|
|
181
|
+
Copy .workflow/config.json → {wtPath}/.workflow/config.json
|
|
182
|
+
IF directory_exists(".workflow/specs"):
|
|
183
|
+
Copy .workflow/specs/ → {wtPath}/.workflow/specs/
|
|
184
|
+
|
|
185
|
+
// 6e: Copy ALL phase directories for this milestone
|
|
186
|
+
ownedPhaseNumbers = []
|
|
187
|
+
for (p of phaseList):
|
|
188
|
+
NN = String(p.phase).padStart(2, '0')
|
|
189
|
+
Copy .workflow/phases/{NN}-{p.slug}/ → {wtPath}/.workflow/phases/{NN}-{p.slug}/
|
|
190
|
+
ownedPhaseNumbers.push(p.phase)
|
|
191
|
+
|
|
192
|
+
// 6f: Copy completed dependency phase dirs outside this milestone (read-only reference)
|
|
193
|
+
allDeps = new Set()
|
|
194
|
+
for (p of phaseList):
|
|
195
|
+
for (dep of p.depends_on):
|
|
196
|
+
IF NOT ownedPhaseNumbers.includes(dep):
|
|
197
|
+
allDeps.add(dep)
|
|
198
|
+
|
|
199
|
+
for (dep of allDeps):
|
|
200
|
+
depNN = String(dep).padStart(2, '0')
|
|
201
|
+
Glob: .workflow/phases/{depNN}-*/index.json
|
|
202
|
+
Read → depIndex
|
|
203
|
+
Copy .workflow/phases/{depNN}-{depIndex.slug}/ → {wtPath}/.workflow/phases/{depNN}-{depIndex.slug}/
|
|
204
|
+
|
|
205
|
+
// 6g: Write worktree-scope.json
|
|
206
|
+
Write {wtPath}/.workflow/worktree-scope.json:
|
|
207
|
+
{
|
|
208
|
+
"worktree": true,
|
|
209
|
+
"milestone_num": milestoneNum,
|
|
210
|
+
"milestone": milestoneName,
|
|
211
|
+
"owned_phases": ownedPhaseNumbers,
|
|
212
|
+
"main_worktree": resolve(cwd),
|
|
213
|
+
"branch": branch,
|
|
214
|
+
"base_commit": baseCommit,
|
|
215
|
+
"created_at": getUtc8ISOString()
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// 6h: Write scoped state.json
|
|
219
|
+
Read .workflow/state.json → mainState
|
|
220
|
+
firstPending = phaseList.find(p => p.status !== "completed")
|
|
221
|
+
scopedState = {
|
|
222
|
+
...mainState,
|
|
223
|
+
current_phase: firstPending?.phase ?? phaseList[0].phase,
|
|
224
|
+
current_milestone: milestoneName
|
|
225
|
+
}
|
|
226
|
+
Write {wtPath}/.workflow/state.json: scopedState
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## Step 7: Update Main Registry
|
|
232
|
+
|
|
233
|
+
```
|
|
234
|
+
IF file_exists(".workflow/worktrees.json"):
|
|
235
|
+
Read .workflow/worktrees.json → registry
|
|
236
|
+
ELSE:
|
|
237
|
+
registry = { version: "1.0", worktrees: [], fork_sessions: [] }
|
|
238
|
+
|
|
239
|
+
registry.worktrees.push({
|
|
240
|
+
milestone_num: milestoneNum,
|
|
241
|
+
milestone: milestoneName,
|
|
242
|
+
slug: milestoneSlug,
|
|
243
|
+
branch: branch,
|
|
244
|
+
path: wtPath,
|
|
245
|
+
base_commit: baseCommit,
|
|
246
|
+
status: "active",
|
|
247
|
+
created_at: getUtc8ISOString(),
|
|
248
|
+
owned_phases: ownedPhaseNumbers,
|
|
249
|
+
fork_session: forkSessionId
|
|
250
|
+
})
|
|
251
|
+
|
|
252
|
+
registry.fork_sessions.push({
|
|
253
|
+
session_id: forkSessionId,
|
|
254
|
+
created_at: getUtc8ISOString(),
|
|
255
|
+
milestone_num: milestoneNum,
|
|
256
|
+
milestone: milestoneName,
|
|
257
|
+
base_branch: baseBranch,
|
|
258
|
+
base_commit: baseCommit
|
|
259
|
+
})
|
|
260
|
+
|
|
261
|
+
Write .workflow/worktrees.json: registry
|
|
262
|
+
|
|
263
|
+
// Mark milestone phases as "forked" in main
|
|
264
|
+
for (p of phaseList):
|
|
265
|
+
IF p.status !== "completed":
|
|
266
|
+
NN = String(p.phase).padStart(2, '0')
|
|
267
|
+
Read .workflow/phases/{NN}-{p.slug}/index.json → idx
|
|
268
|
+
idx.status = "forked"
|
|
269
|
+
idx.updated_at = getUtc8ISOString()
|
|
270
|
+
Write .workflow/phases/{NN}-{p.slug}/index.json: idx
|
|
271
|
+
|
|
272
|
+
mainState.last_updated = getUtc8ISOString()
|
|
273
|
+
Write .workflow/state.json: mainState
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## Step 8: Display Summary
|
|
279
|
+
|
|
280
|
+
```
|
|
281
|
+
Display:
|
|
282
|
+
=== FORK COMPLETE ===
|
|
283
|
+
Session: {forkSessionId}
|
|
284
|
+
Base: {baseBranch} ({baseCommit.substring(0, 7)})
|
|
285
|
+
Milestone: M{milestoneNum} — {milestoneName} ({milestoneTitle})
|
|
286
|
+
Branch: {branch}
|
|
287
|
+
Path: {wtPath}
|
|
288
|
+
Phases: {ownedPhaseNumbers.join(', ')}
|
|
289
|
+
|
|
290
|
+
Next steps (run in the worktree):
|
|
291
|
+
cd {wtPath}
|
|
292
|
+
|
|
293
|
+
# Sequential lifecycle for each phase:
|
|
294
|
+
/maestro-analyze {firstPending.phase}
|
|
295
|
+
/maestro-plan {firstPending.phase}
|
|
296
|
+
/maestro-execute {firstPending.phase}
|
|
297
|
+
/maestro-verify {firstPending.phase}
|
|
298
|
+
/maestro-phase-transition {firstPending.phase}
|
|
299
|
+
# ... repeat for next phases in milestone
|
|
300
|
+
|
|
301
|
+
Or delegate (automated):
|
|
302
|
+
maestro delegate "run full lifecycle for milestone" --cd {wtPath} --mode write
|
|
303
|
+
|
|
304
|
+
Sync worktree with main (if needed later):
|
|
305
|
+
/maestro-fork -m {milestoneNum} --sync
|
|
306
|
+
|
|
307
|
+
When all phases in milestone complete:
|
|
308
|
+
/maestro-merge -m {milestoneNum}
|
|
309
|
+
```
|
package/workflows/init.md
CHANGED
|
@@ -4,6 +4,15 @@ Project initialization with automatic state detection. Creates project infrastru
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
## Worktree Guard
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
# Block in worktree
|
|
11
|
+
IF file_exists(".workflow/worktree-scope.json"):
|
|
12
|
+
ERROR "Cannot run maestro-init inside a worktree. Run from the main worktree."
|
|
13
|
+
EXIT
|
|
14
|
+
```
|
|
15
|
+
|
|
7
16
|
## Step 1: State Detection
|
|
8
17
|
|
|
9
18
|
Detect current project state to determine initialization path.
|
|
@@ -41,7 +50,7 @@ CHECK .workflow/state.json exists?
|
|
|
41
50
|
|
|
42
51
|
If `--auto` flag: skip interactive questioning, extract from @ referenced document.
|
|
43
52
|
If `--from-brainstorm SESSION-ID`:
|
|
44
|
-
- Locate brainstorm session directory (`.workflow/scratch/brainstorm-*/`
|
|
53
|
+
- Locate brainstorm session directory (`.workflow/scratch/brainstorm-*/`)
|
|
45
54
|
- Read `guidance-specification.md`:
|
|
46
55
|
- Problem statement → project vision + core value
|
|
47
56
|
- Features → project goals (Active requirements)
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Workflow: Issue Analysis
|
|
2
2
|
|
|
3
|
+
> **DEPRECATED**: This workflow was used by the deleted `manage-issue-analyze` command.
|
|
4
|
+
> Use `maestro-analyze --gaps [ISS-ID]` instead, which integrates issue root cause analysis
|
|
5
|
+
> into the unified analyze pipeline. See `~/.maestro/workflows/issue-gaps-analyze.md`.
|
|
6
|
+
|
|
3
7
|
Root cause analysis for a specific issue using CLI exploration and codebase context gathering.
|
|
4
8
|
|
|
5
9
|
## Input
|
|
@@ -87,7 +91,7 @@ Root cause analysis for a specific issue using CLI exploration and codebase cont
|
|
|
87
91
|
```
|
|
88
92
|
1. Build analysis prompt:
|
|
89
93
|
|
|
90
|
-
maestro
|
|
94
|
+
maestro delegate "PURPOSE: Root cause analysis for issue {ISS-ID}: {ISSUE.title}
|
|
91
95
|
Identify the root cause, assess impact, and suggest an approach.
|
|
92
96
|
|
|
93
97
|
ISSUE DETAILS:
|
|
@@ -116,7 +120,7 @@ Root cause analysis for a specific issue using CLI exploration and codebase cont
|
|
|
116
120
|
confidence: 'high'|'medium'|'low',
|
|
117
121
|
suggested_approach: string (actionable fix direction)
|
|
118
122
|
CONSTRAINTS: Only cite evidence found in codebase, no speculation
|
|
119
|
-
" --
|
|
123
|
+
" --to {TOOL} --mode analysis
|
|
120
124
|
|
|
121
125
|
2. Parse CLI output:
|
|
122
126
|
- Extract JSON object from response
|
|
@@ -115,7 +115,7 @@ Batch 2: scalability, ux, accessibility, compliance
|
|
|
115
115
|
|
|
116
116
|
For each perspective, launch a CLI analysis:
|
|
117
117
|
|
|
118
|
-
maestro
|
|
118
|
+
maestro delegate "PURPOSE: Discover {PERSPECTIVE} issues in the codebase.
|
|
119
119
|
Focus: {FOCUS_AREA}
|
|
120
120
|
Guiding question: {QUESTION}
|
|
121
121
|
|
|
@@ -130,7 +130,7 @@ For each perspective, launch a CLI analysis:
|
|
|
130
130
|
EXPECTED: JSON array of findings, each with:
|
|
131
131
|
title, severity, description, location (file:line), fix_direction, affected_components[]
|
|
132
132
|
CONSTRAINTS: Only report real issues with evidence, no speculative findings
|
|
133
|
-
" --
|
|
133
|
+
" --to gemini --mode analysis
|
|
134
134
|
|
|
135
135
|
Store results per perspective in:
|
|
136
136
|
.workflow/issues/discoveries/{SESSION_ID}/{PERSPECTIVE}-findings.json
|
|
@@ -262,7 +262,7 @@ For each unique finding:
|
|
|
262
262
|
```
|
|
263
263
|
Use Gemini CLI to decompose the user prompt into exploration dimensions:
|
|
264
264
|
|
|
265
|
-
maestro
|
|
265
|
+
maestro delegate "PURPOSE: Decompose this issue discovery prompt into 3-5 specific exploration dimensions.
|
|
266
266
|
|
|
267
267
|
User wants to find: {USER_PROMPT}
|
|
268
268
|
|
|
@@ -280,7 +280,7 @@ Use Gemini CLI to decompose the user prompt into exploration dimensions:
|
|
|
280
280
|
file_patterns: string[],
|
|
281
281
|
finding_criteria: string
|
|
282
282
|
}]
|
|
283
|
-
" --
|
|
283
|
+
" --to gemini --mode analysis
|
|
284
284
|
|
|
285
285
|
Store dimensions in:
|
|
286
286
|
.workflow/issues/discoveries/{SESSION_ID}/exploration-plan.json
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# Workflow: Issue Execution
|
|
2
2
|
|
|
3
|
+
> **DEPRECATED**: This workflow was used by the deleted `manage-issue-execute` command.
|
|
4
|
+
> Use `maestro-execute` instead, which handles wave-based execution with automatic issue status sync.
|
|
5
|
+
|
|
3
6
|
Execute a planned solution for an issue via dual-mode agent dispatch (server or direct CLI).
|
|
4
7
|
|
|
5
8
|
## Input
|
|
@@ -182,8 +185,8 @@ If SERVER_UP == false (or server dispatch failed):
|
|
|
182
185
|
}
|
|
183
186
|
- Rewrite file
|
|
184
187
|
|
|
185
|
-
3. Execute via
|
|
186
|
-
maestro
|
|
188
|
+
3. Execute via delegate:
|
|
189
|
+
maestro delegate "{EXEC_PROMPT}" --to {CLI_TOOL} --mode write
|
|
187
190
|
|
|
188
191
|
4. Evaluate result:
|
|
189
192
|
- If CLI exits successfully → EXEC_SUCCESS = true
|
|
@@ -274,7 +277,7 @@ If execution failed:
|
|
|
274
277
|
## Output
|
|
275
278
|
|
|
276
279
|
- **Updated**: `.workflow/issues/issues.jsonl` -- issue status transitions (open -> in_progress -> resolved/open)
|
|
277
|
-
- **Execution modes**: Server dispatch (POST /api/execution/dispatch) or Direct
|
|
280
|
+
- **Execution modes**: Server dispatch (POST /api/execution/dispatch) or Direct delegate (maestro delegate --mode write)
|
|
278
281
|
|
|
279
282
|
## Quality Criteria
|
|
280
283
|
|
package/workflows/issue-plan.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# Workflow: Issue Planning
|
|
2
2
|
|
|
3
|
+
> **DEPRECATED**: This workflow was used by the deleted `manage-issue-plan` command.
|
|
4
|
+
> Use `maestro-plan --gaps` instead, which generates TASK files linked to issues via `task_refs`.
|
|
5
|
+
|
|
3
6
|
Solution planning for a specific issue with codebase-aware step generation and prompt template construction.
|
|
4
7
|
|
|
5
8
|
## Input
|
|
@@ -91,7 +94,7 @@ Solution planning for a specific issue with codebase-aware step generation and p
|
|
|
91
94
|
```
|
|
92
95
|
1. Build planning prompt:
|
|
93
96
|
|
|
94
|
-
maestro
|
|
97
|
+
maestro delegate "PURPOSE: Generate a step-by-step solution plan for issue {ISS-ID}: {ISSUE.title}
|
|
95
98
|
Produce an actionable, ordered list of implementation steps.
|
|
96
99
|
|
|
97
100
|
ISSUE DETAILS:
|
|
@@ -116,7 +119,7 @@ Solution planning for a specific issue with codebase-aware step generation and p
|
|
|
116
119
|
context: string (approach summary),
|
|
117
120
|
promptTemplate: string (execution prompt for the agent)
|
|
118
121
|
CONSTRAINTS: Steps must be concrete and file-specific, not vague
|
|
119
|
-
" --
|
|
122
|
+
" --to {TOOL} --mode analysis
|
|
120
123
|
|
|
121
124
|
2. Parse CLI output:
|
|
122
125
|
- Extract JSON object from response
|