@ionivetech/mugiwara 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.codex-plugin/plugin.json +1 -1
  4. package/.cursor-plugin/plugin.json +1 -1
  5. package/.kimi-plugin/plugin.json +1 -1
  6. package/.opencode/mugiwara-helpers.mjs +2 -2
  7. package/README.md +194 -328
  8. package/content/agents/franky-gates.md +1 -1
  9. package/content/agents/luffy-orchestrator.md +2 -2
  10. package/content/skills/mugiwara-backend/SKILL.md +52 -43
  11. package/content/skills/mugiwara-checkpoint/SKILL.md +19 -8
  12. package/content/skills/mugiwara-contract-first/SKILL.md +46 -1
  13. package/content/skills/mugiwara-execution/SKILL.md +32 -32
  14. package/content/skills/mugiwara-execution/references/execution-phase-flows.md +18 -0
  15. package/content/skills/mugiwara-frontend/SKILL.md +44 -44
  16. package/content/skills/mugiwara-gates/SKILL.md +22 -16
  17. package/content/skills/mugiwara-healing/SKILL.md +26 -25
  18. package/content/skills/mugiwara-orchestration/SKILL.md +6 -6
  19. package/content/skills/mugiwara-orchestration/references/control-commands.md +14 -0
  20. package/content/skills/mugiwara-planning/SKILL.md +26 -14
  21. package/content/skills/mugiwara-planning/references/large-campaign-subplan.md +41 -0
  22. package/content/skills/mugiwara-planning/references/plan-template.md +22 -0
  23. package/content/skills/mugiwara-quality/SKILL.md +19 -13
  24. package/content/skills/mugiwara-resume/SKILL.md +6 -1
  25. package/content/skills/mugiwara-review/SKILL.md +17 -12
  26. package/content/skills/mugiwara-security/SKILL.md +46 -35
  27. package/content/skills/mugiwara-workflow/SKILL.md +6 -9
  28. package/content/skills/mugiwara-workflow/references/adaptive-budget-governor.md +5 -0
  29. package/content/skills/mugiwara-workflow/references/benchmark-governor.md +53 -0
  30. package/content/skills/mugiwara-workflow/references/cognitive-output-governor.md +5 -0
  31. package/content/skills/mugiwara-workflow/references/large-campaign-subplan.md +29 -0
  32. package/content/skills/mugiwara-workflow/references/scope-code-governor.md +14 -0
  33. package/content/skills/mugiwara-workflow/references/stop-slop-governor.md +14 -0
  34. package/content/skills/mugiwara-workflow/references/workspace-layout.md +6 -3
  35. package/dist/mugiwara.js +925 -253
  36. package/gemini-extension.json +1 -1
  37. package/hooks/pipeline-guard.js +1 -1
  38. package/hooks/pipeline-guard.ts +2 -1
  39. package/package.json +2 -2
  40. package/plugin.json +1 -1
  41. package/references/multi-actor.md +21 -0
  42. package/references/posture-routing.md +31 -0
  43. package/scripts/benchmark-governor.ts +516 -0
  44. package/scripts/benchmark-thresholds.json +47 -0
  45. package/scripts/check-doc-links.ts +8 -2
  46. package/scripts/gate-selftest.ts +20 -0
  47. package/scripts/lib/lane-base.sh +4 -4
  48. package/scripts/retrieval-eval.ts +9 -3
  49. package/scripts/savepoint.sh +20 -1
  50. package/scripts/validate-content.ts +22 -3
  51. package/src/adaptive-budget.ts +178 -0
  52. package/src/args.ts +3 -2
  53. package/src/budget.ts +7 -16
  54. package/src/check-artifacts.ts +45 -0
  55. package/src/cli.ts +102 -4
  56. package/src/cognition.ts +234 -0
  57. package/src/config.ts +107 -0
  58. package/src/context.ts +72 -0
  59. package/src/cost.ts +186 -0
  60. package/src/evidence.ts +160 -0
  61. package/src/installer.ts +2 -16
  62. package/src/integrity.ts +1 -1
  63. package/src/investigation.ts +72 -0
  64. package/src/mission.ts +124 -10
  65. package/src/posture.ts +86 -0
  66. package/src/reporting.ts +225 -0
  67. package/src/scope.ts +321 -0
  68. package/src/sign.ts +194 -20
  69. package/src/slop.ts +306 -0
  70. package/src/work.ts +273 -0
package/README.md CHANGED
@@ -6,85 +6,45 @@
6
6
 
7
7
  **Your agent writes the code. Mugiwara proves it.**
8
8
 
9
- A governed engineering crew for your AI agent — evidence at every step, and a
10
- process that sizes itself to the work. A typo costs nothing. An auth migration
11
- gets all nine flow stages. No runtime, no API keys, no servers. Just markdown your
12
- agent already knows how to read.
9
+ A governed engineering crew for your AI agent — evidence at every step, a
10
+ process that sizes itself to the work, and cost you can actually see. No
11
+ runtime, no API keys, no servers. Just markdown your agent already knows how
12
+ to read.
13
13
 
14
14
  Works on Claude Code, opencode, Copilot, Gemini, and 8 more platforms.
15
15
 
16
16
  ![Mugiwara banner](assets/banner.png)
17
17
 
18
- ## Why this exists
18
+ ---
19
19
 
20
- AI agents are fast. They're also **unverified.** No audit trail. No review. No
21
- "who checked this?" when something breaks. Mugiwara wraps your agent in a team
22
- structure with role boundaries, evidence gates, and cost tracking — the same
23
- discipline you'd expect from a senior engineering team. Zero runtime overhead:
24
- every agent, every skill, every rule is static markdown.
20
+ ## What is Mugiwara? (30 seconds)
25
21
 
26
- [Full pitch: why mugiwara vs just asking your agent](docs/concepts/comparison.md)
22
+ AI agents are fast. They're also **unverified** no audit trail, no review, no
23
+ "who checked this?" when something breaks.
27
24
 
28
- ## See the evidence
29
-
30
- A closed mission leaves a report you can actually read and after `mugiwara archive <mission>`, the whole trail folds INTO it. This is the shape of `.mugiwara/missions/<mission>/report.md`:
31
-
32
- # Mission: invitation-accepted-flow . 2026-08-11
33
-
34
- **Lane** full . **Mode** guided . **Actor** john . **Branch** feature/MKR-412
35
-
36
- ## What changed
37
-
38
- 11 files, +340 LOC
39
- Sensitive paths: src/auth/
25
+ Mugiwara wraps your agent in a **Straw Hat crew**: a team of named roles
26
+ (Luffy, Nami, Zoro, Chopper, …) that triages, plans, executes, audits, reviews,
27
+ and heals your workwith a **ruled pipeline**, **evidence at every gate**, and
28
+ a **cost governor** that keeps spend visible and bounded.
40
29
 
41
- ## Flow stages
42
-
43
- | Flow stage | Artifact | Verdict |
44
- |------|----------|---------|
45
- | Execute (Flow 3) | `flows/01-execution.md` | PASS |
46
- | Checkpoint (Flow 4) | `flows/02-audit.md` | PASS |
47
- | Quality (Flow 5) | `flows/03-quality.md` | PASS |
48
- | Gates (Flow 6) | `flows/04-gates.md` | PASS |
49
- | Healing (Flow 8) | `flows/05-healing.md` | PASS |
50
- | Closure (Flow 9) | `flows/06-closure.md` | GO |
51
-
52
- ## Review & blockers
53
-
54
- Review + security findings: review.md, security.md
55
- Findings: 3
56
- Blocker ledger rows: 1
30
+ Three things it does for you:
57
31
 
58
- ## State
59
-
60
- | Field | Value |
61
- |-------|-------|
62
- | Flow stage | 9 |
63
- | Tasks | 6/6 done |
64
- | Blockers open | 0 |
65
- | Heal cycles | 1 |
66
- | Tokens used | 14,200 / 20,000 |
67
-
68
- ## Lanes
32
+ | You get | Meaning |
33
+ |---|---|
34
+ | **Evidence, not claims** | Every flow stage re-runs checks and shows output. "Done" = proof. |
35
+ | **Process that sizes itself** | A typo costs nothing. An auth migration gets the full pipeline. |
36
+ | **Visible cost** | Per-lane budgets, a live slop governor, and a `mugiwara cost` ledger. |
69
37
 
70
- Work is sized to the diffa typo gets no pipeline, an auth migration gets
71
- all nine flow stages. Mugiwara itself is free; token usage depends on the lane:
38
+ It runs **inline in your chat**you watch every step. No hidden subagents, no
39
+ black box.
72
40
 
73
- | Lane | Flow stages | Typical tokens | Budget |
74
- | ------------------- | :---: | :------------: | :----: |
75
- | Direct (typo) | 0 | ~0 | — |
76
- | Lean (small bug) | 2 | ~7k | 12k |
77
- | Standard (feature) | 5–7 | ~13k | 25k |
78
- | Full (architecture) | 9–11 | ~23k | 50k |
41
+ [Why mugiwara vs just asking your agent](docs/concepts/comparison.md)
79
42
 
80
- Usage tracked in `.mugiwara/missions/<mission>/[member].json` per mission. Budget warns at 1.5×,
81
- pauses at 3×. Lane bases are measured from the skills/agents loaded per lane
82
- by `scripts/lane-base.ts` — the constants fail CI if they drift from content
83
- load.
43
+ ---
84
44
 
85
- [Full cost model](docs/concepts/cost.md)
45
+ ## Quick start (5 minutes)
86
46
 
87
- ## 30-second try
47
+ Add the plugin, then just ask something non-trivial:
88
48
 
89
49
  ```bash
90
50
  # opencode — add to opencode.json, then restart
@@ -97,7 +57,7 @@ load.
97
57
  npx @ionivetech/mugiwara@latest install --target all --yes
98
58
  ```
99
59
 
100
- First run: install writes `.mugiwara/config` with defaults — edit it anytime (mode, coverage, depths). Then ask something non-trivial:
60
+ First run writes `.mugiwara/config` with defaults. Then ask:
101
61
 
102
62
  ```
103
63
  > add role-based access control: admin, editor, viewer
@@ -106,339 +66,244 @@ First run: install writes `.mugiwara/config` with defaults — edit it anytime (
106
66
  > split this feature across the team: payment gateway, ledger, fraud
107
67
  ```
108
68
 
109
- A Standard lane mission (~13k tokens) produces a branch with test-first
110
- commits, an audit report, a security review, and a ready PR summary — visible
111
- at every step in your chat.
112
-
113
69
  You ask. The crew routes automatically. **No agent names to memorize, no
114
- pipeline config to write.**
115
-
116
- | You say | What happens |
117
- | ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
118
- | `add search bar to products page` | Luffy triages → Nami plans 3 tasks → Zoro executes TDD → Chopper audits → Sanji runs quality → Franky gates → Robin reviews → code pushed, PR summary ready |
119
- | `split payment system: gateway, ledger, fraud` | Nami interviews → writes one plan split into sub-missions, each with its own branch and done-criteria → each dev resumes only their own sub-mission → all mergeable at the end |
120
- | `Brook, fix the failing login test` | Healer reads failure ledger, root-cause fixes, proves fix ≤3 cycles |
121
- | `Jinbe, audit auth middleware` | STRIDE + OWASP + dependency audit. Read-only — never touches code |
122
- | `/mugiwara auto` | Switches to full autonomy — all flow stages run without asking, from the next flow stage |
123
-
124
- - **Full pipeline** when the task is big or direction is unclear
125
- - **Direct agent** when you know exactly what you need — say the name
126
- - **Slash commands** when you want to drive: `/mugiwara`, `/mugiwara-continue`, `/mugiwara-review`, `/mugiwara-security`
127
-
128
- → [Full walkthrough](docs/getting-started.md) · [Full workflow walkthrough](docs/concepts/workflow.md)
129
-
130
- ## What Mugiwara does
131
-
132
- ### All features
133
-
134
- **Every day, on every repo:**
70
+ pipeline config to write.** A Standard-lane mission (~13k tokens) produces a
71
+ branch with test-first commits, an audit report, a security review, and a ready
72
+ PR summary visible at every step in your chat.
135
73
 
136
- | Feature | What you get |
137
- | ------------------------ | ----------------------------------------------------------------------------------------------- |
138
- | **Lane sizing** | Work auto-sized from `git diff`. Typo = instant fix. Auth migration = full pipeline. |
139
- | **Evidence trail** | `.mugiwara/` workspace: plans, audit reports, quality reports, review findings, blocker ledger. |
140
- | **Closure integrity** | Archive fails on dangling links, secrets in the trail, or missing evidence. |
141
- | **Provenance** | Per-commit attribution agent, model, lane, evidence. `mugiwara blame`. |
142
- | **Rollback map** | Executable `rollback.sh` per mission: exact revert commands. Human runs it. Under squash merges the diff is collapsed — `rollback.sh` contains `UNRESOLVED` guidance with `git log --grep="<mission>"` and `exit 1` instead of a silent "nothing to revert" (measured caveat). |
143
- | **Review routing** | Ranked reading order in every report: sensitive paths first, scaffolding last. |
144
- | **Staleness guard** | Resume warns when main moved past the mission's base. |
74
+ | You say | What happens |
75
+ | ---------------------------------------------- | ------------------------------------------------------- |
76
+ | `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 |
77
+ | `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 |
78
+ | `Brook, fix the failing login test` | Healer reads the failure ledger, root-cause fixes, proves it ≤3 cycles |
79
+ | `Jinbe, audit auth middleware` | STRIDE + OWASP + dependency audit. Read-only — never touches code |
145
80
 
146
- **When a team scales it up:**
81
+ [Full walkthrough](docs/getting-started.md)
147
82
 
148
- | Feature | What you get |
149
- | ------------------------ | ----------------------------------------------------------------------------------------------- |
150
- | **Policy as code** | `mugiwara.policy.yml`: force lanes up, raise coverage gates, flag paths for human approval. |
151
- | **Signed attestation** | Optional minisign signing of the report — evidence that cannot be edited after the fact. |
152
- | **Handoff** | `mugiwara handoff`: engineer-to-engineer report from computed state. |
153
- | **Context budget** | Trail size measured at closure; optional ceiling fails the archive like a test. |
154
- | **Team collaboration** | One shared plan, per-(mission, member) state + resume. Zero collisions. |
83
+ ---
155
84
 
156
- **Always on, under the surface:**
85
+ ## How it works (the short version)
157
86
 
158
- | Feature | What you get |
159
- | ------------------------ | ----------------------------------------------------------------------------------------------- |
160
- | **Self-healing** | Brook reads all failures at once, fixes root causes, re-runs verification. ≤3 cycles. |
161
- | **Resume from anywhere** | Rebuilds from `.mugiwara/` state. Continues, never restarts. |
162
- | **12 platforms** | Claude Code, opencode, Copilot, Gemini, Codex, Cursor, Kimi, Pi, Antigravity + CLI. |
163
-
164
- → All features, with how-to-use + scenarios: [Every feature](docs/concepts/features.md) · [Full pipeline](docs/concepts/workflow.md) · [Lanes](docs/concepts/lanes.md) · [Modes](docs/concepts/modes.md) · [Config](docs/concepts/config.md) · [Audit trail](docs/concepts/audit-trail.md) · [Cost](docs/concepts/cost.md) · [Provenance](docs/concepts/provenance.md) · [Policy](docs/concepts/policy-as-code.md) · [Closure tools](docs/concepts/closure-tools.md) · [Permissions](docs/concepts/permissions.md)
165
-
166
- ## The pipeline
167
-
168
- ```mermaid
169
- flowchart TB
170
- L0["Luffy - Triage"] --> L1["Usopp - Brainstorm"] --> L2["Nami - Plan"] --> L3["Zoro - Execute"] --> L4["Chopper - Audit"]
171
- L4 --> L5["Sanji - Quality"] --> L6["Franky - Gates"]
172
- L6 --> L7R["Robin - Review"]
173
- L6 --> L7J["Jinbe - Security"]
174
- L7R --> L8["Brook - Heal"]
175
- L7J --> L8
176
- L8 --> L9["Luffy - Closure"]
177
- L8 -. "heal ≤3 cycles" .-> L4
178
- ```
87
+ Four ideas explain almost everything:
179
88
 
180
- [Full pipeline details](docs/concepts/workflow.md)
89
+ ### 1. The crew pipeline
90
+ A mission runs as **flow stages**, each owned by one crew member — triage →
91
+ brainstorm → plan → execute → audit → quality → gates → review → heal →
92
+ closure. Every stage reports a compact checkpoint you can read in your chat.
181
93
 
182
- ## The crew
94
+ [Full pipeline](docs/concepts/workflow.md) · [The crew](docs/concepts/agents.md)
183
95
 
184
- 11 agents (+3 internal), one specialist per role auditors and reviewers are
185
- read-only by declared tool scope. Full table, summoning syntax, and boundary
186
- rules live in one place:
96
+ ### 2. Lanesprocess sizes itself
97
+ Work is sized to the diff. A typo gets no pipeline; an auth migration gets all
98
+ nine stages. Lanes: `direct` / `lean` / `standard` / `full` / `spike`.
187
99
 
188
- [Agent details: roles, scopes, summoning, boundaries](docs/concepts/agents.md)
100
+ | Lane | Flow stages | Typical tokens | Budget |
101
+ | ---- | :---: | :---: | :---: |
102
+ | Direct (typo) | 0 | ~0 | — |
103
+ | Lean (small bug) | 2 | ~8k | 12k |
104
+ | Standard (feature) | 5–7 | ~13k | 25k |
105
+ | Full (architecture) | 9–11 | ~22k | 50k |
189
106
 
190
- ## Team collaboration
107
+ [Lanes](docs/concepts/lanes.md)
191
108
 
192
- Mugiwara is built for a team sharing one repo. Identity is **(mission, member)**,
193
- never branch so any number of engineers can run parallel work without
194
- colliding, and one engineer can juggle several missions.
109
+ ### 3. Modes how much you participate
110
+ `guided` (approve every step), `semi` (approve the plan, then auto), `auto`
111
+ (full autonomy within your scope).
195
112
 
196
- ```
197
- .mugiwara/
198
- └── missions/<mission>/
199
- ├── plan.md # ONE shared plan (source of truth)
200
- ├── state.json # solo state
201
- ├── <member>.json # per-member state
202
- ├── continue.json # solo resume point
203
- └── continue-<member>.json # per-member resume point
204
- ```
113
+ → [Modes](docs/concepts/modes.md)
205
114
 
206
- Quick start for a team:
115
+ ### 4. Cost Governor — what is safe to spend
116
+ Per-lane budgets, a **live slop governor** that flags wasted cost and
117
+ attributes it to the crew member that caused it, and a `mugiwara cost` ledger.
207
118
 
208
- ```bash
209
- # Nami writes one plan; very-large scopes get a ## Mission split with a
210
- # sub-mission per part, each with its own branch and done-criteria.
119
+ → [Cost model](docs/concepts/cost.md)
211
120
 
212
- # Each member works on their own branch, resumes only their own work
213
- /mugiwara continue # list every in-flight mission for YOU
214
- /mugiwara continue payment-gateway # solo resume; team list members
215
- /mugiwara continue payment-gateway patty # resume exactly patty's work
121
+ ### Adaptive execution
122
+ Three decisions stay **independent**: your **control mode** (how much you
123
+ approve), the **execution posture** (how work runs inline / parallel /
124
+ context-relief / phase / team), and the **Cost Governor** (what is safe to
125
+ spend). The crew picks the posture from evidence at each flow boundary; a
126
+ Full-lane mission can be Guided and inline, a Lean mission can be Auto and
127
+ sequential. Inline stays the default.
216
128
 
217
- # Coordination radar
218
- mugiwara status # computed per-mission position: flow stage, tasks, lane, blockers
219
- ```
129
+ [Adaptive execution](docs/concepts/execution-model.md)
220
130
 
221
- Auto mode runs every flow stage autonomously — and never downgrades to guided
222
- mid-mission. In a team plan, auto covers **your member scope only**: resuming
223
- your sub-mission runs it to ship, never the other members'.
131
+ ---
224
132
 
225
- [Multi-actor reference](references/multi-actor.md)
133
+ ## See the evidence
226
134
 
227
- ## When not to use Mugiwara
135
+ A closed mission leaves a report you can actually read — and after
136
+ `mugiwara archive <mission>`, the whole trail folds INTO it. This is the shape
137
+ of `.mugiwara/missions/<mission>/report.md`:
228
138
 
229
- - **Prototyping or spikes** — use Lane 4, or skip mugiwara entirely.
230
- - **Unattended multi-hour runs** — the crew runs inline so you can interrupt it.
231
- If you want to walk away, superpowers' subagent-driven-development is built
232
- for that.
233
- - **Solo scripts with no review path** — the audit trail has no audience.
234
- - **Harnesses without agent dispatch** (Gemini, Codex, tier 3) — you get the
235
- workflow and the trail, not enforced role boundaries.
139
+ # Mission: invitation-accepted-flow . 2026-08-11
236
140
 
237
- ## Configuration
141
+ **Lane** full . **Mode** guided . **Actor** john . **Branch** feature/MKR-412
238
142
 
239
- Switch mode any time: `/mugiwara guided | semi | auto`. Or edit `.mugiwara/config`:
143
+ ## What changed
144
+ 11 files, +340 LOC. Sensitive paths: src/auth/
240
145
 
241
- | Key | Default | What |
242
- | ------------------- | ------------------------------- | ---------------------------------------------- |
243
- | `mode` | guided | guided / semi / auto |
244
- | `branch` | `feature/{type}-{issue}-{slug}` | Branch naming |
245
- | `commit` | conventional | conventional / gitmoji / plain / template (e.g. `{issue}: {title}`) |
246
- | `auto_commit` | on | on / off — off disables commit+push in guided/semi |
247
- | `coverage_new` | 90 | Coverage threshold for new files (%) |
248
- | `coverage_modified` | 80 | Coverage threshold for modified files (%) |
249
- | `review_depth` | full | full / standard / quick — Robin's review depth |
250
- | `quality_depth` | full | full / standard / quick — Sanji's check depth |
251
- | `verify_merged` | off | on merges Flow 5+6 into one verify pass (never Lane 3) |
252
- | `delegate_threshold`| 60 | % of token budget at which remaining tasks dispatch to workers |
253
- | `heal_max_cycles` | 3 | Max heal-loop cycles before human escalation |
254
- | `verbosity` | normal | normal / full — how much the crew echoes. `normal` hides investigation steps (reads, greps) and file contents; edits, results, decisions stay visible. `full` echoes everything. Never suppresses decisions, questions, blockers, or lane rises |
255
-
256
- Set via edit directly (`.mugiwara/config`). Unknown keys ignored. Project
257
- config (`.mugiwara/config`) overrides global (`~/.mugiwara/config`).
258
-
259
- **How much does the crew ask you?**
260
-
261
- | Mode | Plan | Execution | Ambiguities |
262
- | --------- | ---- | --------- | ----------- |
263
- | `guided` | you approve every step | ask before each flow stage | ask the user |
264
- | `semi` | you approve the written plan | auto from Flow 3 to ship | ask the user |
265
- | `auto` | auto | auto all the way to ship (your member scope in a team) | resolved internally (brainstorm → Luffy decides) |
266
-
267
- In `auto`, the crew runs every flow stage autonomously — triage, plan, execute,
268
- quality, gates, review, heal, closure — and never downgrades to guided
269
- mid-mission. Only a genuine blocker or the heal halt pauses.
270
-
271
- → [All config keys](docs/concepts/config.md) · [Mode details](docs/concepts/modes.md)
146
+ ## Flow stages
147
+ Execute (Flow 3) PASS · Checkpoint (Flow 4) PASS · Quality (Flow 5) PASS
148
+ Gates (Flow 6) PASS · Healing (Flow 8) PASS · Closure (Flow 9) GO
272
149
 
273
- ## Quick reference
150
+ ## Review & blockers
151
+ Review + security: 3 findings · Blocker ledger: 1 row
274
152
 
275
- | Need | Command / Doc |
276
- | ----------------------- | ---------------------------------------- |
277
- | Review a PR diff | `/mugiwara-review` or "review this PR" |
278
- | Security audit | `/mugiwara-security` or "Jinbe, audit X" |
279
- | Resume a mission | `/mugiwara continue <mission> [member]` or "where were we?" |
280
- | See mission position | `mugiwara status` (flow stage, tasks, lane, blockers, budget) |
281
- | Close out a mission | `mugiwara archive <mission>` — folds the trail into report.md |
282
- | Tidy closed missions | `mugiwara clean` (batch; `--all --force` includes in-flight) |
283
- | Switch mode | `/mugiwara guided\|semi\|auto` |
284
- | Check gate locally | `bun run gate` |
285
- | All docs | [docs/](docs/) |
153
+ ## State
154
+ Flow 9 · 6/6 tasks · 0 blockers · 1 heal · 14,200 / 20,000 tokens
286
155
 
287
- ## Install
156
+ ---
288
157
 
289
- <details>
290
- <summary><b>Claude Code</b></summary>
158
+ ## What Mugiwara does
291
159
 
292
- ```bash
293
- /plugin marketplace add ionivetech/mugiwara && /plugin install mugiwara
294
- ```
160
+ **Every day, on every repo:**
295
161
 
296
- Uninstall: `/plugin uninstall mugiwara`
162
+ | Feature | What you get |
163
+ |---|---|
164
+ | **Lane sizing** | Work auto-sized from `git diff`. Typo = instant fix. Auth migration = full pipeline. |
165
+ | **Evidence trail** | `.mugiwara/` workspace: plans, audit reports, quality reports, review findings, blocker ledger. |
166
+ | **Adaptive execution** | Picks an execution posture from evidence at each flow boundary — cost-aware, never a mode flip. |
167
+ | **Live slop governor** | Flags wasted cost live and attributes it per crew member. `mugiwara cost` shows it. |
168
+ | **Closure integrity** | Archive fails on dangling links, secrets in the trail, or missing evidence. |
169
+ | **Provenance** | Per-commit attribution — agent, model, lane, evidence. `mugiwara blame`. |
170
+ | **Rollback map** | Executable `rollback.sh` per mission: exact revert commands. Human runs it. |
171
+ | **Staleness guard** | Resume warns when main moved past the mission's base. |
297
172
 
298
- </details>
173
+ **When a team scales it up:**
299
174
 
300
- <details>
301
- <summary><b>OpenCode</b></summary>
175
+ | Feature | What you get |
176
+ |---|---|
177
+ | **Policy as code** | `mugiwara.policy.yml`: force lanes up, raise coverage gates, flag paths for human approval. |
178
+ | **Signed attestation** | Optional signing of the report — evidence that cannot be edited after the fact. |
179
+ | **Handoff** | `mugiwara handoff`: engineer-to-engineer report from computed state. |
180
+ | **Context budget** | Trail size measured at closure; optional ceiling fails the archive like a test. |
181
+ | **Team collaboration** | One shared plan, per-(mission, member) state + resume. Zero collisions. |
302
182
 
303
- Add to `opencode.json`:
183
+ **Always on, under the surface:**
304
184
 
305
- ```json
306
- { "plugin": ["@ionivetech/mugiwara"] }
307
- ```
185
+ | Feature | What you get |
186
+ |---|---|
187
+ | **Self-healing** | Brook reads all failures at once, fixes root causes, re-runs verification. ≤3 cycles. |
188
+ | **Resume from anywhere** | Rebuilds from `.mugiwara/` state. Continues, never restarts. |
189
+ | **12 platforms** | Claude Code, opencode, Copilot, Gemini, Codex, Cursor, Kimi, Pi, Antigravity + CLI. |
308
190
 
309
- Update: `rm -rf ~/.cache/opencode/packages/@ionivetech/mugiwara* && opencode plugin @ionivetech/mugiwara -g` ([details](docs/install/opencode.md#update))
191
+ All features, with how-to-use + scenarios: [Every feature](docs/concepts/features.md)
310
192
 
311
- Uninstall: remove `"@ionivetech/mugiwara"` from `opencode.json` plugins array
193
+ ---
312
194
 
313
- </details>
195
+ ## Team collaboration
314
196
 
315
- <details>
316
- <summary><b>Gemini CLI</b></summary>
197
+ Built for a team sharing one repo. Identity is **(mission, member)**, never
198
+ branch — so any number of engineers run parallel work without colliding.
317
199
 
318
200
  ```bash
319
- gemini extensions install https://github.com/ionivetech/mugiwara
201
+ /mugiwara continue # list every in-flight mission for YOU
202
+ /mugiwara continue payment-gateway # solo → resume; team → list members
203
+ /mugiwara continue payment-gateway patty # resume exactly patty's work
204
+ mugiwara status # computed per-mission position
320
205
  ```
321
206
 
322
- Uninstall: `gemini extensions uninstall mugiwara`
207
+ Auto mode runs your **member scope only** — resuming your sub-mission runs it to
208
+ ship, never the other members'.
323
209
 
324
- </details>
325
-
326
- <details>
327
- <summary><b>Codex</b></summary>
328
-
329
- ```bash
330
- codex plugin marketplace add ionivetech/mugiwara && codex plugin add mugiwara@mugiwara
331
- ```
210
+ → [Multi-actor reference](references/multi-actor.md)
332
211
 
333
- Uninstall: `codex plugin remove mugiwara@mugiwara`
212
+ ---
334
213
 
335
- </details>
214
+ ## When not to use Mugiwara
336
215
 
337
- <details>
338
- <summary><b>GitHub Copilot</b></summary>
216
+ - **Prototyping or spikes** — use Lane 4, or skip mugiwara entirely.
217
+ - **Unattended multi-hour runs** — the crew runs inline so you can interrupt it.
218
+ - **Solo scripts with no review path** — the audit trail has no audience.
219
+ - **Harnesses without agent dispatch** (Gemini, Codex, tier 3) — you get the
220
+ workflow and the trail, not enforced role boundaries.
339
221
 
340
- ```bash
341
- copilot plugin install https://github.com/ionivetech/mugiwara
342
- ```
222
+ ---
343
223
 
344
- Uninstall: `copilot plugin uninstall mugiwara`
224
+ ## Configuration
345
225
 
346
- </details>
226
+ Switch mode any time: `/mugiwara guided | semi | auto`. Or edit `.mugiwara/config`:
347
227
 
348
- <details>
349
- <summary><b>Cursor</b></summary>
228
+ | Key | Default | What |
229
+ |---|---|---|
230
+ | `mode` | guided | guided / semi / auto |
231
+ | `branch` | `feature/{type}-{issue}-{slug}` | Branch naming |
232
+ | `commit` | conventional | conventional / gitmoji / plain / template |
233
+ | `auto_commit` | on | off disables commit+push in guided/semi |
234
+ | `coverage_new` | 85 | Coverage threshold for new files (%) |
235
+ | `coverage_modified` | 90 | Coverage threshold for modified files (%) |
236
+ | `delegate_threshold` | 60 | % of budget at which remaining tasks dispatch to workers |
237
+ | `heal_max_cycles` | 3 | Max heal-loop cycles before human escalation |
238
+ | `verbosity` | normal | normal / full — how much the crew echoes |
350
239
 
351
- ```bash
352
- /add-plugin mugiwara
353
- ```
240
+ Project config (`.mugiwara/config`) overrides global (`~/.mugiwara/config`).
354
241
 
355
- Uninstall: `/remove-plugin mugiwara`
242
+ [All config keys](docs/concepts/config.md)
356
243
 
357
- </details>
244
+ ---
358
245
 
359
- <details>
360
- <summary><b>Antigravity</b></summary>
246
+ ## Quick reference
361
247
 
362
- ```bash
363
- agy plugin install https://github.com/ionivetech/mugiwara
364
- ```
248
+ | Need | Command / Doc |
249
+ |---|---|
250
+ | Review a PR diff | `/mugiwara-review` or "review this PR" |
251
+ | Security audit | `/mugiwara-security` or "Jinbe, audit X" |
252
+ | Resume a mission | `/mugiwara continue <mission> [member]` |
253
+ | See mission position | `mugiwara status` |
254
+ | See cost + live slop | `mugiwara cost` |
255
+ | Close out a mission | `mugiwara archive <mission>` |
256
+ | Switch mode | `/mugiwara guided\|semi\|auto` |
257
+ | All docs | [docs/](docs/) |
365
258
 
366
- Uninstall: `agy plugin uninstall mugiwara`
259
+ ---
367
260
 
368
- </details>
261
+ ## Install
369
262
 
370
263
  <details>
371
- <summary><b>Kimi</b></summary>
264
+ <summary><b>Claude Code</b></summary>
372
265
 
373
266
  ```bash
374
- /plugins install https://github.com/ionivetech/mugiwara
267
+ /plugin marketplace add ionivetech/mugiwara && /plugin install mugiwara
375
268
  ```
376
-
377
- Uninstall: `/plugins uninstall mugiwara`
269
+ Uninstall: `/plugin uninstall mugiwara`
378
270
 
379
271
  </details>
380
272
 
381
273
  <details>
382
- <summary><b>Pi</b></summary>
274
+ <summary><b>OpenCode</b></summary>
383
275
 
384
- ```bash
385
- pi install git:github.com/ionivetech/mugiwara
276
+ Add to `opencode.json`:
277
+ ```json
278
+ { "plugin": ["@ionivetech/mugiwara"] }
386
279
  ```
387
-
388
- Uninstall: `pi uninstall mugiwara`
280
+ Update: `rm -rf ~/.cache/opencode/packages/@ionivetech/mugiwara* && opencode plugin @ionivetech/mugiwara -g` ([details](docs/install/opencode.md#update))
281
+ Uninstall: remove `"@ionivetech/mugiwara"` from the plugins array
389
282
 
390
283
  </details>
391
284
 
392
285
  <details>
393
- <summary><b>Windsurf / Cline / Kilo</b> CLI install</summary>
394
-
395
- ```bash
396
- npx @ionivetech/mugiwara@latest install --target <id> --yes
397
- ```
398
-
399
- Uninstall: `npx @ionivetech/mugiwara@latest uninstall`
286
+ <summary><b>Gemini CLI / Codex / Copilot / Cursor / Antigravity / Kimi / Pi</b></summary>
400
287
 
401
- Targets: `windsurf`, `cline`, `kilo`, `codex`.
288
+ See [per-platform guides](docs/install/index.md) each has a one-line install
289
+ and uninstall.
402
290
 
403
291
  </details>
404
292
 
405
293
  <details>
406
- <summary><b>Global CLI</b> — shorter commands after first install</summary>
294
+ <summary><b>Any platform via CLI</b></summary>
407
295
 
408
296
  ```bash
409
- npm i -g @ionivetech/mugiwara
410
- mugiwara install --target all --yes
297
+ npx @ionivetech/mugiwara@latest install --target <id> --yes # windsurf, cline, kilo, codex
298
+ npm i -g @ionivetech/mugiwara && mugiwara install --target all --yes
411
299
  ```
412
300
 
413
- Uninstall: `mugiwara uninstall`
414
-
415
301
  </details>
416
302
 
417
303
  All platforms get the full crew — 11 agents (+3 internal), 21 skills.
418
304
  Enforcement depth varies by harness; see the [harness matrix](docs/reference/harness-matrix.md).
419
305
 
420
- → [How the skills stay small: three-layer disclosure](docs/reference/skill-anatomy.md)
421
-
422
- → [Per-platform guides](docs/install/index.md)
423
-
424
- ## Update
425
-
426
- ```bash
427
- # opencode — clear the pinned cache, then reinstall (npm update alone does NOT work)
428
- rm -rf ~/.cache/opencode/packages/@ionivetech/mugiwara* && opencode plugin @ionivetech/mugiwara -g
429
-
430
- # Claude Code — marketplace
431
- /plugin update mugiwara
432
-
433
- # CLI — npm global
434
- npm i -g @ionivetech/mugiwara@latest
435
- ```
436
-
437
- OpenCode pins the resolved version in its own package cache, so `npm update`
438
- never touches it. Reinstall with the same command for GitHub-based plugins
439
- (Gemini, Codex, Copilot, Cursor, Kimi, Pi, Antigravity).
440
-
441
- → [Per-platform guides](docs/install/index.md)
306
+ ---
442
307
 
443
308
  ## CLI
444
309
 
@@ -447,35 +312,35 @@ mugiwara install # wizard (interactive)
447
312
  mugiwara install --target all --yes # non-interactive
448
313
  mugiwara update --target <id> --yes # overwrite to latest
449
314
  mugiwara uninstall # remove installed files
450
- mugiwara list # show installations
451
- mugiwara list --check # health check
315
+ mugiwara list [--check] # show / health-check installations
452
316
  mugiwara status # computed mission state
453
- mugiwara continue [mission] [member] # resume / list in-flight
454
- mugiwara archive <mission> # fold the trail into report.md (integrity-gated)
317
+ mugiwara continue [mission] [member] # resume / list in-flight (read-only)
318
+ mugiwara cost [--mission <id>] [--json] # cost ledger, avoided work, live slop
319
+ mugiwara archive <mission> # fold the trail into report.md
455
320
  mugiwara clean [--all] [--before <date>] # batch-archive closed missions
456
- mugiwara blame <path> # provenance note on the last commit touching path
321
+ mugiwara blame <path> # provenance on the last commit touching path
457
322
  mugiwara handoff <mission> # engineer-to-engineer handoff report
458
- mugiwara sign <mission> [--verify] # optional minisign attestation of report.md
323
+ mugiwara sign <mission> [--verify] # optional report attestation
459
324
  mugiwara reset --keep-logs # wipe state, keep lessons
460
325
  ```
461
326
 
327
+ ---
328
+
462
329
  ## Docs
463
330
 
464
331
  **Start here:** [Getting started](docs/getting-started.md) · [What mugiwara replaces](docs/concepts/comparison.md)
465
332
 
466
333
  **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)
467
334
 
468
- **Adopt:** [Adoption guide](docs/reference/adoption-guide.md) · [Adoption kit](docs/adoption.md)
335
+ **Crew:** [Agents](docs/concepts/agents.md) · [Skills](docs/concepts/skills.md) · [Adaptive execution](docs/concepts/execution-model.md)
469
336
 
470
- **Crew:** [Agents](docs/concepts/agents.md) · [Skills](docs/concepts/skills.md)
337
+ **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)
471
338
 
472
- **Reference:** [Agent anatomy](docs/reference/agent-anatomy.md) · [Skill anatomy](docs/reference/skill-anatomy.md) · [Harness matrix](docs/reference/harness-matrix.md) · [Compliance matrix](docs/reference/compliance-matrix.md) · [Developer onboarding](docs/reference/developer-onboarding.md)
473
-
474
- **Install per platform:** [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)
339
+ **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)
475
340
 
476
341
  **Troubleshooting:** [Common problems](docs/troubleshooting.md)
477
342
 
478
- **Roadmap:** [ROADMAP.md](ROADMAP.md)
343
+ ---
479
344
 
480
345
  ## What is measured, and what is not
481
346
 
@@ -486,11 +351,12 @@ mugiwara reset --keep-logs # wipe state, keep lessons
486
351
  | Index size published vs measured | **doc-gated** — validator fails on drift, in CI |
487
352
  | Lane constants match content load | **verified**, in CI |
488
353
  | Write-scope enforcement | **opencode only** — rules-based elsewhere |
489
- | Cross-harness mission behavior | **12/12 platforms** — 9 rules-dir installs + 3 marketplace manifests, in CI |
490
- | Outcome vs other approaches | **not measured** — see roadmap |
354
+ | Cross-harness mission behavior | **12/12 platforms**, in CI |
355
+ | Outcome vs other approaches | **not measured** |
356
+
357
+ Numbers here are produced by `bun run gate`. Nothing in this table is an estimate.
491
358
 
492
- Numbers here are produced by `bun run gate`. Nothing in this table is an
493
- estimate.
359
+ ---
494
360
 
495
361
  ## License
496
362