maestro-flow-one 0.2.34 → 0.2.35

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 (54) hide show
  1. package/maestro-flow/commands/learn/investigate.md +151 -152
  2. package/maestro-flow/commands/learn/second-opinion.md +118 -122
  3. package/maestro-flow/commands/lifecycle/analyze.md +215 -266
  4. package/maestro-flow/commands/lifecycle/blueprint.md +189 -204
  5. package/maestro-flow/commands/lifecycle/brainstorm.md +209 -213
  6. package/maestro-flow/commands/lifecycle/companion.md +531 -531
  7. package/maestro-flow/commands/lifecycle/composer.md +188 -179
  8. package/maestro-flow/commands/lifecycle/execute.md +183 -184
  9. package/maestro-flow/commands/lifecycle/fork.md +111 -110
  10. package/maestro-flow/commands/lifecycle/grill.md +175 -176
  11. package/maestro-flow/commands/lifecycle/guard.md +103 -102
  12. package/maestro-flow/commands/lifecycle/impeccable.md +311 -268
  13. package/maestro-flow/commands/lifecycle/init.md +130 -131
  14. package/maestro-flow/commands/lifecycle/merge.md +87 -80
  15. package/maestro-flow/commands/lifecycle/next.md +253 -257
  16. package/maestro-flow/commands/lifecycle/overlay.md +188 -178
  17. package/maestro-flow/commands/lifecycle/plan.md +225 -211
  18. package/maestro-flow/commands/lifecycle/quick.md +83 -77
  19. package/maestro-flow/commands/lifecycle/roadmap.md +173 -186
  20. package/maestro-flow/commands/lifecycle/swarm-workflow.md +243 -264
  21. package/maestro-flow/commands/lifecycle/tools-execute.md +122 -117
  22. package/maestro-flow/commands/lifecycle/tools-register.md +162 -157
  23. package/maestro-flow/commands/lifecycle/ui-codify.md +117 -100
  24. package/maestro-flow/commands/lifecycle/universal-workflow.md +548 -561
  25. package/maestro-flow/commands/lifecycle/update.md +122 -119
  26. package/maestro-flow/commands/manage/codebase-rebuild.md +87 -85
  27. package/maestro-flow/commands/manage/harvest.md +97 -95
  28. package/maestro-flow/commands/manage/issue-discover.md +83 -81
  29. package/maestro-flow/commands/manage/issue.md +72 -73
  30. package/maestro-flow/commands/manage/kg-extractors.md +128 -0
  31. package/maestro-flow/commands/manage/knowhow-capture.md +92 -82
  32. package/maestro-flow/commands/manage/knowhow.md +83 -79
  33. package/maestro-flow/commands/manage/knowledge-audit.md +105 -88
  34. package/maestro-flow/commands/manage/status.md +62 -52
  35. package/maestro-flow/commands/manage/wiki.md +82 -71
  36. package/maestro-flow/commands/milestone/audit.md +4 -10
  37. package/maestro-flow/commands/milestone/complete.md +6 -7
  38. package/maestro-flow/commands/milestone/release.md +136 -145
  39. package/maestro-flow/commands/quality/auto-test.md +153 -136
  40. package/maestro-flow/commands/quality/debug.md +159 -120
  41. package/maestro-flow/commands/quality/refactor.md +105 -67
  42. package/maestro-flow/commands/quality/retrospective.md +123 -77
  43. package/maestro-flow/commands/quality/review.md +155 -128
  44. package/maestro-flow/commands/quality/sync.md +88 -52
  45. package/maestro-flow/commands/quality/test.md +147 -117
  46. package/maestro-flow/commands/spec/add.md +77 -70
  47. package/maestro-flow/commands/spec/setup.md +49 -52
  48. package/package.json +1 -1
  49. package/maestro-flow/commands/lifecycle/odyssey-debug.md +0 -473
  50. package/maestro-flow/commands/lifecycle/odyssey-improve.md +0 -505
  51. package/maestro-flow/commands/lifecycle/odyssey-planex.md +0 -601
  52. package/maestro-flow/commands/lifecycle/odyssey-review-test-fix.md +0 -427
  53. package/maestro-flow/commands/lifecycle/odyssey-ui.md +0 -462
  54. package/maestro-flow/commands/lifecycle/security-audit.md +0 -179
@@ -1,266 +1,215 @@
1
- ---
2
- name: maestro-analyze
3
- description: Use when a topic needs structured multi-dimensional investigation before planning or decision-making
4
- argument-hint: "[phase|topic] [-y] [-c] [-q] [--gaps [ISS-ID]]"
5
- allowed-tools:
6
- - Read
7
- - Write
8
- - Edit
9
- - Bash
10
- - Glob
11
- - Grep
12
- - Agent
13
- - AskUserQuestion
14
- ---
15
- <purpose>
16
- Perform multi-dimensional analysis of a technical proposal, decision, or architecture choice through iterative CLI-assisted exploration and interactive discussion. Produces a discussion timeline (discussion.md) with evolving understanding, multi-perspective findings, Decision Recording Protocol, Intent Coverage tracking, and a final conclusions package with Go/No-Go recommendation.
17
-
18
- Combines structured 6-dimension scoring with iterative deepening and decision extraction. Replaces both analysis and decision-capture workflows — produces analysis.md (scoring) AND context.md (Locked/Free/Deferred decisions for plan).
19
-
20
- Use `-q` for quick decision extraction only (skip exploration + scoring).
21
-
22
- Use `--gaps` for issue-focused root cause analysis (replaces manage-issue-analyze). Loads issues from issues.jsonl, performs CLI exploration against issue context/location, synthesizes root cause into issue.analysis, and outputs context.md for downstream `plan --gaps`.
23
-
24
- Pipeline position: downstream of maestro-grill, maestro-brainstorm, and maestro-blueprint (optional upstream enrichment); upstream of maestro-plan and maestro-roadmap (consumes analysis context).
25
- </purpose>
26
-
27
- <required_reading>
28
- @~/.maestro/workflows/analyze.md
29
- </required_reading>
30
-
31
- <deferred_reading>
32
- - [state.json](~/.maestro/templates/state.json) read when registering artifact
33
- - [issue-gaps-analyze.md](~/.maestro/workflows/issue-gaps-analyze.md) read when --gaps is triggered
34
- </deferred_reading>
35
-
36
- <context>
37
- $ARGUMENTS -- phase number for micro mode, topic text for macro/adhoc mode, no args for milestone-wide.
38
-
39
- **Dual-layer mode:**
40
- - **Macro mode** (text argument): Explore impact surface of a topic/requirement. Produces coarse-grained context with `scope_verdict` to route next step. Use before roadmap or for standalone analysis.
41
- - **Micro mode** (numeric argument): Phase-level deep analysis within an existing roadmap. Produces fine-grained context for plan consumption. `analyze 1` = Phase 1 of current milestone.
42
-
43
- **Disambiguation rule (mode selection):**
44
- - First positional arg matches `^\d+$` (pure digits, e.g. `1`, `42`) → **micro mode** (treat as phase number)
45
- - First positional arg is non-numeric text (e.g. `auth-refactor`, `improve search`) **macro mode** (treat as topic)
46
- - No positional arg milestone-wide micro mode (when roadmap present) else macro fallback
47
- - Mixed input like `"1 phase"` is treated as text macro mode (only bare numerics trigger micro)
48
-
49
- **Flags:**
50
-
51
- | Flag | Effect | Default |
52
- |------|--------|---------|
53
- | `-y` / `--yes` | Auto mode — skip interactive scoping, use recommended defaults, auto-deepen | false |
54
- | `-c` / `--continue` | Resume from existing session (auto-detect session folder + discussion.md) | false |
55
- | `-q` / `--quick` | Quick mode skip exploration + scoring, go straight to decision extraction (context.md only) | false |
56
- | `--from <source>` | Load upstream context package (grill:ID, brainstorm:ID, blueprint:BLP-xxx, @file, or path) | — |
57
- | `--gaps [ISS-ID]` | Issue root cause analysis mode. If ISS-ID provided, analyze single issue. If omitted, analyze all open/registered issues from issues.jsonl | |
58
-
59
- **Scope routing:**
60
- | Input | Mode | Scope |
61
- |-------|------|-------|
62
- | Pure digits (e.g. `1`, `42`) | micro | Phase-level deep analysis |
63
- | Non-numeric text (e.g. `auth-refactor`) | macro | Topic impact surface |
64
- | No positional arg + roadmap | micro | Milestone-wide |
65
- | No positional arg + no roadmap | macro | Fallback |
66
- | `--gaps [ISS-ID]` | gaps | Issue root cause analysis |
67
-
68
- Output directory format, artifact registration schema, and output artifact listing are defined in workflow analyze.md (Output Structure section).
69
-
70
- ### Pre-load
71
-
72
- 1. **Codebase docs**: IF `.workflow/codebase/doc-index.json` exists → Read ARCHITECTURE.md for module boundaries
73
- 2. **Specs**: `maestro spec load --category arch` — load architecture constraints
74
- 3. **Wiki search**: `maestro search "{topic keywords}" --json` → top 5-10 entries as prior knowledge
75
- 4. All optional — proceed without if unavailable (log warning)
76
-
77
- ### Role Knowledge
78
- `maestro search --category debug` select relevant `maestro wiki load`
79
- </context>
80
-
81
- <interview_protocol>
82
- Follows @~/.maestro/workflows/interview-mechanics.md standard.
83
-
84
- **Interaction mode**: convergent menu-driven
85
- **Decision tree** (strict order): scope (phase / topic / milestone-wide / adhoc / --gaps) → depth (quick / standard / deep) → dimensions (which of the 6 to keep) → Go/No-Go threshold
86
- **Scope guard**: only analyze decisions; do not prejudge plan/execute concerns
87
- **Writeback target**: discussion.md (top table) + context.md "Interview Decisions"
88
- **Additional search sources**: issues.jsonl (--gaps mode), roadmap.md
89
- **Additional skip conditions**: input is already specific (explicit phase number or unambiguous topic)
90
- **Exit condition**: all decision points settled finalize session metadata
91
- </interview_protocol>
92
-
93
- <execution>
94
- Follow '~/.maestro/workflows/analyze.md' completely.
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
-
147
- ### --gaps Mode (Issue Root Cause Analysis)
148
-
149
- When `--gaps` flag is present, follow `~/.maestro/workflows/issue-gaps-analyze.md` instead of the standard analyze pipeline:
150
-
151
- ```
152
- Phase 1: Load issues from .workflow/issues/issues.jsonl
153
- - If ISS-ID provided: load single issue
154
- - If no ISS-ID: filter issues where status = open | registered
155
- - Validate: at least 1 issue loaded, else error E_NO_ISSUES
156
-
157
- Phase 2: CLI exploration per issue
158
- - For each issue: build exploration prompt from issue.title, description, context, related_files
159
- - Run maestro delegate --role analyze --mode analysis with codebase context
160
- - Gather affected files, call chains, root cause evidence
161
-
162
- Phase 3: Root cause synthesis write issue.analysis
163
- - Parse CLI output into analysis record: { root_cause, affected_files, impact_scope, fix_direction, confidence, analyzed_at, tool, depth }
164
- - Write analysis record to issue in issues.jsonl
165
- - Append history entry: { action: "analyzed", at: <ISO>, by: "maestro-analyze --gaps" }
166
-
167
- Phase 4: Output context.md for downstream plan --gaps
168
- - Aggregate all analyzed issues into context.md with root causes and fix directions
169
- - Register ANL artifact in state.json
170
- ```
171
-
172
- **Handoff:** context.md is consumed by maestro-plan (loads Locked/Free/Deferred decisions). In --gaps mode, context.md contains issue root causes for `plan --gaps` consumption.
173
-
174
- **scope_verdict** (added to context.md in Step 6 Synthesis for macro/adhoc/standalone scopes):
175
- - `large` (3+ independent subsystems or hard serial dependencies) → suggest `/maestro-roadmap --from analyze:ANL-xxx`
176
- - `medium` (1-2 subsystems, parallelizable) → suggest `/maestro-plan --from analyze:ANL-xxx`
177
- - `small` (single-file or few-file change) suggest `/maestro-plan --from analyze:ANL-xxx`
178
- </execution>
179
-
180
- <completion>
181
- ### Standalone report
182
-
183
- ```
184
- === ANALYSIS READY ===
185
- Artifact: ANL-{id}
186
- Scope: {micro|macro|adhoc|gaps}
187
- Go/No-Go: {GO|NO-GO|CONDITIONAL}
188
- Confidence: {high|medium|low}
189
- Outputs: analysis.md, context.md, conclusions.json, discussion.md
190
- Session dir: {output_dir}
191
- ===
192
- ```
193
-
194
- ### Ralph-invoked completion
195
-
196
- End the step by calling the CLI (no text block output):
197
- ```
198
- maestro ralph complete <idx> --status {STATUS} [--evidence {path}]
199
- ```
200
-
201
- Status verdicts:
202
- - **DONE** Normal completion
203
- - **DONE_WITH_CONCERNS** — Completed with caveats; pass `--concerns`
204
- - **NEEDS_RETRY** Tooling error / transient issue; ralph will retry
205
- - **BLOCKED** External hard blocker; pass `--reason`
206
-
207
- ### Next-step routing
208
-
209
- | Condition | Suggestion |
210
- |-----------|-----------|
211
- | Phase/Milestone scope, Go, UI work needed | `/maestro-impeccable build {target}` |
212
- | Phase/Milestone scope, Go, ready to plan | `/maestro-plan` or `/maestro-plan {phase}` |
213
- | Phase/Milestone scope, No-Go | Revisit requirements or `/maestro-brainstorm {topic}` |
214
- | Macro/Adhoc, scope_verdict = large | `/maestro-roadmap --from analyze:ANL-xxx` |
215
- | Macro/Adhoc, scope_verdict = medium/small | `/maestro-plan --from analyze:ANL-xxx` |
216
- | Need more exploration | `/maestro-analyze {topic} -c` |
217
- | Gaps scope, issues analyzed | `/maestro-plan --gaps` |
218
- | Gaps scope, need more context | `/maestro-analyze --gaps {ISS-ID}` |
219
-
220
- ### Session seal
221
-
222
- @~/.maestro/workflows/finish-work.md — SESSION_DIR=OUTPUT_DIR, SESSION_TYPE=analyze, SESSION_ID={artifact_id}, LINKED_MILESTONE={target_milestone or null}
223
- </completion>
224
-
225
- <error_codes>
226
- | Code | Severity | Condition | Recovery |
227
- |------|----------|-----------|----------|
228
- | E001 | error | No args and no roadmap (cannot determine scope) | Prompt user for topic text or create roadmap first |
229
- | W001 | warning | CLI exploration failed | Continue with available context, note limitation |
230
- | W002 | warning | CLI analysis timeout | Retry with shorter prompt, or skip perspective |
231
- | W003 | warning | Insufficient evidence for scoring dimensions | Note low-confidence dimensions, proceed with available evidence |
232
- | W004 | warning | Max rounds reached (5) | Force synthesis, offer continuation option |
233
- | E_NO_ISSUES | error | --gaps but no open/registered issues found | Suggest `/manage-issue-discover` or `/manage-issue create` |
234
- | E_ISSUE_NOT_FOUND | error | --gaps with ISS-ID but issue not found | Suggest `/manage-issue list` to find valid IDs |
235
- </error_codes>
236
-
237
- <success_criteria>
238
- Full mode:
239
- - [ ] CLI exploration completed with code anchors and call chains
240
- - [ ] discussion.md created with full timeline, TOC, Current Understanding
241
- - [ ] analysis.md written with all 6 dimensions scored with evidence
242
- - [ ] conclusions.json created with recommendations and decision trail
243
- - [ ] Intent Coverage tracked and verified (no unresolved ❌ items)
244
- - [ ] Confidence tracking initialized (Step 4.6) and re-scored each round (Step 5.8)
245
- - [ ] Readiness gate checked before synthesis (Step 5.10)
246
- - [ ] Pressure pass completed ≥ 1 time before Step 6
247
- - [ ] Confidence summary with factor decomposition written to analysis.md
248
-
249
- Gaps mode:
250
- - [ ] Issues loaded from issues.jsonl (all open/registered, or single ISS-ID)
251
- - [ ] CLI exploration executed per issue with codebase context
252
- - [ ] Analysis record attached to each issue in issues.jsonl
253
- - [ ] context.md written with aggregated root causes for plan --gaps
254
-
255
- Both modes (full + quick):
256
- - [ ] Interactive mode: interview decision table written to `discussion.md` and mirrored into `context.md` "Interview Decisions"
257
- - [ ] context.md written with all decisions classified as Locked/Free/Deferred
258
- - [ ] Gray areas identified through phase-specific analysis
259
- - [ ] Decision Recording Protocol applied to all decisions
260
- - [ ] Scope creep redirected to Deferred section
261
- - [ ] Deferred items auto-created as issues (if any)
262
- - [ ] Artifact registered in state.json with correct scope/milestone/phase
263
- - [ ] Next step routed (impeccable/plan for Go, brainstorm for No-Go)
264
- - [ ] Session sealed via finish-work (archive.json written, optional spec/knowhow extraction)
265
- </success_criteria>
266
-
1
+ ---
2
+ name: maestro-analyze
3
+ description: Use when a topic needs structured multi-dimensional investigation before planning or decision-making
4
+ argument-hint: "[phase|topic] [-y] [-c] [-q] [--gaps [ISS-ID]]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ - Agent
13
+ - AskUserQuestion
14
+ ---
15
+ <purpose>
16
+ Multi-dimensional analysis of a proposal, decision, or architecture choice via CLI-assisted exploration and interactive discussion. Produces analysis.md (6-dimension scoring), context.md (Locked/Free/Deferred decisions), conclusions.json, and discussion.md with Go/No-Go recommendation. Use `--gaps` for issue root cause analysis feeding `plan --gaps`.
17
+ </purpose>
18
+
19
+ <required_reading>
20
+ @~/.maestro/workflows/analyze.md
21
+ </required_reading>
22
+
23
+ <deferred_reading>
24
+ - [state.json](~/.maestro/templates/state.json) read when registering artifact
25
+ - [issue-gaps-analyze.md](~/.maestro/workflows/issue-gaps-analyze.md) — read when --gaps is triggered
26
+ </deferred_reading>
27
+
28
+ <context>
29
+ $ARGUMENTS -- phase number for micro mode, topic text for macro/adhoc mode, no args for milestone-wide.
30
+
31
+ **Dual-layer mode:**
32
+ - **Macro mode** (text argument): Explore impact surface of a topic/requirement. Produces coarse-grained context with `scope_verdict` to route next step. Use before roadmap or for standalone analysis.
33
+ - **Micro mode** (numeric argument): Phase-level deep analysis within an existing roadmap. Produces fine-grained context for plan consumption. `analyze 1` = Phase 1 of current milestone.
34
+
35
+ **Disambiguation rule (mode selection):**
36
+ - First positional arg matches `^\d+$` (pure digits, e.g. `1`, `42`) → **micro mode** (treat as phase number)
37
+ - First positional arg is non-numeric text (e.g. `auth-refactor`, `improve search`) → **macro mode** (treat as topic)
38
+ - No positional arg → milestone-wide micro mode (when roadmap present) else macro fallback
39
+ - Mixed input like `"1 phase"` is treated as text → macro mode (only bare numerics trigger micro)
40
+
41
+ **Flags:**
42
+
43
+ | Flag | Effect | Default |
44
+ |------|--------|---------|
45
+ | `-y` / `--yes` | Auto mode skip interactive scoping, use recommended defaults, auto-deepen | false |
46
+ | `-c` / `--continue` | Resume from existing session (auto-detect session folder + discussion.md) | false |
47
+ | `-q` / `--quick` | Quick mode skip exploration + scoring, go straight to decision extraction (context.md only) | false |
48
+ | `--from <source>` | Load upstream context package (grill:ID, brainstorm:ID, blueprint:BLP-xxx, @file, or path) | — |
49
+ | `--gaps [ISS-ID]` | Issue root cause analysis mode. If ISS-ID provided, analyze single issue. If omitted, analyze all open/registered issues from issues.jsonl | — |
50
+
51
+ **Scope routing:**
52
+ | Input | Mode | Scope |
53
+ |-------|------|-------|
54
+ | Pure digits (e.g. `1`, `42`) | micro | Phase-level deep analysis |
55
+ | Non-numeric text (e.g. `auth-refactor`) | macro | Topic impact surface |
56
+ | No positional arg + roadmap | micro | Milestone-wide |
57
+ | No positional arg + no roadmap | macro | Fallback |
58
+ | `--gaps [ISS-ID]` | gaps | Issue root cause analysis |
59
+
60
+ Output directory format, artifact registration schema, and output artifact listing are defined in workflow analyze.md (Output Structure section).
61
+
62
+ ### Pre-load
63
+
64
+ 1. **Codebase docs**: IF `.workflow/codebase/doc-index.json` exists Read ARCHITECTURE.md for module boundaries
65
+ 2. **Specs**: `maestro spec load --category arch` load architecture constraints
66
+ 3. **Wiki search**: `maestro search "{topic keywords}" --json` top 5-10 entries as prior knowledge
67
+ 4. All optional — proceed without if unavailable (log warning)
68
+
69
+ ### Role Knowledge
70
+ `maestro search --category debug` → select relevant → `maestro wiki load`
71
+ </context>
72
+
73
+ <interview_protocol>
74
+ Follows @~/.maestro/workflows/interview-mechanics.md standard.
75
+
76
+ **Interaction mode**: convergent menu-driven
77
+ **Decision tree** (strict order): scope (phase / topic / milestone-wide / adhoc / --gaps) → depth (quick / standard / deep) → dimensions (which of the 6 to keep) → Go/No-Go threshold
78
+ **Scope guard**: only analyze decisions; do not prejudge plan/execute concerns
79
+ **Writeback target**: discussion.md (top table) + context.md "Interview Decisions"
80
+ **Additional search sources**: issues.jsonl (--gaps mode), roadmap.md
81
+ **Additional skip conditions**: input is already specific (explicit phase number or unambiguous topic)
82
+ **Exit condition**: all decision points settled → finalize session metadata
83
+ </interview_protocol>
84
+
85
+ <execution>
86
+ Follow '~/.maestro/workflows/analyze.md' completely.
87
+
88
+ ### Evidence-Backed Decisions
89
+
90
+ Every decision MUST trace to independently gathered evidence. Manual Read/Grep is preparation — NOT evidence. Valid evidence sources:
91
+ - cli-explore-agent output (code anchors, call chains, data flows)
92
+ - maestro delegate CLI analysis output (multi-perspective findings)
93
+ - User-provided input (domain knowledge, constraints, corrections)
94
+
95
+ Decisions without CLI/agent-sourced evidence MUST be flagged as LOW CONFIDENCE.
96
+
97
+ ### Standard Mode Gates
98
+
99
+ Gates 1-4 are defined in `analyze.md`. NEVER skip gates. NEVER substitute manual Read/Grep for agent/CLI exploration.
100
+
101
+ ### Artifact Verification
102
+
103
+ Before writing the completion report (Step 9), verify ALL expected artifacts exist in OUTPUT_DIR:
104
+ ```
105
+ FULL_MODE_REQUIRED = [
106
+ "discussion.md", // Step 3+5
107
+ "exploration-codebase.json", // Step 4.1
108
+ "explorations.json" OR "perspectives.json", // Step 4.3
109
+ "analysis.md", // Step 6
110
+ "conclusions.json", // Step 7
111
+ "context.md", // Step 8
112
+ "context-package.json" // Step 8.6
113
+ ]
114
+ ```
115
+ If any artifact is missing: DO NOT report completion. Produce the missing artifact first.
116
+
117
+ ### --gaps Mode
118
+
119
+ When `--gaps` is present, follow `~/.maestro/workflows/issue-gaps-analyze.md` instead of the standard pipeline.
120
+
121
+ **Handoff:** context.md is consumed by maestro-plan. In --gaps mode, context.md contains issue root causes for `plan --gaps`.
122
+
123
+ **scope_verdict** (added to context.md in Step 6 Synthesis for macro/adhoc/standalone scopes):
124
+ - `large` (3+ independent subsystems or hard serial dependencies) → suggest `/maestro-roadmap --from analyze:ANL-xxx`
125
+ - `medium` (1-2 subsystems, parallelizable) → suggest `/maestro-plan --from analyze:ANL-xxx`
126
+ - `small` (single-file or few-file change) suggest `/maestro-plan --from analyze:ANL-xxx`
127
+ </execution>
128
+
129
+ <completion>
130
+ ### Standalone report
131
+
132
+ ```
133
+ === ANALYSIS READY ===
134
+ Artifact: ANL-{id}
135
+ Scope: {micro|macro|adhoc|gaps}
136
+ Go/No-Go: {GO|NO-GO|CONDITIONAL}
137
+ Confidence: {high|medium|low}
138
+ Outputs: analysis.md, context.md, conclusions.json, discussion.md
139
+ Session dir: {output_dir}
140
+ ===
141
+ ```
142
+
143
+ ### Ralph-invoked completion
144
+
145
+ End the step by calling the CLI (no text block output):
146
+ ```
147
+ maestro ralph complete <idx> --status {STATUS} [--evidence {path}]
148
+ ```
149
+
150
+ Status verdicts:
151
+ - **DONE** — Normal completion
152
+ - **DONE_WITH_CONCERNS** Completed with caveats; pass `--concerns`
153
+ - **NEEDS_RETRY** Tooling error / transient issue; ralph will retry
154
+ - **BLOCKED** External hard blocker; pass `--reason`
155
+
156
+ ### Next-step routing
157
+
158
+ | Condition | Suggestion |
159
+ |-----------|-----------|
160
+ | Phase/Milestone scope, Go, UI work needed | `/maestro-impeccable build {target}` |
161
+ | Phase/Milestone scope, Go, ready to plan | `/maestro-plan` or `/maestro-plan {phase}` |
162
+ | Phase/Milestone scope, No-Go | Revisit requirements or `/maestro-brainstorm {topic}` |
163
+ | Macro/Adhoc, scope_verdict = large | `/maestro-roadmap --from analyze:ANL-xxx` |
164
+ | Macro/Adhoc, scope_verdict = medium/small | `/maestro-plan --from analyze:ANL-xxx` |
165
+ | Need more exploration | `/maestro-analyze {topic} -c` |
166
+ | Gaps scope, issues analyzed | `/maestro-plan --gaps` |
167
+ | Gaps scope, need more context | `/maestro-analyze --gaps {ISS-ID}` |
168
+
169
+ ### Session seal
170
+
171
+ @~/.maestro/workflows/finish-work.md — SESSION_DIR=OUTPUT_DIR, SESSION_TYPE=analyze, SESSION_ID={artifact_id}, LINKED_MILESTONE={target_milestone or null}
172
+ </completion>
173
+
174
+ <error_codes>
175
+ | Code | Severity | Condition | Recovery |
176
+ |------|----------|-----------|----------|
177
+ | E001 | error | No args and no roadmap (cannot determine scope) | Prompt user for topic text or create roadmap first |
178
+ | W001 | warning | CLI exploration failed | Continue with available context, note limitation |
179
+ | W002 | warning | CLI analysis timeout | Retry with shorter prompt, or skip perspective |
180
+ | W003 | warning | Insufficient evidence for scoring dimensions | Note low-confidence dimensions, proceed with available evidence |
181
+ | W004 | warning | Max rounds reached (5) | Force synthesis, offer continuation option |
182
+ | E_NO_ISSUES | error | --gaps but no open/registered issues found | Suggest `/manage-issue-discover` or `/manage-issue create` |
183
+ | E_ISSUE_NOT_FOUND | error | --gaps with ISS-ID but issue not found | Suggest `/manage-issue list` to find valid IDs |
184
+ </error_codes>
185
+
186
+ <success_criteria>
187
+ Full mode:
188
+ - [ ] CLI exploration completed with code anchors and call chains
189
+ - [ ] discussion.md created with full timeline, TOC, Current Understanding
190
+ - [ ] analysis.md written with all 6 dimensions scored with evidence
191
+ - [ ] conclusions.json created with recommendations and decision trail
192
+ - [ ] Intent Coverage tracked and verified (no unresolved ❌ items)
193
+ - [ ] Confidence tracking initialized (Step 4.6) and re-scored each round (Step 5.8)
194
+ - [ ] Readiness gate checked before synthesis (Step 5.10)
195
+ - [ ] Pressure pass completed ≥ 1 time before Step 6
196
+ - [ ] Confidence summary with factor decomposition written to analysis.md
197
+
198
+ Gaps mode:
199
+ - [ ] Issues loaded from issues.jsonl (all open/registered, or single ISS-ID)
200
+ - [ ] CLI exploration executed per issue with codebase context
201
+ - [ ] Analysis record attached to each issue in issues.jsonl
202
+ - [ ] context.md written with aggregated root causes for plan --gaps
203
+
204
+ Both modes (full + quick):
205
+ - [ ] Interactive mode: interview decision table written to `discussion.md` and mirrored into `context.md` "Interview Decisions"
206
+ - [ ] context.md written with all decisions classified as Locked/Free/Deferred
207
+ - [ ] Gray areas identified through phase-specific analysis
208
+ - [ ] Decision Recording Protocol applied to all decisions
209
+ - [ ] Scope creep redirected to Deferred section
210
+ - [ ] Deferred items auto-created as issues (if any)
211
+ - [ ] Artifact registered in state.json with correct scope/milestone/phase
212
+ - [ ] Next step routed (impeccable/plan for Go, brainstorm for No-Go)
213
+ - [ ] Session sealed via finish-work (archive.json written, optional spec/knowhow extraction)
214
+ </success_criteria>
215
+