maestro-flow 0.4.21 → 0.4.23

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 (63) hide show
  1. package/.agents/skills/maestro-analyze/SKILL.md +78 -34
  2. package/.agents/skills/maestro-blueprint/SKILL.md +57 -24
  3. package/.agents/skills/maestro-brainstorm/SKILL.md +69 -34
  4. package/.agents/skills/maestro-execute/SKILL.md +45 -15
  5. package/.agents/skills/maestro-grill/SKILL.md +63 -38
  6. package/.agents/skills/maestro-init/SKILL.md +59 -17
  7. package/.agents/skills/maestro-milestone-audit/SKILL.md +48 -5
  8. package/.agents/skills/maestro-milestone-complete/SKILL.md +48 -6
  9. package/.agents/skills/maestro-milestone-release/SKILL.md +42 -11
  10. package/.agents/skills/maestro-plan/SKILL.md +19 -13
  11. package/.agents/skills/maestro-roadmap/SKILL.md +59 -29
  12. package/.agents/skills/maestro-verify/SKILL.md +46 -11
  13. package/.agents/skills/team-adversarial-swarm/scripts/__pycache__/pheromone.cpython-313.pyc +0 -0
  14. package/.agents/skills/team-adversarial-swarm/scripts/__pycache__/scoring.cpython-313.pyc +0 -0
  15. package/.agents/skills/team-adversarial-swarm/scripts/aco.py +15 -15
  16. package/.agents/skills/team-adversarial-swarm/scripts/pheromone.py +2 -2
  17. package/.agents/skills/team-adversarial-swarm/scripts/scoring.py +1 -1
  18. package/.agents/skills/team-swarm/scripts/aco.py +15 -15
  19. package/.agents/skills/team-swarm/scripts/pheromone.py +2 -2
  20. package/.agents/skills/team-swarm/scripts/scoring.py +1 -1
  21. package/.agy/skills/maestro-analyze/SKILL.md +78 -34
  22. package/.agy/skills/maestro-blueprint/SKILL.md +57 -24
  23. package/.agy/skills/maestro-brainstorm/SKILL.md +69 -34
  24. package/.agy/skills/maestro-execute/SKILL.md +45 -15
  25. package/.agy/skills/maestro-grill/SKILL.md +63 -38
  26. package/.agy/skills/maestro-init/SKILL.md +59 -17
  27. package/.agy/skills/maestro-milestone-audit/SKILL.md +48 -5
  28. package/.agy/skills/maestro-milestone-complete/SKILL.md +48 -6
  29. package/.agy/skills/maestro-milestone-release/SKILL.md +42 -11
  30. package/.agy/skills/maestro-plan/SKILL.md +19 -13
  31. package/.agy/skills/maestro-roadmap/SKILL.md +59 -29
  32. package/.agy/skills/maestro-verify/SKILL.md +46 -11
  33. package/.agy/skills/team-adversarial-swarm/scripts/__pycache__/pheromone.cpython-313.pyc +0 -0
  34. package/.agy/skills/team-adversarial-swarm/scripts/__pycache__/scoring.cpython-313.pyc +0 -0
  35. package/.agy/skills/team-adversarial-swarm/scripts/aco.py +15 -15
  36. package/.agy/skills/team-adversarial-swarm/scripts/pheromone.py +2 -2
  37. package/.agy/skills/team-adversarial-swarm/scripts/scoring.py +1 -1
  38. package/.agy/skills/team-swarm/scripts/aco.py +15 -15
  39. package/.agy/skills/team-swarm/scripts/pheromone.py +2 -2
  40. package/.agy/skills/team-swarm/scripts/scoring.py +1 -1
  41. package/.claude/commands/maestro-analyze.md +78 -34
  42. package/.claude/commands/maestro-blueprint.md +57 -24
  43. package/.claude/commands/maestro-brainstorm.md +69 -34
  44. package/.claude/commands/maestro-execute.md +45 -15
  45. package/.claude/commands/maestro-grill.md +63 -38
  46. package/.claude/commands/maestro-init.md +59 -17
  47. package/.claude/commands/maestro-milestone-audit.md +48 -5
  48. package/.claude/commands/maestro-milestone-complete.md +48 -6
  49. package/.claude/commands/maestro-milestone-release.md +42 -11
  50. package/.claude/commands/maestro-plan.md +19 -13
  51. package/.claude/commands/maestro-roadmap.md +59 -29
  52. package/.claude/commands/maestro-verify.md +46 -11
  53. package/.claude/skills/team-adversarial-swarm/scripts/__pycache__/pheromone.cpython-313.pyc +0 -0
  54. package/.claude/skills/team-adversarial-swarm/scripts/__pycache__/scoring.cpython-313.pyc +0 -0
  55. package/.claude/skills/team-adversarial-swarm/scripts/aco.py +15 -15
  56. package/.claude/skills/team-adversarial-swarm/scripts/pheromone.py +2 -2
  57. package/.claude/skills/team-adversarial-swarm/scripts/scoring.py +1 -1
  58. package/.claude/skills/team-swarm/scripts/aco.py +15 -15
  59. package/.claude/skills/team-swarm/scripts/pheromone.py +2 -2
  60. package/.claude/skills/team-swarm/scripts/scoring.py +1 -1
  61. package/package.json +1 -1
  62. package/workflows/command-authoring.md +823 -0
  63. package/workflows/interview-mechanics.md +7 -0
@@ -15,6 +15,8 @@ allowed-tools:
15
15
  ---
16
16
  <purpose>
17
17
  Unified brainstorming combining interactive framework generation, multi-role parallel analysis, cross-role review, and resolution writeback. Two modes: Auto (full pipeline: guidance-specification → parallel {role}/ multi-file analysis → cross-role-reviewer compares Decision Digests for conflicts/gaps/synergies → user-confirmed resolutions patched into role files + logged in guidance §12) and Single Role (individual role analysis for an existing session). Outputs structured artifacts in `.workflow/scratch/{YYYYMMDD}-brainstorm-{slug}/` ready for downstream planning (roadmap / analyze / blueprint consume `guidance-specification.md`).
18
+
19
+ Pipeline position: downstream of maestro-grill (optional stress-test). Upstream of maestro-roadmap, maestro-analyze, and maestro-blueprint (all consume brainstorm output).
18
20
  </purpose>
19
21
 
20
22
  <required_reading>
@@ -40,13 +42,16 @@ $ARGUMENTS -- topic text for auto mode, or role name for single role mode.
40
42
  **Valid roles**: data-architect, product-manager, product-owner, scrum-master, subject-matter-expert, system-architect, test-strategist, ui-designer, ux-expert
41
43
 
42
44
  **Flags**:
43
- - `--yes` / `-y`: Auto mode, skip interactive questions, use defaults
44
- - `--count N`: Number of roles to select (default 3, max 9)
45
- - `--session ID`: Use existing session
46
- - `--update`: Update existing analysis (single role)
47
- - `--skip-questions`: Skip context gathering questions
48
- - `--include-questions`: Force context gathering even if analysis exists
49
- - `--style-skill PKG`: Style package for ui-designer role
45
+
46
+ | Flag | Effect | Default |
47
+ |------|--------|---------|
48
+ | `--yes` / `-y` | Auto mode — skip interactive questions, use defaults | false |
49
+ | `--count N` | Number of roles to select (max 9) | 3 |
50
+ | `--session ID` | Use existing session | — |
51
+ | `--update` | Update existing analysis (single role) | false |
52
+ | `--skip-questions` | Skip context gathering questions | false |
53
+ | `--include-questions` | Force context gathering even if analysis exists | false |
54
+ | `--style-skill PKG` | Style package for ui-designer role | — |
50
55
 
51
56
  ### Pre-load specs
52
57
  1. **Architecture specs**: Run `maestro spec load --category arch` to load architecture constraints. Use as context for multi-role analysis — ensures roles respect documented decisions.
@@ -62,39 +67,69 @@ $ARGUMENTS -- topic text for auto mode, or role name for single role mode.
62
67
  </context>
63
68
 
64
69
  <interview_protocol>
65
- Interview the user relentlessly until shared understanding is reached. Active only in interactive mode; skip when `--yes/-y`, `--skip-questions`, `--session` (existing session), or input is already specific.
66
-
67
- - One decision per turn via ask_question with 2–4 options + a (Recommended) default. The user controls termination — keep interviewing until convergence; they can interrupt naturally or via `Other` at any time.
68
- - Search-first when uncertain: before asking, resolve via `state.json`, the session directory, `maestro spec load`, `maestro wiki search`, Glob/Grep/Read, or for open-ended multi-file scans — spawn `invoke_subagent([{ TypeName: "<TypeName>", Role: "<Role>", Prompt: "<Prompt>", Workspace: "inherit" }])` / `maestro delegate ... --role explore`. Never ask what code or memory can verify; never bounce your own ambiguity back to the user search first, then ask only what truly needs human judgment.
69
- - Writeback cadence: each time a decision settles, immediately append/update its row in `guidance-specification.md` §11 (create the section if absent). Do NOT batch writeback to the end — partial decisions must already be on disk before the next question.
70
- - Branch jumps allowed: the user may switch freely between mode / role / upstream / sub-pipeline branches; sequence is not enforced, but every decision point must end with a definite answer.
71
- - Scope guard: only ask about decisions owned by `brainstorm`. Do not pre-resolve roadmap/plan choices.
72
-
73
- Decision points: mode (auto / single-role / review-only) / role selection and `--count` / `--from` upstream source (grill:ID, blueprint:ID, @file, path) / whether to enable design-research and the DESIGN.md sub-pipeline.
74
-
75
- Exit: on consensus or explicit user signal to proceed, finalize session metadata. The §11 table (already populated incrementally) uses this schema:
76
- `| # | Decision | Choice | Source (user / code / default) |`
70
+ Follows @~/.maestro/workflows/interview-mechanics.md standard.
71
+
72
+ **Interaction mode**: convergent menu-driven
73
+ **Decision tree** (flexible order user may jump between branches): mode (auto / single-role / review-only) role selection and --count --from upstream source (grill:ID, blueprint:ID, @file, path) whether to enable design-research and DESIGN.md sub-pipeline
74
+ **Scope guard**: only brainstorm decisions; do not pre-resolve roadmap/plan choices
75
+ **Writeback target**: guidance-specification.md §11 (create section if absent)
76
+ **Additional skip conditions**: --skip-questions, --session (existing session)
77
+ **Exit condition**: on consensus or explicit user signal → finalize session metadata
77
78
  </interview_protocol>
78
79
 
79
80
  <execution>
80
81
  Follow '~/.maestro/workflows/brainstorm.md' completely.
81
-
82
- **Next-step routing on completion:**
83
-
84
- Auto mode:
85
- - Project not initialized → view_file(AbsolutePath="<agy-skills-dir>/maestro-init/SKILL.md") + execute inline
86
- - Project initialized, need formal spec package → view_file(AbsolutePath="<agy-skills-dir>/maestro-blueprint/SKILL.md") + execute inline (args: "--from brainstorm:{artifact_id}")
87
- - Project initialized, quick roadmap → view_file(AbsolutePath="<agy-skills-dir>/maestro-roadmap/SKILL.md") + execute inline (args: "--from brainstorm:{artifact_id}")
88
- - Need deeper analysis first → view_file(AbsolutePath="<agy-skills-dir>/maestro-analyze/SKILL.md") + execute inline (args: "{topic} --from brainstorm:{artifact_id}")
89
- - Need stress-testing first → view_file(AbsolutePath="<agy-skills-dir>/maestro-grill/SKILL.md") + execute inline (args: "{topic}")
90
- - `html-prototypes/` produced with 2+ files and user wants to browse → load `~/.maestro/workflows/brainstorm-visualize.md` and launch visualizer server (optional, user-triggered)
91
- - DESIGN.md established during Step 3.5 → suggest: "Run `/maestro-impeccable build <feature-description>` to build with the established design system"
92
-
93
- Single role mode:
94
- - More roles needed → view_file(AbsolutePath="<agy-skills-dir>/maestro-brainstorm/SKILL.md") + execute inline (args: "{next_role} --session {session_id}")
95
- - All roles done, run synthesis → view_file(AbsolutePath="<agy-skills-dir>/maestro-brainstorm/SKILL.md") + execute inline (args: "{topic} --session {session_id}")
96
82
  </execution>
97
83
 
84
+ <completion>
85
+ ### Standalone report
86
+
87
+ ```
88
+ === BRAINSTORM READY ===
89
+ Session: {session_id}
90
+ Output: {output_dir}
91
+ Mode: {auto|single-role}
92
+ Roles: {selected_roles}
93
+ Findings: {review_findings_count} cross-role issues, {resolutions_applied} resolutions applied
94
+ Status: COMPLETE
95
+ ========================
96
+ ```
97
+
98
+ ### Ralph-invoked completion
99
+
100
+ End the step by calling the CLI (no text block output):
101
+ ```
102
+ maestro ralph complete <idx> --status {STATUS} [--evidence {path}]
103
+ ```
104
+
105
+ Status verdicts:
106
+ - **DONE** — Normal completion
107
+ - **DONE_WITH_CONCERNS** — Completed with caveats; pass `--concerns`
108
+ - **NEEDS_RETRY** — Tooling error / transient issue; ralph will retry
109
+ - **BLOCKED** — External hard blocker; pass `--reason`
110
+
111
+ ### Next-step routing
112
+
113
+ **Auto mode:**
114
+
115
+ | Condition | Suggestion |
116
+ |-----------|-----------|
117
+ | Project not initialized | `/maestro-init` |
118
+ | Need formal spec package | `/maestro-blueprint --from brainstorm:{artifact_id}` |
119
+ | Quick roadmap needed | `/maestro-roadmap --from brainstorm:{artifact_id}` |
120
+ | Need deeper analysis first | `/maestro-analyze {topic} --from brainstorm:{artifact_id}` |
121
+ | Need stress-testing first | `/maestro-grill {topic}` |
122
+ | `html-prototypes/` produced with 2+ files and user wants to browse | Load `~/.maestro/workflows/brainstorm-visualize.md` and launch visualizer server |
123
+ | DESIGN.md established during Step 3.5 | `/maestro-impeccable build <feature-description>` |
124
+
125
+ **Single role mode:**
126
+
127
+ | Condition | Suggestion |
128
+ |-----------|-----------|
129
+ | More roles needed | `/maestro-brainstorm {next_role} --session {session_id}` |
130
+ | All roles done, run synthesis | `/maestro-brainstorm {topic} --session {session_id}` |
131
+ </completion>
132
+
98
133
  <error_codes>
99
134
  | Code | Severity | Condition | Recovery |
100
135
  |------|----------|-----------|----------|
@@ -18,6 +18,8 @@ allowed-tools:
18
18
  Execute all tasks in a plan using wave-based parallel execution with dependency-aware ordering. Each plan is executed independently (plans串行, plan内wave并行). Task summaries are written to the plan's scratch directory under `.summaries/`. Registers EXC artifact in state.json.
19
19
 
20
20
  Invoked after /maestro-plan produces a confirmed plan. When called without args on a milestone, finds all pending plans and executes them sequentially.
21
+
22
+ Pipeline position: upstream from maestro-plan (consumes confirmed plan), downstream to maestro-verify.
21
23
  </purpose>
22
24
 
23
25
  <required_reading>
@@ -32,7 +34,26 @@ Invoked after /maestro-plan produces a confirmed plan. When called without args
32
34
  <context>
33
35
  $ARGUMENTS — phase number, or no args for milestone-wide execution, with optional flags.
34
36
 
35
- Scope routing, flags, resolution logic, output directory format, artifact registration schema, and incremental knowhow extraction are defined in workflow `execute.md`.
37
+ ### Flags
38
+
39
+ | Flag | Effect | Default |
40
+ |------|--------|---------|
41
+ | `--auto-commit` | Auto-commit after each completed task | false |
42
+ | `--method agent\|cli\|auto` | Execution method: Agent tool, CLI delegate, or auto-select | `auto` |
43
+ | `--executor <tool>` | Explicit executor tool for CLI delegate mode | First enabled in config |
44
+ | `--dir <path>` | Execute a specific plan directory instead of auto-discovery | — |
45
+ | `-y` / `--yes` | Auto mode — skip interactive questions | false |
46
+
47
+ ### Scope routing
48
+
49
+ | Input | Scope | Resolution |
50
+ |-------|-------|------------|
51
+ | numeric arg | phase | Resolve plan from roadmap phase |
52
+ | `--dir <path>` | explicit | Use specified plan directory |
53
+ | no args + milestone | milestone | Find all pending plans, execute sequentially |
54
+ | no args + no milestone | error E001 | No plan found |
55
+
56
+ Full resolution logic, output directory format, artifact registration schema, and incremental knowhow extraction are defined in workflow `execute.md`.
36
57
 
37
58
  ### Pre-load context (before task execution)
38
59
 
@@ -83,7 +104,10 @@ For each completed/failed TASK with issue_id:
83
104
  Write updated issue back to issues.jsonl
84
105
  ```
85
106
 
86
- **Report format on completion:**
107
+ </execution>
108
+
109
+ <completion>
110
+ ### Standalone report
87
111
 
88
112
  ```
89
113
  === EXECUTION COMPLETE ===
@@ -93,24 +117,30 @@ Failed: {failed_count} tasks
93
117
 
94
118
  Summaries: {plan_dir}/.summaries/
95
119
  Tasks: {plan_dir}/.task/
96
-
97
- Next steps:
98
- /maestro-verify -- Verify execution results
99
- /maestro-verify --dir {dir} -- Verify specific plan
100
- /manage-status -- View project dashboard
101
120
  ```
102
121
 
103
- **Completion status:**
122
+ ### Ralph-invoked completion
123
+
124
+ End the step by calling the CLI (no text block output):
104
125
  ```
105
- --- COMPLETION STATUS ---
106
- STATUS: DONE|DONE_WITH_CONCERNS|NEEDS_RETRY
107
- CONCERNS: {failed_count} tasks failed (if any)
108
- NEXT: /maestro-verify
109
- --- END STATUS ---
126
+ maestro ralph complete <idx> --status {STATUS} [--evidence {path}]
110
127
  ```
111
128
 
112
- If failed tasks exist, suggest /quality-debug for investigation.
113
- </execution>
129
+ Status verdicts:
130
+ - **DONE** — Normal completion
131
+ - **DONE_WITH_CONCERNS** — Completed with caveats; pass `--concerns`
132
+ - **NEEDS_RETRY** — Tooling error / transient issue; ralph will retry
133
+ - **BLOCKED** — External hard blocker; pass `--reason`
134
+
135
+ ### Next-step routing
136
+
137
+ | Condition | Suggestion |
138
+ |-----------|-----------|
139
+ | All tasks completed successfully | `/maestro-verify` |
140
+ | Specific plan needs verification | `/maestro-verify --dir {dir}` |
141
+ | Failed tasks exist | `/quality-debug` |
142
+ | View project dashboard | `/manage-status` |
143
+ </completion>
114
144
 
115
145
  <error_codes>
116
146
  | Code | Severity | Condition | Recovery |
@@ -37,57 +37,82 @@ $ARGUMENTS -- topic/plan text for interactive mode, or --from source for upstrea
37
37
  - **Resume mode** (`-c` or `--session ID`): Continue from a previous grill session
38
38
 
39
39
  **Flags:**
40
- - `-y` / `--yes`: Auto mode — CLI exploration replaces human answers
41
- - `-c` / `--continue`: Resume from last grill session
42
- - `--session ID`: Resume specific session
43
- - `--depth shallow|standard|deep`: Branch count 3/5/8 (default: standard)
44
- - `--from <source>`: Load upstream material (`blueprint:ID`, `@file`, or path)
40
+
41
+ | Flag | Effect | Default |
42
+ |------|--------|---------|
43
+ | `-y` / `--yes` | Auto mode CLI exploration replaces human answers | `false` |
44
+ | `-c` / `--continue` | Resume from last grill session | — |
45
+ | `--session ID` | Resume specific session | — |
46
+ | `--depth shallow\|standard\|deep` | Branch count 3/5/8 | `standard` |
47
+ | `--from <source>` | Load upstream material (`blueprint:ID`, `@file`, or path) | — |
45
48
 
46
49
  **Output directory**: `.workflow/scratch/{YYYYMMDD}-grill-{slug}/`
47
50
  **Produced files**: `grill-report.md`, `terminology.md`, `context-package.json`
48
51
 
49
- ### Role Knowledge
50
- `maestro wiki search "{topic keywords}"` → load relevant entries before grilling.
51
- `maestro spec load --category arch` load architecture constraints.
52
+ ### Pre-load
53
+
54
+ 1. **Specs**: `maestro spec load --category arch` load architecture constraints
55
+ 2. **Wiki search**: `maestro wiki search "{topic keywords}"` → load relevant entries before grilling
56
+ 3. All optional — proceed without if unavailable
52
57
  </context>
53
58
 
54
59
  <interview_protocol>
55
- Grill the user relentlessly until every branch of the decision tree is walked. This is NOT a menu-driven interview — it is adversarial Socratic questioning. Active only in interactive mode; skip when `-y/--yes` or `-c/--continue`.
56
-
57
- Core protocol:
58
- - **One question per turn**. Each question probes ONE specific aspect. Never ask compound questions.
59
- - **Code-grounded**: Before asking, search the codebase for evidence. Use findings to sharpen the question or challenge the user's answer. Never ask what code can verify — search first, then confront.
60
- - **Escalating depth**: Start with scope boundaries, progress to data model, edge cases, failure modes. Each branch goes basic → specific → adversarial.
61
- - **Immediate writeback**: After each answered question, immediately append the Q&A + decision to `grill-report.md`. Do NOT batch — partial progress must be on disk before the next question.
62
- - **Challenge contradictions**: If an answer conflicts with code evidence or a prior answer, immediately surface the contradiction and demand resolution.
63
- - **Terminology enforcement**: When the user uses a term that conflicts with codebase naming, challenge it immediately. Propose the code-consistent alternative. Update `terminology.md` as terms crystallize.
64
-
65
- Question framing rules:
66
- - Reference specific code findings: "The codebase uses `{symbol}` at `{file:line}` — your proposal calls it `{term}`. Which wins?"
67
- - Use concrete scenarios: "What happens when a user does {action} while {condition} is true?"
68
- - Probe boundaries: "You said {X} is in scope — does that include {edge_case}, or is that separate?"
69
- - Challenge scale: "This touches `{table}` — at 10x current data volume, which query breaks first?"
70
-
71
- Branch walking order: Scope & Boundaries → Data Model & State → Edge Cases & Failure Modes → Integration & Dependencies → Scale & Performance → Security & Access Control → Observability & Operations → Migration & Rollback. Number of branches determined by `--depth`.
72
-
73
- Exit: When all depth-selected branches are fully walked (every question answered or explicitly deferred), finalize the report and generate context-package.json.
60
+ Follows @~/.maestro/workflows/interview-mechanics.md standard.
61
+
62
+ **Interaction mode override**: adversarial Socratic — NOT menu-driven
63
+ **Question style**:
64
+ - Reference specific code: "The codebase uses `{symbol}` at `{file:line}` your proposal calls it `{term}`. Which wins?"
65
+ - Concrete scenarios: "What happens when {action} while {condition}?"
66
+ - Challenge contradictions: immediately surface conflicts with code evidence or prior answers
67
+ - Escalating depth: per branch basic specific adversarial
68
+ **Branch traversal** (depth-gated, --depth controls count): Scope & Boundaries Data Model & State Edge Cases & Failure Modes Integration & Dependencies Scale & Performance → Security & Access Control → Observability & Operations → Migration & Rollback
69
+ **Writeback target**: grill-report.md (Q&A append per question) + terminology.md (term crystallization)
70
+ **Additional skip conditions**: none beyond standard (-y, -c)
71
+ **Exit condition**: all depth-selected branches fully walked finalize report + context-package.json
74
72
  </interview_protocol>
75
73
 
76
74
  <execution>
77
75
  Follow '~/.maestro/workflows/grill.md' completely.
78
-
79
- **Next-step routing on completion:**
80
-
81
- Standard routing:
82
- - Need multi-role elaboration → view_file(AbsolutePath="<agy-skills-dir>/maestro-brainstorm/SKILL.md") + execute inline (args: "{topic} --from grill:{artifact_id}")
83
- - Need deep technical analysis → view_file(AbsolutePath="<agy-skills-dir>/maestro-analyze/SKILL.md") + execute inline (args: "{topic} --from grill:{artifact_id}")
84
- - Scope is clear, ready for roadmap → view_file(AbsolutePath="<agy-skills-dir>/maestro-roadmap/SKILL.md") + execute inline (args: "--from grill:{artifact_id}")
85
- - Need formal spec package → view_file(AbsolutePath="<agy-skills-dir>/maestro-blueprint/SKILL.md") + execute inline (args: "--from grill:{artifact_id}")
86
-
87
- Resume routing:
88
- - More branches to walk → view_file(AbsolutePath="<agy-skills-dir>/maestro-grill/SKILL.md") + execute inline (args: "{topic} -c")
89
76
  </execution>
90
77
 
78
+ <completion>
79
+ ### Standalone report
80
+
81
+ ```
82
+ === GRILL READY ===
83
+ Topic: {topic}
84
+ Branches walked: {count}/{depth_target}
85
+ Decisions locked: {locked_count}
86
+ Open risks: {risk_count}
87
+ Output: {output_dir}
88
+ Artifact: GRL-{id}
89
+ === END GRILL ===
90
+ ```
91
+
92
+ ### Ralph-invoked completion
93
+
94
+ End the step by calling the CLI (no text block output):
95
+ ```
96
+ maestro ralph complete <idx> --status {STATUS} [--evidence {path}]
97
+ ```
98
+
99
+ Status verdicts:
100
+ - **DONE** — Normal completion
101
+ - **DONE_WITH_CONCERNS** — Completed with caveats; pass `--concerns`
102
+ - **NEEDS_RETRY** — Tooling error / transient issue; ralph will retry
103
+ - **BLOCKED** — External hard blocker; pass `--reason`
104
+
105
+ ### Next-step routing
106
+
107
+ | Condition | Suggestion |
108
+ |-----------|-----------|
109
+ | Need multi-role elaboration | `view_file(AbsolutePath="<agy-skills-dir>/maestro-brainstorm/SKILL.md") + execute inline (args: "{topic} --from grill:{artifact_id}")` |
110
+ | Need deep technical analysis | `view_file(AbsolutePath="<agy-skills-dir>/maestro-analyze/SKILL.md") + execute inline (args: "{topic} --from grill:{artifact_id}")` |
111
+ | Scope is clear, ready for roadmap | `view_file(AbsolutePath="<agy-skills-dir>/maestro-roadmap/SKILL.md") + execute inline (args: "--from grill:{artifact_id}")` |
112
+ | Need formal spec package | `view_file(AbsolutePath="<agy-skills-dir>/maestro-blueprint/SKILL.md") + execute inline (args: "--from grill:{artifact_id}")` |
113
+ | More branches to walk | `view_file(AbsolutePath="<agy-skills-dir>/maestro-grill/SKILL.md") + execute inline (args: "{topic} -c")` |
114
+ </completion>
115
+
91
116
  <error_codes>
92
117
  | Code | Severity | Condition | Recovery |
93
118
  |------|----------|-----------|----------|
@@ -15,28 +15,56 @@ allowed-tools:
15
15
  ---
16
16
  <purpose>
17
17
  Initialize a new project through auto state detection and unified flow. Invoked when starting a fresh project or onboarding an existing codebase into workflow management. Produces the `.workflow/` directory structure with project.md, state.json, config.json, and specs. Does NOT create roadmap — use maestro-roadmap (light mode, default) or maestro-roadmap --mode full (spec package) as the next step.
18
+
19
+ Pipeline position: entry point (no upstream). Downstream: `maestro-roadmap` or `maestro-brainstorm`.
18
20
  </purpose>
19
21
 
20
22
  <required_reading>
21
23
  @~/.maestro/workflows/init.md
22
- @~/.maestro/templates/project.md
23
- @~/.maestro/templates/state.json
24
- @~/.maestro/templates/config.json
25
24
  </required_reading>
26
25
 
26
+ <deferred_reading>
27
+ - [project.md](~/.maestro/templates/project.md) — read when generating project description
28
+ - [state.json](~/.maestro/templates/state.json) — read when creating initial state
29
+ - [config.json](~/.maestro/templates/config.json) — read when creating workflow configuration
30
+ </deferred_reading>
31
+
27
32
  <context>
33
+ $ARGUMENTS — none for interactive mode, or `-y` with `@file` reference for auto mode.
34
+
28
35
  **Flags:**
29
- - `-y` -- Automatic mode. After config questions, runs research without further interaction. Expects idea document via @ reference.
30
- - `--from <source>` -- Load upstream context package (brainstorm:ID, @file, or path). Consumes context-package.json to pre-fill project vision, goals, constraints, and terminology. Skips interactive questioning. Alias: `--from-brainstorm`
36
+
37
+ | Flag | Effect | Default |
38
+ |------|--------|---------|
39
+ | `-y` / `--yes` | Automatic mode. After config questions, runs research without further interaction. Expects idea document via @ reference. | `false` |
40
+ | `--from <source>` | Load upstream context package (brainstorm:ID, @file, or path). Consumes context-package.json to pre-fill project vision, goals, constraints, and terminology. Skips interactive questioning. Alias: `--from-brainstorm` | — |
31
41
 
32
42
  **Load project state if exists:**
33
43
  Check for `.workflow/state.json` -- loads context if project already initialized.
34
44
  </context>
35
45
 
46
+ <interview_protocol>
47
+ Follows @~/.maestro/workflows/interview-mechanics.md standard.
48
+
49
+ **Interaction mode**: convergent menu-driven
50
+ **Decision tree** (strict order): project type (greenfield / existing codebase onboarding) → tech stack detection and confirmation → directory structure preferences → initial configuration (specs categories, wiki bootstrap)
51
+ **Scope guard**: only init decisions; do not prejudge roadmap structure or plan scope
52
+ **Writeback target**: project.md (project description) + config.json (settings) + state.json (initial state)
53
+ **Additional skip conditions**: --from source (upstream context pre-fills decisions)
54
+ **Exit condition**: all configuration questions settled → proceed to workflow execution
55
+ </interview_protocol>
56
+
36
57
  <execution>
58
+ ### Pre-flight
59
+
60
+ 1. Check if `.workflow/` already exists — if so, load state and warn (E002 for greenfield conflicts)
61
+ 2. Validate `--from` source is accessible if provided
62
+
37
63
  Follow '~/.maestro/workflows/init.md' completely.
64
+ </execution>
38
65
 
39
- **Report format on completion:**
66
+ <completion>
67
+ ### Standalone report
40
68
 
41
69
  ```
42
70
  === WORKFLOW INITIALIZED ===
@@ -48,17 +76,31 @@ Created:
48
76
  .workflow/state.json
49
77
  .workflow/config.json
50
78
  .workflow/specs/
79
+ ```
51
80
 
52
- Next steps (choose one path to create roadmap):
53
- /maestro-roadmap <requirement> -- Direct interactive roadmap (light, default)
54
- /maestro-roadmap --mode full <idea> -- Full spec package + roadmap (heavy)
81
+ ### Ralph-invoked completion
55
82
 
56
- Other commands:
57
- /manage-status -- View project dashboard
58
- /maestro-brainstorm <topic> -- Explore ideas first
59
- /maestro-quick <task> -- Quick ad-hoc task
83
+ End the step by calling the CLI (no text block output):
60
84
  ```
61
- </execution>
85
+ maestro ralph complete <idx> --status {STATUS} [--evidence {path}]
86
+ ```
87
+
88
+ Status verdicts:
89
+ - **DONE** — Normal completion
90
+ - **DONE_WITH_CONCERNS** — Completed with caveats; pass `--concerns`
91
+ - **NEEDS_RETRY** — Tooling error / transient issue; ralph will retry
92
+ - **BLOCKED** — External hard blocker; pass `--reason`
93
+
94
+ ### Next-step routing
95
+
96
+ | Condition | Suggestion |
97
+ |-----------|-----------|
98
+ | Roadmap needed (default light) | `/maestro-roadmap <requirement>` |
99
+ | Full spec package + roadmap | `/maestro-roadmap --mode full <idea>` |
100
+ | Explore ideas first | `/maestro-brainstorm <topic>` |
101
+ | View project dashboard | `/manage-status` |
102
+ | Quick ad-hoc task | `/maestro-quick <task>` |
103
+ </completion>
62
104
 
63
105
  <error_codes>
64
106
  | Code | Severity | Condition | Recovery |
@@ -70,11 +112,11 @@ Other commands:
70
112
  </error_codes>
71
113
 
72
114
  <success_criteria>
73
- - [ ] Deep questioning completed (threads followed, not rushed) — or extracted from document/brainstorm
74
115
  - [ ] `.workflow/project.md` created with Core Value, Requirements (Validated/Active/Out of Scope), Key Decisions
75
116
  - [ ] `.workflow/state.json` created with artifacts[] array, initialized to idle state
76
117
  - [ ] `.workflow/config.json` created with workflow / execution / git / gates / codebase / guard / collab / specInjection / dashboard segments
77
118
  - [ ] `.workflow/specs/` initialized with convention files
78
- - [ ] Research completed (if enabled) 4 parallel agents spawned
79
- - [ ] User knows next step is `/maestro-roadmap` (light) or `/maestro-roadmap --mode full` (spec package)
119
+ - [ ] All interview decisions written to project.md / config.json before proceeding
120
+ - [ ] Research completed (if enabled) parallel agents spawned with results merged
121
+ - [ ] Next-step routing displayed in completion report
80
122
  </success_criteria>
@@ -23,6 +23,8 @@ Audit milestone completion using the artifact registry. Checks:
23
23
 
24
24
  Data source: `state.json.artifacts[]` filtered by current milestone.
25
25
  Produces audit report at `.workflow/milestones/{milestone}/audit-report.md`.
26
+
27
+ Pipeline position: downstream of maestro-verify (all phases verified), upstream of maestro-milestone-complete.
26
28
  </purpose>
27
29
 
28
30
  <required_reading>
@@ -40,19 +42,60 @@ Milestone: $ARGUMENTS (optional -- defaults to current_milestone from state.json
40
42
  - Plan scratch dirs — for task status verification
41
43
 
42
44
  **Adhoc milestone support (D-008):** When the target milestone has `type == "adhoc"` (or `type` field is missing, defaulting to `"standard"`), the audit skips roadmap.md parsing and phase coverage checks. It only validates artifact chain completeness (PLN→EXC exists) and runs integration checks.
45
+
46
+ ### Pre-load
47
+
48
+ 1. **Codebase docs**: IF `.workflow/codebase/doc-index.json` exists → Read ARCHITECTURE.md for integration checks
49
+ 2. **Specs**: `maestro spec load --category review` — load review standards for audit
50
+ 3. All optional — proceed without if unavailable
51
+
52
+ ### Role Knowledge
53
+
54
+ 1. Browse: `maestro wiki list --category review`
55
+ 2. Select entries relevant to milestone integration audit
56
+ 3. Load: `maestro wiki load <id1> [id2...]`
43
57
  </context>
44
58
 
45
59
  <execution>
46
60
  Follow '~/.maestro/workflows/milestone-audit.md' completely.
47
61
 
48
62
  Audit checklist steps (phase coverage, ad-hoc completeness, execution completeness, cross-artifact integration) are defined in workflow `milestone-audit.md`.
49
-
50
- **Next-step routing on completion:**
51
- - Verdict PASS → `/maestro-milestone-complete {milestone}`
52
- - Verdict FAIL, integration gaps → `/maestro-plan --gaps`
53
- - Verdict FAIL, incomplete execution → `/maestro-execute`
54
63
  </execution>
55
64
 
65
+ <completion>
66
+ ### Standalone report
67
+
68
+ ```
69
+ === MILESTONE AUDIT READY ===
70
+ Milestone: {milestone}
71
+ Verdict: {PASS|FAIL}
72
+ Phases audited: {N}
73
+ Integration gaps: {N}
74
+ Report: .workflow/milestones/{milestone}/audit-report.md
75
+ ```
76
+
77
+ ### Ralph-invoked completion
78
+
79
+ End the step by calling the CLI (no text block output):
80
+ ```
81
+ maestro ralph complete <idx> --status {STATUS} [--evidence .workflow/milestones/{milestone}/audit-report.md]
82
+ ```
83
+
84
+ Status verdicts:
85
+ - **DONE** — Audit passed, no gaps found
86
+ - **DONE_WITH_CONCERNS** — Audit passed with minor caveats; pass `--concerns`
87
+ - **NEEDS_RETRY** — Tooling error / transient issue; ralph will retry
88
+ - **BLOCKED** — External hard blocker; pass `--reason`
89
+
90
+ ### Next-step routing
91
+
92
+ | Condition | Suggestion |
93
+ |-----------|-----------|
94
+ | Verdict PASS | `/maestro-milestone-complete {milestone}` |
95
+ | Verdict FAIL, integration gaps | `/maestro-plan --gaps` |
96
+ | Verdict FAIL, incomplete execution | `/maestro-execute` |
97
+ </completion>
98
+
56
99
  <error_codes>
57
100
  | Code | Severity | Condition | Recovery |
58
101
  |------|----------|-----------|----------|
@@ -15,13 +15,23 @@ allowed-tools:
15
15
  ---
16
16
 
17
17
  <purpose>
18
- 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 knowhow, and advances to the next milestone.
18
+ Mark a milestone as complete after its audit has passed. Performs 6-step archival:
19
+ validation → directory archival → artifact history → knowhow extraction → state advancement → cleanup.
20
+
21
+ Produces `milestones/{M}/artifacts/` archive and `specs/learnings.md` knowhow entries.
22
+ Supports two milestone types: standard (advances to next milestone) and adhoc (self-contained, sets idle).
23
+
24
+ Pipeline position: downstream of `maestro-milestone-audit` (requires PASS verdict). Upstream of `maestro-milestone-release` (cut a release) or next milestone planning (`maestro-analyze` / `maestro-plan`).
19
25
  </purpose>
20
26
 
21
27
  <required_reading>
22
28
  @~/.maestro/workflows/milestone-complete.md
23
29
  </required_reading>
24
30
 
31
+ <deferred_reading>
32
+ - [state.json](~/.maestro/templates/state.json) — read when updating milestone_history and advancing state
33
+ </deferred_reading>
34
+
25
35
  <context>
26
36
  Milestone: $ARGUMENTS (optional -- defaults to current_milestone from state.json).
27
37
 
@@ -52,20 +62,52 @@ After knowhow extraction (step 4), scan `learnings.md` for promotion candidates:
52
62
 
53
63
  If user confirms promotion, invoke `view_file(AbsolutePath="<agy-skills-dir>/spec-add/SKILL.md") + execute inline (args: "<category> <content>")` with promoted content, preserving original date and source traceability.
54
64
 
55
- **Next-step routing on completion:**
56
- - Cut a release → `/maestro-milestone-release`
57
- - Next milestone → `/maestro-analyze` or `/maestro-plan 1` (standard milestones only)
58
- - View state → `/manage-status`
59
-
60
65
  **Adhoc milestone (D-008):** When completing an adhoc milestone, skip roadmap snapshot and do not advance to next milestone. Set `current_milestone = null`, `status = "idle"`. Adhoc milestones are self-contained — no successor in roadmap chain.
61
66
  </execution>
62
67
 
68
+ <completion>
69
+ ### Standalone report
70
+
71
+ ```
72
+ === MILESTONE COMPLETE ===
73
+ Milestone: {milestone_id}
74
+ Status: ARCHIVED
75
+ Artifacts archived: {count}
76
+ Knowhow extracted: {count} entries
77
+ Next milestone: {next_id | "none (adhoc)"}
78
+ ==============================
79
+ ```
80
+
81
+ ### Ralph-invoked completion
82
+
83
+ End the step by calling the CLI (no text block output):
84
+ ```
85
+ maestro ralph complete <idx> --status {STATUS} [--evidence {path}]
86
+ ```
87
+
88
+ Status verdicts:
89
+ - **DONE** — Normal completion
90
+ - **DONE_WITH_CONCERNS** — Completed with caveats; pass `--concerns`
91
+ - **NEEDS_RETRY** — Tooling error / transient issue; ralph will retry
92
+ - **BLOCKED** — External hard blocker; pass `--reason`
93
+
94
+ ### Next-step routing
95
+
96
+ | Condition | Suggestion |
97
+ |-----------|-----------|
98
+ | Cut a release | `/maestro-milestone-release` |
99
+ | Next milestone (standard) | `/maestro-analyze` or `/maestro-plan 1` |
100
+ | View state | `/manage-status` |
101
+ </completion>
102
+
63
103
  <error_codes>
64
104
  | Code | Severity | Condition | Recovery |
65
105
  |------|----------|-----------|----------|
66
106
  | E001 | error | Milestone identifier required | Check arguments |
67
107
  | E002 | error | Audit not passed | Run maestro-milestone-audit first |
68
108
  | E003 | error | Incomplete artifacts remain | Complete remaining work first |
109
+ | W001 | warning | Knowhow extraction produced 0 entries | Review milestone work for missed learnings |
110
+ | W002 | warning | Wiki-connect found unlinked knowledge islands | Run `/manage-wiki --fix` manually |
69
111
  </error_codes>
70
112
 
71
113
  <success_criteria>