maestro-flow 0.3.43 → 0.3.45

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 (149) hide show
  1. package/.claude/commands/learn-decompose.md +10 -15
  2. package/.claude/commands/learn-follow.md +11 -16
  3. package/.claude/commands/learn-investigate.md +18 -22
  4. package/.claude/commands/learn-retro.md +23 -26
  5. package/.claude/commands/learn-second-opinion.md +11 -16
  6. package/.claude/commands/maestro-analyze.md +8 -0
  7. package/.claude/commands/maestro-brainstorm.md +8 -0
  8. package/.claude/commands/maestro-execute.md +11 -3
  9. package/.claude/commands/maestro-learn.md +4 -4
  10. package/.claude/commands/maestro-milestone-complete.md +6 -6
  11. package/.claude/commands/maestro-plan.md +8 -0
  12. package/.claude/commands/maestro-ralph-execute.md +1 -2
  13. package/.claude/commands/maestro-tools-execute.md +117 -0
  14. package/.claude/commands/maestro-tools-register.md +136 -0
  15. package/.claude/commands/maestro-ui-codify.md +67 -0
  16. package/.claude/commands/manage-harvest.md +1 -1
  17. package/.claude/commands/manage-learn.md +5 -7
  18. package/.claude/commands/manage-wiki.md +1 -1
  19. package/.claude/commands/quality-auto-test.md +1 -1
  20. package/.claude/commands/quality-debug.md +8 -0
  21. package/.claude/commands/quality-retrospective.md +4 -5
  22. package/.claude/commands/quality-review.md +8 -0
  23. package/.claude/commands/spec-add.md +18 -2
  24. package/.claude/commands/spec-load.md +25 -6
  25. package/.claude/commands/spec-setup.md +2 -2
  26. package/.claude/commands/wiki-connect.md +1 -1
  27. package/.claude/commands/wiki-digest.md +5 -6
  28. package/.claude/skills/codify-to-knowhow/SKILL.md +167 -0
  29. package/.claude/skills/codify-to-knowhow/phases/01-load-manifest.md +101 -0
  30. package/.claude/skills/codify-to-knowhow/phases/02-generate-knowhow.md +97 -0
  31. package/.claude/skills/codify-to-knowhow/phases/03-generate-specs.md +92 -0
  32. package/.claude/skills/codify-to-knowhow/phases/04-index-verify.md +119 -0
  33. package/.codex/skills/codify-to-knowhow/SKILL.md +427 -0
  34. package/.codex/skills/learn-decompose/SKILL.md +8 -8
  35. package/.codex/skills/learn-follow/SKILL.md +6 -6
  36. package/.codex/skills/learn-investigate/SKILL.md +4 -4
  37. package/.codex/skills/learn-retro/SKILL.md +7 -7
  38. package/.codex/skills/learn-second-opinion/SKILL.md +6 -6
  39. package/.codex/skills/maestro-analyze/SKILL.md +491 -491
  40. package/.codex/skills/maestro-collab/SKILL.md +1 -1
  41. package/.codex/skills/maestro-learn/SKILL.md +1 -1
  42. package/.codex/skills/maestro-milestone-complete/SKILL.md +122 -122
  43. package/.codex/skills/maestro-plan/SKILL.md +485 -485
  44. package/.codex/skills/maestro-tools-execute/SKILL.md +105 -0
  45. package/.codex/skills/maestro-tools-register/SKILL.md +149 -0
  46. package/.codex/skills/maestro-ui-codify/SKILL.md +398 -0
  47. package/.codex/skills/maestro-verify/SKILL.md +486 -486
  48. package/.codex/skills/manage-harvest/SKILL.md +3 -3
  49. package/.codex/skills/manage-issue-discover/SKILL.md +431 -431
  50. package/.codex/skills/manage-learn/SKILL.md +13 -13
  51. package/.codex/skills/manage-wiki/SKILL.md +1 -1
  52. package/.codex/skills/quality-auto-test/SKILL.md +553 -553
  53. package/.codex/skills/quality-refactor/SKILL.md +151 -151
  54. package/.codex/skills/quality-retrospective/SKILL.md +6 -6
  55. package/.codex/skills/spec-add/SKILL.md +104 -101
  56. package/.codex/skills/spec-load/SKILL.md +73 -77
  57. package/.codex/skills/team-quality-assurance/roles/executor/role.md +1 -1
  58. package/.codex/skills/wiki-connect/SKILL.md +5 -5
  59. package/.codex/skills/wiki-digest/SKILL.md +8 -8
  60. package/dashboard/dist-server/dashboard/src/server/routes/wiki.js +0 -1
  61. package/dashboard/dist-server/dashboard/src/server/routes/wiki.js.map +1 -1
  62. package/dashboard/dist-server/dashboard/src/server/state/fs-watcher.js +2 -2
  63. package/dashboard/dist-server/dashboard/src/server/state/fs-watcher.js.map +1 -1
  64. package/dashboard/dist-server/dashboard/src/server/supervisor/self-learning-service.d.ts +1 -1
  65. package/dashboard/dist-server/dashboard/src/server/supervisor/self-learning-service.js +1 -1
  66. package/dashboard/dist-server/dashboard/src/server/supervisor/self-learning-service.js.map +1 -1
  67. package/dashboard/dist-server/dashboard/src/server/wiki/search.js +2 -2
  68. package/dashboard/dist-server/dashboard/src/server/wiki/search.js.map +1 -1
  69. package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.d.ts +6 -3
  70. package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.js +29 -14
  71. package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.js.map +1 -1
  72. package/dashboard/dist-server/dashboard/src/server/wiki/stress.test.js +0 -1
  73. package/dashboard/dist-server/dashboard/src/server/wiki/stress.test.js.map +1 -1
  74. package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.d.ts +1 -2
  75. package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.js +2 -52
  76. package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.js.map +1 -1
  77. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +68 -33
  78. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
  79. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-types.d.ts +1 -1
  80. package/dashboard/dist-server/dashboard/src/server/wiki/writer-stress.test.js +1 -11
  81. package/dashboard/dist-server/dashboard/src/server/wiki/writer-stress.test.js.map +1 -1
  82. package/dashboard/dist-server/dashboard/src/server/wiki/writer.d.ts +5 -4
  83. package/dashboard/dist-server/dashboard/src/server/wiki/writer.js +26 -12
  84. package/dashboard/dist-server/dashboard/src/server/wiki/writer.js.map +1 -1
  85. package/dashboard/dist-server/src/agents/cli-agent-runner.js +5 -5
  86. package/dashboard/dist-server/src/agents/cli-agent-runner.js.map +1 -1
  87. package/dashboard/dist-server/src/tools/spec-entry-parser.d.ts +4 -2
  88. package/dashboard/dist-server/src/tools/spec-entry-parser.js +19 -7
  89. package/dashboard/dist-server/src/tools/spec-entry-parser.js.map +1 -1
  90. package/dashboard/dist-server/src/tools/spec-loader.d.ts +4 -4
  91. package/dashboard/dist-server/src/tools/spec-loader.js +166 -23
  92. package/dashboard/dist-server/src/tools/spec-loader.js.map +1 -1
  93. package/dist/src/agents/cli-agent-runner.js +5 -5
  94. package/dist/src/agents/cli-agent-runner.js.map +1 -1
  95. package/dist/src/commands/knowhow.d.ts.map +1 -1
  96. package/dist/src/commands/knowhow.js +25 -6
  97. package/dist/src/commands/knowhow.js.map +1 -1
  98. package/dist/src/commands/spec.d.ts +1 -1
  99. package/dist/src/commands/spec.d.ts.map +1 -1
  100. package/dist/src/commands/spec.js +70 -3
  101. package/dist/src/commands/spec.js.map +1 -1
  102. package/dist/src/commands/wiki.d.ts.map +1 -1
  103. package/dist/src/commands/wiki.js +45 -6
  104. package/dist/src/commands/wiki.js.map +1 -1
  105. package/dist/src/hooks/keyword-spec-injector.js +1 -1
  106. package/dist/src/hooks/keyword-spec-injector.js.map +1 -1
  107. package/dist/src/hooks/plugins/spec-injection-plugin.js +2 -2
  108. package/dist/src/hooks/plugins/spec-injection-plugin.js.map +1 -1
  109. package/dist/src/hooks/spec-injector.d.ts +0 -6
  110. package/dist/src/hooks/spec-injector.d.ts.map +1 -1
  111. package/dist/src/hooks/spec-injector.js +36 -43
  112. package/dist/src/hooks/spec-injector.js.map +1 -1
  113. package/dist/src/hooks/wiki-role-loader.d.ts +18 -0
  114. package/dist/src/hooks/wiki-role-loader.d.ts.map +1 -0
  115. package/dist/src/hooks/wiki-role-loader.js +43 -0
  116. package/dist/src/hooks/wiki-role-loader.js.map +1 -0
  117. package/dist/src/tools/spec-entry-parser.d.ts +4 -2
  118. package/dist/src/tools/spec-entry-parser.d.ts.map +1 -1
  119. package/dist/src/tools/spec-entry-parser.js +19 -7
  120. package/dist/src/tools/spec-entry-parser.js.map +1 -1
  121. package/dist/src/tools/spec-init.js +54 -54
  122. package/dist/src/tools/spec-loader.d.ts +4 -4
  123. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  124. package/dist/src/tools/spec-loader.js +166 -23
  125. package/dist/src/tools/spec-loader.js.map +1 -1
  126. package/dist/src/tools/spec-writer.d.ts +5 -0
  127. package/dist/src/tools/spec-writer.d.ts.map +1 -1
  128. package/dist/src/tools/spec-writer.js +27 -0
  129. package/dist/src/tools/spec-writer.js.map +1 -1
  130. package/dist/src/tools/store-knowhow.d.ts.map +1 -1
  131. package/dist/src/tools/store-knowhow.js +56 -27
  132. package/dist/src/tools/store-knowhow.js.map +1 -1
  133. package/package.json +1 -1
  134. package/workflows/execute.md +1 -1
  135. package/workflows/harvest.md +13 -13
  136. package/workflows/knowhow.md +72 -11
  137. package/workflows/learn.md +70 -58
  138. package/workflows/milestone-complete.md +1 -1
  139. package/workflows/retrospective.md +50 -56
  140. package/workflows/specs-load.md +15 -14
  141. package/workflows/tools-spec.md +65 -0
  142. package/workflows/ui-codify-extract.md +373 -0
  143. package/workflows/ui-codify-knowhow.md +258 -0
  144. package/workflows/ui-codify-package.md +161 -0
  145. package/workflows/ui-codify.md +225 -0
  146. package/workflows/verify.md +1 -1
  147. package/workflows/wiki-connect.md +7 -7
  148. package/workflows/wiki-digest.md +13 -13
  149. package/workflows/wiki-manage.md +1 -1
@@ -1,151 +1,151 @@
1
- ---
2
- name: quality-refactor
3
- description: Reduce tech debt with reflection-driven iteration
4
- argument-hint: "<phase|--dir path> [--max-iterations N]"
5
- allowed-tools: Read, Write, Edit, Bash, Glob, Grep, Agent, AskUserQuestion
6
- ---
7
-
8
- <purpose>
9
- Iterative refactoring cycle: analyze scope for tech debt -> plan refactoring tasks -> execute each with test verification -> reflect on strategy per round -> repeat if needed. Every change is verified against existing tests. Failed changes are reverted and retried with adjusted strategy.
10
- </purpose>
11
-
12
- <context>
13
- $ARGUMENTS -- module path, feature area, or "all", plus optional flags.
14
-
15
- **Usage**:
16
-
17
- ```bash
18
- $quality-refactor "src/auth" # module path scope
19
- $quality-refactor "authentication" # feature area scope
20
- $quality-refactor "all" # full codebase scan
21
- $quality-refactor "src/api --max-iterations 5" # limit iteration rounds
22
- $quality-refactor "--dir .workflow/scratch/refactor-auth-2026-03-18" # resume existing
23
- ```
24
-
25
- **Flags**:
26
- - `<phase|scope>`: Module path, feature area, or "all"
27
- - `--dir path`: Resume existing refactor scratch directory
28
- - `--max-iterations N`: Max refactoring rounds (default: 3)
29
-
30
- **Output**: `.workflow/scratch/refactor-{slug}-{date}/` with index.json, plan.json, reflection-log.md, .task/, .summaries/
31
- </context>
32
-
33
- <invariants>
34
- 1. **Test after every change** -- zero regressions tolerated
35
- 2. **Revert on failure** -- never leave broken state
36
- 3. **Max 2 retries per task** with strategy adjustment
37
- 4. **Reflection-driven** -- every round records strategy, outcome, adjustment
38
- 5. **User approval required** before execution (Step 4)
39
- 6. **Quick wins first** -- order by risk (low first) and dependency
40
- 7. **Agent calls use `run_in_background: false`** for synchronous execution
41
- 8. **Incremental safety** -- each task is independently safe to apply or revert
42
- </invariants>
43
-
44
- <execution>
45
-
46
- ### Step 1: Parse Scope
47
-
48
- 1. Parse `$ARGUMENTS` for scope and flags
49
- 2. If `--dir` provided: resume existing scratch directory (skip to Step 5)
50
- 3. Scope types:
51
- - Module path (e.g., "src/auth") -> scan that directory
52
- - Feature area (e.g., "authentication") -> search for related files
53
- - "all" -> full codebase scan
54
- 4. If empty: prompt user via AskUserQuestion with options (Module path / Feature area / Full codebase)
55
- 5. Detect `--max-iterations N` (default: 3)
56
-
57
- ### Step 2: Create Scratch Directory
58
-
59
- Create `.workflow/scratch/refactor-{slug}-{date}/` with `.task/` and `.summaries/` subdirectories. Write `index.json` with type "refactor", scope, status "active", plan/execution/reflection counters.
60
-
61
- ### Step 3: Scope Analysis
62
-
63
- Load project specs if available (`maestro spec load --category coding`).
64
-
65
- Analyze scope for tech debt categories:
66
-
67
- | Category | What to Look For |
68
- |----------|-----------------|
69
- | Duplication | Repeated code blocks, copy-paste patterns |
70
- | Complexity | Long functions, deep nesting, high cyclomatic complexity |
71
- | Naming | Inconsistent naming, unclear identifiers |
72
- | Dependencies | Circular deps, tight coupling, god objects |
73
- | Dead code | Unused functions, unreachable branches |
74
- | Pattern violations | Inconsistent with project conventions |
75
-
76
- Present analysis summary table with category, count, severity.
77
- Confirm with user before proceeding.
78
-
79
- ### Step 4: Plan Refactoring
80
-
81
- 1. Write `plan.json` with scope, total_tasks, strategy ("incremental -- each task independently safe")
82
- 2. For each identified issue, create `.task/TASK-{NNN}.json`:
83
- - id, title, status (pending), type (refactor), category
84
- - description, read_first files, files with action/target/change
85
- - convergence.criteria (grep-verifiable), verification command
86
- - implementation steps, risk level
87
- 3. Order: high risk last, dependencies respected, quick wins first
88
- 4. Update `index.json` plan fields
89
- 5. Present plan to user via AskUserQuestion -- show affected files, risk areas, ask for approval
90
-
91
- ### Step 5: Execute with Reflection
92
-
93
- Initialize `reflection-log.md` if not exists.
94
-
95
- For each task in order:
96
-
97
- **5a. Execute refactoring:** Spawn Agent to implement the refactoring — read `read_first` files, apply changes to targets, follow convergence criteria exactly.
98
-
99
- **5b. Run test suite** (npm test / pytest / go test as appropriate).
100
-
101
- **5c. Record in reflection-log.md:** Round number, task title, strategy, result (pass/fail), test outcome, adjustment for next round, files changed.
102
-
103
- **5d. Handle test failures:**
104
- 1. Revert the change
105
- 2. Record failure + strategy adjustment in reflection-log.md
106
- 3. Retry with adjusted strategy (max 2 retries per task)
107
- 4. If still failing: mark task "blocked", continue to next
108
-
109
- **5e. Update state:**
110
- - `.task/TASK-{NNN}.json` status -> "completed" or "blocked"
111
- - `.summaries/TASK-{NNN}-summary.md` written
112
- - `index.json` execution and reflection fields updated
113
-
114
- ### Step 6: Final Verification
115
-
116
- Run full test suite. Record final state in reflection-log.md: test result, tasks completed/total, tasks blocked, key learnings.
117
-
118
- ### Step 7: Complete and Report
119
-
120
- Update `index.json`: status -> "completed", final execution/reflection counts.
121
-
122
- Display report: scope, tasks completed/blocked, reflection rounds, strategy adjustments, test status, key learnings from reflection-log.md, artifact paths (`{REFACTOR_DIR}/reflection-log.md`, `{REFACTOR_DIR}/.summaries/`).
123
-
124
- **Next-step routing:**
125
-
126
- | Result | Next Step |
127
- |--------|-----------|
128
- | All tests pass, refactoring complete | `$quality-sync` (update codebase docs) |
129
- | Test failures remain after refactor | `$quality-debug "{scope}"` |
130
- | No test suite available for scope | `$quality-auto-test "{phase}"` |
131
- | Partial completion (some blocked) | `$quality-debug "{scope}"` for blocked tasks |
132
- </execution>
133
-
134
- <error_codes>
135
- | Code | Severity | Condition | Recovery |
136
- |------|----------|-----------|----------|
137
- | E001 | error | Scope/description required | Prompt user for module path, feature area, or "all" |
138
- | E002 | error | Test suite not available | Suggest creating tests first, or proceed with manual verification |
139
- | W001 | warning | Partial test coverage | Note uncovered areas, proceed with extra caution |
140
- </error_codes>
141
-
142
- <success_criteria>
143
- - [ ] Scope resolved and scratch directory created
144
- - [ ] Tech debt analysis completed with categorized findings
145
- - [ ] Refactoring plan approved by user
146
- - [ ] Each task executed with test verification
147
- - [ ] Failed changes reverted, retried with adjusted strategy
148
- - [ ] Reflection log records every round's strategy and outcome
149
- - [ ] Final test suite passes with zero regressions
150
- - [ ] Completion report with key learnings displayed
151
- </success_criteria>
1
+ ---
2
+ name: quality-refactor
3
+ description: Reduce tech debt with reflection-driven iteration
4
+ argument-hint: "<phase|--dir path> [--max-iterations N]"
5
+ allowed-tools: Read, Write, Edit, Bash, Glob, Grep, Agent, AskUserQuestion
6
+ ---
7
+
8
+ <purpose>
9
+ Iterative refactoring cycle: analyze scope for tech debt -> plan refactoring tasks -> execute each with test verification -> reflect on strategy per round -> repeat if needed. Every change is verified against existing tests. Failed changes are reverted and retried with adjusted strategy.
10
+ </purpose>
11
+
12
+ <context>
13
+ $ARGUMENTS -- module path, feature area, or "all", plus optional flags.
14
+
15
+ **Usage**:
16
+
17
+ ```bash
18
+ $quality-refactor "src/auth" # module path scope
19
+ $quality-refactor "authentication" # feature area scope
20
+ $quality-refactor "all" # full codebase scan
21
+ $quality-refactor "src/api --max-iterations 5" # limit iteration rounds
22
+ $quality-refactor "--dir .workflow/scratch/refactor-auth-2026-03-18" # resume existing
23
+ ```
24
+
25
+ **Flags**:
26
+ - `<phase|scope>`: Module path, feature area, or "all"
27
+ - `--dir path`: Resume existing refactor scratch directory
28
+ - `--max-iterations N`: Max refactoring rounds (default: 3)
29
+
30
+ **Output**: `.workflow/scratch/refactor-{slug}-{date}/` with index.json, plan.json, reflection-log.md, .task/, .summaries/
31
+ </context>
32
+
33
+ <invariants>
34
+ 1. **Test after every change** -- zero regressions tolerated
35
+ 2. **Revert on failure** -- never leave broken state
36
+ 3. **Max 2 retries per task** with strategy adjustment
37
+ 4. **Reflection-driven** -- every round records strategy, outcome, adjustment
38
+ 5. **User approval required** before execution (Step 4)
39
+ 6. **Quick wins first** -- order by risk (low first) and dependency
40
+ 7. **Agent calls use `run_in_background: false`** for synchronous execution
41
+ 8. **Incremental safety** -- each task is independently safe to apply or revert
42
+ </invariants>
43
+
44
+ <execution>
45
+
46
+ ### Step 1: Parse Scope
47
+
48
+ 1. Parse `$ARGUMENTS` for scope and flags
49
+ 2. If `--dir` provided: resume existing scratch directory (skip to Step 5)
50
+ 3. Scope types:
51
+ - Module path (e.g., "src/auth") -> scan that directory
52
+ - Feature area (e.g., "authentication") -> search for related files
53
+ - "all" -> full codebase scan
54
+ 4. If empty: prompt user via AskUserQuestion with options (Module path / Feature area / Full codebase)
55
+ 5. Detect `--max-iterations N` (default: 3)
56
+
57
+ ### Step 2: Create Scratch Directory
58
+
59
+ Create `.workflow/scratch/refactor-{slug}-{date}/` with `.task/` and `.summaries/` subdirectories. Write `index.json` with type "refactor", scope, status "active", plan/execution/reflection counters.
60
+
61
+ ### Step 3: Scope Analysis
62
+
63
+ Load project specs if available (`maestro spec load --category coding`).
64
+
65
+ Analyze scope for tech debt categories:
66
+
67
+ | Category | What to Look For |
68
+ |----------|-----------------|
69
+ | Duplication | Repeated code blocks, copy-paste patterns |
70
+ | Complexity | Long functions, deep nesting, high cyclomatic complexity |
71
+ | Naming | Inconsistent naming, unclear identifiers |
72
+ | Dependencies | Circular deps, tight coupling, god objects |
73
+ | Dead code | Unused functions, unreachable branches |
74
+ | Pattern violations | Inconsistent with project conventions |
75
+
76
+ Present analysis summary table with category, count, severity.
77
+ Confirm with user before proceeding.
78
+
79
+ ### Step 4: Plan Refactoring
80
+
81
+ 1. Write `plan.json` with scope, total_tasks, strategy ("incremental -- each task independently safe")
82
+ 2. For each identified issue, create `.task/TASK-{NNN}.json`:
83
+ - id, title, status (pending), type (refactor), category
84
+ - description, read_first files, files with action/target/change
85
+ - convergence.criteria (grep-verifiable), verification command
86
+ - implementation steps, risk level
87
+ 3. Order: high risk last, dependencies respected, quick wins first
88
+ 4. Update `index.json` plan fields
89
+ 5. Present plan to user via AskUserQuestion -- show affected files, risk areas, ask for approval
90
+
91
+ ### Step 5: Execute with Reflection
92
+
93
+ Initialize `reflection-log.md` if not exists.
94
+
95
+ For each task in order:
96
+
97
+ **5a. Execute refactoring:** Spawn Agent to implement the refactoring — read `read_first` files, apply changes to targets, follow convergence criteria exactly.
98
+
99
+ **5b. Run test suite** (npm test / pytest / go test as appropriate).
100
+
101
+ **5c. Record in reflection-log.md:** Round number, task title, strategy, result (pass/fail), test outcome, adjustment for next round, files changed.
102
+
103
+ **5d. Handle test failures:**
104
+ 1. Revert the change
105
+ 2. Record failure + strategy adjustment in reflection-log.md
106
+ 3. Retry with adjusted strategy (max 2 retries per task)
107
+ 4. If still failing: mark task "blocked", continue to next
108
+
109
+ **5e. Update state:**
110
+ - `.task/TASK-{NNN}.json` status -> "completed" or "blocked"
111
+ - `.summaries/TASK-{NNN}-summary.md` written
112
+ - `index.json` execution and reflection fields updated
113
+
114
+ ### Step 6: Final Verification
115
+
116
+ Run full test suite. Record final state in reflection-log.md: test result, tasks completed/total, tasks blocked, key learnings.
117
+
118
+ ### Step 7: Complete and Report
119
+
120
+ Update `index.json`: status -> "completed", final execution/reflection counts.
121
+
122
+ Display report: scope, tasks completed/blocked, reflection rounds, strategy adjustments, test status, key learnings from reflection-log.md, artifact paths (`{REFACTOR_DIR}/reflection-log.md`, `{REFACTOR_DIR}/.summaries/`).
123
+
124
+ **Next-step routing:**
125
+
126
+ | Result | Next Step |
127
+ |--------|-----------|
128
+ | All tests pass, refactoring complete | `$quality-sync` (update codebase docs) |
129
+ | Test failures remain after refactor | `$quality-debug "{scope}"` |
130
+ | No test suite available for scope | `$quality-auto-test "{phase}"` |
131
+ | Partial completion (some blocked) | `$quality-debug "{scope}"` for blocked tasks |
132
+ </execution>
133
+
134
+ <error_codes>
135
+ | Code | Severity | Condition | Recovery |
136
+ |------|----------|-----------|----------|
137
+ | E001 | error | Scope/description required | Prompt user for module path, feature area, or "all" |
138
+ | E002 | error | Test suite not available | Suggest creating tests first, or proceed with manual verification |
139
+ | W001 | warning | Partial test coverage | Note uncovered areas, proceed with extra caution |
140
+ </error_codes>
141
+
142
+ <success_criteria>
143
+ - [ ] Scope resolved and scratch directory created
144
+ - [ ] Tech debt analysis completed with categorized findings
145
+ - [ ] Refactoring plan approved by user
146
+ - [ ] Each task executed with test verification
147
+ - [ ] Failed changes reverted, retried with adjusted strategy
148
+ - [ ] Reflection log records every round's strategy and outcome
149
+ - [ ] Final test suite passes with zero regressions
150
+ - [ ] Completion report with key learnings displayed
151
+ </success_criteria>
@@ -8,7 +8,7 @@ allowed-tools: Read, Write, Edit, Bash, Glob, Grep
8
8
  <purpose>
9
9
  Multi-lens retrospective for completed phases. Context-Agent Fork loads phase artifacts once;
10
10
  four parallel lens agents (technical, process, quality, decision) analyze independently;
11
- synthesizer distills insights; outputs are routed to spec stubs, knowhow tips, issues, and lessons.jsonl.
11
+ synthesizer distills insights; outputs are routed to spec stubs, knowhow tips, issues, and specs/learnings.md.
12
12
 
13
13
  ```
14
14
  +------------------------------------------------------------------+
@@ -71,8 +71,8 @@ When `-y`: Accept all routing recommendations without prompting. Route all insig
71
71
  - `.workflow/specs/{category-file}.md` -- `<spec-entry>` entries appended to matching category files (one per spec-routed insight)
72
72
  - `.workflow/issues/issues.jsonl` -- appended issue rows (`source: "retrospective"`)
73
73
  - `.workflow/knowhow/TIP-*.md` -- knowhow tips (via `manage-knowhow-capture` skill)
74
- - `.workflow/learning/lessons.jsonl` -- append-only insight log
75
- - `.workflow/learning/learning-index.json` -- updated searchable index
74
+ - `.workflow/specs/learnings.md` -- append-only insight log
75
+ - Index auto-maintained by WikiIndexer
76
76
 
77
77
  **Storage read (never modified)** — all resolved via `state.json.artifacts[]`:
78
78
  ```
@@ -125,7 +125,7 @@ Each artifact's type determines its outputs at `.workflow/{a.path}/`:
125
125
  7. **Archive before overwrite**: Move existing retrospective.{md,json} to `.history/` with timestamp before writing new ones
126
126
  8. **Spec learnings.md backward-compat**: Append to it only if it already exists -- never create it
127
127
  9. **Route confirmation**: Unless `-y`, present routing table and ask per-group before writing spec/issue/knowhow
128
- 10. **Lessons always written**: Append to `lessons.jsonl` regardless of `--no-route` -- routing only controls spec/issue/knowhow creation
128
+ 10. **Lessons always written**: Append to `specs/learnings.md` regardless of `--no-route` -- routing only controls spec/issue/knowhow creation
129
129
  </invariants>
130
130
 
131
131
  <execution>
@@ -250,7 +250,7 @@ Write two files to `{target_dir}/`:
250
250
  - **retrospective.json**: phase, slug, timestamp, lenses_run, metrics, findings_by_lens, distilled_insights, routing_summary
251
251
  - **retrospective.md**: Header with phase/slug/timestamp, metrics table (tasks completed, test pass rate, review issues, UAT scenarios), findings by lens, distilled insights, routing summary
252
252
 
253
- Append each insight to `.workflow/learning/lessons.jsonl` and update `learning-index.json`.
253
+ Append each insight to `.workflow/specs/learnings.md`.
254
254
 
255
255
  If `.workflow/specs/learnings.md` already exists, append each insight as `<spec-entry>` (category=`learning`, auto-extract keywords, date=today, source=`retrospective`). Never create the file -- only append if it exists.
256
256
 
@@ -287,6 +287,6 @@ Next steps: `$manage-status`, `$manage-issue "list --source retrospective"`, `$m
287
287
  - [ ] Synthesizer produces deduplicated insights with stable INS-ids
288
288
  - [ ] Routing applied per insight (spec/issue/knowhow/none) with confirmation
289
289
  - [ ] retrospective.{md,json} written to phase directory
290
- - [ ] Lessons appended to lessons.jsonl regardless of --no-route flag
290
+ - [ ] Lessons appended to specs/learnings.md regardless of --no-route flag
291
291
  - [ ] Existing retrospective archived before overwrite
292
292
  </success_criteria>
@@ -1,101 +1,104 @@
1
- ---
2
- name: spec-add
3
- description: Add spec entry by category
4
- argument-hint: "<category> <content>"
5
- allowed-tools: Read, Write, Bash, Glob, Grep
6
- ---
7
-
8
- <purpose>
9
- Add a spec entry using `<spec-entry>` closed-tag format. Each category maps 1:1 to a single target file.
10
-
11
- ```bash
12
- $spec-add "coding Always use named exports for utility functions"
13
- $spec-add "learning Off-by-one in pagination when page=0"
14
- $spec-add "arch Use Zod for runtime validation over io-ts"
15
- $spec-add "quality All API endpoints must return structured error objects"
16
- ```
17
-
18
- **Valid categories**: coding, arch, quality, debug, test, review, learning, bug, pattern, decision, rule, validation.
19
-
20
- **CLI alternative**: `maestro spec add <category> "<title>" "<content>" --keywords kw1,kw2 --source <src>`. Used by workflow agents (analyze, plan, execute) for programmatic spec enrichment.
21
- </purpose>
22
-
23
- <context>
24
- $ARGUMENTS — `<category> <content>` where category selects the target file.
25
-
26
- **Category-to-file mapping (1:1, same as spec-load):**
27
- | Category | Target file |
28
- |----------|------------|
29
- | `coding` | `coding-conventions.md` |
30
- | `arch` | `architecture-constraints.md` |
31
- | `quality` | `quality-rules.md` |
32
- | `debug` | `debug-notes.md` |
33
- | `test` | `test-conventions.md` |
34
- | `review` | `review-standards.md` |
35
- | `learning` | `learnings.md` |
36
- | `bug` | `learnings.md` |
37
- | `pattern` | `coding-conventions.md` |
38
- | `decision` | `architecture-constraints.md` |
39
- | `rule` | `quality-rules.md` |
40
- | `validation` | `quality-rules.md` |
41
-
42
- Extended types (`bug`, `pattern`, `decision`, `rule`, `validation`) are stored in the file of their closest core category but retain their specific category in the `<spec-entry>` tag.
43
- </context>
44
-
45
- <execution>
46
-
47
- ### Step 1: Parse Input
48
-
49
- Extract category (first token) and content (remainder) from arguments.
50
- - Validate category is one of: coding, arch, quality, debug, test, review, learning, bug, pattern, decision, rule, validation (E003 if invalid)
51
- - Validate content is non-empty (E001 if missing)
52
-
53
- ### Step 2: Validate Specs Directory
54
-
55
- Verify `.workflow/specs/` exists (E002).
56
-
57
- ### Step 3: Route to File
58
-
59
- Resolve target file from category-to-file mapping table. If the target file does not exist, create it with a basic header.
60
-
61
- ### Step 4: Extract Keywords
62
-
63
- Auto-extract 3-5 relevant keywords from the content. Keywords should be:
64
- - Lowercase, no spaces (use hyphens for multi-word)
65
- - Domain-specific terms that would help future lookup
66
- - Avoid generic words (code, file, function, etc.)
67
-
68
- ### Step 5: Write Entry
69
-
70
- Append `<spec-entry>` closed-tag block to target file:
71
-
72
- ```markdown
73
- <spec-entry category="{category}" keywords="{kw1},{kw2},{kw3}" date="{YYYY-MM-DD}">
74
-
75
- ### {title extracted from content}
76
-
77
- {content}
78
-
79
- </spec-entry>
80
- ```
81
-
82
- ### Step 6: Confirm
83
-
84
- Display: category, target file, extracted keywords, and commands for verify (`/spec-load`) and remove (`/spec-remove`).
85
- </execution>
86
-
87
- <error_codes>
88
- | Code | Severity | Description |
89
- |------|----------|-------------|
90
- | E001 | fatal | Category and content are both required |
91
- | E002 | fatal | `.workflow/specs/` not initialized -- run `Skill({ skill: "spec-setup" })` first |
92
- | E003 | fatal | Invalid category -- must be one of: coding, arch, quality, debug, test, review, learning, bug, pattern, decision, rule, validation |
93
- </error_codes>
94
-
95
- <success_criteria>
96
- - [ ] Category and content parsed and validated
97
- - [ ] Keywords auto-extracted from content (3-5 terms)
98
- - [ ] Entry written in `<spec-entry>` closed-tag format with keywords attribute
99
- - [ ] Entry appended to correct target file
100
- - [ ] Confirmation displayed with keywords and verify command
101
- </success_criteria>
1
+ ---
2
+ name: spec-add
3
+ description: Add spec entry by category with role tagging
4
+ argument-hint: "<category> <content>"
5
+ allowed-tools: Read, Write, Bash, Glob, Grep
6
+ ---
7
+
8
+ <purpose>
9
+ Add a spec entry using `<spec-entry>` closed-tag format. Each category maps 1:1 to a single target file.
10
+
11
+ ```bash
12
+ $spec-add "coding Always use named exports for utility functions"
13
+ $spec-add "learning Off-by-one in pagination when page=0"
14
+ $spec-add "arch Use Zod for runtime validation over io-ts"
15
+ $spec-add "quality All API endpoints must return structured error objects"
16
+ ```
17
+
18
+ **Valid categories**: coding, arch, quality, debug, test, review, learning, tools, bug, pattern, decision, rule, validation.
19
+
20
+ **CLI alternative**: `maestro spec add <category> "<title>" "<content>" --keywords kw1,kw2 --source <src>`. Used by workflow agents (analyze, plan, execute) for programmatic spec enrichment.
21
+ </purpose>
22
+
23
+ <context>
24
+ $ARGUMENTS — `<category> <content>` where category selects the target file.
25
+
26
+ **Category-to-file mapping (1:1, same as spec-load):**
27
+ | Category | Target file |
28
+ |----------|------------|
29
+ | `coding` | `coding-conventions.md` |
30
+ | `arch` | `architecture-constraints.md` |
31
+ | `quality` | `quality-rules.md` |
32
+ | `debug` | `debug-notes.md` |
33
+ | `test` | `test-conventions.md` |
34
+ | `review` | `review-standards.md` |
35
+ | `learning` | `learnings.md` |
36
+ | `tools` | `tools.md` |
37
+ | `bug` | `learnings.md` |
38
+ | `pattern` | `coding-conventions.md` |
39
+ | `decision` | `architecture-constraints.md` |
40
+ | `rule` | `quality-rules.md` |
41
+ | `validation` | `quality-rules.md` |
42
+
43
+ Extended types (`bug`, `pattern`, `decision`, `rule`, `validation`) are stored in the file of their closest core category but retain their specific category in the `<spec-entry>` tag.
44
+
45
+ Category is determined by the first positional argument.
46
+ </context>
47
+
48
+ <execution>
49
+
50
+ ### Step 1: Parse Input
51
+
52
+ Extract category (first token) and content (remainder) from arguments.
53
+ - Validate category is one of: coding, arch, quality, debug, test, review, learning, bug, pattern, decision, rule, validation (E003 if invalid)
54
+ - Validate content is non-empty (E001 if missing)
55
+
56
+ ### Step 2: Validate Specs Directory
57
+
58
+ Verify `.workflow/specs/` exists (E002).
59
+
60
+ ### Step 3: Route to File
61
+
62
+ Resolve target file from category-to-file mapping table. If the target file does not exist, create it with a basic header.
63
+
64
+ ### Step 4: Extract Keywords
65
+
66
+ Auto-extract 3-5 relevant keywords from the content. Keywords should be:
67
+ - Lowercase, no spaces (use hyphens for multi-word)
68
+ - Domain-specific terms that would help future lookup
69
+ - Avoid generic words (code, file, function, etc.)
70
+
71
+ ### Step 5: Write Entry
72
+
73
+ Append `<spec-entry>` closed-tag block to target file:
74
+
75
+ ```markdown
76
+ <spec-entry category="{category}" keywords="{kw1},{kw2},{kw3}" date="{YYYY-MM-DD}">
77
+
78
+ ### {title extracted from content}
79
+
80
+ {content}
81
+
82
+ </spec-entry>
83
+ ```
84
+
85
+ ### Step 6: Confirm
86
+
87
+ Display: category, target file, extracted keywords, and commands for verify (`/spec-load`) and remove (`/spec-remove`).
88
+ </execution>
89
+
90
+ <error_codes>
91
+ | Code | Severity | Description |
92
+ |------|----------|-------------|
93
+ | E001 | fatal | Category and content are both required |
94
+ | E002 | fatal | `.workflow/specs/` not initialized -- run `Skill({ skill: "spec-setup" })` first |
95
+ | E003 | fatal | Invalid category -- must be one of: coding, arch, quality, debug, test, review, learning, bug, pattern, decision, rule, validation |
96
+ </error_codes>
97
+
98
+ <success_criteria>
99
+ - [ ] Category and content parsed and validated
100
+ - [ ] Keywords auto-extracted from content (3-5 terms)
101
+ - [ ] Entry written in `<spec-entry>` closed-tag format with keywords attribute
102
+ - [ ] Entry appended to correct target file
103
+ - [ ] Confirmation displayed with keywords and verify command
104
+ </success_criteria>