maestro-flow-one 0.2.0 → 0.2.2

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 (97) hide show
  1. package/.ace-tool/index.json +108 -0
  2. package/bin/maestro-flow.js +30 -0
  3. package/claude/maestro-flow/agents/cli-explore-agent.md +187 -0
  4. package/claude/maestro-flow/agents/conceptual-planning-agent.md +245 -0
  5. package/claude/maestro-flow/agents/team-supervisor.md +143 -0
  6. package/claude/maestro-flow/agents/team-worker.md +237 -0
  7. package/claude/maestro-flow/agents/ui-design-agent.md +286 -0
  8. package/claude/maestro-flow/agents/workflow-analyzer.md +115 -0
  9. package/claude/maestro-flow/agents/workflow-codebase-mapper.md +77 -0
  10. package/claude/maestro-flow/agents/workflow-collab-planner.md +143 -0
  11. package/claude/maestro-flow/agents/workflow-debugger.md +103 -0
  12. package/claude/maestro-flow/agents/workflow-executor.md +129 -0
  13. package/claude/maestro-flow/agents/workflow-external-researcher.md +86 -0
  14. package/claude/maestro-flow/agents/workflow-integration-checker.md +83 -0
  15. package/claude/maestro-flow/agents/workflow-nyquist-auditor.md +85 -0
  16. package/claude/maestro-flow/agents/workflow-phase-researcher.md +85 -0
  17. package/claude/maestro-flow/agents/workflow-plan-checker.md +90 -0
  18. package/claude/maestro-flow/agents/workflow-planner.md +195 -0
  19. package/claude/maestro-flow/agents/workflow-project-researcher.md +74 -0
  20. package/claude/maestro-flow/agents/workflow-research-synthesizer.md +70 -0
  21. package/claude/maestro-flow/agents/workflow-reviewer.md +82 -0
  22. package/claude/maestro-flow/agents/workflow-roadmapper.md +81 -0
  23. package/claude/maestro-flow/agents/workflow-verifier.md +120 -0
  24. package/codex/maestro-flow/agents/team-supervisor.toml +40 -0
  25. package/codex/maestro-flow/agents/team-worker.toml +63 -0
  26. package/maestro-flow/agents/cli-explore-agent.md +187 -0
  27. package/maestro-flow/agents/conceptual-planning-agent.md +245 -0
  28. package/maestro-flow/agents/team-supervisor.md +143 -0
  29. package/maestro-flow/agents/team-worker.md +237 -0
  30. package/maestro-flow/agents/ui-design-agent.md +286 -0
  31. package/maestro-flow/agents/workflow-analyzer.md +115 -0
  32. package/maestro-flow/agents/workflow-codebase-mapper.md +77 -0
  33. package/maestro-flow/agents/workflow-collab-planner.md +143 -0
  34. package/maestro-flow/agents/workflow-debugger.md +103 -0
  35. package/maestro-flow/agents/workflow-executor.md +129 -0
  36. package/maestro-flow/agents/workflow-external-researcher.md +86 -0
  37. package/maestro-flow/agents/workflow-integration-checker.md +83 -0
  38. package/maestro-flow/agents/workflow-nyquist-auditor.md +85 -0
  39. package/maestro-flow/agents/workflow-phase-researcher.md +85 -0
  40. package/maestro-flow/agents/workflow-plan-checker.md +90 -0
  41. package/maestro-flow/agents/workflow-planner.md +195 -0
  42. package/maestro-flow/agents/workflow-project-researcher.md +74 -0
  43. package/maestro-flow/agents/workflow-research-synthesizer.md +70 -0
  44. package/maestro-flow/agents/workflow-reviewer.md +82 -0
  45. package/maestro-flow/agents/workflow-roadmapper.md +81 -0
  46. package/maestro-flow/agents/workflow-verifier.md +120 -0
  47. package/maestro-flow/commands/learn/decompose.md +176 -0
  48. package/maestro-flow/commands/learn/follow.md +167 -0
  49. package/maestro-flow/commands/learn/investigate.md +221 -0
  50. package/maestro-flow/commands/learn/retro.md +303 -0
  51. package/maestro-flow/commands/learn/second-opinion.md +167 -0
  52. package/maestro-flow/commands/lifecycle/amend.md +300 -0
  53. package/maestro-flow/commands/lifecycle/analyze.md +130 -0
  54. package/maestro-flow/commands/lifecycle/brainstorm.md +104 -0
  55. package/maestro-flow/commands/lifecycle/collab.md +333 -0
  56. package/maestro-flow/commands/lifecycle/composer.md +354 -0
  57. package/maestro-flow/commands/lifecycle/execute.md +120 -0
  58. package/maestro-flow/commands/lifecycle/fork.md +86 -0
  59. package/maestro-flow/commands/lifecycle/init.md +78 -0
  60. package/maestro-flow/commands/lifecycle/learn.md +140 -0
  61. package/maestro-flow/commands/lifecycle/link-coordinate.md +71 -0
  62. package/maestro-flow/commands/lifecycle/merge.md +61 -0
  63. package/maestro-flow/commands/lifecycle/overlay.md +178 -0
  64. package/maestro-flow/commands/lifecycle/plan.md +154 -0
  65. package/maestro-flow/commands/lifecycle/player.md +404 -0
  66. package/maestro-flow/commands/lifecycle/quick.md +56 -0
  67. package/maestro-flow/commands/lifecycle/roadmap.md +164 -0
  68. package/maestro-flow/commands/lifecycle/ui-design.md +93 -0
  69. package/maestro-flow/commands/lifecycle/update.md +176 -0
  70. package/maestro-flow/commands/lifecycle/verify.md +96 -0
  71. package/maestro-flow/commands/manage/codebase-rebuild.md +75 -0
  72. package/maestro-flow/commands/manage/codebase-refresh.md +57 -0
  73. package/maestro-flow/commands/manage/harvest.md +94 -0
  74. package/maestro-flow/commands/manage/issue-discover.md +77 -0
  75. package/maestro-flow/commands/manage/issue.md +73 -0
  76. package/maestro-flow/commands/manage/knowhow-capture.md +193 -0
  77. package/maestro-flow/commands/manage/knowhow.md +77 -0
  78. package/maestro-flow/commands/manage/learn.md +67 -0
  79. package/maestro-flow/commands/manage/status.md +51 -0
  80. package/maestro-flow/commands/manage/wiki.md +62 -0
  81. package/maestro-flow/commands/milestone/audit.md +68 -0
  82. package/maestro-flow/commands/milestone/complete.md +75 -0
  83. package/maestro-flow/commands/milestone/release.md +96 -0
  84. package/maestro-flow/commands/quality/auto-test.md +128 -0
  85. package/maestro-flow/commands/quality/debug.md +125 -0
  86. package/maestro-flow/commands/quality/refactor.md +55 -0
  87. package/maestro-flow/commands/quality/retrospective.md +78 -0
  88. package/maestro-flow/commands/quality/review.md +114 -0
  89. package/maestro-flow/commands/quality/sync.md +51 -0
  90. package/maestro-flow/commands/quality/test.md +107 -0
  91. package/maestro-flow/commands/spec/add.md +49 -0
  92. package/maestro-flow/commands/spec/load.md +51 -0
  93. package/maestro-flow/commands/spec/remove.md +51 -0
  94. package/maestro-flow/commands/spec/setup.md +51 -0
  95. package/maestro-flow/commands/wiki/connect.md +62 -0
  96. package/maestro-flow/commands/wiki/digest.md +69 -0
  97. package/package.json +1 -1
@@ -0,0 +1,178 @@
1
+ ---
2
+ name: maestro-overlay
3
+ description: Create or edit command overlays from natural language
4
+ argument-hint: "<intent>"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Bash
9
+ - Glob
10
+ - Grep
11
+ - AskUserQuestion
12
+ ---
13
+ <purpose>
14
+ Turn a user's natural-language instruction into a command overlay — a JSON patch file that augments one or more `.claude/commands/*.md` files non-invasively. Overlays live at `~/.maestro/overlays/` and are auto-applied by every `maestro install` run, so injected steps survive reinstalls. Use this skill when the user says things like "always run CLI verification after `/maestro-execute`", "require reading doc X before `/maestro-plan`", or "add a `ccw cli` quality check at the end of every quality-review".
15
+ </purpose>
16
+
17
+ <required_reading>
18
+ @~/.maestro/workflows/overlays.md
19
+ @~/.maestro/cli-tools.json
20
+ </required_reading>
21
+
22
+ <context>
23
+ **Overlay model** — an overlay is a JSON file with a `name`, one or more `targets` (command names without `.md`), and a list of `patches`. Each patch targets an XML section (`execution`, `required_reading`, `context`, `success_criteria`, etc.), a mode (`append`, `prepend`, `replace`, `new-section`), and `content`. On apply, the patcher wraps the content in hashed HTML-comment markers so re-apply is idempotent and removal is surgical.
24
+
25
+ **Where overlays live**
26
+ - User overlays: `~/.maestro/overlays/*.json` — created by this skill
27
+ - Shared docs: `~/.maestro/overlays/docs/*.md` — referenced via `@~/.maestro/overlays/docs/*.md` inside patch content
28
+ - Shipped examples: `~/.maestro/overlays/_shipped/` — read-only, do not edit
29
+
30
+ **Management** — listing and removing overlays is handled by `maestro overlay list` (ink TUI with interactive delete). This skill focuses solely on creation.
31
+
32
+ **Available sections** (for `section:` in patches): `purpose`, `required_reading`, `deferred_reading`, `context`, `execution`, `error_codes`, `success_criteria`.
33
+ </context>
34
+
35
+ <execution>
36
+ ### 1. Parse user intent
37
+
38
+ Treat the argument as natural-language intent. If unclear, ask up to 2 questions with AskUserQuestion: (a) which command(s) to target, (b) where in the command flow the injection should happen.
39
+
40
+ ### 2. Identify targets, injection points, and visualize
41
+
42
+ For each likely target command, read the pristine source from `$PKG_ROOT/.claude/commands/<name>.md` (preferred — untouched by overlays) or fall back to `~/.claude/commands/<name>.md`. Inspect the XML sections and pick the right one:
43
+
44
+ - **New step after execution** → `section: execution`, `mode: append`
45
+ - **Required reading** → `section: required_reading`, `mode: append`
46
+ - **Preconditions / gating** → `section: context`, `mode: append`
47
+ - **Output quality gate** → `section: success_criteria`, `mode: append`
48
+
49
+ If the user wants a whole new section, use `mode: new-section` with `afterSection: execution` (or whichever anchor makes sense).
50
+
51
+ **Injection point preview** — after selecting section + mode, render the target command's section map showing existing overlays and the new injection point:
52
+
53
+ ```
54
+ === maestro-execute.md (1 overlay exists) ===
55
+
56
+ <purpose>
57
+ <required_reading>
58
+ <context>
59
+ <execution>
60
+ ├─ [existing] cli-verify #1 "CLI Verification step"
61
+ >>> NEW: append here (your overlay)
62
+ <success_criteria>
63
+ ```
64
+
65
+ Use AskUserQuestion to confirm:
66
+ - **"Confirm"** — proceed with this injection point
67
+ - **"Pick different section"** — re-select section/mode
68
+ - **"Cancel"** — abort
69
+
70
+ ### 2.5. Skill chain configuration
71
+
72
+ After confirming the injection point, ask whether this overlay should chain to another skill upon completion. This enables the overlay's injected content to hand off to a skill via AskUserQuestion at runtime — similar to how `/maestro` chains commands via `Skill({ skill: "...", args: "..." })`.
73
+
74
+ Use AskUserQuestion:
75
+ - **"No chain"** — standard overlay, no skill handoff
76
+ - **"Chain to skill"** → ask for the target skill name (e.g., `quality-review`, `maestro-verify`, `quality-test`)
77
+ - **"Chain with alternatives"** → ask for primary skill + 1-2 alternative skills
78
+
79
+ If chain is selected, record the skill name(s) for use in Step 3.
80
+
81
+ ### 3. Draft the overlay JSON
82
+
83
+ Build a slug from the user's intent (kebab-case, lowercase). Write to `~/.maestro/overlays/<slug>.json`:
84
+
85
+ ```json
86
+ {
87
+ "name": "<slug>",
88
+ "description": "<short summary of what and why>",
89
+ "targets": ["maestro-execute"],
90
+ "priority": 50,
91
+ "enabled": true,
92
+ "patches": [
93
+ {
94
+ "section": "execution",
95
+ "mode": "append",
96
+ "content": "## CLI Verification (overlay)\n\nAfter execution, run:\n```\nccw cli -p \"PURPOSE: ...\" --mode analysis --rule analysis-review-code-quality\n```"
97
+ }
98
+ ]
99
+ }
100
+ ```
101
+
102
+ **Content guidelines**
103
+ - Lead the injected block with a heading that includes `(overlay)` so readers see it's machine-injected
104
+ - Keep content concise — overlays should add a step, not rewrite the command
105
+ - `@~/.maestro/...` references are encouraged for pointing at docs
106
+ - Escape `\n` in JSON strings; use a HEREDOC via Bash if content is long
107
+
108
+ **Skill chain content** — if a chain was configured in Step 2.5, append a Skill Handoff block at the end of the patch `content`. The handoff uses AskUserQuestion so the user controls whether to proceed:
109
+
110
+ ```markdown
111
+ ---
112
+
113
+ **Skill Handoff** (overlay)
114
+
115
+ After the above step completes, use AskUserQuestion:
116
+ - "Proceed to /quality-review" — Hand off to quality review
117
+ - "Skip" — Continue with current command flow
118
+ - "Alternative: /maestro-verify" — Run verification instead
119
+
120
+ On user selection:
121
+ - Proceed → Skill({ skill: "quality-review", args: "{phase}" })
122
+ - Alternative → Skill({ skill: "maestro-verify", args: "{phase}" })
123
+ - Skip → continue normally
124
+ ```
125
+
126
+ Handoff rules:
127
+ - Always include a **"Skip"** option — the user can always decline the chain
128
+ - Use `Skill({ skill: "<name>", args: "..." })` syntax consistent with maestro.md chainMap
129
+ - Mark handoff heading with `(overlay)` tag
130
+ - Support runtime variable placeholders: `{phase}`, `{description}`, `{session_id}`
131
+ - Keep handoff block under 10 lines of markdown
132
+
133
+ ### 4. Install via `maestro overlay add`
134
+
135
+ Run:
136
+
137
+ ```bash
138
+ maestro overlay add ~/.maestro/overlays/<slug>.json
139
+ ```
140
+
141
+ This validates the overlay, copies it into place (idempotent), and applies it across all known install scopes. On validation failure, fix the JSON and re-run.
142
+
143
+ ### 5. Report
144
+
145
+ Show the user:
146
+ - Path of the saved overlay JSON
147
+ - Which targets were patched and which were skipped (missing/disabled)
148
+ - Skill chain info (if configured)
149
+ - A reminder that `maestro install` will auto-reapply on every run
150
+ - How to remove: `maestro overlay remove <slug>`
151
+
152
+ **Report format**
153
+
154
+ ```
155
+ === OVERLAY INSTALLED ===
156
+ Name: <slug>
157
+ Path: ~/.maestro/overlays/<slug>.json
158
+ Targets: maestro-execute (applied), maestro-plan (skipped: missing)
159
+ Chain: quality-review (via AskUserQuestion) | none
160
+ Scopes: [global]
161
+
162
+ Re-apply: maestro overlay apply
163
+ Remove: maestro overlay remove <slug>
164
+ Inspect: maestro overlay list
165
+ ```
166
+
167
+ After the report, remind the user they can run `maestro overlay list` for the interactive TUI showing section maps and overlay management.
168
+ </execution>
169
+
170
+ <success_criteria>
171
+ - [ ] Overlay JSON written to `~/.maestro/overlays/<slug>.json` and validates
172
+ - [ ] `maestro overlay add` exited successfully and applied to at least one scope
173
+ - [ ] Target command file(s) contain `<!-- maestro-overlay:<slug>#N hash=... -->` markers
174
+ - [ ] Re-running `maestro overlay apply` produces no file changes (idempotent)
175
+ - [ ] User shown the report with target list and removal instructions
176
+ - [ ] Injection point preview shown (with existing overlays + `>>>` marker) and confirmed before drafting
177
+ - [ ] If chain configured, `content` includes Skill Handoff block with AskUserQuestion + Skip option + `Skill()` calls
178
+ </success_criteria>
@@ -0,0 +1,154 @@
1
+ ---
2
+ name: maestro-plan
3
+ description: Plan phase execution with exploration and verification
4
+ argument-hint: "[phase] [--collab] [--spec SPEC-xxx] [-y] [--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`, `-y`, `--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
+ ### Codebase Docs Loading (P1 addition)
62
+
63
+ During P1 Context Collection, after loading context files, load codebase documentation if available:
64
+
65
+ ```
66
+ IF exists(.workflow/codebase/doc-index.json):
67
+ codebase_ctx = Read(.workflow/codebase/ARCHITECTURE.md) + Read(.workflow/codebase/FEATURES.md)
68
+ Pass codebase_ctx to planner agent as structural context
69
+ ELSE:
70
+ display "W004: Codebase docs unavailable, continuing with code exploration only"
71
+ ```
72
+
73
+ ### Wiki Knowledge Search (P1 addition)
74
+
75
+ During P1 Context Collection, after loading context files and before parallel exploration (step 5), search the wiki for prior knowledge related to the phase:
76
+
77
+ ```
78
+ phase_keywords = extract key terms from goal/title (2-5 terms)
79
+ wiki_result = Bash("maestro wiki search ${phase_keywords} --json 2>/dev/null")
80
+
81
+ IF wiki_result exit code != 0 OR empty:
82
+ display "W003: Wiki search unavailable, continuing without prior knowledge"
83
+ ELSE:
84
+ entries = JSON.parse(wiki_result).entries (limit to first 10)
85
+ wiki_context = structured block for downstream stages
86
+ ```
87
+
88
+ ### Issue Linkback (--gaps mode)
89
+
90
+ After plan generation and checking, if `--gaps` mode was used, link TASK files back to issues bidirectionally:
91
+
92
+ ```
93
+ For each created TASK-{NNN}.json that has issue_id:
94
+ Update corresponding issue in .workflow/issues/issues.jsonl:
95
+ task_refs: append TASK-{NNN} to array
96
+ task_plan_dir: relative path to .task/ directory
97
+ status: "planned"
98
+ updated_at: now()
99
+ Append history entry: { action: "planned", at: <ISO>, by: "maestro-plan", summary: "Linked to TASK-{NNN}" }
100
+ ```
101
+
102
+ 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.
103
+
104
+ **Report format on completion:**
105
+
106
+ ```
107
+ === PLAN READY ===
108
+ Phase: {phase_name}
109
+ Tasks: {task_count} tasks in {wave_count} waves
110
+ Check: {checker_status} (iteration {check_count}/{max_checks})
111
+ Collision: {collision_status}
112
+
113
+ Plan: scratch/{YYYYMMDD}-plan-P{N}-{slug}/plan.json
114
+ Tasks: scratch/{YYYYMMDD}-plan-P{N}-{slug}/.task/TASK-*.json
115
+
116
+ Next steps:
117
+ /maestro-execute -- Execute the plan
118
+ /maestro-execute --dir {dir} -- Execute specific plan
119
+ /maestro-plan {phase} -- Re-plan with modifications
120
+ ```
121
+
122
+ ### Mode: Revise / Check
123
+
124
+ Follow workflow plan.md § "Revise Mode" and § "Check Mode" respectively. These modes bypass the standard P1-P5 create pipeline.
125
+ </execution>
126
+
127
+ <error_codes>
128
+ | Code | Severity | Condition | Recovery |
129
+ |------|----------|-----------|----------|
130
+ | E001 | error | No args and no roadmap (cannot determine scope) | Provide phase number or topic, or create roadmap |
131
+ | E003 | error | --gaps requires prior verification/issues to exist | Run maestro-verify first |
132
+ | E004 | error | No plan found to revise (--revise without target) | Use --dir to specify plan, or create plan first |
133
+ | E005 | error | Plan directory not found (--check) | Check path, use --dir |
134
+ | W001 | warning | Exploration agent returned incomplete results | Retry exploration or proceed with available context |
135
+ | W002 | warning | Plan-checker found minor issues, continuing | Review plan-checker feedback, adjust plan if needed |
136
+ | W003 | warning | Wiki search unavailable or returned no results | Continue without prior knowledge context |
137
+ | W004 | warning | Collision detected with existing plan | Review colliding files, confirm or adjust scope |
138
+ </error_codes>
139
+
140
+ <success_criteria>
141
+ - [ ] plan.json written to scratch directory with summary, approach, task_ids, waves (with phase labels)
142
+ - [ ] .task/TASK-*.json files created for each task
143
+ - [ ] Every task has `read_first[]` with at least the file being modified + source of truth files
144
+ - [ ] Every task has `convergence.criteria[]` with grep-verifiable conditions (no subjective language)
145
+ - [ ] Every task `action` and `implementation` contain concrete values (no "align X with Y")
146
+ - [ ] Plan confidence scored in P4 with 5-dimension factor model
147
+ - [ ] Plan readiness gate checked before P4.5 collision detection
148
+ - [ ] Pressure pass completed on highest-complexity task
149
+ - [ ] plan.json includes confidence section (overall, dimensions, pressure_pass)
150
+ - [ ] Collision detection executed against same-milestone plans (non-blocking)
151
+ - [ ] Plan-checker passed (or minor issues acknowledged)
152
+ - [ ] User confirmation captured (execute/modify/cancel) with confidence displayed
153
+ - [ ] Artifact registered in state.json with correct scope/milestone/phase/depends_on
154
+ </success_criteria>