maestro-flow 0.3.19 → 0.3.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/.claude/commands/learn-investigate.md +195 -195
  2. package/.claude/commands/learn-retro.md +303 -303
  3. package/.claude/commands/learn-second-opinion.md +167 -167
  4. package/.claude/commands/maestro-amend.md +300 -300
  5. package/.claude/commands/maestro-analyze.md +126 -126
  6. package/.claude/commands/maestro-composer.md +354 -354
  7. package/.claude/commands/maestro-execute.md +114 -114
  8. package/.claude/commands/maestro-learn.md +140 -140
  9. package/.claude/commands/maestro-milestone-audit.md +68 -68
  10. package/.claude/commands/maestro-milestone-complete.md +75 -75
  11. package/.claude/commands/maestro-milestone-release.md +96 -96
  12. package/.claude/commands/maestro-plan.md +138 -138
  13. package/.claude/commands/maestro-player.md +404 -404
  14. package/.claude/commands/maestro-update.md +176 -176
  15. package/.claude/commands/maestro-verify.md +90 -90
  16. package/.claude/commands/manage-codebase-rebuild.md +75 -75
  17. package/.claude/commands/manage-knowhow-capture.md +193 -193
  18. package/.claude/commands/manage-knowhow.md +77 -77
  19. package/.claude/commands/manage-learn.md +67 -67
  20. package/.claude/commands/manage-wiki.md +62 -62
  21. package/.claude/commands/quality-business-test.md +110 -110
  22. package/.claude/commands/quality-retrospective.md +78 -78
  23. package/.claude/commands/spec-add.md +49 -49
  24. package/.claude/commands/spec-load.md +51 -51
  25. package/.claude/commands/spec-remove.md +51 -51
  26. package/.claude/commands/wiki-connect.md +62 -62
  27. package/.claude/commands/wiki-digest.md +69 -69
  28. package/.codex/skills/maestro-link-coordinate/SKILL.md +5 -5
  29. package/.codex/skills/maestro-player/SKILL.md +5 -5
  30. package/dashboard/dist-server/dashboard/src/server/coordinator/workflow-coordinator.js +3 -3
  31. package/dashboard/dist-server/dashboard/src/server/coordinator/workflow-coordinator.js.map +1 -1
  32. package/dashboard/dist-server/dashboard/src/server/execution/execution-scheduler.js +1 -1
  33. package/dashboard/dist-server/dashboard/src/server/execution/execution-scheduler.js.map +1 -1
  34. package/dist/src/commands/coordinate.js +2 -2
  35. package/dist/src/commands/coordinate.js.map +1 -1
  36. package/dist/src/hooks/coordinator-tracker.d.ts +1 -1
  37. package/dist/src/hooks/coordinator-tracker.js +3 -3
  38. package/dist/src/hooks/coordinator-tracker.js.map +1 -1
  39. package/package.json +1 -1
  40. package/workflows/maestro-link-coordinate.md +3 -3
  41. package/workflows/maestro.codex.md +2 -2
  42. package/workflows/maestro-coordinate.codex.md +0 -281
@@ -1,75 +1,75 @@
1
- ---
2
- name: maestro-milestone-complete
3
- description: Archive completed milestone and prepare for next
4
- argument-hint: "[<milestone>]"
5
- allowed-tools:
6
- - Read
7
- - Write
8
- - Bash
9
- - Glob
10
- - Grep
11
- - Agent
12
- - AskUserQuestion
13
- ---
14
-
15
- <purpose>
16
- Mark a milestone as complete after its audit has passed. Archives all scratch artifacts to `milestones/{M}/artifacts/`, moves artifact entries from `state.json.artifacts[]` to `milestone_history`, extracts final learnings, and advances to the next milestone.
17
- </purpose>
18
-
19
- <required_reading>
20
- @~/.maestro/workflows/milestone-complete.md
21
- </required_reading>
22
-
23
- <context>
24
- Milestone: $ARGUMENTS (optional -- defaults to current_milestone from state.json).
25
-
26
- **Requires:** `/maestro-milestone-audit` should have passed.
27
-
28
- **State files:**
29
- - `.workflow/state.json` — artifacts[], milestones[], current_milestone, milestone_history[]
30
- - `.workflow/roadmap.md` — milestone structure
31
- - `.workflow/milestones/{milestone}/audit-report.md` — audit results
32
- </context>
33
-
34
- <execution>
35
- Follow '~/.maestro/workflows/milestone-complete.md' completely.
36
-
37
- Archive flow steps (validation, directory archival, artifact history, learning extraction, state advancement, cleanup) are defined in workflow `milestone-complete.md`.
38
-
39
- ### Knowledge Promotion Inquiry
40
-
41
- After learning extraction (step 4), scan `learnings.md` for promotion candidates:
42
-
43
- 1. **High-frequency pattern detection**: Scan all `<spec-entry category="learning">` entries for keyword overlap (≥2 entries sharing keywords):
44
- → Ask: "Keyword '{keyword}' appears in {N} learning entries. Should this be promoted to a formal coding convention? (`/spec-add coding`)"
45
-
46
- 2. **Convention drift detection**: Compare executed task summaries against `coding-conventions.md` and `architecture-constraints.md`:
47
- → Ask: "Were any established conventions bypassed during this milestone? Should conventions be updated?"
48
-
49
- 3. **Wiki island check**: Auto-trigger `wiki-connect --fix` to link newly extracted knowledge.
50
-
51
- If user confirms promotion, invoke `Skill({ skill: "spec-add", args: "<category> <content>" })` with promoted content, preserving original date and source traceability.
52
-
53
- **Next-step routing on completion:**
54
- - Cut a release → `/maestro-milestone-release`
55
- - Next milestone → `/maestro-analyze` or `/maestro-plan 1`
56
- - View state → `/manage-status`
57
- </execution>
58
-
59
- <error_codes>
60
- | Code | Severity | Condition | Recovery |
61
- |------|----------|-----------|----------|
62
- | E001 | error | Milestone identifier required | Check arguments |
63
- | E002 | error | Audit not passed | Run maestro-milestone-audit first |
64
- | E003 | error | Incomplete artifacts remain | Complete remaining work first |
65
- </error_codes>
66
-
67
- <success_criteria>
68
- - [ ] Audit report verified as PASS
69
- - [ ] Scratch artifacts moved to milestones/{M}/artifacts/
70
- - [ ] Artifact entries archived to milestone_history
71
- - [ ] Learnings extracted to specs/learnings.md
72
- - [ ] state.json updated: next milestone as current, artifacts[] cleared
73
- - [ ] Roadmap snapshot saved
74
- - [ ] project.md Context updated with milestone summary
75
- </success_criteria>
1
+ ---
2
+ name: maestro-milestone-complete
3
+ description: Archive completed milestone and prepare for next
4
+ argument-hint: "[<milestone>]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Bash
9
+ - Glob
10
+ - Grep
11
+ - Agent
12
+ - AskUserQuestion
13
+ ---
14
+
15
+ <purpose>
16
+ Mark a milestone as complete after its audit has passed. Archives all scratch artifacts to `milestones/{M}/artifacts/`, moves artifact entries from `state.json.artifacts[]` to `milestone_history`, extracts final learnings, and advances to the next milestone.
17
+ </purpose>
18
+
19
+ <required_reading>
20
+ @~/.maestro/workflows/milestone-complete.md
21
+ </required_reading>
22
+
23
+ <context>
24
+ Milestone: $ARGUMENTS (optional -- defaults to current_milestone from state.json).
25
+
26
+ **Requires:** `/maestro-milestone-audit` should have passed.
27
+
28
+ **State files:**
29
+ - `.workflow/state.json` — artifacts[], milestones[], current_milestone, milestone_history[]
30
+ - `.workflow/roadmap.md` — milestone structure
31
+ - `.workflow/milestones/{milestone}/audit-report.md` — audit results
32
+ </context>
33
+
34
+ <execution>
35
+ Follow '~/.maestro/workflows/milestone-complete.md' completely.
36
+
37
+ Archive flow steps (validation, directory archival, artifact history, learning extraction, state advancement, cleanup) are defined in workflow `milestone-complete.md`.
38
+
39
+ ### Knowledge Promotion Inquiry
40
+
41
+ After learning extraction (step 4), scan `learnings.md` for promotion candidates:
42
+
43
+ 1. **High-frequency pattern detection**: Scan all `<spec-entry category="learning">` entries for keyword overlap (≥2 entries sharing keywords):
44
+ → Ask: "Keyword '{keyword}' appears in {N} learning entries. Should this be promoted to a formal coding convention? (`/spec-add coding`)"
45
+
46
+ 2. **Convention drift detection**: Compare executed task summaries against `coding-conventions.md` and `architecture-constraints.md`:
47
+ → Ask: "Were any established conventions bypassed during this milestone? Should conventions be updated?"
48
+
49
+ 3. **Wiki island check**: Auto-trigger `wiki-connect --fix` to link newly extracted knowledge.
50
+
51
+ If user confirms promotion, invoke `Skill({ skill: "spec-add", args: "<category> <content>" })` with promoted content, preserving original date and source traceability.
52
+
53
+ **Next-step routing on completion:**
54
+ - Cut a release → `/maestro-milestone-release`
55
+ - Next milestone → `/maestro-analyze` or `/maestro-plan 1`
56
+ - View state → `/manage-status`
57
+ </execution>
58
+
59
+ <error_codes>
60
+ | Code | Severity | Condition | Recovery |
61
+ |------|----------|-----------|----------|
62
+ | E001 | error | Milestone identifier required | Check arguments |
63
+ | E002 | error | Audit not passed | Run maestro-milestone-audit first |
64
+ | E003 | error | Incomplete artifacts remain | Complete remaining work first |
65
+ </error_codes>
66
+
67
+ <success_criteria>
68
+ - [ ] Audit report verified as PASS
69
+ - [ ] Scratch artifacts moved to milestones/{M}/artifacts/
70
+ - [ ] Artifact entries archived to milestone_history
71
+ - [ ] Learnings extracted to specs/learnings.md
72
+ - [ ] state.json updated: next milestone as current, artifacts[] cleared
73
+ - [ ] Roadmap snapshot saved
74
+ - [ ] project.md Context updated with milestone summary
75
+ </success_criteria>
@@ -1,96 +1,96 @@
1
- ---
2
- name: maestro-milestone-release
3
- description: Version bump, changelog generation, and git tag for a completed milestone
4
- argument-hint: "[<version>] [--bump patch|minor|major] [--dry-run] [--no-tag] [--no-push]"
5
- allowed-tools:
6
- - Read
7
- - Write
8
- - Edit
9
- - Bash
10
- - Glob
11
- - Grep
12
- - Agent
13
- - AskUserQuestion
14
- ---
15
-
16
- <purpose>
17
- Package a completed milestone into a releasable version. Bumps the project version (e.g. `package.json`, `pyproject.toml`, or language-specific manifest), generates or appends a changelog entry from phase/milestone summaries and git log, creates an annotated git tag, and optionally pushes to the remote. Runs after `/maestro-milestone-complete` has archived the milestone; serves as the final delivery step in the SDLC loop.
18
- </purpose>
19
-
20
- <required_reading>
21
- @~/.maestro/workflows/milestone-release.md
22
- </required_reading>
23
-
24
- <context>
25
- $ARGUMENTS -- optional explicit version string and flags.
26
-
27
- **Flags:**
28
- - `<version>` -- explicit version (e.g. `1.2.0`). If omitted, version is derived from `--bump` or prompted.
29
- - `--bump patch|minor|major` -- semver bump relative to the current version (default: `minor`)
30
- - `--dry-run` -- compute the next version, changelog diff, and tag name without writing files or creating tags
31
- - `--no-tag` -- skip git tag creation (version bump + changelog only)
32
- - `--no-push` -- skip `git push --follow-tags` after tagging
33
-
34
- **State files:**
35
- - `.workflow/state.json` -- current_milestone, previous release version
36
- - `.workflow/milestones/{milestone}/summary.md` -- milestone summary (from `maestro-milestone-complete`)
37
- - `.workflow/milestones/{milestone}/audit-report.md` -- audit verdict (must be PASS)
38
- - `CHANGELOG.md` -- release notes file (created if missing)
39
- - Version manifest -- `package.json` / `pyproject.toml` / `Cargo.toml` / etc. (auto-detected)
40
-
41
- **Preconditions:**
42
- - Current milestone must be completed (audit PASS + `/maestro-milestone-complete` run)
43
- - Working tree must be clean (no uncommitted changes) unless `--dry-run`
44
- </context>
45
-
46
- <execution>
47
- Follow '~/.maestro/workflows/release.md' completely.
48
-
49
- **High-level flow:**
50
- 1. Validate preconditions (milestone completed, clean tree, audit PASS)
51
- 2. Resolve target version from `<version>` or `--bump` against current manifest
52
- 3. Collect changes since last release tag: milestone summary + phase summaries + git log between tags
53
- 4. Generate `CHANGELOG.md` entry (grouped by phase / change type)
54
- 5. Write version to manifest file(s) + commit with message `chore(release): v{version}`
55
- 6. Create annotated git tag `v{version}` with release notes body (unless `--no-tag`)
56
- 7. Push commit + tag to remote (unless `--no-push`)
57
-
58
- **Report format on completion:**
59
- ```
60
- === RELEASE COMPLETE ===
61
- Version: v{previous} → v{new}
62
- Milestone: {milestone_name}
63
- Tag: v{new} {pushed|local-only}
64
- Changelog: {N} entries written to CHANGELOG.md
65
- Manifest: {file_path} updated
66
-
67
- Next steps:
68
- /maestro-plan {next_phase} -- Start next milestone's first phase
69
- /manage-status -- View project dashboard
70
- ```
71
-
72
- For `--dry-run`, print the computed version, changelog diff, and tag name without side effects.
73
- </execution>
74
-
75
- <error_codes>
76
- | Code | Severity | Condition | Recovery |
77
- |------|----------|-----------|----------|
78
- | E001 | error | Current milestone not completed (no milestone-complete run) | Run `/maestro-milestone-complete` first |
79
- | E002 | error | Audit verdict not PASS | Re-run `/maestro-milestone-audit` and resolve findings |
80
- | E003 | error | Working tree not clean (uncommitted changes) | Commit or stash changes, then retry |
81
- | E004 | error | Version manifest not found / unsupported | Add supported manifest or pass `<version>` explicitly with `--no-tag` |
82
- | E005 | error | Target version not greater than current (would break semver monotonicity) | Choose a higher version or run with explicit `<version>` |
83
- | W001 | warning | No changes detected since last release tag | Confirm whether release is still desired |
84
- | W002 | warning | Remote push failed (network / auth) | Retry manually with `git push --follow-tags` |
85
- </error_codes>
86
-
87
- <success_criteria>
88
- - [ ] Preconditions validated (milestone complete, audit PASS, clean tree)
89
- - [ ] Target version computed and greater than previous
90
- - [ ] Version manifest(s) updated with new version
91
- - [ ] CHANGELOG.md contains new entry with milestone summary + grouped changes
92
- - [ ] Release commit created with conventional message
93
- - [ ] Annotated git tag created (unless `--no-tag`)
94
- - [ ] Commit + tag pushed to remote (unless `--no-push` or push failed → W002)
95
- - [ ] state.json updated with last_release_version + last_release_at timestamp
96
- </success_criteria>
1
+ ---
2
+ name: maestro-milestone-release
3
+ description: Version bump, changelog generation, and git tag for a completed milestone
4
+ argument-hint: "[<version>] [--bump patch|minor|major] [--dry-run] [--no-tag] [--no-push]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ - Agent
13
+ - AskUserQuestion
14
+ ---
15
+
16
+ <purpose>
17
+ Package a completed milestone into a releasable version. Bumps the project version (e.g. `package.json`, `pyproject.toml`, or language-specific manifest), generates or appends a changelog entry from phase/milestone summaries and git log, creates an annotated git tag, and optionally pushes to the remote. Runs after `/maestro-milestone-complete` has archived the milestone; serves as the final delivery step in the SDLC loop.
18
+ </purpose>
19
+
20
+ <required_reading>
21
+ @~/.maestro/workflows/milestone-release.md
22
+ </required_reading>
23
+
24
+ <context>
25
+ $ARGUMENTS -- optional explicit version string and flags.
26
+
27
+ **Flags:**
28
+ - `<version>` -- explicit version (e.g. `1.2.0`). If omitted, version is derived from `--bump` or prompted.
29
+ - `--bump patch|minor|major` -- semver bump relative to the current version (default: `minor`)
30
+ - `--dry-run` -- compute the next version, changelog diff, and tag name without writing files or creating tags
31
+ - `--no-tag` -- skip git tag creation (version bump + changelog only)
32
+ - `--no-push` -- skip `git push --follow-tags` after tagging
33
+
34
+ **State files:**
35
+ - `.workflow/state.json` -- current_milestone, previous release version
36
+ - `.workflow/milestones/{milestone}/summary.md` -- milestone summary (from `maestro-milestone-complete`)
37
+ - `.workflow/milestones/{milestone}/audit-report.md` -- audit verdict (must be PASS)
38
+ - `CHANGELOG.md` -- release notes file (created if missing)
39
+ - Version manifest -- `package.json` / `pyproject.toml` / `Cargo.toml` / etc. (auto-detected)
40
+
41
+ **Preconditions:**
42
+ - Current milestone must be completed (audit PASS + `/maestro-milestone-complete` run)
43
+ - Working tree must be clean (no uncommitted changes) unless `--dry-run`
44
+ </context>
45
+
46
+ <execution>
47
+ Follow '~/.maestro/workflows/release.md' completely.
48
+
49
+ **High-level flow:**
50
+ 1. Validate preconditions (milestone completed, clean tree, audit PASS)
51
+ 2. Resolve target version from `<version>` or `--bump` against current manifest
52
+ 3. Collect changes since last release tag: milestone summary + phase summaries + git log between tags
53
+ 4. Generate `CHANGELOG.md` entry (grouped by phase / change type)
54
+ 5. Write version to manifest file(s) + commit with message `chore(release): v{version}`
55
+ 6. Create annotated git tag `v{version}` with release notes body (unless `--no-tag`)
56
+ 7. Push commit + tag to remote (unless `--no-push`)
57
+
58
+ **Report format on completion:**
59
+ ```
60
+ === RELEASE COMPLETE ===
61
+ Version: v{previous} → v{new}
62
+ Milestone: {milestone_name}
63
+ Tag: v{new} {pushed|local-only}
64
+ Changelog: {N} entries written to CHANGELOG.md
65
+ Manifest: {file_path} updated
66
+
67
+ Next steps:
68
+ /maestro-plan {next_phase} -- Start next milestone's first phase
69
+ /manage-status -- View project dashboard
70
+ ```
71
+
72
+ For `--dry-run`, print the computed version, changelog diff, and tag name without side effects.
73
+ </execution>
74
+
75
+ <error_codes>
76
+ | Code | Severity | Condition | Recovery |
77
+ |------|----------|-----------|----------|
78
+ | E001 | error | Current milestone not completed (no milestone-complete run) | Run `/maestro-milestone-complete` first |
79
+ | E002 | error | Audit verdict not PASS | Re-run `/maestro-milestone-audit` and resolve findings |
80
+ | E003 | error | Working tree not clean (uncommitted changes) | Commit or stash changes, then retry |
81
+ | E004 | error | Version manifest not found / unsupported | Add supported manifest or pass `<version>` explicitly with `--no-tag` |
82
+ | E005 | error | Target version not greater than current (would break semver monotonicity) | Choose a higher version or run with explicit `<version>` |
83
+ | W001 | warning | No changes detected since last release tag | Confirm whether release is still desired |
84
+ | W002 | warning | Remote push failed (network / auth) | Retry manually with `git push --follow-tags` |
85
+ </error_codes>
86
+
87
+ <success_criteria>
88
+ - [ ] Preconditions validated (milestone complete, audit PASS, clean tree)
89
+ - [ ] Target version computed and greater than previous
90
+ - [ ] Version manifest(s) updated with new version
91
+ - [ ] CHANGELOG.md contains new entry with milestone summary + grouped changes
92
+ - [ ] Release commit created with conventional message
93
+ - [ ] Annotated git tag created (unless `--no-tag`)
94
+ - [ ] Commit + tag pushed to remote (unless `--no-push` or push failed → W002)
95
+ - [ ] state.json updated with last_release_version + last_release_at timestamp
96
+ </success_criteria>
@@ -1,138 +1,138 @@
1
- ---
2
- name: maestro-plan
3
- description: Explore, clarify, plan, check, and confirm a phase execution plan
4
- argument-hint: "[phase] [--collab] [--spec SPEC-xxx] [--auto] [--gaps] [--dir <path>] [--revise [instructions]] [--check <plan-dir>]"
5
- allowed-tools:
6
- - Read
7
- - Write
8
- - Edit
9
- - Bash
10
- - Glob
11
- - Grep
12
- - Agent
13
- - AskUserQuestion
14
- ---
15
- <purpose>
16
- Create, revise, or verify an execution plan through a 5-stage pipeline: Exploration, Clarification, Planning, Plan Checking, and Confirmation. Produces plan.json with waves, task definitions, and user-confirmed execution strategy.
17
-
18
- Supports three modes:
19
- - **Create** (default): Build plan from analysis context or phase requirements
20
- - **Revise** (`--revise`): Incrementally modify existing plan — edit tasks, adjust waves, add/remove tasks
21
- - **Check** (`--check`): Standalone plan verification — run plan-checker against existing plan
22
-
23
- All plan output goes to `.workflow/scratch/{YYYYMMDD}-plan-[P{N}-|M{N}-]{slug}/`. Date-first ordering enables chronological sorting. Scope prefix in directory name (`P{N}` for phase, `M{N}` for milestone, omit for adhoc/standalone) enables fallback identification. Registers PLN artifact in state.json. Performs collision detection against other plans in same milestone.
24
- </purpose>
25
-
26
- <required_reading>
27
- @~/.maestro/workflows/plan.md
28
- </required_reading>
29
-
30
- <deferred_reading>
31
- - [plan.json](~/.maestro/templates/plan.json) — read when generating plan output
32
- - [task.json](~/.maestro/templates/task.json) — read when generating task files
33
- - [state.json](~/.maestro/templates/state.json) — read when registering artifact
34
- </deferred_reading>
35
-
36
- <context>
37
- $ARGUMENTS — phase number, or no args for milestone-wide planning, with optional flags.
38
-
39
- Scope routing, base flags (`--collab`, `--spec`, `--auto`, `--gaps`, `--dir`), output directory format, and artifact registration are defined in workflow plan.md.
40
-
41
- **Command-level flags** (extensions beyond workflow base):
42
- - `--revise [instructions]` -- See workflow plan.md § Revise Mode
43
- - `--check <plan-dir>` -- See workflow plan.md § Check Mode
44
-
45
- **Upstream context:**
46
- - Reads `context.md` from prior analyze artifact (auto-discovered from state.json or via --dir)
47
- - Reads `conclusions.json` if available (implementation_scope seeds task generation)
48
- </context>
49
-
50
- <execution>
51
- ### Pre-flight: team conflict check
52
-
53
- Before starting the plan pipeline, run:
54
- ```
55
- Bash("maestro collab preflight --phase <phase-number>")
56
- ```
57
- If exit code is 1, present warnings and ask whether to proceed.
58
-
59
- Follow '~/.maestro/workflows/plan.md' completely.
60
-
61
- ### Wiki Knowledge Search (P1 addition)
62
-
63
- During P1 Context Collection, after loading context files and before parallel exploration (step 5), search the wiki for prior knowledge related to the phase:
64
-
65
- ```
66
- phase_keywords = extract key terms from goal/title (2-5 terms)
67
- wiki_result = Bash("maestro wiki search ${phase_keywords} --json 2>/dev/null")
68
-
69
- IF wiki_result exit code != 0 OR empty:
70
- display "W003: Wiki search unavailable, continuing without prior knowledge"
71
- ELSE:
72
- entries = JSON.parse(wiki_result).entries (limit to first 10)
73
- wiki_context = structured block for downstream stages
74
- ```
75
-
76
- ### Issue Linkback (--gaps mode)
77
-
78
- After plan generation and checking, if `--gaps` mode was used, link TASK files back to issues bidirectionally:
79
-
80
- ```
81
- For each created TASK-{NNN}.json that has issue_id:
82
- Update corresponding issue in .workflow/issues/issues.jsonl:
83
- task_refs: append TASK-{NNN} to array
84
- task_plan_dir: relative path to .task/ directory
85
- status: "planned"
86
- updated_at: now()
87
- Append history entry: { action: "planned", at: <ISO>, by: "maestro-plan", summary: "Linked to TASK-{NNN}" }
88
- ```
89
-
90
- This ensures issue → TASK traceability. The `task_refs[]` and `task_plan_dir` fields on the issue allow the dashboard to resolve and display associated TASK details.
91
-
92
- **Report format on completion:**
93
-
94
- ```
95
- === PLAN READY ===
96
- Phase: {phase_name}
97
- Tasks: {task_count} tasks in {wave_count} waves
98
- Check: {checker_status} (iteration {check_count}/{max_checks})
99
- Collision: {collision_status}
100
-
101
- Plan: scratch/{YYYYMMDD}-plan-P{N}-{slug}/plan.json
102
- Tasks: scratch/{YYYYMMDD}-plan-P{N}-{slug}/.task/TASK-*.json
103
-
104
- Next steps:
105
- /maestro-execute -- Execute the plan
106
- /maestro-execute --dir {dir} -- Execute specific plan
107
- /maestro-plan {phase} -- Re-plan with modifications
108
- ```
109
-
110
- ### Mode: Revise / Check
111
-
112
- Follow workflow plan.md § "Revise Mode" and § "Check Mode" respectively. These modes bypass the standard P1-P5 create pipeline.
113
- </execution>
114
-
115
- <error_codes>
116
- | Code | Severity | Condition | Recovery |
117
- |------|----------|-----------|----------|
118
- | E001 | error | No args and no roadmap (cannot determine scope) | Provide phase number or topic, or create roadmap |
119
- | E003 | error | --gaps requires prior verification/issues to exist | Run maestro-verify first |
120
- | E004 | error | No plan found to revise (--revise without target) | Use --dir to specify plan, or create plan first |
121
- | E005 | error | Plan directory not found (--check) | Check path, use --dir |
122
- | W001 | warning | Exploration agent returned incomplete results | Retry exploration or proceed with available context |
123
- | W002 | warning | Plan-checker found minor issues, continuing | Review plan-checker feedback, adjust plan if needed |
124
- | W003 | warning | Wiki search unavailable or returned no results | Continue without prior knowledge context |
125
- | W004 | warning | Collision detected with existing plan | Review colliding files, confirm or adjust scope |
126
- </error_codes>
127
-
128
- <success_criteria>
129
- - [ ] plan.json written to scratch directory with summary, approach, task_ids, waves (with phase labels)
130
- - [ ] .task/TASK-*.json files created for each task
131
- - [ ] Every task has `read_first[]` with at least the file being modified + source of truth files
132
- - [ ] Every task has `convergence.criteria[]` with grep-verifiable conditions (no subjective language)
133
- - [ ] Every task `action` and `implementation` contain concrete values (no "align X with Y")
134
- - [ ] Collision detection executed against same-milestone plans (non-blocking)
135
- - [ ] Plan-checker passed (or minor issues acknowledged)
136
- - [ ] User confirmation captured (execute/modify/cancel)
137
- - [ ] Artifact registered in state.json with correct scope/milestone/phase/depends_on
138
- </success_criteria>
1
+ ---
2
+ name: maestro-plan
3
+ description: Explore, clarify, plan, check, and confirm a phase execution plan
4
+ argument-hint: "[phase] [--collab] [--spec SPEC-xxx] [--auto] [--gaps] [--dir <path>] [--revise [instructions]] [--check <plan-dir>]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ - Agent
13
+ - AskUserQuestion
14
+ ---
15
+ <purpose>
16
+ Create, revise, or verify an execution plan through a 5-stage pipeline: Exploration, Clarification, Planning, Plan Checking, and Confirmation. Produces plan.json with waves, task definitions, and user-confirmed execution strategy.
17
+
18
+ Supports three modes:
19
+ - **Create** (default): Build plan from analysis context or phase requirements
20
+ - **Revise** (`--revise`): Incrementally modify existing plan — edit tasks, adjust waves, add/remove tasks
21
+ - **Check** (`--check`): Standalone plan verification — run plan-checker against existing plan
22
+
23
+ All plan output goes to `.workflow/scratch/{YYYYMMDD}-plan-[P{N}-|M{N}-]{slug}/`. Date-first ordering enables chronological sorting. Scope prefix in directory name (`P{N}` for phase, `M{N}` for milestone, omit for adhoc/standalone) enables fallback identification. Registers PLN artifact in state.json. Performs collision detection against other plans in same milestone.
24
+ </purpose>
25
+
26
+ <required_reading>
27
+ @~/.maestro/workflows/plan.md
28
+ </required_reading>
29
+
30
+ <deferred_reading>
31
+ - [plan.json](~/.maestro/templates/plan.json) — read when generating plan output
32
+ - [task.json](~/.maestro/templates/task.json) — read when generating task files
33
+ - [state.json](~/.maestro/templates/state.json) — read when registering artifact
34
+ </deferred_reading>
35
+
36
+ <context>
37
+ $ARGUMENTS — phase number, or no args for milestone-wide planning, with optional flags.
38
+
39
+ Scope routing, base flags (`--collab`, `--spec`, `--auto`, `--gaps`, `--dir`), output directory format, and artifact registration are defined in workflow plan.md.
40
+
41
+ **Command-level flags** (extensions beyond workflow base):
42
+ - `--revise [instructions]` -- See workflow plan.md § Revise Mode
43
+ - `--check <plan-dir>` -- See workflow plan.md § Check Mode
44
+
45
+ **Upstream context:**
46
+ - Reads `context.md` from prior analyze artifact (auto-discovered from state.json or via --dir)
47
+ - Reads `conclusions.json` if available (implementation_scope seeds task generation)
48
+ </context>
49
+
50
+ <execution>
51
+ ### Pre-flight: team conflict check
52
+
53
+ Before starting the plan pipeline, run:
54
+ ```
55
+ Bash("maestro collab preflight --phase <phase-number>")
56
+ ```
57
+ If exit code is 1, present warnings and ask whether to proceed.
58
+
59
+ Follow '~/.maestro/workflows/plan.md' completely.
60
+
61
+ ### Wiki Knowledge Search (P1 addition)
62
+
63
+ During P1 Context Collection, after loading context files and before parallel exploration (step 5), search the wiki for prior knowledge related to the phase:
64
+
65
+ ```
66
+ phase_keywords = extract key terms from goal/title (2-5 terms)
67
+ wiki_result = Bash("maestro wiki search ${phase_keywords} --json 2>/dev/null")
68
+
69
+ IF wiki_result exit code != 0 OR empty:
70
+ display "W003: Wiki search unavailable, continuing without prior knowledge"
71
+ ELSE:
72
+ entries = JSON.parse(wiki_result).entries (limit to first 10)
73
+ wiki_context = structured block for downstream stages
74
+ ```
75
+
76
+ ### Issue Linkback (--gaps mode)
77
+
78
+ After plan generation and checking, if `--gaps` mode was used, link TASK files back to issues bidirectionally:
79
+
80
+ ```
81
+ For each created TASK-{NNN}.json that has issue_id:
82
+ Update corresponding issue in .workflow/issues/issues.jsonl:
83
+ task_refs: append TASK-{NNN} to array
84
+ task_plan_dir: relative path to .task/ directory
85
+ status: "planned"
86
+ updated_at: now()
87
+ Append history entry: { action: "planned", at: <ISO>, by: "maestro-plan", summary: "Linked to TASK-{NNN}" }
88
+ ```
89
+
90
+ This ensures issue → TASK traceability. The `task_refs[]` and `task_plan_dir` fields on the issue allow the dashboard to resolve and display associated TASK details.
91
+
92
+ **Report format on completion:**
93
+
94
+ ```
95
+ === PLAN READY ===
96
+ Phase: {phase_name}
97
+ Tasks: {task_count} tasks in {wave_count} waves
98
+ Check: {checker_status} (iteration {check_count}/{max_checks})
99
+ Collision: {collision_status}
100
+
101
+ Plan: scratch/{YYYYMMDD}-plan-P{N}-{slug}/plan.json
102
+ Tasks: scratch/{YYYYMMDD}-plan-P{N}-{slug}/.task/TASK-*.json
103
+
104
+ Next steps:
105
+ /maestro-execute -- Execute the plan
106
+ /maestro-execute --dir {dir} -- Execute specific plan
107
+ /maestro-plan {phase} -- Re-plan with modifications
108
+ ```
109
+
110
+ ### Mode: Revise / Check
111
+
112
+ Follow workflow plan.md § "Revise Mode" and § "Check Mode" respectively. These modes bypass the standard P1-P5 create pipeline.
113
+ </execution>
114
+
115
+ <error_codes>
116
+ | Code | Severity | Condition | Recovery |
117
+ |------|----------|-----------|----------|
118
+ | E001 | error | No args and no roadmap (cannot determine scope) | Provide phase number or topic, or create roadmap |
119
+ | E003 | error | --gaps requires prior verification/issues to exist | Run maestro-verify first |
120
+ | E004 | error | No plan found to revise (--revise without target) | Use --dir to specify plan, or create plan first |
121
+ | E005 | error | Plan directory not found (--check) | Check path, use --dir |
122
+ | W001 | warning | Exploration agent returned incomplete results | Retry exploration or proceed with available context |
123
+ | W002 | warning | Plan-checker found minor issues, continuing | Review plan-checker feedback, adjust plan if needed |
124
+ | W003 | warning | Wiki search unavailable or returned no results | Continue without prior knowledge context |
125
+ | W004 | warning | Collision detected with existing plan | Review colliding files, confirm or adjust scope |
126
+ </error_codes>
127
+
128
+ <success_criteria>
129
+ - [ ] plan.json written to scratch directory with summary, approach, task_ids, waves (with phase labels)
130
+ - [ ] .task/TASK-*.json files created for each task
131
+ - [ ] Every task has `read_first[]` with at least the file being modified + source of truth files
132
+ - [ ] Every task has `convergence.criteria[]` with grep-verifiable conditions (no subjective language)
133
+ - [ ] Every task `action` and `implementation` contain concrete values (no "align X with Y")
134
+ - [ ] Collision detection executed against same-milestone plans (non-blocking)
135
+ - [ ] Plan-checker passed (or minor issues acknowledged)
136
+ - [ ] User confirmation captured (execute/modify/cancel)
137
+ - [ ] Artifact registered in state.json with correct scope/milestone/phase/depends_on
138
+ </success_criteria>