Repository navigation
Research: the Mikado Method for refactoring - #228
Draft
mxriverlynn wants to merge 3 commits into
Draft
mxriverlynn wants to merge 3 commits into
mxriverlynn wants to merge 3 commits into
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
2 of 3 tasks
mxriverlynn
added a commit
that referenced
this pull request
Oct 15, 2026
## Summary The refactor skill's red-step revert could throw away finished work. **The bug.** On a red suite, the skill ran `git checkout`/`git restore` on the touched files whenever git was available and the tree was clean *at the start of the run*. Commits during a run only happen if you ask for them, and even then can be grouped. Git restores a file to its last commit, so when two steps touch the same file with no commit between them, reverting the second step also discarded the first, already-green step. That contradicted the skill's own stop-rule promise that "everything already applied is green and stands." **The fix.** A red step now undoes only its own edits directly: reverse each edit, delete any file the step created, and move renamed or moved files back. The skill never restores files from git to undo a step, never runs `git reset --hard`, `git clean`, or `git stash` for it, and re-runs the suite to show the revert is back to green. ## Changes - `han-coding/skills/refactor/SKILL.md`: Step 4, item 4 rewritten. - `han-coding/docs/skills/refactor.md`: the "what you get" bullet now says a revert touches only that step's edits. Found during the Mikado Method research in #228. That research's Mikado recommendations are deliberately out of scope here. ## Test plan - [x] `npm run lint` passes - [x] `npm test` passes - [ ] Manual: run `/refactor` on a target where two planned steps edit the same file, with no commits requested, and force the second step red; confirm the first step's change survives the revert. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Research report on whether, and how, to add the Mikado Method to
han-coding:refactor, produced with/han-research:research(medium band, strict evidence mode, adversarially validated).docs/research/mikado-method-refactor.mdFindings
plan-a-change, or as a separate skill). Its discover-by-breaking loop conflicts with three rules the skill rests on: plan before editing, scope as a contract, and stop after two undos.Confidence: Medium. The Mikado evidence is practitioner accounts only, with no measured studies, and nothing in the repo shows people hitting the scope stop today.
No skill or doc changes yet. This PR carries the research only.
🤖 Generated with Claude Code