Skip to content

Add the restructure skill, with the Mikado Method for stalled units - #232

Merged
mxriverlynn merged 8 commits into
v6.0.0-betafrom
restructure-skill
Oct 27, 2026
Merged

mxriverlynn merged 8 commits into
v6.0.0-betafrom
restructure-skill

Conversation

@mxriverlynn

@mxriverlynn mxriverlynn commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This PR adds a restructure skill that reorganizes a codebase toward a target layout one committed unit at a time, so that a large restructure can run unattended without changing behavior.

Behavior changes

The new han-coding:restructure skill coordinates the work and leaves the code changes to existing skills. You state a goal, such as "group each package by feature." The skill discovers the project's layout, commands, test roots, and documented structure rules at runtime, so it works on any codebase. It shows all of that at one start gate and then asks nothing further. After you confirm, it runs architectural-analysis, plans ordered units, and hands each unit to refactor or tdd. Each green unit is committed on the current branch, and every decision goes into a change log with its justification. The skill never pushes, never switches branches, and never edits a test to make a unit pass.

When a unit stalls because its code is too tangled to move in one step, the skill switches to the Mikado Method. It tries the change, records what breaks as prerequisites in a graph committed to the repo, undoes the attempt, and does the prerequisites first. A bundled undo-attempt.sh script restores the tree to the last commit. It refuses to run if HEAD has moved, and it removes only untracked files that git does not ignore, which is why the skill requires a clean tree at the start. Discovery stops after five rounds per stalled unit by default; the unit is then logged as not done and its dependents are skipped.

Three existing skills route work differently. pairing can now drive restructure, stopping after each unit so you can review the commit. The descriptions of refactor and plan-a-change now point to restructure for whole-area work. han-coding gains no dependency on han-planning: when plan-a-change is not installed, restructure writes the unit plan itself and records that in the change log. The research report behind the design is included at docs/research/mikado-method-skill.md.

mxriverlynn and others added 7 commits October 27, 2026 08:32
…r stalled units

Coordinates architectural-analysis, plan-a-change (or its own plan when
han-planning is absent), and refactor or tdd per unit, after one start
gate. A unit that stalls becomes the goal of a Mikado graph: attempt,
record prerequisites, undo with undo-attempt.sh, and work leaves first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d workflow map

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and plan-a-change to it

Adds restructure to pairing's flagged skills and to the collaborative-stop
rule (canonical and both vendored copies, still byte-identical), and gives
refactor and plan-a-change routing lines toward restructure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Moves the missing-test-command case out of the hard-failure list and into
the start gate, says what happens when a Mikado leaf stalls, and renames
the test fixture's folder so no conventional source path appears.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mxriverlynn mxriverlynn changed the title Research: Mikado Method as a new restructure skill Add the restructure skill, with the Mikado Method for stalled units Oct 27, 2026
# Conflicts:
#	docs/concepts.md
#	han-planning/skills/plan-a-change/SKILL.md
@mxriverlynn
mxriverlynn marked this pull request as ready for review October 27, 2026 16:44
@mxriverlynn
mxriverlynn merged commit 4366830 into v6.0.0-beta Oct 27, 2026
2 checks passed
@mxriverlynn
mxriverlynn deleted the restructure-skill branch October 27, 2026 16:44
@mxriverlynn mxriverlynn mentioned this pull request Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant