maxsimcli 4.8.0 → 4.10.0

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 (162) hide show
  1. package/README.md +180 -202
  2. package/dist/assets/CHANGELOG.md +61 -0
  3. package/dist/assets/hooks/maxsim-check-update.cjs +38 -0
  4. package/dist/assets/hooks/maxsim-check-update.cjs.map +1 -1
  5. package/dist/assets/hooks/maxsim-statusline.cjs +116 -48
  6. package/dist/assets/hooks/maxsim-statusline.cjs.map +1 -1
  7. package/dist/assets/hooks/maxsim-sync-reminder.cjs +117 -0
  8. package/dist/assets/hooks/maxsim-sync-reminder.cjs.map +1 -0
  9. package/dist/assets/templates/agents/AGENTS.md +78 -106
  10. package/dist/assets/templates/agents/executor.md +101 -0
  11. package/dist/assets/templates/agents/planner.md +86 -0
  12. package/dist/assets/templates/agents/researcher.md +71 -0
  13. package/dist/assets/templates/agents/verifier.md +88 -0
  14. package/dist/assets/templates/commands/maxsim/debug.md +7 -7
  15. package/dist/assets/templates/commands/maxsim/execute.md +45 -0
  16. package/dist/assets/templates/commands/maxsim/go.md +29 -0
  17. package/dist/assets/templates/commands/maxsim/help.md +2 -2
  18. package/dist/assets/templates/commands/maxsim/init.md +52 -0
  19. package/dist/assets/templates/commands/maxsim/plan.md +50 -0
  20. package/dist/assets/templates/commands/maxsim/progress.md +4 -3
  21. package/dist/assets/templates/commands/maxsim/quick.md +6 -4
  22. package/dist/assets/templates/commands/maxsim/settings.md +4 -3
  23. package/dist/assets/templates/references/continuation-format.md +16 -16
  24. package/dist/assets/templates/references/model-profile-resolution.md +1 -1
  25. package/dist/assets/templates/references/model-profiles.md +12 -19
  26. package/dist/assets/templates/rules/conventions.md +51 -0
  27. package/dist/assets/templates/rules/verification-protocol.md +57 -0
  28. package/dist/assets/templates/skills/agent-system-map/SKILL.md +92 -0
  29. package/dist/assets/templates/skills/brainstorming/SKILL.md +48 -36
  30. package/dist/assets/templates/skills/code-review/SKILL.md +40 -61
  31. package/dist/assets/templates/skills/commit-conventions/SKILL.md +75 -0
  32. package/dist/assets/templates/skills/evidence-collection/SKILL.md +87 -0
  33. package/dist/assets/templates/skills/handoff-contract/SKILL.md +70 -0
  34. package/dist/assets/templates/skills/input-validation/SKILL.md +51 -0
  35. package/dist/assets/templates/skills/maxsim-batch/SKILL.md +41 -45
  36. package/dist/assets/templates/skills/maxsim-simplify/SKILL.md +37 -90
  37. package/dist/assets/templates/skills/memory-management/SKILL.md +32 -67
  38. package/dist/assets/templates/skills/research-methodology/SKILL.md +137 -0
  39. package/dist/assets/templates/skills/roadmap-writing/SKILL.md +40 -58
  40. package/dist/assets/templates/skills/sdd/SKILL.md +34 -69
  41. package/dist/assets/templates/skills/systematic-debugging/SKILL.md +20 -26
  42. package/dist/assets/templates/skills/tdd/SKILL.md +25 -33
  43. package/dist/assets/templates/skills/tool-priority-guide/SKILL.md +80 -0
  44. package/dist/assets/templates/skills/using-maxsim/SKILL.md +42 -73
  45. package/dist/assets/templates/skills/verification-before-completion/SKILL.md +12 -24
  46. package/dist/assets/templates/skills/verification-gates/SKILL.md +169 -0
  47. package/dist/assets/templates/templates/UAT.md +3 -3
  48. package/dist/assets/templates/templates/VALIDATION.md +1 -1
  49. package/dist/assets/templates/templates/context.md +4 -4
  50. package/dist/assets/templates/templates/debug-subagent-prompt.md +3 -3
  51. package/dist/assets/templates/templates/discovery.md +2 -2
  52. package/dist/assets/templates/templates/phase-prompt.md +2 -2
  53. package/dist/assets/templates/templates/planner-subagent-prompt.md +7 -7
  54. package/dist/assets/templates/templates/project.md +1 -1
  55. package/dist/assets/templates/templates/research.md +1 -1
  56. package/dist/assets/templates/templates/state.md +2 -2
  57. package/dist/assets/templates/templates/summary.md +41 -0
  58. package/dist/assets/templates/workflows/batch.md +5 -5
  59. package/dist/assets/templates/workflows/diagnose-issues.md +2 -2
  60. package/dist/assets/templates/workflows/discovery-phase.md +3 -3
  61. package/dist/assets/templates/workflows/discuss-phase.md +11 -11
  62. package/dist/assets/templates/workflows/execute-phase.md +205 -11
  63. package/dist/assets/templates/workflows/execute-plan.md +299 -34
  64. package/dist/assets/templates/workflows/execute.md +421 -0
  65. package/dist/assets/templates/workflows/go.md +250 -0
  66. package/dist/assets/templates/workflows/health.md +5 -5
  67. package/dist/assets/templates/workflows/help.md +165 -435
  68. package/dist/assets/templates/workflows/init-existing.md +23 -23
  69. package/dist/assets/templates/workflows/init.md +205 -0
  70. package/dist/assets/templates/workflows/new-milestone.md +9 -9
  71. package/dist/assets/templates/workflows/new-project.md +26 -26
  72. package/dist/assets/templates/workflows/plan-create.md +298 -0
  73. package/dist/assets/templates/workflows/plan-discuss.md +347 -0
  74. package/dist/assets/templates/workflows/plan-phase.md +29 -29
  75. package/dist/assets/templates/workflows/plan-research.md +177 -0
  76. package/dist/assets/templates/workflows/plan.md +231 -0
  77. package/dist/assets/templates/workflows/progress.md +46 -42
  78. package/dist/assets/templates/workflows/quick.md +195 -14
  79. package/dist/assets/templates/workflows/research-phase.md +5 -5
  80. package/dist/assets/templates/workflows/sdd.md +20 -12
  81. package/dist/assets/templates/workflows/settings.md +18 -14
  82. package/dist/assets/templates/workflows/verify-phase.md +1 -1
  83. package/dist/assets/templates/workflows/verify-work.md +16 -16
  84. package/dist/cli.cjs +4589 -229
  85. package/dist/cli.cjs.map +1 -1
  86. package/dist/core-D5zUr9cb.cjs.map +1 -1
  87. package/dist/install.cjs +234 -17
  88. package/dist/install.cjs.map +1 -1
  89. package/dist/mcp-server.cjs +298 -20
  90. package/dist/mcp-server.cjs.map +1 -1
  91. package/dist/skills-CjFWZIGM.cjs.map +1 -1
  92. package/package.json +1 -1
  93. package/dist/assets/hooks/maxsim-context-monitor.cjs +0 -121
  94. package/dist/assets/hooks/maxsim-context-monitor.cjs.map +0 -1
  95. package/dist/assets/templates/agents/maxsim-code-reviewer.md +0 -239
  96. package/dist/assets/templates/agents/maxsim-codebase-mapper.md +0 -214
  97. package/dist/assets/templates/agents/maxsim-debugger.md +0 -572
  98. package/dist/assets/templates/agents/maxsim-drift-checker.md +0 -522
  99. package/dist/assets/templates/agents/maxsim-executor.md +0 -504
  100. package/dist/assets/templates/agents/maxsim-integration-checker.md +0 -273
  101. package/dist/assets/templates/agents/maxsim-phase-researcher.md +0 -305
  102. package/dist/assets/templates/agents/maxsim-plan-checker.md +0 -343
  103. package/dist/assets/templates/agents/maxsim-planner.md +0 -610
  104. package/dist/assets/templates/agents/maxsim-project-researcher.md +0 -359
  105. package/dist/assets/templates/agents/maxsim-research-synthesizer.md +0 -263
  106. package/dist/assets/templates/agents/maxsim-roadmapper.md +0 -324
  107. package/dist/assets/templates/agents/maxsim-spec-reviewer.md +0 -245
  108. package/dist/assets/templates/agents/maxsim-verifier.md +0 -393
  109. package/dist/assets/templates/commands/maxsim/add-phase.md +0 -43
  110. package/dist/assets/templates/commands/maxsim/add-tests.md +0 -41
  111. package/dist/assets/templates/commands/maxsim/add-todo.md +0 -57
  112. package/dist/assets/templates/commands/maxsim/artefakte.md +0 -122
  113. package/dist/assets/templates/commands/maxsim/audit-milestone.md +0 -36
  114. package/dist/assets/templates/commands/maxsim/batch.md +0 -42
  115. package/dist/assets/templates/commands/maxsim/check-drift.md +0 -56
  116. package/dist/assets/templates/commands/maxsim/check-todos.md +0 -46
  117. package/dist/assets/templates/commands/maxsim/cleanup.md +0 -18
  118. package/dist/assets/templates/commands/maxsim/complete-milestone.md +0 -136
  119. package/dist/assets/templates/commands/maxsim/discuss-phase.md +0 -87
  120. package/dist/assets/templates/commands/maxsim/discuss.md +0 -70
  121. package/dist/assets/templates/commands/maxsim/execute-phase.md +0 -41
  122. package/dist/assets/templates/commands/maxsim/health.md +0 -22
  123. package/dist/assets/templates/commands/maxsim/init-existing.md +0 -46
  124. package/dist/assets/templates/commands/maxsim/insert-phase.md +0 -32
  125. package/dist/assets/templates/commands/maxsim/list-phase-assumptions.md +0 -46
  126. package/dist/assets/templates/commands/maxsim/map-codebase.md +0 -71
  127. package/dist/assets/templates/commands/maxsim/new-milestone.md +0 -44
  128. package/dist/assets/templates/commands/maxsim/new-project.md +0 -46
  129. package/dist/assets/templates/commands/maxsim/pause-work.md +0 -38
  130. package/dist/assets/templates/commands/maxsim/plan-milestone-gaps.md +0 -34
  131. package/dist/assets/templates/commands/maxsim/plan-phase.md +0 -44
  132. package/dist/assets/templates/commands/maxsim/realign.md +0 -39
  133. package/dist/assets/templates/commands/maxsim/reapply-patches.md +0 -110
  134. package/dist/assets/templates/commands/maxsim/remove-phase.md +0 -31
  135. package/dist/assets/templates/commands/maxsim/research-phase.md +0 -189
  136. package/dist/assets/templates/commands/maxsim/resume-work.md +0 -40
  137. package/dist/assets/templates/commands/maxsim/roadmap.md +0 -19
  138. package/dist/assets/templates/commands/maxsim/sdd.md +0 -39
  139. package/dist/assets/templates/commands/maxsim/set-profile.md +0 -34
  140. package/dist/assets/templates/commands/maxsim/update.md +0 -37
  141. package/dist/assets/templates/commands/maxsim/verify-work.md +0 -38
  142. package/dist/assets/templates/workflows/add-phase.md +0 -111
  143. package/dist/assets/templates/workflows/add-tests.md +0 -351
  144. package/dist/assets/templates/workflows/add-todo.md +0 -247
  145. package/dist/assets/templates/workflows/audit-milestone.md +0 -297
  146. package/dist/assets/templates/workflows/check-drift.md +0 -248
  147. package/dist/assets/templates/workflows/check-todos.md +0 -261
  148. package/dist/assets/templates/workflows/cleanup.md +0 -153
  149. package/dist/assets/templates/workflows/complete-milestone.md +0 -701
  150. package/dist/assets/templates/workflows/discuss.md +0 -343
  151. package/dist/assets/templates/workflows/insert-phase.md +0 -129
  152. package/dist/assets/templates/workflows/list-phase-assumptions.md +0 -178
  153. package/dist/assets/templates/workflows/map-codebase.md +0 -315
  154. package/dist/assets/templates/workflows/pause-work.md +0 -122
  155. package/dist/assets/templates/workflows/plan-milestone-gaps.md +0 -274
  156. package/dist/assets/templates/workflows/realign.md +0 -288
  157. package/dist/assets/templates/workflows/remove-phase.md +0 -154
  158. package/dist/assets/templates/workflows/resume-project.md +0 -306
  159. package/dist/assets/templates/workflows/roadmap.md +0 -130
  160. package/dist/assets/templates/workflows/set-profile.md +0 -81
  161. package/dist/assets/templates/workflows/transition.md +0 -544
  162. package/dist/assets/templates/workflows/update.md +0 -220
@@ -1,90 +1,86 @@
1
1
  ---
2
2
  name: maxsim-batch
3
3
  description: >-
4
- Decomposes large tasks into independent units and executes each in an isolated
5
- git worktree with its own branch and PR. Use when parallelizing work across
6
- 3-30 independent units or orchestrating worktree-based parallel execution. Not
7
- for sequential dependencies or fewer than 3 units.
4
+ Parallel worktree execution for independent work units. Isolates agents in
5
+ separate git worktrees for conflict-free parallel implementation. Use when
6
+ executing multiple independent plans, batch processing, or parallelizable
7
+ tasks.
8
8
  ---
9
9
 
10
- # Batch Worktree
10
+ # Batch Worktree Execution
11
11
 
12
- Decompose large tasks into independent units, execute each in an isolated worktree, and produce one PR per unit.
12
+ Decompose large tasks into independent units and execute each in an isolated git worktree.
13
13
 
14
- **HARD GATE: Every unit must be independently mergeable. If merging unit A would break the build without unit B, they are not independent. Combine them or serialize them. No exceptions.**
14
+ ## When to Use
15
+
16
+ - 3 or more independent work units with no shared file modifications
17
+ - Tasks that can be verified independently (each unit's tests pass without the others)
18
+ - Parallelizable implementation where speed matters
19
+
20
+ **Do not use for:** Fewer than 3 units (overhead not worth it), sequential dependencies, tasks that modify the same files.
15
21
 
16
22
  ## Process
17
23
 
18
- ### 1. Research -- Analyze and Decompose
24
+ ### 1. DECOMPOSE -- Analyze Independence
19
25
 
20
- List all units with a one-line description each. For each unit, list the files it will create or modify. Verify no file appears in more than one unit. If overlap exists, merge the overlapping units into one or extract shared code into a prerequisite unit that runs first.
26
+ List all units with a one-line description each. For each unit, list the files it will create or modify. Verify:
21
27
 
22
- For each pair of units, confirm:
23
- - No shared file modifications
28
+ - No file appears in more than one unit
24
29
  - No runtime dependency (unit A output is not unit B input)
25
- - Each unit's tests pass without the other unit's changes
30
+ - Each unit's tests pass without the other units' changes
31
+
32
+ If overlap exists, merge overlapping units or extract shared code into a prerequisite unit that runs first.
26
33
 
27
- If validation fails, redesign the decomposition before proceeding.
34
+ ### 2. PLAN -- Define Unit Specifications
28
35
 
29
- ### 2. Plan -- Define Unit Specifications
36
+ For each unit, prepare:
30
37
 
31
- For each unit, prepare a specification containing:
32
38
  - Unit description and acceptance criteria
33
39
  - The list of files it owns (and only those files)
34
40
  - The base branch to branch from
35
- - Instructions to implement, test, commit, push, and create a PR
36
-
37
- Record the decomposition decision:
38
-
39
- ```
40
- node .claude/maxsim/bin/maxsim-tools.cjs state-add-decision "Batch decomposition: N units identified, no file overlap confirmed"
41
- ```
41
+ - Instructions: implement, test, commit, push, create PR
42
42
 
43
- ### 3. Spawn -- Create Worktree Per Unit
43
+ ### 3. SPAWN -- Create Worktree Per Unit
44
44
 
45
- For each unit, create an isolated worktree and spawn an agent with `isolation: "worktree"`. Each agent receives its unit specification and works independently through: read relevant source, implement changes, run tests, commit, push, create PR.
45
+ For each unit, create an isolated worktree and spawn an agent. Each agent works independently: read source, implement changes, run tests, commit, push, create PR.
46
46
 
47
- ### 4. Track -- Monitor Progress
47
+ ### 4. TRACK -- Monitor Progress
48
48
 
49
- Maintain a status table and update it as agents report back:
49
+ Maintain a status table:
50
50
 
51
51
  | # | Unit | Status | PR |
52
52
  |---|------|--------|----|
53
53
  | 1 | description | done | #123 |
54
54
  | 2 | description | in-progress | -- |
55
- | 3 | description | failed | -- |
56
55
 
57
- Statuses: `pending`, `in-progress`, `done`, `failed`, `needs-review`
56
+ Statuses: `pending`, `in-progress`, `done`, `failed`
57
+
58
+ ### 5. MERGE -- Collect Results
59
+
60
+ When all units complete, list all created PRs. Handle failures:
58
61
 
59
- Failure handling:
60
62
  - Unit fails tests: spawn a fix agent in the same worktree
61
- - Merge conflict: decomposition was wrong, fix overlap and re-run unit
62
- - Agent times out: re-spawn with the same unit description
63
- - 3+ failures on same unit: stop and escalate to user
63
+ - Merge conflict: decomposition was wrong -- fix overlap and re-run unit
64
+ - 3+ failures on same unit: stop and escalate
65
+
66
+ ## Limits
64
67
 
65
- When all units complete, list all created PRs and flag any failed units with error summaries. If any unit failed, spawn a fix agent for that unit only.
68
+ - Up to 30 parallel agents, but typically 3-10 for manageable coordination
69
+ - Fast-forward merge preferred, rebase if needed
70
+ - Each unit must be independently mergeable
66
71
 
67
72
  ## Common Pitfalls
68
73
 
69
74
  - "The overlap is minor" -- Minor overlap causes merge conflicts. Split shared code into a prerequisite unit.
70
75
  - "We'll merge in the right order" -- Order-dependent merges are not independent. Serialize those units.
71
- - "Only 2 units, let's still use worktrees" -- Worktree overhead is not worth it for fewer than 3 units. Use sequential execution.
76
+ - "Only 2 units, let's still use worktrees" -- Worktree overhead is not worth it for fewer than 3 units.
72
77
 
73
78
  ## Verification
74
79
 
75
- Before reporting completion, confirm:
80
+ Before reporting completion:
76
81
 
77
- - [ ] All units were verified to touch non-overlapping files
82
+ - [ ] All units touch non-overlapping files
78
83
  - [ ] Each unit was implemented in an isolated worktree
79
84
  - [ ] Each unit's tests pass independently
80
85
  - [ ] Each unit has its own PR
81
86
  - [ ] No PR depends on another PR being merged first
82
- - [ ] Status table is complete with all PR links
83
-
84
- ## MAXSIM Integration
85
-
86
- When a plan specifies `skill: "maxsim-batch"`:
87
- - The orchestrator decomposes the plan's tasks into independent units
88
- - Each unit becomes a worktree agent with its own branch and PR
89
- - The orchestrator tracks progress and reports the final PR list in SUMMARY.md
90
- - Failed units are retried once before escalating
@@ -1,55 +1,38 @@
1
1
  ---
2
2
  name: maxsim-simplify
3
3
  description: >-
4
- Maintainability optimization pass: finds duplication, dead code, and
5
- unnecessary complexity. Answers "Is this code as simple as it can be?"
6
- Use when reviewing code before committing, cleaning up implementations,
7
- or preparing changes for review. Not a correctness gate — that is
8
- code-review's job.
4
+ Maintainability optimization covering duplication, dead code, complexity, and
5
+ naming. Produces structured findings with before/after metrics. Use when
6
+ reviewing code for simplification, during refactoring passes, or when
7
+ codebase complexity is increasing.
9
8
  ---
10
9
 
11
10
  # Simplify
12
11
 
13
12
  Every line of code is a liability. Remove what does not earn its place.
14
13
 
15
- **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.
14
+ ## Scope
16
15
 
17
- ## When to Use
16
+ Only simplify touched files unless explicitly asked for broader refactoring. The goal is incremental maintainability improvement, not a codebase-wide rewrite.
18
17
 
19
- - After implementing a feature or fix, before committing
20
- - When preparing changes for code review
21
- - When cleaning up code that has grown organically over multiple iterations
22
- - When onboarding to a file and noticing accumulated complexity
18
+ ## Dimensions
23
19
 
24
- Do NOT use this skill when:
25
- - Making a hotfix where speed matters more than polish (file a follow-up instead)
26
- - The changes are purely mechanical (renames, formatting, dependency bumps)
27
-
28
- ## Process
29
-
30
- ### 1. DIFF — Identify What Changed
31
-
32
- - Collect the set of modified and added files
33
- - Read each file in full, not just the changed hunks
34
- - Note files that interact with the changes (callers, consumers, shared modules)
35
-
36
- ### 2. DUPLICATION — Eliminate Repeated Logic
20
+ ### 1. DUPLICATION -- Eliminate Repeated Logic
37
21
 
38
22
  - Are there patterns repeated across files that should be a shared helper?
39
23
  - Does new code duplicate existing utilities or library functions?
40
24
  - Could two similar implementations be merged behind a single interface?
41
- - Is there copy-paste that should be refactored?
42
25
 
43
- **Rule of three**: If the same pattern appears three times, extract it.
26
+ **Rule of three:** If the same pattern appears three times, extract it.
44
27
 
45
- ### 3. DEAD CODE Remove What Is Not Called
28
+ ### 2. DEAD CODE -- Remove What Is Not Called
46
29
 
47
30
  - Delete unused imports, variables, functions, and parameters
48
31
  - Remove commented-out code blocks (version control is the archive)
49
32
  - Strip unreachable branches and impossible conditions
50
- - Drop feature flags and configuration for features that no longer exist
33
+ - Drop feature flags for features that no longer exist
51
34
 
52
- ### 4. COMPLEXITY Question Every Abstraction
35
+ ### 3. COMPLEXITY -- Question Every Abstraction
53
36
 
54
37
  - Does every wrapper, adapter, or indirection layer justify its existence?
55
38
  - Are there generics or parametrization that serve only one concrete case?
@@ -58,86 +41,50 @@ Do NOT use this skill when:
58
41
 
59
42
  **If removing it does not break anything, it should not be there.**
60
43
 
61
- ### 5. CLARITY Tighten Naming and Structure
44
+ ### 4. NAMING -- Tighten Clarity
62
45
 
63
46
  - Are names self-documenting? Rename anything that needs a comment to explain.
64
47
  - Could nested logic be flattened with early returns?
65
48
  - Is control flow straightforward, or does it require tracing to understand?
66
- - Are there layers of indirection that obscure the data path?
67
-
68
- ### 6. REVIEW — Final Sanity Check
69
-
70
- - Re-read the simplified code end to end
71
- - Confirm all tests still pass
72
- - Verify no behavioral changes were introduced (simplify, do not alter)
73
-
74
- ## Parallel 3-Reviewer Pattern
75
-
76
- When invoked as part of the execute-phase cycle, simplification runs as three parallel review agents, each focused on one dimension.
77
49
 
78
- ### Reviewer 1: Code Reuse
79
-
80
- - Scan all changed files for duplicated patterns
81
- - Cross-reference against existing shared utilities and helpers
82
- - Flag any logic that appears three or more times without extraction
83
- - **Output**: List of reuse opportunities with file paths and line ranges
84
-
85
- ### Reviewer 2: Code Quality
86
-
87
- - Check for dead code: unused imports, unreachable branches, commented blocks
88
- - Verify naming consistency with codebase conventions
89
- - Flag unnecessary abstractions, wrappers, and indirection
90
- - **Output**: List of quality issues categorized by severity
91
-
92
- ### Reviewer 3: Efficiency
50
+ ## Process
93
51
 
94
- - Identify over-engineered solutions (parametrization serving one case, generic interfaces with one implementor)
95
- - Flag defensive programming that guards impossible conditions
96
- - Check for configuration and feature flags that serve no current purpose
97
- - **Output**: List of efficiency issues with suggested removals
52
+ 1. **DIFF** -- Collect the set of modified and added files. Read each file in full, not just changed hunks.
53
+ 2. **SCAN** -- Check each dimension (duplication, dead code, complexity, naming) against each file.
54
+ 3. **RECORD** -- Document findings with file path, line range, dimension, and suggested fix.
55
+ 4. **FIX** -- Apply fixes for all actionable items. Blocker and High priority first.
56
+ 5. **VERIFY** -- Re-run tests to confirm nothing broke. Simplify, do not alter behavior.
98
57
 
99
- ### Consolidation
58
+ ## Output Format
100
59
 
101
- After all three reviewers complete:
102
- 1. Merge findings into a deduplicated list
103
- 2. Apply fixes for all actionable items (BLOCKER and HIGH priority first)
104
- 3. Re-run tests to confirm nothing broke
105
- 4. Report status: CLEAN (nothing found), FIXED (issues resolved), or BLOCKED (cannot simplify without architectural changes)
60
+ ```
61
+ DIMENSION: [Duplication | Dead Code | Complexity | Naming]
62
+ FILE: [path]
63
+ FINDING: [description]
64
+ SEVERITY: [Blocker | High | Medium]
65
+ FIX: [what was done or recommended]
66
+ ```
106
67
 
107
- ## Common Rationalizations REJECT THESE
68
+ ## Common Rationalizations -- Reject These
108
69
 
109
- | Excuse | Why It Violates the Rule |
110
- |--------|--------------------------|
70
+ | Excuse | Why It Fails |
71
+ |--------|-------------|
111
72
  | "It might be needed later" | Delete it. Re-adding is cheaper than maintaining unused code. |
112
- | "The abstraction makes it extensible" | Extensibility that serves no current requirement is dead weight. |
73
+ | "The abstraction makes it extensible" | Extensibility serving no current requirement is dead weight. |
113
74
  | "Refactoring is risky" | Small, tested simplifications reduce risk. Accumulated complexity increases it. |
114
75
  | "I'll clean it up later" | Later never comes. Simplify now while context is fresh. |
115
76
 
116
- ## Red Flags STOP If You Catch Yourself:
117
-
118
- - Skipping the simplification pass because the diff is small
119
- - Keeping dead code "just in case"
120
- - Adding complexity during a simplification pass
121
- - Merging without having read the full file (not just changed lines)
77
+ Stop if you catch yourself skipping the simplification pass because the diff is small, keeping dead code "just in case", or adding complexity during a simplification pass.
122
78
 
123
- **If any red flag triggers: STOP. Complete the simplification cycle before proceeding.**
79
+ ## Verification
124
80
 
125
- ## Verification Checklist
81
+ Before reporting completion:
126
82
 
127
- Before reporting completion, confirm:
128
-
129
- - [ ] All changed files were reviewed in full (not just diffs)
83
+ - [ ] All changed files reviewed in full (not just diffs)
130
84
  - [ ] No duplicated logic remains that appears three or more times
131
85
  - [ ] No dead code: unused imports, commented blocks, unreachable branches
132
86
  - [ ] No unnecessary abstractions, wrappers, or indirection layers
133
87
  - [ ] All tests pass after simplification
134
- - [ ] No behavioral changes were introduced (simplify only, do not alter)
135
-
136
- ## MAXSIM Integration
88
+ - [ ] No behavioral changes introduced (simplify only, do not alter)
137
89
 
138
- When a plan specifies `skill: "maxsim-simplify"`:
139
- - The orchestrator collects changed files from the implementation step
140
- - Three parallel reviewers (Reuse, Quality, Efficiency) are spawned
141
- - Findings are consolidated and fixes applied
142
- - Progress is tracked in STATE.md via decision entries
143
- - Final results are recorded in SUMMARY.md
90
+ See also: `/code-review` for correctness review (security, interfaces, error handling, test coverage).
@@ -1,19 +1,17 @@
1
1
  ---
2
2
  name: memory-management
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."
3
+ description: >-
4
+ Pattern and error persistence across sessions. Defines what to persist, where
5
+ to store it, and when to capture. Use when encountering recurring patterns,
6
+ solving non-trivial problems, making architectural decisions, or discovering
7
+ environment-specific behaviors.
4
8
  ---
5
9
 
6
10
  # Memory Management
7
11
 
8
12
  Context dies with each session. Patterns discovered but not saved are patterns lost.
9
13
 
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
-
12
- ## Process
13
-
14
- ### 1. Detect -- Recognize Save Triggers
15
-
16
- Save immediately when any of these occur:
14
+ ## What to Persist
17
15
 
18
16
  | Trigger | Threshold | What to Save |
19
17
  |---------|-----------|-------------|
@@ -24,87 +22,54 @@ Save immediately when any of these occur:
24
22
  | Workaround for tooling/framework quirk | Once | The quirk and the workaround |
25
23
  | Project-specific pattern confirmed | 2+ uses | The pattern and when to apply it |
26
24
 
27
- Do NOT save: session-specific context, information already in CLAUDE.md, speculative conclusions, temporary workarounds, or obvious patterns.
28
-
29
- ### 2. Check -- Avoid Duplicates
25
+ **Do NOT save:** Session-specific context, information already in CLAUDE.md, speculative conclusions, temporary workarounds, or obvious patterns.
30
26
 
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
27
+ ## Where to Store
34
28
 
35
- ### 3. Write -- Persist the Memory
29
+ | Location | Content | When Loaded |
30
+ |----------|---------|-------------|
31
+ | STATE.md | Project-level decisions, blockers, metrics | Every MAXSIM session |
32
+ | CLAUDE.md | Project conventions, build commands, architecture | Every Claude Code session |
33
+ | LESSONS.md | Cross-session codebase-specific lessons | MAXSIM execution startup |
36
34
 
37
- Add to the appropriate topic file using this entry format:
35
+ ### Entry Format
38
36
 
39
37
  ```markdown
40
- ## [Short descriptive title]
41
-
42
- **Context:** When this applies
43
- **Pattern/Error:** What was observed
44
- **Solution/Decision:** What to do about it
45
- **Evidence:** How this was confirmed (dates, occurrences, test results)
38
+ - [YYYY-MM-DD] [{phase}-{plan}] {actionable lesson}
46
39
  ```
47
40
 
48
- ### 4. Verify -- Confirm the Save
41
+ For LESSONS.md entries. For STATE.md decisions, use the `state add-decision` tool.
49
42
 
50
- - Re-read the file to confirm the entry was written correctly
51
- - Ensure the entry is actionable (someone reading it can act on it immediately)
43
+ ## When to Persist
52
44
 
53
- ## File Organization
45
+ Persist at natural breakpoints:
54
46
 
55
- Memory files live in `.claude/memory/` (or the equivalent runtime memory directory).
56
-
57
- ```
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
64
- ```
65
-
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
47
+ - After resolving a non-trivial bug (save error pattern + fix)
48
+ - After making an architectural decision (save decision + rationale)
49
+ - After discovering a recurring pattern (save pattern + when to apply)
50
+ - At checkpoints (save current understanding before context resets)
51
+ - At session end (review what was learned, save anything missed)
69
52
 
70
53
  ## Error Escalation
71
54
 
72
55
  ```
73
56
  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
57
+ Error seen twice -- Save to LESSONS.md with pattern and fix
58
+ Error seen 3+ times -- Save AND add to CLAUDE.md for immediate visibility
76
59
  ```
77
60
 
61
+ ## Process
62
+
63
+ 1. **DETECT** -- Recognize a save trigger from the table above
64
+ 2. **CHECK** -- Read existing memory files before writing to avoid duplicates
65
+ 3. **WRITE** -- Add the entry to the appropriate file
66
+ 4. **VERIFY** -- Re-read the file to confirm the entry was written correctly and is actionable
67
+
78
68
  ## Common Pitfalls
79
69
 
80
70
  - Encountering the same error a second time without saving it
81
71
  - Making the same architectural decision you made in a previous session
82
72
  - Debugging a problem you already solved before
83
- - Saying "I think we fixed this before" without finding the memory entry
84
73
  - Leaving a session without updating memory for patterns discovered
85
74
 
86
75
  If any of these occur: stop, write the memory entry now, then continue.
87
-
88
- ## Verification
89
-
90
- Before ending a work session:
91
-
92
- - [ ] All errors encountered 2+ times are saved to `errors.md`
93
- - [ ] All significant decisions are saved to `architecture.md`
94
- - [ ] All discovered patterns are saved to `patterns.md`
95
- - [ ] MEMORY.md index is up to date
96
- - [ ] No duplicate entries were created
97
- - [ ] All entries follow the format (Context, Pattern, Solution, Evidence)
98
-
99
- ## MAXSIM Integration
100
-
101
- During plan execution, agents load memory files at startup:
102
- - **Executor:** Reads MEMORY.md to avoid known pitfalls before implementing
103
- - **Researcher:** Saves findings to memory for future phases
104
- - **Debugger:** Checks error memories before starting investigation -- the fix may already be known
105
-
106
- Memory persistence happens at natural breakpoints:
107
- - After resolving a bug (save to errors.md)
108
- - After completing a phase (save patterns discovered)
109
- - After making an architectural decision (save to architecture.md)
110
- - At checkpoints (save current understanding before context resets)
@@ -0,0 +1,137 @@
1
+ ---
2
+ name: research-methodology
3
+ description: >-
4
+ Research process with tool priorities, confidence levels, and source evaluation.
5
+ Defines how to investigate technical domains, evaluate sources, and structure
6
+ findings with confidence tags. Use when researching libraries, APIs, architecture
7
+ patterns, or any domain requiring external knowledge gathering.
8
+ user-invocable: false
9
+ ---
10
+
11
+ # Research Methodology
12
+
13
+ Systematic process for investigating technical domains and producing structured findings with confidence levels.
14
+
15
+ ## Research Process
16
+
17
+ ### 1. Define Questions
18
+
19
+ Before researching, write explicit questions:
20
+
21
+ - What specific information do I need?
22
+ - What decisions will this research inform?
23
+ - What would change my approach if I learned X vs Y?
24
+
25
+ Avoid open-ended exploration. Each question should have a clear "answered" state.
26
+
27
+ ### 2. Identify Sources
28
+
29
+ Use this priority order for source selection:
30
+
31
+ | Priority | Source Type | Tool | Best For |
32
+ |----------|-----------|------|----------|
33
+ | 1 | Official documentation | WebFetch | API specs, config options, platform features |
34
+ | 2 | Codebase (existing code) | Grep, Glob, Read | Current patterns, conventions, dependencies |
35
+ | 3 | CLI tool help | Bash (`--help`, `--version`) | Tool capabilities, available flags |
36
+ | 4 | Package registries | WebFetch (npm, PyPI) | Version info, dependency trees |
37
+ | 5 | Reputable technical blogs | WebFetch | Architecture patterns, best practices |
38
+ | 6 | Community forums | WebFetch | Edge cases, workarounds, known issues |
39
+
40
+ ### 3. Evaluate Sources
41
+
42
+ Not all sources are equal. Tag each finding with a confidence level:
43
+
44
+ | Level | Criteria | Examples |
45
+ |-------|----------|---------|
46
+ | **HIGH** | Official docs, verified by tool output, multiple primary sources agree | Platform docs, API reference, confirmed by running code |
47
+ | **MEDIUM** | Reputable blogs, community consensus, single primary source | Well-known tech blogs, Stack Overflow accepted answers, conference talks |
48
+ | **LOW** | Single non-official source, outdated (>1 year), unverified claims | Personal blogs, forum posts, AI-generated content without verification |
49
+
50
+ **Source evaluation checklist:**
51
+ - Is this a primary source (official docs) or secondary (blog post)?
52
+ - When was it published or last updated?
53
+ - Does it match what I see in the actual codebase/tool?
54
+ - Do multiple independent sources agree?
55
+
56
+ ### 4. Cross-Reference Claims
57
+
58
+ For any finding that influences architecture or design:
59
+
60
+ - Find at least 2 independent sources
61
+ - Verify against actual tool behavior (run a command, read a config)
62
+ - Note when sources disagree and which you trust more
63
+ - Mark single-source findings as LOW confidence
64
+
65
+ ### 5. Structure Output
66
+
67
+ Research findings follow this format:
68
+
69
+ ```markdown
70
+ ## Finding: [Title]
71
+
72
+ **Confidence:** HIGH | MEDIUM | LOW
73
+ **Sources:** [list of sources with links]
74
+
75
+ [Finding description -- what was learned]
76
+
77
+ **Implications:** [How this affects our decisions]
78
+ **Open questions:** [What remains unclear]
79
+ ```
80
+
81
+ ## Research Output Template
82
+
83
+ ```markdown
84
+ # [Domain] Research
85
+
86
+ **Researched:** [date]
87
+ **Confidence:** [overall confidence level]
88
+
89
+ ## Key Findings
90
+ - [Finding 1] (HIGH confidence)
91
+ - [Finding 2] (MEDIUM confidence)
92
+
93
+ ## Standard Stack
94
+ | Component | Choice | Why |
95
+ |-----------|--------|-----|
96
+ | [area] | [choice] | [reason] |
97
+
98
+ ## Don't Hand-Roll
99
+ | Problem | Don't Build | Use Instead |
100
+ |---------|-------------|-------------|
101
+ | [problem] | [custom solution] | [existing solution] |
102
+
103
+ ## Common Pitfalls
104
+ ### Pitfall 1: [name]
105
+ **What goes wrong:** [description]
106
+ **How to avoid:** [recommendation]
107
+
108
+ ## Open Questions
109
+ - [Unanswered questions for future investigation]
110
+
111
+ ## Sources
112
+ ### Primary (HIGH confidence)
113
+ - [source with link]
114
+ ### Secondary (MEDIUM confidence)
115
+ - [source with link]
116
+ ```
117
+
118
+ ## Common Research Mistakes
119
+
120
+ | Mistake | Why It's Wrong | Do Instead |
121
+ |---------|---------------|------------|
122
+ | Using only AI knowledge | May be outdated or hallucinated | Fetch actual docs with WebFetch |
123
+ | Trusting a single blog post | Could be wrong, outdated, or opinionated | Cross-reference with official docs |
124
+ | Skipping version checks | APIs change between versions | Verify against the actual version in use |
125
+ | Assuming current codebase is correct | Code may have bugs or outdated patterns | Verify patterns against official docs |
126
+ | Not recording sources | Cannot verify or update findings later | Always include links and dates |
127
+ | Research without questions | Leads to unfocused exploration | Define questions first, research to answer them |
128
+
129
+ ## Time Boxing
130
+
131
+ Research is a means to an end, not the end itself:
132
+
133
+ - **Quick lookup** (5 min): Single question, check official docs, done
134
+ - **Standard research** (30 min): Multiple questions, cross-reference, structured output
135
+ - **Deep investigation** (60 min): Architecture decision, multiple domains, full template
136
+
137
+ If you cannot answer a question within the time box, document it as an open question and move on.