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,19 +0,0 @@
1
- ---
2
- name: maxsim:roadmap
3
- description: Display the project roadmap with phase status icons, plan counts, and milestone summary
4
- allowed-tools:
5
- - Read
6
- - Bash
7
- - Glob
8
- ---
9
- <objective>
10
- Render the project roadmap in a human-readable format with phase status icons (✓ DONE, ► IN PROGRESS, □ PLANNED), plan progress counts per phase, and a milestone summary header.
11
- </objective>
12
-
13
- <execution_context>
14
- @./workflows/roadmap.md
15
- </execution_context>
16
-
17
- <process>
18
- Execute the roadmap workflow from @./workflows/roadmap.md end-to-end.
19
- </process>
@@ -1,39 +0,0 @@
1
- ---
2
- name: maxsim:sdd
3
- description: Execute a phase using Spec-Driven Dispatch — fresh agent per task with 2-stage review
4
- argument-hint: "<phase-number>"
5
- allowed-tools:
6
- - Read
7
- - Write
8
- - Edit
9
- - Glob
10
- - Grep
11
- - Bash
12
- - Task
13
- - AskUserQuestion
14
- ---
15
- <objective>
16
- Execute phase plans using the Spec-Driven Dispatch (SDD) pattern. Each task is dispatched to a fresh-context subagent with minimal context. Two-stage review (spec compliance + code quality) runs between every task. No task starts until the previous task passes both review stages.
17
-
18
- SDD differs from standard execute-phase:
19
- - **Standard:** Single agent or segmented execution per plan
20
- - **SDD:** Fresh agent per task with mandatory inter-task review gates
21
-
22
- Context budget: ~10% orchestrator. 100% fresh per task agent. Zero context bleeding between tasks.
23
- </objective>
24
-
25
- <execution_context>
26
- @./workflows/sdd.md
27
- @./references/ui-brand.md
28
- </execution_context>
29
-
30
- <context>
31
- Phase: $ARGUMENTS
32
-
33
- Context files are resolved inside the workflow via `maxsim-tools init execute-phase` and per-task `<files_to_read>` blocks.
34
- </context>
35
-
36
- <process>
37
- Execute the SDD workflow from @./workflows/sdd.md end-to-end.
38
- Preserve all workflow gates (task dispatch, 2-stage review, fix iteration cap, state updates, routing).
39
- </process>
@@ -1,34 +0,0 @@
1
- ---
2
- name: maxsim:set-profile
3
- description: Switch model profile for MAXSIM agents (quality/balanced/budget/tokenburner)
4
- argument-hint: <profile>
5
- allowed-tools:
6
- - Read
7
- - Write
8
- - Bash
9
- ---
10
-
11
- <objective>
12
- Switch the model profile used by MAXSIM agents. Controls which Claude model each agent uses, balancing quality vs token spend.
13
-
14
- Routes to the set-profile workflow which handles:
15
- - Argument validation (quality/balanced/budget/tokenburner)
16
- - Config file creation if missing
17
- - Profile update in config.json
18
- - Confirmation with model table display
19
- </objective>
20
-
21
- <execution_context>
22
- @./workflows/set-profile.md
23
- </execution_context>
24
-
25
- <process>
26
- **Follow the set-profile workflow** from `@./workflows/set-profile.md`.
27
-
28
- The workflow handles all logic including:
29
- 1. Profile argument validation
30
- 2. Config file ensuring
31
- 3. Config reading and updating
32
- 4. Model table generation from MODEL_PROFILES
33
- 5. Confirmation display
34
- </process>
@@ -1,37 +0,0 @@
1
- ---
2
- name: maxsim:update
3
- description: Update MAXSIM to latest version with changelog display
4
- allowed-tools:
5
- - Bash
6
- - AskUserQuestion
7
- ---
8
-
9
- <objective>
10
- Check for MAXSIM updates, install if available, and display what changed.
11
-
12
- Routes to the update workflow which handles:
13
- - Version detection (local vs global installation)
14
- - npm version checking
15
- - Changelog fetching and display
16
- - User confirmation with clean install warning
17
- - Update execution and cache clearing
18
- - Restart reminder
19
- </objective>
20
-
21
- <execution_context>
22
- @./workflows/update.md
23
- </execution_context>
24
-
25
- <process>
26
- **Follow the update workflow** from `@./workflows/update.md`.
27
-
28
- The workflow handles all logic including:
29
- 1. Installed version detection (local/global)
30
- 2. Latest version checking via npm
31
- 3. Version comparison
32
- 4. Changelog fetching and extraction
33
- 5. Clean install warning display
34
- 6. User confirmation
35
- 7. Update execution
36
- 8. Cache clearing
37
- </process>
@@ -1,38 +0,0 @@
1
- ---
2
- name: maxsim:verify-work
3
- description: Validate built features through conversational UAT
4
- argument-hint: "[phase number, e.g., '4']"
5
- allowed-tools:
6
- - Read
7
- - Bash
8
- - Glob
9
- - Grep
10
- - Edit
11
- - Write
12
- - Task
13
- ---
14
- <objective>
15
- Validate built features through conversational testing with persistent state.
16
-
17
- Purpose: Confirm what Claude built actually works from user's perspective. One test at a time, plain text responses, no interrogation. When issues are found, automatically diagnose, plan fixes, and prepare for execution.
18
-
19
- Output: {phase_num}-UAT.md tracking all test results. If issues found: diagnosed gaps, verified fix plans ready for /maxsim:execute-phase
20
- </objective>
21
-
22
- <execution_context>
23
- @./workflows/verify-work.md
24
- @./templates/UAT.md
25
- </execution_context>
26
-
27
- <context>
28
- Phase: $ARGUMENTS (optional)
29
- - If provided: Test specific phase (e.g., "4")
30
- - If not provided: Check for active sessions or prompt for phase
31
-
32
- Context files are resolved inside the workflow (`init verify-work`) and delegated via `<files_to_read>` blocks.
33
- </context>
34
-
35
- <process>
36
- Execute the verify-work workflow from @./workflows/verify-work.md end-to-end.
37
- Preserve all workflow gates (session management, test presentation, diagnosis, fix planning, routing).
38
- </process>
@@ -1,111 +0,0 @@
1
- <purpose>
2
- Add a new integer phase to the end of the current milestone in the roadmap. Automatically calculates next phase number, creates phase directory, and updates roadmap structure.
3
- </purpose>
4
-
5
- <required_reading>
6
- Read all files referenced by the invoking prompt's execution_context before starting.
7
- </required_reading>
8
-
9
- <process>
10
-
11
- <step name="parse_arguments">
12
- Parse the command arguments:
13
- - All arguments become the phase description
14
- - Example: `/maxsim:add-phase Add authentication` → description = "Add authentication"
15
- - Example: `/maxsim:add-phase Fix critical performance issues` → description = "Fix critical performance issues"
16
-
17
- If no arguments provided:
18
-
19
- ```
20
- ERROR: Phase description required
21
- Usage: /maxsim:add-phase <description>
22
- Example: /maxsim:add-phase Add authentication system
23
- ```
24
-
25
- Exit.
26
- </step>
27
-
28
- <step name="init_context">
29
- Load phase operation context:
30
-
31
- ```bash
32
- INIT=$(node ~/.claude/maxsim/bin/maxsim-tools.cjs init phase-op "0")
33
- ```
34
-
35
- Check `roadmap_exists` from init JSON. If false:
36
- ```
37
- ERROR: No roadmap found (.planning/ROADMAP.md)
38
- Run /maxsim:new-project to initialize.
39
- ```
40
- Exit.
41
- </step>
42
-
43
- <step name="add_phase">
44
- **Delegate the phase addition to maxsim-tools:**
45
-
46
- ```bash
47
- RESULT=$(node ~/.claude/maxsim/bin/maxsim-tools.cjs phase add "${description}")
48
- ```
49
-
50
- The CLI handles:
51
- - Finding the highest existing integer phase number
52
- - Calculating next phase number (max + 1)
53
- - Generating slug from description
54
- - Creating the phase directory (`.planning/phases/{NN}-{slug}/`)
55
- - Inserting the phase entry into ROADMAP.md with Goal, Depends on, and Plans sections
56
-
57
- Extract from result: `phase_number`, `padded`, `name`, `slug`, `directory`.
58
- </step>
59
-
60
- <step name="update_project_state">
61
- Update STATE.md to reflect the new phase:
62
-
63
- 1. Read `.planning/STATE.md`
64
- 2. Under "## Accumulated Context" → "### Roadmap Evolution" add entry:
65
- ```
66
- - Phase {N} added: {description}
67
- ```
68
-
69
- If "Roadmap Evolution" section doesn't exist, create it.
70
- </step>
71
-
72
- <step name="completion">
73
- Present completion summary:
74
-
75
- ```
76
- Phase {N} added to current milestone:
77
- - Description: {description}
78
- - Directory: .planning/phases/{phase-num}-{slug}/
79
- - Status: Not planned yet
80
-
81
- Roadmap updated: .planning/ROADMAP.md
82
-
83
- ---
84
-
85
- ## ▶ Next Up
86
-
87
- **Phase {N}: {description}**
88
-
89
- `/maxsim:plan-phase {N}`
90
-
91
- <sub>`/clear` first → fresh context window</sub>
92
-
93
- ---
94
-
95
- **Also available:**
96
- - `/maxsim:add-phase <description>` — add another phase
97
- - Review roadmap
98
-
99
- ---
100
- ```
101
- </step>
102
-
103
- </process>
104
-
105
- <success_criteria>
106
- - [ ] `maxsim-tools phase add` executed successfully
107
- - [ ] Phase directory created
108
- - [ ] Roadmap updated with new phase entry
109
- - [ ] STATE.md updated with roadmap evolution note
110
- - [ ] User informed of next steps
111
- </success_criteria>
@@ -1,351 +0,0 @@
1
- <purpose>
2
- Generate unit and E2E tests for a completed phase based on its SUMMARY.md, CONTEXT.md, and implementation. Classifies each changed file into TDD (unit), E2E (browser), or Skip categories, presents a test plan for user approval, then generates tests following RED-GREEN conventions.
3
-
4
- Users currently hand-craft `/maxsim:quick` prompts for test generation after each phase. This workflow standardizes the process with proper classification, quality gates, and gap reporting.
5
- </purpose>
6
-
7
- <required_reading>
8
- Read all files referenced by the invoking prompt's execution_context before starting.
9
- @./references/dashboard-bridge.md
10
- </required_reading>
11
-
12
- <process>
13
-
14
- <step name="parse_arguments">
15
- Parse `$ARGUMENTS` for:
16
- - Phase number (integer, decimal, or letter-suffix) → store as `$PHASE_ARG`
17
- - Remaining text after phase number → store as `$EXTRA_INSTRUCTIONS` (optional)
18
-
19
- Example: `/maxsim:add-tests 12 focus on edge cases` → `$PHASE_ARG=12`, `$EXTRA_INSTRUCTIONS="focus on edge cases"`
20
-
21
- If no phase argument provided:
22
-
23
- ```
24
- ERROR: Phase number required
25
- Usage: /maxsim:add-tests <phase> [additional instructions]
26
- Example: /maxsim:add-tests 12
27
- Example: /maxsim:add-tests 12 focus on edge cases in the pricing module
28
- ```
29
-
30
- Exit.
31
- </step>
32
-
33
- <step name="init_context">
34
- Load phase operation context:
35
-
36
- ```bash
37
- INIT=$(node ~/.claude/maxsim/bin/maxsim-tools.cjs init phase-op "${PHASE_ARG}")
38
- ```
39
-
40
- Extract from init JSON: `phase_dir`, `phase_number`, `phase_name`.
41
-
42
- Verify the phase directory exists. If not:
43
- ```
44
- ERROR: Phase directory not found for phase ${PHASE_ARG}
45
- Ensure the phase exists in .planning/phases/
46
- ```
47
- Exit.
48
-
49
- Read the phase artifacts (in order of priority):
50
- 1. `${phase_dir}/*-SUMMARY.md` — what was implemented, files changed
51
- 2. `${phase_dir}/CONTEXT.md` — acceptance criteria, decisions
52
- 3. `${phase_dir}/*-VERIFICATION.md` — user-verified scenarios (if UAT was done)
53
-
54
- If no SUMMARY.md exists:
55
- ```
56
- ERROR: No SUMMARY.md found for phase ${PHASE_ARG}
57
- This command works on completed phases. Run /maxsim:execute-phase first.
58
- ```
59
- Exit.
60
-
61
- Present banner:
62
- ```
63
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
64
- MAXSIM ► ADD TESTS — Phase ${phase_number}: ${phase_name}
65
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
66
- ```
67
- </step>
68
-
69
- <step name="analyze_implementation">
70
- Extract the list of files modified by the phase from SUMMARY.md ("Files Changed" or equivalent section).
71
-
72
- For each file, classify into one of three categories:
73
-
74
- | Category | Criteria | Test Type |
75
- |----------|----------|-----------|
76
- | **TDD** | Pure functions where `expect(fn(input)).toBe(output)` is writable | Unit tests |
77
- | **E2E** | UI behavior verifiable by browser automation | Playwright/E2E tests |
78
- | **Skip** | Not meaningfully testable or already covered | None |
79
-
80
- **TDD classification — apply when:**
81
- - Business logic: calculations, pricing, tax rules, validation
82
- - Data transformations: mapping, filtering, aggregation, formatting
83
- - Parsers: CSV, JSON, XML, custom format parsing
84
- - Validators: input validation, schema validation, business rules
85
- - State machines: status transitions, workflow steps
86
- - Utilities: string manipulation, date handling, number formatting
87
-
88
- **E2E classification — apply when:**
89
- - Keyboard shortcuts: key bindings, modifier keys, chord sequences
90
- - Navigation: page transitions, routing, breadcrumbs, back/forward
91
- - Form interactions: submit, validation errors, field focus, autocomplete
92
- - Selection: row selection, multi-select, shift-click ranges
93
- - Drag and drop: reordering, moving between containers
94
- - Modal dialogs: open, close, confirm, cancel
95
- - Data grids: sorting, filtering, inline editing, column resize
96
-
97
- **Skip classification — apply when:**
98
- - UI layout/styling: CSS classes, visual appearance, responsive breakpoints
99
- - Configuration: config files, environment variables, feature flags
100
- - Glue code: dependency injection setup, middleware registration, routing tables
101
- - Migrations: database migrations, schema changes
102
- - Simple CRUD: basic create/read/update/delete with no business logic
103
- - Type definitions: records, DTOs, interfaces with no logic
104
-
105
- Read each file to verify classification. Don't classify based on filename alone.
106
- </step>
107
-
108
- <step name="present_classification">
109
- Present the classification to the user for confirmation before proceeding:
110
-
111
- ```
112
- AskUserQuestion(
113
- header: "Test Classification",
114
- question: |
115
- ## Files classified for testing
116
-
117
- ### TDD (Unit Tests) — {N} files
118
- {list of files with brief reason}
119
-
120
- ### E2E (Browser Tests) — {M} files
121
- {list of files with brief reason}
122
-
123
- ### Skip — {K} files
124
- {list of files with brief reason}
125
-
126
- {if $EXTRA_INSTRUCTIONS: "Additional instructions: ${EXTRA_INSTRUCTIONS}"}
127
-
128
- How would you like to proceed?
129
- options:
130
- - "Approve and generate test plan"
131
- - "Adjust classification (I'll specify changes)"
132
- - "Cancel"
133
- )
134
- ```
135
-
136
- If user selects "Adjust classification": apply their changes and re-present.
137
- If user selects "Cancel": exit gracefully.
138
- </step>
139
-
140
- <step name="discover_test_structure">
141
- Before generating the test plan, discover the project's existing test structure:
142
-
143
- ```bash
144
- # Find existing test directories and files (cross-platform)
145
- git ls-files --others --cached --exclude-standard | grep -E "(test|spec|__tests__)" | head -20
146
- # Find existing test files for convention matching
147
- git ls-files --others --cached --exclude-standard | grep -E "\.(test|spec)\.|Tests\.(fs|cs)|Test\.(fs|cs)" | head -20
148
- # Check for test runners
149
- ls package.json *.sln 2>/dev/null
150
- ```
151
-
152
- Identify:
153
- - Test directory structure (where unit tests live, where E2E tests live)
154
- - Naming conventions (`.test.ts`, `.spec.ts`, `*Tests.fs`, etc.)
155
- - Test runner commands (how to execute unit tests, how to execute E2E tests)
156
- - Test framework (xUnit, NUnit, Jest, Playwright, etc.)
157
-
158
- If test structure is ambiguous, ask the user:
159
- ```
160
- AskUserQuestion(
161
- header: "Test Structure",
162
- question: "I found multiple test locations. Where should I create tests?",
163
- options: [list discovered locations]
164
- )
165
- ```
166
- </step>
167
-
168
- <step name="generate_test_plan">
169
- For each approved file, create a detailed test plan.
170
-
171
- **For TDD files**, plan tests following RED-GREEN-REFACTOR:
172
- 1. Identify testable functions/methods in the file
173
- 2. For each function: list input scenarios, expected outputs, edge cases
174
- 3. Note: since code already exists, tests may pass immediately — that's OK, but verify they test the RIGHT behavior
175
-
176
- **For E2E files**, plan tests following RED-GREEN gates:
177
- 1. Identify user scenarios from CONTEXT.md/VERIFICATION.md
178
- 2. For each scenario: describe the user action, expected outcome, assertions
179
- 3. Note: RED gate means confirming the test would fail if the feature were broken
180
-
181
- Present the complete test plan:
182
-
183
- ```
184
- AskUserQuestion(
185
- header: "Test Plan",
186
- question: |
187
- ## Test Generation Plan
188
-
189
- ### Unit Tests ({N} tests across {M} files)
190
- {for each file: test file path, list of test cases}
191
-
192
- ### E2E Tests ({P} tests across {Q} files)
193
- {for each file: test file path, list of test scenarios}
194
-
195
- ### Test Commands
196
- - Unit: {discovered test command}
197
- - E2E: {discovered e2e command}
198
-
199
- Ready to generate?
200
- options:
201
- - "Generate all"
202
- - "Cherry-pick (I'll specify which)"
203
- - "Adjust plan"
204
- )
205
- ```
206
-
207
- If "Cherry-pick": ask user which tests to include.
208
- If "Adjust plan": apply changes and re-present.
209
- </step>
210
-
211
- <step name="execute_tdd_generation">
212
- For each approved TDD test:
213
-
214
- 1. **Create test file** following discovered project conventions (directory, naming, imports)
215
-
216
- 2. **Write test** with clear arrange/act/assert structure:
217
- ```
218
- // Arrange — set up inputs and expected outputs
219
- // Act — call the function under test
220
- // Assert — verify the output matches expectations
221
- ```
222
-
223
- 3. **Run the test**:
224
- ```bash
225
- {discovered test command}
226
- ```
227
-
228
- 4. **Evaluate result:**
229
- - **Test passes**: Good — the implementation satisfies the test. Verify the test checks meaningful behavior (not just that it compiles).
230
- - **Test fails with assertion error**: This may be a genuine bug discovered by the test. Flag it:
231
- ```
232
- ⚠️ Potential bug found: {test name}
233
- Expected: {expected}
234
- Actual: {actual}
235
- File: {implementation file}
236
- ```
237
- Do NOT fix the implementation — this is a test-generation command, not a fix command. Record the finding.
238
- - **Test fails with error (import, syntax, etc.)**: This is a test error. Fix the test and re-run.
239
- </step>
240
-
241
- <step name="execute_e2e_generation">
242
- For each approved E2E test:
243
-
244
- 1. **Check for existing tests** covering the same scenario:
245
- ```bash
246
- grep -r "{scenario keyword}" {e2e test directory} 2>/dev/null
247
- ```
248
- If found, extend rather than duplicate.
249
-
250
- 2. **Create test file** targeting the user scenario from CONTEXT.md/VERIFICATION.md
251
-
252
- 3. **Run the E2E test**:
253
- ```bash
254
- {discovered e2e command}
255
- ```
256
-
257
- 4. **Evaluate result:**
258
- - **GREEN (passes)**: Record success
259
- - **RED (fails)**: Determine if it's a test issue or a genuine application bug. Flag bugs:
260
- ```
261
- ⚠️ E2E failure: {test name}
262
- Scenario: {description}
263
- Error: {error message}
264
- ```
265
- - **Cannot run**: Report blocker. Do NOT mark as complete.
266
- ```
267
- 🛑 E2E blocker: {reason tests cannot run}
268
- ```
269
-
270
- **No-skip rule:** If E2E tests cannot execute (missing dependencies, environment issues), report the blocker and mark the test as incomplete. Never mark success without actually running the test.
271
- </step>
272
-
273
- <step name="summary_and_commit">
274
- Create a test coverage report and present to user:
275
-
276
- ```
277
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
278
- MAXSIM ► TEST GENERATION COMPLETE
279
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
280
-
281
- ## Results
282
-
283
- | Category | Generated | Passing | Failing | Blocked |
284
- |----------|-----------|---------|---------|---------|
285
- | Unit | {N} | {n1} | {n2} | {n3} |
286
- | E2E | {M} | {m1} | {m2} | {m3} |
287
-
288
- ## Files Created/Modified
289
- {list of test files with paths}
290
-
291
- ## Coverage Gaps
292
- {areas that couldn't be tested and why}
293
-
294
- ## Bugs Discovered
295
- {any assertion failures that indicate implementation bugs}
296
- ```
297
-
298
- Record test generation in project state:
299
- ```bash
300
- node ~/.claude/maxsim/bin/maxsim-tools.cjs state-snapshot
301
- ```
302
-
303
- If there are passing tests to commit:
304
-
305
- ```bash
306
- git add {test files}
307
- git commit -m "test(phase-${phase_number}): add unit and E2E tests from add-tests command"
308
- ```
309
-
310
- Present next steps:
311
-
312
- ```
313
- ---
314
-
315
- ## ▶ Next Up
316
-
317
- {if bugs discovered:}
318
- **Fix discovered bugs:** `/maxsim:quick fix the {N} test failures discovered in phase ${phase_number}`
319
-
320
- {if blocked tests:}
321
- **Resolve test blockers:** {description of what's needed}
322
-
323
- {otherwise:}
324
- **All tests passing!** Phase ${phase_number} is fully tested.
325
-
326
- ---
327
-
328
- **Also available:**
329
- - `/maxsim:add-tests {next_phase}` — test another phase
330
- - `/maxsim:verify-work {phase_number}` — run UAT verification
331
-
332
- ---
333
- ```
334
- </step>
335
-
336
- </process>
337
-
338
- <success_criteria>
339
- - [ ] Phase artifacts loaded (SUMMARY.md, CONTEXT.md, optionally VERIFICATION.md)
340
- - [ ] All changed files classified into TDD/E2E/Skip categories
341
- - [ ] Classification presented to user and approved
342
- - [ ] Project test structure discovered (directories, conventions, runners)
343
- - [ ] Test plan presented to user and approved
344
- - [ ] TDD tests generated with arrange/act/assert structure
345
- - [ ] E2E tests generated targeting user scenarios
346
- - [ ] All tests executed — no untested tests marked as passing
347
- - [ ] Bugs discovered by tests flagged (not fixed)
348
- - [ ] Test files committed with proper message
349
- - [ ] Coverage gaps documented
350
- - [ ] Next steps presented to user
351
- </success_criteria>