Discipline
becomes
magic.
Portable opencode slash commands that enforce root cause before fix, design before code, verify before ship.
zero npm · zero MCP · pure markdown ritual
Magic is the discipline of order.
mahou (魔法) is Japanese for magic. Here, magic is not spectacle — it is the craft of doing the right work in the right order: root cause before fix, design before code, verify before ship.
Three iron laws
Not guidelines — the ritual that turns chaos into power you can trust.
Root cause before fix
Investigate before acting. One hypothesis, one test — verify before continuing. No stacked patches.
Design before code
Spec and plan before implementation. Know what you are building before you build it.
Verify before ship
Check the build against the spec. Nothing ships without passing verification.
Three layers. One current.
From project context through feature execution to delivery — each layer feeds the next.
- layer 1
Project
Initialize projects, research approaches, and map existing codebases.
context · research · map
- layer 2
Feature
Brainstorm specs, orchestrate implementation, and review against the plan.
spec · execute · review
- layer 3
Lifecycle
Resume sessions, verify the build, and ship pull requests.
resume · verify · ship
The closed loop
Brainstorm → orchestrate → verify → ship. Failures route to debug or replan — never silent drift.
- Brainstorm
/mahou-brainstormDesign to spec before code.
- Orchestrate
/mahou-orchestratorExecute the plan task-by-task.
- Verify
/mahou-verifyCheck implementation against spec.
- Ship
/mahou-shipPush, create PR, ship it.
分岐 · branches
Pass → Ship
Verification clears. Push and open the PR.
Fail → Debug
Root-cause first. Fix only what the evidence demands.
Drift → Replan
Scope or assumptions broke. Return to brainstorm.
Commands that enforce order
Invoked only when needed. Zero structural token cost until you call them.
/mahou-new-projectInitialize the project — PROJECT.md and ROADMAP.md.
Project/mahou-initMap an existing codebase into .mahou/map.md.
Project/mahou-researchResearch online — explore, diagnose, or lookup.
Project/mahou-askAnswer questions and explain code, never editing.
Any/mahou-debugRoot-cause investigation before any fix.
Any/mahou-reviewDiscover, triage, and verify real issues only.
Any/mahou-brainstormDesign to spec before writing code.
Feature/mahou-designerDesign and ship production-grade frontend interfaces.
Feature/mahou-orchestratorExecute a plan task-by-task via subagents.
Feature/mahou-ultracodeFan out parallel subagent waves for large-scale work.
Feature/mahou-verifyCheck implementation against the spec.
Lifecycle/mahou-secureSecurity-verify a change — PASS, FIX, or ESCALATE.
Lifecycle/mahou-resumeResume orchestration with git-diff reconciliation.
Lifecycle/mahou-shipPush, create a PR, filter planning artifacts.
Lifecycle/mahou-postmortemWrite a post-mortem for a resolved incident.
Lifecycle
Install in one breath
Clone, run the installer, restart opencode. No plugins. No MCP. No npm. Just slash commands that enforce the craft.