Compact map-resume skill body#137
Conversation
There was a problem hiding this comment.
Pull request overview
This PR restructures the /map-resume skill to keep the invoked SKILL.md compact for post-compaction recovery, moving low-frequency reference material into a bundled resume-reference.md. It also adds regression tests and documentation updates to prevent the skill body from regressing in size or losing the supporting reference.
Changes:
- Externalize
/map-resumeexamples/technical notes/token budget/troubleshooting intoresume-reference.md, keepingSKILL.mdfocused on the active recovery path. - Add a skills regression test enforcing
map-resume/SKILL.mdsize and presence/linking of the supporting reference for both.claude/skillsand shipped templates. - Update README/usage/architecture + improvement-plan loop documentation to reflect the compact recovery surface and follow-up slices.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_skills.py | Adds regression enforcing compact /map-resume skill body + supporting reference presence/linking (source + templates). |
| src/mapify_cli/templates/skills/map-resume/SKILL.md | Removes long appendices from invoked body; adds links to supporting reference for examples/troubleshooting. |
| src/mapify_cli/templates/skills/map-resume/resume-reference.md | New bundled appendix holding detailed examples, integration notes, token budget, troubleshooting. |
| .claude/skills/map-resume/SKILL.md | Mirrors the compacted /map-resume skill for the source-of-truth skills directory. |
| .claude/skills/map-resume/resume-reference.md | Mirrors the supporting reference appendix in the source-of-truth skills directory. |
| README.md | Documents the new “compact recovery surface” design for /map-resume. |
| docs/USAGE.md | Updates /map-resume section to mention the compact skill + supporting reference and branch-scoped checkpoint. |
| docs/ARCHITECTURE.md | Updates /map-resume architecture table/flow to reference step_state.json and the new reference file. |
| docs/learned/testing-strategies.md | Adds a learned rule to protect compact recovery skill bodies with regression coverage. |
| docs/learned/review-checks.md | Adds a learned review check for supporting-file externalization end-to-end. |
| docs/learned/commands.md | Adds a learned command to run the new /map-resume lifecycle regression tests. |
| docs/learned/architecture-patterns.md | Adds a learned architecture pattern about externalizing recovery appendices. |
| docs/improvement-plan.md | Records 2604.033-1 execution note + adds follow-on slices for broader skill compaction/linting. |
| docs/improvement-loop-log.md | Logs the 2604.033-1 change, validations, and reusable learnings. |
| docs/improvement-done.md | Marks 2604.033-1 as done and summarizes shipped changes + validations. |
Comments suppressed due to low confidence (2)
src/mapify_cli/templates/skills/map-resume/resume-reference.md:182
- These troubleshooting steps instruct users to update
step_state.jsondirectly. Elsewhere the repo warns against direct JSON mutation because partial edits can leavecurrent_step_phase/status inconsistent (e.g..claude/skills/map-check/SKILL.mdwarns againstjq/sed). Consider replacing this guidance with orchestrator-driven recovery (e.g., re-runresume_from_plan/resume_single_subtask, or explicitly document a safe, atomic repair path) so users don’t corrupt state.
**Fix:**
1. Manually verify each subtask's actual completion status
2. Update `step_state.json` to match reality
3. Resume from corrected state
.claude/skills/map-resume/resume-reference.md:182
- These troubleshooting steps instruct users to update
step_state.jsondirectly. Elsewhere the repo warns against direct JSON mutation because partial edits can leavecurrent_step_phase/status inconsistent (e.g..claude/skills/map-check/SKILL.mdwarns againstjq/sed). Consider replacing this guidance with orchestrator-driven recovery (e.g., re-runresume_from_plan/resume_single_subtask, or explicitly document a safe, atomic repair path) so users don’t corrupt state.
**Fix:**
1. Manually verify each subtask's actual completion status
2. Update `step_state.json` to match reality
3. Resume from corrected state
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| Claude: ## No Workflow in Progress | ||
|
|
||
| No checkpoint file found at `.map/feat-auth/step_state.json`. |
There was a problem hiding this comment.
Fixed in 97847c2 by switching the example to the generic .map/<branch>/step_state.json path.
|
|
||
| Claude: ## No Workflow in Progress | ||
|
|
||
| No checkpoint file found at `.map/feat-auth/step_state.json`. |
There was a problem hiding this comment.
Fixed in 97847c2 by syncing the same generic .map/<branch>/step_state.json example into the source skill reference.
| The installed `/map-resume` skill keeps this active recovery path compact. Detailed example transcripts, state-file shape notes, token-budget notes, and troubleshooting live in `.claude/skills/map-resume/resume-reference.md` and are loaded only when the checkpoint is ambiguous or recovery fails. | ||
|
|
||
| **What you'll see:** | ||
|
|
||
| When running `/map-resume` with an existing checkpoint (`.map/progress.md`): | ||
| When running `/map-resume` with an existing branch checkpoint (`.map/<branch>/step_state.json`): |
There was a problem hiding this comment.
Fixed in 97847c2 by updating the adjacent security/manual recovery text to describe the current branch-scoped step_state.json checkpoint and call progress.md legacy where relevant.
| 1. **User runs `/map-resume`** - Explicit recovery command (no auto-injection) | ||
| 2. **Command checks checkpoint** - Tests if `.map/progress.md` exists | ||
| 3. **YAML frontmatter parsed** - WorkflowState.load() extracts machine state | ||
| 2. **Command checks checkpoint** - Tests if `.map/<branch>/step_state.json` exists | ||
| 3. **Branch state parsed** - Orchestrator state identifies the current step, phase, and subtask | ||
| 4. **Progress summary displayed** - Shows completed/remaining subtasks | ||
| 5. **User confirms Y/n** - Simple prompt, Y resumes, n clears checkpoint |
There was a problem hiding this comment.
Fixed in 97847c2 by updating the diagram and surrounding architecture wording from .map/progress.md/YAML parsing to .map/<branch>/step_state.json/orchestrator JSON parsing.
Summary
Validation