maestro-flow 0.3.10 → 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 (184) 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-coordinate.md +1 -3
  9. package/.claude/commands/manage-harvest.md +131 -131
  10. package/.claude/commands/manage-issue.md +2 -2
  11. package/.claude/commands/spec-add.md +67 -56
  12. package/.claude/commands/spec-load.md +66 -64
  13. package/.claude/commands/spec-setup.md +5 -9
  14. package/.codex/skills/learn-decompose/SKILL.md +119 -0
  15. package/.codex/skills/learn-follow/SKILL.md +83 -0
  16. package/.codex/skills/learn-investigate/SKILL.md +83 -0
  17. package/.codex/skills/learn-retro/SKILL.md +83 -0
  18. package/.codex/skills/learn-second-opinion/SKILL.md +86 -0
  19. package/.codex/skills/maestro/SKILL.md +151 -279
  20. package/.codex/skills/maestro-analyze/SKILL.md +59 -71
  21. package/.codex/skills/maestro-brainstorm/SKILL.md +452 -463
  22. package/.codex/skills/maestro-chain/SKILL.md +95 -110
  23. package/.codex/skills/maestro-coordinate/SKILL.md +68 -234
  24. package/.codex/skills/maestro-execute/SKILL.md +435 -446
  25. package/.codex/skills/maestro-fork/SKILL.md +68 -0
  26. package/.codex/skills/maestro-init/SKILL.md +171 -167
  27. package/.codex/skills/maestro-learn/SKILL.md +80 -0
  28. package/.codex/skills/maestro-link-coordinate/SKILL.md +224 -220
  29. package/.codex/skills/maestro-merge/SKILL.md +62 -0
  30. package/.codex/skills/maestro-milestone-audit/SKILL.md +108 -103
  31. package/.codex/skills/maestro-milestone-complete/SKILL.md +155 -149
  32. package/.codex/skills/maestro-milestone-release/SKILL.md +70 -0
  33. package/.codex/skills/maestro-overlay/SKILL.md +188 -185
  34. package/.codex/skills/maestro-plan/SKILL.md +58 -69
  35. package/.codex/skills/maestro-quick/SKILL.md +26 -23
  36. package/.codex/skills/maestro-roadmap/SKILL.md +65 -73
  37. package/.codex/skills/maestro-spec-generate/SKILL.md +66 -74
  38. package/.codex/skills/maestro-ui-design/SKILL.md +34 -31
  39. package/.codex/skills/maestro-verify/SKILL.md +556 -566
  40. package/.codex/skills/manage-codebase-rebuild/SKILL.md +397 -405
  41. package/.codex/skills/manage-codebase-refresh/SKILL.md +93 -82
  42. package/.codex/skills/manage-harvest/SKILL.md +82 -0
  43. package/.codex/skills/manage-issue/SKILL.md +80 -65
  44. package/.codex/skills/manage-issue-discover/SKILL.md +491 -503
  45. package/.codex/skills/manage-learn/SKILL.md +190 -186
  46. package/.codex/skills/manage-memory/SKILL.md +95 -72
  47. package/.codex/skills/manage-memory-capture/SKILL.md +99 -86
  48. package/.codex/skills/manage-status/SKILL.md +102 -89
  49. package/.codex/skills/quality-business-test/SKILL.md +228 -223
  50. package/.codex/skills/quality-debug/SKILL.md +54 -66
  51. package/.codex/skills/quality-integration-test/SKILL.md +532 -544
  52. package/.codex/skills/quality-refactor/SKILL.md +197 -191
  53. package/.codex/skills/quality-retrospective/SKILL.md +512 -505
  54. package/.codex/skills/quality-review/SKILL.md +93 -105
  55. package/.codex/skills/quality-sync/SKILL.md +101 -89
  56. package/.codex/skills/quality-test/SKILL.md +202 -198
  57. package/.codex/skills/quality-test-gen/SKILL.md +93 -104
  58. package/.codex/skills/spec-add/SKILL.md +58 -39
  59. package/.codex/skills/spec-load/SKILL.md +45 -40
  60. package/.codex/skills/spec-map/SKILL.md +180 -182
  61. package/.codex/skills/spec-setup/SKILL.md +94 -76
  62. package/.codex/skills/team-coordinate/SKILL.md +346 -357
  63. package/.codex/skills/team-executor/SKILL.md +70 -112
  64. package/.codex/skills/team-lifecycle-v4/SKILL.md +311 -299
  65. package/.codex/skills/team-quality-assurance/SKILL.md +234 -227
  66. package/.codex/skills/team-review/SKILL.md +232 -225
  67. package/.codex/skills/team-tech-debt/SKILL.md +78 -100
  68. package/.codex/skills/team-testing/SKILL.md +242 -235
  69. package/.codex/skills/wiki-connect/SKILL.md +75 -0
  70. package/.codex/skills/wiki-digest/SKILL.md +87 -0
  71. package/README.md +7 -4
  72. package/README.zh-CN.md +7 -4
  73. package/dashboard/dist-server/dashboard/src/server/routes/specs.d.ts +1 -1
  74. package/dashboard/dist-server/dashboard/src/server/routes/specs.js +75 -30
  75. package/dashboard/dist-server/dashboard/src/server/routes/specs.js.map +1 -1
  76. package/dashboard/dist-server/dashboard/src/server/state/event-bus.d.ts +5 -0
  77. package/dashboard/dist-server/dashboard/src/server/state/event-bus.js +5 -0
  78. package/dashboard/dist-server/dashboard/src/server/state/event-bus.js.map +1 -1
  79. package/dashboard/dist-server/dashboard/src/shared/constants.js +5 -0
  80. package/dashboard/dist-server/dashboard/src/shared/constants.js.map +1 -1
  81. package/dashboard/dist-server/dashboard/src/shared/team-types.d.ts +21 -0
  82. package/dashboard/dist-server/dashboard/src/shared/team-types.js.map +1 -1
  83. package/dashboard/dist-server/dashboard/src/shared/types.d.ts +3 -2
  84. package/dashboard/dist-server/dashboard/src/shared/ws-protocol.d.ts +1 -1
  85. package/dashboard/dist-server/dashboard/src/shared/ws-protocol.js.map +1 -1
  86. package/dashboard/dist-server/src/hooks/constants.d.ts +2 -0
  87. package/dashboard/dist-server/src/hooks/constants.js +2 -0
  88. package/dashboard/dist-server/src/hooks/constants.js.map +1 -1
  89. package/dist/src/commands/collab.js +4 -4
  90. package/dist/src/commands/collab.js.map +1 -1
  91. package/dist/src/commands/hooks.d.ts.map +1 -1
  92. package/dist/src/commands/hooks.js +66 -1
  93. package/dist/src/commands/hooks.js.map +1 -1
  94. package/dist/src/commands/spec.d.ts.map +1 -1
  95. package/dist/src/commands/spec.js +7 -2
  96. package/dist/src/commands/spec.js.map +1 -1
  97. package/dist/src/hooks/constants.d.ts +2 -0
  98. package/dist/src/hooks/constants.d.ts.map +1 -1
  99. package/dist/src/hooks/constants.js +2 -0
  100. package/dist/src/hooks/constants.js.map +1 -1
  101. package/dist/src/hooks/guards/index.d.ts +1 -0
  102. package/dist/src/hooks/guards/index.d.ts.map +1 -1
  103. package/dist/src/hooks/guards/index.js +1 -0
  104. package/dist/src/hooks/guards/index.js.map +1 -1
  105. package/dist/src/hooks/guards/spec-validator.d.ts +25 -0
  106. package/dist/src/hooks/guards/spec-validator.d.ts.map +1 -0
  107. package/dist/src/hooks/guards/spec-validator.js +66 -0
  108. package/dist/src/hooks/guards/spec-validator.js.map +1 -0
  109. package/dist/src/hooks/keyword-spec-injector.d.ts +21 -0
  110. package/dist/src/hooks/keyword-spec-injector.d.ts.map +1 -0
  111. package/dist/src/hooks/keyword-spec-injector.js +96 -0
  112. package/dist/src/hooks/keyword-spec-injector.js.map +1 -0
  113. package/dist/src/hooks/plugins/spec-injection-plugin.d.ts +2 -1
  114. package/dist/src/hooks/plugins/spec-injection-plugin.d.ts.map +1 -1
  115. package/dist/src/hooks/plugins/spec-injection-plugin.js +21 -12
  116. package/dist/src/hooks/plugins/spec-injection-plugin.js.map +1 -1
  117. package/dist/src/hooks/spec-bridge.d.ts +40 -0
  118. package/dist/src/hooks/spec-bridge.d.ts.map +1 -0
  119. package/dist/src/hooks/spec-bridge.js +97 -0
  120. package/dist/src/hooks/spec-bridge.js.map +1 -0
  121. package/dist/src/hooks/spec-injector.d.ts.map +1 -1
  122. package/dist/src/hooks/spec-injector.js +18 -12
  123. package/dist/src/hooks/spec-injector.js.map +1 -1
  124. package/dist/src/team/phase-orchestrator.d.ts +52 -0
  125. package/dist/src/team/phase-orchestrator.d.ts.map +1 -0
  126. package/dist/src/team/phase-orchestrator.js +165 -0
  127. package/dist/src/team/phase-orchestrator.js.map +1 -0
  128. package/dist/src/team/phase-types.d.ts +51 -0
  129. package/dist/src/team/phase-types.d.ts.map +1 -0
  130. package/dist/src/team/phase-types.js +41 -0
  131. package/dist/src/team/phase-types.js.map +1 -0
  132. package/dist/src/tools/index.d.ts.map +1 -1
  133. package/dist/src/tools/index.js +6 -0
  134. package/dist/src/tools/index.js.map +1 -1
  135. package/dist/src/tools/spec-entry-parser.d.ts +56 -0
  136. package/dist/src/tools/spec-entry-parser.d.ts.map +1 -0
  137. package/dist/src/tools/spec-entry-parser.js +196 -0
  138. package/dist/src/tools/spec-entry-parser.js.map +1 -0
  139. package/dist/src/tools/spec-init.d.ts.map +1 -1
  140. package/dist/src/tools/spec-init.js +66 -92
  141. package/dist/src/tools/spec-init.js.map +1 -1
  142. package/dist/src/tools/spec-keyword-index.d.ts +30 -0
  143. package/dist/src/tools/spec-keyword-index.d.ts.map +1 -0
  144. package/dist/src/tools/spec-keyword-index.js +101 -0
  145. package/dist/src/tools/spec-keyword-index.js.map +1 -0
  146. package/dist/src/tools/spec-loader.d.ts +3 -3
  147. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  148. package/dist/src/tools/spec-loader.js +49 -23
  149. package/dist/src/tools/spec-loader.js.map +1 -1
  150. package/dist/src/tools/team-agents.d.ts +27 -0
  151. package/dist/src/tools/team-agents.d.ts.map +1 -0
  152. package/dist/src/tools/team-agents.js +362 -0
  153. package/dist/src/tools/team-agents.js.map +1 -0
  154. package/dist/src/tools/team-mailbox.d.ts +40 -0
  155. package/dist/src/tools/team-mailbox.d.ts.map +1 -0
  156. package/dist/src/tools/team-mailbox.js +384 -0
  157. package/dist/src/tools/team-mailbox.js.map +1 -0
  158. package/dist/src/tools/team-msg.d.ts +17 -8
  159. package/dist/src/tools/team-msg.d.ts.map +1 -1
  160. package/dist/src/tools/team-msg.js +110 -13
  161. package/dist/src/tools/team-msg.js.map +1 -1
  162. package/dist/src/tools/team-tasks-mcp.d.ts +27 -0
  163. package/dist/src/tools/team-tasks-mcp.d.ts.map +1 -0
  164. package/dist/src/tools/team-tasks-mcp.js +408 -0
  165. package/dist/src/tools/team-tasks-mcp.js.map +1 -0
  166. package/package.json +2 -1
  167. package/workflows/analyze.md +816 -816
  168. package/workflows/brainstorm.md +471 -471
  169. package/workflows/codebase-rebuild.md +332 -332
  170. package/workflows/codebase-refresh.md +240 -240
  171. package/workflows/execute.md +1 -1
  172. package/workflows/harvest.md +420 -420
  173. package/workflows/integration-test.md +343 -343
  174. package/workflows/issue-discover.md +414 -414
  175. package/workflows/map.md +111 -111
  176. package/workflows/milestone-complete.md +176 -176
  177. package/workflows/plan.md +1 -1
  178. package/workflows/quick.md +497 -497
  179. package/workflows/refactor.md +300 -300
  180. package/workflows/roadmap.md +335 -335
  181. package/workflows/spec-generate.md +640 -640
  182. package/workflows/specs-add.md +46 -81
  183. package/workflows/specs-load.md +15 -17
  184. package/workflows/specs-setup.md +40 -161
@@ -67,7 +67,7 @@ Follow '~/.maestro/workflows/issue.md' completely.
67
67
  - [ ] Output displayed in appropriate format (table for list, detail for status)
68
68
  - [ ] Cross-references maintained (link creates bidirectional references)
69
69
  - [ ] Next step routing by subcommand:
70
- - create → `/manage-issue-analyze <ISS-ID>` or `/manage-issue-plan <ISS-ID>`
71
- - list → `/manage-issue-analyze <ISS-ID>` for any open issue
70
+ - create → `/maestro-analyze --gaps <ISS-ID>` or `/maestro-plan --gaps`
71
+ - list → `/maestro-analyze --gaps <ISS-ID>` for any open issue
72
72
  - close → `/manage-status`
73
73
  </success_criteria>
@@ -1,56 +1,67 @@
1
- ---
2
- name: spec-add
3
- description: Add a spec entry (bug, pattern, decision, or rule) to the appropriate specs file
4
- argument-hint: "<type> <content>"
5
- allowed-tools:
6
- - Read
7
- - Write
8
- - Bash
9
- - Glob
10
- - Grep
11
- ---
12
- <purpose>
13
- Add a knowledge entry to the project specs system, routing it to the correct file by category.
14
- Each entry is timestamped and appended to learnings.md, then the relevant spec file is updated if the entry warrants a convention or rule change.
15
- Supports four categories: bug fixes, patterns, architectural decisions, and quality rules.
16
- </purpose>
17
-
18
- <required_reading>
19
- @~/.maestro/workflows/specs-add.md
20
- </required_reading>
21
-
22
- <context>
23
- $ARGUMENTS -- expects `<type> <content>` where type is one of: bug, pattern, decision, rule, debug, test, review, validation
24
-
25
- **Type-to-file mapping:**
26
- | Type | Primary file | Secondary update |
27
- |------|-------------|-----------------|
28
- | `bug` | `learnings.md` | -- |
29
- | `pattern` | `learnings.md` | `coding-conventions.md` |
30
- | `decision` | `learnings.md` | `architecture-constraints.md` |
31
- | `rule` | `learnings.md` | `quality-rules.md` |
32
- | `debug` | `learnings.md` | `debug-notes.md` |
33
- | `test` | `learnings.md` | `test-conventions.md` |
34
- | `review` | `learnings.md` | `review-standards.md` |
35
- | `validation` | `learnings.md` | `validation-rules.md` |
36
- </context>
37
-
38
- <execution>
39
- Follow '~/.maestro/workflows/specs-add.md' completely.
40
- </execution>
41
-
42
- <error_codes>
43
- | Code | Severity | Description | Stage |
44
- |------|----------|-------------|-------|
45
- | E001 | fatal | Category and content are both required -- usage: `<type> <content>` | parse_input |
46
- | E002 | fatal | `.workflow/specs/` not initialized -- run `/spec-setup` first | validate_entry |
47
- | E003 | fatal | Invalid category -- must be one of: bug, pattern, decision, rule, debug, test, review, validation | parse_input |
48
- </error_codes>
49
-
50
- <success_criteria>
51
- - [ ] Category parsed and validated as bug/pattern/decision/rule
52
- - [ ] Entry appended to `.workflow/specs/learnings.md` with timestamp
53
- - [ ] Relevant spec file updated (if type is pattern/decision/rule)
54
- - [ ] Confirmation report displayed
55
- - [ ] Next step: `/spec-load --category {type}` to verify, or continue current task
56
- </success_criteria>
1
+ ---
2
+ name: spec-add
3
+ description: Add a spec entry to the appropriate specs file by category
4
+ argument-hint: "<category> <content>"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Bash
9
+ - Glob
10
+ - Grep
11
+ ---
12
+ <purpose>
13
+ Add a knowledge entry to the project specs system using `<spec-entry>` closed-tag format.
14
+ Each category maps 1:1 to a single target file no dual-write.
15
+ </purpose>
16
+
17
+ <required_reading>
18
+ @~/.maestro/workflows/specs-add.md
19
+ </required_reading>
20
+
21
+ <context>
22
+ $ARGUMENTS -- expects `<category> <content>`
23
+
24
+ **Category-to-file mapping (1:1, same as spec-load):**
25
+ | Category | Target file |
26
+ |----------|------------|
27
+ | `coding` | `coding-conventions.md` |
28
+ | `arch` | `architecture-constraints.md` |
29
+ | `quality` | `quality-rules.md` |
30
+ | `debug` | `debug-notes.md` |
31
+ | `test` | `test-conventions.md` |
32
+ | `review` | `review-standards.md` |
33
+ | `learning` | `learnings.md` |
34
+
35
+ **Entry format (closed-tag):**
36
+ ```markdown
37
+ <spec-entry category="{category}" keywords="{auto-extracted}" date="{YYYY-MM-DD}">
38
+
39
+ ### {title}
40
+
41
+ {content}
42
+
43
+ </spec-entry>
44
+ ```
45
+ </context>
46
+
47
+ <execution>
48
+ Follow '~/.maestro/workflows/specs-add.md' completely.
49
+ </execution>
50
+
51
+ <error_codes>
52
+ | Code | Severity | Description | Stage |
53
+ |------|----------|-------------|-------|
54
+ | E001 | fatal | Category and content are both required -- usage: `<category> <content>` | parse_input |
55
+ | E002 | fatal | `.workflow/specs/` not initialized -- run `/spec-setup` first | validate_entry |
56
+ | E003 | fatal | Invalid category -- must be one of: coding, arch, quality, debug, test, review, learning | parse_input |
57
+ </error_codes>
58
+
59
+ <success_criteria>
60
+ - [ ] Category parsed and validated
61
+ - [ ] Keywords auto-extracted from content (3-5 relevant terms)
62
+ - [ ] Entry written in `<spec-entry>` closed-tag format
63
+ - [ ] Entry appended to target file
64
+ - [ ] Confirmation report displayed
65
+ - [ ] Next step: `/spec-load --keyword {keyword}` to verify
66
+ </success_criteria>
67
+ </output>
@@ -1,64 +1,66 @@
1
- ---
2
- name: spec-load
3
- description: Load relevant specs and lessons for current context (used by agents before execution)
4
- argument-hint: "[--category <type>] [--with-lessons] [keyword]"
5
- allowed-tools:
6
- - Read
7
- - Bash
8
- - Glob
9
- - Grep
10
- ---
11
- <purpose>
12
- Load and display relevant spec files for the current working context, optionally filtered by category.
13
- Designed for agents to call before execution to internalize project conventions, constraints, and learnings.
14
- Returns matched sections with file references ranked by relevance.
15
- </purpose>
16
-
17
- <required_reading>
18
- @~/.maestro/workflows/specs-load.md
19
- </required_reading>
20
-
21
- <context>
22
- $ARGUMENTS -- optional `--category <type>` flag and/or keyword to filter specs
23
-
24
- **Category filter** (matches frontmatter `category` field):
25
- | Category | Files loaded |
26
- |----------|-------------|
27
- | `general` | `learnings.md` |
28
- | `exploration` | _(reserved)_ |
29
- | `planning` | `architecture-constraints.md` |
30
- | `execution` | `coding-conventions.md`, `quality-rules.md` |
31
- | `debug` | `debug-notes.md` |
32
- | `test` | `test-conventions.md` |
33
- | `review` | `review-standards.md` |
34
- | `validation` | `validation-rules.md` |
35
- | `all` (default) | All spec files |
36
-
37
- **Keyword:** If provided, search within loaded files for matching sections.
38
- If no arguments, loads all specs for the active phase/task context.
39
-
40
- **Flags:**
41
- - `--with-lessons` — Also search `.workflow/learning/lessons.jsonl` for entries with `category: "gotcha"`, `"antipattern"`, or `"pattern"` relevant to the keyword or current context. Appends matched lessons after spec output. This bridges the gap between specs (prescriptive rules) and lessons (discovered knowledge).
42
- </context>
43
-
44
- <execution>
45
- Follow '~/.maestro/workflows/specs-load.md' completely.
46
- </execution>
47
-
48
- <error_codes>
49
- | Code | Severity | Description | Stage |
50
- |------|----------|-------------|-------|
51
- | E001 | fatal | `.workflow/specs/` not initialized -- run `/spec-setup` first | detect_context |
52
- | W001 | warning | No matching specs found for keyword -- showing all specs in category instead | load_specs |
53
- </error_codes>
54
-
55
- <success_criteria>
56
- - [ ] Category filter parsed correctly (or defaults to all)
57
- - [ ] Spec files resolved and read
58
- - [ ] Keyword filtering applied if provided
59
- - [ ] If `--with-lessons`: lessons.jsonl searched for gotcha/antipattern/pattern entries matching context
60
- - [ ] If `--with-lessons`: matched lessons displayed after specs (max 10, newest first)
61
- - [ ] Results displayed with file:line references
62
- - [ ] Relevant specs loaded into agent context
63
- - [ ] Next step: proceed with current task using loaded specs as context
64
- </success_criteria>
1
+ ---
2
+ name: spec-load
3
+ description: Load relevant specs and lessons for current context (used by agents before execution)
4
+ argument-hint: "[--category <type>] [--keyword <word>] [--with-lessons]"
5
+ allowed-tools:
6
+ - Read
7
+ - Bash
8
+ - Glob
9
+ - Grep
10
+ ---
11
+ <purpose>
12
+ Load and display relevant spec files for the current working context.
13
+ Supports filtering by category (file-level) and keyword (entry-level via `<spec-entry>` tags).
14
+ </purpose>
15
+
16
+ <required_reading>
17
+ @~/.maestro/workflows/specs-load.md
18
+ </required_reading>
19
+
20
+ <context>
21
+ $ARGUMENTS -- optional flags and keyword
22
+
23
+ **Category-to-file mapping (1:1, same as spec-add):**
24
+ | Category | File loaded |
25
+ |----------|------------|
26
+ | `coding` | `coding-conventions.md` |
27
+ | `arch` | `architecture-constraints.md` |
28
+ | `quality` | `quality-rules.md` |
29
+ | `debug` | `debug-notes.md` |
30
+ | `test` | `test-conventions.md` |
31
+ | `review` | `review-standards.md` |
32
+ | `learning` | `learnings.md` |
33
+ | `all` (default) | All spec files |
34
+
35
+ **Flags:**
36
+ - `--category <type>` — Filter by file category (loads one file)
37
+ - `--keyword <word>` Filter entries by keyword attribute in `<spec-entry>` tags. Searches across all files (or within category if combined)
38
+ - `--with-lessons` Also search `.workflow/learning/lessons.jsonl`
39
+
40
+ **Examples:**
41
+ ```
42
+ /spec-load --keyword auth
43
+ /spec-load --category coding --keyword naming
44
+ /spec-load --category arch
45
+ ```
46
+ </context>
47
+
48
+ <execution>
49
+ Follow '~/.maestro/workflows/specs-load.md' completely.
50
+ </execution>
51
+
52
+ <error_codes>
53
+ | Code | Severity | Description | Stage |
54
+ |------|----------|-------------|-------|
55
+ | E001 | fatal | `.workflow/specs/` not initialized -- run `/spec-setup` first | detect_context |
56
+ | W001 | warning | No matching specs found for keyword -- showing all specs in category instead | load_specs |
57
+ </error_codes>
58
+
59
+ <success_criteria>
60
+ - [ ] Category and/or keyword parsed from arguments
61
+ - [ ] Spec files loaded per category mapping
62
+ - [ ] Keyword filtering applied at entry level (via `<spec-entry>` keywords attribute)
63
+ - [ ] Legacy entries filtered by text grep fallback
64
+ - [ ] Results displayed with file:category references
65
+ </success_criteria>
66
+ </output>
@@ -11,7 +11,7 @@ allowed-tools:
11
11
  ---
12
12
  <purpose>
13
13
  Initialize the project-level specs directory by scanning the codebase for conventions, patterns, and tech stack.
14
- Produces four spec files plus a tech profile JSON that downstream agents and commands consume for consistent coding.
14
+ Core files (coding, arch, learning) are always created. Optional files (quality, debug, test, review) are created only when relevant signals are detected.
15
15
  All output lands in `.workflow/specs/` and `.workflow/project-tech.json`.
16
16
  </purpose>
17
17
 
@@ -45,13 +45,9 @@ Follow '~/.maestro/workflows/specs-setup.md' completely.
45
45
 
46
46
  <success_criteria>
47
47
  - [ ] `.workflow/specs/` directory created
48
- - [ ] `coding-conventions.md` written with detected patterns
49
- - [ ] `architecture-constraints.md` written with structural rules
50
- - [ ] `quality-rules.md` written with auto-detected and manual sections
51
- - [ ] `learnings.md` initialized with format instructions
48
+ - [ ] Core files always created: `coding-conventions.md`, `architecture-constraints.md`, `learnings.md`
49
+ - [ ] Optional files created when detected: `quality-rules.md` (linter/CI), `test-conventions.md` (test framework), `debug-notes.md` (on demand), `review-standards.md` (on demand)
52
50
  - [ ] `project-tech.json` written with detected tech stack
53
- - [ ] Report displayed with summary and next steps:
54
- - Build codebase docs → `/manage-codebase-rebuild`
55
- - Load specs for task → `/spec-load`
56
- - Add new knowledge → `/spec-add <type> <content>`
51
+ - [ ] Report displayed with summary and next steps
57
52
  </success_criteria>
53
+ </output>
@@ -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>