maxsimcli 5.0.6 → 5.1.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 (91) hide show
  1. package/README.md +316 -288
  2. package/dist/assets/CHANGELOG.md +14 -0
  3. package/dist/assets/hooks/maxsim-capture-learnings.cjs +128 -0
  4. package/dist/assets/hooks/maxsim-capture-learnings.cjs.map +1 -0
  5. package/dist/assets/hooks/maxsim-check-update.cjs +126 -88
  6. package/dist/assets/hooks/maxsim-check-update.cjs.map +1 -1
  7. package/dist/assets/hooks/maxsim-notification-sound.cjs +87 -43
  8. package/dist/assets/hooks/maxsim-notification-sound.cjs.map +1 -1
  9. package/dist/assets/hooks/maxsim-statusline.cjs +45 -171
  10. package/dist/assets/hooks/maxsim-statusline.cjs.map +1 -1
  11. package/dist/assets/hooks/maxsim-stop-sound.cjs +86 -43
  12. package/dist/assets/hooks/maxsim-stop-sound.cjs.map +1 -1
  13. package/dist/assets/hooks/maxsim-sync-reminder.cjs +72 -21
  14. package/dist/assets/hooks/maxsim-sync-reminder.cjs.map +1 -1
  15. package/dist/assets/templates/agents/AGENTS.md +62 -51
  16. package/dist/assets/templates/agents/executor.md +44 -59
  17. package/dist/assets/templates/agents/planner.md +36 -31
  18. package/dist/assets/templates/agents/researcher.md +35 -43
  19. package/dist/assets/templates/agents/verifier.md +29 -31
  20. package/dist/assets/templates/commands/maxsim/debug.md +20 -154
  21. package/dist/assets/templates/commands/maxsim/execute.md +19 -33
  22. package/dist/assets/templates/commands/maxsim/go.md +21 -20
  23. package/dist/assets/templates/commands/maxsim/help.md +5 -14
  24. package/dist/assets/templates/commands/maxsim/init.md +18 -40
  25. package/dist/assets/templates/commands/maxsim/plan.md +22 -37
  26. package/dist/assets/templates/commands/maxsim/progress.md +15 -16
  27. package/dist/assets/templates/commands/maxsim/quick.md +18 -29
  28. package/dist/assets/templates/commands/maxsim/settings.md +18 -26
  29. package/dist/assets/templates/references/continuation-format.md +2 -4
  30. package/dist/assets/templates/references/model-profiles.md +2 -2
  31. package/dist/assets/templates/references/planning-config.md +10 -11
  32. package/dist/assets/templates/references/self-improvement.md +120 -0
  33. package/dist/assets/templates/rules/conventions.md +1 -1
  34. package/dist/assets/templates/rules/verification-protocol.md +1 -1
  35. package/dist/assets/templates/skills/brainstorming/SKILL.md +35 -26
  36. package/dist/assets/templates/skills/code-review/SKILL.md +78 -55
  37. package/dist/assets/templates/skills/commit-conventions/SKILL.md +70 -36
  38. package/dist/assets/templates/skills/github-operations/SKILL.md +142 -0
  39. package/dist/assets/templates/skills/handoff-contract/SKILL.md +62 -28
  40. package/dist/assets/templates/skills/maxsim-batch/SKILL.md +68 -42
  41. package/dist/assets/templates/skills/maxsim-simplify/SKILL.md +65 -40
  42. package/dist/assets/templates/skills/project-memory/SKILL.md +121 -0
  43. package/dist/assets/templates/skills/research/SKILL.md +126 -0
  44. package/dist/assets/templates/skills/roadmap-writing/SKILL.md +71 -68
  45. package/dist/assets/templates/skills/systematic-debugging/SKILL.md +37 -25
  46. package/dist/assets/templates/skills/tdd/SKILL.md +36 -39
  47. package/dist/assets/templates/skills/using-maxsim/SKILL.md +69 -55
  48. package/dist/assets/templates/skills/verification/SKILL.md +167 -0
  49. package/dist/assets/templates/workflows/batch.md +249 -268
  50. package/dist/assets/templates/workflows/diagnose-issues.md +225 -151
  51. package/dist/assets/templates/workflows/execute-plan.md +191 -981
  52. package/dist/assets/templates/workflows/execute.md +350 -309
  53. package/dist/assets/templates/workflows/go.md +119 -138
  54. package/dist/assets/templates/workflows/health.md +71 -114
  55. package/dist/assets/templates/workflows/help.md +85 -147
  56. package/dist/assets/templates/workflows/init-existing.md +180 -1373
  57. package/dist/assets/templates/workflows/init.md +53 -165
  58. package/dist/assets/templates/workflows/new-milestone.md +91 -334
  59. package/dist/assets/templates/workflows/new-project.md +165 -1384
  60. package/dist/assets/templates/workflows/plan-create.md +182 -73
  61. package/dist/assets/templates/workflows/plan-discuss.md +89 -82
  62. package/dist/assets/templates/workflows/plan-research.md +191 -85
  63. package/dist/assets/templates/workflows/plan.md +122 -58
  64. package/dist/assets/templates/workflows/progress.md +76 -310
  65. package/dist/assets/templates/workflows/quick.md +70 -495
  66. package/dist/assets/templates/workflows/sdd.md +231 -221
  67. package/dist/assets/templates/workflows/settings.md +90 -120
  68. package/dist/assets/templates/workflows/verify-phase.md +296 -258
  69. package/dist/cli.cjs +17 -23465
  70. package/dist/cli.cjs.map +1 -1
  71. package/dist/install.cjs +356 -8358
  72. package/dist/install.cjs.map +1 -1
  73. package/package.json +16 -22
  74. package/dist/assets/templates/skills/agent-system-map/SKILL.md +0 -92
  75. package/dist/assets/templates/skills/evidence-collection/SKILL.md +0 -87
  76. package/dist/assets/templates/skills/github-artifact-protocol/SKILL.md +0 -67
  77. package/dist/assets/templates/skills/github-tools-guide/SKILL.md +0 -89
  78. package/dist/assets/templates/skills/input-validation/SKILL.md +0 -51
  79. package/dist/assets/templates/skills/memory-management/SKILL.md +0 -75
  80. package/dist/assets/templates/skills/research-methodology/SKILL.md +0 -137
  81. package/dist/assets/templates/skills/sdd/SKILL.md +0 -91
  82. package/dist/assets/templates/skills/tool-priority-guide/SKILL.md +0 -80
  83. package/dist/assets/templates/skills/verification-before-completion/SKILL.md +0 -71
  84. package/dist/assets/templates/skills/verification-gates/SKILL.md +0 -169
  85. package/dist/assets/templates/workflows/discuss-phase.md +0 -683
  86. package/dist/assets/templates/workflows/research-phase.md +0 -73
  87. package/dist/assets/templates/workflows/verify-work.md +0 -572
  88. package/dist/core-D5zUr9cb.cjs +0 -4305
  89. package/dist/core-D5zUr9cb.cjs.map +0 -1
  90. package/dist/skills-CjFWZIGM.cjs +0 -6824
  91. package/dist/skills-CjFWZIGM.cjs.map +0 -1
@@ -1,48 +1,47 @@
1
1
  <purpose>
2
- Auto-detect project state through live GitHub queries, surface problems proactively, and dispatch to the appropriate MAXSIM command. Uses the Show + Act pattern: display detection reasoning first, then act immediately.
2
+ Auto-detect project state through live GitHub queries, surface problems proactively, and dispatch to the appropriate MAXSIM command. Uses the Show + Act pattern: display detection reasoning first, then act immediately. GitHub Issues are the sole source of truth — no local .planning/ directory is consulted.
3
3
  </purpose>
4
4
 
5
- <required_reading>
6
- Read all files referenced by the invoking prompt's execution_context before starting.
7
- </required_reading>
8
-
9
5
  <process>
10
6
 
11
7
  <step name="immediate_feedback">
12
- **Show immediate feedback while gathering context:**
8
+ ## Step 1: Immediate Feedback
9
+
10
+ Print immediately so the user knows work is happening:
13
11
 
14
12
  ```
15
13
  Analyzing project state...
16
14
  ```
17
-
18
- This ensures the user sees something immediately while context gathering runs.
19
15
  </step>
20
16
 
21
- <step name="deep_context_gathering">
22
- **Phase 1: Deep Context Gathering**
17
+ <step name="initialization_check">
18
+ ## Step 2: Check Initialization
23
19
 
24
- Gather all project signals in parallel for speed. Run these checks simultaneously:
20
+ Verify MAXSIM is initialized by checking for the config file:
25
21
 
26
- **1. Project existence check:**
27
22
  ```bash
28
- PLANNING_EXISTS=$(test -d .planning && echo "true" || echo "false")
23
+ INITIALIZED=$(test -f .claude/maxsim/config.json && echo "true" || echo "false")
29
24
  ```
30
25
 
31
- If `.planning/` does not exist, skip all other checks and go directly to the decision tree (Rule 1: No project found).
26
+ If `INITIALIZED` is `false`, stop immediately and display:
32
27
 
33
- **2. Load local project context (always from local files per WIRE-02):**
34
- ```bash
35
- # State snapshot (local)
36
- STATE=$(node ~/.claude/maxsim/bin/maxsim-tools.cjs state-snapshot 2>/dev/null || echo "{}")
37
28
  ```
29
+ ## MAXSIM Not Initialized
38
30
 
39
- Read local files for project context:
40
- - `.planning/STATE.md` — blockers, decisions, session continuity
41
- - `.planning/ROADMAP.md` — phase structure and phase ordering
31
+ No MAXSIM configuration found in this directory (.claude/maxsim/config.json missing).
42
32
 
43
- **3. Live GitHub state (primary source — always-live, no cached state):**
33
+ Run /maxsim:init to set up this project.
34
+ ```
44
35
 
45
- Run `github status` to get current state of all phases and detect interrupted work in one call:
36
+ Do not proceed further. Exit.
37
+ </step>
38
+
39
+ <step name="context_gathering">
40
+ ## Step 3: Deep Context Gathering
41
+
42
+ Gather all signals in parallel for speed. Run these simultaneously:
43
+
44
+ **1. Live GitHub project board state (primary source of truth):**
46
45
 
47
46
  ```bash
48
47
  node ~/.claude/maxsim/bin/maxsim-tools.cjs github status
@@ -50,210 +49,192 @@ node ~/.claude/maxsim/bin/maxsim-tools.cjs github status
50
49
 
51
50
  Returns: `phase_number`, `title`, `issue_number`, `total_tasks`, `completed_tasks`, `remaining_tasks`, `status` (GitHub board column: To Do / In Progress / In Review / Done), and any interrupted phase detection.
52
51
 
53
- **4. Git context:**
52
+ **2. Open bugs and issues:**
53
+
54
54
  ```bash
55
- # Uncommitted changes
56
- GIT_STATUS=$(git status --porcelain 2>/dev/null | head -20)
55
+ gh issue list --label "bug" --state open --json number,title,createdAt
56
+ ```
57
+
58
+ **3. Git context:**
57
59
 
58
- # Recent commits
60
+ ```bash
61
+ GIT_STATUS=$(git status --porcelain 2>/dev/null | head -20)
59
62
  RECENT_COMMITS=$(git log --oneline -5 2>/dev/null)
60
63
  ```
61
- </step>
62
64
 
63
- <step name="problem_detection">
64
- **Phase 2: Problem Detection**
65
+ If `github status` fails (GitHub CLI not available, not authenticated, no remote), display:
65
66
 
66
- Check for problems BEFORE suggesting any action. All problems are blocking — no severity tiers.
67
+ ```
68
+ ## GitHub Unavailable
67
69
 
68
- **Check each of these in order:**
70
+ GitHub integration is required. Check:
71
+ - gh auth status
72
+ - git remote -v
69
73
 
70
- **1. Uncommitted changes in .planning/**
71
- ```bash
72
- git status --porcelain .planning/ 2>/dev/null | head -10
73
- ```
74
- If uncommitted changes exist in `.planning/`:
74
+ Fix the issue, then re-run /maxsim:go.
75
75
  ```
76
- ## Problem Detected
77
76
 
78
- **Issue:** Uncommitted changes in .planning/ directory
79
- **Impact:** State drift — local planning files may diverge from team or lose work
80
- **Resolution:** Commit planning changes to preserve state
77
+ Exit. Do not fall back to local file scanning.
78
+ </step>
81
79
 
82
- **Files with changes:**
83
- {list of changed files}
80
+ <step name="problem_detection">
81
+ ## Step 4: Problem Detection
84
82
 
85
- Resolve this before continuing. Options:
86
- 1. Commit now (recommended)
87
- 2. Investigate changes first
88
- 3. Skip and continue anyway
83
+ Check for problems BEFORE suggesting any action. All problems are blocking — surface each one and wait for user resolution before continuing.
84
+
85
+ **Problem 1: Failed verification on GitHub**
86
+
87
+ Check if any phase issue is stuck in "In Review" with a verification FAIL comment. Query the current phase issue comments:
88
+
89
+ ```bash
90
+ node ~/.claude/maxsim/bin/maxsim-tools.cjs github get-issue --issue-number N --include-comments
89
91
  ```
90
92
 
91
- Block until user responds.
93
+ If a FAIL is found:
92
94
 
93
- **2. Blockers in STATE.md**
94
- Extract blockers from state snapshot. If any exist:
95
95
  ```
96
96
  ## Problem Detected
97
97
 
98
- **Issue:** Active blocker recorded in project state
99
- **Blocker:** {blocker text}
100
- **Impact:** Execution cannot proceed safely until this is resolved
101
- **Resolution:** Address the blocker or remove it if no longer relevant
98
+ Issue: Phase verification failed
99
+ Phase: {phase number and name} (GitHub Issue #{issue_number})
100
+ Impact: Phase is not verified complete may have gaps
101
+ Resolution: Re-run verification or fix identified issues
102
102
 
103
- Resolve this before continuing. Options:
104
- 1. Investigate and resolve
105
- 2. Remove blocker (if no longer relevant)
103
+ Options:
104
+ 1. View verification results (check GitHub issue comments)
105
+ 2. Re-execute to fix issues
106
106
  3. Skip and continue anyway
107
107
  ```
108
108
 
109
- Block until user responds.
109
+ Wait for user response before continuing.
110
110
 
111
- **3. Failed verification on GitHub**
112
- Check if any phase issue has a verification comment with FAIL status (from live GitHub data via `github all-progress` — look for phases stuck in "In Review" with a known failure, or check recent comments via `github get-issue` for the current phase issue):
111
+ **Problem 2: Open bug issues**
112
+
113
+ If `gh issue list --label "bug"` returned open issues:
113
114
 
114
- ```bash
115
- node ~/.claude/maxsim/bin/maxsim-tools.cjs github get-issue --issue-number N --include-comments
116
- ```
117
115
  ```
118
116
  ## Problem Detected
119
117
 
120
- **Issue:** Phase verification failed
121
- **Phase:** {phase number and name} (GitHub Issue #{issue_number})
122
- **Impact:** Phase is not verified as complete may have gaps
123
- **Resolution:** Re-run verification or fix identified issues
118
+ Issue: {N} open bug(s) on GitHub
119
+ Bugs:
120
+ #{number}{title}
121
+ ...
122
+ Impact: Active bugs may affect current phase execution
123
+ Resolution: Address bugs or route to /maxsim:debug
124
124
 
125
- Resolve this before continuing. Options:
126
- 1. View verification results (check GitHub issue comments)
127
- 2. Re-execute to fix issues
125
+ Options:
126
+ 1. Route to /maxsim:debug
127
+ 2. View bugs on GitHub
128
128
  3. Skip and continue anyway
129
129
  ```
130
130
 
131
- Block until user responds.
132
-
133
- **If any problem is found:** Surface it and wait for user resolution. Do NOT proceed to the decision tree until all problems are cleared or explicitly skipped.
131
+ Wait for user response before continuing.
134
132
 
135
- **If no problems found:** Proceed to the decision tree.
133
+ If no problems are found, proceed directly to the decision tree.
136
134
  </step>
137
135
 
138
136
  <step name="decision_tree">
139
- **Phase 3: Decision Tree**
137
+ ## Step 5: Decision Tree
140
138
 
141
- Apply rules in strict precedence order. The FIRST matching rule determines the action.
142
-
143
- Use live GitHub data from `github status` (gathered in Phase 1) as the primary source of truth for phase state. Use local ROADMAP.md for phase ordering only.
139
+ Apply rules in strict precedence order. The FIRST matching rule determines the action. Use live GitHub data from `github status` as the sole source of truth for phase state.
144
140
 
145
141
  ```
146
- Rule 1: No .planning/ directory?
147
- -> Action: /maxsim:init
148
- -> Reasoning: "No MAXSIM project found in this directory."
149
-
150
- Rule 2: Has blockers in STATE.md? (not cleared in problem detection)
151
- -> Action: Surface blocker, suggest resolution
152
- -> Reasoning: "BLOCKED: {blocker text}"
142
+ Rule 1: GitHub status returns no phases at all?
143
+ -> Action: Suggest creating roadmap
144
+ -> Reasoning: "No phases found on GitHub. Create a roadmap to get started."
145
+ -> Suggest: /maxsim:plan
153
146
 
154
- Rule 3: Interrupted phase detected (from `github status`)?
147
+ Rule 2: Interrupted phase detected (from github status)?
155
148
  -> Action: /maxsim:execute {N}
156
149
  -> Reasoning: "Phase {N} ({name}) was interrupted. Resuming execution."
157
150
 
158
- Rule 4: Phase "In Progress" on GitHub board with incomplete tasks?
159
- -> Check: `github status` returns a phase with status="In Progress" and remaining_tasks > 0
151
+ Rule 3: Phase status = "In Progress" with remaining_tasks > 0?
160
152
  -> Action: /maxsim:execute {N}
161
- -> Reasoning: "Phase {N} ({name}) has {remaining} tasks remaining. Ready to continue."
153
+ -> Reasoning: "Phase {N} ({name}) has {remaining} tasks remaining."
162
154
 
163
- Rule 5: Phase "To Do" on GitHub board (not yet started)?
164
- -> Check: `github status` returns the next unstarted phase (status="To Do")
155
+ Rule 4: Phase status = "To Do" (next unstarted phase)?
165
156
  -> Action: /maxsim:plan {N}
166
157
  -> Reasoning: "Phase {N} ({name}) needs planning."
167
158
 
168
- Sub-check: Does a context comment exist on the phase GitHub Issue?
169
- -> If yes: "Discussion complete, ready for research + planning."
170
- -> If no: "Starting from discussion stage."
171
-
172
- Rule 6: Current phase "In Review" on GitHub board?
173
- -> Check: `github status` returns a phase with status="In Review"
159
+ Rule 5: Phase status = "In Review"?
174
160
  -> Action: /maxsim:execute {N}
175
161
  -> Reasoning: "Phase {N} ({name}) is awaiting verification."
176
162
 
177
- Rule 7: All phases "Done" on GitHub board?
178
- -> Check: `github status` — all phases have status="Done"
163
+ Rule 6: All phases status = "Done"?
179
164
  -> Action: /maxsim:progress
180
165
  -> Reasoning: "All phases complete. Milestone ready for review."
181
166
 
182
- Rule 8: None of the above?
183
- -> Action: Show interactive menu
184
- -> Reasoning: "Project state is ambiguous. Here are your options."
167
+ Rule 7: None of the above?
168
+ -> Action: Show interactive menu (see Step 6)
169
+ -> Reasoning: "Project state is ambiguous."
185
170
  ```
186
171
  </step>
187
172
 
188
173
  <step name="show_and_act">
189
- **Phase 4: Show + Act**
174
+ ## Step 6: Show + Act
190
175
 
191
- Once a rule matches, display detection reasoning FIRST, then act immediately.
176
+ Once a rule matches (Rules 1–6), display detection reasoning FIRST, then invoke the Skill tool to run the recommended command. Do NOT ask for confirmation — the user can Ctrl+C if the detection is wrong.
192
177
 
193
- **Format for auto-dispatch (Rules 1-7):**
178
+ **Display format:**
194
179
 
195
180
  ```
196
181
  ## Detected: {summary of what was found}
197
182
 
198
- **Project:** {project name from PROJECT.md, or "New project"}
199
- **Milestone:** {milestone from ROADMAP.md, or "Not started"}
200
- **Current phase:** {phase N - name, or "None"} (GitHub Issue #{issue_number})
201
- **GitHub Status:** {board column from live `github status` data}
202
- **Tasks:** {completed}/{total} complete
183
+ Project: {project name from config.json}
184
+ Current phase: Phase {N} {name} (GitHub Issue #{issue_number})
185
+ GitHub status: {board column}
186
+ Tasks: {completed}/{total} complete
203
187
 
204
- **Action:** Running /maxsim:{command} {args}...
188
+ Action: Running /maxsim:{command} {args}...
205
189
  ```
206
190
 
207
- Then immediately dispatch the command using the SlashCommand tool. The user can Ctrl+C if the detection is wrong.
208
-
209
- **Important:** Show the detection block, then dispatch. Do not ask for confirmation — this is Show + Act, not Show + Ask.
191
+ Then invoke the Skill tool with the recommended command.
210
192
  </step>
211
193
 
212
194
  <step name="interactive_menu">
213
- **Phase 5: Interactive Menu (Rule 8 — no obvious action)**
195
+ ## Step 7: Interactive Menu (Rule 7 only)
214
196
 
215
- When no clear action is detected, show a contextual menu. The menu items are NOT static — filter based on what makes sense for the current project state (use live GitHub data from `github status`).
197
+ When no clear action is detected, show a contextual menu. Filter items based on live GitHub data do not show static options that don't apply.
216
198
 
217
199
  ```
218
200
  ## Project Status
219
201
 
220
- **Project:** {project name}
221
- **Milestone:** {milestone}
222
- **GitHub Progress:** {X}/{Y} phases Done on board
202
+ Project: {project name}
203
+ GitHub: {X}/{Y} phases Done on board
223
204
 
224
205
  What would you like to do?
225
206
 
226
207
  1. /maxsim:plan {next_phase} — Plan next phase
227
- 2. /maxsim:quickQuick ad-hoc task
228
- 3. /maxsim:progressView detailed progress
229
- 4. /maxsim:debugDebug an issue
208
+ 2. /maxsim:execute {N} Continue phase execution
209
+ 3. /maxsim:quickQuick ad-hoc task
210
+ 4. /maxsim:progressView detailed progress
230
211
 
231
212
  Or describe what you'd like to do:
232
213
  ```
233
214
 
234
- **Contextual filtering rules:**
235
- - If phases are "In Progress" on GitHub: show execute options prominently
236
- - If all phases are "Done" on GitHub: show `/maxsim:progress` (offers milestone completion)
237
- - If recent git activity suggests debugging: show `/maxsim:debug` prominently
238
- - If no phases exist on board: show `/maxsim:plan` prominently
239
- - Always include `/maxsim:quick` as it is always relevant
240
- - Always include an open-ended fallback ("Or describe what you'd like to do")
241
- - If GitHub not available (CLI calls fail): show error: "GitHub integration required. Run `/maxsim:init` to configure GitHub." Do NOT fall back to local file scanning.
215
+ **Filtering rules:**
216
+
217
+ - Show `/maxsim:execute {N}` only if an in-progress phase exists on GitHub
218
+ - Show `/maxsim:plan {N}` only if an unstarted phase exists on GitHub
219
+ - Show `/maxsim:progress` if all phases are Done
220
+ - Always show `/maxsim:quick`
221
+ - Always include the open-ended fallback
242
222
 
243
- Wait for user selection, then dispatch the chosen command.
223
+ Wait for user selection, then invoke the Skill tool for the chosen command.
244
224
  </step>
245
225
 
246
226
  </process>
247
227
 
248
228
  <constraints>
229
+ - Tool name is Agent (NOT Task)
230
+ - No SlashCommand tool — use the Skill tool to invoke commands
231
+ - GitHub Issues is the SOLE source of truth for phase state
232
+ - No local .planning/ directory references anywhere
233
+ - Use `node ~/.claude/maxsim/bin/maxsim-tools.cjs` for all CLI operations
249
234
  - Never ask for confirmation before dispatching (Show + Act, not Show + Ask)
250
235
  - Always surface problems BEFORE suggesting actions
251
- - All problems block — no severity tiers, no "warnings"
236
+ - All problems are blocking — no warnings, no severity tiers
252
237
  - No arguments accepted — this is pure auto-detection
253
- - No mention of old commands (plan, execute-phase, etc.)
254
- - Keep initial feedback fastshow "Analyzing..." before heavy operations
255
- - Primary source for phase state: live GitHub (`github status`)
256
- - Local reads: STATE.md for blockers/decisions, ROADMAP.md for phase ordering only
257
- - If context gathering fails (tools not available, etc.), fall back to the interactive menu
238
+ - Show "Analyzing..." before heavy operations
239
+ - If GitHub is unavailable, fail explicitly do not fall back to local files
258
240
  </constraints>
259
- </output>
@@ -1,156 +1,113 @@
1
1
  <purpose>
2
- Validate `.planning/` directory integrity and report actionable issues. Checks for missing files, invalid configurations, inconsistent state, and orphaned plans. Optionally repairs auto-fixable issues.
2
+ Verify MaxsimCLI installation and GitHub connectivity. Report the status of each check with actionable fix instructions.
3
3
  </purpose>
4
4
 
5
- <required_reading>
6
- Read all files referenced by the invoking prompt's execution_context before starting.
7
- </required_reading>
8
-
9
5
  <process>
10
6
 
11
- <step name="parse_args">
12
- **Parse arguments:**
13
-
14
- Check if `--repair` flag is present in the command arguments.
15
-
16
- ```
17
- REPAIR_FLAG=""
18
- if arguments contain "--repair"; then
19
- REPAIR_FLAG="--repair"
20
- fi
21
- ```
22
- </step>
7
+ ## Step 1: Check .claude/ directory structure
23
8
 
24
- <step name="run_health_check">
25
- **Run health validation:**
9
+ Verify the required files exist:
26
10
 
27
11
  ```bash
28
- node ~/.claude/maxsim/bin/maxsim-tools.cjs validate health $REPAIR_FLAG
12
+ node ~/.claude/maxsim/bin/maxsim-tools.cjs validate structure
29
13
  ```
30
14
 
31
- Parse JSON output:
32
- - `status`: "healthy" | "degraded" | "broken"
33
- - `errors[]`: Critical issues (code, message, fix, repairable)
34
- - `warnings[]`: Non-critical issues
35
- - `info[]`: Informational notes
36
- - `repairable_count`: Number of auto-fixable issues
37
- - `repairs_performed[]`: Actions taken if --repair was used
38
- </step>
15
+ Expected checks:
16
+ - `~/.claude/` directory exists
17
+ - `~/.claude/maxsim/` directory exists
18
+ - `~/.claude/maxsim/bin/maxsim-tools.cjs` exists
19
+ - `~/.claude/maxsim/config.json` exists (or create with defaults)
39
20
 
40
- <step name="format_output">
41
- **Format and display results:**
21
+ Record PASS/FAIL for each.
42
22
 
43
- ```
44
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
45
- MAXSIM Health Check
46
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
23
+ ---
47
24
 
48
- Status: HEALTHY | DEGRADED | BROKEN
49
- Errors: N | Warnings: N | Info: N
50
- ```
25
+ ## Step 2: Check gh CLI
51
26
 
52
- **If repairs were performed:**
27
+ ```bash
28
+ gh --version
53
29
  ```
54
- ## Repairs Performed
55
30
 
56
- - config.json: Created with defaults
57
- - ✓ STATE.md: Regenerated from roadmap
58
- ```
31
+ If not found: FAIL "gh CLI not installed. Install from: https://cli.github.com"
59
32
 
60
- **If errors exist:**
33
+ ```bash
34
+ gh auth status
61
35
  ```
62
- ## Errors
63
36
 
64
- - [E001] config.json: JSON parse error at line 5
65
- Fix: Run /maxsim:progress (health check) --repair to reset to defaults
37
+ If not authenticated: FAIL "Not authenticated. Run: gh auth login"
66
38
 
67
- - [E002] PROJECT.md not found
68
- Fix: Run /maxsim:init to create
69
- ```
39
+ Record PASS/FAIL.
70
40
 
71
- **If warnings exist:**
72
- ```
73
- ## Warnings
41
+ ---
74
42
 
75
- - [W001] STATE.md references phase 5, but only phases 1-3 exist
76
- Fix: Run /maxsim:progress (health check) --repair to regenerate
43
+ ## Step 3: Check GitHub repo
77
44
 
78
- - [W005] Phase directory "1-setup" doesn't follow NN-name format
79
- Fix: Rename to match pattern (e.g., 01-setup)
45
+ ```bash
46
+ node ~/.claude/maxsim/bin/maxsim-tools.cjs github status
80
47
  ```
81
48
 
82
- **If info exists:**
83
- ```
84
- ## Info
49
+ If the command returns an error:
50
+ - Check if the current directory is a git repo: `git remote get-url origin`
51
+ - If no remote: FAIL — "No GitHub remote found. Add one or run /maxsim:init in a GitHub repo."
52
+ - If remote exists but API fails: FAIL — "GitHub API unreachable. Check: gh auth status"
85
53
 
86
- - [I001] 02-implementation/02-01-PLAN.md has no SUMMARY.md
87
- Note: May be in progress
88
- ```
54
+ Record PASS/FAIL.
89
55
 
90
- **Footer (if repairable issues exist and --repair was NOT used):**
91
- ```
92
56
  ---
93
- N issues can be auto-repaired. Run: /maxsim:progress (health check) --repair
94
- ```
95
- </step>
96
57
 
97
- <step name="offer_repair">
98
- **If repairable issues exist and --repair was NOT used:**
58
+ ## Step 4: Check project board
59
+
60
+ From the `github status` output, verify a project board is configured.
61
+
62
+ If no project board: WARN — "No GitHub Project board linked. Run /maxsim:init to configure."
99
63
 
100
- Ask user if they want to run repairs:
64
+ Record PASS/WARN/FAIL.
65
+
66
+ ---
67
+
68
+ ## Step 5: Report results
101
69
 
102
70
  ```
103
- Would you like to run /maxsim:progress (health check) --repair to fix N issues automatically?
71
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
72
+ MAXSIM ► HEALTH CHECK
73
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
74
+
75
+ | Check | Status | Notes |
76
+ |------------------------------|--------|-------|
77
+ | .claude/ structure | PASS | |
78
+ | maxsim-tools.cjs present | PASS | |
79
+ | gh CLI installed | PASS | v2.x |
80
+ | gh CLI authenticated | PASS | user@github.com |
81
+ | GitHub repo accessible | PASS | org/repo |
82
+ | Project board linked | PASS | Project #N |
83
+
84
+ Overall: HEALTHY / DEGRADED / BROKEN
104
85
  ```
105
86
 
106
- If yes, re-run with --repair flag and display results.
107
- </step>
87
+ **If any check FAILed**, list fix instructions after the table:
88
+
89
+ ```
90
+ ## Issues Found
108
91
 
109
- <step name="verify_repairs">
110
- **If repairs were performed:**
92
+ - [Check Name]: [Error message]
93
+ Fix: [exact command or instruction to resolve]
94
+ ```
111
95
 
112
- Re-run health check without --repair to confirm issues are resolved:
96
+ **If all checks PASS:**
113
97
 
114
- ```bash
115
- node ~/.claude/maxsim/bin/maxsim-tools.cjs validate health
116
98
  ```
99
+ All systems operational. MAXSIM is ready to use.
117
100
 
118
- Report final status.
119
- </step>
101
+ Run /maxsim:go to resume your project.
102
+ ```
120
103
 
121
104
  </process>
122
105
 
123
- <error_codes>
124
-
125
- | Code | Severity | Description | Repairable |
126
- |------|----------|-------------|------------|
127
- | E001 | error | .planning/ directory not found | No |
128
- | E002 | error | PROJECT.md not found | No |
129
- | E003 | error | ROADMAP.md not found | No |
130
- | E004 | error | STATE.md not found | Yes |
131
- | E005 | error | config.json parse error | Yes |
132
- | W001 | warning | PROJECT.md missing required section | No |
133
- | W002 | warning | STATE.md references invalid phase | Yes |
134
- | W003 | warning | config.json not found | Yes |
135
- | W004 | warning | config.json invalid field value | No |
136
- | W005 | warning | Phase directory naming mismatch | No |
137
- | W006 | warning | Phase in ROADMAP but no directory | No |
138
- | W007 | warning | Phase on disk but not in ROADMAP | No |
139
- | I001 | info | Plan without SUMMARY (may be in progress) | No |
140
-
141
- </error_codes>
142
-
143
- <repair_actions>
144
-
145
- | Action | Effect | Risk |
146
- |--------|--------|------|
147
- | createConfig | Create config.json with defaults | None |
148
- | resetConfig | Delete + recreate config.json | Loses custom settings |
149
- | regenerateState | Create STATE.md from ROADMAP structure | Loses session history |
150
-
151
- **Not repairable (too risky):**
152
- - PROJECT.md, ROADMAP.md content
153
- - Phase directory renaming
154
- - Orphaned plan cleanup
155
-
156
- </repair_actions>
106
+ <success_criteria>
107
+ - [ ] .claude/ directory structure verified
108
+ - [ ] gh CLI installation and authentication checked
109
+ - [ ] GitHub repo accessibility confirmed
110
+ - [ ] Project board existence confirmed
111
+ - [ ] Status of each check reported with fix instructions for failures
112
+ - [ ] Overall health status (HEALTHY / DEGRADED / BROKEN) displayed
113
+ </success_criteria>