maxsimcli 4.8.0 → 4.9.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.
- package/dist/assets/CHANGELOG.md +13 -0
- package/dist/assets/hooks/maxsim-check-update.cjs +38 -0
- package/dist/assets/hooks/maxsim-check-update.cjs.map +1 -1
- package/dist/assets/hooks/maxsim-statusline.cjs +116 -48
- package/dist/assets/hooks/maxsim-statusline.cjs.map +1 -1
- package/dist/assets/hooks/maxsim-sync-reminder.cjs +117 -0
- package/dist/assets/hooks/maxsim-sync-reminder.cjs.map +1 -0
- package/dist/assets/templates/agents/AGENTS.md +78 -106
- package/dist/assets/templates/agents/executor.md +101 -0
- package/dist/assets/templates/agents/planner.md +86 -0
- package/dist/assets/templates/agents/researcher.md +71 -0
- package/dist/assets/templates/agents/verifier.md +88 -0
- package/dist/assets/templates/commands/maxsim/debug.md +7 -7
- package/dist/assets/templates/commands/maxsim/execute.md +45 -0
- package/dist/assets/templates/commands/maxsim/go.md +29 -0
- package/dist/assets/templates/commands/maxsim/help.md +2 -2
- package/dist/assets/templates/commands/maxsim/init.md +52 -0
- package/dist/assets/templates/commands/maxsim/plan.md +50 -0
- package/dist/assets/templates/commands/maxsim/progress.md +4 -3
- package/dist/assets/templates/commands/maxsim/quick.md +6 -4
- package/dist/assets/templates/commands/maxsim/settings.md +4 -3
- package/dist/assets/templates/references/continuation-format.md +16 -16
- package/dist/assets/templates/references/model-profile-resolution.md +1 -1
- package/dist/assets/templates/references/model-profiles.md +12 -19
- package/dist/assets/templates/rules/conventions.md +51 -0
- package/dist/assets/templates/rules/verification-protocol.md +57 -0
- package/dist/assets/templates/skills/agent-system-map/SKILL.md +92 -0
- package/dist/assets/templates/skills/brainstorming/SKILL.md +48 -36
- package/dist/assets/templates/skills/code-review/SKILL.md +40 -61
- package/dist/assets/templates/skills/commit-conventions/SKILL.md +75 -0
- package/dist/assets/templates/skills/evidence-collection/SKILL.md +87 -0
- package/dist/assets/templates/skills/handoff-contract/SKILL.md +70 -0
- package/dist/assets/templates/skills/input-validation/SKILL.md +51 -0
- package/dist/assets/templates/skills/maxsim-batch/SKILL.md +41 -45
- package/dist/assets/templates/skills/maxsim-simplify/SKILL.md +37 -90
- package/dist/assets/templates/skills/memory-management/SKILL.md +32 -67
- package/dist/assets/templates/skills/research-methodology/SKILL.md +137 -0
- package/dist/assets/templates/skills/roadmap-writing/SKILL.md +40 -58
- package/dist/assets/templates/skills/sdd/SKILL.md +34 -69
- package/dist/assets/templates/skills/systematic-debugging/SKILL.md +20 -26
- package/dist/assets/templates/skills/tdd/SKILL.md +25 -33
- package/dist/assets/templates/skills/tool-priority-guide/SKILL.md +80 -0
- package/dist/assets/templates/skills/using-maxsim/SKILL.md +42 -73
- package/dist/assets/templates/skills/verification-before-completion/SKILL.md +12 -24
- package/dist/assets/templates/skills/verification-gates/SKILL.md +169 -0
- package/dist/assets/templates/templates/UAT.md +3 -3
- package/dist/assets/templates/templates/VALIDATION.md +1 -1
- package/dist/assets/templates/templates/context.md +4 -4
- package/dist/assets/templates/templates/debug-subagent-prompt.md +3 -3
- package/dist/assets/templates/templates/discovery.md +2 -2
- package/dist/assets/templates/templates/phase-prompt.md +2 -2
- package/dist/assets/templates/templates/planner-subagent-prompt.md +7 -7
- package/dist/assets/templates/templates/project.md +1 -1
- package/dist/assets/templates/templates/research.md +1 -1
- package/dist/assets/templates/templates/state.md +2 -2
- package/dist/assets/templates/templates/summary.md +41 -0
- package/dist/assets/templates/workflows/batch.md +5 -5
- package/dist/assets/templates/workflows/diagnose-issues.md +2 -2
- package/dist/assets/templates/workflows/discovery-phase.md +3 -3
- package/dist/assets/templates/workflows/discuss-phase.md +11 -11
- package/dist/assets/templates/workflows/execute-phase.md +205 -11
- package/dist/assets/templates/workflows/execute-plan.md +299 -34
- package/dist/assets/templates/workflows/execute.md +421 -0
- package/dist/assets/templates/workflows/go.md +250 -0
- package/dist/assets/templates/workflows/health.md +5 -5
- package/dist/assets/templates/workflows/help.md +165 -435
- package/dist/assets/templates/workflows/init-existing.md +23 -23
- package/dist/assets/templates/workflows/init.md +205 -0
- package/dist/assets/templates/workflows/new-milestone.md +9 -9
- package/dist/assets/templates/workflows/new-project.md +26 -26
- package/dist/assets/templates/workflows/plan-create.md +298 -0
- package/dist/assets/templates/workflows/plan-discuss.md +347 -0
- package/dist/assets/templates/workflows/plan-phase.md +29 -29
- package/dist/assets/templates/workflows/plan-research.md +177 -0
- package/dist/assets/templates/workflows/plan.md +231 -0
- package/dist/assets/templates/workflows/progress.md +46 -42
- package/dist/assets/templates/workflows/quick.md +195 -14
- package/dist/assets/templates/workflows/research-phase.md +5 -5
- package/dist/assets/templates/workflows/sdd.md +20 -12
- package/dist/assets/templates/workflows/settings.md +18 -14
- package/dist/assets/templates/workflows/verify-phase.md +1 -1
- package/dist/assets/templates/workflows/verify-work.md +16 -16
- package/dist/cli.cjs +496 -91
- package/dist/cli.cjs.map +1 -1
- package/dist/core-D5zUr9cb.cjs.map +1 -1
- package/dist/install.cjs +234 -17
- package/dist/install.cjs.map +1 -1
- package/dist/mcp-server.cjs +21 -2
- package/dist/mcp-server.cjs.map +1 -1
- package/dist/skills-CjFWZIGM.cjs.map +1 -1
- package/package.json +1 -1
- package/dist/assets/hooks/maxsim-context-monitor.cjs +0 -121
- package/dist/assets/hooks/maxsim-context-monitor.cjs.map +0 -1
- package/dist/assets/templates/agents/maxsim-code-reviewer.md +0 -239
- package/dist/assets/templates/agents/maxsim-codebase-mapper.md +0 -214
- package/dist/assets/templates/agents/maxsim-debugger.md +0 -572
- package/dist/assets/templates/agents/maxsim-drift-checker.md +0 -522
- package/dist/assets/templates/agents/maxsim-executor.md +0 -504
- package/dist/assets/templates/agents/maxsim-integration-checker.md +0 -273
- package/dist/assets/templates/agents/maxsim-phase-researcher.md +0 -305
- package/dist/assets/templates/agents/maxsim-plan-checker.md +0 -343
- package/dist/assets/templates/agents/maxsim-planner.md +0 -610
- package/dist/assets/templates/agents/maxsim-project-researcher.md +0 -359
- package/dist/assets/templates/agents/maxsim-research-synthesizer.md +0 -263
- package/dist/assets/templates/agents/maxsim-roadmapper.md +0 -324
- package/dist/assets/templates/agents/maxsim-spec-reviewer.md +0 -245
- package/dist/assets/templates/agents/maxsim-verifier.md +0 -393
- package/dist/assets/templates/commands/maxsim/add-phase.md +0 -43
- package/dist/assets/templates/commands/maxsim/add-tests.md +0 -41
- package/dist/assets/templates/commands/maxsim/add-todo.md +0 -57
- package/dist/assets/templates/commands/maxsim/artefakte.md +0 -122
- package/dist/assets/templates/commands/maxsim/audit-milestone.md +0 -36
- package/dist/assets/templates/commands/maxsim/batch.md +0 -42
- package/dist/assets/templates/commands/maxsim/check-drift.md +0 -56
- package/dist/assets/templates/commands/maxsim/check-todos.md +0 -46
- package/dist/assets/templates/commands/maxsim/cleanup.md +0 -18
- package/dist/assets/templates/commands/maxsim/complete-milestone.md +0 -136
- package/dist/assets/templates/commands/maxsim/discuss-phase.md +0 -87
- package/dist/assets/templates/commands/maxsim/discuss.md +0 -70
- package/dist/assets/templates/commands/maxsim/execute-phase.md +0 -41
- package/dist/assets/templates/commands/maxsim/health.md +0 -22
- package/dist/assets/templates/commands/maxsim/init-existing.md +0 -46
- package/dist/assets/templates/commands/maxsim/insert-phase.md +0 -32
- package/dist/assets/templates/commands/maxsim/list-phase-assumptions.md +0 -46
- package/dist/assets/templates/commands/maxsim/map-codebase.md +0 -71
- package/dist/assets/templates/commands/maxsim/new-milestone.md +0 -44
- package/dist/assets/templates/commands/maxsim/new-project.md +0 -46
- package/dist/assets/templates/commands/maxsim/pause-work.md +0 -38
- package/dist/assets/templates/commands/maxsim/plan-milestone-gaps.md +0 -34
- package/dist/assets/templates/commands/maxsim/plan-phase.md +0 -44
- package/dist/assets/templates/commands/maxsim/realign.md +0 -39
- package/dist/assets/templates/commands/maxsim/reapply-patches.md +0 -110
- package/dist/assets/templates/commands/maxsim/remove-phase.md +0 -31
- package/dist/assets/templates/commands/maxsim/research-phase.md +0 -189
- package/dist/assets/templates/commands/maxsim/resume-work.md +0 -40
- package/dist/assets/templates/commands/maxsim/roadmap.md +0 -19
- package/dist/assets/templates/commands/maxsim/sdd.md +0 -39
- package/dist/assets/templates/commands/maxsim/set-profile.md +0 -34
- package/dist/assets/templates/commands/maxsim/update.md +0 -37
- package/dist/assets/templates/commands/maxsim/verify-work.md +0 -38
- package/dist/assets/templates/workflows/add-phase.md +0 -111
- package/dist/assets/templates/workflows/add-tests.md +0 -351
- package/dist/assets/templates/workflows/add-todo.md +0 -247
- package/dist/assets/templates/workflows/audit-milestone.md +0 -297
- package/dist/assets/templates/workflows/check-drift.md +0 -248
- package/dist/assets/templates/workflows/check-todos.md +0 -261
- package/dist/assets/templates/workflows/cleanup.md +0 -153
- package/dist/assets/templates/workflows/complete-milestone.md +0 -701
- package/dist/assets/templates/workflows/discuss.md +0 -343
- package/dist/assets/templates/workflows/insert-phase.md +0 -129
- package/dist/assets/templates/workflows/list-phase-assumptions.md +0 -178
- package/dist/assets/templates/workflows/map-codebase.md +0 -315
- package/dist/assets/templates/workflows/pause-work.md +0 -122
- package/dist/assets/templates/workflows/plan-milestone-gaps.md +0 -274
- package/dist/assets/templates/workflows/realign.md +0 -288
- package/dist/assets/templates/workflows/remove-phase.md +0 -154
- package/dist/assets/templates/workflows/resume-project.md +0 -306
- package/dist/assets/templates/workflows/roadmap.md +0 -130
- package/dist/assets/templates/workflows/set-profile.md +0 -81
- package/dist/assets/templates/workflows/transition.md +0 -544
- package/dist/assets/templates/workflows/update.md +0 -220
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
<sanity_check>
|
|
2
|
-
Before executing any step in this workflow, verify:
|
|
3
|
-
1. The current directory contains a `.planning/` folder -- if not, stop and tell the user to run `/maxsim:new-project` first.
|
|
4
|
-
2. `.planning/DRIFT-REPORT.md` exists -- if not, stop and tell the user to run `/maxsim:check-drift` first.
|
|
5
|
-
</sanity_check>
|
|
6
|
-
|
|
7
|
-
<purpose>
|
|
8
|
-
Correct spec-code divergence in either direction. Realign-to-code updates `.planning/` to match the actual codebase. Realign-to-spec generates new fix phases to make code match the spec. Reads the DRIFT-REPORT.md produced by `/maxsim:check-drift`.
|
|
9
|
-
</purpose>
|
|
10
|
-
|
|
11
|
-
<core_principle>
|
|
12
|
-
This is an interactive orchestrator workflow, not an agent spawn. Realign-to-code requires per-item user decisions (Accept/Skip/Edit). Realign-to-spec requires user approval of proposed phase groupings. The workflow drives the interaction directly.
|
|
13
|
-
</core_principle>
|
|
14
|
-
|
|
15
|
-
<required_reading>
|
|
16
|
-
Read STATE.md before any operation to load project context.
|
|
17
|
-
</required_reading>
|
|
18
|
-
|
|
19
|
-
<process>
|
|
20
|
-
|
|
21
|
-
<step name="initialize" priority="first">
|
|
22
|
-
Load context and validate prerequisites:
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
INIT=$(node ~/.claude/maxsim/bin/maxsim-tools.cjs init realign "$DIRECTION")
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
Parse JSON for: `has_report`, `has_planning`, `report_path`, `state_path`, `requirements_path`, `roadmap_path`, `phase_dirs`, `current_phase`, `commit_docs`.
|
|
29
|
-
|
|
30
|
-
**Validation gates:**
|
|
31
|
-
- If `has_planning` is false: "No `.planning/` directory found. Run `/maxsim:new-project` first." STOP.
|
|
32
|
-
- If `has_report` is false: "No DRIFT-REPORT.md found. Run `/maxsim:check-drift` first to generate a drift report." STOP.
|
|
33
|
-
</step>
|
|
34
|
-
|
|
35
|
-
<step name="read_report">
|
|
36
|
-
Read the drift report metadata and content:
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
REPORT=$(node ~/.claude/maxsim/bin/maxsim-tools.cjs drift read-report)
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
Parse the result to extract:
|
|
43
|
-
- **Frontmatter:** `status`, `critical_count`, `warning_count`, `info_count`, `undocumented_count`, `total_items`, `aligned_count`
|
|
44
|
-
- **Body sections:** "Spec Ahead of Code", "Code Ahead of Spec", "No-Go Violations", "Undocumented Features"
|
|
45
|
-
|
|
46
|
-
**If `status` is `aligned`:**
|
|
47
|
-
```
|
|
48
|
-
No drift detected -- nothing to realign. All spec items match the codebase.
|
|
49
|
-
```
|
|
50
|
-
STOP.
|
|
51
|
-
</step>
|
|
52
|
-
|
|
53
|
-
<step name="select_direction">
|
|
54
|
-
Determine the realignment direction.
|
|
55
|
-
|
|
56
|
-
**If `$DIRECTION` was provided via `$ARGUMENTS`:** Use it directly. Validate it is either `to-code` or `to-spec`.
|
|
57
|
-
|
|
58
|
-
**If no direction was provided:** Present the user with a choice:
|
|
59
|
-
|
|
60
|
-
```markdown
|
|
61
|
-
## Drift Report Summary
|
|
62
|
-
|
|
63
|
-
**Status:** {critical_count} critical | {warning_count} warning | {info_count} info | {undocumented_count} undocumented
|
|
64
|
-
|
|
65
|
-
Choose a realignment direction:
|
|
66
|
-
|
|
67
|
-
1. **to-code** -- Update `.planning/` to match current codebase (spec follows code)
|
|
68
|
-
Best when: Code is correct and spec is outdated. Accepts code reality.
|
|
69
|
-
|
|
70
|
-
2. **to-spec** -- Generate fix phases to make code match spec (code follows spec)
|
|
71
|
-
Best when: Spec is correct and code has gaps. Creates implementation phases.
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
Wait for user selection.
|
|
75
|
-
</step>
|
|
76
|
-
|
|
77
|
-
<step name="realign_to_code">
|
|
78
|
-
**Execute only if direction is `to-code`.**
|
|
79
|
-
|
|
80
|
-
Parse the drift report body to extract all drifted items from:
|
|
81
|
-
- "Spec Ahead of Code" section (requirements marked complete but code missing/incomplete)
|
|
82
|
-
- "Code Ahead of Spec" section (features in code but not captured in spec)
|
|
83
|
-
- "No-Go Violations" section (code violating declared constraints)
|
|
84
|
-
- "Undocumented Features" section (features with no spec coverage)
|
|
85
|
-
|
|
86
|
-
Build a list of actionable items. For each item, extract:
|
|
87
|
-
- Requirement ID (if applicable)
|
|
88
|
-
- Section heading/description
|
|
89
|
-
- Current spec text and location
|
|
90
|
-
- What was found (or not found) in code
|
|
91
|
-
- The report's fix recommendation
|
|
92
|
-
- All spec file references from the evidence section
|
|
93
|
-
|
|
94
|
-
**Process each item interactively:**
|
|
95
|
-
|
|
96
|
-
For each drifted item, present it to the user:
|
|
97
|
-
|
|
98
|
-
```markdown
|
|
99
|
-
### Item {N}/{total}: {Requirement ID or Feature Name}
|
|
100
|
-
|
|
101
|
-
**Severity:** {CRITICAL | WARNING | INFO}
|
|
102
|
-
**Direction:** {Spec ahead of code | Code ahead of spec | No-go violation | Undocumented}
|
|
103
|
-
|
|
104
|
-
**Current spec:** {spec text from report}
|
|
105
|
-
**Code reality:** {what was found or not found}
|
|
106
|
-
**Recommendation:** {fix recommendation from report}
|
|
107
|
-
|
|
108
|
-
**Affected spec files:** {list of files that reference this item}
|
|
109
|
-
|
|
110
|
-
Choose:
|
|
111
|
-
- **Accept** -- Apply the recommended spec change
|
|
112
|
-
- **Skip** -- Leave as-is (no changes for this item)
|
|
113
|
-
- **Edit** -- Provide a custom change description
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
Wait for user response.
|
|
117
|
-
|
|
118
|
-
**Apply accepted changes based on item direction:**
|
|
119
|
-
|
|
120
|
-
**For "Spec ahead of code" items** (requirement marked done but code missing):
|
|
121
|
-
- Update REQUIREMENTS.md: change `[x]` to `[ ]` for the requirement using `node ~/.claude/maxsim/bin/maxsim-tools.cjs requirements mark-incomplete {REQ_ID}`, or manually edit the checkbox if the tool does not support it.
|
|
122
|
-
- Check ROADMAP.md: if the requirement appears in success criteria for a phase, add a note that the criterion is unmet.
|
|
123
|
-
- Check STATE.md: if a decision references this requirement, add a note that the implementation is pending.
|
|
124
|
-
- Check phase SUMMARY.md files: if any summary claims this requirement was completed, add a caveat note.
|
|
125
|
-
|
|
126
|
-
**For "Code ahead of spec" items** (feature exists but spec does not mention it):
|
|
127
|
-
- If user accepts the default recommendation: add the feature as a new requirement in REQUIREMENTS.md under the appropriate version section.
|
|
128
|
-
- If user provides an edit: apply their custom text instead.
|
|
129
|
-
- Update PROJECT.md if the feature represents a significant capability not documented there.
|
|
130
|
-
|
|
131
|
-
**For "No-go violation" items** (code violating a declared constraint):
|
|
132
|
-
- Document as known tech debt in STATE.md under "Blockers/Concerns" or a "Known Tech Debt" section.
|
|
133
|
-
- Optionally mark for future fix phase.
|
|
134
|
-
|
|
135
|
-
**For "Undocumented feature" items** (code with no spec coverage):
|
|
136
|
-
- Add to REQUIREMENTS.md as a new entry documenting the existing capability.
|
|
137
|
-
- Or update PROJECT.md to document it as an existing capability, depending on user's edit.
|
|
138
|
-
|
|
139
|
-
**CRITICAL -- Multi-file consistency:** For each accepted item, identify ALL spec files that reference it (from the drift report evidence section) and update all of them. Do NOT update only REQUIREMENTS.md while leaving ROADMAP.md or STATE.md inconsistent. Use the spec file references in the drift report as the update checklist.
|
|
140
|
-
|
|
141
|
-
Track changes: maintain a running count of accepted, skipped, and edited items, and a list of all modified files.
|
|
142
|
-
|
|
143
|
-
**After processing all items:**
|
|
144
|
-
|
|
145
|
-
Check if any phase now has all success criteria met in code. For each phase referenced in the drift report:
|
|
146
|
-
|
|
147
|
-
```bash
|
|
148
|
-
# Check if phase criteria are now all satisfied
|
|
149
|
-
PHASE_STATUS=$(node ~/.claude/maxsim/bin/maxsim-tools.cjs roadmap get-phase "{phase_number}")
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
If all criteria for a phase are met after the realignment updates, auto-mark that phase complete:
|
|
153
|
-
|
|
154
|
-
```bash
|
|
155
|
-
node ~/.claude/maxsim/bin/maxsim-tools.cjs phase complete "{phase_number}"
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
**If ALL items were skipped:** "No changes applied. Drift report remains unchanged." STOP (do not commit).
|
|
159
|
-
|
|
160
|
-
**Commit changes:**
|
|
161
|
-
|
|
162
|
-
```bash
|
|
163
|
-
node ~/.claude/maxsim/bin/maxsim-tools.cjs commit "docs: realign spec to match codebase" --files {space-separated list of all modified files}
|
|
164
|
-
```
|
|
165
|
-
</step>
|
|
166
|
-
|
|
167
|
-
<step name="realign_to_spec">
|
|
168
|
-
**Execute only if direction is `to-spec`.**
|
|
169
|
-
|
|
170
|
-
Parse the drift report to extract all "Spec Ahead of Code" items -- requirements and success criteria that are specified but not yet implemented in code. Also include any "No-Go Violations" that require code changes.
|
|
171
|
-
|
|
172
|
-
Build a list of implementation gaps. For each gap, extract:
|
|
173
|
-
- Requirement ID
|
|
174
|
-
- Description of what needs to be implemented
|
|
175
|
-
- Current spec location (file and section)
|
|
176
|
-
- Evidence of what is missing from the report
|
|
177
|
-
|
|
178
|
-
**Group gaps into phases using this algorithm:**
|
|
179
|
-
|
|
180
|
-
1. **Group by requirement prefix:** Collect all gaps sharing a requirement prefix (e.g., all `DRIFT-*` gaps into one phase, all `INIT-*` into another, all `ROT-*` into another). The prefix is the text before the hyphen and number in the requirement ID.
|
|
181
|
-
|
|
182
|
-
2. **If no prefix grouping possible** (gaps have no requirement IDs or all have unique prefixes): group by affected subsystem. Cluster gaps whose evidence references common file paths or directories.
|
|
183
|
-
|
|
184
|
-
3. **Apply the 5-phase cap:**
|
|
185
|
-
- If 5 or fewer groups: use them as-is.
|
|
186
|
-
- If more than 5 groups: sort groups by gap count (ascending). Merge the smallest groups into a "Remaining Gaps" phase until only 5 groups remain.
|
|
187
|
-
|
|
188
|
-
4. **Minimum group size:** Each phase should have at minimum 2 gaps, unless it is the only group or merging is not possible.
|
|
189
|
-
|
|
190
|
-
5. **Name each phase** descriptively: "{Prefix} Implementation Gaps" or "{Subsystem} Fixes" or similar concise name.
|
|
191
|
-
|
|
192
|
-
**Present proposed phases to user:**
|
|
193
|
-
|
|
194
|
-
```markdown
|
|
195
|
-
## Proposed Realignment Phases
|
|
196
|
-
|
|
197
|
-
Based on the drift report, {gap_count} implementation gaps will be organized into {phase_count} new phases inserted after the current active phase ({current_phase}).
|
|
198
|
-
|
|
199
|
-
| # | Phase Name | Requirements | Gap Count | Description |
|
|
200
|
-
|---|-----------|-------------|-----------|-------------|
|
|
201
|
-
| 1 | {name} | {REQ-01, REQ-02} | {N} | {brief description} |
|
|
202
|
-
| 2 | {name} | {REQ-03} | {N} | {brief description} |
|
|
203
|
-
|
|
204
|
-
Approve this breakdown? (yes / suggest changes)
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
Wait for user approval. If user suggests changes, adjust the grouping accordingly.
|
|
208
|
-
|
|
209
|
-
**For each approved phase, insert after the current active phase:**
|
|
210
|
-
|
|
211
|
-
```bash
|
|
212
|
-
RESULT=$(node ~/.claude/maxsim/bin/maxsim-tools.cjs phase insert "{current_phase}" "{phase_name}")
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
The insert command creates the phase directory with decimal numbering (e.g., `04.1`, `04.2`) and updates ROADMAP.md.
|
|
216
|
-
|
|
217
|
-
**For each inserted phase, update the ROADMAP.md phase section** to include:
|
|
218
|
-
- The requirement IDs covered by this phase
|
|
219
|
-
- Success criteria extracted from the drift report (what needs to be implemented)
|
|
220
|
-
- A brief goal statement
|
|
221
|
-
|
|
222
|
-
Use the Edit tool to add requirement details and success criteria to each newly created phase entry in ROADMAP.md.
|
|
223
|
-
|
|
224
|
-
**Commit changes:**
|
|
225
|
-
|
|
226
|
-
```bash
|
|
227
|
-
node ~/.claude/maxsim/bin/maxsim-tools.cjs commit "feat: add realignment phases from drift report" --files .planning/ROADMAP.md .planning/STATE.md
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
Note: Include any new phase directories created by the insert commands in the commit files list.
|
|
231
|
-
</step>
|
|
232
|
-
|
|
233
|
-
<step name="summary">
|
|
234
|
-
Display a summary of what was changed.
|
|
235
|
-
|
|
236
|
-
**For realign-to-code:**
|
|
237
|
-
|
|
238
|
-
```markdown
|
|
239
|
-
## Realignment Complete (to-code)
|
|
240
|
-
|
|
241
|
-
**Items processed:** {total}
|
|
242
|
-
- Accepted: {accepted_count}
|
|
243
|
-
- Skipped: {skipped_count}
|
|
244
|
-
- Edited: {edited_count}
|
|
245
|
-
|
|
246
|
-
**Files modified:** {list of modified files}
|
|
247
|
-
**Phases auto-completed:** {list of phases marked complete, or "None"}
|
|
248
|
-
**Commit:** {commit hash}
|
|
249
|
-
|
|
250
|
-
The spec now reflects the current codebase state for the accepted items.
|
|
251
|
-
Skipped items remain as drift -- run `/maxsim:check-drift` again to see remaining drift.
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
**For realign-to-spec:**
|
|
255
|
-
|
|
256
|
-
```markdown
|
|
257
|
-
## Realignment Complete (to-spec)
|
|
258
|
-
|
|
259
|
-
**Implementation gaps:** {gap_count}
|
|
260
|
-
**New phases created:** {phase_count}
|
|
261
|
-
|
|
262
|
-
| Phase | Name | Requirements |
|
|
263
|
-
|-------|------|-------------|
|
|
264
|
-
| {num} | {name} | {REQ IDs} |
|
|
265
|
-
|
|
266
|
-
**Next step:** Run `/maxsim:execute-phase {first_new_phase}` to begin implementing the gaps.
|
|
267
|
-
```
|
|
268
|
-
</step>
|
|
269
|
-
|
|
270
|
-
</process>
|
|
271
|
-
|
|
272
|
-
<error_handling>
|
|
273
|
-
- **DRIFT-REPORT.md missing:** Direct user to run `/maxsim:check-drift` first. Do not attempt to generate a report.
|
|
274
|
-
- **Report status is "aligned":** Nothing to do. Inform user and stop.
|
|
275
|
-
- **All items skipped (to-code):** No changes made. Inform user that drift remains.
|
|
276
|
-
- **Zero "Spec Ahead of Code" gaps (to-spec):** Inform user "All specified items appear implemented. No fix phases needed. Consider realign-to-code instead to capture undocumented features."
|
|
277
|
-
- **Phase insert fails:** Report the error. Continue with remaining phases if possible. Document any failures in the summary.
|
|
278
|
-
- **Invalid direction argument:** Show usage: `/maxsim:realign [to-code | to-spec]`
|
|
279
|
-
</error_handling>
|
|
280
|
-
|
|
281
|
-
<critical_rules>
|
|
282
|
-
- **Item-by-item approval for to-code:** Never batch-apply changes. Present each item individually and wait for Accept/Skip/Edit.
|
|
283
|
-
- **Multi-file consistency:** When updating spec for an accepted item, update ALL referencing spec files, not just REQUIREMENTS.md. Use the evidence section from the drift report to identify all affected files.
|
|
284
|
-
- **Phase cap for to-spec:** Never create more than 5 new phases. Group and merge as described in the algorithm.
|
|
285
|
-
- **Insert after current phase:** New phases go after the current active phase, not at the end of the roadmap.
|
|
286
|
-
- **No auto-generation of reports:** This workflow reads an existing DRIFT-REPORT.md. It does not run drift detection itself.
|
|
287
|
-
- **Auto-complete phases:** After realign-to-code, check if any phase has all criteria met and auto-mark it complete.
|
|
288
|
-
</critical_rules>
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
<purpose>
|
|
2
|
-
Remove an unstarted future phase from the project roadmap, delete its directory, renumber all subsequent phases to maintain a clean linear sequence, and commit the change. The git commit serves as the historical record of removal.
|
|
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
|
-
- Argument is the phase number to remove (integer or decimal)
|
|
14
|
-
- Example: `/maxsim:remove-phase 17` → phase = 17
|
|
15
|
-
- Example: `/maxsim:remove-phase 16.1` → phase = 16.1
|
|
16
|
-
|
|
17
|
-
If no argument provided:
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
ERROR: Phase number required
|
|
21
|
-
Usage: /maxsim:remove-phase <phase-number>
|
|
22
|
-
Example: /maxsim:remove-phase 17
|
|
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 "${target}")
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Extract: `phase_found`, `phase_dir`, `phase_number`, `commit_docs`, `roadmap_exists`.
|
|
36
|
-
|
|
37
|
-
Also read STATE.md and ROADMAP.md content for parsing current position.
|
|
38
|
-
</step>
|
|
39
|
-
|
|
40
|
-
<step name="validate_future_phase">
|
|
41
|
-
Verify the phase is a future phase (not started):
|
|
42
|
-
|
|
43
|
-
1. Compare target phase to current phase from STATE.md
|
|
44
|
-
2. Target must be > current phase number
|
|
45
|
-
|
|
46
|
-
If target <= current phase:
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
ERROR: Cannot remove Phase {target}
|
|
50
|
-
|
|
51
|
-
Only future phases can be removed:
|
|
52
|
-
- Current phase: {current}
|
|
53
|
-
- Phase {target} is current or completed
|
|
54
|
-
|
|
55
|
-
To abandon current work, use /maxsim:pause-work instead.
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
Exit.
|
|
59
|
-
</step>
|
|
60
|
-
|
|
61
|
-
<step name="confirm_removal">
|
|
62
|
-
Present removal summary and confirm:
|
|
63
|
-
|
|
64
|
-
```
|
|
65
|
-
Removing Phase {target}: {Name}
|
|
66
|
-
|
|
67
|
-
This will:
|
|
68
|
-
- Delete: .planning/phases/{target}-{slug}/
|
|
69
|
-
- Renumber all subsequent phases
|
|
70
|
-
- Update: ROADMAP.md, STATE.md
|
|
71
|
-
|
|
72
|
-
Proceed? (y/n)
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
Wait for confirmation.
|
|
76
|
-
</step>
|
|
77
|
-
|
|
78
|
-
<step name="execute_removal">
|
|
79
|
-
**Delegate the entire removal operation to maxsim-tools:**
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
RESULT=$(node ~/.claude/maxsim/bin/maxsim-tools.cjs phase remove "${target}")
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
If the phase has executed plans (SUMMARY.md files), maxsim-tools will error. Use `--force` only if the user confirms:
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
RESULT=$(node ~/.claude/maxsim/bin/maxsim-tools.cjs phase remove "${target}" --force)
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
The CLI handles:
|
|
92
|
-
- Deleting the phase directory
|
|
93
|
-
- Renumbering all subsequent directories (in reverse order to avoid conflicts)
|
|
94
|
-
- Renaming all files inside renumbered directories (PLAN.md, SUMMARY.md, etc.)
|
|
95
|
-
- Updating ROADMAP.md (removing section, renumbering all phase references, updating dependencies)
|
|
96
|
-
- Updating STATE.md (decrementing phase count)
|
|
97
|
-
|
|
98
|
-
Extract from result: `removed`, `directory_deleted`, `renamed_directories`, `renamed_files`, `roadmap_updated`, `state_updated`.
|
|
99
|
-
</step>
|
|
100
|
-
|
|
101
|
-
<step name="commit">
|
|
102
|
-
Stage and commit the removal:
|
|
103
|
-
|
|
104
|
-
```bash
|
|
105
|
-
node ~/.claude/maxsim/bin/maxsim-tools.cjs commit "chore: remove phase {target} ({original-phase-name})" --files .planning/
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
The commit message preserves the historical record of what was removed.
|
|
109
|
-
</step>
|
|
110
|
-
|
|
111
|
-
<step name="completion">
|
|
112
|
-
Present completion summary:
|
|
113
|
-
|
|
114
|
-
```
|
|
115
|
-
Phase {target} ({original-name}) removed.
|
|
116
|
-
|
|
117
|
-
Changes:
|
|
118
|
-
- Deleted: .planning/phases/{target}-{slug}/
|
|
119
|
-
- Renumbered: {N} directories and {M} files
|
|
120
|
-
- Updated: ROADMAP.md, STATE.md
|
|
121
|
-
- Committed: chore: remove phase {target} ({original-name})
|
|
122
|
-
|
|
123
|
-
---
|
|
124
|
-
|
|
125
|
-
## What's Next
|
|
126
|
-
|
|
127
|
-
Would you like to:
|
|
128
|
-
- `/maxsim:progress` — see updated roadmap status
|
|
129
|
-
- Continue with current phase
|
|
130
|
-
- Review roadmap
|
|
131
|
-
|
|
132
|
-
---
|
|
133
|
-
```
|
|
134
|
-
</step>
|
|
135
|
-
|
|
136
|
-
</process>
|
|
137
|
-
|
|
138
|
-
<anti_patterns>
|
|
139
|
-
|
|
140
|
-
- Don't remove completed phases (have SUMMARY.md files) without --force
|
|
141
|
-
- Don't remove current or past phases
|
|
142
|
-
- Don't manually renumber — use `maxsim-tools phase remove` which handles all renumbering
|
|
143
|
-
- Don't add "removed phase" notes to STATE.md — git commit is the record
|
|
144
|
-
- Don't modify completed phase directories
|
|
145
|
-
</anti_patterns>
|
|
146
|
-
|
|
147
|
-
<success_criteria>
|
|
148
|
-
Phase removal is complete when:
|
|
149
|
-
|
|
150
|
-
- [ ] Target phase validated as future/unstarted
|
|
151
|
-
- [ ] `maxsim-tools phase remove` executed successfully
|
|
152
|
-
- [ ] Changes committed with descriptive message
|
|
153
|
-
- [ ] User informed of changes
|
|
154
|
-
</success_criteria>
|