{
  "markdown": "# Mugiwara\n\n[![npm version](https://img.shields.io/npm/v/@ionivetech%2fmugiwara)](https://www.npmjs.com/package/@ionivetech/mugiwara)\n[![npm downloads](https://img.shields.io/npm/dm/@ionivetech%2fmugiwara)](https://www.npmjs.com/package/@ionivetech/mugiwara)\n[![License: MIT](https://img.shields.io/github/license/ionivetech/mugiwara)](https://github.com/ionivetech/mugiwara/blob/main/LICENSE)\n\n**Your AI agent already writes the code. Mugiwara makes it reviewable.**\n\nA crew of 12 specialists with defined roles, evidence at every step, and a\nprocess that sizes itself to the work — a typo costs nothing, an auth migration\ngets all nine stages and a security review. No runtime, no API keys, no\nservers. Just markdown your agent already knows how to read.\n\nWorks on Claude Code, opencode, Copilot, Gemini, and 8 more platforms.\n\n![Mugiwara banner](assets/banner.png)\n\n---\n\n## The problem\n\nAn AI agent can write 400 lines in five minutes. It says \"tests pass\" — and\nleaves nothing you can open, read, or attach to a PR. Review becomes a\nformality, and a formality is worse than no review, because it launders the\nchange through a human name.\n\nMugiwara makes the work provable: every change carries a trail a human can\nreview, and the process sizes itself to the work.\n\n## What you get back\n\nEvery mission closes with one file. This is what your reviewer reads:\n\n```markdown\n# Mission: invitation-accepted-flow\n2026-09-03 · farid · branch `feature/MKR-412` · lane **full** · mode guided\n\n## Verdict\n**GO** — all gates passed. 1 finding deferred with an owner.\n\n## What changed\n11 files, +340 / -82.\nSensitive paths touched: `src/auth/invitation.ts`, `migrations/004.sql`\n\n## Gates\n| Gate | Verdict | Evidence |\n|---|---|---|\n| Checkpoint (Flow 4) | PASS | `flows/04-audit.md` |\n| Quality (Flow 5) | PASS | `flows/05-quality.md` |\n| Coverage (Flow 6) | PASS | new 94% / modified 87% |\n| Security (Flow 7) | PASS | STRIDE, 0 high -> `review/security.md` |\n\n## Cost\nUsed **8,781** of 12,000 tokens (73%). Lane `lean`. 1 heal cycle.\n```\n\n*Generated from fixture `test/fixtures/report-sample.md` — 2026-09-03.*\n\n### Without Mugiwara\n\n> **Agent:** Done — I refactored the auth flow and all tests pass.\n>\n> **You:** ...which tests? Did anything touch the token check? What did you\n> decide about the redirect? Is there anything you skipped?\n>\n> **Agent:** *(the context is gone)*\n\n### With Mugiwara\n\nOne file, attached to the PR. Which files changed, which gates passed and where\ntheir evidence lives, who decided what and why, and — the part nobody else\nwrites down — **what was not verified**.\n\n## The process fits the work\n\n| Your change | Lane | What runs |\n|---|---|---|\n| Typo, one file | **Direct** | nothing — just fix it |\n| Small bug | **Lean** | execute -> quality |\n| A feature | **Standard** | plan -> execute -> audit -> quality -> review |\n| Touches `auth/`, `payments/`, migrations | **Full** | all 9 flow stages + security review |\n| Requirements still fuzzy | **Spike** | brainstorm first, then re-size |\n\nThe lane is computed from `git diff` — never guessed by the model — and it only\never rises. Once a mission touches a sensitive path it cannot drop back, even if\nthat file is reverted.\n\n## What is Mugiwara? (30 seconds)\n\nAI agents are fast. They're also **unverified** — no audit trail, no review, no\n\"who checked this?\" when something breaks.\n\nMugiwara wraps your agent in a **Straw Hat crew**: a team of named roles\n(Luffy, Nami, Zoro, Chopper, …) that triages, plans, executes, audits, reviews,\nand heals your work — with a **ruled pipeline**, **evidence at every gate**, and\na **cost governor** that keeps spend visible and bounded.\n\nThree things it does for you:\n\n| You get | Meaning |\n|---|---|\n| **Evidence, not claims** | Every flow stage re-runs checks and shows output. \"Done\" = proof. |\n| **Process that sizes itself** | A typo costs nothing. An auth migration gets the full pipeline. |\n| **Visible cost** | Per-lane budgets, a live slop governor, and a `mugiwara cost` ledger. |\n\nIt runs **inline in your chat** — you watch every step. No hidden subagents, no\nblack box.\n\n→ [Why mugiwara vs just asking your agent](docs/concepts/comparison.md)\n\n---\n\n## Quick start (5 minutes)\n\nAdd the plugin, then just ask something non-trivial:\n\n```bash\n# opencode — add to opencode.json, then restart\n{ \"plugin\": [\"@ionivetech/mugiwara\"] }\n\n# Claude Code\n/plugin marketplace add ionivetech/mugiwara && /plugin install mugiwara\n\n# Any platform via npm\nnpx @ionivetech/mugiwara@latest install --target all --yes\n```\n\nFirst run writes `.mugiwara/config` with defaults. Then ask:\n\n```\n> add role-based access control: admin, editor, viewer\n> audit the auth middleware for security gaps\n> review the last PR for breaking changes\n> split this feature across the team: payment gateway, ledger, fraud\n```\n\nYou ask. The crew routes automatically. **No agent names to memorize, no\npipeline config to write.** A Standard-lane mission (~13k tokens) produces a\nbranch with test-first commits, an audit report, a security review, and a ready\nPR summary — visible at every step in your chat.\n\n| You say                                        | What happens |\n| ---------------------------------------------- | ------------------------------------------------------- |\n| `add search bar to products page`              | Luffy triages → Nami plans → Zoro executes TDD → Chopper audits → Sanji quality → Franky gates → Robin reviews → pushed, PR summary ready |\n| `split payment system: gateway, ledger, fraud` | Nami writes one plan split into sub-missions, each with its own branch + done-criteria → each dev resumes only their own → all mergeable |\n| `Brook, fix the failing login test`            | Healer reads the failure ledger, root-cause fixes, proves it ≤3 cycles |\n| `Jinbe, audit auth middleware`                 | STRIDE + OWASP + dependency audit. Read-only — never touches code |\n\n→ [Full walkthrough](docs/getting-started.md)\n\n---\n\n## How it works (the short version)\n\nFour ideas explain almost everything:\n\n### 1. The crew pipeline\nA mission runs as **flow stages**, each owned by one crew member — triage →\nbrainstorm → plan → execute → audit → quality → gates → review → heal →\nclosure. Every stage reports a compact checkpoint you can read in your chat.\n\n→ [Full pipeline](docs/concepts/workflow.md) · [The crew](docs/concepts/agents.md)\n\n### 2. Lanes — process sizes itself\nWork is sized to the diff. A typo gets no pipeline; an auth migration gets all\nnine stages. Lanes: `direct` / `lean` / `standard` / `full` / `spike`.\n\n| Lane | Flow stages | Typical tokens | Budget |\n| ---- | :---: | :---: | :---: |\n| Direct (typo) | 0 | ~0 | — |\n| Lean (small bug) | 2 | ~8k | 12k |\n| Standard (feature) | 5–7 | ~13k | 25k |\n| Full (architecture) | 9–11 | ~22k | 50k |\n\n→ [Lanes](docs/concepts/lanes.md)\n\n### 3. Modes — how much you participate\n`guided` (approve every step), `semi` (approve the plan, then auto), `auto`\n(full autonomy within your scope).\n\n→ [Modes](docs/concepts/modes.md)\n\n### 4. Cost Governor — what is safe to spend\nPer-lane budgets, a **live slop governor** that flags wasted cost and\nattributes it to the crew member that caused it, and a `mugiwara cost` ledger.\n\n→ [Cost model](docs/concepts/cost.md)\n\n### Adaptive execution\nThree decisions stay **independent**: your **control mode** (how much you\napprove), the **execution posture** (how work runs — inline / parallel /\ncontext-relief / phase / team), and the **Cost Governor** (what is safe to\nspend). The crew picks the posture from evidence at each flow boundary; a\nFull-lane mission can be Guided and inline, a Lean mission can be Auto and\nsequential. Inline stays the default.\n\n→ [Adaptive execution](docs/concepts/execution-model.md)\n\n---\n\n## What Mugiwara does\n\n| Feature | One line |\n|---|---|\n| Lane sizing | Process scales to the work. Computed from `git diff`, never guessed. |\n| Evidence gates | A stage passes only if the check actually ran. No output, no pass. |\n| Team split | One shared plan, per-person state, file conflicts caught before merge. |\n| Resume | Session died? Continues from the exact stage. Never restarts. |\n| 12 platforms | Same crew on Claude Code, Gemini, Codex, Copilot, Cursor and more — 9 via install, 3 via marketplace manifest. |\n\n→ all features: [Every feature](docs/concepts/features.md)\n\n---\n\n## Team collaboration\n\nBuilt for a team sharing one repo. Identity is **(mission, member)**, never\nbranch — so any number of engineers run parallel work without colliding.\n\n```bash\n/mugiwara continue                      # list every in-flight mission for YOU\n/mugiwara continue payment-gateway      # solo → resume; team → list members\n/mugiwara continue payment-gateway patty # resume exactly patty's work\nmugiwara status                         # computed per-mission position\n```\n\nAuto mode runs your **member scope only** — resuming your sub-mission runs it to\nship, never the other members'.\n\n→ [Multi-actor reference](references/multi-actor.md)\n\n---\n\n## When not to use Mugiwara\n\n- **Throwaway prototype you will delete tonight** — use Lane 4 spike, or skip mugiwara entirely; the trail outlives the code otherwise.\n- **Unattended multi-hour runs with nobody watching chat** — the crew runs inline so you can interrupt it; asleep at the wheel, use a batch runner instead.\n- **Solo script with no reviewer, no PR, no future reader** — the audit trail has no audience, so it is pure overhead.\n- **Harnesses without agent dispatch** (Gemini, Codex, tier 3) — you get the workflow and the trail, not enforced role boundaries; do not expect the harness to stop a role from touching code it should not.\n\n---\n\n## Configuration\n\nSwitch mode any time: say `mugiwara mode <guided|semi|auto>` in session — no CLI flag, no slash command. Or edit `.mugiwara/config`:\n\n| Key | Default | What |\n|---|---|---|\n| `mode` | guided | guided / semi / auto |\n| `branch` | `feature/{type}-{issue}-{slug}` | Branch naming |\n| `commit` | conventional | conventional / gitmoji / plain / template |\n| `auto_commit` | on | off disables commit+push in guided/semi |\n| `coverage_new` | 85 | Coverage threshold for new files (%) |\n| `coverage_modified` | 90 | Coverage threshold for modified files (%) |\n| `delegate_threshold` | 60 | % of budget at which remaining tasks dispatch to workers |\n| `heal_max_cycles` | 3 | Max heal-loop cycles before human escalation |\n| `verbosity` | normal | normal / full — how much the crew echoes |\n\nProject config (`.mugiwara/config`) overrides global (`~/.mugiwara/config`).\n\n→ [All config keys](docs/concepts/config.md)\n\n---\n\n## Quick reference\n\n| Need | Command / Doc |\n|---|---|\n| Review a PR diff | `/mugiwara-review` or \"review this PR\" |\n| Security audit | `/mugiwara-security` or \"Jinbe, audit X\" |\n| Resume a mission | `/mugiwara continue <mission> [member]` |\n| See mission position | `mugiwara status` |\n| See cost + live slop | `mugiwara cost` |\n| Close out a mission | `mugiwara archive <mission>` |\n| Switch mode | `mugiwara mode <guided\\|semi\\|auto>` (in session) |\n| All docs | [docs/](docs/) |\n\n---\n\n## Try it in 60 seconds\n\n    npx @ionivetech/mugiwara@latest install --target claude --yes\n\nThen just describe what you want:\n\n    \"fix the typo in the header comment\"        -> fixed immediately, no ceremony\n    \"add pagination to the users endpoint\"      -> plan, execute, audit, quality, review\n    \"move auth to short-lived tokens\"           -> all nine stages plus a security review\n\nYou did not choose any of that. The lane was computed from the diff.\n\n## Install\n\n<details>\n<summary><b>Claude Code</b></summary>\n\n```bash\n/plugin marketplace add ionivetech/mugiwara && /plugin install mugiwara\n```\nUninstall: `/plugin uninstall mugiwara`\n\n</details>\n\n<details>\n<summary><b>OpenCode</b></summary>\n\nAdd to `opencode.json`:\n```json\n{ \"plugin\": [\"@ionivetech/mugiwara\"] }\n```\nUpdate: `rm -rf ~/.cache/opencode/packages/@ionivetech/mugiwara* && opencode plugin @ionivetech/mugiwara -g` ([details](docs/install/opencode.md#update))\nUninstall: remove `\"@ionivetech/mugiwara\"` from the plugins array\n\n</details>\n\n<details>\n<summary><b>Gemini CLI / Codex / Copilot / Cursor / Antigravity / Kimi / Pi</b></summary>\n\nSee [per-platform guides](docs/install/index.md) — each has a one-line install\nand uninstall.\n\n</details>\n\n<details>\n<summary><b>Any platform via CLI</b></summary>\n\n```bash\nnpx @ionivetech/mugiwara@latest install --target <id> --yes   # windsurf, cline, kilo, codex\nnpm i -g @ionivetech/mugiwara && mugiwara install --target all --yes\n```\n\n</details>\n\nAll platforms get the full crew — 11 agents (+3 internal), 21 skills.\nEnforcement depth varies by harness; see the [harness matrix](docs/reference/harness-matrix.md).\n\n---\n\n## CLI\n\n```bash\nmugiwara install                              # wizard (interactive)\nmugiwara install --target all --yes           # non-interactive\nmugiwara update --target <id> --yes           # overwrite to latest\nmugiwara uninstall                            # remove installed files\nmugiwara list [--check]                       # show / health-check installations\nmugiwara status                               # computed mission state\nmugiwara continue [mission] [member]          # resume / list in-flight (read-only)\nmugiwara cost [--mission <id>] [--json]       # cost ledger, avoided work, live slop\nmugiwara archive <mission>                    # fold the trail into report.md\nmugiwara clean [--all] [--before <date>]      # batch-archive closed missions\nmugiwara blame <path>                         # provenance on the last commit touching path\nmugiwara handoff <mission>                    # engineer-to-engineer handoff report\nmugiwara sign <mission> [--verify]            # optional report attestation\nmugiwara reset --keep-logs                    # wipe state, keep lessons\n```\n\n---\n\n## Docs\n\n**Start here:** [Getting started](docs/getting-started.md) · [What mugiwara replaces](docs/concepts/comparison.md)\n\n**Concepts:** [Workflow](docs/concepts/workflow.md) · [Lanes](docs/concepts/lanes.md) · [Modes](docs/concepts/modes.md) · [Execution model](docs/concepts/execution-model.md) · [Git strategy](docs/concepts/git-strategy.md) · [Config](docs/concepts/config.md) · [Cost](docs/concepts/cost.md) · [Audit trail](docs/concepts/audit-trail.md) · [Security](docs/concepts/security.md) · [Provenance](docs/concepts/provenance.md) · [Policy as code](docs/concepts/policy-as-code.md) · [Closure tools](docs/concepts/closure-tools.md) · [Permissions](docs/concepts/permissions.md)\n\n**Crew:** [Agents](docs/concepts/agents.md) · [Skills](docs/concepts/skills.md) · [Adaptive execution](docs/concepts/execution-model.md)\n\n**Reference:** [Adoption guide](docs/reference/adoption-guide.md) · [Glossary](docs/reference/glossary.md) · [Harness matrix](docs/reference/harness-matrix.md) · [Compliance matrix](docs/reference/compliance-matrix.md)\n\n**Install:** [Overview](docs/install/index.md) · [Claude](docs/install/claude.md) · [opencode](docs/install/opencode.md) · [Gemini](docs/install/gemini.md) · [Codex](docs/install/codex.md) · [Copilot](docs/install/copilot.md) · [CLI targets](docs/install/cli.md)\n\n**Runbooks:** [Solo mission](docs/runbooks/solo-mission.md) · [Team mission](docs/runbooks/team-mission.md) · [Joining mid-mission](docs/runbooks/joining-a-mission.md) · [Resume after crash](docs/runbooks/resume-after-crash.md) · [Monorepo](docs/runbooks/monorepo.md) · [Signing](docs/runbooks/signing-and-attestation.md) · [Policy](docs/runbooks/policy-for-a-team.md) · [Troubleshooting](docs/runbooks/troubleshooting.md)\n\n**Troubleshooting:** [Common problems](docs/troubleshooting.md)\n\n---\n\n## What is measured, and what is not\n\n| Claim | Status |\n|---|---|\n| Retrieval routing rank-1 | **95.9%**, 216 probes, offline, in CI |\n| Reference pointers resolve | **318/318**, 9 targets, in CI |\n| Index size published vs measured | **doc-gated** — validator fails on drift, in CI |\n| Lane constants match content load | **verified**, in CI |\n| Write-scope enforcement | **opencode only** — rules-based elsewhere |\n| Cross-harness mission behavior | **12/12 platforms**, in CI |\n| Outcome vs other approaches | **not measured** |\n\nNumbers here are produced by `bun run gate`. Nothing in this table is an estimate.\n\n---\n\n## License\n\nMIT. Copyright (c) 2026 ionivetech.\n",
  "bytes": 16269,
  "sha": "ef7e69d394cf60d262cda1a8028f43f711e9cac252ff060c968b2bb2192a7cf0",
  "repo_slug": "ionivetech/mugiwara",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_ionivetech_mugiwara_077e1c56/readme"
}