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.
- package/.claude/commands/learn-decompose.md +10 -15
- package/.claude/commands/learn-follow.md +11 -16
- package/.claude/commands/learn-investigate.md +18 -22
- package/.claude/commands/learn-retro.md +23 -26
- package/.claude/commands/learn-second-opinion.md +11 -16
- package/.claude/commands/maestro-analyze.md +8 -0
- package/.claude/commands/maestro-brainstorm.md +8 -0
- package/.claude/commands/maestro-execute.md +11 -3
- package/.claude/commands/maestro-learn.md +4 -4
- package/.claude/commands/maestro-milestone-complete.md +6 -6
- package/.claude/commands/maestro-plan.md +8 -0
- package/.claude/commands/maestro-ralph-execute.md +1 -2
- package/.claude/commands/maestro-tools-execute.md +117 -0
- package/.claude/commands/maestro-tools-register.md +136 -0
- package/.claude/commands/maestro-ui-codify.md +67 -0
- package/.claude/commands/manage-harvest.md +1 -1
- package/.claude/commands/manage-learn.md +5 -7
- package/.claude/commands/manage-wiki.md +1 -1
- package/.claude/commands/quality-auto-test.md +1 -1
- package/.claude/commands/quality-debug.md +8 -0
- package/.claude/commands/quality-retrospective.md +4 -5
- package/.claude/commands/quality-review.md +8 -0
- package/.claude/commands/spec-add.md +18 -2
- package/.claude/commands/spec-load.md +25 -6
- package/.claude/commands/spec-setup.md +2 -2
- package/.claude/commands/wiki-connect.md +1 -1
- package/.claude/commands/wiki-digest.md +5 -6
- package/.claude/skills/codify-to-knowhow/SKILL.md +167 -0
- package/.claude/skills/codify-to-knowhow/phases/01-load-manifest.md +101 -0
- package/.claude/skills/codify-to-knowhow/phases/02-generate-knowhow.md +97 -0
- package/.claude/skills/codify-to-knowhow/phases/03-generate-specs.md +92 -0
- package/.claude/skills/codify-to-knowhow/phases/04-index-verify.md +119 -0
- package/.codex/skills/codify-to-knowhow/SKILL.md +427 -0
- package/.codex/skills/learn-decompose/SKILL.md +8 -8
- package/.codex/skills/learn-follow/SKILL.md +6 -6
- package/.codex/skills/learn-investigate/SKILL.md +4 -4
- package/.codex/skills/learn-retro/SKILL.md +7 -7
- package/.codex/skills/learn-second-opinion/SKILL.md +6 -6
- package/.codex/skills/maestro-analyze/SKILL.md +491 -491
- package/.codex/skills/maestro-collab/SKILL.md +1 -1
- package/.codex/skills/maestro-learn/SKILL.md +1 -1
- package/.codex/skills/maestro-milestone-complete/SKILL.md +122 -122
- package/.codex/skills/maestro-plan/SKILL.md +485 -485
- package/.codex/skills/maestro-tools-execute/SKILL.md +105 -0
- package/.codex/skills/maestro-tools-register/SKILL.md +149 -0
- package/.codex/skills/maestro-ui-codify/SKILL.md +398 -0
- package/.codex/skills/maestro-verify/SKILL.md +486 -486
- package/.codex/skills/manage-harvest/SKILL.md +3 -3
- package/.codex/skills/manage-issue-discover/SKILL.md +431 -431
- package/.codex/skills/manage-learn/SKILL.md +13 -13
- package/.codex/skills/manage-wiki/SKILL.md +1 -1
- package/.codex/skills/quality-auto-test/SKILL.md +553 -553
- package/.codex/skills/quality-refactor/SKILL.md +151 -151
- package/.codex/skills/quality-retrospective/SKILL.md +6 -6
- package/.codex/skills/spec-add/SKILL.md +104 -101
- package/.codex/skills/spec-load/SKILL.md +73 -77
- package/.codex/skills/team-quality-assurance/roles/executor/role.md +1 -1
- package/.codex/skills/wiki-connect/SKILL.md +5 -5
- package/.codex/skills/wiki-digest/SKILL.md +8 -8
- package/dashboard/dist-server/dashboard/src/server/routes/wiki.js +0 -1
- package/dashboard/dist-server/dashboard/src/server/routes/wiki.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/state/fs-watcher.js +2 -2
- package/dashboard/dist-server/dashboard/src/server/state/fs-watcher.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/supervisor/self-learning-service.d.ts +1 -1
- package/dashboard/dist-server/dashboard/src/server/supervisor/self-learning-service.js +1 -1
- package/dashboard/dist-server/dashboard/src/server/supervisor/self-learning-service.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/wiki/search.js +2 -2
- package/dashboard/dist-server/dashboard/src/server/wiki/search.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.d.ts +6 -3
- package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.js +29 -14
- package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/wiki/stress.test.js +0 -1
- package/dashboard/dist-server/dashboard/src/server/wiki/stress.test.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.d.ts +1 -2
- package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.js +2 -52
- package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +68 -33
- package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/wiki/wiki-types.d.ts +1 -1
- package/dashboard/dist-server/dashboard/src/server/wiki/writer-stress.test.js +1 -11
- package/dashboard/dist-server/dashboard/src/server/wiki/writer-stress.test.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/wiki/writer.d.ts +5 -4
- package/dashboard/dist-server/dashboard/src/server/wiki/writer.js +26 -12
- package/dashboard/dist-server/dashboard/src/server/wiki/writer.js.map +1 -1
- package/dashboard/dist-server/src/agents/cli-agent-runner.js +5 -5
- package/dashboard/dist-server/src/agents/cli-agent-runner.js.map +1 -1
- package/dashboard/dist-server/src/tools/spec-entry-parser.d.ts +4 -2
- package/dashboard/dist-server/src/tools/spec-entry-parser.js +19 -7
- package/dashboard/dist-server/src/tools/spec-entry-parser.js.map +1 -1
- package/dashboard/dist-server/src/tools/spec-loader.d.ts +4 -4
- package/dashboard/dist-server/src/tools/spec-loader.js +166 -23
- package/dashboard/dist-server/src/tools/spec-loader.js.map +1 -1
- package/dist/src/agents/cli-agent-runner.js +5 -5
- package/dist/src/agents/cli-agent-runner.js.map +1 -1
- package/dist/src/commands/knowhow.d.ts.map +1 -1
- package/dist/src/commands/knowhow.js +25 -6
- package/dist/src/commands/knowhow.js.map +1 -1
- package/dist/src/commands/spec.d.ts +1 -1
- package/dist/src/commands/spec.d.ts.map +1 -1
- package/dist/src/commands/spec.js +70 -3
- package/dist/src/commands/spec.js.map +1 -1
- package/dist/src/commands/wiki.d.ts.map +1 -1
- package/dist/src/commands/wiki.js +45 -6
- package/dist/src/commands/wiki.js.map +1 -1
- package/dist/src/hooks/keyword-spec-injector.js +1 -1
- package/dist/src/hooks/keyword-spec-injector.js.map +1 -1
- package/dist/src/hooks/plugins/spec-injection-plugin.js +2 -2
- package/dist/src/hooks/plugins/spec-injection-plugin.js.map +1 -1
- package/dist/src/hooks/spec-injector.d.ts +0 -6
- package/dist/src/hooks/spec-injector.d.ts.map +1 -1
- package/dist/src/hooks/spec-injector.js +36 -43
- package/dist/src/hooks/spec-injector.js.map +1 -1
- package/dist/src/hooks/wiki-role-loader.d.ts +18 -0
- package/dist/src/hooks/wiki-role-loader.d.ts.map +1 -0
- package/dist/src/hooks/wiki-role-loader.js +43 -0
- package/dist/src/hooks/wiki-role-loader.js.map +1 -0
- package/dist/src/tools/spec-entry-parser.d.ts +4 -2
- package/dist/src/tools/spec-entry-parser.d.ts.map +1 -1
- package/dist/src/tools/spec-entry-parser.js +19 -7
- package/dist/src/tools/spec-entry-parser.js.map +1 -1
- package/dist/src/tools/spec-init.js +54 -54
- package/dist/src/tools/spec-loader.d.ts +4 -4
- package/dist/src/tools/spec-loader.d.ts.map +1 -1
- package/dist/src/tools/spec-loader.js +166 -23
- package/dist/src/tools/spec-loader.js.map +1 -1
- package/dist/src/tools/spec-writer.d.ts +5 -0
- package/dist/src/tools/spec-writer.d.ts.map +1 -1
- package/dist/src/tools/spec-writer.js +27 -0
- package/dist/src/tools/spec-writer.js.map +1 -1
- package/dist/src/tools/store-knowhow.d.ts.map +1 -1
- package/dist/src/tools/store-knowhow.js +56 -27
- package/dist/src/tools/store-knowhow.js.map +1 -1
- package/package.json +1 -1
- package/workflows/execute.md +1 -1
- package/workflows/harvest.md +13 -13
- package/workflows/knowhow.md +72 -11
- package/workflows/learn.md +70 -58
- package/workflows/milestone-complete.md +1 -1
- package/workflows/retrospective.md +50 -56
- package/workflows/specs-load.md +15 -14
- package/workflows/tools-spec.md +65 -0
- package/workflows/ui-codify-extract.md +373 -0
- package/workflows/ui-codify-knowhow.md +258 -0
- package/workflows/ui-codify-package.md +161 -0
- package/workflows/ui-codify.md +225 -0
- package/workflows/verify.md +1 -1
- package/workflows/wiki-connect.md +7 -7
- package/workflows/wiki-digest.md +13 -13
- 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
|
|
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/
|
|
75
|
-
-
|
|
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 `
|
|
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/
|
|
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
|
|
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
|
-
| `
|
|
37
|
-
| `
|
|
38
|
-
| `
|
|
39
|
-
| `
|
|
40
|
-
| `
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
- [ ]
|
|
100
|
-
- [ ]
|
|
101
|
-
|
|
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>
|