魔法 · mahou

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

名 · the name

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.

ma — power hō — method / law
道 · doctrine

Three iron laws

Not guidelines — the ritual that turns chaos into power you can trust.

  1. Root cause before fix

    Investigate before acting. One hypothesis, one test — verify before continuing. No stacked patches.

  2. Design before code

    Spec and plan before implementation. Know what you are building before you build it.

  3. Verify before ship

    Check the build against the spec. Nothing ships without passing verification.

流 · flow

Three layers. One current.

From project context through feature execution to delivery — each layer feeds the next.

  1. layer 1

    Project

    Initialize projects, research approaches, and map existing codebases.

    context · research · map

  2. layer 2

    Feature

    Brainstorm specs, orchestrate implementation, and review against the plan.

    spec · execute · review

  3. layer 3

    Lifecycle

    Resume sessions, verify the build, and ship pull requests.

    resume · verify · ship

輪 · cycle

The closed loop

Brainstorm → orchestrate → verify → ship. Failures route to debug or replan — never silent drift.

  1. Brainstorm
    /mahou-brainstorm

    Design to spec before code.

  2. Orchestrate
    /mahou-orchestrator

    Execute the plan task-by-task.

  3. Verify
    /mahou-verify

    Check implementation against spec.

  4. Ship
    /mahou-ship

    Push, 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.

術 · spellbook

Commands that enforce order

Invoked only when needed. Zero structural token cost until you call them.

  • /mahou-new-project

    Initialize the project — PROJECT.md and ROADMAP.md.

    Project
  • /mahou-init

    Map an existing codebase into .mahou/map.md.

    Project
  • /mahou-research

    Research online — explore, diagnose, or lookup.

    Project
  • /mahou-ask

    Answer questions and explain code, never editing.

    Any
  • /mahou-debug

    Root-cause investigation before any fix.

    Any
  • /mahou-review

    Discover, triage, and verify real issues only.

    Any
  • /mahou-brainstorm

    Design to spec before writing code.

    Feature
  • /mahou-designer

    Design and ship production-grade frontend interfaces.

    Feature
  • /mahou-orchestrator

    Execute a plan task-by-task via subagents.

    Feature
  • /mahou-ultracode

    Fan out parallel subagent waves for large-scale work.

    Feature
  • /mahou-verify

    Check implementation against the spec.

    Lifecycle
  • /mahou-secure

    Security-verify a change — PASS, FIX, or ESCALATE.

    Lifecycle
  • /mahou-resume

    Resume orchestration with git-diff reconciliation.

    Lifecycle
  • /mahou-ship

    Push, create a PR, filter planning artifacts.

    Lifecycle
  • /mahou-postmortem

    Write a post-mortem for a resolved incident.

    Lifecycle
始 · begin

Install in one breath

Clone, run the installer, restart opencode. No plugins. No MCP. No npm. Just slash commands that enforce the craft.

terminal · mahou