Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/studioKjm/ai-harness-templatenpx agentmods add commands/studiokjm/ai-harness-template/mikadoWrote 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.
[](https://agentmods.dev/commands/studiokjm/ai-harness-template/mikado)<a href="https://agentmods.dev/commands/studiokjm/ai-harness-template/mikado"><img src="https://agentmods.dev/badge/commands/studiokjm/ai-harness-template/mikado.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.01122 |
| Opus 5 | $0.00000 | $0.00561 |
| Sonnet 5 | $0.00000 | $0.00224 |
| Haiku 4.5 | $0.00000 | $0.00112 |
Grade A, and why
mikado 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 8d 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.
How it starts
The opening of the file, as written. The whole thing — 124 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/mikado — Mikado Method Manager
Methodology: mikado-method
Purpose: Tree-based incremental refactoring. Try → fail → revert → discover prerequisites → solve leaves first.
Usage
/mikado new <goal> [--hypothesis <text>]
/mikado try <graph-id> <node-id> [--notes <text>]
/mikado block <graph-id> <node-id> --prereq <desc> [<desc>...] [--desc <text>]
/mikado done <graph-id> <node-id>
/mikado revert <graph-id> <node-id>
/mikado tree <graph-id>
/mikado show <graph-id> <node-id>
/mikado list [--state in-progress|done|abandoned]
/mikado abandon <graph-id> [--reason <text>]
The Mikado Algorithm
1. SET GOAL
/mikado new "replace PostgreSQL driver"
2. TRY the change
/mikado try mik-20260430-001 root
3a. IF it works (compiles, tests pass):
/mikado done mik-20260430-001 root ← graph complete 🎊
3b. IF it breaks (compile errors, test failures):
→ WRITE DOWN the prerequisites
/mikado block mik-20260430-001 root --prereq "extract ConnectionPool interface" "add type alias for QueryResult"
→ REVERT all changes
git checkout HEAD -- .
/mikado revert mik-20260430-001 root
4. WORK ON LEAVES (nodes with no prerequisites)
/mikado try mik-20260430-001 node-001
... (repeat from step 2 for each leaf node)
5. WHEN LEAVES DONE → retry parent
/mikado try mik-20260430-001 root ← prerequisites now done
Key principle: Always work on leaves. Never commit broken intermediate state.
Node State Machine
⬜ pending ──try──→ 🟡 attempted ──done──→ ✅ done
│
block (prereqs discovered)
↓
🔴 blocked ──try──→ 🟡 attempted (when prereqs done)
│
←──revert (back to pending)
Example Session
# 1. Define goal
python3 methodologies/mikado-method/scripts/mikado.py new \
"replace raw SQL with ORM"
# 2. Try the goal
python3 methodologies/mikado-method/scripts/mikado.py try mik-20260430-001 root
# 3. Hit compile errors — write prerequisites, revert
python3 methodologies/mikado-method/scripts/mikado.py block mik-20260430-001 root \
--prereq "add ORM entity for User" "add ORM entity for Order" "configure ORM connection pool"
git checkout HEAD -- .
python3 methodologies/mikado-method/scripts/mikado.py revert mik-20260430-001 root
# 4. Visualize
python3 methodologies/mikado-method/scripts/mikado.py tree mik-20260430-001
# 🎯 Graph: mik-20260430-001 [in-progress]
# ⬜ root [pending] "replace raw SQL with ORM"
# ├── ⬜ node-001 [pending] "add ORM entity for User"
# ├── ⬜ node-002 [pending] "add ORM entity for Order"
# └── ⬜ node-003 [pending] "configure ORM connection pool"
# 5. Work on leaves
python3 methodologies/mikado-method/scripts/mikado.py try mik-20260430-001 node-001
# ... write User entity, tests pass
python3 methodologies/mikado-method/scripts/mikado.py done mik-20260430-001 node-001
# 6. Retry root when all prerequisites done
python3 methodologies/mikado-method/scripts/mikado.py try mik-20260430-001 root
python3 methodologies/mikado-method/scripts/mikado.py done mik-20260430-001 root
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.
- 8d ago First seen · 124 lines · 0 tokens per session scan A 13615ec5e0ec
mikado is a command published in the GitHub repository studioKjm/ai-harness-template (43 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,122 tokens. 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-08-30.
Other commands, from other repositories
capture-feedback
Quick feedback capture with structured signals.
show-lessons
Display promoted lessons and their corrective actions.
harness-review
Review the current change set from an opposing harness-engineering perspective.
step0-specify-feature
Pipeline Step 0 — Specify what you want to build and why, before any technical planning. Surfaces ambiguities early with [NEEDS CLARIFICATION] markers.
harness-update
Update a target repository's harness from the latest harness-starter-kit reference material.
harness-doctor
Run Harness Doctor to evaluate how ready the current repository is for reliable AI coding agent collaboration.