nw-mikado-method

nw-mikado-method is a skill for Claude Code from nWave-ai/nWave. It costs 28 tokens per session (1,168 once invoked), scanned A, original, MIT.

A step-by-step method for refactoring complex code by uncovering dependencies, mapping them as a tree, and changing the smallest prerequisite pieces first. Refactoring means changing code structure without intentionally changing its behavior.

In plain words
What is it for?
Use it to plan and carry out refactors that span multiple classes or modules and have unclear dependencies.
Why use it?
Large architectural changes can cause failures in places that are hard to predict. This method turns those failures into dependency information while keeping the codebase in a working state.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Good fit Use it to plan and carry out refactors that span multiple classes or modules and have unclear dependencies.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nwave-ai/nwave/nw-mikado-method
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add nWave-ai/nWave --skill nw-mikado-method
Clone the repo
git clone --depth 1 https://github.com/nWave-ai/nWave

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for nw-mikado-method

README.md
[![agentmods](https://agentmods.dev/badge/skills/nwave-ai/nwave/nw-mikado-method.svg)](https://agentmods.dev/skills/nwave-ai/nwave/nw-mikado-method)
Your own site
<a href="https://agentmods.dev/skills/nwave-ai/nwave/nw-mikado-method"><img src="https://agentmods.dev/badge/skills/nwave-ai/nwave/nw-mikado-method.svg" alt="Measured on agentmods" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,168 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00028 $0.01168
Opus 5 $0.00014 $0.00584
Sonnet 5 $0.00006 $0.00234
Haiku 4.5 $0.00003 $0.00117

Measured 4d ago against content hash 474589da3d25, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

nw-mikado-method scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

nWave/skills/nw-mikado-method/SKILL.md · 129 lines

How it starts

The opening of the file, as written. The whole thing — 129 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Mikado Method

Use for complex refactoring where direct implementation causes cascading failures across multiple classes/modules.

When to Use

  • Refactoring goal affects multiple classes/modules | Direct implementation causes cascade of failures
  • Dependencies not immediately clear | High risk of breaking existing functionality

Core Process

Cycle: Set Goal > Experiment > Visualize prerequisites > Revert to working state.

Treat compilation/test failures as valuable information -- each failure reveals a prerequisite node in the dependency graph. Revert keeps codebase shippable at all times.

Discovery-Tracking Protocol

Commit immediately after each dependency discovery to preserve exploration history and enable interrupt/resume.

Commit Formats

  • Dependency: Discovery: [Class.Method(params)] requires [Prerequisite] in [File:Line]
  • False leaf: Discovery: False leaf - [Node] blocked by [Dependency]
  • Exploration complete: Discovery: No new dependencies found - exploration complete for [GoalArea]
  • Ready: Ready: True leaves identified - [Count] leaves ready for execution

Exhaustive Exploration Algorithm

Sequence: EXPERIMENT > LEARN > GRAPH > COMMIT GRAPH > REVERT

  1. Experiment: Attempt naive implementation of stated goal
  2. Learn: Capture ALL compilation and test failures immediately
  3. Graph: Create concrete prerequisite nodes with exact specifications
  4. Commit Graph: Commit discovery with mandatory format
  5. Revert: Revert ALL code changes to maintain clean state

Termination Criteria

  • Every apparent leaf candidate systematically attempted | No new dependencies emerge from leaf attempts
  • Tree structure stable across multiple exploration cycles | True leaves confirmed with zero prerequisites

Concrete Node Specification

Nodes require method-level specificity:

  • Method signatures: ClassName.MethodName(parameter types) -> ReturnType
  • File locations: src/Services/UserService.cs, line 45
  • Access modifiers: public | private | internal | protected
  • Refactoring technique: Extract Method | Move Method | etc.
  • Atomic transformation: Rename | Extract | Inline | Move | Safe Delete
  • Code smell target: Long Method | Feature Envy | etc.

Read the full file on GitHub · 129 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 129 lines · 28 tokens per session scan A 474589da3d25

Subscribe to this mod's changes

nw-mikado-method is a skill published in the GitHub repository nWave-ai/nWave (608 stars, last pushed 2d ago), licensed MIT. It adds 28 tokens to every session and 1,168 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.