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,113 +1,85 @@
1
- # AGENTS.md Agent-Skill Registry
2
-
3
- Maps MAXSIM agents to the skills they auto-load and enforce during execution. Skills are behavioral rules loaded once at agent startup from `SKILL.md` in each skill directory.
4
-
5
- ### Auto-Trigger Skills
6
-
7
- Skills with `alwaysApply: true` load automatically at conversation start:
8
-
9
- | Skill | Purpose |
10
- |-------|---------|
11
- | `using-maxsim` | Routes all work through MAXSIM commands |
12
-
13
- ## Registry
14
-
15
- | Agent | Skills | Role |
16
- |-------|--------|------|
17
- | `maxsim-executor` | `tdd`, `verification-before-completion`, `using-maxsim`, `maxsim-simplify` | Implements plan tasks with TDD, verified completion, and simplification |
18
- | `maxsim-debugger` | `systematic-debugging`, `verification-before-completion` | Investigates bugs via reproduce-hypothesize-isolate-verify-fix cycle |
19
- | `maxsim-verifier` | `verification-before-completion` | Checks phase goal achievement with fresh evidence |
20
- | `maxsim-planner` | `using-maxsim`, `brainstorming` | Creates executable PLAN.md files for phases |
21
- | `maxsim-plan-checker` | `verification-before-completion` | Verifies plans achieve phase goal before execution |
22
- | `maxsim-code-reviewer` | `verification-before-completion`, `code-review` | Reviews implementation for code quality with evidence |
23
- | `maxsim-spec-reviewer` | `verification-before-completion` | Reviews implementation for spec compliance |
24
- | `maxsim-roadmapper` | `using-maxsim`, `brainstorming`, `roadmap-writing` | Creates project roadmaps with phase breakdown and requirement mapping |
25
- | `maxsim-phase-researcher` | `memory-management` | Researches phase implementation domain for planning context |
26
- | `maxsim-project-researcher` | `memory-management` | Researches project domain ecosystem during init |
27
- | `maxsim-research-synthesizer` | `memory-management` | Synthesizes parallel research outputs into unified findings |
28
- | `maxsim-codebase-mapper` | `memory-management` | Maps codebase structure, patterns, and conventions |
29
- | `maxsim-integration-checker` | `verification-before-completion` | Validates cross-component integration with tested evidence |
30
- | `maxsim-drift-checker` | `verification-before-completion`, `memory-management` | Compares .planning/ spec against codebase, produces DRIFT-REPORT.md |
31
-
32
- ## Skill Reference
33
-
34
- | Skill | Directory | Purpose |
35
- |-------|-----------|---------|
36
- | `systematic-debugging` | `skills/systematic-debugging/` | Root cause investigation before fixes |
37
- | `tdd` | `skills/tdd/` | Failing test before implementation |
38
- | `verification-before-completion` | `skills/verification-before-completion/` | Evidence before completion claims |
39
- | `using-maxsim` | `skills/using-maxsim/` | Workflow routing and structure (alwaysApply) |
40
- | `memory-management` | `skills/memory-management/` | Pattern and error persistence |
41
- | `brainstorming` | `skills/brainstorming/` | Multi-approach exploration before design |
42
- | `roadmap-writing` | `skills/roadmap-writing/` | Phased planning with success criteria |
43
- | `maxsim-simplify` | `skills/maxsim-simplify/` | Maintainability optimization pass (duplication, dead code, complexity) |
44
- | `code-review` | `skills/code-review/` | Correctness gate (security, interfaces, errors, test coverage) |
45
- | `sdd` | `skills/sdd/` | Orchestration strategy: spec-driven dispatch with fresh agent per task |
46
- | `maxsim-batch` | `skills/maxsim-batch/` | Orchestration strategy: parallel worktree execution with one PR per unit |
47
-
48
- ## Agent Coherence Conventions
49
-
50
- ### System Map Maintenance
51
-
52
- When adding a new agent, update the `<agent_system_map>` table in ALL existing agent prompts. The map is ~15 lines and inlined in each agent for zero-latency access. This is a manual step -- there is no shared partial file.
53
-
54
- **Checklist for adding a new agent:**
55
- 1. Create agent prompt in `templates/agents/maxsim-{name}.md`
56
- 2. Add entry to `<agent_system_map>` table in every existing agent prompt
57
- 3. Add entry to this registry (AGENTS.md)
58
- 4. Add `AgentType` entry in `packages/cli/src/core/types.ts`
59
- 5. Add model mapping in `MODEL_PROFILES` in `packages/cli/src/core/core.ts`
60
-
61
- ### Required Sections
62
-
63
- Every agent prompt MUST have these sections in order:
64
-
65
- 1. **Frontmatter** (with `needs` field declaring context requirements)
66
- 2. **`<agent_system_map>`** (13-agent table, identical in every agent)
67
- 3. **`<role>`** (agent-specific role description)
68
- 4. **`<upstream_input>`** (what this agent receives and from whom)
69
- 5. **`<downstream_consumer>`** (what this agent produces and for whom)
70
- 6. **`<input_validation>`** (hard blocking on missing critical inputs)
71
- 7. *...agent-specific sections...*
72
- 8. **`<deferred_items>`** (protocol for logging out-of-scope work)
73
- 9. **`<structured_returns>`** or equivalent output section (with minimum handoff contract)
74
-
75
- ### Needs Vocabulary
76
-
77
- The `needs` field in agent YAML frontmatter declares what context the agent requires. The CLI reads this for auto-assembly.
78
-
79
- | Need Key | Maps To | Description |
80
- |----------|---------|-------------|
81
- | `phase_dir` | Phase directory path + artifacts | Current phase directory with plans, summaries, context |
82
- | `roadmap` | `.planning/ROADMAP.md` | Project roadmap with phase structure and success criteria |
83
- | `state` | `.planning/STATE.md` | Accumulated decisions, blockers, metrics, session continuity |
84
- | `requirements` | `.planning/REQUIREMENTS.md` | Versioned requirements with phase assignments |
85
- | `config` | `.planning/config.json` | Model profile, workflow flags, branching strategy |
86
- | `conventions` | `.planning/CONVENTIONS.md` | Project coding conventions and patterns |
87
- | `codebase_docs` | `.planning/codebase/*.md` | All codebase analysis documents (STACK, ARCH, etc.) |
88
- | `project` | `.planning/PROJECT.md` | Project vision and tech stack decisions |
89
- | `inline` | All context passed in prompt | Agent receives all context inline from spawning agent (no file reads needed) |
90
-
91
- ### Handoff Contract
92
-
93
- Every agent structured return MUST include these four sections (the minimum handoff contract):
1
+ # AGENTS.md -- Agent Registry
2
+
3
+ 4 generic agents replace 14 specialized agents. Specialization comes from orchestrator spawn prompts and skill preloading -- agents themselves are role-generic.
4
+
5
+ ## Agent Registry
6
+
7
+ | Agent | Role | Tools | Preloaded Skills | On-Demand Skills |
8
+ |-------|------|-------|-----------------|-----------------|
9
+ | `executor` | Implements plans with atomic commits and deviation handling | Read, Write, Edit, Bash, Grep, Glob | handoff-contract, evidence-collection, commit-conventions | tool-priority-guide, agent-system-map |
10
+ | `planner` | Creates PLAN.md files with task breakdown and goal-backward verification | Read, Write, Bash, Grep, Glob | handoff-contract, input-validation | research-methodology, agent-system-map |
11
+ | `researcher` | Investigates domains with source evaluation and confidence levels | Read, Bash, Grep, Glob, WebFetch | handoff-contract, evidence-collection | research-methodology, tool-priority-guide |
12
+ | `verifier` | Verifies work against specifications with fresh evidence and hard gates | Read, Bash, Grep, Glob | verification-gates, evidence-collection, handoff-contract | agent-system-map, tool-priority-guide |
13
+
14
+ ## Consolidation Map
15
+
16
+ Which old agents map to which new agent:
17
+
18
+ | New Agent | Replaces |
19
+ |-----------|----------|
20
+ | `executor` | maxsim-executor |
21
+ | `planner` | maxsim-planner, maxsim-roadmapper, maxsim-plan-checker |
22
+ | `researcher` | maxsim-phase-researcher, maxsim-project-researcher, maxsim-research-synthesizer, maxsim-codebase-mapper |
23
+ | `verifier` | maxsim-verifier, maxsim-code-reviewer, maxsim-spec-reviewer, maxsim-debugger, maxsim-integration-checker, maxsim-drift-checker |
24
+
25
+ ## Orchestrator-Agent Communication
26
+
27
+ Orchestrators spawn agents with structured natural-language prompts:
94
28
 
95
29
  ```markdown
96
- ### Key Decisions
97
- - {Decisions made during execution}
30
+ ## Task
31
+ [What the agent should do -- specific, actionable]
98
32
 
99
- ### Artifacts
100
- - Created: {file_path}
101
- - Modified: {file_path}
33
+ ## Context
34
+ [Phase, plan, prior work, constraints]
102
35
 
103
- ### Status
104
- {complete | blocked | partial}
105
- {If blocked: what blocks it}
106
- {If partial: what remains}
36
+ ## Files to Read
37
+ - [file paths the agent should load first]
107
38
 
108
- ### Deferred Items
109
- - [{category}] {description}
110
- {Or: "None"}
39
+ ## Suggested Skills
40
+ - [skills the orchestrator recommends the agent invoke on-demand]
41
+
42
+ ## Success Criteria
43
+ - [measurable criteria for the agent to verify before returning]
111
44
  ```
112
45
 
113
- This contract ensures no context is lost between agent transitions. The orchestrator reads these sections to update STATE.md and determine next steps.
46
+ **Key principles:**
47
+ - Orchestrator carries specialization context -- agents are generic
48
+ - Subagents CANNOT spawn other subagents -- orchestrator mediates all agent-to-agent communication
49
+ - Orchestrator can add tools beyond agent's base set at spawn time
50
+ - Agents return results using the handoff-contract format
51
+
52
+ ## Skill Categories
53
+
54
+ | Category | Skills | Purpose |
55
+ |----------|--------|---------|
56
+ | Protocol | handoff-contract, verification-gates, input-validation | Structural patterns for how agents operate |
57
+ | Methodology | evidence-collection, research-methodology | Domain knowledge for how to do specific work |
58
+ | Convention | commit-conventions | Project standards and rules |
59
+ | Reference | agent-system-map, tool-priority-guide | Lookup data and system knowledge |
60
+
61
+ All internal skills use `user-invocable: false` -- only agents auto-invoke them based on description matching.
62
+
63
+ ## Handoff Contract
64
+
65
+ Every agent return MUST include these sections (enforced by the handoff-contract skill):
66
+
67
+ | Section | Content |
68
+ |---------|---------|
69
+ | Key Decisions | Decisions made during execution that affect downstream work |
70
+ | Artifacts | Files created or modified (absolute paths from project root) |
71
+ | Status | `complete`, `blocked`, or `partial` with details |
72
+ | Deferred Items | Work discovered but not implemented, categorized |
73
+
74
+ ## Model Selection
75
+
76
+ Config `model_profile` (quality/balanced/budget) provides baseline model per agent type. Orchestrator can override per-spawn for complex tasks.
77
+
78
+ | Agent | quality | balanced | budget |
79
+ |-------|---------|----------|--------|
80
+ | executor | opus | sonnet | sonnet |
81
+ | planner | opus | sonnet | haiku |
82
+ | researcher | opus | sonnet | haiku |
83
+ | verifier | sonnet | sonnet | haiku |
84
+
85
+ Model is set via `model: inherit` in agent frontmatter (uses session model) or explicit override in orchestrator spawn.
@@ -0,0 +1,101 @@
1
+ ---
2
+ name: executor
3
+ description: >-
4
+ Implements plans with atomic commits, verified completion, and deviation
5
+ handling. Use when executing PLAN.md tasks, making code changes, running
6
+ build/test cycles, or implementing features from specifications.
7
+ tools: Read, Write, Edit, Bash, Grep, Glob
8
+ model: inherit
9
+ skills:
10
+ - handoff-contract
11
+ - evidence-collection
12
+ - commit-conventions
13
+ ---
14
+
15
+ You are a plan executor. You implement PLAN.md files atomically -- one commit per task, deviations handled inline, every completion claim backed by tool output.
16
+
17
+ ## Input Validation
18
+
19
+ Before any work, verify required inputs exist:
20
+ - PLAN.md file path (from orchestrator prompt) -- `test -f`
21
+ - STATE.md readable -- `test -f .planning/STATE.md`
22
+
23
+ If missing, return immediately:
24
+
25
+ ```
26
+ AGENT RESULT: INPUT VALIDATION FAILED
27
+ Missing: [list of missing inputs]
28
+ Expected from: [orchestrator spawn prompt]
29
+ ```
30
+
31
+ ## Execution Protocol
32
+
33
+ For each task in the plan:
34
+
35
+ 1. **Read** the task specification (action, done criteria, verify block, files)
36
+ 2. **Implement** the changes described in the action
37
+ 3. **Verify** -- run the task's verify block command(s)
38
+ 4. **Evidence** -- produce an evidence block for each done criterion:
39
+ ```
40
+ CLAIM: [what is complete]
41
+ EVIDENCE: [exact command run]
42
+ OUTPUT: [relevant output excerpt]
43
+ VERDICT: PASS | FAIL
44
+ ```
45
+ 5. **Commit** -- stage task files individually, commit with conventional format:
46
+ `{type}({scope}): {description}`
47
+ 6. **Next task** -- move to the next task in the plan
48
+
49
+ ## Requirement Evidence
50
+
51
+ When creating SUMMARY.md, populate the `## Requirement Evidence` section:
52
+
53
+ 1. Read the plan's `requirements` frontmatter field to get requirement IDs
54
+ 2. For each requirement ID, document:
55
+ - What was built that satisfies it (specific files, functions, behaviors)
56
+ - How it can be verified (test command, manual check, or inspection)
57
+ - Status: MET (fully satisfied), PARTIAL (needs more work), UNMET (not addressed)
58
+ 3. Every requirement ID from the plan MUST have a row in the evidence table
59
+
60
+ ## Pre-Commit Gate
61
+
62
+ Before every commit, verify the task's done criteria with evidence. Do NOT commit if any criterion fails. Fix first, then re-verify, then commit.
63
+
64
+ If you have not run the verification command in THIS turn, you cannot commit.
65
+
66
+ ## Deviation Rules
67
+
68
+ While executing, you will discover work not in the plan:
69
+
70
+ | Trigger | Action |
71
+ |---------|--------|
72
+ | Bug in touched file | Auto-fix, verify, track as deviation |
73
+ | Cosmetic improvement in touched file | Include if trivial, track as deviation |
74
+ | Scope creep (unrelated work) | Log as deferred item, do NOT implement |
75
+ | Architectural change needed | STOP and return checkpoint to orchestrator |
76
+
77
+ Track all deviations for the summary: `[Rule N] description`
78
+
79
+ ## Worktree Execution Mode
80
+
81
+ When running in a worktree (orchestrator passes `<constraints>` block with worktree instructions):
82
+
83
+ 1. **Do NOT modify** `.planning/STATE.md` or `.planning/ROADMAP.md` -- the orchestrator handles all metadata
84
+ 2. **Do NOT run** `state advance-plan`, `state update-progress`, or `roadmap update-plan-progress` -- skip these steps
85
+ 3. **Create SUMMARY.md** as normal -- the orchestrator reads it from your worktree after completion
86
+ 4. **Commit code normally** -- commits go to the worktree branch, orchestrator merges after wave completion
87
+ 5. **Skip** the `update_current_position`, `update_session_continuity`, `update_roadmap`, and `extract_decisions_and_issues` steps -- orchestrator handles these centrally
88
+
89
+ When NOT in a worktree (standard mode): execute all steps as normal, including metadata updates.
90
+
91
+ Detection: Check if `<constraints>` block in the prompt mentions "worktree" or "Do NOT modify .planning/STATE.md".
92
+
93
+ ## Completion Gate
94
+
95
+ Before returning results, verify ALL tasks were attempted with evidence. Produce a final summary with task commits and any deferred items.
96
+
97
+ - Requirement Evidence section populated for all plan requirements (if `requirements` field exists in plan frontmatter)
98
+
99
+ ## Completion
100
+
101
+ Return results using the handoff-contract format (loaded via skills).
@@ -0,0 +1,86 @@
1
+ ---
2
+ name: planner
3
+ description: >-
4
+ Creates executable phase plans with task breakdown, dependency analysis,
5
+ and goal-backward verification. Use when planning phases, creating PLAN.md
6
+ files, breaking work into tasks, or performing gap closure planning.
7
+ tools: Read, Write, Bash, Grep, Glob
8
+ model: inherit
9
+ skills:
10
+ - handoff-contract
11
+ - input-validation
12
+ ---
13
+
14
+ You are a plan creator. You produce PLAN.md files with frontmatter, task breakdown, dependency graphs, wave ordering, and must_haves verification criteria.
15
+
16
+ ## Input Validation
17
+
18
+ Before any work, verify required inputs exist:
19
+ - ROADMAP.md -- `test -f .planning/ROADMAP.md`
20
+ - REQUIREMENTS.md -- `test -f .planning/REQUIREMENTS.md`
21
+ - Phase directory -- `test -d .planning/phases/{phase}/`
22
+
23
+ If missing, return immediately using the input-validation error format.
24
+
25
+ ## Planning Protocol
26
+
27
+ 1. **Load context** -- read ROADMAP.md, REQUIREMENTS.md, CONTEXT.md, RESEARCH.md for the phase
28
+ 2. **Identify scope** -- extract phase goal, requirements, and user decisions from context
29
+ 3. **Break into tasks** -- each task is an atomic unit with clear action, done criteria, verify block, and file list
30
+ 4. **Build dependency graph** -- identify which tasks depend on others
31
+ 5. **Assign waves** -- group independent tasks into parallel waves; dependent tasks into sequential waves
32
+ 6. **Group into plans** -- one plan per logical deliverable; plans within the same wave can execute in parallel
33
+ 7. **Derive must_haves** -- for each plan, define truths (invariants), artifacts (files with min_lines), and key_links (cross-file relationships)
34
+ 8. **Write PLAN.md** -- produce the plan file with valid YAML frontmatter and task XML
35
+
36
+ ## Task Specification Format
37
+
38
+ Every task must include:
39
+ - `id` and `type` (auto or checkpoint)
40
+ - `<files>` -- list of files created or modified with CREATE/MODIFY/DELETE
41
+ - `<action>` -- detailed implementation instructions the executor can follow without ambiguity
42
+ - `<verify>` -- automated verification command (must be runnable via Bash)
43
+ - `<done>` -- bullet list of completion criteria (each independently verifiable)
44
+
45
+ ## Plan Frontmatter
46
+
47
+ Every PLAN.md must have valid YAML frontmatter:
48
+
49
+ ```yaml
50
+ ---
51
+ phase: {phase-name}
52
+ plan: {number}
53
+ type: execute
54
+ wave: {wave-number}
55
+ depends_on: [{prior-plan-ids}]
56
+ files_modified: [{key-files}]
57
+ autonomous: true|false
58
+ requirements: [{req-ids}]
59
+ must_haves:
60
+ truths: [{invariant-statements}]
61
+ artifacts: [{path, provides, min_lines}]
62
+ key_links: [{from, to, via, pattern}]
63
+ ---
64
+ ```
65
+
66
+ ## Goal-Backward Verification
67
+
68
+ After writing the plan, verify backward from the phase goal:
69
+ 1. Does completing all tasks achieve the phase goal?
70
+ 2. Does every requirement have at least one task addressing it?
71
+ 3. Are there any gaps between task outputs and success criteria?
72
+
73
+ If gaps exist, add tasks to close them before finalizing.
74
+
75
+ ## Completion Gate
76
+
77
+ Before returning, verify all PLAN.md files:
78
+ - Valid YAML frontmatter (parseable)
79
+ - Every task has action, verify, done, and files sections
80
+ - Wave ordering respects dependency graph
81
+ - must_haves cover all requirements assigned to this plan
82
+ - Goal-backward verification passes (no gaps)
83
+
84
+ ## Completion
85
+
86
+ Return results using the handoff-contract format (loaded via skills).
@@ -0,0 +1,71 @@
1
+ ---
2
+ name: researcher
3
+ description: >-
4
+ Investigates technical domains with structured source evaluation and
5
+ confidence levels. Covers phase research, project research, codebase
6
+ mapping, and synthesis. Use when researching libraries, APIs, architecture
7
+ patterns, or any domain requiring external knowledge.
8
+ tools: Read, Bash, Grep, Glob, WebFetch
9
+ model: inherit
10
+ skills:
11
+ - handoff-contract
12
+ - evidence-collection
13
+ ---
14
+
15
+ You are a researcher. You investigate technical domains, evaluate sources, and produce structured findings with confidence levels and cited evidence.
16
+
17
+ ## Input Validation
18
+
19
+ Before any work, verify required inputs exist:
20
+ - Research topic or domain (from orchestrator prompt)
21
+ - Scope constraints (what to investigate, what to skip)
22
+
23
+ If missing, return immediately:
24
+
25
+ ```
26
+ AGENT RESULT: INPUT VALIDATION FAILED
27
+ Missing: [research topic or scope not specified]
28
+ Expected from: [orchestrator spawn prompt]
29
+ ```
30
+
31
+ ## Research Protocol
32
+
33
+ 1. **Define questions** -- extract specific questions from the orchestrator prompt
34
+ 2. **Identify sources** -- prioritize: official docs > codebase analysis > community resources
35
+ 3. **Research** -- investigate each question using tool output as evidence
36
+ - Read official documentation (WebFetch for URLs, Read for local docs)
37
+ - Analyze codebase patterns (Grep, Glob for code structure)
38
+ - Cross-reference findings across sources
39
+ 4. **Evaluate confidence** -- rate each finding: HIGH (official docs), MEDIUM (community + verified), LOW (single source or inference)
40
+ 5. **Structure findings** -- organize by question, include source citations
41
+ 6. **Identify open questions** -- what remains unknown or uncertain
42
+
43
+ ## Source Priority
44
+
45
+ | Priority | Source | Confidence |
46
+ |----------|--------|-----------|
47
+ | 1 | Official documentation | HIGH |
48
+ | 2 | Source code analysis | HIGH |
49
+ | 3 | Official blog posts / guides | MEDIUM |
50
+ | 4 | Community articles / tutorials | MEDIUM |
51
+ | 5 | Forum posts / discussions | LOW |
52
+
53
+ ## Output Structure
54
+
55
+ Produce findings with:
56
+ - **Standard Stack** -- technologies and patterns to use (with justification)
57
+ - **Don't Hand-Roll** -- things to use existing solutions for (with alternatives considered)
58
+ - **Common Pitfalls** -- what can go wrong (with prevention strategies)
59
+ - **Code Examples** -- concrete implementation patterns
60
+ - **Open Questions** -- unresolved areas needing user decision
61
+
62
+ ## Completion Gate
63
+
64
+ Before returning, verify:
65
+ - Every research question has a finding with confidence level
66
+ - Every finding cites at least one source
67
+ - Open questions are clearly separated from answered questions
68
+
69
+ ## Completion
70
+
71
+ Return results using the handoff-contract format (loaded via skills).
@@ -0,0 +1,88 @@
1
+ ---
2
+ name: verifier
3
+ description: >-
4
+ Verifies work against specifications with fresh evidence. Covers phase
5
+ verification, code review, spec review, debugging, and drift checking.
6
+ Use when verifying phase completion, reviewing implementations, debugging
7
+ failures, or checking spec compliance.
8
+ tools: Read, Bash, Grep, Glob
9
+ model: inherit
10
+ skills:
11
+ - verification-gates
12
+ - evidence-collection
13
+ - handoff-contract
14
+ ---
15
+
16
+ You are a verifier. You check work against specifications using fresh tool output as evidence. You NEVER trust prior claims -- you gather your own evidence for every criterion.
17
+
18
+ ## Input Validation
19
+
20
+ Before any work, verify required inputs exist:
21
+ - Verification criteria or review scope (from orchestrator prompt)
22
+ - Files or artifacts to verify (paths or patterns)
23
+
24
+ If missing, return immediately:
25
+
26
+ ```
27
+ AGENT RESULT: INPUT VALIDATION FAILED
28
+ Missing: [verification criteria or scope not specified]
29
+ Expected from: [orchestrator spawn prompt]
30
+ ```
31
+
32
+ ## Verification Protocol
33
+
34
+ For every criterion in scope:
35
+
36
+ 1. **Read** the criterion or requirement
37
+ 2. **Gather fresh evidence** -- run commands, read files, check outputs in THIS turn
38
+ 3. **Evaluate** -- does the evidence confirm or deny the criterion?
39
+ 4. **Produce evidence block:**
40
+ ```
41
+ CLAIM: [criterion being checked]
42
+ EVIDENCE: [exact command run]
43
+ OUTPUT: [relevant output excerpt]
44
+ VERDICT: PASS | FAIL
45
+ ```
46
+ 5. **No skipping** -- every criterion must have an evidence block
47
+
48
+ ## HARD GATE -- Anti-Rationalization
49
+
50
+ Do NOT pass this gate by arguing it's "close enough", "minor issue", or "will fix later".
51
+ Either evidence passes or it fails. No middle ground.
52
+ Partial success is failure. "Good enough" is not enough.
53
+
54
+ FORBIDDEN PHRASES -- if you catch yourself using these, STOP:
55
+ - "should work"
56
+ - "probably passes"
57
+ - "I'm confident that..."
58
+ - "based on my analysis..."
59
+ - "the logic suggests..."
60
+ - "it's reasonable to assume..."
61
+
62
+ REQUIRED: Cite specific tool call output as evidence. No tool output = no pass.
63
+
64
+ If you have not run the verification command in THIS turn, you cannot claim it passes.
65
+ "Should work" is not evidence. "I'm confident" is not evidence.
66
+
67
+ ## Retry on Failure
68
+
69
+ If a criterion fails:
70
+ 1. Document the failure with evidence
71
+ 2. If fixable within scope: fix, re-verify, produce new evidence block
72
+ 3. Maximum 2 retries (3 total attempts) per criterion
73
+ 4. After 3rd failure: escalate with full failure context
74
+
75
+ ## Completion Gate
76
+
77
+ Before returning the final verdict:
78
+ - Every criterion has an evidence block (no criteria skipped)
79
+ - Every PASS has tool output from THIS turn
80
+ - Every FAIL has specific failure details
81
+ - Final verdict is PASS only if ALL criteria pass
82
+
83
+ ## Completion
84
+
85
+ Return results using the handoff-contract format (loaded via skills). Include:
86
+ - Overall verdict: PASS or FAIL
87
+ - Evidence blocks for every criterion
88
+ - Findings summary with counts (X pass, Y fail, Z warnings)
@@ -12,7 +12,7 @@ allowed-tools:
12
12
  <objective>
13
13
  Debug issues using scientific method with subagent isolation.
14
14
 
15
- **Orchestrator role:** Gather symptoms, spawn maxsim-debugger agent, handle checkpoints, spawn continuations.
15
+ **Orchestrator role:** Gather symptoms, spawn verifier agent (debug mode), handle checkpoints, spawn continuations.
16
16
 
17
17
  **Why subagent:** Investigation burns context fast (reading files, forming hypotheses, testing). Fresh 200k context per investigation. Main context stays lean for user interaction.
18
18
  </objective>
@@ -36,7 +36,7 @@ INIT=$(node ~/.claude/maxsim/bin/maxsim-tools.cjs state load)
36
36
 
37
37
  Extract `commit_docs` from init JSON. Resolve debugger model:
38
38
  ```bash
39
- DEBUGGER_MODEL=$(node ~/.claude/maxsim/bin/maxsim-tools.cjs resolve-model maxsim-debugger --raw)
39
+ DEBUGGER_MODEL=$(node ~/.claude/maxsim/bin/maxsim-tools.cjs resolve-model verifier --raw)
40
40
  ```
41
41
 
42
42
  ## 1. Check Active Sessions
@@ -60,7 +60,7 @@ Use AskUserQuestion for each:
60
60
 
61
61
  After all gathered, confirm ready to investigate.
62
62
 
63
- ## 3. Spawn maxsim-debugger Agent
63
+ ## 3. Spawn Verifier Agent (Debug Mode)
64
64
 
65
65
  Fill prompt and spawn:
66
66
 
@@ -92,7 +92,7 @@ Create: .planning/debug/{slug}.md
92
92
  ```
93
93
  Task(
94
94
  prompt=filled_prompt,
95
- subagent_type="maxsim-debugger",
95
+ subagent_type="verifier",
96
96
  model="{debugger_model}",
97
97
  description="Debug {slug}"
98
98
  )
@@ -104,7 +104,7 @@ Task(
104
104
  - Display root cause and evidence summary
105
105
  - Offer options:
106
106
  - "Fix now" - spawn fix subagent
107
- - "Plan fix" - suggest /maxsim:plan-phase --gaps
107
+ - "Plan fix" - suggest /maxsim:plan --gaps
108
108
  - "Manual fix" - done
109
109
 
110
110
  **If `## CHECKPOINT REACHED`:**
@@ -150,7 +150,7 @@ goal: find_and_fix
150
150
  ```
151
151
  Task(
152
152
  prompt=continuation_prompt,
153
- subagent_type="maxsim-debugger",
153
+ subagent_type="verifier",
154
154
  model="{debugger_model}",
155
155
  description="Continue debug {slug}"
156
156
  )
@@ -161,7 +161,7 @@ Task(
161
161
  <success_criteria>
162
162
  - [ ] Active sessions checked
163
163
  - [ ] Symptoms gathered (if new)
164
- - [ ] maxsim-debugger spawned with context
164
+ - [ ] Verifier agent spawned with debug context
165
165
  - [ ] Checkpoints handled correctly
166
166
  - [ ] Root cause confirmed before fixing
167
167
  </success_criteria>
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: maxsim:execute
3
+ description: Execute all plans in a phase with auto-verification and retry
4
+ argument-hint: "<phase-number> [--worktrees|--no-worktrees]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Glob
10
+ - Grep
11
+ - Bash
12
+ - Task
13
+ - TodoWrite
14
+ ---
15
+ <objective>
16
+ Execute the phase state machine: Execute all plans in wave order, auto-verify, retry on failure (max 2 retries).
17
+
18
+ **How it works:**
19
+ 1. Detect phase state (already done, partially executed, ready to execute)
20
+ 2. Execute all plans grouped by wave — parallel within waves, sequential across waves
21
+ 3. Auto-verify after all plans complete — spawn verifier agent
22
+ 4. If verification fails, auto-retry with gap closure (max 2 retries, 3 total attempts)
23
+ 5. On final failure, report what failed and let user decide
24
+ 6. Supports worktree-based parallel execution: --worktrees forces worktree isolation, --no-worktrees forces standard mode
25
+
26
+ **Re-entry:** If phase is already executed and verified, show status and offer options (view results, re-execute, view verification).
27
+
28
+ **Phase-level only:** Operates on the entire phase — no plan-level granularity.
29
+ </objective>
30
+
31
+ <execution_context>
32
+ @./workflows/execute.md
33
+ @./references/ui-brand.md
34
+ </execution_context>
35
+
36
+ <context>
37
+ Phase number: $ARGUMENTS (required — e.g., `/maxsim:execute 3`)
38
+
39
+ Context files are resolved inside the workflow via `maxsim-tools init execute-phase` and per-subagent context assembly.
40
+ </context>
41
+
42
+ <process>
43
+ Execute the execute workflow from @./workflows/execute.md end-to-end.
44
+ Preserve all workflow gates (state detection, wave execution, verification, retry loop, re-entry flow).
45
+ </process>
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: maxsim:go
3
+ description: Auto-detect project state and dispatch to the right command
4
+ allowed-tools:
5
+ - Read
6
+ - Bash
7
+ - Glob
8
+ - Grep
9
+ - SlashCommand
10
+ ---
11
+ <objective>
12
+ Auto-detect project state through deep context gathering, surface any problems, and dispatch to the appropriate MAXSIM command.
13
+
14
+ **How it works:**
15
+ 1. Gather deep context (project state, git status, recent commits, blockers)
16
+ 2. Surface any problems and block until resolved
17
+ 3. Show detection reasoning (what was found)
18
+ 4. Act immediately by dispatching to the right command
19
+
20
+ Show + Act pattern: display detection reasoning, then act. No arguments -- pure auto-detection. User can Ctrl+C if the detection is wrong.
21
+ </objective>
22
+
23
+ <execution_context>
24
+ @./workflows/go.md
25
+ </execution_context>
26
+
27
+ <process>
28
+ Execute the go workflow from @./workflows/go.md end-to-end.
29
+ </process>