maestro-flow 0.3.42 → 0.3.44

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 (172) hide show
  1. package/.claude/commands/learn-decompose.md +10 -15
  2. package/.claude/commands/learn-follow.md +11 -16
  3. package/.claude/commands/learn-investigate.md +18 -22
  4. package/.claude/commands/learn-retro.md +23 -26
  5. package/.claude/commands/learn-second-opinion.md +11 -16
  6. package/.claude/commands/maestro-analyze.md +8 -0
  7. package/.claude/commands/maestro-brainstorm.md +8 -0
  8. package/.claude/commands/maestro-execute.md +11 -3
  9. package/.claude/commands/maestro-learn.md +4 -4
  10. package/.claude/commands/maestro-milestone-complete.md +6 -6
  11. package/.claude/commands/maestro-plan.md +8 -0
  12. package/.claude/commands/maestro-ralph-execute.md +52 -80
  13. package/.claude/commands/maestro-ralph.md +2 -2
  14. package/.claude/commands/maestro-tools-execute.md +117 -0
  15. package/.claude/commands/maestro-tools-register.md +137 -0
  16. package/.claude/commands/maestro-ui-codify.md +67 -0
  17. package/.claude/commands/manage-harvest.md +1 -1
  18. package/.claude/commands/manage-learn.md +5 -7
  19. package/.claude/commands/manage-wiki.md +1 -1
  20. package/.claude/commands/quality-auto-test.md +1 -1
  21. package/.claude/commands/quality-debug.md +8 -0
  22. package/.claude/commands/quality-retrospective.md +4 -5
  23. package/.claude/commands/quality-review.md +8 -0
  24. package/.claude/commands/spec-add.md +25 -4
  25. package/.claude/commands/spec-load.md +26 -6
  26. package/.claude/commands/spec-setup.md +2 -2
  27. package/.claude/commands/wiki-connect.md +1 -1
  28. package/.claude/commands/wiki-digest.md +5 -6
  29. package/.claude/skills/codify-to-knowhow/SKILL.md +167 -0
  30. package/.claude/skills/codify-to-knowhow/phases/01-load-manifest.md +101 -0
  31. package/.claude/skills/codify-to-knowhow/phases/02-generate-knowhow.md +97 -0
  32. package/.claude/skills/codify-to-knowhow/phases/03-generate-specs.md +92 -0
  33. package/.claude/skills/codify-to-knowhow/phases/04-index-verify.md +119 -0
  34. package/.codex/skills/codify-to-knowhow/SKILL.md +427 -0
  35. package/.codex/skills/learn-decompose/SKILL.md +8 -8
  36. package/.codex/skills/learn-follow/SKILL.md +6 -6
  37. package/.codex/skills/learn-investigate/SKILL.md +4 -4
  38. package/.codex/skills/learn-retro/SKILL.md +7 -7
  39. package/.codex/skills/learn-second-opinion/SKILL.md +6 -6
  40. package/.codex/skills/maestro-analyze/SKILL.md +491 -491
  41. package/.codex/skills/maestro-collab/SKILL.md +1 -1
  42. package/.codex/skills/maestro-learn/SKILL.md +1 -1
  43. package/.codex/skills/maestro-milestone-complete/SKILL.md +122 -122
  44. package/.codex/skills/maestro-plan/SKILL.md +485 -485
  45. package/.codex/skills/maestro-tools-execute/SKILL.md +105 -0
  46. package/.codex/skills/maestro-tools-register/SKILL.md +144 -0
  47. package/.codex/skills/maestro-ui-codify/SKILL.md +398 -0
  48. package/.codex/skills/maestro-verify/SKILL.md +486 -486
  49. package/.codex/skills/manage-harvest/SKILL.md +3 -3
  50. package/.codex/skills/manage-issue-discover/SKILL.md +431 -431
  51. package/.codex/skills/manage-learn/SKILL.md +13 -13
  52. package/.codex/skills/manage-wiki/SKILL.md +1 -1
  53. package/.codex/skills/quality-auto-test/SKILL.md +553 -553
  54. package/.codex/skills/quality-refactor/SKILL.md +151 -151
  55. package/.codex/skills/quality-retrospective/SKILL.md +6 -6
  56. package/.codex/skills/spec-add/SKILL.md +17 -4
  57. package/.codex/skills/spec-load/SKILL.md +24 -28
  58. package/.codex/skills/team-quality-assurance/roles/executor/role.md +1 -1
  59. package/.codex/skills/team-review/roles/reviewer/role.md +1 -1
  60. package/.codex/skills/team-tech-debt/roles/scanner/role.md +1 -1
  61. package/.codex/skills/team-testing/roles/executor/role.md +1 -1
  62. package/.codex/skills/team-testing/roles/generator/role.md +1 -1
  63. package/.codex/skills/wiki-connect/SKILL.md +5 -5
  64. package/.codex/skills/wiki-digest/SKILL.md +8 -8
  65. package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js +4 -2
  66. package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js.map +1 -1
  67. package/dashboard/dist-server/dashboard/src/server/routes/specs.js +1 -1
  68. package/dashboard/dist-server/dashboard/src/server/routes/specs.js.map +1 -1
  69. package/dashboard/dist-server/dashboard/src/server/routes/wiki.js +2 -1
  70. package/dashboard/dist-server/dashboard/src/server/routes/wiki.js.map +1 -1
  71. package/dashboard/dist-server/dashboard/src/server/state/fs-watcher.js +2 -2
  72. package/dashboard/dist-server/dashboard/src/server/state/fs-watcher.js.map +1 -1
  73. package/dashboard/dist-server/dashboard/src/server/supervisor/self-learning-service.d.ts +1 -1
  74. package/dashboard/dist-server/dashboard/src/server/supervisor/self-learning-service.js +1 -1
  75. package/dashboard/dist-server/dashboard/src/server/supervisor/self-learning-service.js.map +1 -1
  76. package/dashboard/dist-server/dashboard/src/server/wiki/search.js +2 -2
  77. package/dashboard/dist-server/dashboard/src/server/wiki/search.js.map +1 -1
  78. package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.d.ts +7 -3
  79. package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.js +47 -15
  80. package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.js.map +1 -1
  81. package/dashboard/dist-server/dashboard/src/server/wiki/stress.test.js +1 -1
  82. package/dashboard/dist-server/dashboard/src/server/wiki/stress.test.js.map +1 -1
  83. package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.d.ts +1 -2
  84. package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.js +3 -52
  85. package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.js.map +1 -1
  86. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +67 -21
  87. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
  88. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-types.d.ts +6 -1
  89. package/dashboard/dist-server/dashboard/src/server/wiki/writer-stress.test.js +1 -11
  90. package/dashboard/dist-server/dashboard/src/server/wiki/writer-stress.test.js.map +1 -1
  91. package/dashboard/dist-server/dashboard/src/server/wiki/writer.d.ts +7 -4
  92. package/dashboard/dist-server/dashboard/src/server/wiki/writer.js +27 -12
  93. package/dashboard/dist-server/dashboard/src/server/wiki/writer.js.map +1 -1
  94. package/dashboard/dist-server/src/tools/spec-entry-parser.d.ts +10 -2
  95. package/dashboard/dist-server/src/tools/spec-entry-parser.js +46 -12
  96. package/dashboard/dist-server/src/tools/spec-entry-parser.js.map +1 -1
  97. package/dashboard/dist-server/src/tools/spec-loader.d.ts +6 -2
  98. package/dashboard/dist-server/src/tools/spec-loader.js +119 -23
  99. package/dashboard/dist-server/src/tools/spec-loader.js.map +1 -1
  100. package/dist/src/commands/knowhow.d.ts.map +1 -1
  101. package/dist/src/commands/knowhow.js +21 -2
  102. package/dist/src/commands/knowhow.js.map +1 -1
  103. package/dist/src/commands/spec.d.ts +1 -1
  104. package/dist/src/commands/spec.d.ts.map +1 -1
  105. package/dist/src/commands/spec.js +78 -4
  106. package/dist/src/commands/spec.js.map +1 -1
  107. package/dist/src/commands/wiki.d.ts.map +1 -1
  108. package/dist/src/commands/wiki.js +51 -3
  109. package/dist/src/commands/wiki.js.map +1 -1
  110. package/dist/src/hooks/keyword-spec-injector.js +1 -1
  111. package/dist/src/hooks/keyword-spec-injector.js.map +1 -1
  112. package/dist/src/hooks/plugins/spec-injection-plugin.js +11 -11
  113. package/dist/src/hooks/plugins/spec-injection-plugin.js.map +1 -1
  114. package/dist/src/hooks/spec-injector.d.ts +1 -0
  115. package/dist/src/hooks/spec-injector.d.ts.map +1 -1
  116. package/dist/src/hooks/spec-injector.js +55 -22
  117. package/dist/src/hooks/spec-injector.js.map +1 -1
  118. package/dist/src/hooks/wiki-role-loader.d.ts +18 -0
  119. package/dist/src/hooks/wiki-role-loader.d.ts.map +1 -0
  120. package/dist/src/hooks/wiki-role-loader.js +43 -0
  121. package/dist/src/hooks/wiki-role-loader.js.map +1 -0
  122. package/dist/src/tools/spec-entry-parser.d.ts +10 -2
  123. package/dist/src/tools/spec-entry-parser.d.ts.map +1 -1
  124. package/dist/src/tools/spec-entry-parser.js +46 -12
  125. package/dist/src/tools/spec-entry-parser.js.map +1 -1
  126. package/dist/src/tools/spec-init.d.ts.map +1 -1
  127. package/dist/src/tools/spec-init.js +19 -0
  128. package/dist/src/tools/spec-init.js.map +1 -1
  129. package/dist/src/tools/spec-loader.d.ts +6 -2
  130. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  131. package/dist/src/tools/spec-loader.js +119 -23
  132. package/dist/src/tools/spec-loader.js.map +1 -1
  133. package/dist/src/tools/spec-writer.d.ts +6 -1
  134. package/dist/src/tools/spec-writer.d.ts.map +1 -1
  135. package/dist/src/tools/spec-writer.js +29 -2
  136. package/dist/src/tools/spec-writer.js.map +1 -1
  137. package/dist/src/tools/store-knowhow.d.ts.map +1 -1
  138. package/dist/src/tools/store-knowhow.js +56 -27
  139. package/dist/src/tools/store-knowhow.js.map +1 -1
  140. package/package.json +1 -1
  141. package/workflows/analyze.md +2 -2
  142. package/workflows/auto-test.md +2 -2
  143. package/workflows/brainstorm.md +1 -1
  144. package/workflows/codebase-rebuild.md +1 -1
  145. package/workflows/codebase-refresh.md +1 -1
  146. package/workflows/debug.md +1 -1
  147. package/workflows/execute.md +3 -3
  148. package/workflows/harvest.md +13 -13
  149. package/workflows/integration-test.md +2 -2
  150. package/workflows/issue-discover.md +1 -1
  151. package/workflows/knowhow.md +72 -11
  152. package/workflows/learn.md +70 -58
  153. package/workflows/map.md +1 -1
  154. package/workflows/milestone-complete.md +2 -2
  155. package/workflows/plan.md +1 -1
  156. package/workflows/quick.md +1 -1
  157. package/workflows/refactor.md +1 -1
  158. package/workflows/retrospective.md +51 -57
  159. package/workflows/review.md +1 -1
  160. package/workflows/roadmap-common.md +1 -1
  161. package/workflows/specs-add.md +11 -2
  162. package/workflows/specs-load.md +17 -15
  163. package/workflows/test-gen.md +1 -1
  164. package/workflows/tools-spec.md +98 -0
  165. package/workflows/ui-codify-extract.md +373 -0
  166. package/workflows/ui-codify-knowhow.md +258 -0
  167. package/workflows/ui-codify-package.md +161 -0
  168. package/workflows/ui-codify.md +225 -0
  169. package/workflows/verify.md +1 -1
  170. package/workflows/wiki-connect.md +7 -7
  171. package/workflows/wiki-digest.md +13 -13
  172. package/workflows/wiki-manage.md +1 -1
@@ -13,18 +13,9 @@ allowed-tools:
13
13
  ---
14
14
  <purpose>
15
15
  Single-step executor for ralph (adaptive) and maestro (static) sessions.
16
- Sessions stored at `.workflow/.maestro/*/status.json` with unified JSON schema.
16
+ Sessions stored at `.workflow/.maestro/*/status.json`.
17
17
 
18
- Each invocation: find next pending step → execute → update status → hand off to next iteration.
19
-
20
- Three node types:
21
- - **decision** (ralph-only): `Skill("maestro-ralph")` — ralph re-evaluates, may expand chain
22
- - **internal**: `Skill({ skill, args })` — synchronous in-session → self-invoke next
23
- - **external**: `maestro delegate --to claude` → new Claude Code session executing `/{skill} {args}` → STOP → callback → self-invoke next
24
-
25
- Session sources:
26
- - **source: "ralph"** — Adaptive chain with decision nodes. Primary use case.
27
- - **source: "maestro"** — Static chain, internal/external only. No decision callbacks.
18
+ Each invocation: locate session → find next pending step → resolve args → execute → update status → hand off to next iteration.
28
19
 
29
20
  Mutual invocation with `/maestro-ralph` forms a self-perpetuating work loop.
30
21
  </purpose>
@@ -39,15 +30,35 @@ Remaining → session_id (if matches maestro-* or ralph-* pattern)
39
30
  ```
40
31
 
41
32
  Also read `session.auto_mode` from status.json — if `true`, treat as `-y` even without flag.
33
+
34
+ **Session sources:**
35
+ - **ralph** — Adaptive chain with decision nodes (primary)
36
+ - **maestro** — Static chain, internal/external only, no decision callbacks
37
+
38
+ **Node types:**
39
+
40
+ | Type | Execution | Flow after |
41
+ |------|-----------|------------|
42
+ | decision (ralph-only) | `Skill("maestro-ralph")` — ralph re-evaluates, may expand chain | Ralph handles handoff, this execution ends |
43
+ | internal | `Skill({ skill, args })` — synchronous in-session | Self-invoke next |
44
+ | external | `maestro delegate --to claude` — new Claude Code session | STOP → callback → self-invoke next |
45
+
46
+ **Auto flag map** (appended to skill args when auto mode is active):
47
+
48
+ All lifecycle skills: `-y`. Exception: `quality-test` → `-y --auto-fix`.
49
+
50
+ Fallback for unlisted skills: internal → no flag, external → `-y`.
51
+
52
+ HARD RULE: External nodes ALWAYS append `-y` **to the skill's args inside the prompt** (not as a `maestro delegate` CLI argument), regardless of auto mode — delegate sessions are non-interactive and cannot confirm prompts.
42
53
  </context>
43
54
 
44
55
  <execution>
45
56
 
46
- ## Step 1: Locate Session
57
+ ## Step 1: Locate Session + Find Next Step
47
58
 
48
59
  ```
49
- If $ARGUMENTS matches maestro-* or ralph-* pattern:
50
- session_path = .workflow/.maestro/{$ARGUMENTS}/status.json
60
+ If session_id provided (matches maestro-* or ralph-*):
61
+ session_path = .workflow/.maestro/{session_id}/status.json
51
62
  Else:
52
63
  Scan .workflow/.maestro/*/status.json
53
64
  Filter: status == "running"
@@ -61,16 +72,14 @@ If no session found:
61
72
 
62
73
  Read status.json → extract: `session_id`, `source`, `steps[]`, `current_step`, `status`, `phase`, `milestone`, `intent`, `auto_mode`, `context`, `cli_tool`.
63
74
 
64
- ## Step 2: Find Next Pending Step
65
-
66
75
  ```
67
76
  next = steps.find(step => step.status == "pending")
68
- If no pending step → Step 6 (Complete)
77
+ If no pending step → Step 5 (Complete Session)
69
78
  ```
70
79
 
71
- ## Step 3: Resolve Args (context propagation)
80
+ ## Step 2: Resolve Args
72
81
 
73
- Before execution, enrich `next.args` with session context and prior outputs.
82
+ Enrich `next.args` with session context before execution.
74
83
 
75
84
  **Placeholder substitution:**
76
85
 
@@ -109,8 +118,9 @@ For execute commands: find latest type=="plan" artifact → --dir .workflow/scra
109
118
 
110
119
  Write enriched args back to status.json (resume-safe).
111
120
 
112
- ## Step 4: Mark Running
121
+ ## Step 3: Execute
113
122
 
123
+ Mark step as running:
114
124
  ```
115
125
  next.status = "running"
116
126
  next.started_at = ISO timestamp
@@ -119,7 +129,7 @@ status.updated_at = ISO timestamp
119
129
  Write status.json
120
130
  ```
121
131
 
122
- Display step banner:
132
+ Display banner:
123
133
  ```
124
134
  ------------------------------------------------------------
125
135
  [{next.index}/{steps.length - 1}] {next.skill} [{next.type}]
@@ -127,75 +137,40 @@ Display step banner:
127
137
  Session: {session_id} [{source}]
128
138
  Args: {next.args}
129
139
  ```
140
+ If decision node: also show `Retry: {retry_count}/{max_retries}`.
130
141
 
131
- If decision node: also show `Retry: {retry_count}/{max_retries}` from parsed args.
132
-
133
- ## Step 5: Execute by Type
134
-
135
- ### 5a. decision node (ralph-only)
136
-
137
- Hand control back to ralph for re-evaluation.
142
+ ### decision node
138
143
 
139
144
  ```
140
145
  Skill({ skill: "maestro-ralph" })
141
146
  ```
142
147
 
143
- Ralph will: detect running decision → evaluate results → optionally expand steps[] → mark completed → call ralph-execute to resume.
144
-
145
- **After Skill("maestro-ralph") returns, this execution ends.** Ralph handles the handoff.
146
-
147
- ### 5b. internal node
148
-
149
- HARD RULE: Every internal step MUST be executed via `Skill({ skill, args })`.
150
- Never "simulate" or "inline" a skill's work. If Skill() is not called, the step has NOT been executed.
148
+ Ralph detects the running decision → evaluates → optionally expands steps[] → marks completed → calls ralph-execute. **This execution ends here — ralph handles the handoff.**
151
149
 
152
- **Auto flag propagation** (when `auto == true`):
150
+ ### internal node
153
151
 
154
- | Skill | Flag appended |
155
- |-------|---------------|
156
- | maestro-init | `-y` |
157
- | maestro-analyze | `-y` |
158
- | maestro-brainstorm | `-y` |
159
- | maestro-roadmap | `-y` |
160
- | maestro-ui-design | `-y` |
161
- | maestro-plan | `-y` |
162
- | maestro-execute | `-y` |
163
- | quality-auto-test | `-y` |
164
- | quality-test | `-y --auto-fix` |
165
- | quality-retrospective | `-y` |
166
- | maestro-milestone-complete | `-y` |
167
- | maestro-verify | `-y` |
168
- | quality-review | `-y` |
169
- | quality-debug | `-y` |
170
- | maestro-milestone-audit | `-y` |
152
+ HARD RULE: Every step MUST be executed via `Skill({ skill, args })`. Never simulate or inline a skill's work.
171
153
 
172
154
  ```
173
- flag = auto_flag_map[next.skill] || ""
155
+ flag = auto ? (auto_flag_map[next.skill] || "") : ""
174
156
  effective_args = flag ? `${next.args} ${flag}` : next.args
175
157
 
176
158
  Skill({ skill: next.skill, args: effective_args })
177
159
  ```
178
160
 
179
- **On success** Step 5d (Mark Complete).
180
- **On failure** → Step 5e (Handle Failure).
161
+ On success: Step 4a. On failure: Step 4b.
181
162
 
182
- ### 5c. external node
163
+ ### external node
183
164
 
184
- Context-isolated skill execution via new Claude Code session.
185
-
186
- HARD RULE: external nodes ALWAYS delegate to `claude` — only Claude Code can execute slash-command skills.
187
- `session.cli_tool` is for analysis-mode delegates (e.g., decision evaluation in ralph), NOT for external node execution.
188
-
189
- HARD RULE: Delegate sessions are non-interactive and cannot confirm prompts. External nodes MUST always append `-y`, regardless of whether the user passed `-y`. Without it, delegate hangs indefinitely waiting for confirmation.
165
+ HARD RULE: External nodes ALWAYS delegate to `claude` — only Claude Code can execute slash-command skills. `session.cli_tool` is for analysis-mode delegates (e.g., decision evaluation in ralph), NOT for external node execution.
190
166
 
191
167
  ```
192
- // Always apply auto flag — delegate sessions are non-interactive and cannot confirm
168
+ // Always append -y to skill args inside the prompt — delegate sessions cannot confirm
193
169
  flag = auto_flag_map[next.skill] || "-y"
194
170
  effective_args = `${next.args} ${flag}`
195
171
 
196
172
  Bash({
197
- command: `maestro delegate "Execute: Skill({ skill: \"${next.skill}\", args: \"${effective_args}\" })
198
- Do NOT reimplement — invoke the skill command directly." --to claude --mode write`,
173
+ command: `maestro delegate "/${next.skill} ${effective_args}" --to claude --mode write`,
199
174
  run_in_background: true,
200
175
  timeout: 600000
201
176
  })
@@ -203,12 +178,12 @@ Do NOT reimplement — invoke the skill command directly." --to claude --mode wr
203
178
  STOP — wait for background callback.
204
179
  ```
205
180
 
206
- **On callback:**
207
- - Retrieve output: `maestro delegate output <exec_id>`
208
- - **On success** → Step 5d (Mark Complete)
209
- - **On failure** → Step 5e (Handle Failure)
181
+ On callback: retrieve output via `maestro delegate output <exec_id>`.
182
+ On success: Step 4a. On failure: Step 4b.
183
+
184
+ ## Step 4: Post-Execution
210
185
 
211
- ### 5d. Mark Complete (shared)
186
+ ### 4a. Mark Complete
212
187
 
213
188
  ```
214
189
  next.status = "completed"
@@ -223,12 +198,9 @@ Write status.json
223
198
  Display: [{next.index}/{total}] ✓ {next.skill} completed {next.type == "external" ? "[external]" : ""}
224
199
  ```
225
200
 
226
- Then hand off:
227
- ```
228
- Skill({ skill: "maestro-ralph-execute" })
229
- ```
201
+ `Skill({ skill: "maestro-ralph-execute" })` (next iteration)
230
202
 
231
- ### 5e. Handle Failure (shared)
203
+ ### 4b. Handle Failure
232
204
 
233
205
  ```
234
206
  next.status = "failed"
@@ -251,7 +223,7 @@ Else:
251
223
  End.
252
224
  ```
253
225
 
254
- **Interactive mode (non-auto):**
226
+ **Interactive mode:**
255
227
  ```
256
228
  AskUserQuestion: "retry / skip / abort"
257
229
  retry → next.status = "pending", next.error = null → Skill("maestro-ralph-execute")
@@ -259,7 +231,7 @@ AskUserQuestion: "retry / skip / abort"
259
231
  abort → status.status = "paused" → Write status.json → End.
260
232
  ```
261
233
 
262
- ## Step 6: Complete Session
234
+ ## Step 5: Complete Session
263
235
 
264
236
  When no pending steps remain:
265
237
 
@@ -312,7 +284,7 @@ Type badges: `◆` decision, `⚡` external, (none) internal.
312
284
  - [ ] Artifact dir resolution finds latest artifact for --dir args
313
285
  - [ ] decision nodes hand off to maestro-ralph via Skill() (ralph sessions only)
314
286
  - [ ] internal nodes execute via Skill() with auto flag propagation
315
- - [ ] external nodes use maestro delegate --to claude with run_in_background + STOP pattern
287
+ - [ ] external nodes delegate to claude with `-y` in prompt args (not CLI args), run_in_background + STOP
316
288
  - [ ] Context propagation: output signals update status.json.context
317
289
  - [ ] status.json updated after every status change (resume-safe)
318
290
  - [ ] Auto mode: retry once then pause; interactive: AskUserQuestion retry/skip/abort
@@ -190,7 +190,7 @@ Generate steps from `lifecycle_position` to target (default: `milestone-complete
190
190
 
191
191
  IMPORTANT: `external` ≠ single CLI tool call. It spawns a full Claude Code session that executes the skill command — the delegate session has complete skill access.
192
192
 
193
- HARD RULE: Delegate sessions are non-interactive. All skills executed via delegate MUST always append `-y`, regardless of user flags. This is enforced by ralph-execute in Step 5c — ralph does not preset flags in steps.
193
+ HARD RULE: Delegate sessions are non-interactive. All skills executed via delegate MUST always append `-y` **to the skill's args inside the prompt** (not as a `maestro delegate` CLI argument). This is enforced by ralph-execute in Step 5c — ralph does not preset flags in steps.
194
194
 
195
195
  **Build rules:**
196
196
  1. Start from inferred position, skip completed stages
@@ -237,7 +237,7 @@ HARD RULE: Delegate sessions are non-interactive. All skills executed via delega
237
237
  "target": "milestone-complete",
238
238
  "phase": null | N,
239
239
  "milestone": "{M}",
240
- "auto_mode": false,
240
+ "auto_mode": auto_confirm,
241
241
  "cli_tool": "claude",
242
242
  "quality_mode": "standard",
243
243
  "passed_gates": [],
@@ -0,0 +1,117 @@
1
+ ---
2
+ name: maestro-tools-execute
3
+ description: Load and execute tool specs by role or name
4
+ argument-hint: "[tool-name | --role <role>]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ - AskUserQuestion
13
+ - Agent
14
+ ---
15
+ <purpose>
16
+ Load registered tool specs and execute them step-by-step. Two invocation modes:
17
+
18
+ 1. **Direct** — Specify tool name, load full steps, execute sequentially
19
+ 2. **Role-based** — List available tools for a role, user selects, then execute
20
+
21
+ Execution follows the tool definition steps in order, reporting progress per step and asking user on blockers.
22
+ </purpose>
23
+
24
+ <required_reading>
25
+ @~/.maestro/workflows/tools-spec.md
26
+ </required_reading>
27
+
28
+ <context>
29
+ $ARGUMENTS — Tool name, keyword, or --role filter
30
+
31
+ **Examples**:
32
+ ```
33
+ /maestro-tools-execute integration-test
34
+ /maestro-tools-execute --role implement
35
+ /maestro-tools-execute --role review --keyword api
36
+ /maestro-tools-execute
37
+ ```
38
+
39
+ Empty arguments enters interactive mode: list all tools for user selection.
40
+ </context>
41
+
42
+ <execution>
43
+
44
+ ### Step 1: Load Tool
45
+
46
+ **By name**:
47
+ ```bash
48
+ maestro spec load --role implement --keyword <name>
49
+ ```
50
+ Match entries in tools.md whose title or keywords contain the name.
51
+
52
+ **By role**:
53
+ ```bash
54
+ maestro spec load --role <role>
55
+ ```
56
+ Extract tools.md entries from output, list available tools.
57
+
58
+ **Empty args**:
59
+ Load all tools.md entries, present to user with AskUserQuestion for selection.
60
+
61
+ ### Step 2: Display Tool
62
+
63
+ Show tool information:
64
+ - Name, roles, keywords
65
+ - Steps overview (for ref entries, expand knowhow detail first)
66
+
67
+ Expand ref entries:
68
+ ```bash
69
+ maestro wiki load <knowhow-id>
70
+ ```
71
+
72
+ ### Step 3: Confirm Execution
73
+
74
+ Ask user:
75
+ - Execute steps as-is?
76
+ - Adjust parameters/scope?
77
+ - View only, do not execute?
78
+
79
+ ### Step 4: Step-by-Step Execution
80
+
81
+ Follow the tool definition steps in order:
82
+ 1. Read current step description
83
+ 2. Execute step action (file ops, commands, code changes, etc.)
84
+ 3. Verify step completion
85
+ 4. Report progress: `[Step N/M] done — <step_name>`
86
+ 5. Proceed to next step
87
+
88
+ **Blocker handling**:
89
+ - Step fails → report error, ask user: retry / skip / abort
90
+ - Needs user input → AskUserQuestion for parameters
91
+ - Prerequisites unmet → show missing items, ask how to proceed
92
+
93
+ ### Step 5: Report Results
94
+
95
+ After completion, output:
96
+ - Completed steps list
97
+ - Skipped/failed steps (if any)
98
+ - Artifacts produced (generated files, test results, etc.)
99
+ - Suggested next actions
100
+
101
+ </execution>
102
+
103
+ <error_codes>
104
+ | Code | Severity | Description |
105
+ |------|----------|-------------|
106
+ | E001 | fatal | No matching tool found — check name/keyword |
107
+ | E002 | warning | Multiple tools match — list options for user selection |
108
+ | E003 | warning | Step execution failed — ask user how to proceed |
109
+ </error_codes>
110
+
111
+ <success_criteria>
112
+ - [ ] Tool correctly loaded (ref expanded if applicable)
113
+ - [ ] User confirmed before execution starts
114
+ - [ ] Each step has progress feedback
115
+ - [ ] Blockers handled interactively
116
+ - [ ] Results reported clearly
117
+ </success_criteria>
@@ -0,0 +1,137 @@
1
+ ---
2
+ name: maestro-tools-register
3
+ description: Register tool specs - extract, generate, or optimize
4
+ argument-hint: "[description]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ - AskUserQuestion
13
+ - Agent
14
+ ---
15
+ <purpose>
16
+ Codify reusable business processes as tool specs into `.workflow/specs/tools.md`. Once registered, entries are auto-discovered by downstream agents via `spec load --role` and spec-injector — plan agents pick up design/architecture flows, test agents pick up verification methods, implement agents pick up execution steps.
17
+
18
+ When to register: during planning to standardize a business process (e.g. payment reconciliation, OAuth integration steps); after execution to capture a validated procedure (e.g. database migration rollback); before testing to register verification methods for test agents (e.g. E2E checkout flow, API idempotency verification); during retrospective/harvest to extract reusable process knowledge from artifacts.
19
+
20
+ Three modes: Extract (from code/docs), Generate (from description), Optimize (improve existing).
21
+ Short processes (<10 steps) inline; long processes (>=10 steps) use ref mode with knowhow detail doc.
22
+ </purpose>
23
+
24
+ <required_reading>
25
+ @~/.maestro/workflows/tools-spec.md
26
+ </required_reading>
27
+
28
+ <context>
29
+ $ARGUMENTS — Intent description
30
+
31
+ **Examples**:
32
+ ```
33
+ /maestro-tools-register extract OAuth PKCE token exchange flow from src/auth/
34
+ /maestro-tools-register generate Stripe webhook idempotency verification --roles implement,test
35
+ /maestro-tools-register generate E2E checkout flow with payment gateway mock setup --roles test
36
+ /maestro-tools-register optimize e2e-checkout tool
37
+ ```
38
+ </context>
39
+
40
+ <execution>
41
+
42
+ ### Step 1: Intent Detection
43
+
44
+ Parse $ARGUMENTS to determine mode:
45
+ - Contains "extract" → extract mode
46
+ - Contains "optimize/improve" → optimize mode
47
+ - Other → generate mode
48
+ - Empty → ask user with AskUserQuestion
49
+
50
+ ### Step 2: Gather Information
51
+
52
+ **Extract mode**:
53
+ - Identify source (current conversation, specified files, codebase scan)
54
+ - Extract step sequence, prerequisites, expected outputs
55
+
56
+ **Generate mode**:
57
+ - Confirm tool name, applicable roles, target scenario
58
+ - If unclear, ask user with AskUserQuestion
59
+
60
+ **Optimize mode**:
61
+ - Load existing tool: `maestro spec load --role implement --keyword <name>`
62
+ - Analyze improvement points (step splitting, prerequisites, error handling)
63
+
64
+ **For all modes** — identify the usage timing: when should an agent or user invoke this tool? This becomes the first line of the entry description (see Step 5).
65
+
66
+ ### Step 3: Determine Roles
67
+
68
+ Infer applicable roles from context, or ask user:
69
+ - implement — execution tools (build, deploy, integrate)
70
+ - test — testing tools (test flows, verification steps)
71
+ - review — review tools (checklists, audit standards)
72
+ - plan — planning tools (design flows, analysis steps)
73
+ - analyze — analysis tools (diagnostic flows, investigation steps)
74
+
75
+ ### Step 4: Decide Inline vs Ref
76
+
77
+ - Steps <10 and no code blocks → **inline mode**
78
+ - Steps >=10 or contains code examples/config → **ref mode**
79
+
80
+ ### Step 5: Write
81
+
82
+ **Description format**: First line after `### Title` must state **when to use** this tool (the usage timing from Step 2). This is critical for ref entries — `spec load` only shows the first 200 chars after the heading as the summary.
83
+
84
+ ```
85
+ ### {Title}
86
+
87
+ Use when {timing/trigger condition}.
88
+
89
+ 1. Step one ...
90
+ ```
91
+
92
+ **Inline mode**:
93
+ ```bash
94
+ maestro spec add tools "<title>" "Use when <timing>.\n\n1. <step1>\n2. <step2>" --roles "<csv>" --keywords "<csv>"
95
+ ```
96
+
97
+ **Ref mode**:
98
+ 1. Generate knowhow detail document (RCP- or DOC- prefix). YAML frontmatter must include `summary` with usage timing — this is what `wiki list` and wiki-role-loader show to agents:
99
+ ```yaml
100
+ ---
101
+ title: <Title>
102
+ type: recipe
103
+ summary: "Use when <timing>. <scope description>"
104
+ tags: [<keywords>]
105
+ roles: [<roles>]
106
+ ---
107
+ ```
108
+ 2. Register spec index entry — description must also include usage timing within 200 chars (this is what `spec load` shows):
109
+ ```bash
110
+ maestro spec add tools "<title>" "Use when <timing>. <scope summary>" --roles "<csv>" --keywords "<csv>" \
111
+ --ref "knowhow/RCP-<slug>.md" --knowhow-type recipe
112
+ ```
113
+
114
+ ### Step 6: Verify
115
+
116
+ - `maestro spec load --role <role> --keyword <keyword>` to confirm loadable
117
+ - Display result: title, roles, keywords, storage location
118
+
119
+ </execution>
120
+
121
+ <error_codes>
122
+ | Code | Severity | Description |
123
+ |------|----------|-------------|
124
+ | E001 | fatal | `.workflow/specs/` does not exist — run `maestro spec init` |
125
+ | E002 | warning | Duplicate tool name detected — confirm overwrite/optimize |
126
+ | E003 | fatal | roles parameter empty — tools must declare applicable roles |
127
+ </error_codes>
128
+
129
+ <success_criteria>
130
+ - [ ] Tool definition written to tools.md (or ref to knowhow)
131
+ - [ ] roles attribute correctly set
132
+ - [ ] keywords auto-extracted (3-5 terms)
133
+ - [ ] Description starts with "Use when ..." (usage timing)
134
+ - [ ] Loadable via `spec load --role <role>`
135
+ - [ ] Long processes use ref mode with knowhow file created
136
+ - [ ] Ref knowhow YAML includes `summary` with usage timing
137
+ </success_criteria>
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: maestro-ui-codify
3
+ description: Extract design system from code, generate reference package, persist as knowledge assets
4
+ argument-hint: "<source-path> [--package-name <name>] [--output-dir <path>] [--overwrite]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ - Agent
13
+ - Skill
14
+ ---
15
+ <purpose>
16
+ Codify UI design system from existing source code. 4-phase pipeline:
17
+
18
+ 1. **Validate** (inline): Parameter validation, workspace setup, file discovery
19
+ 2. **Extract** (3 parallel agents): Style Agent + Animation Agent + Layout Agent produce design-tokens.json, animation-tokens.json, layout-templates.json
20
+ 3. **Package** (agent): Copy tokens to package directory, generate preview.html + preview.css
21
+ 4. **Knowhow** (manifest + skill): Build knowhow-manifest.json, call codify-to-knowhow to persist as knowledge assets
22
+
23
+ Position in pipeline: code -> **ui-codify** -> knowhow + specs
24
+ </purpose>
25
+
26
+ <deferred_reading>
27
+ - [ui-codify.md](~/.maestro/workflows/ui-codify.md) — read always (main workflow orchestrator)
28
+ - [ui-codify-extract.md](~/.maestro/workflows/ui-codify-extract.md) — read when Phase 2 starts (style extraction with 3 agents)
29
+ - [ui-codify-package.md](~/.maestro/workflows/ui-codify-package.md) — read when Phase 3 starts (reference package generation)
30
+ - [ui-codify-knowhow.md](~/.maestro/workflows/ui-codify-knowhow.md) — read when Phase 4 starts (knowledge asset generation)
31
+ </deferred_reading>
32
+
33
+ <context>
34
+ $ARGUMENTS — source path (required) with optional flags.
35
+
36
+ Flags:
37
+ - `<source-path>` (positional, required): Directory containing CSS/SCSS/JS/TS/HTML source files
38
+ - `--package-name <name>`: Package name for reference output (default: auto-generated from source directory)
39
+ - `--output-dir <path>`: Output directory for reference package (default: `.workflow/reference_style`)
40
+ - `--overwrite`: Allow overwriting existing package directory
41
+ </context>
42
+
43
+ <execution>
44
+ Route to `~/.maestro/workflows/ui-codify.md` and follow completely.
45
+
46
+ The workflow orchestrates 4 phases with deferred loading of phase-specific workflow files. Each phase reads its workflow file only when execution reaches that phase.
47
+ </execution>
48
+
49
+ <error_codes>
50
+ | Code | Severity | Description | Stage |
51
+ |------|----------|-------------|-------|
52
+ | E001 | error | Source path argument required | parse_input |
53
+ | E002 | error | Source path not found or not a directory | validate |
54
+ | E003 | error | Package directory exists without --overwrite flag | validate |
55
+ | W001 | warning | animation-tokens.json not found (optional, extraction continues) | extract |
56
+ </error_codes>
57
+
58
+ <success_criteria>
59
+ - [ ] Source path validated and file discovery completed
60
+ - [ ] design-tokens.json generated with color, typography, spacing tokens
61
+ - [ ] layout-templates.json generated with component patterns (universal/specialized)
62
+ - [ ] animation-tokens.json generated (optional, W001 if missing)
63
+ - [ ] preview.html + preview.css generated as interactive showcase
64
+ - [ ] knowhow-manifest.json created with AST/DCS assets and spec entries
65
+ - [ ] codify-to-knowhow called and completed successfully
66
+ - [ ] Temporary workspace cleaned up
67
+ </success_criteria>
@@ -54,7 +54,7 @@ Extraction patterns, classification rules, routing infrastructure, and fragment
54
54
  - Review wiki entries → `maestro wiki list --type note`
55
55
  - Connect wiki graph → `/wiki-connect --fix`
56
56
  - Triage issues → `/manage-issue list --source harvest`
57
- - View specs → `/spec-load --category learning`
57
+ - View specs → `/spec-load --role implement`
58
58
  - Full retrospective → `/quality-retrospective`
59
59
  </execution>
60
60
 
@@ -16,7 +16,7 @@ Unified atomic knowledge capture for the workflow learning library. Captures two
16
16
  - **Insights**: Timeless "eureka moment" entries (patterns, gotchas, techniques) — the default mode
17
17
  - **Tips**: Quick contextual notes for cross-session recovery (formerly in `manage-knowhow-capture tip`)
18
18
 
19
- Both types are stored in `.workflow/learning/lessons.jsonl` with auto-detected phase linkage and keyword-based category inference. Tips are distinguished by `source: "tip"` and implicitly tagged `tip`. Same store as retrospective output, so search and list see the entire knowledge corpus.
19
+ Both types are stored in `.workflow/specs/learnings.md` as `<spec-entry>` blocks with auto-detected phase linkage and keyword-based category inference. Tips are distinguished by `source: "tip"` and implicitly tagged `tip`. Same store as retrospective output, so search and list see the entire knowledge corpus.
20
20
  </purpose>
21
21
 
22
22
  <required_reading>
@@ -30,7 +30,7 @@ Arguments: $ARGUMENTS
30
30
  - `"<insight text>"` (or any non-keyword text) → insight capture mode
31
31
  - `tip <text>` → tip capture mode (quick contextual note, auto-tagged `tip`)
32
32
  - `list` → list recent entries (default 20)
33
- - `search <query>` → text search across lessons.jsonl
33
+ - `search <query>` → `maestro spec load --category learning` or text search across `specs/learnings.md`
34
34
  - `show <INS-id>` → full detail with phase context
35
35
  - empty → AskUserQuestion to prompt for text
36
36
 
@@ -47,21 +47,19 @@ Follow `~/.maestro/workflows/learn.md` Stages 1–5 in order.
47
47
  | E001 | error | `.workflow/` not initialized — run `/maestro-init` first | parse_input |
48
48
  | E002 | error | Unknown `--category` value (allowed: pattern, antipattern, decision, tool, gotcha, technique, tip) | parse_input |
49
49
  | E003 | error | `show` mode requires an INS-id argument | show |
50
- | E004 | error | Insight id not found in lessons.jsonl | show |
50
+ | E004 | error | Insight id not found in `specs/learnings.md` | show |
51
51
  | W001 | warning | Auto-phase detection found a current_phase but no matching artifact in registry; phase set to null | capture |
52
- | W002 | warning | learning-index.json out of sync with lessons.jsonl (different row count); offer to rebuild | list/search |
53
52
  </error_codes>
54
53
 
55
54
  <success_criteria>
56
55
  - [ ] Mode correctly routed (capture / list / search / show)
57
- - [ ] Capture: `lessons.jsonl` row appended with valid JSON and all required fields
58
- - [ ] Capture: `learning-index.json` updated with matching entry
56
+ - [ ] Capture: `<spec-entry>` block appended to `specs/learnings.md` with all required fields
59
57
  - [ ] Capture: phase auto-link resolves correctly via artifact registry when `state.json` has `current_phase`
60
58
  - [ ] Capture: category inference produces a sensible default when `--category` absent
61
59
  - [ ] List: filters apply, output sorted newest-first, default limit 20
62
60
  - [ ] Search: results ranked by title (3) > tags (2) > summary (1) match
63
61
  - [ ] Show: full insight displayed with phase context and routed-artifact link if any
64
- - [ ] No file modifications outside `.workflow/learning/`
62
+ - [ ] No file modifications outside `.workflow/knowhow/`
65
63
  - [ ] Confirmation banner displayed with INS-id and next-step hints
66
64
  - [ ] Next step: `/manage-learn list` to browse, or `/manage-learn search <query>` to find related insights
67
65
  </success_criteria>
@@ -34,7 +34,7 @@ $ARGUMENTS — subcommand and optional flags.
34
34
  | No args | Same as `health` |
35
35
 
36
36
  **Flags:**
37
- - `--type <type>` — Filter by wiki type: spec, knowhow, note, lesson, issue
37
+ - `--type <type>` — Filter by wiki type: spec, knowhow, note, issue
38
38
  - `--fix` — Auto-fix issues found during cleanup (remove broken links, suggest connections)
39
39
  - `--json` — Output in JSON format
40
40
  </context>
@@ -85,7 +85,7 @@ Append to state.json.artifacts[]:
85
85
  **Next-step routing on completion:**
86
86
  - Converged (>=95%) → `/maestro-verify {phase}`
87
87
  - All requirements verified (spec source) → `/maestro-milestone-audit`
88
- - Bugs discovered → `/quality-debug --from-auto-test {phase}`
88
+ - Bugs discovered → `/quality-debug --from-uat {phase}`
89
89
  - Max iter, >80% → `/quality-test {phase}` for manual UAT
90
90
  - Max iter, <80% → `/quality-debug {phase}`
91
91
  - Coverage still low → `/quality-auto-test {phase} --layer {missing}`
@@ -49,6 +49,14 @@ Extract conclusions from related artifacts that may affect this debug session
49
49
  2. **Wiki prior knowledge**: Run `maestro wiki search "<symptom keywords>" --json 2>/dev/null`. If results found, check for prior investigations on similar issues to avoid re-investigation.
50
50
  3. Both are optional — proceed without if unavailable.
51
51
 
52
+ ### Role Knowledge
53
+ 1. Browse accumulated knowledge for this role:
54
+ `maestro wiki list --role analyze`
55
+ 2. Analyze the index, identify entries relevant to the current task
56
+ 3. Load selected documents:
57
+ `maestro wiki load <id1> [id2] [id3...]`
58
+ 4. Review loaded knowledge before proceeding
59
+
52
60
  **Output**: `DEBUG_DIR = .workflow/scratch/{YYYYMMDD}-debug-P{N}-{slug}/` (P{N} = phase number when phase-scoped; omit for standalone). Output directory rules defined in workflow debug.md Step 4.
53
61
  </context>
54
62