maestro-flow 0.3.19 → 0.3.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/.claude/commands/learn-investigate.md +195 -195
  2. package/.claude/commands/learn-retro.md +303 -303
  3. package/.claude/commands/learn-second-opinion.md +167 -167
  4. package/.claude/commands/maestro-amend.md +300 -300
  5. package/.claude/commands/maestro-analyze.md +126 -126
  6. package/.claude/commands/maestro-composer.md +354 -354
  7. package/.claude/commands/maestro-execute.md +114 -114
  8. package/.claude/commands/maestro-learn.md +140 -140
  9. package/.claude/commands/maestro-milestone-audit.md +68 -68
  10. package/.claude/commands/maestro-milestone-complete.md +75 -75
  11. package/.claude/commands/maestro-milestone-release.md +96 -96
  12. package/.claude/commands/maestro-plan.md +138 -138
  13. package/.claude/commands/maestro-player.md +404 -404
  14. package/.claude/commands/maestro-update.md +176 -176
  15. package/.claude/commands/maestro-verify.md +90 -90
  16. package/.claude/commands/manage-codebase-rebuild.md +75 -75
  17. package/.claude/commands/manage-knowhow-capture.md +193 -193
  18. package/.claude/commands/manage-knowhow.md +77 -77
  19. package/.claude/commands/manage-learn.md +67 -67
  20. package/.claude/commands/manage-wiki.md +62 -62
  21. package/.claude/commands/quality-business-test.md +110 -110
  22. package/.claude/commands/quality-retrospective.md +78 -78
  23. package/.claude/commands/spec-add.md +49 -49
  24. package/.claude/commands/spec-load.md +51 -51
  25. package/.claude/commands/spec-remove.md +51 -51
  26. package/.claude/commands/wiki-connect.md +62 -62
  27. package/.claude/commands/wiki-digest.md +69 -69
  28. package/.codex/skills/maestro-link-coordinate/SKILL.md +5 -5
  29. package/.codex/skills/maestro-player/SKILL.md +5 -5
  30. package/dashboard/dist-server/dashboard/src/server/coordinator/workflow-coordinator.js +3 -3
  31. package/dashboard/dist-server/dashboard/src/server/coordinator/workflow-coordinator.js.map +1 -1
  32. package/dashboard/dist-server/dashboard/src/server/execution/execution-scheduler.js +1 -1
  33. package/dashboard/dist-server/dashboard/src/server/execution/execution-scheduler.js.map +1 -1
  34. package/dist/src/commands/coordinate.js +2 -2
  35. package/dist/src/commands/coordinate.js.map +1 -1
  36. package/dist/src/hooks/coordinator-tracker.d.ts +1 -1
  37. package/dist/src/hooks/coordinator-tracker.js +3 -3
  38. package/dist/src/hooks/coordinator-tracker.js.map +1 -1
  39. package/package.json +1 -1
  40. package/workflows/maestro-link-coordinate.md +3 -3
  41. package/workflows/maestro.codex.md +2 -2
  42. package/workflows/maestro-coordinate.codex.md +0 -281
@@ -1,195 +1,195 @@
1
- ---
2
- name: learn-investigate
3
- description: Systematic question investigation with hypothesis testing, evidence logging, and 3-strike escalation
4
- argument-hint: "<question> [--scope <path>] [--max-hypotheses N]"
5
- allowed-tools:
6
- - Read
7
- - Write
8
- - Bash
9
- - Glob
10
- - Grep
11
- - Agent
12
- - AskUserQuestion
13
- ---
14
- <purpose>
15
- Systematic investigation workflow for understanding questions (not bug-fixing). Inspired by gstack `/investigate` with its 4-phase approach, scope lock, and 3-strike escalation rule.
16
-
17
- Unlike `quality-debug` which is designed for fixing bugs during execution phases, this command is for answering "how does X work?", "why does Y happen?", "what would happen if Z?" questions. It produces structured evidence trails and understanding documents that persist to the learning system.
18
- </purpose>
19
-
20
- <context>
21
- Arguments: $ARGUMENTS
22
-
23
- **Target:** First argument is the question or topic to investigate (quoted string or keywords).
24
-
25
- **Flags:**
26
- - `--scope <path>` — Restrict investigation to files under this directory (default: entire project)
27
- - `--max-hypotheses N` — Maximum hypotheses to test before escalating (default: 3)
28
-
29
- **Storage written:**
30
- - `.workflow/learning/investigate-{slug}/evidence.ndjson` — Structured evidence log (one JSON line per evidence)
31
- - `.workflow/learning/investigate-{slug}/understanding.md` — Evolving understanding document
32
- - `.workflow/learning/investigate-{slug}/report.md` — Final investigation report
33
- - `.workflow/learning/lessons.jsonl` — Investigation findings as insights (source: "investigate")
34
- - `.workflow/learning/learning-index.json` — Updated index
35
-
36
- **Storage read:**
37
- - Source files within scope
38
- - `maestro wiki search "<question>"` — Prior knowledge about the topic
39
- - `.workflow/learning/lessons.jsonl` — Prior related investigations
40
- - `.workflow/specs/debug-notes.md` — Known gotchas and patterns
41
- - `.workflow/codebase/architecture.md` — Structural context (if exists)
42
- </context>
43
-
44
- <execution>
45
-
46
- ### Stage 1: Frame the Question
47
- - Parse question from arguments
48
- - Determine scope (--scope or full project)
49
- - Generate investigation slug from question keywords
50
- - Create `.workflow/learning/investigate-{slug}/` directory
51
- - Search prior knowledge:
52
- - `maestro wiki search "<question>"` for related entries
53
- - Grep `lessons.jsonl` for related insights
54
- - Read `debug-notes.md` for known gotchas
55
-
56
- Write initial `understanding.md`:
57
- ```markdown
58
- # Investigation: {question}
59
- ## Initial Understanding
60
- - Prior knowledge: {summary of wiki/lessons findings}
61
- - Scope: {path or "full project"}
62
- - Started: {timestamp}
63
- ```
64
-
65
- ### Stage 2: Evidence Collection
66
- Systematically gather evidence related to the question:
67
-
68
- 1. **Code search**: Grep for keywords from the question across the scoped files
69
- 2. **File inspection**: Read the most relevant files identified by search
70
- 3. **Import/dependency tracing**: Follow imports to understand the dependency chain
71
- 4. **Git history**: `git log --oneline -10 -- <relevant-files>` for recent changes
72
-
73
- For each piece of evidence, append to `evidence.ndjson`:
74
- ```json
75
- {"ts": "ISO", "type": "code|git|search|doc", "source": "file:line", "relevance": "high|medium|low", "content": "...", "note": "why this matters"}
76
- ```
77
-
78
- ### Stage 3: Pattern Matching
79
- Compare collected evidence against known patterns:
80
- - Check `debug-notes.md` entries for matching situations
81
- - Check `lessons.jsonl` for related technique/pattern/gotcha entries
82
- - Identify: does this match a documented pattern, or is it novel?
83
-
84
- Update `understanding.md` with pattern analysis section.
85
-
86
- ### Stage 4: Hypothesis Formation
87
- From evidence and patterns, generate ranked hypotheses:
88
- - Each hypothesis: a specific, testable claim about "how/why"
89
- - Rank by plausibility (evidence strength)
90
- - Write hypotheses to `understanding.md`
91
-
92
- ```markdown
93
- ## Hypotheses
94
- 1. **[HIGH]** {hypothesis 1} — Evidence: {refs}
95
- 2. **[MEDIUM]** {hypothesis 2} — Evidence: {refs}
96
- 3. **[LOW]** {hypothesis 3} — Evidence: {refs}
97
- ```
98
-
99
- ### Stage 5: Hypothesis Testing
100
- For each hypothesis (in rank order):
101
-
102
- 1. **Design test**: What specific evidence would confirm or disprove this?
103
- 2. **Execute test**: Code trace, targeted search, data inspection, or experiment
104
- 3. **Record result**: Append to `evidence.ndjson` with `type: "test"`
105
- 4. **Update understanding**: Mark hypothesis as confirmed / disproved / inconclusive
106
-
107
- ```markdown
108
- ## Test Results
109
- ### Hypothesis 1: {claim}
110
- - Test: {what was done}
111
- - Result: CONFIRMED / DISPROVED / INCONCLUSIVE
112
- - Evidence: {file:line references}
113
- ```
114
-
115
- ### Stage 6: 3-Strike Escalation
116
- If `--max-hypotheses` hypotheses all fail:
117
-
118
- 1. **Broaden scope**: If scope was restricted, suggest expanding. AskUserQuestion:
119
- ```
120
- {N} hypotheses tested, none confirmed.
121
- A) Broaden scope to full project
122
- B) I have a new hypothesis: [user provides]
123
- C) Escalate — this needs deeper investigation
124
- ```
125
- 2. **Search wiki for clues**: `maestro wiki search` with alternative keywords
126
- 3. **If still stuck**: Mark as INCONCLUSIVE with what was learned and what remains unknown
127
-
128
- ### Stage 7: Synthesize & Report
129
- Write final `report.md`:
130
-
131
- ```markdown
132
- # Investigation Report: {question}
133
-
134
- ## Answer
135
- {confirmed understanding or "INCONCLUSIVE: ..."}
136
-
137
- ## Evidence Trail
138
- | # | Type | Source | Relevance | Finding |
139
- |---|------|--------|-----------|---------|
140
- | 1 | code | file:line | high | ... |
141
-
142
- ## Hypotheses Tested
143
- | Hypothesis | Result | Key Evidence |
144
- |-----------|--------|-------------|
145
- | ... | confirmed/disproved | file:line |
146
-
147
- ## Key Learnings
148
- - {learning 1}
149
- - {learning 2}
150
-
151
- ## Open Questions
152
- - {what remains unknown}
153
- ```
154
-
155
- ### Stage 8: Persist
156
- 1. Append findings to `lessons.jsonl`:
157
- - Confirmed hypotheses → `category: "technique"` or `"pattern"`
158
- - Disproved hypotheses → `category: "gotcha"` (what looked true but wasn't)
159
- - `source: "investigate"`, tags: `["investigate", "{question-slug}"]`
160
- - Stable INS-id from `hash("investigate" + question + finding_title)`
161
- 2. Update `learning-index.json`
162
- 3. Display summary with answer and next steps
163
-
164
- **Next-step routing:**
165
- - Save finding to specs → `/spec-add debug <finding>`
166
- - Follow-along on discovered code → `/learn-follow <path>`
167
- - Decompose patterns found → `/learn-decompose <module>`
168
- - Create wiki entry for understanding → `maestro wiki create --type note`
169
- </execution>
170
-
171
- <error_codes>
172
- | Code | Severity | Condition | Recovery |
173
- |------|----------|-----------|----------|
174
- | E001 | error | No question provided | Provide a question as the first argument |
175
- | E002 | error | Scope path does not exist | Check --scope path is valid |
176
- | W001 | warning | No prior knowledge found in wiki/lessons | Proceed with fresh investigation |
177
- | W002 | warning | Evidence collection found very few matches (<3) | Broaden search terms or expand scope |
178
- | W003 | warning | All hypotheses inconclusive — escalating | Investigation marked INCONCLUSIVE |
179
- </error_codes>
180
-
181
- <success_criteria>
182
- - [ ] Question parsed and investigation slug generated
183
- - [ ] Investigation directory created under `.workflow/learning/`
184
- - [ ] Prior knowledge loaded from wiki and lessons
185
- - [ ] Evidence collected and logged to `evidence.ndjson` (structured NDJSON)
186
- - [ ] Pattern matching performed against debug-notes and lessons
187
- - [ ] At least 1 hypothesis formed and tested
188
- - [ ] `understanding.md` tracks evolving understanding with timestamps
189
- - [ ] `report.md` written with answer, evidence trail, hypothesis results
190
- - [ ] Findings appended to `lessons.jsonl` with stable INS-ids
191
- - [ ] `learning-index.json` updated
192
- - [ ] 3-strike escalation triggered if all hypotheses fail
193
- - [ ] No files modified outside `.workflow/learning/`
194
- - [ ] Summary displayed with answer and next-step routing
195
- </success_criteria>
1
+ ---
2
+ name: learn-investigate
3
+ description: Systematic question investigation with hypothesis testing, evidence logging, and 3-strike escalation
4
+ argument-hint: "<question> [--scope <path>] [--max-hypotheses N]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Bash
9
+ - Glob
10
+ - Grep
11
+ - Agent
12
+ - AskUserQuestion
13
+ ---
14
+ <purpose>
15
+ Systematic investigation workflow for understanding questions (not bug-fixing). Inspired by gstack `/investigate` with its 4-phase approach, scope lock, and 3-strike escalation rule.
16
+
17
+ Unlike `quality-debug` which is designed for fixing bugs during execution phases, this command is for answering "how does X work?", "why does Y happen?", "what would happen if Z?" questions. It produces structured evidence trails and understanding documents that persist to the learning system.
18
+ </purpose>
19
+
20
+ <context>
21
+ Arguments: $ARGUMENTS
22
+
23
+ **Target:** First argument is the question or topic to investigate (quoted string or keywords).
24
+
25
+ **Flags:**
26
+ - `--scope <path>` — Restrict investigation to files under this directory (default: entire project)
27
+ - `--max-hypotheses N` — Maximum hypotheses to test before escalating (default: 3)
28
+
29
+ **Storage written:**
30
+ - `.workflow/learning/investigate-{slug}/evidence.ndjson` — Structured evidence log (one JSON line per evidence)
31
+ - `.workflow/learning/investigate-{slug}/understanding.md` — Evolving understanding document
32
+ - `.workflow/learning/investigate-{slug}/report.md` — Final investigation report
33
+ - `.workflow/learning/lessons.jsonl` — Investigation findings as insights (source: "investigate")
34
+ - `.workflow/learning/learning-index.json` — Updated index
35
+
36
+ **Storage read:**
37
+ - Source files within scope
38
+ - `maestro wiki search "<question>"` — Prior knowledge about the topic
39
+ - `.workflow/learning/lessons.jsonl` — Prior related investigations
40
+ - `.workflow/specs/debug-notes.md` — Known gotchas and patterns
41
+ - `.workflow/codebase/architecture.md` — Structural context (if exists)
42
+ </context>
43
+
44
+ <execution>
45
+
46
+ ### Stage 1: Frame the Question
47
+ - Parse question from arguments
48
+ - Determine scope (--scope or full project)
49
+ - Generate investigation slug from question keywords
50
+ - Create `.workflow/learning/investigate-{slug}/` directory
51
+ - Search prior knowledge:
52
+ - `maestro wiki search "<question>"` for related entries
53
+ - Grep `lessons.jsonl` for related insights
54
+ - Read `debug-notes.md` for known gotchas
55
+
56
+ Write initial `understanding.md`:
57
+ ```markdown
58
+ # Investigation: {question}
59
+ ## Initial Understanding
60
+ - Prior knowledge: {summary of wiki/lessons findings}
61
+ - Scope: {path or "full project"}
62
+ - Started: {timestamp}
63
+ ```
64
+
65
+ ### Stage 2: Evidence Collection
66
+ Systematically gather evidence related to the question:
67
+
68
+ 1. **Code search**: Grep for keywords from the question across the scoped files
69
+ 2. **File inspection**: Read the most relevant files identified by search
70
+ 3. **Import/dependency tracing**: Follow imports to understand the dependency chain
71
+ 4. **Git history**: `git log --oneline -10 -- <relevant-files>` for recent changes
72
+
73
+ For each piece of evidence, append to `evidence.ndjson`:
74
+ ```json
75
+ {"ts": "ISO", "type": "code|git|search|doc", "source": "file:line", "relevance": "high|medium|low", "content": "...", "note": "why this matters"}
76
+ ```
77
+
78
+ ### Stage 3: Pattern Matching
79
+ Compare collected evidence against known patterns:
80
+ - Check `debug-notes.md` entries for matching situations
81
+ - Check `lessons.jsonl` for related technique/pattern/gotcha entries
82
+ - Identify: does this match a documented pattern, or is it novel?
83
+
84
+ Update `understanding.md` with pattern analysis section.
85
+
86
+ ### Stage 4: Hypothesis Formation
87
+ From evidence and patterns, generate ranked hypotheses:
88
+ - Each hypothesis: a specific, testable claim about "how/why"
89
+ - Rank by plausibility (evidence strength)
90
+ - Write hypotheses to `understanding.md`
91
+
92
+ ```markdown
93
+ ## Hypotheses
94
+ 1. **[HIGH]** {hypothesis 1} — Evidence: {refs}
95
+ 2. **[MEDIUM]** {hypothesis 2} — Evidence: {refs}
96
+ 3. **[LOW]** {hypothesis 3} — Evidence: {refs}
97
+ ```
98
+
99
+ ### Stage 5: Hypothesis Testing
100
+ For each hypothesis (in rank order):
101
+
102
+ 1. **Design test**: What specific evidence would confirm or disprove this?
103
+ 2. **Execute test**: Code trace, targeted search, data inspection, or experiment
104
+ 3. **Record result**: Append to `evidence.ndjson` with `type: "test"`
105
+ 4. **Update understanding**: Mark hypothesis as confirmed / disproved / inconclusive
106
+
107
+ ```markdown
108
+ ## Test Results
109
+ ### Hypothesis 1: {claim}
110
+ - Test: {what was done}
111
+ - Result: CONFIRMED / DISPROVED / INCONCLUSIVE
112
+ - Evidence: {file:line references}
113
+ ```
114
+
115
+ ### Stage 6: 3-Strike Escalation
116
+ If `--max-hypotheses` hypotheses all fail:
117
+
118
+ 1. **Broaden scope**: If scope was restricted, suggest expanding. AskUserQuestion:
119
+ ```
120
+ {N} hypotheses tested, none confirmed.
121
+ A) Broaden scope to full project
122
+ B) I have a new hypothesis: [user provides]
123
+ C) Escalate — this needs deeper investigation
124
+ ```
125
+ 2. **Search wiki for clues**: `maestro wiki search` with alternative keywords
126
+ 3. **If still stuck**: Mark as INCONCLUSIVE with what was learned and what remains unknown
127
+
128
+ ### Stage 7: Synthesize & Report
129
+ Write final `report.md`:
130
+
131
+ ```markdown
132
+ # Investigation Report: {question}
133
+
134
+ ## Answer
135
+ {confirmed understanding or "INCONCLUSIVE: ..."}
136
+
137
+ ## Evidence Trail
138
+ | # | Type | Source | Relevance | Finding |
139
+ |---|------|--------|-----------|---------|
140
+ | 1 | code | file:line | high | ... |
141
+
142
+ ## Hypotheses Tested
143
+ | Hypothesis | Result | Key Evidence |
144
+ |-----------|--------|-------------|
145
+ | ... | confirmed/disproved | file:line |
146
+
147
+ ## Key Learnings
148
+ - {learning 1}
149
+ - {learning 2}
150
+
151
+ ## Open Questions
152
+ - {what remains unknown}
153
+ ```
154
+
155
+ ### Stage 8: Persist
156
+ 1. Append findings to `lessons.jsonl`:
157
+ - Confirmed hypotheses → `category: "technique"` or `"pattern"`
158
+ - Disproved hypotheses → `category: "gotcha"` (what looked true but wasn't)
159
+ - `source: "investigate"`, tags: `["investigate", "{question-slug}"]`
160
+ - Stable INS-id from `hash("investigate" + question + finding_title)`
161
+ 2. Update `learning-index.json`
162
+ 3. Display summary with answer and next steps
163
+
164
+ **Next-step routing:**
165
+ - Save finding to specs → `/spec-add debug <finding>`
166
+ - Follow-along on discovered code → `/learn-follow <path>`
167
+ - Decompose patterns found → `/learn-decompose <module>`
168
+ - Create wiki entry for understanding → `maestro wiki create --type note`
169
+ </execution>
170
+
171
+ <error_codes>
172
+ | Code | Severity | Condition | Recovery |
173
+ |------|----------|-----------|----------|
174
+ | E001 | error | No question provided | Provide a question as the first argument |
175
+ | E002 | error | Scope path does not exist | Check --scope path is valid |
176
+ | W001 | warning | No prior knowledge found in wiki/lessons | Proceed with fresh investigation |
177
+ | W002 | warning | Evidence collection found very few matches (<3) | Broaden search terms or expand scope |
178
+ | W003 | warning | All hypotheses inconclusive — escalating | Investigation marked INCONCLUSIVE |
179
+ </error_codes>
180
+
181
+ <success_criteria>
182
+ - [ ] Question parsed and investigation slug generated
183
+ - [ ] Investigation directory created under `.workflow/learning/`
184
+ - [ ] Prior knowledge loaded from wiki and lessons
185
+ - [ ] Evidence collected and logged to `evidence.ndjson` (structured NDJSON)
186
+ - [ ] Pattern matching performed against debug-notes and lessons
187
+ - [ ] At least 1 hypothesis formed and tested
188
+ - [ ] `understanding.md` tracks evolving understanding with timestamps
189
+ - [ ] `report.md` written with answer, evidence trail, hypothesis results
190
+ - [ ] Findings appended to `lessons.jsonl` with stable INS-ids
191
+ - [ ] `learning-index.json` updated
192
+ - [ ] 3-strike escalation triggered if all hypotheses fail
193
+ - [ ] No files modified outside `.workflow/learning/`
194
+ - [ ] Summary displayed with answer and next-step routing
195
+ </success_criteria>