maxsimcli 4.0.0 → 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/README.md +43 -17
- package/dist/assets/CHANGELOG.md +60 -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/dist/mcp-server.cjs +22489 -32
- package/dist/mcp-server.cjs.map +1 -1
- package/package.json +1 -1
|
@@ -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
|
|
@@ -1,185 +1,142 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: simplify
|
|
3
|
-
description:
|
|
3
|
+
description: >-
|
|
4
|
+
Reviews changed code for reuse opportunities, unnecessary complexity, and
|
|
5
|
+
dead weight using three parallel review agents. Use when reviewing code
|
|
6
|
+
before committing, cleaning up implementations, or preparing changes for
|
|
7
|
+
review.
|
|
4
8
|
---
|
|
5
9
|
|
|
6
10
|
# Simplify
|
|
7
11
|
|
|
8
|
-
Every line of code is a liability.
|
|
12
|
+
Every line of code is a liability. Remove what does not earn its place.
|
|
9
13
|
|
|
10
|
-
**If you have not
|
|
14
|
+
**HARD GATE**: No code ships without a simplification pass. If you have not checked for duplication, dead code, and unnecessary complexity, the change is not ready. "It works" is the starting point, not the finish line.
|
|
11
15
|
|
|
12
|
-
##
|
|
16
|
+
## When to Use
|
|
13
17
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
Violating this rule is a violation — not a preference.
|
|
19
|
-
</HARD-GATE>
|
|
18
|
+
- After implementing a feature or fix, before committing
|
|
19
|
+
- When preparing changes for code review
|
|
20
|
+
- When cleaning up code that has grown organically over multiple iterations
|
|
21
|
+
- When onboarding to a file and noticing accumulated complexity
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
Do NOT use this skill when:
|
|
24
|
+
- Making a hotfix where speed matters more than polish (file a follow-up instead)
|
|
25
|
+
- The changes are purely mechanical (renames, formatting, dependency bumps)
|
|
22
26
|
|
|
23
|
-
|
|
27
|
+
## Process
|
|
24
28
|
|
|
25
|
-
### 1. DIFF —
|
|
29
|
+
### 1. DIFF — Identify What Changed
|
|
26
30
|
|
|
27
|
-
-
|
|
28
|
-
- Read
|
|
29
|
-
-
|
|
31
|
+
- Collect the set of modified and added files
|
|
32
|
+
- Read each file in full, not just the changed hunks
|
|
33
|
+
- Note files that interact with the changes (callers, consumers, shared modules)
|
|
30
34
|
|
|
31
|
-
|
|
32
|
-
# Review staged changes
|
|
33
|
-
git diff --staged
|
|
34
|
-
# Or all uncommitted changes
|
|
35
|
-
git diff
|
|
36
|
-
```
|
|
35
|
+
### 2. DUPLICATION — Eliminate Repeated Logic
|
|
37
36
|
|
|
38
|
-
|
|
37
|
+
- Are there patterns repeated across files that should be a shared helper?
|
|
38
|
+
- Does new code duplicate existing utilities or library functions?
|
|
39
|
+
- Could two similar implementations be merged behind a single interface?
|
|
40
|
+
- Is there copy-paste that should be refactored?
|
|
39
41
|
|
|
40
|
-
|
|
41
|
-
- Are there two or more blocks that do similar things and could share a helper?
|
|
42
|
-
- Could an existing utility, library function, or helper replace new code?
|
|
43
|
-
- Is there copy-paste from another file that should be extracted?
|
|
42
|
+
**Rule of three**: If the same pattern appears three times, extract it.
|
|
44
43
|
|
|
45
|
-
|
|
44
|
+
### 3. DEAD CODE — Remove What Is Not Called
|
|
46
45
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
- Are there unreachable branches or impossible conditions?
|
|
52
|
-
- Are there parameters that are always passed the same value?
|
|
53
|
-
|
|
54
|
-
**If it is not called, it does not belong. Delete it.**
|
|
46
|
+
- Delete unused imports, variables, functions, and parameters
|
|
47
|
+
- Remove commented-out code blocks (version control is the archive)
|
|
48
|
+
- Strip unreachable branches and impossible conditions
|
|
49
|
+
- Drop feature flags and configuration for features that no longer exist
|
|
55
50
|
|
|
56
51
|
### 4. COMPLEXITY — Question Every Abstraction
|
|
57
52
|
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
53
|
+
- Does every wrapper, adapter, or indirection layer justify its existence?
|
|
54
|
+
- Are there generics or parametrization that serve only one concrete case?
|
|
55
|
+
- Could a 20-line class be replaced by a 3-line function?
|
|
56
|
+
- Is there defensive programming that guards against conditions that cannot occur?
|
|
62
57
|
|
|
63
|
-
**
|
|
58
|
+
**If removing it does not break anything, it should not be there.**
|
|
64
59
|
|
|
65
|
-
### 5. CLARITY —
|
|
60
|
+
### 5. CLARITY — Tighten Naming and Structure
|
|
66
61
|
|
|
67
|
-
- Are
|
|
68
|
-
- Could
|
|
69
|
-
-
|
|
70
|
-
-
|
|
62
|
+
- Are names self-documenting? Rename anything that needs a comment to explain.
|
|
63
|
+
- Could nested logic be flattened with early returns?
|
|
64
|
+
- Is control flow straightforward, or does it require tracing to understand?
|
|
65
|
+
- Are there layers of indirection that obscure the data path?
|
|
71
66
|
|
|
72
|
-
### 6.
|
|
67
|
+
### 6. REVIEW — Final Sanity Check
|
|
73
68
|
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
- Is data being transformed multiple times when once would suffice?
|
|
69
|
+
- Re-read the simplified code end to end
|
|
70
|
+
- Confirm all tests still pass
|
|
71
|
+
- Verify no behavioral changes were introduced (simplify, do not alter)
|
|
78
72
|
|
|
79
|
-
|
|
73
|
+
## Parallel 3-Reviewer Pattern
|
|
80
74
|
|
|
81
|
-
|
|
75
|
+
When invoked as part of the execute-phase cycle, simplification runs as three parallel review agents, each focused on one dimension.
|
|
82
76
|
|
|
83
|
-
|
|
84
|
-
|----------|----------|---------------|
|
|
85
|
-
| Duplication | Same logic exists elsewhere? | Extract shared helper or reuse existing |
|
|
86
|
-
| Duplication | Copy-paste from another file? | Extract to shared module |
|
|
87
|
-
| Dead code | Unused imports or variables? | Delete them |
|
|
88
|
-
| Dead code | Commented-out code? | Delete it (git has history) |
|
|
89
|
-
| Complexity | Abstraction for one call site? | Inline it |
|
|
90
|
-
| Complexity | Generic where specific suffices? | Simplify to specific |
|
|
91
|
-
| Complexity | Config for hypothetical needs? | Remove until needed |
|
|
92
|
-
| Clarity | Confusing variable name? | Rename to describe purpose |
|
|
93
|
-
| Clarity | Deep nesting? | Flatten with early returns |
|
|
94
|
-
| Efficiency | O(n^2) with obvious O(n) fix? | Fix it now |
|
|
95
|
-
| Efficiency | Same computation in a loop? | Hoist outside the loop |
|
|
77
|
+
### Reviewer 1: Code Reuse
|
|
96
78
|
|
|
97
|
-
|
|
79
|
+
- Scan all changed files for duplicated patterns
|
|
80
|
+
- Cross-reference against existing shared utilities and helpers
|
|
81
|
+
- Flag any logic that appears three or more times without extraction
|
|
82
|
+
- **Output**: List of reuse opportunities with file paths and line ranges
|
|
98
83
|
|
|
99
|
-
|
|
100
|
-
|--------|--------------------------|
|
|
101
|
-
| "It works, don't touch it" | Working is the minimum bar. Simplify before it becomes legacy. |
|
|
102
|
-
| "We might need the flexibility later" | YAGNI. Add flexibility when you need it, not before. |
|
|
103
|
-
| "Refactoring is risky" | Small simplifications with passing tests are safe. Large refactors are a separate task. |
|
|
104
|
-
| "The duplication is minor" | Minor duplication compounds. Three occurrences is the threshold, not six. |
|
|
105
|
-
| "I'll clean it up in a follow-up" | Follow-ups rarely happen. Simplify now while context is fresh. |
|
|
106
|
-
| "It's just a few extra lines" | Every unnecessary line is maintenance cost. Delete it. |
|
|
84
|
+
### Reviewer 2: Code Quality
|
|
107
85
|
|
|
108
|
-
|
|
86
|
+
- Check for dead code: unused imports, unreachable branches, commented blocks
|
|
87
|
+
- Verify naming consistency with codebase conventions
|
|
88
|
+
- Flag unnecessary abstractions, wrappers, and indirection
|
|
89
|
+
- **Output**: List of quality issues categorized by severity
|
|
109
90
|
|
|
110
|
-
|
|
111
|
-
- Keeping dead code "just in case"
|
|
112
|
-
- Adding a utility class for a single use case
|
|
113
|
-
- Building configuration for features no one has requested
|
|
114
|
-
- Writing a comment to explain code that could be rewritten to be self-evident
|
|
115
|
-
- Skipping simplification because "it's good enough"
|
|
91
|
+
### Reviewer 3: Efficiency
|
|
116
92
|
|
|
117
|
-
|
|
93
|
+
- Identify over-engineered solutions (parametrization serving one case, generic interfaces with one implementor)
|
|
94
|
+
- Flag defensive programming that guards impossible conditions
|
|
95
|
+
- Check for configuration and feature flags that serve no current purpose
|
|
96
|
+
- **Output**: List of efficiency issues with suggested removals
|
|
118
97
|
|
|
119
|
-
|
|
98
|
+
### Consolidation
|
|
120
99
|
|
|
121
|
-
|
|
100
|
+
After all three reviewers complete:
|
|
101
|
+
1. Merge findings into a deduplicated list
|
|
102
|
+
2. Apply fixes for all actionable items (BLOCKER and HIGH priority first)
|
|
103
|
+
3. Re-run tests to confirm nothing broke
|
|
104
|
+
4. Report status: CLEAN (nothing found), FIXED (issues resolved), or BLOCKED (cannot simplify without architectural changes)
|
|
122
105
|
|
|
123
|
-
|
|
124
|
-
- [ ] No duplication with existing codebase logic (or duplication is below threshold)
|
|
125
|
-
- [ ] No dead code: unused imports, variables, unreachable branches, commented code
|
|
126
|
-
- [ ] No unnecessary abstractions, wrappers, or premature generalizations
|
|
127
|
-
- [ ] Naming is clear and consistent with codebase conventions
|
|
128
|
-
- [ ] No obvious efficiency issues (unnecessary O(n^2), repeated computations)
|
|
129
|
-
- [ ] Tests still pass after simplification changes
|
|
106
|
+
## Common Rationalizations — REJECT THESE
|
|
130
107
|
|
|
131
|
-
|
|
108
|
+
| Excuse | Why It Violates the Rule |
|
|
109
|
+
|--------|--------------------------|
|
|
110
|
+
| "It might be needed later" | Delete it. Re-adding is cheaper than maintaining unused code. |
|
|
111
|
+
| "The abstraction makes it extensible" | Extensibility that serves no current requirement is dead weight. |
|
|
112
|
+
| "Refactoring is risky" | Small, tested simplifications reduce risk. Accumulated complexity increases it. |
|
|
113
|
+
| "I'll clean it up later" | Later never comes. Simplify now while context is fresh. |
|
|
132
114
|
|
|
133
|
-
|
|
134
|
-
- After task implementation is complete and tests pass, run this review
|
|
135
|
-
- Make simplification changes as part of the same commit (not a separate task)
|
|
136
|
-
- If simplification reveals a larger refactoring opportunity, file a todo — do not scope-creep
|
|
137
|
-
- Track significant simplifications in the task's commit message (e.g., "extracted shared helper for X")
|
|
115
|
+
## Red Flags — STOP If You Catch Yourself:
|
|
138
116
|
|
|
139
|
-
|
|
117
|
+
- Skipping the simplification pass because the diff is small
|
|
118
|
+
- Keeping dead code "just in case"
|
|
119
|
+
- Adding complexity during a simplification pass
|
|
120
|
+
- Merging without having read the full file (not just changed lines)
|
|
140
121
|
|
|
141
|
-
|
|
122
|
+
**If any red flag triggers: STOP. Complete the simplification cycle before proceeding.**
|
|
142
123
|
|
|
143
|
-
|
|
144
|
-
- Find duplicated logic across the codebase (not just within changed files)
|
|
145
|
-
- Identify copy-paste from other files that should be extracted to shared modules
|
|
146
|
-
- Suggest shared helpers for patterns appearing 3+ times (Rule of Three)
|
|
147
|
-
- Check if existing utility functions, library methods, or helpers could replace new code
|
|
148
|
-
- **Output:** List of reuse opportunities with file paths and line ranges
|
|
124
|
+
## Verification Checklist
|
|
149
125
|
|
|
150
|
-
|
|
151
|
-
- Check naming consistency with codebase conventions (read CLAUDE.md first)
|
|
152
|
-
- Verify error handling covers all external calls and edge cases
|
|
153
|
-
- Look for dead code: unused imports, variables, unreachable branches, commented-out code
|
|
154
|
-
- Check for unnecessary abstractions, wrappers, or premature generalizations
|
|
155
|
-
- Verify security: no hardcoded secrets, no unsanitized inputs, no data exposure
|
|
156
|
-
- **Output:** List of quality issues categorized by severity (BLOCKER, HIGH, MEDIUM)
|
|
126
|
+
Before reporting completion, confirm:
|
|
157
127
|
|
|
158
|
-
|
|
159
|
-
-
|
|
160
|
-
-
|
|
161
|
-
-
|
|
162
|
-
-
|
|
163
|
-
-
|
|
164
|
-
- **Output:** List of efficiency issues with suggested fixes
|
|
128
|
+
- [ ] All changed files were reviewed in full (not just diffs)
|
|
129
|
+
- [ ] No duplicated logic remains that appears three or more times
|
|
130
|
+
- [ ] No dead code: unused imports, commented blocks, unreachable branches
|
|
131
|
+
- [ ] No unnecessary abstractions, wrappers, or indirection layers
|
|
132
|
+
- [ ] All tests pass after simplification
|
|
133
|
+
- [ ] No behavioral changes were introduced (simplify only, do not alter)
|
|
165
134
|
|
|
166
|
-
|
|
135
|
+
## MAXSIM Integration
|
|
167
136
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
6. Reports final status: CLEAN (nothing found), FIXED (issues found and resolved), or BLOCKED (cannot fix without architectural change)
|
|
175
|
-
|
|
176
|
-
### Spawning Pattern
|
|
177
|
-
|
|
178
|
-
Each reviewer is spawned as a parallel agent via the Agent tool:
|
|
179
|
-
```
|
|
180
|
-
# All 3 run in parallel
|
|
181
|
-
Task(prompt="Reviewer 1: Code Reuse — {files_to_review} ...", subagent_type="maxsim-executor")
|
|
182
|
-
Task(prompt="Reviewer 2: Code Quality — {files_to_review} ...", subagent_type="maxsim-executor")
|
|
183
|
-
Task(prompt="Reviewer 3: Efficiency — {files_to_review} ...", subagent_type="maxsim-executor")
|
|
184
|
-
# Wait for all 3 to complete, then consolidate
|
|
185
|
-
```
|
|
137
|
+
When a plan specifies `skill: "simplify"`:
|
|
138
|
+
- The orchestrator collects changed files from the implementation step
|
|
139
|
+
- Three parallel reviewers (Reuse, Quality, Efficiency) are spawned
|
|
140
|
+
- Findings are consolidated and fixes applied
|
|
141
|
+
- Progress is tracked in STATE.md via decision entries
|
|
142
|
+
- Final results are recorded in SUMMARY.md
|