maxsimcli 4.0.1 → 4.0.2
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/dist/assets/CHANGELOG.md +7 -0
- package/dist/assets/templates/skills/batch-worktree/SKILL.md +38 -85
- package/dist/assets/templates/skills/brainstorming/SKILL.md +44 -114
- package/dist/assets/templates/skills/code-review/SKILL.md +43 -71
- package/dist/assets/templates/skills/memory-management/SKILL.md +36 -100
- package/dist/assets/templates/skills/roadmap-writing/SKILL.md +39 -73
- package/dist/assets/templates/skills/sdd/SKILL.md +36 -85
- package/dist/assets/templates/skills/simplify/SKILL.md +96 -139
- package/dist/assets/templates/skills/systematic-debugging/SKILL.md +41 -74
- package/dist/assets/templates/skills/tdd/SKILL.md +32 -65
- package/dist/assets/templates/skills/using-maxsim/SKILL.md +26 -39
- package/dist/assets/templates/skills/verification-before-completion/SKILL.md +37 -56
- package/package.json +1 -1
|
@@ -1,28 +1,19 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: memory-management
|
|
3
|
-
description:
|
|
3
|
+
description: "Persists recurring patterns, error solutions, and architectural decisions to project memory files for cross-session continuity. Use when encountering the same error twice, making significant decisions, or discovering non-obvious conventions."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Memory Management
|
|
7
7
|
|
|
8
8
|
Context dies with each session. Patterns discovered but not saved are patterns lost.
|
|
9
9
|
|
|
10
|
-
**If you encountered it twice, save it. You will encounter it again
|
|
10
|
+
**HARD GATE** -- If you encountered it twice, save it. You will encounter it again. "I'll remember" is a lie -- your context resets. Write it down. Violating this rule guarantees repeated mistakes across sessions.
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Process
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
RECURRING PATTERNS MUST BE PERSISTED.
|
|
16
|
-
If you have seen the same error, pattern, or decision twice in this session or across sessions, you MUST save it.
|
|
17
|
-
"I'll remember" is a lie — your context resets. Write it down.
|
|
18
|
-
Violating this rule guarantees repeated mistakes across sessions.
|
|
19
|
-
</HARD-GATE>
|
|
14
|
+
### 1. Detect -- Recognize Save Triggers
|
|
20
15
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
### Auto-Save Triggers (MUST save)
|
|
24
|
-
|
|
25
|
-
These situations require immediate memory persistence:
|
|
16
|
+
Save immediately when any of these occur:
|
|
26
17
|
|
|
27
18
|
| Trigger | Threshold | What to Save |
|
|
28
19
|
|---------|-----------|-------------|
|
|
@@ -33,36 +24,17 @@ These situations require immediate memory persistence:
|
|
|
33
24
|
| Workaround for tooling/framework quirk | Once | The quirk and the workaround |
|
|
34
25
|
| Project-specific pattern confirmed | 2+ uses | The pattern and when to apply it |
|
|
35
26
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
- Session-specific context (current task details, in-progress work)
|
|
39
|
-
- Information already in CLAUDE.md or project documentation
|
|
40
|
-
- Speculative conclusions from reading a single file
|
|
41
|
-
- Temporary workarounds that will be removed
|
|
42
|
-
- Obvious patterns that any developer would know
|
|
43
|
-
|
|
44
|
-
## Where to Save
|
|
45
|
-
|
|
46
|
-
Memory files live in `.claude/memory/` (for Claude Code) or the equivalent runtime memory directory.
|
|
27
|
+
Do NOT save: session-specific context, information already in CLAUDE.md, speculative conclusions, temporary workarounds, or obvious patterns.
|
|
47
28
|
|
|
48
|
-
###
|
|
49
|
-
|
|
50
|
-
```
|
|
51
|
-
.claude/memory/
|
|
52
|
-
MEMORY.md # Index file — always loaded into context
|
|
53
|
-
patterns.md # Code patterns and conventions
|
|
54
|
-
errors.md # Error patterns and solutions
|
|
55
|
-
architecture.md # Architectural decisions and rationale
|
|
56
|
-
tooling.md # Tool quirks and workarounds
|
|
57
|
-
```
|
|
29
|
+
### 2. Check -- Avoid Duplicates
|
|
58
30
|
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
31
|
+
- Read existing memory files before writing
|
|
32
|
+
- If the pattern is already documented, update it (do not duplicate)
|
|
33
|
+
- If it contradicts existing memory, investigate which is correct
|
|
62
34
|
|
|
63
|
-
###
|
|
35
|
+
### 3. Write -- Persist the Memory
|
|
64
36
|
|
|
65
|
-
|
|
37
|
+
Add to the appropriate topic file using this entry format:
|
|
66
38
|
|
|
67
39
|
```markdown
|
|
68
40
|
## [Short descriptive title]
|
|
@@ -73,83 +45,47 @@ Each entry should follow this structure:
|
|
|
73
45
|
**Evidence:** How this was confirmed (dates, occurrences, test results)
|
|
74
46
|
```
|
|
75
47
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
When you encounter something worth remembering:
|
|
79
|
-
|
|
80
|
-
### 1. DETECT — Recognize the Pattern
|
|
81
|
-
|
|
82
|
-
- Is this the same error/pattern you saw before?
|
|
83
|
-
- Is this a decision that will affect future work?
|
|
84
|
-
- Is this a non-obvious convention or quirk?
|
|
85
|
-
|
|
86
|
-
### 2. CHECK — Avoid Duplicates
|
|
87
|
-
|
|
88
|
-
- Read the existing memory files first
|
|
89
|
-
- If the pattern is already documented, update it (don't duplicate)
|
|
90
|
-
- If it contradicts existing memory, investigate which is correct
|
|
91
|
-
|
|
92
|
-
### 3. WRITE — Persist the Memory
|
|
93
|
-
|
|
94
|
-
- Add to the appropriate topic file
|
|
95
|
-
- Update MEMORY.md index if adding a new topic
|
|
96
|
-
- Keep entries concise — future you needs the answer, not the journey
|
|
97
|
-
|
|
98
|
-
### 4. VERIFY — Confirm the Save
|
|
48
|
+
### 4. Verify -- Confirm the Save
|
|
99
49
|
|
|
100
50
|
- Re-read the file to confirm the entry was written correctly
|
|
101
|
-
- Ensure the entry is actionable (someone reading it can act on it)
|
|
51
|
+
- Ensure the entry is actionable (someone reading it can act on it immediately)
|
|
102
52
|
|
|
103
|
-
##
|
|
53
|
+
## File Organization
|
|
104
54
|
|
|
105
|
-
|
|
55
|
+
Memory files live in `.claude/memory/` (or the equivalent runtime memory directory).
|
|
106
56
|
|
|
107
57
|
```
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
58
|
+
.claude/memory/
|
|
59
|
+
MEMORY.md # Index file -- always loaded into context
|
|
60
|
+
patterns.md # Code patterns and conventions
|
|
61
|
+
errors.md # Error patterns and solutions
|
|
62
|
+
architecture.md # Architectural decisions and rationale
|
|
63
|
+
tooling.md # Tool quirks and workarounds
|
|
111
64
|
```
|
|
112
65
|
|
|
113
|
-
|
|
66
|
+
- **MEMORY.md** is the index: keep it under 200 lines, link to topic files for details
|
|
67
|
+
- Topic files hold detailed notes organized by subject
|
|
68
|
+
- Use headers and bullet points for scannability
|
|
114
69
|
|
|
115
|
-
|
|
116
|
-
```markdown
|
|
117
|
-
## Vitest "cannot find module" for path aliases
|
|
70
|
+
## Error Escalation
|
|
118
71
|
|
|
119
|
-
**Context:** When running tests that import from `@maxsim/core`
|
|
120
|
-
**Error:** `Cannot find module '@maxsim/core/types'`
|
|
121
|
-
**Fix:** Add `resolve.alias` to `vitest.config.ts` matching tsconfig paths
|
|
122
|
-
**Evidence:** Hit 3 times across phases 01-03 (Feb 2026)
|
|
123
72
|
```
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
## Test error
|
|
128
|
-
There was an error with tests. Fixed it by changing config.
|
|
73
|
+
Error seen once -- Note it, move on
|
|
74
|
+
Error seen twice -- Save to errors.md with pattern and fix
|
|
75
|
+
Error seen 3+ times -- Save AND add to MEMORY.md index for immediate visibility
|
|
129
76
|
```
|
|
130
77
|
|
|
131
|
-
## Common
|
|
132
|
-
|
|
133
|
-
| Excuse | Why It Violates the Rule |
|
|
134
|
-
|--------|--------------------------|
|
|
135
|
-
| "I'll remember this" | No you won't. Context resets. Write it down. |
|
|
136
|
-
| "It's too specific to save" | Specific is good. Generic memories are useless. |
|
|
137
|
-
| "Memory files are messy" | Organize them. Messy files > lost knowledge. |
|
|
138
|
-
| "This only applies to this project" | Project memory IS project-scoped. Save it. |
|
|
139
|
-
| "Someone else documented this" | If it's not in your memory files, you won't find it next session. |
|
|
140
|
-
| "I'll save it later" | You'll forget to. Save it now. |
|
|
141
|
-
|
|
142
|
-
## Red Flags — STOP If You Catch Yourself:
|
|
78
|
+
## Common Pitfalls
|
|
143
79
|
|
|
144
|
-
- Encountering the same error
|
|
80
|
+
- Encountering the same error a second time without saving it
|
|
145
81
|
- Making the same architectural decision you made in a previous session
|
|
146
82
|
- Debugging a problem you already solved before
|
|
147
83
|
- Saying "I think we fixed this before" without finding the memory entry
|
|
148
84
|
- Leaving a session without updating memory for patterns discovered
|
|
149
85
|
|
|
150
|
-
|
|
86
|
+
If any of these occur: stop, write the memory entry now, then continue.
|
|
151
87
|
|
|
152
|
-
## Verification
|
|
88
|
+
## Verification
|
|
153
89
|
|
|
154
90
|
Before ending a work session:
|
|
155
91
|
|
|
@@ -160,12 +96,12 @@ Before ending a work session:
|
|
|
160
96
|
- [ ] No duplicate entries were created
|
|
161
97
|
- [ ] All entries follow the format (Context, Pattern, Solution, Evidence)
|
|
162
98
|
|
|
163
|
-
## Integration
|
|
99
|
+
## MAXSIM Integration
|
|
164
100
|
|
|
165
|
-
During plan execution,
|
|
101
|
+
During plan execution, agents load memory files at startup:
|
|
166
102
|
- **Executor:** Reads MEMORY.md to avoid known pitfalls before implementing
|
|
167
103
|
- **Researcher:** Saves findings to memory for future phases
|
|
168
|
-
- **Debugger:** Checks error memories before starting investigation
|
|
104
|
+
- **Debugger:** Checks error memories before starting investigation -- the fix may already be known
|
|
169
105
|
|
|
170
106
|
Memory persistence happens at natural breakpoints:
|
|
171
107
|
- After resolving a bug (save to errors.md)
|
|
@@ -1,28 +1,20 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: roadmap-writing
|
|
3
|
-
description:
|
|
3
|
+
description: >-
|
|
4
|
+
Creates structured project roadmaps with phased planning, dependency graphs,
|
|
5
|
+
and testable success criteria in MAXSIM-compatible format. Use when creating a
|
|
6
|
+
new roadmap, restructuring project phases, or planning milestones.
|
|
4
7
|
---
|
|
5
8
|
|
|
6
9
|
# Roadmap Writing
|
|
7
10
|
|
|
8
11
|
A roadmap without success criteria is a wish list. Define what done looks like for every phase.
|
|
9
12
|
|
|
10
|
-
**
|
|
13
|
+
**HARD GATE: No phase without success criteria and dependencies. Every phase must have a number, name, goal, testable success criteria, and explicit dependencies. Violating this rule is a violation, not flexibility.**
|
|
11
14
|
|
|
12
|
-
##
|
|
15
|
+
## Process
|
|
13
16
|
|
|
14
|
-
|
|
15
|
-
NO PHASE WITHOUT SUCCESS CRITERIA AND DEPENDENCIES.
|
|
16
|
-
Every phase MUST have: a number, a name, a goal, success criteria (testable statements), and explicit dependencies.
|
|
17
|
-
"We'll figure it out as we go" is not planning — it is drifting.
|
|
18
|
-
Violating this rule is a violation — not flexibility.
|
|
19
|
-
</HARD-GATE>
|
|
20
|
-
|
|
21
|
-
## The Gate Function
|
|
22
|
-
|
|
23
|
-
Follow these steps IN ORDER when creating or restructuring a roadmap.
|
|
24
|
-
|
|
25
|
-
### 1. SCOPE — Understand the Project
|
|
17
|
+
### 1. SCOPE -- Understand the Project
|
|
26
18
|
|
|
27
19
|
Before writing phases, understand what you are planning:
|
|
28
20
|
|
|
@@ -31,26 +23,18 @@ Before writing phases, understand what you are planning:
|
|
|
31
23
|
- Check existing STATE.md for decisions and blockers
|
|
32
24
|
- Identify the delivery target (MVP, v1, v2, etc.)
|
|
33
25
|
|
|
34
|
-
|
|
35
|
-
# Load project context
|
|
36
|
-
node ~/.claude/maxsim/bin/maxsim-tools.cjs state read --raw
|
|
37
|
-
|
|
38
|
-
# Check existing roadmap (if any)
|
|
39
|
-
node ~/.claude/maxsim/bin/maxsim-tools.cjs roadmap read --raw
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
### 2. DECOMPOSE — Break Into Phases
|
|
26
|
+
### 2. DECOMPOSE -- Break Into Phases
|
|
43
27
|
|
|
44
28
|
Each phase should be:
|
|
45
29
|
|
|
46
30
|
| Property | Requirement |
|
|
47
31
|
|----------|------------|
|
|
48
|
-
| **Independently deliverable** | The phase produces a working increment
|
|
32
|
+
| **Independently deliverable** | The phase produces a working increment, not a half-built feature |
|
|
49
33
|
| **1-3 days of work** | Larger phases should be split; smaller ones should be merged |
|
|
50
34
|
| **Clear boundary** | You can tell when the phase is done without ambiguity |
|
|
51
35
|
| **Ordered by dependency** | No phase depends on a later phase |
|
|
52
36
|
|
|
53
|
-
|
|
37
|
+
Phase numbering convention:
|
|
54
38
|
|
|
55
39
|
| Format | When to Use |
|
|
56
40
|
|--------|------------|
|
|
@@ -58,54 +42,51 @@ Each phase should be:
|
|
|
58
42
|
| `01A`, `01B` | Parallel sub-phases that can execute concurrently |
|
|
59
43
|
| `01.1`, `01.2` | Sequential sub-phases within a parent phase |
|
|
60
44
|
|
|
61
|
-
Sort order: `01
|
|
45
|
+
Sort order: `01` then `01A` then `01B` then `01.1` then `01.2` then `02`.
|
|
62
46
|
|
|
63
|
-
### 3. DEFINE
|
|
47
|
+
### 3. DEFINE -- Write Each Phase
|
|
64
48
|
|
|
65
|
-
Every phase
|
|
49
|
+
Every phase must include all of these fields:
|
|
66
50
|
|
|
67
51
|
```markdown
|
|
68
52
|
### Phase {number}: {name}
|
|
69
|
-
**Goal**: {one sentence
|
|
53
|
+
**Goal**: {one sentence -- what this phase achieves}
|
|
70
54
|
**Depends on**: {phase numbers, or "Nothing" for the first phase}
|
|
71
55
|
**Requirements**: {requirement IDs from REQUIREMENTS.md, if applicable}
|
|
72
56
|
**Success Criteria** (what must be TRUE):
|
|
73
|
-
1. {Testable statement
|
|
57
|
+
1. {Testable statement -- can be verified with a command, test, or inspection}
|
|
74
58
|
2. {Testable statement}
|
|
75
59
|
3. {Testable statement}
|
|
76
60
|
**Plans**: TBD
|
|
77
61
|
```
|
|
78
62
|
|
|
79
|
-
|
|
80
|
-
- Each criterion must be testable
|
|
63
|
+
Success criteria rules:
|
|
64
|
+
- Each criterion must be testable -- "code is clean" is not testable; "no lint warnings" is testable
|
|
81
65
|
- Include at least 2 criteria per phase
|
|
82
66
|
- At least one criterion should be verifiable by running a command (test, build, lint)
|
|
83
|
-
- Criteria describe the
|
|
67
|
+
- Criteria describe the end state, not the process ("tests pass" not "write tests")
|
|
84
68
|
|
|
85
|
-
### 4. CONNECT
|
|
69
|
+
### 4. CONNECT -- Map Dependencies
|
|
86
70
|
|
|
87
|
-
Draw the dependency graph:
|
|
88
71
|
- Which phases can run in parallel? (Use letter suffixes: `03A`, `03B`)
|
|
89
72
|
- Which phases are strictly sequential? (Use number suffixes: `03.1`, `03.2`)
|
|
90
|
-
- Are there any circular dependencies? (This is a design error
|
|
73
|
+
- Are there any circular dependencies? (This is a design error -- restructure)
|
|
91
74
|
|
|
92
|
-
|
|
75
|
+
Every phase except the first must declare at least one dependency.
|
|
93
76
|
|
|
94
|
-
### 5. MILESTONE
|
|
77
|
+
### 5. MILESTONE -- Group Into Milestones
|
|
95
78
|
|
|
96
|
-
Group phases into milestones that represent user-visible releases
|
|
79
|
+
Group phases into milestones that represent user-visible releases. Each milestone should be a coherent deliverable that could ship independently.
|
|
97
80
|
|
|
98
81
|
```markdown
|
|
99
82
|
## Milestones
|
|
100
83
|
|
|
101
|
-
- **v1.0 MVP**
|
|
102
|
-
- **v1.1 Polish**
|
|
103
|
-
- **v2.0 Scale**
|
|
84
|
+
- **v1.0 MVP** -- Phases 1-4
|
|
85
|
+
- **v1.1 Polish** -- Phases 5-7
|
|
86
|
+
- **v2.0 Scale** -- Phases 8-10
|
|
104
87
|
```
|
|
105
88
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
### 6. WRITE — Produce the Roadmap
|
|
89
|
+
### 6. WRITE -- Produce the Roadmap
|
|
109
90
|
|
|
110
91
|
Assemble the complete ROADMAP.md:
|
|
111
92
|
|
|
@@ -118,7 +99,7 @@ Assemble the complete ROADMAP.md:
|
|
|
118
99
|
|
|
119
100
|
## Milestones
|
|
120
101
|
|
|
121
|
-
-
|
|
102
|
+
- **{milestone name}** -- Phases {range} ({status})
|
|
122
103
|
|
|
123
104
|
## Phases
|
|
124
105
|
|
|
@@ -135,47 +116,32 @@ Assemble the complete ROADMAP.md:
|
|
|
135
116
|
**Plans**: TBD
|
|
136
117
|
```
|
|
137
118
|
|
|
138
|
-
### 7. VALIDATE
|
|
119
|
+
### 7. VALIDATE -- Check the Roadmap
|
|
139
120
|
|
|
140
121
|
Before finalizing, verify:
|
|
141
122
|
|
|
142
|
-
```bash
|
|
143
|
-
# Write the roadmap (creates or overwrites .planning/ROADMAP.md)
|
|
144
|
-
# Then verify phase structure
|
|
145
|
-
node ~/.claude/maxsim/bin/maxsim-tools.cjs roadmap read --raw
|
|
146
|
-
```
|
|
147
|
-
|
|
148
123
|
| Check | How to Verify |
|
|
149
124
|
|-------|--------------|
|
|
150
125
|
| Every phase has success criteria | Read each phase detail section |
|
|
151
|
-
| Dependencies are acyclic | Trace the dependency chain
|
|
126
|
+
| Dependencies are acyclic | Trace the dependency chain -- no loops |
|
|
152
127
|
| Phase numbering is sequential | Numbers increase, no gaps larger than 1 |
|
|
153
128
|
| Milestones cover all phases | Every phase appears in exactly one milestone |
|
|
154
129
|
| Success criteria are testable | Each criterion can be verified by command, test, or inspection |
|
|
155
130
|
|
|
156
|
-
## Common
|
|
131
|
+
## Common Pitfalls
|
|
157
132
|
|
|
158
|
-
|
|
|
159
|
-
|
|
133
|
+
| Pitfall | Why It Fails |
|
|
134
|
+
|---------|-------------|
|
|
160
135
|
| "We don't know enough to plan" | Plan what you know. Unknown phases get a research spike first. |
|
|
161
|
-
| "The roadmap will change anyway" | Plans change
|
|
136
|
+
| "The roadmap will change anyway" | Plans change -- that is expected. No plan guarantees drift. |
|
|
162
137
|
| "Success criteria are too rigid" | Vague criteria are useless. Rigid criteria are adjustable. |
|
|
163
138
|
| "One big phase is simpler" | Big phases hide complexity and delay feedback. Split them. |
|
|
164
139
|
| "Dependencies are obvious" | Obvious to you now. Not obvious to the agent running phase 5 next week. |
|
|
165
140
|
| "We'll add details later" | Later never comes. Write the details now while context is fresh. |
|
|
166
141
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
- Writing a phase without success criteria
|
|
170
|
-
- Creating phases longer than 3 days of work
|
|
171
|
-
- Skipping dependency declarations
|
|
172
|
-
- Writing vague criteria like "code is good" or "feature works"
|
|
173
|
-
- Creating circular dependencies between phases
|
|
174
|
-
- Putting all work in one or two massive phases
|
|
175
|
-
|
|
176
|
-
**If any red flag triggers: STOP. Review the phase structure and fix it.**
|
|
142
|
+
Stop if you catch yourself writing a phase without success criteria, creating phases longer than 3 days of work, skipping dependency declarations, writing vague criteria like "code is good", creating circular dependencies, or putting all work in one or two massive phases.
|
|
177
143
|
|
|
178
|
-
## Verification
|
|
144
|
+
## Verification
|
|
179
145
|
|
|
180
146
|
Before finalizing a roadmap, confirm:
|
|
181
147
|
|
|
@@ -188,11 +154,11 @@ Before finalizing a roadmap, confirm:
|
|
|
188
154
|
- [ ] ROADMAP.md matches the expected format for MAXSIM CLI parsing
|
|
189
155
|
- [ ] Overview section summarizes the project and delivery strategy
|
|
190
156
|
|
|
191
|
-
##
|
|
157
|
+
## MAXSIM Integration
|
|
192
158
|
|
|
193
159
|
Roadmap writing integrates with the MAXSIM lifecycle:
|
|
194
|
-
- Use during project initialization
|
|
160
|
+
- Use during project initialization to create the initial roadmap
|
|
195
161
|
- Use when restructuring after a significant scope change or pivot
|
|
196
|
-
- The roadmap is read by MAXSIM agents via `roadmap read`
|
|
162
|
+
- The roadmap is read by MAXSIM agents via `roadmap read` -- format compliance is mandatory
|
|
197
163
|
- Phase numbering must be parseable by `normalizePhaseName()` and `comparePhaseNum()` in core
|
|
198
164
|
- Config `model_profile` in `.planning/config.json` affects agent assignment per phase
|
|
@@ -1,118 +1,79 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sdd
|
|
3
|
-
description:
|
|
3
|
+
description: >-
|
|
4
|
+
Executes plan tasks sequentially, each in a fresh subagent with minimal context,
|
|
5
|
+
with mandatory two-stage review between tasks. Use when executing sequential
|
|
6
|
+
tasks where context rot is a concern or running spec-driven dispatch.
|
|
4
7
|
---
|
|
5
8
|
|
|
6
9
|
# Spec-Driven Dispatch (SDD)
|
|
7
10
|
|
|
8
11
|
Execute tasks sequentially, each in a fresh subagent with clean context. Review every task before moving to the next.
|
|
9
12
|
|
|
10
|
-
**
|
|
11
|
-
|
|
12
|
-
## When to Use
|
|
13
|
-
|
|
14
|
-
- Tasks are sequential and each builds on the previous
|
|
15
|
-
- Context rot is a concern (long plans, many files, complex logic)
|
|
16
|
-
- Each task benefits from starting with a clean context window
|
|
17
|
-
- You want enforced quality gates between tasks
|
|
18
|
-
|
|
19
|
-
Do NOT use this skill when:
|
|
20
|
-
- Tasks are independent and can run in parallel (use batch-worktree instead)
|
|
21
|
-
- The plan has only 1-2 small tasks (overhead is not worth it)
|
|
22
|
-
- All tasks modify the same small set of files (single-agent execution is simpler)
|
|
23
|
-
|
|
24
|
-
## The Iron Law
|
|
25
|
-
|
|
26
|
-
<HARD-GATE>
|
|
27
|
-
NO TASK STARTS UNTIL THE PREVIOUS TASK PASSES 2-STAGE REVIEW.
|
|
28
|
-
If the review found issues, they must be fixed before the next task begins.
|
|
29
|
-
No "we'll fix it later." No "it's close enough." No skipping review for simple tasks.
|
|
30
|
-
Violating this rule ships unreviewed code — the exact problem SDD prevents.
|
|
31
|
-
</HARD-GATE>
|
|
13
|
+
**HARD GATE** -- No task starts until the previous task passes two-stage review. If the review found issues, they must be fixed before the next task begins. No exceptions, no deferral, no skipping review for simple tasks.
|
|
32
14
|
|
|
33
15
|
## Process
|
|
34
16
|
|
|
35
|
-
### 1. LOAD
|
|
17
|
+
### 1. LOAD -- Read the Plan
|
|
36
18
|
|
|
37
19
|
- Read the plan file (PLAN.md) to get the ordered task list
|
|
38
20
|
- For each task, identify: description, acceptance criteria, relevant files
|
|
39
21
|
- Confirm task order makes sense (later tasks may depend on earlier ones)
|
|
40
22
|
|
|
41
|
-
|
|
42
|
-
# Load plan context
|
|
43
|
-
INIT=$(node .claude/maxsim/bin/maxsim-tools.cjs init execute-phase "${PHASE}")
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### 2. DISPATCH — Spawn Fresh Agent Per Task
|
|
23
|
+
### 2. DISPATCH -- Spawn Fresh Agent Per Task
|
|
47
24
|
|
|
48
25
|
For each task in order:
|
|
49
26
|
|
|
50
27
|
1. Assemble the task context:
|
|
51
28
|
- Task description and acceptance criteria from the plan
|
|
52
29
|
- Only the files relevant to this specific task
|
|
53
|
-
- Results from previous tasks (commit hashes, created files)
|
|
54
|
-
2. Spawn a fresh
|
|
30
|
+
- Results from previous tasks (commit hashes, created files) -- NOT the full previous context
|
|
31
|
+
2. Spawn a fresh agent with this minimal context
|
|
55
32
|
3. The agent implements the task, runs tests, and commits
|
|
56
33
|
|
|
57
|
-
|
|
58
|
-
# Record task dispatch
|
|
59
|
-
node .claude/maxsim/bin/maxsim-tools.cjs state-add-decision "SDD: dispatching task N — [description]"
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### 3. REVIEW — 2-Stage Quality Gate
|
|
34
|
+
### 3. REVIEW -- Two-Stage Quality Gate
|
|
63
35
|
|
|
64
36
|
After each task completes, run two review stages before proceeding:
|
|
65
37
|
|
|
66
|
-
|
|
38
|
+
**Stage 1: Spec Compliance**
|
|
67
39
|
|
|
68
40
|
- Does the implementation match the task description?
|
|
69
41
|
- Are all acceptance criteria met?
|
|
70
42
|
- Were only the specified files modified (no scope creep)?
|
|
71
43
|
- Do the changes align with the plan's intent?
|
|
72
44
|
|
|
73
|
-
|
|
45
|
+
Verdict: PASS or FAIL with specific issues.
|
|
74
46
|
|
|
75
|
-
|
|
47
|
+
**Stage 2: Code Quality**
|
|
76
48
|
|
|
77
49
|
- Are there obvious bugs, edge cases, or error handling gaps?
|
|
78
50
|
- Is the code readable and consistent with codebase conventions?
|
|
79
51
|
- Are there unnecessary complications or dead code?
|
|
80
52
|
- Do all tests pass?
|
|
81
53
|
|
|
82
|
-
|
|
83
|
-
# Run tests to verify
|
|
84
|
-
npx vitest run
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
**Verdict:** PASS or FAIL with specific issues.
|
|
54
|
+
Verdict: PASS or FAIL with specific issues.
|
|
88
55
|
|
|
89
|
-
### 4. FIX
|
|
56
|
+
### 4. FIX -- Address Review Failures
|
|
90
57
|
|
|
91
58
|
If either review stage fails:
|
|
92
59
|
|
|
93
|
-
1. Spawn a NEW fresh agent with
|
|
94
|
-
|
|
95
|
-
- The review feedback (specific issues found)
|
|
96
|
-
- The current state of the files
|
|
97
|
-
2. The fix agent addresses ONLY the review issues — no new features
|
|
60
|
+
1. Spawn a NEW fresh agent with the original task description, the review feedback, and the current file state
|
|
61
|
+
2. The fix agent addresses ONLY the review issues -- no new features
|
|
98
62
|
3. Re-run both review stages on the fixed code
|
|
99
63
|
4. If 3 fix attempts fail: STOP and escalate to the user
|
|
100
64
|
|
|
101
|
-
### 5. ADVANCE
|
|
65
|
+
### 5. ADVANCE -- Move to Next Task
|
|
102
66
|
|
|
103
67
|
Only after both review stages pass:
|
|
68
|
+
|
|
104
69
|
- Record the task as complete
|
|
105
|
-
- Note the commit hash and any files created
|
|
70
|
+
- Note the commit hash and any files created or modified
|
|
106
71
|
- Pass this minimal summary (not full context) to the next task's agent
|
|
107
72
|
|
|
108
|
-
|
|
109
|
-
# Record task completion
|
|
110
|
-
node .claude/maxsim/bin/maxsim-tools.cjs state-add-decision "SDD: task N complete — [summary]"
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
### 6. REPORT — Final Summary
|
|
73
|
+
### 6. REPORT -- Final Summary
|
|
114
74
|
|
|
115
75
|
After all tasks complete:
|
|
76
|
+
|
|
116
77
|
- List each task with its status and commit hash
|
|
117
78
|
- Note any tasks that required fix iterations
|
|
118
79
|
- Summarize the total changes made
|
|
@@ -122,38 +83,27 @@ After all tasks complete:
|
|
|
122
83
|
Each agent receives ONLY what it needs:
|
|
123
84
|
|
|
124
85
|
| Context Item | Included? |
|
|
125
|
-
|
|
86
|
+
|---|---|
|
|
126
87
|
| Task description + acceptance criteria | Always |
|
|
127
88
|
| Files relevant to this task | Always |
|
|
128
89
|
| Previous task commit hashes | Always |
|
|
129
90
|
| Previous task full diff | Never |
|
|
130
91
|
| Previous task agent conversation | Never |
|
|
131
92
|
| PROJECT.md / REQUIREMENTS.md | Only if task references project-level concerns |
|
|
132
|
-
| Full codebase | Never
|
|
133
|
-
|
|
134
|
-
**The point of SDD is fresh context. Loading the previous agent's full context defeats the purpose.**
|
|
93
|
+
| Full codebase | Never -- only specified files |
|
|
135
94
|
|
|
136
|
-
|
|
95
|
+
The point of SDD is fresh context. Loading the previous agent's full context defeats the purpose.
|
|
137
96
|
|
|
138
|
-
|
|
139
|
-
|--------|--------------------------|
|
|
140
|
-
| "This task is simple, skip review" | Simple tasks still have bugs. Review takes seconds for simple code. |
|
|
141
|
-
| "Review is slowing us down" | Unreviewed code slows you down more when bugs compound across tasks. |
|
|
142
|
-
| "Just pass the full context forward" | Full context = context rot. Minimal summaries keep agents effective. |
|
|
143
|
-
| "Fix it in the next task" | The next task's agent does not know about the bug. Fix it now. |
|
|
144
|
-
| "The agent knows best, trust it" | Agents make mistakes. That is why review exists. |
|
|
97
|
+
## Common Pitfalls
|
|
145
98
|
|
|
146
|
-
|
|
99
|
+
| Pitfall | Why it matters |
|
|
100
|
+
|---|---|
|
|
101
|
+
| Skipping review for simple tasks | Simple tasks still have bugs. Review takes seconds for simple code. |
|
|
102
|
+
| Passing full context forward | Full context causes context rot. Minimal summaries keep agents effective. |
|
|
103
|
+
| Deferring fixes to the next task | The next task's agent does not know about the bug. Fix it now. |
|
|
104
|
+
| Accumulating fix-later items across tasks | Each task must be clean before the next starts. |
|
|
147
105
|
|
|
148
|
-
|
|
149
|
-
- Passing full conversation history to the next agent
|
|
150
|
-
- Skipping Stage 1 or Stage 2 of the review
|
|
151
|
-
- Accumulating "fix later" items across tasks
|
|
152
|
-
- On the 3rd fix attempt for the same review issue (escalate to user)
|
|
153
|
-
|
|
154
|
-
**If any red flag triggers: STOP. Complete the review cycle for the current task before proceeding.**
|
|
155
|
-
|
|
156
|
-
## Verification Checklist
|
|
106
|
+
## Verification
|
|
157
107
|
|
|
158
108
|
Before reporting completion, confirm:
|
|
159
109
|
|
|
@@ -164,12 +114,13 @@ Before reporting completion, confirm:
|
|
|
164
114
|
- [ ] All tests pass after the final task
|
|
165
115
|
- [ ] Summary includes per-task status and commit hashes
|
|
166
116
|
|
|
167
|
-
##
|
|
117
|
+
## MAXSIM Integration
|
|
168
118
|
|
|
169
119
|
When a plan specifies `skill: "sdd"`:
|
|
120
|
+
|
|
170
121
|
- The orchestrator reads tasks from PLAN.md in order
|
|
171
122
|
- Each task is dispatched to a fresh subagent
|
|
172
|
-
-
|
|
123
|
+
- Two-stage review runs between every task
|
|
173
124
|
- Failed reviews trigger fix agents (up to 3 attempts)
|
|
174
125
|
- Progress is tracked in STATE.md via decision entries
|
|
175
126
|
- Final results are recorded in SUMMARY.md
|