@ionivetech/mugiwara 0.6.6 → 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 (138) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +2 -7
  3. package/.codex-plugin/plugin.json +2 -7
  4. package/.cursor-plugin/plugin.json +2 -7
  5. package/.kimi-plugin/plugin.json +2 -7
  6. package/.opencode/mugiwara-helpers.mjs +2 -2
  7. package/.opencode/plugins/mugiwara.mjs +3 -18
  8. package/AGENTS.md +5 -4
  9. package/GEMINI.md +3 -3
  10. package/README.md +203 -331
  11. package/content/agents/brook-healing.md +8 -4
  12. package/content/agents/chopper-checkpoint.md +7 -3
  13. package/content/agents/eval-runner.md +4 -4
  14. package/content/agents/franky-gates.md +4 -4
  15. package/content/agents/jinbe-security.md +6 -7
  16. package/content/agents/luffy-orchestrator.md +11 -13
  17. package/content/agents/memory-keeper.md +4 -4
  18. package/content/agents/nami-planner.md +4 -4
  19. package/content/agents/resume-coordinator.md +7 -7
  20. package/content/agents/robin-reviewer.md +7 -3
  21. package/content/agents/sanji-quality.md +2 -2
  22. package/content/agents/skeptic-verifier.md +2 -2
  23. package/content/agents/usopp-brainstorm.md +3 -3
  24. package/content/agents/zoro-execution.md +6 -6
  25. package/content/skills/mugiwara-backend/SKILL.md +54 -43
  26. package/content/skills/mugiwara-backend/references/database.md +61 -0
  27. package/content/skills/mugiwara-brainstorm/SKILL.md +1 -1
  28. package/content/skills/mugiwara-checkpoint/SKILL.md +23 -11
  29. package/content/skills/mugiwara-checkpoint/references/ledger-format.md +1 -1
  30. package/content/skills/mugiwara-contract-first/SKILL.md +46 -1
  31. package/content/skills/mugiwara-execution/SKILL.md +37 -37
  32. package/content/skills/mugiwara-execution/references/dispatch.md +1 -1
  33. package/content/skills/mugiwara-execution/references/execution-phase-flows.md +18 -0
  34. package/content/skills/mugiwara-execution/references/resume-batching.md +2 -2
  35. package/content/skills/mugiwara-frontend/SKILL.md +44 -43
  36. package/content/skills/mugiwara-frontend/references/checklist.md +14 -0
  37. package/content/skills/mugiwara-gates/SKILL.md +23 -14
  38. package/content/skills/mugiwara-healing/SKILL.md +26 -25
  39. package/content/skills/mugiwara-lessons/SKILL.md +2 -2
  40. package/content/skills/mugiwara-orchestration/SKILL.md +11 -11
  41. package/content/skills/mugiwara-orchestration/references/check-ins.md +2 -2
  42. package/content/skills/mugiwara-orchestration/references/closure.md +17 -12
  43. package/content/skills/mugiwara-orchestration/references/control-commands.md +14 -0
  44. package/content/skills/mugiwara-orchestration/references/triage-escalation.md +11 -1
  45. package/content/skills/mugiwara-planning/SKILL.md +26 -29
  46. package/content/skills/mugiwara-planning/references/large-campaign-subplan.md +41 -0
  47. package/content/skills/mugiwara-planning/references/plan-template.md +24 -2
  48. package/content/skills/mugiwara-quality/SKILL.md +21 -12
  49. package/content/skills/mugiwara-resume/SKILL.md +8 -3
  50. package/content/skills/mugiwara-review/SKILL.md +19 -13
  51. package/content/skills/mugiwara-security/SKILL.md +47 -36
  52. package/content/skills/mugiwara-ship/SKILL.md +1 -1
  53. package/content/skills/mugiwara-ship/references/cleanup.md +17 -16
  54. package/content/skills/mugiwara-workflow/SKILL.md +11 -17
  55. package/content/skills/mugiwara-workflow/references/adaptive-budget-governor.md +5 -0
  56. package/content/skills/mugiwara-workflow/references/benchmark-governor.md +53 -0
  57. package/content/skills/mugiwara-workflow/references/cognitive-output-governor.md +5 -0
  58. package/content/skills/mugiwara-workflow/references/large-campaign-subplan.md +29 -0
  59. package/content/skills/mugiwara-workflow/references/scope-code-governor.md +14 -0
  60. package/content/skills/mugiwara-workflow/references/stop-slop-governor.md +14 -0
  61. package/content/skills/mugiwara-workflow/references/workspace-layout.md +42 -38
  62. package/dist/mugiwara.js +1642 -528
  63. package/gemini-extension.json +1 -1
  64. package/hooks/auto-savepoint.js +18 -10
  65. package/hooks/auto-savepoint.ts +23 -23
  66. package/hooks/engagement-marker.js +1 -1
  67. package/hooks/engagement-marker.ts +1 -1
  68. package/hooks/pipeline-guard.js +17 -13
  69. package/hooks/pipeline-guard.ts +24 -20
  70. package/hooks/session-start.js +13 -10
  71. package/hooks/session-start.ts +24 -19
  72. package/package.json +2 -2
  73. package/plugin.json +1 -1
  74. package/references/complexity.md +27 -4
  75. package/references/definition-of-done.md +1 -1
  76. package/references/multi-actor.md +20 -2
  77. package/references/posture-routing.md +31 -0
  78. package/references/prose-style.md +54 -0
  79. package/scripts/benchmark-governor.ts +516 -0
  80. package/scripts/benchmark-thresholds.json +47 -0
  81. package/scripts/check-doc-links.ts +46 -0
  82. package/scripts/conformance.ts +6 -16
  83. package/scripts/coverage-gate.ts +20 -6
  84. package/scripts/gate-selftest.ts +138 -7
  85. package/scripts/lane.sh +54 -8
  86. package/scripts/lib/lane-base.sh +4 -4
  87. package/scripts/lib/patterns.sh +5 -0
  88. package/scripts/policy-force.ts +22 -0
  89. package/scripts/retrieval-eval.ts +10 -4
  90. package/scripts/savepoint.sh +155 -58
  91. package/scripts/validate-content.ts +43 -11
  92. package/scripts/verify-install.ts +9 -7
  93. package/src/adaptive-budget.ts +178 -0
  94. package/src/args.ts +4 -3
  95. package/src/budget.ts +47 -0
  96. package/src/check-artifacts.ts +45 -0
  97. package/src/cli.ts +257 -108
  98. package/src/cognition.ts +234 -0
  99. package/src/config.ts +107 -0
  100. package/src/context.ts +72 -0
  101. package/src/continue.ts +29 -10
  102. package/src/cost.ts +186 -0
  103. package/src/evidence.ts +160 -0
  104. package/src/installer.ts +25 -34
  105. package/src/integrity.ts +158 -0
  106. package/src/investigation.ts +72 -0
  107. package/src/mission.ts +341 -94
  108. package/src/policy.ts +156 -0
  109. package/src/posture.ts +86 -0
  110. package/src/provenance.ts +116 -0
  111. package/src/reporting.ts +225 -0
  112. package/src/rollback.ts +95 -0
  113. package/src/routing.ts +69 -0
  114. package/src/run.ts +2 -2
  115. package/src/scope.ts +321 -0
  116. package/src/sign.ts +235 -0
  117. package/src/slop.ts +306 -0
  118. package/src/targets/claude.ts +2 -2
  119. package/src/work.ts +273 -0
  120. package/.opencode/commands/mugiwara-execute.md +0 -13
  121. package/.opencode/commands/mugiwara-heal.md +0 -13
  122. package/.opencode/commands/mugiwara-onboard.md +0 -14
  123. package/.opencode/commands/mugiwara-plan.md +0 -17
  124. package/.opencode/commands/mugiwara-ship.md +0 -13
  125. package/.opencode/commands/using-mugiwara.md +0 -20
  126. package/content/skills/mugiwara-agent-security/SKILL.md +0 -58
  127. package/content/skills/mugiwara-agent-security/references/checklist.md +0 -20
  128. package/content/skills/mugiwara-context-budget/SKILL.md +0 -66
  129. package/content/skills/mugiwara-context-budget/references/context-budget.md +0 -37
  130. package/content/skills/mugiwara-pr/SKILL.md +0 -69
  131. package/content/skills/mugiwara-pr/references/verdict-format.md +0 -31
  132. package/content/skills/mugiwara-sunset/SKILL.md +0 -82
  133. package/content/skills/using-mugiwara/SKILL.md +0 -51
  134. package/references/token-budget.md +0 -56
  135. package/scripts/evidence.sh +0 -81
  136. package/scripts/initiative.ts +0 -296
  137. package/scripts/mission-report.sh +0 -293
  138. package/src/onboard.ts +0 -207
package/README.md CHANGED
@@ -6,86 +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. This is the exact
31
- format `mugiwara run mission-report.sh` produces:
32
-
33
- # Mission: invitation-accepted-flow . 2026-08-11
34
-
35
- **Lane** full . **Mode** guided . **Actor** john . **Branch** feature/MKR-412
36
-
37
- ## What changed
38
-
39
- 11 files, +340 LOC
40
- Sensitive paths: src/auth/
41
-
42
- ## Flow stages
43
-
44
- | Flow stage | Artifact | Verdict |
45
- |------|----------|---------|
46
- | Execute (Flow 3) | `01-execution.md` | PASS |
47
- | Checkpoint (Flow 4) | `02-audit.md` | PASS |
48
- | Quality (Flow 5) | `03-quality.md` | PASS |
49
- | Gates (Flow 6) | `04-gates.md` | PASS |
50
- | Healing (Flow 8) | `05-healing.md` | PASS |
51
- | Closure (Flow 9) | `06-closure.md` | GO |
52
-
53
- ## Review & blockers
54
-
55
- Review + security files: invitation-accepted-flow-review.md, invitation-accepted-flow-security.md
56
- Findings: 3
57
- Blocker ledger rows: 1
58
-
59
- ## State
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 work with a **ruled pipeline**, **evidence at every gate**, and
28
+ a **cost governor** that keeps spend visible and bounded.
60
29
 
61
- | Field | Value |
62
- |-------|-------|
63
- | Flow stage | 9 |
64
- | Tasks | 6/6 done |
65
- | Blockers open | 0 |
66
- | Heal cycles | 1 |
67
- | Tokens used | 14,200 / 20,000 |
30
+ Three things it does for you:
68
31
 
69
- ## 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. |
70
37
 
71
- Work is sized to the diffa typo gets no pipeline, an auth migration gets
72
- 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.
73
40
 
74
- | Lane | Flow stages | Typical tokens | Budget |
75
- | ------------------- | :---: | :------------: | :----: |
76
- | Direct (typo) | 0 | ~0 | — |
77
- | Lean (small bug) | 2 | ~7k | 12k |
78
- | Standard (feature) | 5–7 | ~13k | 25k |
79
- | Full (architecture) | 9–11 | ~23k | 50k |
41
+ [Why mugiwara vs just asking your agent](docs/concepts/comparison.md)
80
42
 
81
- Usage tracked in `.mugiwara/state/<mission>/[member].json` per mission. Budget warns at 1.5×,
82
- pauses at 3×. Lane bases are measured from the skills/agents loaded per lane
83
- by `scripts/lane-base.ts` — the constants fail CI if they drift from content
84
- load.
43
+ ---
85
44
 
86
- [Full cost model](docs/concepts/cost.md)
45
+ ## Quick start (5 minutes)
87
46
 
88
- ## 30-second try
47
+ Add the plugin, then just ask something non-trivial:
89
48
 
90
49
  ```bash
91
50
  # opencode — add to opencode.json, then restart
@@ -98,7 +57,7 @@ load.
98
57
  npx @ionivetech/mugiwara@latest install --target all --yes
99
58
  ```
100
59
 
101
- First run: run `mugiwara onboard` in your terminal for guided setup (zero-LLM wizard). Then ask something non-trivial:
60
+ First run writes `.mugiwara/config` with defaults. Then ask:
102
61
 
103
62
  ```
104
63
  > add role-based access control: admin, editor, viewer
@@ -107,342 +66,244 @@ First run: run `mugiwara onboard` in your terminal for guided setup (zero-LLM wi
107
66
  > split this feature across the team: payment gateway, ledger, fraud
108
67
  ```
109
68
 
110
- A Standard lane mission (~13k tokens) produces a branch with test-first
111
- commits, an audit report, a security review, and a ready PR summary — visible
112
- at every step in your chat.
113
-
114
69
  You ask. The crew routes automatically. **No agent names to memorize, no
115
- pipeline config to write.**
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.
116
73
 
117
- | You say | What happens |
118
- | ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
119
- | `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 |
120
- | `split payment system: gateway, ledger, fraud` | Nami interviews team → writes initiative plan with sub-missions + assignees → each dev works in own branch → the plan's sub-mission table shows progress → all done → initiative closure |
121
- | `Brook, fix the failing login test` | Healer reads failure ledger, root-cause fixes, proves fix ≤3 cycles |
122
- | `Jinbe, audit auth middleware` | STRIDE + OWASP + dependency audit. Read-only — never touches code |
123
- | `/mugiwara auto` | Switches to full autonomy — all flow stages run without asking, from the next flow stage |
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 |
124
80
 
125
- - **Full pipeline** when the task is big or direction is unclear
126
- - **Direct agent** when you know exactly what you need — say the name
127
- - **Slash commands** when you want to drive: `/mugiwara-plan`, `/mugiwara-review`, `/mugiwara-security`, `/mugiwara-ship`, `/mugiwara onboard`
81
+ [Full walkthrough](docs/getting-started.md)
128
82
 
129
- → [Full walkthrough](docs/getting-started.md) · [Full workflow walkthrough](docs/concepts/workflow.md)
83
+ ---
130
84
 
131
- ## What Mugiwara does
85
+ ## How it works (the short version)
132
86
 
133
- ### All features
134
-
135
- | Feature | What you get |
136
- | ------------------------ | ----------------------------------------------------------------------------------------------- |
137
- | **Lane sizing** | Work auto-sized from `git diff`. Typo = instant fix. Auth migration = full pipeline. |
138
- | **Evidence trail** | `.mugiwara/` workspace: plans, audit reports, quality reports, review findings, blocker ledger. |
139
- | **Team collaboration** | One shared plan, per-(mission, member) state + resume. Any number of engineers, zero collisions. |
140
- | **Self-healing** | Brook reads all failures at once, fixes root causes, re-runs verification. ≤3 cycles. |
141
- | **Resume from anywhere** | Session lost? Rebuilds from `.mugiwara/state/<mission>/` + machine-written `continue/<mission>/`. Continues, never restarts. Auto surfaces in-flight work (lists when ambiguous). |
142
- | **12 platforms** | Claude Code, opencode, Copilot, Gemini, Codex, Cursor, Kimi, Pi, Antigravity + CLI. |
143
-
144
- → All 28 features, with how-to-use + scenarios: [Every feature](docs/concepts/features.md) · [Team collaboration](docs/concepts/collaboration.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)
145
-
146
- ## The pipeline
147
-
148
- ```mermaid
149
- flowchart TB
150
- L0["Luffy - Triage"] --> L1["Usopp - Brainstorm"] --> L2["Nami - Plan"] --> L3["Zoro - Execute"] --> L4["Chopper - Audit"]
151
- L4 --> L5["Sanji - Quality"] --> L6["Franky - Gates"]
152
- L6 --> L7R["Robin - Review"]
153
- L6 --> L7J["Jinbe - Security"]
154
- L7R --> L8["Brook - Heal"]
155
- L7J --> L8
156
- L8 --> L9["Luffy - Closure"]
157
- L8 -. "heal ≤3 cycles" .-> L4
158
- ```
87
+ Four ideas explain almost everything:
159
88
 
160
- [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.
161
93
 
162
- ## The crew
94
+ [Full pipeline](docs/concepts/workflow.md) · [The crew](docs/concepts/agents.md)
163
95
 
164
- 11 agents (+3 internal). Each has role boundaries — auditors
165
- and reviewers are read-only. Call them by name or let the pipeline auto-route.
96
+ ### 2. Lanes process 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`.
166
99
 
167
- | Agent | Role | Permission |
168
- | -------------------- | --------------------------------------------------------------------------------------- | :-----------: |
169
- | `luffy-orchestrator` | Captain triage, check-ins, closure | |
170
- | `usopp-brainstorm` | Critical friend interrogates, researches, recommends | — |
171
- | `nami-planner` | Planner interviews, full scan, scaled plans, team initiatives | — |
172
- | `zoro-execution` | Executor TDD per task, evidence per commit | — |
173
- | `chopper-checkpoint` | Auditor — re-runs criteria, failure ledger | **read-only** |
174
- | `sanji-quality` | Quality — format, lint, test, duplication, complexity, maintainability, code attributes | — |
175
- | `franky-gates` | Gates — coverage, build, DoD, per-condition sonar gate | — |
176
- | `robin-reviewer` | Reviewer — breaking-change map, reliability rating, code attribute deep review | **read-only** |
177
- | `jinbe-security` | Security — STRIDE, OWASP, hotspots, SCA license, secret scan, responsibility | **read-only** |
178
- | `brook-healing` | Healer — reads ledger, root-cause fixes ≤3 cycles | — |
179
- | `resume-coordinator` | Resumer — rebuilds state from `.mugiwara/`, continues never restarts | — |
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 |
180
106
 
181
- **Internal agents** (dispatch-only):
107
+ [Lanes](docs/concepts/lanes.md)
182
108
 
183
- | Agent | Role | Used by |
184
- | ------------------ | ----------------------------------------------------- | ------------------------------ |
185
- | `skeptic-verifier` | Adversarial verifier — doubts every claim | Flow 4.5, high-stakes missions |
186
- | `eval-runner` | Harness tester — task suites, judge rubric | `bun scripts/run-evals.ts` |
187
- | `memory-keeper` | Lessons ledger — surface at start, capture at closure | Flow 0 (read), Flow 9 (write) |
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).
188
112
 
189
- → [Agent details: summoning, boundaries, parameters](docs/concepts/agents.md)
113
+ → [Modes](docs/concepts/modes.md)
190
114
 
191
- ## Team collaboration
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.
192
118
 
193
- Mugiwara is built for a team sharing one repo. Identity is **(mission, member)**,
194
- never branch — so any number of engineers can run parallel work without
195
- colliding, and one engineer can juggle several missions.
119
+ [Cost model](docs/concepts/cost.md)
196
120
 
197
- ```
198
- .mugiwara/
199
- ├── state/<mission>/state.json # solo state
200
- ├── state/<mission>/<member>.json # your team member state
201
- ├── continue/<mission>/state.json # solo resume point
202
- ├── continue/<mission>/<member>.json # your resume point
203
- └── plans/<mission>.md # ONE shared plan (source of truth)
204
- ```
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.
205
128
 
206
- Quick start for a team:
207
-
208
- ```bash
209
- # Nami writes one plan with a ## Sub-missions table (assignee + branch per member)
210
- /mugiwara-plan # guided/semi asks "Solo or team?"
211
-
212
- # Each member works on their own branch, resume 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
216
-
217
- # Coordination radar
218
- mugiwara initiative status plans/<mission>.md # who's where
219
- mugiwara initiative conflict-check plans/<mission>.md # shared-file overlap
220
- # In an installed project: read the sub-mission table in the plan doc, and
221
- # `mugiwara status` for computed per-mission position.
222
- ```
129
+ [Adaptive execution](docs/concepts/execution-model.md)
223
130
 
224
- Auto mode runs every flow stage autonomously — and never downgrades to guided
225
- mid-mission. In a team plan, auto covers **your member scope only**: resuming
226
- your sub-mission runs it to ship, never the other members'.
131
+ ---
227
132
 
228
- [Full collaboration guide with a worked example](docs/concepts/collaboration.md) · [Multi-actor reference](references/multi-actor.md)
133
+ ## See the evidence
229
134
 
230
- ## 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`:
231
138
 
232
- - **Prototyping or spikes** — use Lane 4, or skip mugiwara entirely.
233
- - **Unattended multi-hour runs** — the crew runs inline so you can interrupt it.
234
- If you want to walk away, superpowers' subagent-driven-development is built
235
- for that.
236
- - **Solo scripts with no review path** — the audit trail has no audience.
237
- - **Harnesses without agent dispatch** (Gemini, Codex, tier 3) — you get the
238
- workflow and the trail, not enforced role boundaries.
239
-
240
- ## Configuration
241
-
242
- Switch mode any time: `/mugiwara guided | semi | auto`. Or edit `.mugiwara/config`:
139
+ # Mission: invitation-accepted-flow . 2026-08-11
243
140
 
244
- | Key | Default | What |
245
- | ------------------- | ------------------------------- | ---------------------------------------------- |
246
- | `mode` | guided | guided / semi / auto |
247
- | `branch` | `feature/{type}-{issue}-{slug}` | Branch naming |
248
- | `commit` | conventional | conventional / gitmoji / plain / template (e.g. `{issue}: {title}`) |
249
- | `auto_commit` | on | on / off — off disables commit+push in guided/semi |
250
- | `coverage_new` | 90 | Coverage threshold for new files (%) |
251
- | `coverage_modified` | 80 | Coverage threshold for modified files (%) |
252
- | `review_depth` | full | full / standard / quick — Robin's review depth |
253
- | `quality_depth` | full | full / standard / quick — Sanji's check depth |
254
- | `delegate_threshold`| 60 | % of token budget at which remaining tasks dispatch to workers |
255
- | `heal_max_cycles` | 3 | Max heal-loop cycles before human escalation |
256
- | `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 |
257
-
258
- Set via `mugiwara onboard` or edit directly. Unknown keys ignored. Project
259
- config (`.mugiwara/config`) overrides global (`~/.mugiwara/config`).
260
-
261
- **How much does the crew ask you?**
262
-
263
- | Mode | Plan | Execution | Ambiguities |
264
- | --------- | ---- | --------- | ----------- |
265
- | `guided` | you approve every step | ask before each flow stage | ask the user |
266
- | `semi` | you approve the written plan | auto from Flow 3 to ship | ask the user |
267
- | `auto` | auto | auto all the way to ship (your member scope in a team) | resolved internally (brainstorm → Luffy decides) |
268
-
269
- In `auto`, the crew runs every flow stage autonomously — triage, plan, execute,
270
- quality, gates, review, heal, closure — and never downgrades to guided
271
- mid-mission. Only a genuine blocker or the heal halt pauses.
272
-
273
- → [All config keys](docs/concepts/config.md) · [Mode details](docs/concepts/modes.md)
141
+ **Lane** full . **Mode** guided . **Actor** john . **Branch** feature/MKR-412
274
142
 
275
- ## Quick reference
143
+ ## What changed
144
+ 11 files, +340 LOC. Sensitive paths: src/auth/
276
145
 
277
- | Need | Command / Doc |
278
- | ----------------------- | ---------------------------------------- |
279
- | First-time setup | `mugiwara onboard` (terminal) or `/mugiwara onboard` |
280
- | Plan a feature | `/mugiwara-plan` or just describe it |
281
- | Review a PR diff | `/mugiwara-review` or "review this PR" |
282
- | Security audit | `/mugiwara-security` or "Jinbe, audit X" |
283
- | Ship gate check | `/mugiwara-ship` |
284
- | See initiative progress | `mugiwara initiative status <plan>` |
285
- | Resume a mission | `/mugiwara continue <mission> [member]` or "where were we?" |
286
- | See mission position | `mugiwara status` (flow stage, tasks, lane, blockers, budget) |
287
- | Switch mode | `/mugiwara guided\|semi\|auto` |
288
- | Check gate locally | `bun run gate` |
289
- | All docs | [docs/](docs/) |
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
290
149
 
291
- ## Install
150
+ ## Review & blockers
151
+ Review + security: 3 findings · Blocker ledger: 1 row
292
152
 
293
- <details>
294
- <summary><b>Claude Code</b></summary>
153
+ ## State
154
+ Flow 9 · 6/6 tasks · 0 blockers · 1 heal · 14,200 / 20,000 tokens
295
155
 
296
- ```bash
297
- /plugin marketplace add ionivetech/mugiwara && /plugin install mugiwara
298
- ```
156
+ ---
299
157
 
300
- Uninstall: `/plugin uninstall mugiwara`
158
+ ## What Mugiwara does
301
159
 
302
- </details>
160
+ **Every day, on every repo:**
303
161
 
304
- <details>
305
- <summary><b>OpenCode</b></summary>
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. |
172
+
173
+ **When a team scales it up:**
174
+
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. |
306
182
 
307
- Add to `opencode.json`:
183
+ **Always on, under the surface:**
308
184
 
309
- ```json
310
- { "plugin": ["@ionivetech/mugiwara"] }
311
- ```
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. |
312
190
 
313
- 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)
314
192
 
315
- Uninstall: remove `"@ionivetech/mugiwara"` from `opencode.json` plugins array
193
+ ---
316
194
 
317
- </details>
195
+ ## Team collaboration
318
196
 
319
- <details>
320
- <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.
321
199
 
322
200
  ```bash
323
- 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
324
205
  ```
325
206
 
326
- Uninstall: `gemini extensions uninstall mugiwara`
327
-
328
- </details>
329
-
330
- <details>
331
- <summary><b>Codex</b></summary>
207
+ Auto mode runs your **member scope only** — resuming your sub-mission runs it to
208
+ ship, never the other members'.
332
209
 
333
- ```bash
334
- codex plugin marketplace add ionivetech/mugiwara && codex plugin add mugiwara@mugiwara
335
- ```
210
+ → [Multi-actor reference](references/multi-actor.md)
336
211
 
337
- Uninstall: `codex plugin remove mugiwara@mugiwara`
212
+ ---
338
213
 
339
- </details>
214
+ ## When not to use Mugiwara
340
215
 
341
- <details>
342
- <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.
343
221
 
344
- ```bash
345
- copilot plugin install https://github.com/ionivetech/mugiwara
346
- ```
222
+ ---
347
223
 
348
- Uninstall: `copilot plugin uninstall mugiwara`
224
+ ## Configuration
349
225
 
350
- </details>
226
+ Switch mode any time: `/mugiwara guided | semi | auto`. Or edit `.mugiwara/config`:
351
227
 
352
- <details>
353
- <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 |
354
239
 
355
- ```bash
356
- /add-plugin mugiwara
357
- ```
240
+ Project config (`.mugiwara/config`) overrides global (`~/.mugiwara/config`).
358
241
 
359
- Uninstall: `/remove-plugin mugiwara`
242
+ [All config keys](docs/concepts/config.md)
360
243
 
361
- </details>
244
+ ---
362
245
 
363
- <details>
364
- <summary><b>Antigravity</b></summary>
246
+ ## Quick reference
365
247
 
366
- ```bash
367
- agy plugin install https://github.com/ionivetech/mugiwara
368
- ```
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/) |
369
258
 
370
- Uninstall: `agy plugin uninstall mugiwara`
259
+ ---
371
260
 
372
- </details>
261
+ ## Install
373
262
 
374
263
  <details>
375
- <summary><b>Kimi</b></summary>
264
+ <summary><b>Claude Code</b></summary>
376
265
 
377
266
  ```bash
378
- /plugins install https://github.com/ionivetech/mugiwara
267
+ /plugin marketplace add ionivetech/mugiwara && /plugin install mugiwara
379
268
  ```
380
-
381
- Uninstall: `/plugins uninstall mugiwara`
269
+ Uninstall: `/plugin uninstall mugiwara`
382
270
 
383
271
  </details>
384
272
 
385
273
  <details>
386
- <summary><b>Pi</b></summary>
274
+ <summary><b>OpenCode</b></summary>
387
275
 
388
- ```bash
389
- pi install git:github.com/ionivetech/mugiwara
276
+ Add to `opencode.json`:
277
+ ```json
278
+ { "plugin": ["@ionivetech/mugiwara"] }
390
279
  ```
391
-
392
- 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
393
282
 
394
283
  </details>
395
284
 
396
285
  <details>
397
- <summary><b>Windsurf / Cline / Kilo</b> CLI install</summary>
286
+ <summary><b>Gemini CLI / Codex / Copilot / Cursor / Antigravity / Kimi / Pi</b></summary>
398
287
 
399
- ```bash
400
- npx @ionivetech/mugiwara@latest install --target <id> --yes
401
- ```
402
-
403
- Uninstall: `npx @ionivetech/mugiwara@latest uninstall`
404
-
405
- Targets: `windsurf`, `cline`, `kilo`, `codex`.
288
+ See [per-platform guides](docs/install/index.md) — each has a one-line install
289
+ and uninstall.
406
290
 
407
291
  </details>
408
292
 
409
293
  <details>
410
- <summary><b>Global CLI</b> — shorter commands after first install</summary>
294
+ <summary><b>Any platform via CLI</b></summary>
411
295
 
412
296
  ```bash
413
- npm i -g @ionivetech/mugiwara
414
- 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
415
299
  ```
416
300
 
417
- Uninstall: `mugiwara uninstall`
418
-
419
301
  </details>
420
302
 
421
- All platforms get the full crew — 11 agents (+3 internal), 26 skills.
303
+ All platforms get the full crew — 11 agents (+3 internal), 21 skills.
422
304
  Enforcement depth varies by harness; see the [harness matrix](docs/reference/harness-matrix.md).
423
305
 
424
- → [How the skills stay small: three-layer disclosure](docs/reference/skill-anatomy.md)
425
-
426
- → [Per-platform guides](docs/install/index.md)
427
-
428
- ## Update
429
-
430
- ```bash
431
- # opencode — clear the pinned cache, then reinstall (npm update alone does NOT work)
432
- rm -rf ~/.cache/opencode/packages/@ionivetech/mugiwara* && opencode plugin @ionivetech/mugiwara -g
433
-
434
- # Claude Code — marketplace
435
- /plugin update mugiwara
436
-
437
- # CLI — npm global
438
- npm i -g @ionivetech/mugiwara@latest
439
- ```
440
-
441
- OpenCode pins the resolved version in its own package cache, so `npm update`
442
- never touches it. Reinstall with the same command for GitHub-based plugins
443
- (Gemini, Codex, Copilot, Cursor, Kimi, Pi, Antigravity).
444
-
445
- → [Per-platform guides](docs/install/index.md)
306
+ ---
446
307
 
447
308
  ## CLI
448
309
 
@@ -451,40 +312,51 @@ mugiwara install # wizard (interactive)
451
312
  mugiwara install --target all --yes # non-interactive
452
313
  mugiwara update --target <id> --yes # overwrite to latest
453
314
  mugiwara uninstall # remove installed files
454
- mugiwara list # show installations
455
- mugiwara list --check # health check
315
+ mugiwara list [--check] # show / health-check installations
316
+ mugiwara status # computed mission state
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
320
+ mugiwara clean [--all] [--before <date>] # batch-archive closed missions
321
+ mugiwara blame <path> # provenance on the last commit touching path
322
+ mugiwara handoff <mission> # engineer-to-engineer handoff report
323
+ mugiwara sign <mission> [--verify] # optional report attestation
456
324
  mugiwara reset --keep-logs # wipe state, keep lessons
457
325
  ```
458
326
 
327
+ ---
328
+
459
329
  ## Docs
460
330
 
461
331
  **Start here:** [Getting started](docs/getting-started.md) · [What mugiwara replaces](docs/concepts/comparison.md)
462
332
 
463
- **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)
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)
464
334
 
465
- **Crew:** [Agents](docs/concepts/agents.md) · [Skills](docs/concepts/skills.md)
335
+ **Crew:** [Agents](docs/concepts/agents.md) · [Skills](docs/concepts/skills.md) · [Adaptive execution](docs/concepts/execution-model.md)
466
336
 
467
- **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)
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)
468
338
 
469
- **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)
470
340
 
471
341
  **Troubleshooting:** [Common problems](docs/troubleshooting.md)
472
342
 
473
- **Roadmap:** [ROADMAP.md](ROADMAP.md)
343
+ ---
474
344
 
475
345
  ## What is measured, and what is not
476
346
 
477
347
  | Claim | Status |
478
348
  |---|---|
479
- | Retrieval routing rank-1 | **93.5%**, 181 probes, offline, in CI |
349
+ | Retrieval routing rank-1 | **94.3%**, 150 probes, offline, in CI |
480
350
  | Reference pointers resolve | **66/66**, 3 tiers, in CI |
351
+ | Index size published vs measured | **doc-gated** — validator fails on drift, in CI |
481
352
  | Lane constants match content load | **verified**, in CI |
482
353
  | Write-scope enforcement | **opencode only** — rules-based elsewhere |
483
- | Cross-harness mission behavior | **12/12 platforms** — 9 rules-dir installs + 3 marketplace manifests, in CI |
484
- | 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.
485
358
 
486
- Numbers here are produced by `bun run gate`. Nothing in this table is an
487
- estimate.
359
+ ---
488
360
 
489
361
  ## License
490
362