maestro-flow-one 0.1.0

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 (106) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +173 -0
  3. package/bin/maestro-flow.js +730 -0
  4. package/claude/maestro-flow/SKILL.md +239 -0
  5. package/claude/maestro-flow/chains/templates.json +256 -0
  6. package/claude/maestro-flow/commands/learn/decompose.md +176 -0
  7. package/claude/maestro-flow/commands/learn/follow.md +167 -0
  8. package/claude/maestro-flow/commands/learn/investigate.md +221 -0
  9. package/claude/maestro-flow/commands/learn/retro.md +303 -0
  10. package/claude/maestro-flow/commands/learn/second-opinion.md +167 -0
  11. package/claude/maestro-flow/commands/lifecycle/amend.md +300 -0
  12. package/claude/maestro-flow/commands/lifecycle/analyze.md +126 -0
  13. package/claude/maestro-flow/commands/lifecycle/brainstorm.md +100 -0
  14. package/claude/maestro-flow/commands/lifecycle/composer.md +354 -0
  15. package/claude/maestro-flow/commands/lifecycle/execute.md +114 -0
  16. package/claude/maestro-flow/commands/lifecycle/fork.md +86 -0
  17. package/claude/maestro-flow/commands/lifecycle/init.md +78 -0
  18. package/claude/maestro-flow/commands/lifecycle/learn.md +140 -0
  19. package/claude/maestro-flow/commands/lifecycle/link-coordinate.md +71 -0
  20. package/claude/maestro-flow/commands/lifecycle/merge.md +61 -0
  21. package/claude/maestro-flow/commands/lifecycle/overlay.md +178 -0
  22. package/claude/maestro-flow/commands/lifecycle/plan.md +138 -0
  23. package/claude/maestro-flow/commands/lifecycle/player.md +404 -0
  24. package/claude/maestro-flow/commands/lifecycle/quick.md +56 -0
  25. package/claude/maestro-flow/commands/lifecycle/roadmap.md +164 -0
  26. package/claude/maestro-flow/commands/lifecycle/ui-design.md +93 -0
  27. package/claude/maestro-flow/commands/lifecycle/update.md +176 -0
  28. package/claude/maestro-flow/commands/lifecycle/verify.md +90 -0
  29. package/claude/maestro-flow/commands/manage/codebase-rebuild.md +75 -0
  30. package/claude/maestro-flow/commands/manage/codebase-refresh.md +57 -0
  31. package/claude/maestro-flow/commands/manage/harvest.md +94 -0
  32. package/claude/maestro-flow/commands/manage/issue-discover.md +77 -0
  33. package/claude/maestro-flow/commands/manage/issue.md +73 -0
  34. package/claude/maestro-flow/commands/manage/knowhow-capture.md +193 -0
  35. package/claude/maestro-flow/commands/manage/knowhow.md +77 -0
  36. package/claude/maestro-flow/commands/manage/learn.md +67 -0
  37. package/claude/maestro-flow/commands/manage/status.md +51 -0
  38. package/claude/maestro-flow/commands/manage/wiki.md +62 -0
  39. package/claude/maestro-flow/commands/milestone/audit.md +68 -0
  40. package/claude/maestro-flow/commands/milestone/complete.md +75 -0
  41. package/claude/maestro-flow/commands/milestone/release.md +96 -0
  42. package/claude/maestro-flow/commands/quality/auto-test.md +124 -0
  43. package/claude/maestro-flow/commands/quality/debug.md +115 -0
  44. package/claude/maestro-flow/commands/quality/refactor.md +55 -0
  45. package/claude/maestro-flow/commands/quality/retrospective.md +78 -0
  46. package/claude/maestro-flow/commands/quality/review.md +108 -0
  47. package/claude/maestro-flow/commands/quality/sync.md +51 -0
  48. package/claude/maestro-flow/commands/quality/test.md +103 -0
  49. package/claude/maestro-flow/commands/spec/add.md +49 -0
  50. package/claude/maestro-flow/commands/spec/load.md +51 -0
  51. package/claude/maestro-flow/commands/spec/remove.md +51 -0
  52. package/claude/maestro-flow/commands/spec/setup.md +51 -0
  53. package/claude/maestro-flow/commands/wiki/connect.md +62 -0
  54. package/claude/maestro-flow/commands/wiki/digest.md +69 -0
  55. package/codex/maestro-flow/SKILL.md +505 -0
  56. package/codex/maestro-flow/chains/templates.json +256 -0
  57. package/codex/maestro-flow/commands/learn/decompose.md +113 -0
  58. package/codex/maestro-flow/commands/learn/follow.md +83 -0
  59. package/codex/maestro-flow/commands/learn/investigate.md +83 -0
  60. package/codex/maestro-flow/commands/learn/retro.md +83 -0
  61. package/codex/maestro-flow/commands/learn/second-opinion.md +86 -0
  62. package/codex/maestro-flow/commands/lifecycle/amend.md +300 -0
  63. package/codex/maestro-flow/commands/lifecycle/analyze.md +483 -0
  64. package/codex/maestro-flow/commands/lifecycle/brainstorm.md +397 -0
  65. package/codex/maestro-flow/commands/lifecycle/composer.md +213 -0
  66. package/codex/maestro-flow/commands/lifecycle/execute.md +318 -0
  67. package/codex/maestro-flow/commands/lifecycle/fork.md +98 -0
  68. package/codex/maestro-flow/commands/lifecycle/init.md +134 -0
  69. package/codex/maestro-flow/commands/lifecycle/learn.md +80 -0
  70. package/codex/maestro-flow/commands/lifecycle/link-coordinate.md +257 -0
  71. package/codex/maestro-flow/commands/lifecycle/merge.md +69 -0
  72. package/codex/maestro-flow/commands/lifecycle/overlay.md +119 -0
  73. package/codex/maestro-flow/commands/lifecycle/plan.md +460 -0
  74. package/codex/maestro-flow/commands/lifecycle/player.md +323 -0
  75. package/codex/maestro-flow/commands/lifecycle/quick.md +124 -0
  76. package/codex/maestro-flow/commands/lifecycle/roadmap.md +468 -0
  77. package/codex/maestro-flow/commands/lifecycle/ui-design.md +135 -0
  78. package/codex/maestro-flow/commands/lifecycle/update.md +176 -0
  79. package/codex/maestro-flow/commands/lifecycle/verify.md +468 -0
  80. package/codex/maestro-flow/commands/manage/codebase-rebuild.md +347 -0
  81. package/codex/maestro-flow/commands/manage/codebase-refresh.md +66 -0
  82. package/codex/maestro-flow/commands/manage/harvest.md +91 -0
  83. package/codex/maestro-flow/commands/manage/issue-discover.md +431 -0
  84. package/codex/maestro-flow/commands/manage/issue.md +75 -0
  85. package/codex/maestro-flow/commands/manage/knowhow-capture.md +110 -0
  86. package/codex/maestro-flow/commands/manage/knowhow.md +95 -0
  87. package/codex/maestro-flow/commands/manage/learn.md +137 -0
  88. package/codex/maestro-flow/commands/manage/status.md +76 -0
  89. package/codex/maestro-flow/commands/manage/wiki.md +55 -0
  90. package/codex/maestro-flow/commands/milestone/audit.md +87 -0
  91. package/codex/maestro-flow/commands/milestone/complete.md +91 -0
  92. package/codex/maestro-flow/commands/milestone/release.md +70 -0
  93. package/codex/maestro-flow/commands/quality/auto-test.md +547 -0
  94. package/codex/maestro-flow/commands/quality/debug.md +334 -0
  95. package/codex/maestro-flow/commands/quality/refactor.md +151 -0
  96. package/codex/maestro-flow/commands/quality/retrospective.md +292 -0
  97. package/codex/maestro-flow/commands/quality/review.md +364 -0
  98. package/codex/maestro-flow/commands/quality/sync.md +111 -0
  99. package/codex/maestro-flow/commands/quality/test.md +498 -0
  100. package/codex/maestro-flow/commands/spec/add.md +101 -0
  101. package/codex/maestro-flow/commands/spec/load.md +77 -0
  102. package/codex/maestro-flow/commands/spec/remove.md +69 -0
  103. package/codex/maestro-flow/commands/spec/setup.md +75 -0
  104. package/codex/maestro-flow/commands/wiki/connect.md +73 -0
  105. package/codex/maestro-flow/commands/wiki/digest.md +87 -0
  106. package/package.json +24 -0
@@ -0,0 +1,256 @@
1
+ {
2
+ "version": "2.0",
3
+ "decision_types": {
4
+ "post-verify": {
5
+ "evaluates": "verification.json",
6
+ "verdict_prompt": "评估验证结果: passed/failed 状态, gaps 严重性",
7
+ "fix_loop": ["quality-debug", "maestro-plan --gaps", "maestro-execute", "maestro-verify", "decision:post-verify"]
8
+ },
9
+ "post-review": {
10
+ "evaluates": "review.json",
11
+ "verdict_prompt": "评估代码审查结果: verdict PASS/WARN/BLOCK",
12
+ "fix_loop": ["quality-debug", "maestro-plan --gaps", "maestro-execute", "quality-review", "decision:post-review"]
13
+ },
14
+ "post-test": {
15
+ "evaluates": "uat.md, test-results.json",
16
+ "verdict_prompt": "评估测试结果: 通过率, 失败用例严重性",
17
+ "fix_loop": ["quality-debug", "maestro-plan --gaps", "maestro-execute", "maestro-verify", "decision:post-verify", "quality-test", "decision:post-test"]
18
+ },
19
+ "post-business-test": {
20
+ "evaluates": "business-test-results.json",
21
+ "verdict_prompt": "评估业务测试结果: 需求覆盖率, 失败场景",
22
+ "fix_loop": ["quality-debug", "maestro-plan --gaps", "maestro-execute", "maestro-verify", "decision:post-verify", "quality-auto-test", "decision:post-business-test"]
23
+ },
24
+ "post-milestone": {
25
+ "evaluates": "state.json",
26
+ "verdict_prompt": "检查是否有下一个 milestone",
27
+ "structural": true
28
+ }
29
+ },
30
+ "templates": {
31
+ "quick-fix": {
32
+ "description": "Diagnose and fix a known bug",
33
+ "category": "quick-fix",
34
+ "triggers": ["fix", "debug", "bug", "error", "crash", "broken"],
35
+ "steps": [
36
+ { "cmd": "quality-debug", "args": "\"{intent}\"", "type": "internal" },
37
+ { "cmd": "maestro-plan", "args": "{phase} --gaps", "type": "internal" },
38
+ { "cmd": "maestro-execute", "args": "{phase}", "type": "external" },
39
+ { "cmd": "maestro-verify", "args": "{phase}", "type": "internal" },
40
+ { "cmd": "decision:post-verify", "args": "", "type": "decision", "decision": "post-verify", "retry_count": 0, "max_retries": 2 }
41
+ ]
42
+ },
43
+ "issue-fix": {
44
+ "description": "Analyze, plan, fix, and close a tracked issue",
45
+ "category": "quick-fix",
46
+ "triggers": ["issue", "ISS-", "ticket"],
47
+ "steps": [
48
+ { "cmd": "maestro-analyze", "args": "--gaps {issue_id}", "type": "external" },
49
+ { "cmd": "maestro-plan", "args": "--gaps", "type": "internal" },
50
+ { "cmd": "maestro-execute", "args": "{phase}", "type": "external" },
51
+ { "cmd": "maestro-verify", "args": "{phase}", "type": "internal" },
52
+ { "cmd": "decision:post-verify", "args": "", "type": "decision", "decision": "post-verify", "retry_count": 0, "max_retries": 2 },
53
+ { "cmd": "quality-review", "args": "{phase}", "type": "internal" },
54
+ { "cmd": "decision:post-review", "args": "", "type": "decision", "decision": "post-review", "retry_count": 0, "max_retries": 2 },
55
+ { "cmd": "manage-issue", "args": "close {issue_id} --resolution fixed", "type": "internal" }
56
+ ]
57
+ },
58
+ "analyze-plan-execute": {
59
+ "description": "Fast track: analyze, plan, and implement",
60
+ "category": "feature-build",
61
+ "triggers": ["implement", "build", "create", "develop", "add feature"],
62
+ "steps": [
63
+ { "cmd": "maestro-analyze", "args": "\"{intent}\"", "type": "external" },
64
+ { "cmd": "maestro-plan", "args": "--dir {scratch_dir}", "type": "internal" },
65
+ { "cmd": "maestro-execute", "args": "--dir {scratch_dir}", "type": "external" }
66
+ ]
67
+ },
68
+ "plan-execute-verify": {
69
+ "description": "Full phase: plan, execute, verify with quality gate",
70
+ "category": "feature-build",
71
+ "triggers": ["plan and execute", "phase", "plan execute"],
72
+ "steps": [
73
+ { "cmd": "maestro-plan", "args": "{phase}", "type": "internal" },
74
+ { "cmd": "maestro-execute", "args": "{phase}", "type": "external" },
75
+ { "cmd": "maestro-verify", "args": "{phase}", "type": "internal" },
76
+ { "cmd": "decision:post-verify", "args": "", "type": "decision", "decision": "post-verify", "retry_count": 0, "max_retries": 2 }
77
+ ]
78
+ },
79
+ "execute-verify": {
80
+ "description": "Execute existing plan and verify",
81
+ "category": "feature-build",
82
+ "triggers": ["execute", "run plan", "implement plan"],
83
+ "steps": [
84
+ { "cmd": "maestro-execute", "args": "{phase}", "type": "external" },
85
+ { "cmd": "maestro-verify", "args": "{phase}", "type": "internal" }
86
+ ]
87
+ },
88
+ "quality-loop": {
89
+ "description": "Full quality check: verify, review, test with decision gates",
90
+ "category": "quality-check",
91
+ "triggers": ["check quality", "review and test", "quality", "qa"],
92
+ "steps": [
93
+ { "cmd": "maestro-verify", "args": "{phase}", "type": "internal" },
94
+ { "cmd": "decision:post-verify", "args": "", "type": "decision", "decision": "post-verify", "retry_count": 0, "max_retries": 2 },
95
+ { "cmd": "quality-review", "args": "{phase}", "type": "internal" },
96
+ { "cmd": "decision:post-review", "args": "", "type": "decision", "decision": "post-review", "retry_count": 0, "max_retries": 2 },
97
+ { "cmd": "quality-auto-test", "args": "{phase}", "type": "internal" },
98
+ { "cmd": "quality-test", "args": "{phase}", "type": "internal" },
99
+ { "cmd": "decision:post-test", "args": "", "type": "decision", "decision": "post-test", "retry_count": 0, "max_retries": 2 }
100
+ ]
101
+ },
102
+ "review-fix": {
103
+ "description": "Fix review-blocked issues",
104
+ "category": "quality-check",
105
+ "triggers": ["fix review", "review block", "review fail"],
106
+ "steps": [
107
+ { "cmd": "maestro-plan", "args": "{phase} --gaps", "type": "internal" },
108
+ { "cmd": "maestro-execute", "args": "{phase}", "type": "external" },
109
+ { "cmd": "quality-review", "args": "{phase}", "type": "internal" },
110
+ { "cmd": "decision:post-review", "args": "", "type": "decision", "decision": "post-review", "retry_count": 0, "max_retries": 2 }
111
+ ]
112
+ },
113
+ "brainstorm-driven": {
114
+ "description": "Explore idea then plan and build",
115
+ "category": "explore",
116
+ "triggers": ["brainstorm", "explore idea", "ideate"],
117
+ "steps": [
118
+ { "cmd": "maestro-brainstorm", "args": "\"{intent}\"", "type": "external" },
119
+ { "cmd": "maestro-plan", "args": "{phase}", "type": "internal" },
120
+ { "cmd": "maestro-execute", "args": "{phase}", "type": "external" },
121
+ { "cmd": "maestro-verify", "args": "{phase}", "type": "internal" },
122
+ { "cmd": "decision:post-verify", "args": "", "type": "decision", "decision": "post-verify", "retry_count": 0, "max_retries": 2 }
123
+ ]
124
+ },
125
+ "roadmap-driven": {
126
+ "description": "From requirements to roadmap to first phase with gates",
127
+ "category": "lifecycle",
128
+ "triggers": ["roadmap", "from requirements", "start project", "new project"],
129
+ "steps": [
130
+ { "cmd": "maestro-init", "args": "", "type": "internal" },
131
+ { "cmd": "maestro-roadmap", "args": "\"{intent}\"", "type": "internal" },
132
+ { "cmd": "maestro-analyze", "args": "{phase}", "type": "external" },
133
+ { "cmd": "maestro-plan", "args": "{phase}", "type": "internal" },
134
+ { "cmd": "maestro-execute", "args": "{phase}", "type": "external" },
135
+ { "cmd": "maestro-verify", "args": "{phase}", "type": "internal" },
136
+ { "cmd": "decision:post-verify", "args": "", "type": "decision", "decision": "post-verify", "retry_count": 0, "max_retries": 2 },
137
+ { "cmd": "quality-review", "args": "{phase}", "type": "internal" },
138
+ { "cmd": "decision:post-review", "args": "", "type": "decision", "decision": "post-review", "retry_count": 0, "max_retries": 2 }
139
+ ]
140
+ },
141
+ "full-lifecycle": {
142
+ "description": "Complete phase lifecycle with all quality gates (ralph-equivalent)",
143
+ "category": "lifecycle",
144
+ "triggers": ["full lifecycle", "complete phase", "lifecycle", "ralph"],
145
+ "steps": [
146
+ { "cmd": "maestro-analyze", "args": "{phase}", "type": "external" },
147
+ { "cmd": "maestro-plan", "args": "{phase}", "type": "internal" },
148
+ { "cmd": "maestro-execute", "args": "{phase}", "type": "external" },
149
+ { "cmd": "maestro-verify", "args": "{phase}", "type": "internal" },
150
+ { "cmd": "decision:post-verify", "args": "", "type": "decision", "decision": "post-verify", "retry_count": 0, "max_retries": 2 },
151
+ { "cmd": "quality-auto-test", "args": "{phase}", "type": "internal" },
152
+ { "cmd": "decision:post-business-test", "args": "", "type": "decision", "decision": "post-business-test", "retry_count": 0, "max_retries": 2 },
153
+ { "cmd": "quality-review", "args": "{phase}", "type": "internal" },
154
+ { "cmd": "decision:post-review", "args": "", "type": "decision", "decision": "post-review", "retry_count": 0, "max_retries": 2 },
155
+ { "cmd": "quality-auto-test", "args": "{phase}", "type": "internal" },
156
+ { "cmd": "quality-test", "args": "{phase}", "type": "internal" },
157
+ { "cmd": "decision:post-test", "args": "", "type": "decision", "decision": "post-test", "retry_count": 0, "max_retries": 2 },
158
+ { "cmd": "maestro-milestone-audit", "args": "", "type": "internal" },
159
+ { "cmd": "maestro-milestone-complete", "args": "", "type": "internal" },
160
+ { "cmd": "decision:post-milestone", "args": "", "type": "decision", "decision": "post-milestone" }
161
+ ]
162
+ },
163
+ "standard-lifecycle": {
164
+ "description": "Standard phase lifecycle: verify + review + test gates",
165
+ "category": "lifecycle",
166
+ "triggers": ["standard lifecycle", "standard phase", "standard"],
167
+ "steps": [
168
+ { "cmd": "maestro-plan", "args": "{phase}", "type": "internal" },
169
+ { "cmd": "maestro-execute", "args": "{phase}", "type": "external" },
170
+ { "cmd": "maestro-verify", "args": "{phase}", "type": "internal" },
171
+ { "cmd": "decision:post-verify", "args": "", "type": "decision", "decision": "post-verify", "retry_count": 0, "max_retries": 2 },
172
+ { "cmd": "quality-review", "args": "{phase}", "type": "internal" },
173
+ { "cmd": "decision:post-review", "args": "", "type": "decision", "decision": "post-review", "retry_count": 0, "max_retries": 2 },
174
+ { "cmd": "quality-test", "args": "{phase}", "type": "internal" },
175
+ { "cmd": "decision:post-test", "args": "", "type": "decision", "decision": "post-test", "retry_count": 0, "max_retries": 2 },
176
+ { "cmd": "maestro-milestone-audit", "args": "", "type": "internal" }
177
+ ]
178
+ },
179
+ "milestone-close": {
180
+ "description": "Audit and close current milestone",
181
+ "category": "milestone",
182
+ "triggers": ["close milestone", "complete milestone", "milestone done"],
183
+ "steps": [
184
+ { "cmd": "maestro-milestone-audit", "args": "", "type": "internal" },
185
+ { "cmd": "maestro-milestone-complete", "args": "", "type": "internal" },
186
+ { "cmd": "decision:post-milestone", "args": "", "type": "decision", "decision": "post-milestone" }
187
+ ]
188
+ },
189
+ "milestone-release": {
190
+ "description": "Audit and release milestone with version tag",
191
+ "category": "milestone",
192
+ "triggers": ["release", "publish", "tag version", "ship"],
193
+ "steps": [
194
+ { "cmd": "maestro-milestone-audit", "args": "", "type": "internal" },
195
+ { "cmd": "maestro-milestone-release", "args": "", "type": "internal" }
196
+ ]
197
+ },
198
+ "learn-deep": {
199
+ "description": "Deep module understanding: read, decompose, critique",
200
+ "category": "explore",
201
+ "triggers": ["understand", "deep learn", "study", "learn module"],
202
+ "steps": [
203
+ { "cmd": "learn-follow", "args": "\"{intent}\"", "type": "internal" },
204
+ { "cmd": "learn-decompose", "args": "\"{intent}\"", "type": "internal" },
205
+ { "cmd": "learn-second-opinion", "args": "\"{intent}\" --mode challenge", "type": "internal" }
206
+ ]
207
+ }
208
+ },
209
+ "single_commands": {
210
+ "status": "manage-status",
211
+ "init": "maestro-init",
212
+ "analyze": "maestro-analyze",
213
+ "plan": "maestro-plan",
214
+ "execute": "maestro-execute",
215
+ "verify": "maestro-verify",
216
+ "review": "quality-review",
217
+ "test": "quality-test",
218
+ "auto-test": "quality-auto-test",
219
+ "debug": "quality-debug",
220
+ "refactor": "quality-refactor",
221
+ "sync": "quality-sync",
222
+ "retrospective": "quality-retrospective",
223
+ "issue": "manage-issue",
224
+ "discover-issues": "manage-issue-discover",
225
+ "harvest": "manage-harvest",
226
+ "knowhow": "manage-knowhow",
227
+ "knowhow-capture": "manage-knowhow-capture",
228
+ "spec-add": "spec-add",
229
+ "spec-load": "spec-load",
230
+ "spec-remove": "spec-remove",
231
+ "spec-setup": "spec-setup",
232
+ "wiki": "manage-wiki",
233
+ "wiki-connect": "wiki-connect",
234
+ "wiki-digest": "wiki-digest",
235
+ "brainstorm": "maestro-brainstorm",
236
+ "roadmap": "maestro-roadmap",
237
+ "fork": "maestro-fork",
238
+ "merge": "maestro-merge",
239
+ "quick": "maestro-quick",
240
+ "learn-follow": "learn-follow",
241
+ "learn-investigate": "learn-investigate",
242
+ "learn-decompose": "learn-decompose",
243
+ "learn-retro": "learn-retro",
244
+ "learn-second-opinion": "learn-second-opinion",
245
+ "amend": "maestro-amend",
246
+ "compose": "maestro-composer",
247
+ "play": "maestro-player",
248
+ "update": "maestro-update",
249
+ "ui-design": "maestro-ui-design",
250
+ "milestone-audit": "maestro-milestone-audit",
251
+ "milestone-complete": "maestro-milestone-complete",
252
+ "milestone-release": "maestro-milestone-release",
253
+ "codebase-rebuild": "manage-codebase-rebuild",
254
+ "codebase-refresh": "manage-codebase-refresh"
255
+ }
256
+ }
@@ -0,0 +1,113 @@
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
+ Parse flags from `$ARGUMENTS`: `-y`/`--yes`, `--patterns <list>`, `--save-spec`, `--save-wiki`, `--continue`, `-c N`.
51
+ Extract remaining text as target path/module.
52
+
53
+ Resolve target to file list. Load existing patterns from `coding-conventions.md` + `lessons.jsonl` for dedup set.
54
+
55
+ ### Phase 2: Wave 1 — Parallel Dimension Scans
56
+
57
+ Generate `tasks.csv` with 4 dimension rows (wave 1) + 1 cross-ref row (wave 2):
58
+
59
+ | id | dimension | focus |
60
+ |----|-----------|-------|
61
+ | 1 | structural | Class hierarchy, composition, DI, factories, exports |
62
+ | 2 | behavioral | Events, middleware, observer, command, state machines |
63
+ | 3 | data | Repository, DTO, caching, serialization, validation |
64
+ | 4 | error | Boundaries, retry/backoff, fallbacks, guards, logging |
65
+ | 5 | cross-ref | Dedup + catalog from wave 1 findings |
66
+
67
+ Each dimension agent returns:
68
+ ```json
69
+ [{
70
+ "name": "pattern name",
71
+ "dimension": "structural|behavioral|data|error",
72
+ "confidence": "high|medium|low",
73
+ "anchors": ["file:line"],
74
+ "description": "what it does",
75
+ "rationale": "why this approach",
76
+ "tradeoffs": "what was given up"
77
+ }]
78
+ ```
79
+
80
+ ### Phase 3: Wave 2 — Cross-Reference + Catalog
81
+
82
+ Single agent receives all wave 1 findings via `prev_context`. Tasks:
83
+ - Match against dedup set → mark as `documented`, `known`, or `new`
84
+ - Merge duplicates across dimensions (same pattern found by multiple agents)
85
+ - Flag contradictions with documented conventions
86
+ - Build pattern catalog grouped by dimension
87
+
88
+ ### Phase 4: Persist
89
+
90
+ 1. Write `decompose-{slug}-{date}.md` with full catalog
91
+ 2. Append each **new** pattern to `lessons.jsonl` (source: "decompose", category: "pattern")
92
+ 3. If `--save-spec`: invoke `spec-add` per new pattern
93
+ 4. If `--save-wiki`: create wiki note per dimension group
94
+ </execution>
95
+
96
+ <error_codes>
97
+ | Code | Severity | Condition | Recovery |
98
+ |------|----------|-----------|----------|
99
+ | E001 | error | Target path not found | Check path or use module name |
100
+ | E002 | error | No source files in target | Check target has .ts/.js files |
101
+ | W001 | warning | Dimension agent failed — partial results | Proceed with available dimensions |
102
+ | W002 | warning | coding-conventions.md not found | All patterns marked "new" |
103
+ </error_codes>
104
+
105
+ <success_criteria>
106
+ - [ ] Target resolved to concrete file list
107
+ - [ ] 4 dimension agents spawned in parallel via spawn_agents_on_csv
108
+ - [ ] Each finding has: name, dimension, confidence, anchors, description
109
+ - [ ] Cross-reference performed (documented / known / new)
110
+ - [ ] Pattern catalog written to `decompose-{slug}-{date}.md`
111
+ - [ ] New patterns appended to `lessons.jsonl` with stable INS-ids
112
+ - [ ] If --save-spec / --save-wiki: entries created
113
+ </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-auto-test <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>