maestro-flow-one 0.2.29 → 0.2.31

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 (49) hide show
  1. package/maestro-flow/commands/learn/follow.md +1 -1
  2. package/maestro-flow/commands/learn/investigate.md +2 -2
  3. package/maestro-flow/commands/learn/second-opinion.md +1 -1
  4. package/maestro-flow/commands/lifecycle/analyze.md +53 -2
  5. package/maestro-flow/commands/lifecycle/blueprint.md +36 -1
  6. package/maestro-flow/commands/lifecycle/brainstorm.md +40 -1
  7. package/maestro-flow/commands/lifecycle/collab.md +1 -1
  8. package/maestro-flow/commands/lifecycle/companion.md +4 -4
  9. package/maestro-flow/commands/lifecycle/composer.md +1 -1
  10. package/maestro-flow/commands/lifecycle/execute.md +29 -6
  11. package/maestro-flow/commands/lifecycle/fork.md +24 -0
  12. package/maestro-flow/commands/lifecycle/grill.md +38 -1
  13. package/maestro-flow/commands/lifecycle/impeccable.md +13 -0
  14. package/maestro-flow/commands/lifecycle/init.md +11 -0
  15. package/maestro-flow/commands/lifecycle/merge.md +17 -1
  16. package/maestro-flow/commands/lifecycle/next.md +8 -9
  17. package/maestro-flow/commands/lifecycle/overlay.md +3 -3
  18. package/maestro-flow/commands/lifecycle/plan.md +21 -3
  19. package/maestro-flow/commands/lifecycle/quick.md +13 -1
  20. package/maestro-flow/commands/lifecycle/roadmap.md +28 -2
  21. package/maestro-flow/commands/lifecycle/swarm-workflow.md +2 -2
  22. package/maestro-flow/commands/lifecycle/tools-register.md +2 -2
  23. package/maestro-flow/commands/lifecycle/ui-codify.md +20 -0
  24. package/maestro-flow/commands/lifecycle/update.md +59 -116
  25. package/maestro-flow/commands/manage/codebase-rebuild.md +3 -3
  26. package/maestro-flow/commands/manage/harvest.md +1 -1
  27. package/maestro-flow/commands/manage/knowhow-capture.md +3 -2
  28. package/maestro-flow/commands/manage/knowhow.md +3 -1
  29. package/maestro-flow/commands/manage/wiki.md +17 -8
  30. package/maestro-flow/commands/milestone/audit.md +34 -2
  31. package/maestro-flow/commands/milestone/complete.md +19 -1
  32. package/maestro-flow/commands/milestone/release.md +18 -0
  33. package/maestro-flow/commands/quality/auto-test.md +3 -3
  34. package/maestro-flow/commands/quality/debug.md +4 -4
  35. package/maestro-flow/commands/quality/refactor.md +2 -2
  36. package/maestro-flow/commands/quality/retrospective.md +5 -5
  37. package/maestro-flow/commands/quality/review.md +4 -4
  38. package/maestro-flow/commands/quality/sync.md +1 -0
  39. package/maestro-flow/commands/quality/test.md +4 -4
  40. package/maestro-flow/commands/spec/add.md +6 -4
  41. package/maestro-flow/commands/spec/setup.md +1 -1
  42. package/package.json +1 -1
  43. package/maestro-flow/commands/learn/retro.md +0 -157
  44. package/maestro-flow/commands/lifecycle/learn.md +0 -140
  45. package/maestro-flow/commands/lifecycle/verify.md +0 -144
  46. package/maestro-flow/commands/manage/codebase-refresh.md +0 -60
  47. package/maestro-flow/commands/manage/learn.md +0 -65
  48. package/maestro-flow/commands/wiki/connect.md +0 -62
  49. package/maestro-flow/commands/wiki/digest.md +0 -68
@@ -23,7 +23,7 @@ $ARGUMENTS — target and optional flags.
23
23
  |-------|-----------|
24
24
  | File path (contains `/` or `\`) | Read source file |
25
25
  | Wiki ID (`<type>-<slug>`) | `maestro wiki get <id>` |
26
- | Topic string | `maestro wiki search "<topic>"` → top result; fallback: Grep src/ |
26
+ | Topic string | `maestro search "<topic>"` → top result; fallback: Grep src/ |
27
27
 
28
28
  **Flags**:
29
29
  - `--depth shallow` (default): key patterns and structure only
@@ -30,7 +30,7 @@ $ARGUMENTS — question text and optional flags.
30
30
  - `.workflow/knowhow/KNW-investigate-{slug}/report.md` — final report
31
31
  - `.workflow/specs/learnings.md` — appended `<spec-entry>` blocks
32
32
 
33
- **Storage read**: source files in scope + `maestro wiki search` + `.workflow/specs/learnings.md` + `debug-notes.md` + `codebase/architecture.md`
33
+ **Storage read**: source files in scope + `maestro search` + `.workflow/specs/learnings.md` + `debug-notes.md` + `codebase/architecture.md`
34
34
  </context>
35
35
 
36
36
  <state_machine>
@@ -83,7 +83,7 @@ S_REPORT:
83
83
  ### A_FRAME_QUESTION
84
84
 
85
85
  1. Parse question, generate slug, create KNW-investigate-{slug}/
86
- 2. Search prior knowledge: `maestro wiki search "<question>"` + search .workflow/specs/learnings.md + read debug-notes.md
86
+ 2. Search prior knowledge: `maestro search "<question>"` + search .workflow/specs/learnings.md + read debug-notes.md
87
87
  3. Write initial understanding.md (question, prior knowledge summary, scope, timestamp)
88
88
 
89
89
  ### A_COLLECT_EVIDENCE
@@ -33,7 +33,7 @@ $ARGUMENTS — target and optional mode flag.
33
33
 
34
34
  **Flags**: `--mode review|challenge|consult` (default: review)
35
35
 
36
- **Pre-load** (optional): `Skill("spec-load")` for conventions + `maestro wiki search "<target topic>"` for related entries.
36
+ **Pre-load** (optional): `Skill("spec-load")` for conventions + `maestro search "<target topic>"` for related entries.
37
37
 
38
38
  **Output**: `.workflow/knowhow/KNW-opinion-{slug}-{YYYY-MM-DD}.md`
39
39
  </context>
@@ -71,11 +71,11 @@ Output directory format, artifact registration schema, and output artifact listi
71
71
 
72
72
  1. **Codebase docs**: IF `.workflow/codebase/doc-index.json` exists → Read ARCHITECTURE.md for module boundaries
73
73
  2. **Specs**: `maestro spec load --category arch` — load architecture constraints
74
- 3. **Wiki search**: `maestro wiki search "{topic keywords}" --json` → top 5-10 entries as prior knowledge
74
+ 3. **Wiki search**: `maestro search "{topic keywords}" --json` → top 5-10 entries as prior knowledge
75
75
  4. All optional — proceed without if unavailable (log warning)
76
76
 
77
77
  ### Role Knowledge
78
- `maestro wiki list --category debug` → select relevant → `maestro wiki load`
78
+ `maestro search --category debug` → select relevant → `maestro wiki load`
79
79
  </context>
80
80
 
81
81
  <interview_protocol>
@@ -93,6 +93,57 @@ Follows @~/.maestro/workflows/interview-mechanics.md standard.
93
93
  <execution>
94
94
  Follow '~/.maestro/workflows/analyze.md' completely.
95
95
 
96
+ ### Core Principle: Evidence-Backed Decisions
97
+
98
+ Every decision produced by this command MUST be traceable to independently gathered evidence. Manual file reading (Read/Grep by the orchestrator) is preparation, NOT evidence. Evidence comes from:
99
+ - cli-explore-agent output (code anchors, call chains, data flows)
100
+ - maestro delegate CLI analysis output (multi-perspective findings)
101
+ - User-provided input (domain knowledge, constraints, corrections)
102
+
103
+ A decision without at least one CLI/agent-sourced evidence item is LOW CONFIDENCE and MUST be flagged as such.
104
+
105
+ ### Standard Mode Phase Gates (when `-q` and `--gaps` are BOTH absent)
106
+
107
+ These gates are MANDATORY and BLOCKING. Do NOT advance past a gate until ALL conditions are met. Do NOT substitute manual Read/Grep for agent/CLI exploration.
108
+
109
+ **GATE 1: Step 4 → Step 5** (Exploration → Discussion)
110
+ - REQUIRED: cli-explore-agent spawned and completed (Step 4.1). Output written to `exploration-codebase.json` with ≥1 code anchor.
111
+ - REQUIRED: At least one maestro delegate CLI call completed (Step 4.2). Output aggregated into `explorations.json` or `perspectives.json`.
112
+ - REQUIRED: Baseline confidence scoring recorded in discussion.md (Step 4.6).
113
+ - BLOCKED if any missing: complete Step 4 before proceeding.
114
+
115
+ **GATE 2: Step 5 → Step 6** (Discussion → Scoring)
116
+ - REQUIRED: discussion.md contains ≥1 interactive round with user feedback (Step 5.3).
117
+ - REQUIRED: Confidence re-scored ≥1 time with delta shown (Step 5.8).
118
+ - REQUIRED: Pressure pass completed ≥1 time (Step 5.9).
119
+ - BLOCKED if any missing: continue discussion rounds.
120
+
121
+ **GATE 3: Step 6 → Step 7** (Scoring → Synthesis)
122
+ - REQUIRED: analysis.md written with all 6 dimensions scored.
123
+ - REQUIRED: Each dimension score cites evidence from exploration-codebase.json or explorations.json — NOT from orchestrator's manual file reading.
124
+ - BLOCKED if any missing: complete scoring first.
125
+
126
+ **GATE 4: Step 7 → Step 8** (Synthesis → Decision Extraction)
127
+ - REQUIRED: conclusions.json written with recommendations and decision trail.
128
+ - REQUIRED: Intent Coverage Matrix shows no unresolved ❌ items (or user-confirmed deferrals).
129
+ - BLOCKED if any missing: complete synthesis first.
130
+
131
+ ### Artifact Verification
132
+
133
+ Before writing the completion report (Step 9), verify ALL expected artifacts exist in OUTPUT_DIR:
134
+ ```
135
+ FULL_MODE_REQUIRED = [
136
+ "discussion.md", // Step 3+5
137
+ "exploration-codebase.json", // Step 4.1
138
+ "explorations.json" OR "perspectives.json", // Step 4.3
139
+ "analysis.md", // Step 6
140
+ "conclusions.json", // Step 7
141
+ "context.md", // Step 8
142
+ "context-package.json" // Step 8.6
143
+ ]
144
+ ```
145
+ If any artifact is missing: DO NOT report completion. Go back and produce the missing artifact.
146
+
96
147
  ### --gaps Mode (Issue Root Cause Analysis)
97
148
 
98
149
  When `--gaps` flag is present, follow `~/.maestro/workflows/issue-gaps-analyze.md` instead of the standard analyze pipeline:
@@ -64,7 +64,7 @@ maestro-analyze → maestro-roadmap → maestro-plan
64
64
  ### Pre-load
65
65
 
66
66
  1. **Specs**: `maestro spec load --category arch` — load architecture constraints for Phase 4 decisions
67
- 2. **Wiki search**: `maestro wiki search "{topic keywords}" --json` → prior knowledge context
67
+ 2. **Wiki search**: `maestro search "{topic keywords}" --json` → prior knowledge context
68
68
  3. All optional — proceed without if unavailable
69
69
  </context>
70
70
 
@@ -90,6 +90,41 @@ P0: Spec Study → P1: Discovery → P1.5: Req Expansion → P2: Product Brief
90
90
 
91
91
  P6 gate: Pass (>=80%) → Handoff | Review (60-79%) → Handoff w/caveats | Fail (<60%) → P6.5 Auto-Fix (max 2 iter) → re-check
92
92
 
93
+ ### Phase Gates (MANDATORY, BLOCKING)
94
+
95
+ Each phase produces artifacts that are prerequisites for the next. Do NOT advance past a gate without verifying the prior phase's output exists.
96
+
97
+ **GATE P0 → P1**: `blueprint-config.json` created with session metadata.
98
+ **GATE P1 → P1.5**: Discovery context gathered (codebase patterns, upstream context loaded).
99
+ **GATE P1.5 → P2**: Requirements expanded from discovery findings.
100
+ **GATE P2 → P3**: `product-brief.md` written with vision, goals, scope, multi-perspective synthesis.
101
+ **GATE P3 → P4**: `requirements/` directory with `_index.md` + individual `REQ-*.md` + `NFR-*.md` files. All requirements have RFC 2119 keywords and acceptance criteria.
102
+ **GATE P4 → P5**: `architecture/` directory with `_index.md` + individual `ADR-*.md` files.
103
+ **GATE P5 → P6**: `epics/` directory with `_index.md` + individual `EPIC-*.md` files. Cross-Epic dependency map present.
104
+ **GATE P6**: Readiness score computed. Pass (≥80%) or Review (≥60%) required for handoff.
105
+
106
+ ### Artifact Verification (before completion)
107
+
108
+ ```
109
+ REQUIRED_ARTIFACTS = [
110
+ "blueprint-config.json", // P0
111
+ "product-brief.md", // P2
112
+ "glossary.json", // P2 (≥5 terms)
113
+ "requirements/_index.md", // P3
114
+ "architecture/_index.md", // P4
115
+ "epics/_index.md", // P5
116
+ "readiness-report.md", // P6
117
+ "blueprint-summary.md", // P6
118
+ "context-package.json" // P6
119
+ ]
120
+ ```
121
+ If any artifact is missing: DO NOT report completion. Go back and produce it.
122
+
123
+ ### Evidence Requirement
124
+
125
+ Architecture Decision Records (ADR-*.md) MUST cite evidence for each decision:
126
+ - Valid: code analysis, requirement traceability (REQ-xxx), upstream context, CLI analysis output
127
+ - INVALID: generic rationale without reference to project-specific constraints
93
128
  </execution>
94
129
 
95
130
  <completion>
@@ -57,7 +57,7 @@ $ARGUMENTS -- topic text for auto mode, or role name for single role mode.
57
57
 
58
58
  ### Role Knowledge
59
59
  1. Browse accumulated knowledge for this role:
60
- `maestro wiki list --category arch`
60
+ `maestro search --category arch`
61
61
  2. Analyze the index, identify entries relevant to the current task
62
62
  3. Load selected documents:
63
63
  `maestro wiki load <id1> [id2] [id3...]`
@@ -77,6 +77,45 @@ Follows @~/.maestro/workflows/interview-mechanics.md standard.
77
77
 
78
78
  <execution>
79
79
  Follow '~/.maestro/workflows/brainstorm.md' completely.
80
+
81
+ ### Phase Gates (MANDATORY, BLOCKING)
82
+
83
+ These gates apply to Auto mode (full pipeline). Do NOT advance past a gate until ALL conditions are met.
84
+
85
+ **GATE 1: Framework → Role Analysis** (Step 1 → Step 3)
86
+ - REQUIRED: `guidance-specification.md` written with §10 feature decomposition and RFC 2119 keywords.
87
+ - REQUIRED: Role selection completed (interactive or auto-default).
88
+ - BLOCKED if missing: complete framework generation before spawning role agents.
89
+
90
+ **GATE 2: Role Analysis → Cross-Role Review** (Step 3 → Step 4.5)
91
+ - REQUIRED: Every selected role has `{role}/analysis.md` with §2 Decision Digest (4 tables).
92
+ - REQUIRED: Per-feature files `{role}/analysis-F-*.md` written for each feature in §10.
93
+ - BLOCKED if missing: complete all role analyses before spawning cross-role-reviewer.
94
+
95
+ **GATE 3: Cross-Role Review → Completion** (Step 4.5 → Report)
96
+ - REQUIRED: Cross-role-reviewer output received with `patch_targets[]`.
97
+ - REQUIRED: If findings > 0, resolutions applied via Edit AND logged in `guidance-specification.md` §12.
98
+ - REQUIRED: If findings == 0, final report explicitly states "No cross-role issues detected".
99
+ - BLOCKED if missing: complete review synthesis before reporting.
100
+
101
+ ### Artifact Verification (before completion report)
102
+
103
+ ```
104
+ AUTO_MODE_REQUIRED = [
105
+ "guidance-specification.md", // Step 1
106
+ "{role}/analysis.md" (per selected role), // Step 3
107
+ "{role}/analysis-F-*.md" (per feature), // Step 3
108
+ ]
109
+ ```
110
+ If any artifact is missing: DO NOT report completion. Go back and produce the missing artifact.
111
+
112
+ ### Evidence Requirement
113
+
114
+ Role analysis findings in `{role}/analysis.md` §2 Decision Digest MUST cite concrete evidence:
115
+ - Code references (file:line), API endpoints, data models from the codebase
116
+ - User-provided constraints from interview
117
+ - Cross-role references to other role analyses
118
+ Decisions without evidence are flagged LOW CONFIDENCE.
80
119
  </execution>
81
120
 
82
121
  <completion>
@@ -25,7 +25,7 @@ $ARGUMENTS — requirement text and optional flags.
25
25
  - `--rule <template>`: Shared rule template for all delegates
26
26
  - `-y`: Skip plan confirmation
27
27
 
28
- **Pre-load** (optional): `maestro spec load --category arch` + `maestro wiki list --category arch` → include in delegate prompts.
28
+ **Pre-load** (optional): `maestro spec load --category arch` + `maestro search --category arch` → include in delegate prompts.
29
29
 
30
30
  **Output**: `.workflow/scratch/{YYYYMMDD}-collab-{slug}/`
31
31
  - `collab-report.md` — merged findings with consensus/conflict/unique tags
@@ -114,7 +114,7 @@ Display loaded rules summary (entry count + key rule names).
114
114
  maestro knowhow list --store workflow
115
115
 
116
116
  # With --task: search relevant entries
117
- maestro knowhow search "<task_keyword>"
117
+ maestro search --type knowhow "<task_keyword>"
118
118
  ```
119
119
 
120
120
  Display available knowhow entries (ID + title). Hint: `maestro wiki load <id>` for details.
@@ -127,7 +127,7 @@ ls .workflow/codebase/doc-index.json
127
127
 
128
128
  - Exists → display "Codebase docs ready, last updated: {timestamp}"
129
129
  - Missing → suggest `/manage-codebase-rebuild`
130
- - Stale (>7 days) → suggest `/manage-codebase-refresh`
130
+ - Stale (>7 days) → suggest `/quality-sync`
131
131
 
132
132
  ### 4. Create companion document
133
133
 
@@ -341,7 +341,7 @@ Mid-task commands:
341
341
  /maestro-companion note "finding or decision"
342
342
  /maestro-companion note --file src/auth.ts "changed token validation"
343
343
  /spec-load --keyword <keyword>
344
- maestro wiki search "<query>"
344
+ maestro search "<query>"
345
345
  ```
346
346
 
347
347
  ---
@@ -470,7 +470,7 @@ Clear `.workflow/.scratchpad/.companion-active`.
470
470
 
471
471
  ```
472
472
  Knowledge accumulation reminders:
473
- Reusable pattern found? /spec-add <category> "title" "content"
473
+ Reusable pattern found? /spec-add <category> "title" "content" --description "summary"
474
474
  Solved a complex problem? /manage-knowhow-capture recipe "description"
475
475
  Made an architecture decision? /manage-knowhow-capture decision "description"
476
476
  Discovered a useful trick? /manage-knowhow-capture tip "content"
@@ -126,7 +126,7 @@ Read deferred `node-catalog.md` (fallback to built-in mapping):
126
126
  | review | `quality-review` |
127
127
  | brainstorm | `maestro-brainstorm` |
128
128
  | analysis | `maestro delegate --role analyze` |
129
- | verify | `maestro-verify` |
129
+ | verify | `maestro-execute` |
130
130
  | refactor | `quality-refactor` |
131
131
  | debug | `quality-debug` |
132
132
 
@@ -17,7 +17,7 @@ Execute all tasks in a plan using wave-based parallel execution with dependency-
17
17
 
18
18
  Invoked after /maestro-plan produces a confirmed plan. When called without args on a milestone, finds all pending plans and executes them sequentially.
19
19
 
20
- Pipeline position: upstream from maestro-plan (consumes confirmed plan), downstream to maestro-verify.
20
+ Pipeline position: upstream from maestro-plan (consumes confirmed plan). Verification is built-in (E2.7).
21
21
  </purpose>
22
22
 
23
23
  <required_reading>
@@ -56,13 +56,13 @@ Full resolution logic, output directory format, artifact registration schema, an
56
56
  ### Pre-load context (before task execution)
57
57
 
58
58
  1. **Codebase docs**: If `.workflow/codebase/doc-index.json` exists, read `ARCHITECTURE.md` for module boundaries. Pass as shared context to executor agents.
59
- 2. **Wiki knowledge**: Run `maestro wiki search "<phase keywords>" --json 2>/dev/null`. If results found, extract top 5 entries as prior knowledge context for agents.
59
+ 2. **Wiki knowledge**: Run `maestro search "<phase keywords>" --json 2>/dev/null`. If results found, extract top 5 entries as prior knowledge context for agents.
60
60
  3. **Coding specs + tools**: Run `maestro spec load --category coding` to load coding conventions AND discoverable knowhow tools (tool: true entries). Pass as specs context to all executor agents.
61
61
  4. **UI specs (conditional)**: If any task involves frontend/UI work (task scope/description contains keywords like component, page, style, layout, CSS, HTML, frontend; or focus_paths in `src/components/`, `src/pages/`, `src/styles/`, `src/ui/`), also run `maestro spec load --category ui` and include in agent context.
62
62
  5. All are optional — proceed without if unavailable (log warning).
63
63
 
64
64
  ### Role Knowledge
65
- `maestro wiki list --category coding` → select relevant → `maestro wiki load`
65
+ `maestro search --category coding` → select relevant → `maestro wiki load`
66
66
  </context>
67
67
 
68
68
  <execution>
@@ -76,6 +76,29 @@ If exit code is 1, present warnings and ask whether to proceed.
76
76
 
77
77
  Follow '~/.maestro/workflows/execute.md' completely.
78
78
 
79
+ ### Phase Gates (MANDATORY, BLOCKING)
80
+
81
+ **GATE 1: Plan Load → Task Execution**
82
+ - REQUIRED: plan.json found and parsed with valid task definitions.
83
+ - REQUIRED: `.task/TASK-*.json` files exist for all tasks in plan.
84
+ - BLOCKED if no pending tasks: error E004.
85
+
86
+ **GATE 2: Per-Task Execution → Summary**
87
+ - REQUIRED: Each completed task has `.summaries/TASK-{NNN}-summary.md` written with concrete evidence (files changed, tests run, verification results).
88
+ - REQUIRED: `.task/TASK-{NNN}.json` status updated to completed|blocked.
89
+ - Do NOT silently skip failed tasks — mark as blocked with reason.
90
+
91
+ **GATE 3: All Tasks → Completion**
92
+ - REQUIRED: All waves executed in dependency order.
93
+ - REQUIRED: EXC artifact registered in state.json.
94
+
95
+ ### Evidence Requirement
96
+
97
+ Task summaries MUST include:
98
+ - Files actually modified (not just planned targets)
99
+ - Convergence criteria verification results (pass/fail with evidence)
100
+ - Any deviations from the plan with rationale
101
+
79
102
  ### Post-task Knowledge Inquiry
80
103
 
81
104
  After each task completion, check triggers:
@@ -86,7 +109,8 @@ After each task completion, check triggers:
86
109
  | retry_count >= 2 | "Document fix pattern?" | spec-add debug |
87
110
  | Summary contains design rationale ("chose X because") | "Record as knowhow?" | spec-add learning |
88
111
 
89
- On confirm → `Skill("spec-add", "<category> <content>")`.
112
+ On confirm → `Skill("spec-add", "<category> <content> --description \"<summary>\"")`.
113
+ Include `--description` with a one-line summary for search result display.
90
114
 
91
115
  ### Issue Status Sync
92
116
 
@@ -134,8 +158,7 @@ Status verdicts:
134
158
 
135
159
  | Condition | Suggestion |
136
160
  |-----------|-----------|
137
- | All tasks completed successfully | `/maestro-verify` |
138
- | Specific plan needs verification | `/maestro-verify --dir {dir}` |
161
+ | All tasks completed successfully | `/quality-review` |
139
162
  | Failed tasks exist | `/quality-debug` |
140
163
  | View project dashboard | `/manage-status` |
141
164
  </completion>
@@ -42,6 +42,30 @@ Follow '~/.maestro/workflows/fork.md' completely.
42
42
 
43
43
  Fork and sync algorithm steps are defined in workflow `fork.md`.
44
44
 
45
+ ### Phase Gates (MANDATORY, BLOCKING)
46
+
47
+ **Fork mode:**
48
+
49
+ **GATE 1: Validation → Worktree Creation**
50
+ - REQUIRED: Milestone resolved from state.json.milestones[].
51
+ - REQUIRED: No existing active worktree for this milestone (E008).
52
+ - REQUIRED: Not running inside a worktree (E003).
53
+
54
+ **GATE 2: Worktree Creation → Artifact Copy**
55
+ - REQUIRED: Git worktree created with branch (`milestone/{slug}`).
56
+ - REQUIRED: Shared `.workflow/` files copied (project.md, roadmap.md, config.json, specs/).
57
+
58
+ **GATE 3: Artifact Copy → Completion**
59
+ - REQUIRED: `worktree-scope.json` written with milestone scope.
60
+ - REQUIRED: Scoped `state.json` written (only this milestone's artifacts).
61
+ - REQUIRED: `worktrees.json` registry updated in main worktree.
62
+
63
+ **Sync mode:**
64
+
65
+ **GATE: Sync → Completion**
66
+ - REQUIRED: Git merge main into worktree branch completed.
67
+ - REQUIRED: Shared artifacts re-copied.
68
+
45
69
  **Next-step routing on completion:**
46
70
 
47
71
  Fork mode:
@@ -50,7 +50,7 @@ $ARGUMENTS -- topic/plan text for interactive mode, or --from source for upstrea
50
50
  ### Pre-load
51
51
 
52
52
  1. **Specs**: `maestro spec load --category arch` — load architecture constraints
53
- 2. **Wiki search**: `maestro wiki search "{topic keywords}"` → load relevant entries before grilling
53
+ 2. **Wiki search**: `maestro search "{topic keywords}"` → load relevant entries before grilling
54
54
  3. All optional — proceed without if unavailable
55
55
  </context>
56
56
 
@@ -71,6 +71,43 @@ Follows @~/.maestro/workflows/interview-mechanics.md standard.
71
71
 
72
72
  <execution>
73
73
  Follow '~/.maestro/workflows/grill.md' completely.
74
+
75
+ ### Phase Gates (MANDATORY, BLOCKING)
76
+
77
+ **GATE 1: Setup → Branch Walking** (Step 1 → Step 2)
78
+ - REQUIRED: Topic parsed and output directory created.
79
+ - REQUIRED: Initial codebase scan completed — at least one code reference identified for grounding.
80
+ - BLOCKED if missing: cannot grill without code reality baseline.
81
+
82
+ **GATE 2: Branch Walking → Synthesis** (Step 2 → Step 3)
83
+ - REQUIRED: All depth-selected branches walked (shallow=3, standard=5, deep=8).
84
+ - REQUIRED: Each branch has ≥2 Q&A pairs with evidence (code reference or explicit user input).
85
+ - REQUIRED: Every locked decision has evidence — NOT just orchestrator inference.
86
+ - BLOCKED if branches incomplete: continue walking before synthesizing.
87
+
88
+ **GATE 3: Synthesis → Completion** (Step 3 → Report)
89
+ - REQUIRED: `grill-report.md` written with Branch Log table + all Q&A entries + synthesis section.
90
+ - REQUIRED: `terminology.md` written with ≥5 terms.
91
+ - REQUIRED: `context-package.json` generated.
92
+ - BLOCKED if any artifact missing: produce it before reporting completion.
93
+
94
+ ### Evidence Requirement
95
+
96
+ Grill questions MUST reference specific code when challenging the user's proposal:
97
+ - Valid: "The codebase uses `{symbol}` at `{file:line}` — your proposal calls it `{term}`. Which wins?"
98
+ - INVALID: Generic questions without code grounding (e.g., "How would you handle errors?")
99
+ - If codebase scan failed (W001): flag ALL subsequent locked decisions as LOW CONFIDENCE.
100
+
101
+ ### Artifact Verification (before completion)
102
+
103
+ ```
104
+ REQUIRED_ARTIFACTS = [
105
+ "grill-report.md", // Branch Log + Q&A + synthesis
106
+ "terminology.md", // ≥5 terms with code refs
107
+ "context-package.json" // Schema "context-package/1.0"
108
+ ]
109
+ ```
110
+ If any missing: DO NOT report completion. Go back and produce the missing artifact.
74
111
  </execution>
75
112
 
76
113
  <completion>
@@ -253,3 +253,16 @@ When findings lack explicit suggested command:
253
253
  | Personality, memorability | delight |
254
254
 
255
255
  Never auto-select: teach, shape, craft, live, document, extract, overdrive, critique, audit.
256
+
257
+ ## Chain Phase Gates (MANDATORY for chain mode)
258
+
259
+ **GATE: Quality Gate Step → Next Step**
260
+ - REQUIRED: Score parsed from critique/audit output (not assumed or estimated).
261
+ - REQUIRED: P0 count extracted from findings — P0 == 0 required for pass.
262
+ - REQUIRED: If gate fails, refine commands executed and re-gate attempted.
263
+ - Do NOT skip quality gate steps or mark as "passed" without parsing actual score.
264
+
265
+ **GATE: Chain → Completion**
266
+ - REQUIRED: All non-skipped steps executed (TodoWrite all completed).
267
+ - REQUIRED: status.json updated with `status: "completed"` and final scores.
268
+ - REQUIRED: If any step failed: documented in status.json with reason.
@@ -59,6 +59,17 @@ Follows @~/.maestro/workflows/interview-mechanics.md standard.
59
59
  2. Validate `--from` source is accessible if provided
60
60
 
61
61
  Follow '~/.maestro/workflows/init.md' completely.
62
+
63
+ ### Artifact Verification (before completion)
64
+
65
+ ```
66
+ REQUIRED_ARTIFACTS = [
67
+ ".workflow/project.md", // Core Value, Requirements, Key Decisions
68
+ ".workflow/state.json", // artifacts[], initialized to idle state
69
+ ".workflow/config.json" // Workflow configuration
70
+ ]
71
+ ```
72
+ If any artifact is missing: DO NOT report completion. Write the missing file first.
62
73
  </execution>
63
74
 
64
75
  <completion>
@@ -31,8 +31,24 @@ Flags (`-m`, `--force`, `--dry-run`, `--no-cleanup`, `--continue`), merge sequen
31
31
  <execution>
32
32
  Follow '~/.maestro/workflows/merge.md' completely.
33
33
 
34
+ ### Phase Gates (MANDATORY, BLOCKING)
35
+
36
+ **GATE 1: Pre-merge → Git Merge**
37
+ - REQUIRED: Registry health check completed (stale entries cleaned or flagged).
38
+ - REQUIRED: Pre-merge rebase successful (worktree has latest main).
39
+ - BLOCKED if rebase has conflicts: resolve in worktree first (W003).
40
+
41
+ **GATE 2: Git Merge → Artifact Sync**
42
+ - REQUIRED: Git merge completed without conflicts (or conflicts resolved via --continue).
43
+ - Do NOT sync artifacts until git merge succeeds — prevents partial state corruption.
44
+
45
+ **GATE 3: Artifact Sync → Completion**
46
+ - REQUIRED: All scratch artifacts synced to main `.workflow/scratch/`.
47
+ - REQUIRED: `state.json.artifacts[]` reconciled (worktree entries merged into main).
48
+ - REQUIRED: Worktree cleaned up (unless --no-cleanup).
49
+
34
50
  **Knowledge inquiry on completion:**
35
- After successful merge, ask user once: "Record milestone learnings?" If yes, persist via `Skill("spec-add", "learning \"<title>\" \"<insight>\" --keywords <kw1>,<kw2>")`.
51
+ After successful merge, ask user once: "Record milestone learnings?" If yes, persist via `Skill("spec-add", "learning \"<title>\" \"<insight>\" --keywords <kw1>,<kw2> --description \"<summary>\"")`.
36
52
 
37
53
  **Next-step routing on completion:**
38
54
  - View dashboard → Skill({ skill: "manage-status" })
@@ -112,8 +112,7 @@ ls -la .workflow/.maestro/ 2>$null | head -5 # 进行中的 session
112
112
  | 有 roadmap,未启动 phase | analyze | `maestro-analyze {phase}` |
113
113
  | 最新 artifact = analyze | plan | `maestro-plan {phase}` |
114
114
  | 最新 artifact = plan | execute | `maestro-execute {phase}` |
115
- | 最新 artifact = execute | verify | `maestro-verify {phase}` |
116
- | verify passed | review | `quality-review {phase}` |
115
+ | 最新 artifact = execute | review | `quality-review {phase}` |
117
116
  | review verdict=PASS | test-gen | `quality-auto-test {phase}` |
118
117
  | 测试全绿 | milestone-audit | `maestro-milestone-audit` |
119
118
  | 当前 milestone 全 phase 完成 | milestone-complete | `maestro-milestone-complete` |
@@ -122,7 +121,7 @@ ls -la .workflow/.maestro/ 2>$null | head -5 # 进行中的 session
122
121
  **Maestro Lifecycle 主线:**
123
122
  ```
124
123
  brainstorm → blueprint → init → analyze-macro → roadmap
125
- → [per phase] analyze → plan → execute verify
124
+ → [per phase] analyze → plan → execute (includes verification)
126
125
  → [quality gate] review → auto-test → test
127
126
  → milestone-audit → milestone-complete → milestone-release
128
127
  ```
@@ -157,19 +156,19 @@ brainstorm → blueprint → init → analyze-macro → roadmap
157
156
  | 分析 / analyze / 多维度调研 | `maestro-analyze` |
158
157
  | 规划 / plan / 任务分解 | `maestro-plan` |
159
158
  | 实现 / 执行 / execute | `maestro-execute` |
160
- | 验证 / verify / 验收 | `maestro-verify` |
159
+ | 验证 / verify / 验收 | `maestro-execute` |
161
160
  | 调试 / debug / 排查 / bug | `quality-debug` |
162
161
  | 审查 / review / 代码审查 | `quality-review` |
163
162
  | 测试 / test / UAT | `quality-test` / `quality-auto-test` |
164
163
  | 重构 / refactor / 技术债 | `quality-refactor` |
165
164
  | 同步文档 / sync docs | `quality-sync` |
166
- | 回顾 / retro | `quality-retrospective` / `learn-retro` |
165
+ | 回顾 / retro | `quality-retrospective` |
167
166
  | issue / 缺陷管理 | `manage-issue` / `manage-issue-discover` |
168
- | wiki / 知识图谱 | `manage-wiki` / `wiki-connect` / `wiki-digest` |
167
+ | wiki / 知识图谱 | `manage-wiki` (含 connect/digest 子命令) |
169
168
  | spec / 规则 / 约束 | `spec-load` / `spec-add` / `spec-setup` |
170
169
  | 项目初始化 / init | `maestro-init` |
171
170
  | 状态 / status / 仪表盘 | `manage-status` |
172
- | 文档重建 / codebase 文档 | `manage-codebase-rebuild` / `manage-codebase-refresh` |
171
+ | 文档重建 / codebase 文档 | `manage-codebase-rebuild` / `quality-sync` |
173
172
  | 安全 / security / OWASP | `security-audit` |
174
173
  | 跟读 / 学习 / 阅读源码 | `learn-follow` / `learn-investigate` |
175
174
  | 第二意见 / challenge / consult | `learn-second-opinion` |
@@ -185,9 +184,9 @@ brainstorm → blueprint → init → analyze-macro → roadmap
185
184
  |----|------|---------|
186
185
  | Learning | 接触新代码/未知模块 | `learn-follow` → `learn-decompose` → `learn-second-opinion` |
187
186
  | Knowledge | 提炼经验 / 沉淀知识 | `manage-harvest` → `manage-knowhow-capture` → `spec-add` |
188
- | Wiki | 知识图谱整理 | `manage-wiki` → `wiki-connect` → `wiki-digest` |
187
+ | Wiki | 知识图谱整理 | `manage-wiki health` → `manage-wiki connect` → `manage-wiki digest` |
189
188
  | Issue | 缺陷管理 | `manage-issue-discover` → `manage-issue` |
190
- | 文档同步 | 代码大改后 | `quality-sync` → `manage-codebase-refresh` |
189
+ | 文档同步 | 代码大改后 | `quality-sync` → `manage-codebase-rebuild` (if major) |
191
190
  | 重构 | 技术债积累 | `quality-refactor` → `quality-review` |
192
191
  | 发布 | 里程碑结束 | `maestro-milestone-audit` → `maestro-milestone-release` |
193
192
  | 并行开发 | 多 milestone 并行 | `maestro-fork` → ... → `maestro-merge` |
@@ -73,7 +73,7 @@ After confirming the injection point, ask whether this overlay should chain to a
73
73
 
74
74
  Use AskUserQuestion:
75
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`)
76
+ - **"Chain to skill"** → ask for the target skill name (e.g., `quality-review`, `maestro-execute`, `quality-test`)
77
77
  - **"Chain with alternatives"** → ask for primary skill + 1-2 alternative skills
78
78
 
79
79
  If chain is selected, record the skill name(s) for use in Step 3.
@@ -115,11 +115,11 @@ Build a slug from the user's intent (kebab-case, lowercase). Write to `~/.maestr
115
115
  After the above step completes, use AskUserQuestion:
116
116
  - "Proceed to /quality-review" — Hand off to quality review
117
117
  - "Skip" — Continue with current command flow
118
- - "Alternative: /maestro-verify" — Run verification instead
118
+ - "Alternative: /maestro-execute" — Run execution with built-in verification instead
119
119
 
120
120
  On user selection:
121
121
  - Proceed → Skill({ skill: "quality-review", args: "{phase}" })
122
- - Alternative → Skill({ skill: "maestro-verify", args: "{phase}" })
122
+ - Alternative → Skill({ skill: "maestro-execute", args: "{phase}" })
123
123
  - Skip → continue normally
124
124
  ```
125
125
 
@@ -59,7 +59,7 @@ Scope routing, base flags (`--collab`, `--spec`, `-y`, `--gaps`, `--dir`), outpu
59
59
  **Exception (`--from analyze:ANL-xxx` / `blueprint:BLP-xxx`):** When scope is set to "standalone" by `--from`, skip adhoc milestone auto-creation — the upstream analyze/blueprint artifact already provides the milestone context (or is intentionally milestone-free). Adhoc creation in this path would conflict with the `--from` semantic of "this is a one-shot plan rooted in an existing artifact".
60
60
 
61
61
  ### Role Knowledge
62
- `maestro wiki list --category arch` → select relevant → `maestro wiki load`
62
+ `maestro search --category arch` → select relevant → `maestro wiki load`
63
63
  </context>
64
64
 
65
65
  <execution>
@@ -73,6 +73,24 @@ If exit code is 1, present warnings and ask whether to proceed.
73
73
 
74
74
  Follow '~/.maestro/workflows/plan.md' completely.
75
75
 
76
+ ### Phase Gates (MANDATORY, BLOCKING — Create mode only)
77
+
78
+ **GATE P1 → P2**: Context collection completed — context files loaded, codebase docs read (if available), wiki searched.
79
+ **GATE P2 → P3**: Clarification completed — ambiguous requirements resolved via AskUserQuestion (≤3 rounds).
80
+ **GATE P3 → P4**: Plan generated by planner agent — `plan.json` + `.task/TASK-*.json` files written. Main flow inline planning is FORBIDDEN (see P3 Agent Constraint below).
81
+ **GATE P4 → P5**: Plan-checker passed (or minor issues acknowledged). Confidence scored. Pressure pass completed on highest-complexity task.
82
+ **GATE P5 → Completion**: User confirmation captured (execute/modify/cancel). PLN artifact registered in state.json.
83
+
84
+ ### Artifact Verification (before completion)
85
+
86
+ ```
87
+ REQUIRED_ARTIFACTS = [
88
+ "plan.json", // Task definitions, waves, summary
89
+ ".task/TASK-*.json" (per task) // Individual task files with convergence criteria
90
+ ]
91
+ ```
92
+ Every task MUST have `convergence.criteria[]` with grep-verifiable conditions. If any task lacks verifiable criteria: DO NOT report completion — fix the criteria first.
93
+
76
94
  ### P3 Agent Constraint (MANDATORY)
77
95
 
78
96
  Main flow **MUST** spawn a planner agent (Agent tool) for P3 planning — inline planning by main flow is FORBIDDEN. The agent produces both `plan.json` and `.task/TASK-*.json` files. Main flow only passes context and validates output.
@@ -95,7 +113,7 @@ During P1 Context Collection, after loading context files and before parallel ex
95
113
 
96
114
  ```
97
115
  phase_keywords = extract key terms from goal/title (2-5 terms)
98
- wiki_result = Bash("maestro wiki search ${phase_keywords} --json 2>/dev/null")
116
+ wiki_result = Bash("maestro search ${phase_keywords} --json 2>/dev/null")
99
117
 
100
118
  IF wiki_result exit code != 0 OR empty:
101
119
  display "W003: Wiki search unavailable, continuing without prior knowledge"
@@ -167,7 +185,7 @@ Status verdicts:
167
185
  | Code | Severity | Condition | Recovery |
168
186
  |------|----------|-----------|----------|
169
187
  | E001 | error | No args and no roadmap (cannot determine scope) | Provide phase number or topic, or create roadmap |
170
- | E003 | error | --gaps requires prior verification/issues to exist | Run maestro-verify first |
188
+ | E003 | error | --gaps requires prior verification/issues to exist | Run maestro-execute first (verification is built-in) |
171
189
  | E004 | error | No plan found to revise (--revise without target) | Use --dir to specify plan, or create plan first |
172
190
  | E005 | error | Plan directory not found (--check) | Check path, use --dir |
173
191
  | W001 | warning | Exploration agent returned incomplete results | Retry exploration or proceed with available context |