mikado

Breaks large refactorings into incremental steps using the Mikado method with revert-on-failure.

3|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/nvie/skills --skill mikado-nvie
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: mikado
Source: https://github.com/nvie/skills/tree/main/skills/mikado
Command: npx skills add https://github.com/nvie/skills --skill mikado-nvie

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Large code refactorings often fail midway, leaving a broken codebase and no clear recovery path. This Skill applies the Mikado method: set a goal, attempt changes naively, record prerequisites when something breaks, revert, and work leaf-first until the goal becomes trivial. ## Core Features & Use Cases - Graph-based state tracking: Maintains Mikado graphs as Markdown checklists in a .mikado/ directory, with a current.md symlink for the active goal and a Details section for rich node context. - Incremental main loop: Each /mikado invocation picks one actionable leaf, attempts the change, runs the project's build or tests, and either marks progress or records new prerequisites on failure. - Multiple invocation modes: Supports goal, switch, list, and later subcommands to create graphs, switch between goals, view progress, and capture non-blocking follow-ups. - Use Case: When extracting a shared utils package reveals a circular dependency, the Skill records the dependency as a prerequisite node, waits for your confirmation to revert, and guides you to resolve the leaf first. ## Quick Start Ask the AI to run /mikado goal "Extract shared utils" to create a new Mikado graph and start working through the refactoring one safe step at a time.

Frequently Asked Questions about mikado

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I break a large refactoring into small safe steps?▼

Use the Mikado method: set a goal, attempt the change naively, and when something breaks, record the missing prerequisites as child nodes, revert, and complete the leaves first. The /mikado main loop automates this cycle one leaf at a time.

How does the Mikado method handle failed refactoring attempts?▼

When a change breaks the build or tests, the Skill explains what went wrong and proposes new prerequisite nodes, but does not update the graph or revert until you explicitly confirm. You then decide whether to add prerequisites, run git checkout, or both.

Where does the Mikado graph state get stored?▼

All state lives in a .mikado/ directory at the repository root, with one Markdown file per goal and a current.md symlink pointing to the active graph. The directory is added to .git/info/exclude so the project's .gitignore stays untouched.

Does the Mikado workflow commit or revert changes automatically?▼

No. The Skill never commits, reverts, amends, or rebases autonomously. After a successful leaf it waits for you to review and commit, and after a failure it waits for explicit instruction before running git checkout.

Can I track side tasks without blocking my refactoring goal?▼

Yes. The /mikado later command appends non-blocking items to a Follow-ups section in the current graph file. Follow-ups never become prerequisite nodes automatically, so they never gate progress on the goal.