maestro-flow 0.3.9 → 0.3.11

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 (281) hide show
  1. package/.claude/agents/workflow-collab-planner.md +1 -1
  2. package/.claude/agents/workflow-executor.md +1 -1
  3. package/.claude/agents/workflow-plan-checker.md +1 -1
  4. package/.claude/agents/workflow-planner.md +1 -1
  5. package/.claude/commands/learn-decompose.md +176 -176
  6. package/.claude/commands/learn-follow.md +167 -167
  7. package/.claude/commands/learn-retro.md +1 -1
  8. package/.claude/commands/maestro-analyze.md +46 -3
  9. package/.claude/commands/maestro-coordinate.md +1 -3
  10. package/.claude/commands/maestro-execute.md +14 -0
  11. package/.claude/commands/maestro-plan.md +16 -0
  12. package/.claude/commands/manage-harvest.md +131 -131
  13. package/.claude/commands/manage-issue-discover.md +2 -2
  14. package/.claude/commands/manage-issue.md +5 -5
  15. package/.claude/commands/spec-add.md +67 -56
  16. package/.claude/commands/spec-load.md +66 -64
  17. package/.claude/commands/spec-setup.md +5 -9
  18. package/.codex/skills/learn-decompose/SKILL.md +119 -0
  19. package/.codex/skills/learn-follow/SKILL.md +83 -0
  20. package/.codex/skills/learn-investigate/SKILL.md +83 -0
  21. package/.codex/skills/learn-retro/SKILL.md +83 -0
  22. package/.codex/skills/learn-second-opinion/SKILL.md +86 -0
  23. package/.codex/skills/maestro/SKILL.md +335 -0
  24. package/.codex/skills/maestro-analyze/SKILL.md +84 -75
  25. package/.codex/skills/maestro-brainstorm/SKILL.md +452 -463
  26. package/.codex/skills/maestro-chain/SKILL.md +233 -0
  27. package/.codex/skills/maestro-coordinate/SKILL.md +167 -278
  28. package/.codex/skills/maestro-execute/SKILL.md +435 -438
  29. package/.codex/skills/maestro-fork/SKILL.md +68 -0
  30. package/.codex/skills/maestro-init/SKILL.md +171 -167
  31. package/.codex/skills/maestro-learn/SKILL.md +80 -0
  32. package/.codex/skills/maestro-link-coordinate/SKILL.md +224 -220
  33. package/.codex/skills/maestro-merge/SKILL.md +62 -0
  34. package/.codex/skills/maestro-milestone-audit/SKILL.md +108 -103
  35. package/.codex/skills/maestro-milestone-complete/SKILL.md +155 -149
  36. package/.codex/skills/maestro-milestone-release/SKILL.md +70 -0
  37. package/.codex/skills/maestro-overlay/SKILL.md +188 -185
  38. package/.codex/skills/maestro-plan/SKILL.md +66 -69
  39. package/.codex/skills/maestro-quick/SKILL.md +26 -23
  40. package/.codex/skills/maestro-roadmap/SKILL.md +65 -73
  41. package/.codex/skills/maestro-spec-generate/SKILL.md +66 -74
  42. package/.codex/skills/maestro-ui-design/SKILL.md +34 -31
  43. package/.codex/skills/maestro-verify/SKILL.md +556 -566
  44. package/.codex/skills/manage-codebase-rebuild/SKILL.md +397 -405
  45. package/.codex/skills/manage-codebase-refresh/SKILL.md +93 -82
  46. package/.codex/skills/manage-harvest/SKILL.md +82 -0
  47. package/.codex/skills/manage-issue/SKILL.md +80 -65
  48. package/.codex/skills/manage-issue-discover/SKILL.md +491 -503
  49. package/.codex/skills/manage-learn/SKILL.md +190 -186
  50. package/.codex/skills/manage-memory/SKILL.md +95 -72
  51. package/.codex/skills/manage-memory-capture/SKILL.md +99 -86
  52. package/.codex/skills/manage-status/SKILL.md +102 -89
  53. package/.codex/skills/quality-business-test/SKILL.md +228 -223
  54. package/.codex/skills/quality-debug/SKILL.md +54 -66
  55. package/.codex/skills/quality-integration-test/SKILL.md +532 -544
  56. package/.codex/skills/quality-refactor/SKILL.md +197 -191
  57. package/.codex/skills/quality-retrospective/SKILL.md +512 -505
  58. package/.codex/skills/quality-review/SKILL.md +93 -105
  59. package/.codex/skills/quality-sync/SKILL.md +101 -89
  60. package/.codex/skills/quality-test/SKILL.md +202 -198
  61. package/.codex/skills/quality-test-gen/SKILL.md +93 -104
  62. package/.codex/skills/spec-add/SKILL.md +58 -39
  63. package/.codex/skills/spec-load/SKILL.md +45 -40
  64. package/.codex/skills/spec-map/SKILL.md +180 -182
  65. package/.codex/skills/spec-setup/SKILL.md +94 -76
  66. package/.codex/skills/team-coordinate/SKILL.md +346 -357
  67. package/.codex/skills/team-executor/SKILL.md +70 -112
  68. package/.codex/skills/team-lifecycle-v4/SKILL.md +311 -299
  69. package/.codex/skills/team-quality-assurance/SKILL.md +234 -227
  70. package/.codex/skills/team-review/SKILL.md +232 -225
  71. package/.codex/skills/team-tech-debt/SKILL.md +78 -100
  72. package/.codex/skills/team-testing/SKILL.md +242 -235
  73. package/.codex/skills/wiki-connect/SKILL.md +75 -0
  74. package/.codex/skills/wiki-digest/SKILL.md +87 -0
  75. package/README.md +14 -11
  76. package/README.zh-CN.md +14 -11
  77. package/chains/issue-lifecycle.json +13 -13
  78. package/chains/singles/issue-analyze.json +3 -3
  79. package/chains/singles/issue-execute.json +3 -3
  80. package/chains/singles/issue-plan.json +3 -3
  81. package/dashboard/dist-server/dashboard/src/server/commander/commander-agent.js +2 -2
  82. package/dashboard/dist-server/dashboard/src/server/commander/commander-agent.js.map +1 -1
  83. package/dashboard/dist-server/dashboard/src/server/coordinator/chain-map.js +3 -3
  84. package/dashboard/dist-server/dashboard/src/server/coordinator/chain-map.js.map +1 -1
  85. package/dashboard/dist-server/dashboard/src/server/routes/issues.js +34 -0
  86. package/dashboard/dist-server/dashboard/src/server/routes/issues.js.map +1 -1
  87. package/dashboard/dist-server/dashboard/src/server/routes/specs.d.ts +1 -1
  88. package/dashboard/dist-server/dashboard/src/server/routes/specs.js +75 -30
  89. package/dashboard/dist-server/dashboard/src/server/routes/specs.js.map +1 -1
  90. package/dashboard/dist-server/dashboard/src/server/state/event-bus.d.ts +5 -0
  91. package/dashboard/dist-server/dashboard/src/server/state/event-bus.js +5 -0
  92. package/dashboard/dist-server/dashboard/src/server/state/event-bus.js.map +1 -1
  93. package/dashboard/dist-server/dashboard/src/server/ws/handlers/execution-handler.js +2 -3
  94. package/dashboard/dist-server/dashboard/src/server/ws/handlers/execution-handler.js.map +1 -1
  95. package/dashboard/dist-server/dashboard/src/shared/constants.js +5 -0
  96. package/dashboard/dist-server/dashboard/src/shared/constants.js.map +1 -1
  97. package/dashboard/dist-server/dashboard/src/shared/issue-types.d.ts +5 -0
  98. package/dashboard/dist-server/dashboard/src/shared/issue-types.js.map +1 -1
  99. package/dashboard/dist-server/dashboard/src/shared/normalize-task.d.ts +2 -0
  100. package/dashboard/dist-server/dashboard/src/shared/normalize-task.js +75 -0
  101. package/dashboard/dist-server/dashboard/src/shared/normalize-task.js.map +1 -0
  102. package/dashboard/dist-server/dashboard/src/shared/team-types.d.ts +21 -0
  103. package/dashboard/dist-server/dashboard/src/shared/team-types.js.map +1 -1
  104. package/dashboard/dist-server/dashboard/src/shared/types.d.ts +3 -2
  105. package/dashboard/dist-server/dashboard/src/shared/ws-protocol.d.ts +1 -1
  106. package/dashboard/dist-server/dashboard/src/shared/ws-protocol.js.map +1 -1
  107. package/dashboard/dist-server/src/hooks/constants.d.ts +92 -12
  108. package/dashboard/dist-server/src/hooks/constants.js +151 -16
  109. package/dashboard/dist-server/src/hooks/constants.js.map +1 -1
  110. package/dashboard/dist-server/src/types/index.d.ts +5 -0
  111. package/dist/src/commands/collab.d.ts +1 -34
  112. package/dist/src/commands/collab.d.ts.map +1 -1
  113. package/dist/src/commands/collab.js +8 -76
  114. package/dist/src/commands/collab.js.map +1 -1
  115. package/dist/src/commands/hooks.d.ts +5 -1
  116. package/dist/src/commands/hooks.d.ts.map +1 -1
  117. package/dist/src/commands/hooks.js +115 -10
  118. package/dist/src/commands/hooks.js.map +1 -1
  119. package/dist/src/commands/install-ui/InstallConfirm.d.ts +3 -1
  120. package/dist/src/commands/install-ui/InstallConfirm.d.ts.map +1 -1
  121. package/dist/src/commands/install-ui/InstallConfirm.js +3 -1
  122. package/dist/src/commands/install-ui/InstallConfirm.js.map +1 -1
  123. package/dist/src/commands/install-ui/InstallExecution.d.ts.map +1 -1
  124. package/dist/src/commands/install-ui/InstallExecution.js +5 -1
  125. package/dist/src/commands/install-ui/InstallExecution.js.map +1 -1
  126. package/dist/src/commands/install-ui/InstallFlow.d.ts.map +1 -1
  127. package/dist/src/commands/install-ui/InstallFlow.js +7 -3
  128. package/dist/src/commands/install-ui/InstallFlow.js.map +1 -1
  129. package/dist/src/commands/install-ui/StatuslineConfig.d.ts +6 -1
  130. package/dist/src/commands/install-ui/StatuslineConfig.d.ts.map +1 -1
  131. package/dist/src/commands/install-ui/StatuslineConfig.js +27 -5
  132. package/dist/src/commands/install-ui/StatuslineConfig.js.map +1 -1
  133. package/dist/src/commands/spec.d.ts.map +1 -1
  134. package/dist/src/commands/spec.js +7 -2
  135. package/dist/src/commands/spec.js.map +1 -1
  136. package/dist/src/hooks/__tests__/statusline-visual-test.d.ts +7 -0
  137. package/dist/src/hooks/__tests__/statusline-visual-test.d.ts.map +1 -0
  138. package/dist/src/hooks/__tests__/statusline-visual-test.js +236 -0
  139. package/dist/src/hooks/__tests__/statusline-visual-test.js.map +1 -0
  140. package/dist/src/hooks/constants.d.ts +92 -12
  141. package/dist/src/hooks/constants.d.ts.map +1 -1
  142. package/dist/src/hooks/constants.js +151 -16
  143. package/dist/src/hooks/constants.js.map +1 -1
  144. package/dist/src/hooks/guards/index.d.ts +2 -0
  145. package/dist/src/hooks/guards/index.d.ts.map +1 -1
  146. package/dist/src/hooks/guards/index.js +2 -0
  147. package/dist/src/hooks/guards/index.js.map +1 -1
  148. package/dist/src/hooks/guards/preflight-guard.d.ts +29 -0
  149. package/dist/src/hooks/guards/preflight-guard.d.ts.map +1 -0
  150. package/dist/src/hooks/guards/preflight-guard.js +95 -0
  151. package/dist/src/hooks/guards/preflight-guard.js.map +1 -0
  152. package/dist/src/hooks/guards/spec-validator.d.ts +25 -0
  153. package/dist/src/hooks/guards/spec-validator.d.ts.map +1 -0
  154. package/dist/src/hooks/guards/spec-validator.js +66 -0
  155. package/dist/src/hooks/guards/spec-validator.js.map +1 -0
  156. package/dist/src/hooks/index.d.ts +1 -0
  157. package/dist/src/hooks/index.d.ts.map +1 -1
  158. package/dist/src/hooks/index.js +1 -0
  159. package/dist/src/hooks/index.js.map +1 -1
  160. package/dist/src/hooks/keyword-spec-injector.d.ts +21 -0
  161. package/dist/src/hooks/keyword-spec-injector.d.ts.map +1 -0
  162. package/dist/src/hooks/keyword-spec-injector.js +96 -0
  163. package/dist/src/hooks/keyword-spec-injector.js.map +1 -0
  164. package/dist/src/hooks/plugins/spec-injection-plugin.d.ts +2 -1
  165. package/dist/src/hooks/plugins/spec-injection-plugin.d.ts.map +1 -1
  166. package/dist/src/hooks/plugins/spec-injection-plugin.js +21 -12
  167. package/dist/src/hooks/plugins/spec-injection-plugin.js.map +1 -1
  168. package/dist/src/hooks/preflight-core.d.ts +37 -0
  169. package/dist/src/hooks/preflight-core.d.ts.map +1 -0
  170. package/dist/src/hooks/preflight-core.js +86 -0
  171. package/dist/src/hooks/preflight-core.js.map +1 -0
  172. package/dist/src/hooks/spec-bridge.d.ts +40 -0
  173. package/dist/src/hooks/spec-bridge.d.ts.map +1 -0
  174. package/dist/src/hooks/spec-bridge.js +97 -0
  175. package/dist/src/hooks/spec-bridge.js.map +1 -0
  176. package/dist/src/hooks/spec-injector.d.ts.map +1 -1
  177. package/dist/src/hooks/spec-injector.js +18 -12
  178. package/dist/src/hooks/spec-injector.js.map +1 -1
  179. package/dist/src/hooks/statusline.d.ts +8 -17
  180. package/dist/src/hooks/statusline.d.ts.map +1 -1
  181. package/dist/src/hooks/statusline.js +269 -112
  182. package/dist/src/hooks/statusline.js.map +1 -1
  183. package/dist/src/i18n/locales/en.d.ts.map +1 -1
  184. package/dist/src/i18n/locales/en.js +5 -0
  185. package/dist/src/i18n/locales/en.js.map +1 -1
  186. package/dist/src/i18n/locales/zh.d.ts.map +1 -1
  187. package/dist/src/i18n/locales/zh.js +5 -0
  188. package/dist/src/i18n/locales/zh.js.map +1 -1
  189. package/dist/src/i18n/types.d.ts +5 -0
  190. package/dist/src/i18n/types.d.ts.map +1 -1
  191. package/dist/src/team/phase-orchestrator.d.ts +52 -0
  192. package/dist/src/team/phase-orchestrator.d.ts.map +1 -0
  193. package/dist/src/team/phase-orchestrator.js +165 -0
  194. package/dist/src/team/phase-orchestrator.js.map +1 -0
  195. package/dist/src/team/phase-types.d.ts +51 -0
  196. package/dist/src/team/phase-types.d.ts.map +1 -0
  197. package/dist/src/team/phase-types.js +41 -0
  198. package/dist/src/team/phase-types.js.map +1 -0
  199. package/dist/src/tools/collab-adapter.d.ts +17 -0
  200. package/dist/src/tools/collab-adapter.d.ts.map +1 -1
  201. package/dist/src/tools/collab-adapter.js +138 -0
  202. package/dist/src/tools/collab-adapter.js.map +1 -1
  203. package/dist/src/tools/index.d.ts.map +1 -1
  204. package/dist/src/tools/index.js +6 -0
  205. package/dist/src/tools/index.js.map +1 -1
  206. package/dist/src/tools/merge-validator.d.ts +24 -0
  207. package/dist/src/tools/merge-validator.d.ts.map +1 -0
  208. package/dist/src/tools/merge-validator.js +220 -0
  209. package/dist/src/tools/merge-validator.js.map +1 -0
  210. package/dist/src/tools/spec-entry-parser.d.ts +56 -0
  211. package/dist/src/tools/spec-entry-parser.d.ts.map +1 -0
  212. package/dist/src/tools/spec-entry-parser.js +196 -0
  213. package/dist/src/tools/spec-entry-parser.js.map +1 -0
  214. package/dist/src/tools/spec-init.d.ts.map +1 -1
  215. package/dist/src/tools/spec-init.js +66 -92
  216. package/dist/src/tools/spec-init.js.map +1 -1
  217. package/dist/src/tools/spec-keyword-index.d.ts +30 -0
  218. package/dist/src/tools/spec-keyword-index.d.ts.map +1 -0
  219. package/dist/src/tools/spec-keyword-index.js +101 -0
  220. package/dist/src/tools/spec-keyword-index.js.map +1 -0
  221. package/dist/src/tools/spec-loader.d.ts +3 -3
  222. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  223. package/dist/src/tools/spec-loader.js +49 -23
  224. package/dist/src/tools/spec-loader.js.map +1 -1
  225. package/dist/src/tools/team-agents.d.ts +27 -0
  226. package/dist/src/tools/team-agents.d.ts.map +1 -0
  227. package/dist/src/tools/team-agents.js +362 -0
  228. package/dist/src/tools/team-agents.js.map +1 -0
  229. package/dist/src/tools/team-mailbox.d.ts +40 -0
  230. package/dist/src/tools/team-mailbox.d.ts.map +1 -0
  231. package/dist/src/tools/team-mailbox.js +384 -0
  232. package/dist/src/tools/team-mailbox.js.map +1 -0
  233. package/dist/src/tools/team-msg.d.ts +17 -8
  234. package/dist/src/tools/team-msg.d.ts.map +1 -1
  235. package/dist/src/tools/team-msg.js +110 -13
  236. package/dist/src/tools/team-msg.js.map +1 -1
  237. package/dist/src/tools/team-tasks-mcp.d.ts +27 -0
  238. package/dist/src/tools/team-tasks-mcp.d.ts.map +1 -0
  239. package/dist/src/tools/team-tasks-mcp.js +408 -0
  240. package/dist/src/tools/team-tasks-mcp.js.map +1 -0
  241. package/dist/src/types/index.d.ts +5 -0
  242. package/dist/src/types/index.d.ts.map +1 -1
  243. package/package.json +2 -1
  244. package/templates/cli/prompts/workflow-skill-conflict-patterns.txt +3 -3
  245. package/templates/cli/prompts/workflow-skill-lessons-learned.txt +3 -3
  246. package/templates/search-tools.md +1 -1
  247. package/workflows/analyze.md +816 -816
  248. package/workflows/brainstorm.md +471 -471
  249. package/workflows/cli-tools-usage.md +44 -27
  250. package/workflows/codebase-rebuild.md +332 -332
  251. package/workflows/codebase-refresh.md +240 -240
  252. package/workflows/delegate-usage.md +3 -3
  253. package/workflows/execute.md +1 -1
  254. package/workflows/harvest.md +420 -420
  255. package/workflows/integration-test.md +343 -343
  256. package/workflows/issue-analyze.md +6 -2
  257. package/workflows/issue-discover.md +414 -414
  258. package/workflows/issue-execute.md +6 -3
  259. package/workflows/issue-plan.md +5 -2
  260. package/workflows/maestro-coordinate.codex.md +281 -470
  261. package/workflows/maestro-coordinate.md +14 -14
  262. package/workflows/maestro-link-coordinate.md +2 -2
  263. package/workflows/maestro.codex.md +710 -0
  264. package/workflows/maestro.md +10 -11
  265. package/workflows/map.md +111 -111
  266. package/workflows/milestone-complete.md +176 -176
  267. package/workflows/plan.md +1 -1
  268. package/workflows/quick.md +497 -497
  269. package/workflows/refactor.md +300 -300
  270. package/workflows/retrospective.md +1 -1
  271. package/workflows/roadmap.md +335 -335
  272. package/workflows/spec-generate.md +640 -640
  273. package/workflows/specs-add.md +46 -81
  274. package/workflows/specs-load.md +15 -17
  275. package/workflows/specs-setup.md +40 -161
  276. package/.claude/commands/manage-issue-analyze.md +0 -62
  277. package/.claude/commands/manage-issue-execute.md +0 -73
  278. package/.claude/commands/manage-issue-plan.md +0 -62
  279. package/.codex/skills/manage-issue-analyze/SKILL.md +0 -207
  280. package/.codex/skills/manage-issue-execute/SKILL.md +0 -200
  281. package/.codex/skills/manage-issue-plan/SKILL.md +0 -186
@@ -0,0 +1,119 @@
1
+ ---
2
+ name: learn-decompose
3
+ description: 4-dimension parallel pattern extraction via CSV wave pipeline. Structural, behavioral, data, and error dimension agents scan in parallel (Wave 1), cross-reference agent deduplicates and catalogs (Wave 2). Outputs pattern catalog to lessons.jsonl.
4
+ argument-hint: "[-y|--yes] [-c|--concurrency 4] [--continue] \"<path|module> [--patterns <list>] [--save-spec] [--save-wiki]\""
5
+ allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
6
+ ---
7
+
8
+ <purpose>
9
+ Systematic pattern extraction from code via CSV wave pipeline. 4 parallel dimension agents
10
+ scan a module, then a cross-reference agent deduplicates against existing patterns and
11
+ produces a catalog. Discovered patterns persist to `lessons.jsonl` and optionally to
12
+ specs (via `spec-add`) and wiki.
13
+
14
+ ```
15
+ Resolve Target → Load Existing Patterns → Wave 1 (4 parallel dimension scans) → Wave 2 (cross-ref + catalog) → Persist
16
+ ```
17
+ </purpose>
18
+
19
+ <context>
20
+ $ARGUMENTS — target path/module and optional flags.
21
+
22
+ **Target resolution:**
23
+ - File path → analyze that file
24
+ - Directory path → all source files in it
25
+ - Module name → Glob `src/**/{module}*`
26
+
27
+ **Flags:**
28
+ - `-y, --yes`: Skip confirmations
29
+ - `-c, --concurrency N`: Max concurrent agents (default: 4)
30
+ - `--continue`: Resume existing session
31
+ - `--patterns <list>`: Comma-separated pattern names to focus on
32
+ - `--save-spec`: Invoke `spec-add` for each new pattern
33
+ - `--save-wiki`: Create wiki note entries per dimension group
34
+
35
+ **Output**: `.workflow/.csv-wave/{session-id}/` + `.workflow/learning/decompose-{slug}-{date}.md`
36
+ </context>
37
+
38
+ <invariants>
39
+ 1. **4 dimensions always**: structural, behavioral, data, error — each a wave 1 task
40
+ 2. **Evidence required**: Every finding must have file:line anchors
41
+ 3. **Dedup before persist**: Cross-reference against existing specs + lessons
42
+ 4. **Stable IDs**: INS-id from `hash("decompose" + target + pattern_name)`
43
+ 5. **No files modified outside** `.workflow/learning/` (and optionally specs/wiki)
44
+ </invariants>
45
+
46
+ <execution>
47
+
48
+ ### Phase 1: Session Init + Target Resolution
49
+
50
+ ```javascript
51
+ const AUTO_YES = $ARGUMENTS.includes('-y') || $ARGUMENTS.includes('--yes')
52
+ const patternsMatch = $ARGUMENTS.match(/--patterns\s+(\S+)/)
53
+ const patternFilter = patternsMatch ? patternsMatch[1].split(',') : null
54
+ const SAVE_SPEC = $ARGUMENTS.includes('--save-spec')
55
+ const SAVE_WIKI = $ARGUMENTS.includes('--save-wiki')
56
+ const target = $ARGUMENTS.replace(/--yes|-y|--continue|--concurrency\s+\d+|-c\s+\d+|--patterns\s+\S+|--save-spec|--save-wiki/g, '').trim()
57
+ ```
58
+
59
+ Resolve target to file list. Load existing patterns from `coding-conventions.md` + `lessons.jsonl` for dedup set.
60
+
61
+ ### Phase 2: Wave 1 — Parallel Dimension Scans
62
+
63
+ Generate `tasks.csv` with 4 dimension rows (wave 1) + 1 cross-ref row (wave 2):
64
+
65
+ | id | dimension | focus |
66
+ |----|-----------|-------|
67
+ | 1 | structural | Class hierarchy, composition, DI, factories, exports |
68
+ | 2 | behavioral | Events, middleware, observer, command, state machines |
69
+ | 3 | data | Repository, DTO, caching, serialization, validation |
70
+ | 4 | error | Boundaries, retry/backoff, fallbacks, guards, logging |
71
+ | 5 | cross-ref | Dedup + catalog from wave 1 findings |
72
+
73
+ Each dimension agent returns:
74
+ ```json
75
+ [{
76
+ "name": "pattern name",
77
+ "dimension": "structural|behavioral|data|error",
78
+ "confidence": "high|medium|low",
79
+ "anchors": ["file:line"],
80
+ "description": "what it does",
81
+ "rationale": "why this approach",
82
+ "tradeoffs": "what was given up"
83
+ }]
84
+ ```
85
+
86
+ ### Phase 3: Wave 2 — Cross-Reference + Catalog
87
+
88
+ Single agent receives all wave 1 findings via `prev_context`. Tasks:
89
+ - Match against dedup set → mark as `documented`, `known`, or `new`
90
+ - Merge duplicates across dimensions (same pattern found by multiple agents)
91
+ - Flag contradictions with documented conventions
92
+ - Build pattern catalog grouped by dimension
93
+
94
+ ### Phase 4: Persist
95
+
96
+ 1. Write `decompose-{slug}-{date}.md` with full catalog
97
+ 2. Append each **new** pattern to `lessons.jsonl` (source: "decompose", category: "pattern")
98
+ 3. If `--save-spec`: invoke `spec-add` per new pattern
99
+ 4. If `--save-wiki`: create wiki note per dimension group
100
+ </execution>
101
+
102
+ <error_codes>
103
+ | Code | Severity | Condition | Recovery |
104
+ |------|----------|-----------|----------|
105
+ | E001 | error | Target path not found | Check path or use module name |
106
+ | E002 | error | No source files in target | Check target has .ts/.js files |
107
+ | W001 | warning | Dimension agent failed — partial results | Proceed with available dimensions |
108
+ | W002 | warning | coding-conventions.md not found | All patterns marked "new" |
109
+ </error_codes>
110
+
111
+ <success_criteria>
112
+ - [ ] Target resolved to concrete file list
113
+ - [ ] 4 dimension agents spawned in parallel via spawn_agents_on_csv
114
+ - [ ] Each finding has: name, dimension, confidence, anchors, description
115
+ - [ ] Cross-reference performed (documented / known / new)
116
+ - [ ] Pattern catalog written to `decompose-{slug}-{date}.md`
117
+ - [ ] New patterns appended to `lessons.jsonl` with stable INS-ids
118
+ - [ ] If --save-spec / --save-wiki: entries created
119
+ </success_criteria>
@@ -0,0 +1,83 @@
1
+ ---
2
+ name: learn-follow
3
+ description: Guided follow-along reading of code or wiki entries. Section-by-section walk-through with 4 forcing questions, pattern extraction, and understanding map generation. Persists insights to lessons.jsonl.
4
+ argument-hint: "<path|wiki-id|topic> [--depth shallow|deep] [--save-wiki]"
5
+ allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
6
+ ---
7
+
8
+ <purpose>
9
+ Guided reading experience for code files, wiki entries, or topics. Walks through content
10
+ section by section using 4 forcing questions to extract patterns, identify assumptions,
11
+ and build a structured understanding map. Insights persist to `lessons.jsonl`.
12
+
13
+ Unlike `learn-decompose` which is parallel pattern extraction, this is sequential
14
+ deep reading that builds understanding incrementally.
15
+ </purpose>
16
+
17
+ <context>
18
+ $ARGUMENTS — target and optional flags.
19
+
20
+ **Target resolution (auto-detected):**
21
+ - File path → Read source file
22
+ - Wiki ID (`type-slug`) → Fetch via `maestro wiki get`
23
+ - Topic string → Search via `maestro wiki search`, use top result
24
+
25
+ **Flags:**
26
+ - `--depth shallow` — Key patterns and structure only (default)
27
+ - `--depth deep` — Every function, branch, assumption
28
+ - `--save-wiki` — Create wiki note with reading notes
29
+
30
+ **Output**: `.workflow/learning/follow-{slug}-{date}.md`
31
+ </context>
32
+
33
+ <execution>
34
+
35
+ ### Stage 1: Resolve Target + Load Context Web
36
+ - File: verify exists, parse imports for dependency files
37
+ - Wiki ID: fetch + load forward/backlinks
38
+ - Topic: search wiki, take top result
39
+ - Build 1-hop context neighborhood (imports/exports or wiki links)
40
+
41
+ ### Stage 2: Build Reading Order
42
+ - Single file: split into logical sections (function/class boundaries)
43
+ - Directory: entry point → core modules → utilities → tests
44
+ - `--depth shallow`: top-level structure only
45
+ - `--depth deep`: every function body, every branch
46
+
47
+ ### Stage 3: Guided Reading (4 Forcing Questions per Section)
48
+ 1. **"What pattern is being used here?"** — design patterns, idioms, conventions
49
+ 2. **"Why this approach instead of alternatives?"** — trade-offs made
50
+ 3. **"What assumption does this depend on?"** — external state, input shape, ordering
51
+ 4. **"What would break if this changed?"** — fragility, downstream effects
52
+
53
+ ### Stage 4: Extract Patterns + Produce Understanding Map
54
+ From forcing question answers, extract: design patterns (with file:line anchors), naming conventions, error handling approach, data flow, assumptions.
55
+
56
+ Cross-reference against `coding-conventions.md`: documented vs undocumented patterns.
57
+
58
+ ### Stage 5: Persist
59
+ 1. Write `follow-{slug}-{date}.md` with understanding map
60
+ 2. Append new patterns to `lessons.jsonl` (source: "follow", stable INS-ids)
61
+ 3. If `--save-wiki`: create wiki note entry
62
+
63
+ **Next steps:** `/learn-decompose <path>`, `/spec-add coding ...`, `/learn-second-opinion <file>`
64
+ </execution>
65
+
66
+ <error_codes>
67
+ | Code | Severity | Condition | Recovery |
68
+ |------|----------|-----------|----------|
69
+ | E001 | error | Target not resolvable | Check path/ID or rephrase topic |
70
+ | W001 | warning | Wiki graph unavailable | Proceed with code-only context |
71
+ | W002 | warning | coding-conventions.md not found | Patterns flagged "unknown status" |
72
+ | W003 | warning | Large target (>1000 lines) | Auto-switch to shallow depth |
73
+ </error_codes>
74
+
75
+ <success_criteria>
76
+ - [ ] Target resolved to concrete content
77
+ - [ ] Context web loaded (imports/exports or wiki links)
78
+ - [ ] All 4 forcing questions applied per section
79
+ - [ ] Patterns extracted with file:line anchors
80
+ - [ ] Understanding map produced with concepts, patterns, assumptions, questions
81
+ - [ ] `follow-{slug}-{date}.md` written
82
+ - [ ] `lessons.jsonl` appended with stable INS-ids
83
+ </success_criteria>
@@ -0,0 +1,83 @@
1
+ ---
2
+ name: learn-investigate
3
+ description: Systematic question investigation with hypothesis testing, evidence logging, and 3-strike escalation. 4-phase pipeline — evidence collection, pattern matching, hypothesis testing, synthesis. Persists findings to lessons.jsonl.
4
+ argument-hint: "<question> [--scope <path>] [--max-hypotheses N]"
5
+ allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
6
+ ---
7
+
8
+ <purpose>
9
+ Systematic investigation for understanding questions (not bug-fixing). 4-phase approach
10
+ with scope lock and 3-strike escalation. Produces structured evidence trails and
11
+ understanding documents that persist to the learning system.
12
+
13
+ Unlike `quality-debug` (fixing bugs during execution), this answers "how does X work?",
14
+ "why does Y happen?", "what would happen if Z?" questions.
15
+ </purpose>
16
+
17
+ <context>
18
+ $ARGUMENTS — question text and optional flags.
19
+
20
+ **Flags:**
21
+ - `--scope <path>` — Restrict to files under this directory (default: entire project)
22
+ - `--max-hypotheses N` — Max hypotheses before escalating (default: 3)
23
+
24
+ **Output**: `.workflow/learning/investigate-{slug}/` (evidence.ndjson, understanding.md, report.md)
25
+ </context>
26
+
27
+ <execution>
28
+
29
+ ### Stage 1: Frame the Question
30
+ - Parse question, generate slug, create investigation directory
31
+ - Search prior knowledge: wiki search, grep lessons.jsonl, read debug-notes.md
32
+ - Write initial `understanding.md`
33
+
34
+ ### Stage 2: Evidence Collection
35
+ 1. **Code search**: Grep keywords across scoped files
36
+ 2. **File inspection**: Read most relevant files
37
+ 3. **Import tracing**: Follow dependency chain
38
+ 4. **Git history**: `git log --oneline -10 -- <relevant-files>`
39
+
40
+ Each evidence item → `evidence.ndjson`:
41
+ ```json
42
+ {"ts":"ISO","type":"code|git|search|doc","source":"file:line","relevance":"high|medium|low","content":"...","note":"..."}
43
+ ```
44
+
45
+ ### Stage 3: Hypothesis Formation + Testing
46
+ Generate ranked hypotheses from evidence. For each (in rank order):
47
+ 1. Design test: what evidence would confirm/disprove?
48
+ 2. Execute test: code trace, targeted search, experiment
49
+ 3. Record result in `evidence.ndjson` (type: "test")
50
+ 4. Update `understanding.md`: confirmed / disproved / inconclusive
51
+
52
+ ### Stage 4: 3-Strike Escalation
53
+ If all hypotheses fail: broaden scope, search wiki with alt keywords, or mark INCONCLUSIVE.
54
+
55
+ ### Stage 5: Synthesize + Persist
56
+ 1. Write `report.md` with answer, evidence trail, hypothesis results
57
+ 2. Append to `lessons.jsonl`:
58
+ - Confirmed → category: "technique" / "pattern"
59
+ - Disproved → category: "gotcha"
60
+ 3. Display summary with next-step routing
61
+
62
+ **Next steps:** `/spec-add debug <finding>`, `/learn-follow <path>`, `/learn-decompose <module>`
63
+ </execution>
64
+
65
+ <error_codes>
66
+ | Code | Severity | Condition | Recovery |
67
+ |------|----------|-----------|----------|
68
+ | E001 | error | No question provided | Provide question as first argument |
69
+ | E002 | error | Scope path does not exist | Check --scope path |
70
+ | W001 | warning | No prior knowledge found | Proceed with fresh investigation |
71
+ | W002 | warning | Very few evidence matches (<3) | Broaden search terms |
72
+ | W003 | warning | All hypotheses inconclusive | Marked INCONCLUSIVE |
73
+ </error_codes>
74
+
75
+ <success_criteria>
76
+ - [ ] Question parsed and investigation directory created
77
+ - [ ] Evidence collected and logged to evidence.ndjson
78
+ - [ ] At least 1 hypothesis formed and tested
79
+ - [ ] understanding.md tracks evolving understanding
80
+ - [ ] report.md written with answer and evidence trail
81
+ - [ ] Findings appended to lessons.jsonl with stable INS-ids
82
+ - [ ] 3-strike escalation triggered if all hypotheses fail
83
+ </success_criteria>
@@ -0,0 +1,83 @@
1
+ ---
2
+ name: learn-retro
3
+ description: Unified retrospective via CSV wave pipeline. Git lens (commit metrics, session detection, hotspots) and decision lens (multi-perspective evaluation via 3 parallel agents) with lens-based selection. Persists insights to lessons.jsonl.
4
+ argument-hint: "[-y|--yes] [-c|--concurrency N] [--continue] \"[--lens git|decision|all] [--days N] [--author <name>] [--area <path>] [--phase N] [--compare]\""
5
+ allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
6
+ ---
7
+
8
+ <purpose>
9
+ Unified retrospective combining git activity analysis and decision quality evaluation.
10
+ Two lenses, usable independently or together:
11
+ - **git**: Commit metrics, session detection, per-author breakdown, file hotspots, trends
12
+ - **decision**: Decision tracing across wiki/specs/git, multi-perspective evaluation via 3 parallel agents
13
+
14
+ Works on raw git history and wiki/spec data — does not require completed phase artifacts.
15
+ </purpose>
16
+
17
+ <context>
18
+ $ARGUMENTS — lens selection and scope flags.
19
+
20
+ **Lens:** `--lens git` | `--lens decision` | `--lens all` (default)
21
+
22
+ **Git flags:** `--days N` (default: 7), `--author <name>`, `--area <path>`, `--compare`
23
+ **Decision flags:** `--phase N`, `--tag <tag>`, `--id <id>`
24
+
25
+ **Output**: `.workflow/learning/retro-{date}.md` + `retro-{date}.json`
26
+ </context>
27
+
28
+ <execution>
29
+
30
+ ### Phase 1: Parse + Select Lenses
31
+
32
+ ### Phase 2: Git Lens (skip if --lens decision)
33
+ **Sequential data gathering** (parallel git commands):
34
+ - Commit stats with shortstat
35
+ - Per-commit numstat for test/production LOC split
36
+ - Timestamps for session detection (>2hr gap clustering)
37
+ - File hotspots (most frequently changed)
38
+ - Per-author commit counts
39
+
40
+ **Compute**: commits, LOC, test ratio, churn rate, active days, sessions, per-author breakdown.
41
+ **Trend comparison** if prior `retro-*.json` exists.
42
+
43
+ ### Phase 3: Decision Lens (skip if --lens git)
44
+ **3a: Collect decisions** from wiki, specs, git log, phase context, lessons.jsonl.
45
+ **3b: Build decision registry** per decision (id, title, source, rationale, alternatives, evidence).
46
+
47
+ **3c: Multi-perspective evaluation** via spawn_agents_on_csv (3 parallel agents):
48
+
49
+ | id | perspective | focus |
50
+ |----|------------|-------|
51
+ | 1 | technical | Implementation vs intent, context drift. Grade: sound/degraded/violated |
52
+ | 2 | cost | Complexity added, coupling, tech debt. Grade: low-cost/acceptable/expensive |
53
+ | 3 | hindsight | Right call with current knowledge? Grade: confirmed/questionable/should-revisit |
54
+
55
+ **3d: Classify lifecycle**: Validated / Aging / Questionable / Stale / Reversed.
56
+
57
+ ### Phase 4: Unified Report
58
+ Write `retro-{date}.md` + `retro-{date}.json` with metrics, sessions, hotspots, decision health, combined insights, recommended actions.
59
+
60
+ ### Phase 5: Persist
61
+ Append insights to `lessons.jsonl` (source: "retro-git" or "retro-decision"). Display summary.
62
+
63
+ **Next steps:** `/learn-follow <path>`, `/quality-test-gen <area>`, `/learn-investigate <question>`
64
+ </execution>
65
+
66
+ <error_codes>
67
+ | Code | Severity | Condition | Recovery |
68
+ |------|----------|-----------|----------|
69
+ | E001 | error | Not inside git repo (git lens) | Navigate to git repo |
70
+ | E002 | error | No commits in time window | Increase --days |
71
+ | E003 | error | No decisions found (decision lens) | Check wiki/specs content |
72
+ | W001 | warning | .workflow/learning/ not found | Auto-bootstrap |
73
+ | W002 | warning | No prior retro for comparison | First retro establishes baseline |
74
+ | W003 | warning | Decision perspective agent failed | Proceed with partial evaluation |
75
+ </error_codes>
76
+
77
+ <success_criteria>
78
+ - [ ] Lens selection parsed correctly
79
+ - [ ] Git lens: metrics computed, sessions detected, hotspots identified
80
+ - [ ] Decision lens: decisions collected, 3 agents spawned in parallel, lifecycle classified
81
+ - [ ] Unified report written to retro-{date}.md + retro-{date}.json
82
+ - [ ] lessons.jsonl appended with insights (stable INS-ids)
83
+ </success_criteria>
@@ -0,0 +1,86 @@
1
+ ---
2
+ name: learn-second-opinion
3
+ description: Multi-perspective analysis via CSV wave pipeline. Review mode spawns 3 parallel persona agents (pragmatist, purist, strategist), then synthesis agent merges verdicts. Also supports challenge and consult modes. Persists findings to lessons.jsonl.
4
+ argument-hint: "[-y|--yes] [-c|--concurrency 3] [--continue] \"<target> [--mode review|challenge|consult]\""
5
+ allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
6
+ ---
7
+
8
+ <purpose>
9
+ Structured second-opinion for code, decisions, or plans. Three modes:
10
+ - **review** (default): 3 parallel persona agents independently assess target via spawn_agents_on_csv
11
+ - **challenge**: single adversarial agent via spawn_agents_on_csv (1 worker)
12
+ - **consult**: interactive Q&A (no CSV wave — direct orchestration)
13
+
14
+ Findings persist to `lessons.jsonl`. Decoupled from phase lifecycle.
15
+ </purpose>
16
+
17
+ <context>
18
+ $ARGUMENTS — target and optional flags.
19
+
20
+ **Target resolution (auto-detected):**
21
+ - File path → analyze file content
22
+ - Wiki ID (`type-slug`) → fetch via `maestro wiki get`
23
+ - `HEAD` / `staged` → analyze git diff
24
+ - Phase number → analyze phase plan
25
+
26
+ **Flags:**
27
+ - `--mode review` — 3-persona parallel review (default)
28
+ - `--mode challenge` — Adversarial single-agent analysis
29
+ - `--mode consult` — Interactive Q&A session
30
+
31
+ **Output**: `.workflow/learning/opinion-{slug}-{date}.md`
32
+ </context>
33
+
34
+ <execution>
35
+
36
+ ### Phase 1: Resolve Target + Load Context
37
+ Resolve target to content. Load specs, wiki search, prior lessons for context brief.
38
+
39
+ ### Phase 2: Execute Mode
40
+
41
+ #### Review Mode (spawn_agents_on_csv)
42
+
43
+ | id | persona | focus | grading |
44
+ |----|---------|-------|---------|
45
+ | 1 | pragmatist | Simplicity, YAGNI, maintenance cost, readability | complexity score, abstraction depth |
46
+ | 2 | purist | Correctness, type safety, edge cases, error handling | error paths, type completeness |
47
+ | 3 | strategist | Scalability, extensibility, architecture alignment | coupling, cohesion |
48
+ | 4 | synthesis | Merge verdicts → agreements, disagreements, top 3 recommendations | combined verdict |
49
+
50
+ Wave 1: 3 persona agents in parallel. Wave 2: synthesis agent with wave 1 findings as prev_context.
51
+
52
+ Each persona returns: `{ persona, verdict: approve|concern|reject, confidence, findings: [{severity, description, location, suggestion}], summary }`
53
+
54
+ #### Challenge Mode
55
+ Single agent via spawn_agents_on_csv (1 worker). Adversarial analysis with forcing questions:
56
+ - "What assumption would invalidate this entire approach?"
57
+ - "What's the simplest thing that breaks this?"
58
+ - "What's the implicit contract that isn't enforced?"
59
+
60
+ #### Consult Mode
61
+ Interactive loop via AskUserQuestion. Agent studies target, answers questions with code references. Compile Q&A into report on exit.
62
+
63
+ ### Phase 3: Persist
64
+ 1. Write `opinion-{slug}-{date}.md` with per-persona findings + synthesis
65
+ 2. Append non-trivial findings to `lessons.jsonl` (source: "second-opinion")
66
+ 3. Display summary with verdict and next steps
67
+
68
+ **Next steps:** `/manage-issue create`, `/learn-decompose <path>`, `/learn-follow <path>`
69
+ </execution>
70
+
71
+ <error_codes>
72
+ | Code | Severity | Condition | Recovery |
73
+ |------|----------|-----------|----------|
74
+ | E001 | error | Target not resolvable | Verify path/ID |
75
+ | E002 | error | Unknown --mode value | Use: review, challenge, consult |
76
+ | W001 | warning | Persona agent failed — partial perspectives | Proceed with available agents |
77
+ | W003 | warning | Git diff empty for HEAD/staged | Use file path instead |
78
+ </error_codes>
79
+
80
+ <success_criteria>
81
+ - [ ] Target resolved and context loaded
82
+ - [ ] Mode executed: review (3 parallel agents), challenge (adversarial), or consult (interactive)
83
+ - [ ] Synthesis produced with agreements, disagreements, verdict
84
+ - [ ] Report written to `opinion-{slug}-{date}.md`
85
+ - [ ] Non-trivial findings appended to `lessons.jsonl`
86
+ </success_criteria>