maxsimcli 4.13.0 → 4.15.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.
@@ -25,7 +25,7 @@ INIT=$(node .claude/maxsim/bin/maxsim-tools.cjs init execute-phase "$PHASE")
25
25
 
26
26
  Parse `$ARGUMENTS` for: phase number (required), `--worktrees` (force worktree mode), `--no-worktrees` (force standard mode), `--auto` (auto-advance), `--gaps-only` (gap plans only).
27
27
 
28
- Parse JSON for: `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `plans`, `incomplete_plans`, `plan_count`, `incomplete_count`, `has_verification`, `commit_docs`, `executor_model`, `verifier_model`, `parallelization`, `state_path`, `roadmap_path`, `requirements_path`, `phase_req_ids`.
28
+ Parse JSON for: `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `plans`, `incomplete_plans`, `plan_count`, `incomplete_count`, `has_verification`, `commit_docs`, `executor_model`, `verifier_model`, `parallelization`, `state_path`, `roadmap_path`, `requirements_path`, `phase_req_ids`, `phase_issue_number`, `task_mappings`.
29
29
 
30
30
  All flags from `$ARGUMENTS` are passed through to the execute-phase workflow steps so they are available for execution mode decision and auto-advance detection.
31
31
 
@@ -37,7 +37,16 @@ Use /maxsim:progress to see available phases.
37
37
  ```
38
38
  Exit workflow.
39
39
 
40
- **If `plan_count` is 0:**
40
+ **If `plan_count` is 0 (GitHub check):**
41
+
42
+ When GitHub integration is active (phase_issue_number is set), check for plan comments on the phase issue before reporting no plans:
43
+
44
+ ```
45
+ mcp_get_issue_detail(issue_number: phase_issue_number)
46
+ ```
47
+
48
+ Parse the response to find comments with `<!-- maxsim:type=plan -->` markers or `## Plan NN` headings. If no plan comments are found:
49
+
41
50
  ```
42
51
  No plans found for Phase {phase_number}.
43
52
 
@@ -47,6 +56,58 @@ Exit workflow.
47
56
 
48
57
  ## 2. Detect State
49
58
 
59
+ ### 2a. Load Plan Inventory from GitHub
60
+
61
+ When GitHub integration is active (`phase_issue_number` is set):
62
+
63
+ 1. Fetch the phase issue and its comments:
64
+ ```
65
+ mcp_get_issue_detail(issue_number: phase_issue_number)
66
+ ```
67
+
68
+ 2. Parse issue comments to identify plan comments. A plan comment is one that contains either:
69
+ - A `<!-- maxsim:type=plan -->` HTML comment marker, OR
70
+ - A heading matching `## Plan NN` (where NN is a number)
71
+
72
+ 3. For each plan comment found:
73
+ - Extract the plan number (from the `## Plan NN` heading or frontmatter)
74
+ - Parse YAML frontmatter from the comment body for: `wave`, `dependencies`, `autonomous`, `objective`, `gap_closure`
75
+ - Store plan content in memory as `PLAN_COMMENTS[]`
76
+
77
+ 4. Check completion status for each plan by calling:
78
+ ```
79
+ mcp_list_sub_issues(issue_number: phase_issue_number)
80
+ ```
81
+ A plan is considered complete when ALL of its task sub-issues are closed (state: closed).
82
+ Additionally, check for `<!-- maxsim:type=summary -->` comments on the phase issue as a secondary completion signal.
83
+
84
+ 5. Build `plan_inventory` from GitHub data:
85
+ - `plans[]`: each with `id`, `wave`, `autonomous`, `objective`, `has_summary` (derived from sub-issue closure)
86
+ - `incomplete_plans[]`: plans where not all task sub-issues are closed
87
+ - `plan_count`: total plan comments found
88
+ - `incomplete_count`: count of incomplete plans
89
+
90
+ When GitHub integration is NOT active (no `phase_issue_number`), fall back to local file scanning:
91
+ ```bash
92
+ PLAN_INDEX=$(node .claude/maxsim/bin/maxsim-tools.cjs phase-plan-index "${PHASE_NUMBER}")
93
+ ```
94
+
95
+ ### 2b. Check for External Edits (WIRE-06)
96
+
97
+ If phase_issue_number is set, optionally detect whether the phase issue was externally modified since last read:
98
+
99
+ ```
100
+ mcp_detect_external_edits(issue_number: phase_issue_number)
101
+ ```
102
+
103
+ If external edits are detected: warn the user before proceeding.
104
+ ```
105
+ ⚠️ Phase issue #{phase_issue_number} was modified externally since last check.
106
+ Review the changes before continuing? (yes/no)
107
+ ```
108
+
109
+ ### 2c. Determine Execution State
110
+
50
111
  Determine where to start based on phase artifacts:
51
112
 
52
113
  | Condition | State | Action |
@@ -72,20 +133,20 @@ Display:
72
133
 
73
134
  **Plans:** {plan_count} plan(s) -- all complete
74
135
  **Verification:** Passed
75
- **Phase directory:** {phase_dir}
136
+ **Phase issue:** #{phase_issue_number} (if GitHub active)
76
137
 
77
138
  **Options:**
78
- 1. View results -- show SUMMARY.md files and verification report
79
- 2. Re-execute from scratch -- delete SUMMARYs, restart execution
80
- 3. View verification -- show VERIFICATION.md
139
+ 1. View results -- show plan summaries from GitHub comments
140
+ 2. Re-execute from scratch -- reopen task sub-issues and restart execution
141
+ 3. View verification -- show verification comment on phase issue
81
142
  4. Done (exit)
82
143
  ```
83
144
 
84
145
  Wait for user choice via natural conversation.
85
146
 
86
- - **View results:** Display contents of each SUMMARY.md file, then re-show options.
87
- - **Re-execute:** Delete existing SUMMARY.md files, restart from Execute Plans (step 4).
88
- - **View verification:** Display VERIFICATION.md contents, then re-show options.
147
+ - **View results:** Fetch and display summary comments (`<!-- maxsim:type=summary -->`) from the phase issue, then re-show options.
148
+ - **Re-execute:** Reopen task sub-issues via `mcp_reopen_issue` for each task sub-issue, restart from Execute Plans (step 4).
149
+ - **View verification:** Fetch and display the verification comment (`<!-- maxsim:type=verification -->`) from the phase issue, then re-show options.
89
150
  - **Done:** Exit workflow.
90
151
 
91
152
  ## 4. Execute Plans
@@ -94,13 +155,7 @@ Execute all plans in wave order, delegating each plan to a subagent via execute-
94
155
 
95
156
  ### 4.1 Discover and Group Plans
96
157
 
97
- Load plan inventory with wave grouping:
98
-
99
- ```bash
100
- PLAN_INDEX=$(node .claude/maxsim/bin/maxsim-tools.cjs phase-plan-index "${PHASE_NUMBER}")
101
- ```
102
-
103
- Parse JSON for: `plans[]` (each with `id`, `wave`, `autonomous`, `objective`, `has_summary`), `waves` (map of wave number to plan IDs), `incomplete`.
158
+ Use the plan inventory built in step 2 (from GitHub comments or local files).
104
159
 
105
160
  Skip plans where `has_summary: true` (already complete -- supports resume).
106
161
 
@@ -141,7 +196,7 @@ Execute each wave in sequence. Within a wave: parallel if `parallelization` is t
141
196
 
142
197
  2. **Spawn executor agents:**
143
198
 
144
- Pass paths only -- executors read files themselves with their fresh 200k context.
199
+ Pass plan content and GitHub context -- executors read the plan from GitHub comment content passed in the prompt.
145
200
 
146
201
  ```
147
202
  Task(
@@ -150,7 +205,8 @@ Execute each wave in sequence. Within a wave: parallel if `parallelization` is t
150
205
  prompt="
151
206
  <objective>
152
207
  Execute plan {plan_number} of phase {phase_number}-{phase_name}.
153
- Commit each task atomically. Create SUMMARY.md. Update STATE.md and ROADMAP.md.
208
+ Commit each task atomically. Post SUMMARY as GitHub comment. Update STATE.md and ROADMAP.md.
209
+ Move task sub-issues on the board as you work (In Progress → Done per task).
154
210
  </objective>
155
211
 
156
212
  <execution_context>
@@ -160,9 +216,14 @@ Execute each wave in sequence. Within a wave: parallel if `parallelization` is t
160
216
  @./references/tdd.md
161
217
  </execution_context>
162
218
 
219
+ <github_context>
220
+ Phase issue number: {phase_issue_number}
221
+ Plan comment: {plan_comment_body}
222
+ Task mappings: {task_mappings_for_this_plan}
223
+ </github_context>
224
+
163
225
  <files_to_read>
164
226
  Read these files at execution start using the Read tool:
165
- - {phase_dir}/{plan_file} (Plan)
166
227
  - .planning/STATE.md (State)
167
228
  - .planning/config.json (Config, if exists)
168
229
  - ./CLAUDE.md (Project instructions, if exists)
@@ -171,7 +232,8 @@ Execute each wave in sequence. Within a wave: parallel if `parallelization` is t
171
232
  <success_criteria>
172
233
  - [ ] All tasks executed
173
234
  - [ ] Each task committed individually
174
- - [ ] SUMMARY.md created in plan directory
235
+ - [ ] Summary posted as GitHub comment (mcp_post_comment with type=summary) on phase issue
236
+ - [ ] Task sub-issues moved: In Progress when started, Done when completed
175
237
  - [ ] STATE.md updated with position and decisions
176
238
  - [ ] ROADMAP.md updated with plan progress
177
239
  </success_criteria>
@@ -183,11 +245,12 @@ Execute each wave in sequence. Within a wave: parallel if `parallelization` is t
183
245
 
184
246
  4. **Spot-check results:**
185
247
 
186
- For each completed plan's SUMMARY.md:
187
- - Verify first 2 files from key-files exist on disk
248
+ For each completed plan:
249
+ - Check that a `<!-- maxsim:type=summary -->` comment exists on the phase issue for this plan
188
250
  - Check `git log --oneline --all --grep="{phase}-{plan}"` returns at least 1 commit
189
- - Check for `## Self-Check: FAILED` marker
190
- - Check for `## Review Cycle` section -- verify both Spec and Code stages show PASS
251
+ - Verify task sub-issues for this plan are all closed
252
+ - Check for `## Self-Check: FAILED` in the summary comment body
253
+ - Check for `## Review Cycle` section in summary -- verify both Spec and Code stages show PASS
191
254
 
192
255
  If ANY spot-check fails: report which plan failed, ask "Retry plan?" or "Continue with remaining waves?"
193
256
 
@@ -198,7 +261,7 @@ Execute each wave in sequence. Within a wave: parallel if `parallelization` is t
198
261
  ## Wave {N} Complete
199
262
 
200
263
  **{Plan ID}: {Plan Name}**
201
- {What was built -- from SUMMARY.md}
264
+ {What was built -- from summary comment}
202
265
  {Notable deviations, if any}
203
266
 
204
267
  {If more waves: what this enables for next wave}
@@ -218,7 +281,7 @@ After all waves complete:
218
281
 
219
282
  **Plans executed:** {completed}/{total}
220
283
  **Waves:** {wave_count}
221
- **Commits:** {list of commit summaries from SUMMARY.md files}
284
+ **Commits:** {list of commit summaries from summary comments}
222
285
 
223
286
  Proceeding to verification...
224
287
  ```
@@ -241,11 +304,13 @@ VERIFIER_MODEL=$(node .claude/maxsim/bin/maxsim-tools.cjs resolve-model verifier
241
304
  Task(
242
305
  prompt="Verify phase {phase_number} goal achievement.
243
306
  Phase directory: {phase_dir}
307
+ Phase issue: #{phase_issue_number}
244
308
  Phase goal: {goal from ROADMAP.md}
245
309
  Phase requirement IDs: {phase_req_ids}
246
310
  Check must_haves against actual codebase.
247
- Cross-reference requirement IDs from PLAN frontmatter against REQUIREMENTS.md.
248
- Create VERIFICATION.md.",
311
+ Cross-reference requirement IDs from plan frontmatter against REQUIREMENTS.md.
312
+ Post verification results as a GitHub comment (mcp_post_comment with type=verification) on the phase issue.
313
+ Also write VERIFICATION.md to the phase directory for local reference.",
249
314
  subagent_type="verifier",
250
315
  model="{verifier_model}"
251
316
  )
@@ -253,7 +318,15 @@ Create VERIFICATION.md.",
253
318
 
254
319
  ### 5.2 Parse Verifier Result
255
320
 
256
- Read verification status:
321
+ Read verification status from the verification comment on the phase issue:
322
+
323
+ ```
324
+ mcp_get_issue_detail(issue_number: phase_issue_number)
325
+ ```
326
+
327
+ Look for the `<!-- maxsim:type=verification -->` comment and parse the `status:` field from its body.
328
+
329
+ Also fall back to reading locally:
257
330
  ```bash
258
331
  grep "^status:" "$PHASE_DIR"/*-VERIFICATION.md | cut -d: -f2 | tr -d ' '
259
332
  ```
@@ -264,11 +337,25 @@ grep "^status:" "$PHASE_DIR"/*-VERIFICATION.md | cut -d: -f2 | tr -d ' '
264
337
  ## Gate: Verification Passed
265
338
 
266
339
  **Status:** All must-haves verified
267
- **Evidence:** {summary from VERIFICATION.md}
340
+ **Evidence:** {summary from verification comment}
268
341
 
269
342
  Phase {phase_number} complete!
270
343
  ```
271
344
 
345
+ Move phase issue to "Done" status:
346
+ ```
347
+ mcp_move_issue(issue_number: phase_issue_number, status: "Done")
348
+ ```
349
+
350
+ Post phase completion comment:
351
+ ```
352
+ mcp_post_comment(
353
+ issue_number: phase_issue_number,
354
+ type: "phase-complete",
355
+ body: "## Phase {phase_number} Complete\n\nAll plans executed and verified.\n\n**Plans:** {completed}/{total}\n**Waves:** {wave_count}\n**Verification:** Passed"
356
+ )
357
+ ```
358
+
272
359
  Mark phase complete:
273
360
  ```bash
274
361
  COMPLETION=$(node .claude/maxsim/bin/maxsim-tools.cjs phase complete "${PHASE_NUMBER}")
@@ -279,7 +366,15 @@ Update tracking files:
279
366
  node .claude/maxsim/bin/maxsim-tools.cjs commit "docs(phase-{X}): complete phase execution" --files .planning/ROADMAP.md .planning/STATE.md .planning/REQUIREMENTS.md {phase_dir}/*-VERIFICATION.md
280
367
  ```
281
368
 
282
- **If `gaps_found`:** Proceed to Retry Loop (step 6).
369
+ **If `gaps_found`:** Post a gaps comment on the phase issue, then proceed to Retry Loop (step 6).
370
+
371
+ ```
372
+ mcp_post_comment(
373
+ issue_number: phase_issue_number,
374
+ type: "verification-gaps",
375
+ body: "## Verification Gaps Found\n\n{gap summaries from verification result}"
376
+ )
377
+ ```
283
378
 
284
379
  **If `human_needed`:** Present items for human testing, get approval or feedback. If approved, treat as passed. If issues reported, proceed to Retry Loop.
285
380
 
@@ -299,7 +394,7 @@ If `attempt_count > 2`:
299
394
  **Attempts:** 3 (initial + 2 retries)
300
395
 
301
396
  ### What Failed
302
- {List of unresolved gaps from VERIFICATION.md with evidence}
397
+ {List of unresolved gaps from verification comment with evidence}
303
398
 
304
399
  ### Options
305
400
  1. Fix manually and re-run `/maxsim:execute {phase_number}`
@@ -332,6 +427,7 @@ Task(
332
427
  <downstream_consumer>
333
428
  Output consumed by /maxsim:execute.
334
429
  Plans must be executable prompts.
430
+ Post gap-closure plans as comments on phase issue #{phase_issue_number} using mcp_post_comment with type=plan.
335
431
  </downstream_consumer>
336
432
  ",
337
433
  subagent_type="planner",
@@ -341,7 +437,7 @@ Plans must be executable prompts.
341
437
 
342
438
  ### 6.3 Execute Gap Plans
343
439
 
344
- Execute the newly created gap-closure plans using the same wave execution logic from step 4. Only execute plans with `gap_closure: true` in frontmatter.
440
+ After the planner posts gap-closure plan comments on the phase issue, re-read the phase issue to discover the new plan comments. Execute the newly created gap-closure plans using the same wave execution logic from step 4. Only execute plans with `gap_closure: true` in frontmatter.
345
441
 
346
442
  ### 6.4 Re-verify
347
443
 
@@ -356,12 +452,11 @@ At any point during the workflow, if context is getting full (conversation is lo
356
452
 
357
453
  **Checkpoint protocol:**
358
454
  1. Post a checkpoint comment to the phase's GitHub Issue (if issue tracking is active):
359
- ```bash
360
- # Use MCP tool to post checkpoint
361
- mcp_post_plan_comment(
362
- phase_issue_number={issue_number},
363
- plan_number="checkpoint",
364
- plan_content="## MAXSIM Checkpoint\n\n**Command:** /maxsim:execute\n**Stage:** {current_stage}\n**Plans completed:** {completed_count}/{total_count}\n**Verification attempts:** {attempt_count}/3\n**Resume from:** {next_action}\n**Timestamp:** {ISO timestamp}"
455
+ ```
456
+ mcp_post_comment(
457
+ issue_number: phase_issue_number,
458
+ type: "checkpoint",
459
+ body: "## MAXSIM Checkpoint\n\n**Command:** /maxsim:execute\n**Stage:** {current_stage}\n**Plans completed:** {completed_count}/{total_count}\n**Verification attempts:** {attempt_count}/3\n**Resume from:** {next_action}\n**Timestamp:** {ISO timestamp}"
365
460
  )
366
461
  ```
367
462
 
@@ -369,10 +464,10 @@ mcp_post_plan_comment(
369
464
  ```
370
465
  Context is filling up. Recommended: save progress and /clear.
371
466
 
372
- Your progress has been checkpointed. Re-run `/maxsim:execute {phase_number}` after /clear -- it will detect completed plans and resume from where it left off.
467
+ Your progress has been checkpointed on GitHub issue #{phase_issue_number}. Re-run `/maxsim:execute {phase_number}` after /clear -- it will detect completed plans (via closed task sub-issues) and resume from where it left off.
373
468
  ```
374
469
 
375
- The state detection in step 2 handles resume automatically -- completed plans have SUMMARY.md files that are detected on re-entry.
470
+ The state detection in step 2 handles resume automatically -- completed plans have all their task sub-issues closed, which is detected on re-entry.
376
471
 
377
472
  ## 8. Update State
378
473
 
@@ -394,10 +489,11 @@ Display final results:
394
489
  **Plans:** {completed}/{total} complete
395
490
  **Waves:** {wave_count}
396
491
  **Verification:** Passed (attempt {attempt_count}/3)
492
+ **Phase issue:** #{phase_issue_number} (closed)
397
493
 
398
494
  ### Plan Details
399
- 1. **{plan_id}**: {one-liner from SUMMARY.md}
400
- 2. **{plan_id}**: {one-liner from SUMMARY.md}
495
+ 1. **{plan_id}**: {one-liner from summary comment}
496
+ 2. **{plan_id}**: {one-liner from summary comment}
401
497
 
402
498
  ### Next Steps
403
499
  - `/maxsim:plan {next_phase}` -- Plan next phase
@@ -408,14 +504,17 @@ Display final results:
408
504
 
409
505
  <success_criteria>
410
506
  - [ ] Phase validated against roadmap
411
- - [ ] Current state correctly detected from artifacts
507
+ - [ ] Plan inventory loaded from GitHub issue comments (falling back to local files if no GitHub integration)
508
+ - [ ] External edit detection warns user if phase issue was modified externally
509
+ - [ ] Current state correctly detected from task sub-issue closure and summary comments
412
510
  - [ ] Re-entry flow works for already-executed phases
413
- - [ ] Plans discovered and grouped by wave
414
- - [ ] Per-plan execution delegates to execute-plan.md sub-workflow via Task
415
- - [ ] Spot-check of SUMMARY.md after each wave
511
+ - [ ] Plans discovered from GitHub comments and grouped by wave
512
+ - [ ] Per-plan execution delegates to execute-plan.md sub-workflow via Task with GitHub context
513
+ - [ ] Spot-check reads summary comments and checks sub-issue closure instead of local SUMMARY.md
416
514
  - [ ] Gate confirmation shown after execution completes
417
- - [ ] Auto-verification spawns verifier agent
515
+ - [ ] Auto-verification spawns verifier agent that posts to GitHub
516
+ - [ ] Phase issue moved to Done on verification pass
418
517
  - [ ] Retry loop with gap closure (max 2 retries, 3 total attempts)
419
- - [ ] Checkpoint-before-clear pattern available
420
- - [ ] No references to old commands (execute-phase, verify-work)
518
+ - [ ] Checkpoint-before-clear posts to GitHub issue
519
+ - [ ] No references to old SUMMARY.md local file checks for completion detection
421
520
  </success_criteria>
@@ -592,7 +592,7 @@ INIT=$(node ~/.claude/maxsim/bin/maxsim-tools.cjs init todos)
592
592
  mkdir -p .planning/todos/pending .planning/todos/done
593
593
  ```
594
594
 
595
- Extract from init JSON: `todo_count`, `todos`, `pending_dir`, `date`, `timestamp`.
595
+ Extract from init JSON: `todo_count`, `todos`, `pending_dir`, `date`, `timestamp`, `github_ready`.
596
596
 
597
597
  ---
598
598
 
@@ -669,7 +669,9 @@ files: []
669
669
  TBD
670
670
  ```
671
671
 
672
- 5. Best-effort GitHub Issue with 'todo' label: `node ~/.claude/maxsim/bin/maxsim-tools.cjs todos add "$TITLE" "$PRIORITY" 2>/dev/null || true`
672
+ 5. Best-effort GitHub Issue creation:
673
+ - Always attempt: `node ~/.claude/maxsim/bin/maxsim-tools.cjs todos add "$TITLE" "$PRIORITY" 2>/dev/null || true`
674
+ - If `github_ready` is true in init context: also call `mcp_create_todo_issue` with title, priority, area, and description to create a tracked GitHub Issue linked to the todo file
673
675
  6. Commit: `node ~/.claude/maxsim/bin/maxsim-tools.cjs commit "docs: capture todo - ${TITLE}" --files .planning/todos/pending/${date}-${slug}.md`
674
676
  7. Confirm: "Saved: ${TITLE} (priority: ${PRIORITY})"
675
677
 
package/dist/install.cjs CHANGED
@@ -7295,6 +7295,7 @@ const builtInSkills = [
7295
7295
  "agent-system-map",
7296
7296
  "commit-conventions",
7297
7297
  "evidence-collection",
7298
+ "github-artifact-protocol",
7298
7299
  "handoff-contract",
7299
7300
  "input-validation",
7300
7301
  "research-methodology",