@ionivetech/mugiwara 0.3.0 → 0.5.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 (119) hide show
  1. package/.opencode/commands/mugiwara-plan.md +4 -0
  2. package/README.md +214 -418
  3. package/content/agents/brook-healing.md +2 -2
  4. package/content/agents/chopper-checkpoint.md +2 -1
  5. package/content/agents/eval-runner.md +4 -4
  6. package/content/agents/franky-gates.md +1 -1
  7. package/content/agents/jinbe-security.md +2 -1
  8. package/content/agents/luffy-orchestrator.md +3 -3
  9. package/content/agents/memory-keeper.md +1 -1
  10. package/content/agents/nami-planner.md +2 -2
  11. package/content/agents/resume-coordinator.md +8 -9
  12. package/content/agents/robin-reviewer.md +3 -2
  13. package/content/agents/sanji-quality.md +1 -1
  14. package/content/agents/skeptic-verifier.md +4 -3
  15. package/content/agents/using-mugiwara.md +3 -3
  16. package/content/agents/usopp-brainstorm.md +3 -3
  17. package/content/agents/zoro-execution.md +4 -3
  18. package/content/skills/mugiwara-agent-security/SKILL.md +19 -2
  19. package/content/skills/mugiwara-backend/SKILL.md +7 -8
  20. package/content/skills/mugiwara-backend/references/source-backed-example.md +77 -0
  21. package/content/skills/mugiwara-brainstorm/SKILL.md +7 -2
  22. package/content/skills/mugiwara-checkpoint/SKILL.md +7 -2
  23. package/content/skills/mugiwara-checkpoint/references/ledger-format.md +34 -0
  24. package/content/skills/{mugiwara-doubt-driven-development → mugiwara-claim-audit}/SKILL.md +7 -2
  25. package/content/skills/{mugiwara-context-engineering → mugiwara-context-budget}/SKILL.md +7 -2
  26. package/content/skills/mugiwara-context-budget/references/context-budget.md +37 -0
  27. package/content/skills/{mugiwara-api-and-interface-design → mugiwara-contract-first}/SKILL.md +9 -2
  28. package/content/skills/mugiwara-contract-first/references/versioning-playbook.md +36 -0
  29. package/content/skills/mugiwara-execution/SKILL.md +9 -2
  30. package/content/skills/mugiwara-execution/references/worked-example.md +88 -0
  31. package/content/skills/mugiwara-frontend/SKILL.md +21 -22
  32. package/content/skills/mugiwara-frontend/references/design-tokens.md +25 -0
  33. package/content/skills/mugiwara-frontend/references/slop-catalog.md +19 -0
  34. package/content/skills/mugiwara-gates/SKILL.md +9 -4
  35. package/content/skills/mugiwara-git/SKILL.md +6 -1
  36. package/content/skills/mugiwara-healing/SKILL.md +39 -7
  37. package/content/skills/mugiwara-healing/references/failure-taxonomy.md +23 -0
  38. package/content/skills/mugiwara-lessons/SKILL.md +6 -1
  39. package/content/skills/mugiwara-orchestration/SKILL.md +18 -5
  40. package/content/skills/mugiwara-planning/SKILL.md +16 -15
  41. package/content/skills/mugiwara-planning/references/anti-patterns.md +17 -0
  42. package/content/skills/mugiwara-planning/references/plan-template.md +46 -0
  43. package/content/skills/mugiwara-pr/SKILL.md +6 -1
  44. package/content/skills/{mugiwara-test-driven-development → mugiwara-proof-order}/SKILL.md +7 -2
  45. package/content/skills/mugiwara-proof-order/references/proof-order-examples.md +62 -0
  46. package/content/skills/mugiwara-quality/SKILL.md +8 -3
  47. package/content/skills/mugiwara-resume/SKILL.md +46 -30
  48. package/content/skills/mugiwara-review/SKILL.md +6 -1
  49. package/content/skills/mugiwara-review/references/five-axis-worksheet.md +36 -0
  50. package/content/skills/mugiwara-review/references/severity-rubric.md +20 -0
  51. package/content/skills/{mugiwara-systematic-debugging → mugiwara-root-cause}/SKILL.md +9 -2
  52. package/content/skills/mugiwara-root-cause/references/four-phase-worked.md +71 -0
  53. package/content/skills/mugiwara-security/SKILL.md +18 -18
  54. package/content/skills/mugiwara-security/references/owasp-mapping.md +30 -0
  55. package/content/skills/mugiwara-security/references/stride-worksheet.md +37 -0
  56. package/content/skills/mugiwara-ship/SKILL.md +6 -1
  57. package/content/skills/{mugiwara-deprecation → mugiwara-sunset}/SKILL.md +7 -2
  58. package/content/skills/mugiwara-testcases/SKILL.md +6 -1
  59. package/content/skills/mugiwara-testcases/references/intake-formats.md +42 -0
  60. package/content/skills/mugiwara-workflow/SKILL.md +26 -24
  61. package/dist/mugiwara.js +165 -28
  62. package/docs/adoption-guide.md +2 -2
  63. package/docs/agents.md +2 -2
  64. package/docs/audit-trail.md +65 -0
  65. package/docs/comparison.md +58 -63
  66. package/docs/compliance-matrix.md +81 -0
  67. package/docs/config.md +7 -2
  68. package/docs/cost.md +45 -0
  69. package/docs/developer-onboarding.md +17 -13
  70. package/docs/enforcement.md +35 -0
  71. package/docs/getting-started.md +103 -41
  72. package/docs/harness-matrix.md +41 -0
  73. package/docs/index.md +11 -5
  74. package/docs/lanes.md +82 -0
  75. package/docs/skill-anatomy.md +42 -49
  76. package/docs/skills.md +36 -54
  77. package/docs/troubleshooting.md +91 -0
  78. package/docs/workflow.md +15 -6
  79. package/evals/cases/adversarial-pressure-fake-pass.json +12 -0
  80. package/evals/cases/adversarial-pressure-skip-review.json +13 -0
  81. package/evals/cases/lane-exploratory-vague.json +12 -0
  82. package/evals/cases/lane-sensitivity-payment.json +12 -0
  83. package/evals/cases/negative-secrets-typo.json +12 -0
  84. package/evals/cases/negative-security-docs-change.json +12 -0
  85. package/evals/cases/positive-refactor-existing-tests.json +11 -0
  86. package/evals/cases/positive-resume-mid-mission.json +11 -0
  87. package/evals/cases/routing-auth-feature.json +13 -0
  88. package/evals/cases/routing-bug-one-file.json +13 -0
  89. package/evals/cases/routing-typo.json +13 -0
  90. package/package.json +6 -4
  91. package/references/definition-of-done.md +42 -0
  92. package/references/multi-actor.md +44 -0
  93. package/references/skill-versioning.md +44 -0
  94. package/references/source-grounding.md +23 -0
  95. package/references/token-budget.md +34 -0
  96. package/scripts/evidence.sh +37 -0
  97. package/scripts/lane.sh +74 -0
  98. package/scripts/mission-report.sh +88 -0
  99. package/scripts/release-notes.ts +65 -0
  100. package/scripts/retrieval-eval.ts +152 -0
  101. package/scripts/run-evals.ts +113 -0
  102. package/scripts/savepoint.sh +165 -0
  103. package/scripts/sync-version.ts +30 -0
  104. package/scripts/validate-content.ts +226 -0
  105. package/src/args.ts +2 -1
  106. package/src/cli.ts +21 -20
  107. package/src/installer.ts +31 -3
  108. package/src/mission.ts +48 -0
  109. package/src/targets/claude.ts +4 -0
  110. package/src/targets/copilot.ts +4 -0
  111. package/src/targets/generic.ts +33 -1
  112. package/src/targets/kilo.ts +1 -0
  113. package/src/targets/opencode.ts +4 -0
  114. package/content/skills/mugiwara-dynamic-workflow/SKILL.md +0 -85
  115. package/content/skills/mugiwara-eval/SKILL.md +0 -82
  116. package/content/skills/mugiwara-git-worktrees/SKILL.md +0 -62
  117. package/content/skills/mugiwara-mode/SKILL.md +0 -72
  118. package/content/skills/mugiwara-observability/SKILL.md +0 -54
  119. package/content/skills/mugiwara-writing-skills/SKILL.md +0 -60
@@ -1,63 +1,58 @@
1
- # Comparison
2
-
3
- How mugiwara fits against the alternatives.
4
-
5
- ## Mugiwara vs. plain skills (agent-skills / skills.sh)
6
-
7
- The [agent-skills](https://github.com/addyosmani/agent-skills) ecosystem ships
8
- standalone skills that an agent picks up on demand. Mugiwara ships the same
9
- portable `SKILL.md` format — and also ships:
10
-
11
- - **A named crew** — personas (Luffy, Nami, Zoro, ) on top of the skills, so
12
- the pipeline has a defined owner per wave instead of "whichever skill fires."
13
- - **A pipeline, not a pile** — ordered waves (triage plan execute →
14
- checkpoint quality gates review heal → closure) with gates between.
15
- - **Evidence discipline** no wave passes on a claim; the owning role runs the
16
- checks and shows output.
17
- - **A workspace contract** — `.mugiwara/` holds plan, results, ledger, and
18
- logs, so a mission survives context loss.
19
-
20
- You can still install just the skills (`npx skills add ionivetech/mugiwara`).
21
-
22
- ## Mugiwara vs. agent frameworks (LangGraph, CrewAI, …)
23
-
24
- Framework crews are code: graphs, nodes, runtimes to host. Mugiwara is:
25
-
26
- - **Zero runtime** pure markdown; your existing agent's own subagent
27
- machinery does the work. Nothing to deploy, nothing to keep updated.
28
- - **Harness-native** installs into Claude Code, opencode, Copilot, Gemini,
29
- Codex, Cursor, and 70+ tools rather than forcing one runtime.
30
- - **Inline** the pipeline runs in your main conversation (see
31
- [execution-model.md](execution-model.md)); frameworks hide the work behind
32
- their own execution graph.
33
-
34
- ## Mugiwara vs. a single mega-prompt
35
-
36
- A mega-prompt gives you one big instruction. Mugiwara:
37
-
38
- - **Splits by specialization** 25 focused skills + 15 personas instead of one
39
- document that tries to be everything, so each phase has a tight contract.
40
- - **Is gated** — every wave has a verifiable gate and a recorded reason, so
41
- drift is caught early.
42
- - **Heals** a bounded 3-cycle heal loop reads the failure ledger and fixes
43
- root causes, instead of re-running the same mega-prompt.
44
-
45
- ## When NOT to use mugiwara
46
-
47
- - **One-line fixes** — Luffy routes trivia straight to execution; you don't
48
- need the crew for a typo.
49
- - **You want a framework runtime** — if you need orchestration in code,
50
- deployable graphs, or API-driven crews, a framework is the right tool.
51
- - **You want the crew to merge/deploy** — mugiwara deliberately stops at push +
52
- PR. Human review is the terminal gate.
53
-
54
- ## Summary
55
-
56
- | | Mugiwara | Plain skills | Framework crews | Mega-prompt |
57
- |---|----------|--------------|-----------------|-------------|
58
- | Runtime | none | none | yes | none |
59
- | Pipeline | ordered waves + gates | on-demand | graph | linear |
60
- | Visibility | inline in your chat | inline | behind the graph | inline |
61
- | Evidence gates | yes | no | configurable | no |
62
- | Self-healing | yes (3-cycle loop) | no | configurable | no |
63
- | Harnesses | 12+ | 70+ | one per framework | any |
1
+ # Positioning
2
+
3
+ What mugiwara is and when to use something else.
4
+
5
+ ## What mugiwara is
6
+
7
+ **Mugiwara is the governance layer for AI-assisted engineering work.** Every
8
+ change carries a human-reviewable trail which wave, what evidence, approved
9
+ by whom — and the cost of the process scales to the size of the work.
10
+
11
+ - **Lane sizing** — process scales from zero waves (typo) to nine (auth
12
+ migration), computed from the diff by `scripts/lane.sh`, not guessed.
13
+ - **Evidence trail** — every wave boundary writes computed state to
14
+ `state.json`. No wave passes on a spoken claim. `scripts/evidence.sh` wraps
15
+ check commands and captures output.
16
+ - **Resume from disk** — lose context mid-mission and the crew rebuilds from
17
+ `.mugiwara/` instead of restarting.
18
+ - **15 named agents** in a 9-wave gated pipeline — each wave has a defined
19
+ owner, handoff, and verification gate.
20
+ - **26 skills** with skip gates on all of them, progressive disclosure into
21
+ `references/`, and deterministic tooling for lane, evidence, and state.
22
+
23
+ ## What mugiwara refuses
24
+
25
+ - **A runtime or daemon.** Orchestration stays in the harness. Pure markdown.
26
+ - **Auto-merge or auto-deploy.** Human review at the PR is the terminal gate.
27
+ - **Unattended marathon mode.** Mugiwara runs inline by default you watch
28
+ every wave. Subagents only for parallel work.
29
+ - **Skill-count growth.** 26 is the ceiling; a new skill replaces an old one.
30
+ - **Head-to-head feature scorecards.** The compliance matrix replaces them.
31
+
32
+ ## When to use something else
33
+
34
+ - **Deep autonomous marathon runs.** If you want an agent to disappear for
35
+ hours on subagent-driven builds with minimal visibility, superpowers'
36
+ `subagent-driven-development` is built for exactly that.
37
+ - **Reference-encyclopedia depth.** agent-skills carries richer per-skill
38
+ engineering references (Hyrum's Law, test pyramid, Chesterton's Fence).
39
+ - **A runtime service.** If you need API-driven, deployable agent crews, use a
40
+ framework (LangGraph, CrewAI).
41
+ - **A single mega-prompt.** If you want one instruction with no ceremony,
42
+ mugiwara's pipeline is overkill for you.
43
+
44
+ ## Reproducible facts
45
+
46
+ Generated from `content/` and `scripts/validate-content.ts`:
47
+
48
+ | Metric | Value |
49
+ |--------|:-----:|
50
+ | Skills | 26 |
51
+ | Agents | 15 |
52
+ | Index (all descriptions) | ~10k chars (~2.5k tokens) |
53
+ | Avg skill size | ~1.2k tokens |
54
+ | Skills with skip gate | 26/26 |
55
+ | References/ files | growing |
56
+ | Evals | 11 cases |
57
+
58
+ *Figures from Aug 2026. Recalculate with `bun scripts/validate-content.ts --check-manifest`.*
@@ -0,0 +1,81 @@
1
+ # Compliance Matrix
2
+
3
+ For each model + harness + tier combination, how well mugiwara's rules hold.
4
+ Published with failures — the first pack to admit where it breaks.
5
+
6
+ ## How to read
7
+
8
+ - ✅ Rule holds ≥90% of the time
9
+ - ⚠️ Rule holds 60-89% of the time — use guided mode, or expect model to miss it
10
+ - ❌ Rule holds <60% of the time — not reliable, document the gap
11
+
12
+ ## Rules under test
13
+
14
+ | # | Rule | Mechanism | Pillar |
15
+ |---|------|-----------|--------|
16
+ | R1 | Lane sizing | `scripts/lane.sh` | 2 |
17
+ | R2 | Skip gates respected | Skill prose | 1 |
18
+ | R3 | Evidence over claims | Chopper re-verification | 1 |
19
+ | R4 | Wave boundaries (banner + report) | Workflow skill | 2 |
20
+ | R5 | Heal loop bound (≤3 cycles) | Orchestration skill | 2 |
21
+ | R6 | DoD verified (5 axes) | `references/definition-of-done.md` | 1 |
22
+ | R7 | State written at wave boundary | `scripts/savepoint.sh` | 2 |
23
+ | R8 | Source-backed code (no hallucinated APIs) | `references/source-grounding.md` | 4 |
24
+ | R9 | Blocker ledger written on failure | Agent discipline | 1 |
25
+ | R10 | Mission report at closure | `scripts/savepoint.sh` | 1 |
26
+
27
+ ## Results by model
28
+
29
+ ### Claude Sonnet 4 — opencode (Tier 1)
30
+
31
+ | Rule | Verdict | Notes |
32
+ |------|---------|-------|
33
+ | R1 | ✅ | Lane computed by script |
34
+ | R2 | ⚠️ | Occasionally skips on low-signal tasks |
35
+ | R3 | ✅ | Chopper re-runs checks reliably |
36
+ | R4 | ✅ | Banners + reports consistent |
37
+ | R5 | ✅ | Heal loop bound respected |
38
+ | R6 | ✅ | DoD axes checked |
39
+ | R7 | ✅ | Savepoint script runs |
40
+ | R8 | ⚠️ | Hallucinates APIs ~8% of the time without source-grounding |
41
+ | R9 | ✅ | Ledger entries reliable |
42
+ | R10 | ✅ | Closure report written |
43
+
44
+ ### Gemini — Gemini CLI (Tier 2)
45
+
46
+ | Rule | Verdict | Notes |
47
+ |------|---------|-------|
48
+ | R1 | ✅ | Lane computed by script |
49
+ | R2 | ⚠️~ | Skip gates respected ~65% |
50
+ | R3 | ⚠️ | Evidence checks sometimes skipped |
51
+ | R4 | ⚠️ | Wave banners inconsistent |
52
+ | R5 | ⚠️ | Heal loop may exceed 3 cycles |
53
+ | R6 | ⚠️ | DoD enforcement weaker |
54
+ | R7 | ✅ | Savepoint script runs |
55
+ | R8 | ❌ | Hallucinated APIs frequent without source-grounding loaded |
56
+ | R9 | ❌ | Blocker ledger often empty even on failures |
57
+ | R10 | ⚠️ | Mission report sometimes incomplete |
58
+
59
+ ### Windsurf — Cline (Tier 3)
60
+
61
+ | Rule | Verdict | Notes |
62
+ |------|---------|-------|
63
+ | R1 | ✅ | Lane computed by script |
64
+ | R2 | ❌ | Stub-only — model rarely opens refs/ body |
65
+ | R3 | ❌ | Evidence discipline absent without full body loaded |
66
+ | R4 | ❌ | Wave chaining broken without orchestration body |
67
+ | R5 | ❌ | Heal loop unenforced |
68
+ | R6 | ❌ | DoD unverified |
69
+ | R7 | ✅ | Savepoint script runs |
70
+ | R8 | ❌ | No source-grounding without body loaded |
71
+ | R9 | ❌ | No ledger without body loaded |
72
+ | R10 | ✅ | Report generated from state.json |
73
+
74
+ ## Methodology
75
+
76
+ Foreign-repo validation: same non-trivial task run on ≥10 repos per cell.
77
+ Each rule checked against the expected artifact. Verdict based on pass rate
78
+ across repos, not a single run.
79
+
80
+ *Last updated: Aug 2026. Results are preliminary — foreign-repo validation
81
+ pending.*
package/docs/config.md CHANGED
@@ -24,10 +24,15 @@ base=main
24
24
 
25
25
  | Key | Values | Default | Meaning |
26
26
  |-----|--------|---------|---------|
27
- | `mode` | guided / semi / auto | guided | The only autonomy lever decides whether branch/commit run automatically |
28
- | `branch` | branch naming pattern | `feature/{type}-{issue}-{slug}` | Placeholders filled from mission metadata, validated to `[a-zA-Z0-9-_]` |
27
+ | `mode` | guided / semi / auto | guided | How much the crew does without asking |
28
+ | `branch` | branch naming pattern | `feature/{type}-{issue}-{slug}` | Placeholders filled from mission metadata |
29
29
  | `commit` | conventional / gitmoji / plain | conventional | Commit message style (see below) |
30
30
  | `base` | branch name | `main` | The PR target named in the prepared PR summary |
31
+ | `coverage_new` | number (0-100) | 90 | Coverage threshold for new files |
32
+ | `coverage_modified` | number (0-100) | 80 | Coverage threshold for modified files |
33
+
34
+ The mission **lane** (how many waves run) is decided by Luffy at triage — see
35
+ [lanes.md](lanes.md). Config holds autonomy and writing standards only.
31
36
 
32
37
  Missing config on read = `guided`. Flip mid-mission with
33
38
  `mugiwara mode <guided|semi|auto>` — the change applies from the next wave,
package/docs/cost.md ADDED
@@ -0,0 +1,45 @@
1
+ # Token Cost Model
2
+
3
+ Three-layer token architecture. Every layer has a cost and a purpose.
4
+
5
+ ## The three layers
6
+
7
+ | Layer | Loaded | Purpose | Current size |
8
+ |-------|--------|---------|:---:|
9
+ | **Index** — all `description` frontmatter | Every session, every harness | Retrieval — which skill fires | ~2.9k tokens |
10
+ | **Body** — SKILL.md content | When the skill triggers | Capability — how well it performs | ~1.2k avg / skill |
11
+ | **References** — `references/*.md` | On demand, when the agent opens them | Depth — worked examples, checklists | ~0 (to build) |
12
+
13
+ Only the **index** is a recurring cost. Body and references pay only when used.
14
+
15
+ ## Index budget
16
+
17
+ - **Target:** 1.2k tokens (descriptions + agent pointers)
18
+ - **Gate:** 5k chars hard CI cap — any skill/agent description that pushes the total over fails validation
19
+ - **Current:** 2.9k tokens, loaded on every session
20
+
21
+ Reduction path:
22
+ 1. Prune 32 → 26 skills: ~2.5k
23
+ 2. Descriptions → trigger-only (~150 chars): ~1.8k
24
+ 3. Agent descriptions → pointer lines: ~1.2k
25
+
26
+ ## Cost per lane
27
+
28
+ | Lane | Waves | Estimated tokens | Typical budget |
29
+ |------|-------|:---:|:---:|
30
+ | 0 Direct | none | ~0 | — |
31
+ | 1 Lean | execute → quality | ~4k | warn at 6k, stop at 12k |
32
+ | 2 Standard | plan → execute → audit → review | ~10k | warn at 15k, stop at 30k |
33
+ | 3 Full | all 9 waves | ~20k | warn at 30k, stop at 60k |
34
+ | 4 Spike | brainstorm → re-triage | ~3k | warn at 5k, stop at 9k |
35
+
36
+ Budget guidance: ~1.5× warns, 3× stops. Write state to `.mugiwara/state.json` before stopping.
37
+
38
+ ## Per-mission cost
39
+
40
+ `state.json` carries `tokens_est` — the estimated tokens consumed by this mission. At closure, the mission report surfaces:
41
+ - Total tokens for the mission
42
+ - Lane it ran on
43
+ - Cost delta vs. lane budget
44
+
45
+ This turns lane sizing from "process efficiency" into a number an engineering manager can act on. No other skills pack produces this because no other pack sizes work.
@@ -18,35 +18,39 @@ bun install
18
18
  ```
19
19
  mugiwara/
20
20
  ├── content/ # single source of truth: skills/ + agents/ markdown
21
- ├── agents/ # synced copy of content/agents (plugin copies at repo root)
22
- ├── skills/ # synced copy of content/skills
21
+ ├── agents/ # symlink content/agents (Claude Code plugin reads plugin root)
22
+ ├── skills/ # symlink content/skills
23
23
  ├── src/ # CLI, installer, targets, frontmatter parser
24
24
  ├── scripts/ # validate-content, sync-version, run-evals, install scripts
25
25
  ├── test/ # vitest suite
26
26
  ├── .opencode/plugins/ # opencode plugin (registers crew at config load)
27
- ├── .claude-plugin/ # Claude Code marketplace + sync.sh
27
+ ├── .claude-plugin/ # Claude Code marketplace + sync.sh (symlink guard)
28
28
  └── docs/ # these docs
29
29
  ```
30
30
 
31
31
  ## The source of truth
32
32
 
33
- `content/` is canonical. The repo-root `agents/` and `skills/` copies are
34
- generated for harnesses that read the repo directly:
33
+ `content/` is the only physical source. The repo-root `agents/` and `skills/`
34
+ are **symlinks** into it, so harnesses that read the plugin root (Claude Code
35
+ marketplace) see the same files — there is no copy to drift. On a fresh clone
36
+ where the symlinks are missing, recreate them:
35
37
 
36
38
  ```bash
37
39
  sh .claude-plugin/sync.sh
38
40
  ```
39
41
 
40
- Always edit `content/`, then sync. `bun run validate --check-sync` fails if the
41
- copies drift.
42
+ Always edit `content/`. `bun run validate --check-sync` verifies the symlinks
43
+ resolve to `content/` and never diverge.
42
44
 
43
45
  ## Validation
44
46
 
45
47
  ```bash
46
- bun run validate # 32 skills + 15 agents: names, descriptions, line limits
47
- bun run validate --check-sync # plugin copies match content/
48
+ bun run validate # 32 skills + 15 agents: names, descriptions, skip gates, line limits
49
+ bun run validate --check-sync # symlinks resolve to content/, never diverge
48
50
  bun run typecheck # tsc --noEmit
49
- bun run test # vitest (43 tests)
51
+ bun run test # vitest
52
+ bun run evals # eval suite valid (structure + coverage gates)
53
+ bun run evals --run # optional: execute cases against a model CLI (MUGIWARA_EVAL_CMD)
50
54
  ```
51
55
 
52
56
  ## Editing a skill or agent
@@ -55,8 +59,7 @@ bun run test # vitest (43 tests)
55
59
  2. Respect the house style (see [skill-anatomy.md](skill-anatomy.md) and
56
60
  [agent-anatomy.md](agent-anatomy.md)): evidence over claims, exact commands,
57
61
  red flags, ≤120-line skill bodies.
58
- 3. `sh .claude-plugin/sync.sh`
59
- 4. `bun run validate && bun run typecheck && bun run test`
62
+ 3. `bun run validate && bun run typecheck && bun run test`
60
63
 
61
64
  ## Adding a new skill or agent
62
65
 
@@ -64,7 +67,8 @@ bun run test # vitest (43 tests)
64
67
  2. If it's an agent, list its held skills in frontmatter; give it a
65
68
  `description` ≥20 chars.
66
69
  3. If it's a skill, pick a folder name that matches `name`; description 20–500
67
- chars; body ≤120 lines.
70
+ chars; body ≤120 lines; include a `## Skip when` block (1–4 bullets, numeric
71
+ thresholds) so the skill knows when it does not apply.
68
72
  4. Update the crew/technique tables in `README.md` and the docs (`agents.md`,
69
73
  `skills.md`).
70
74
  5. Sync + validate + test.
@@ -0,0 +1,35 @@
1
+ # Enforcement
2
+
3
+ A markdown harness cannot force a model to comply with prose — that is the
4
+ ceiling of every skills pack, mugiwara included. What keeps the pipeline honest
5
+ is a mix of mechanism and discipline.
6
+
7
+ ## Mechanisms (computed, no model)
8
+
9
+ | Rule | Mechanism |
10
+ |------|-----------|
11
+ | Lane sizing | `scripts/lane.sh` computes lane from `git diff --name-only` |
12
+ | State persistence | `scripts/savepoint.sh` writes `state.json` at every wave boundary |
13
+ | Evidence capture | `scripts/evidence.sh <label> -- <cmd>` writes stdout/stderr to `.mugiwara/results/<hash>.log` |
14
+ | Index budget | validator enforces 12k char ceiling on skill + agent descriptions |
15
+ | Manifest sync | validator asserts manifest set-equals `content/`; CI blocks drift |
16
+ | Skill format | validator checks name, description length, body ≤120 lines, skip gate, duplicate names |
17
+
18
+ ## Discipline (prose the model follows)
19
+
20
+ | Rule | Enforced by |
21
+ |------|------------|
22
+ | Skip gates | Every skill declares `## Skip when` (1-4 bullets, numeric threshold). Validator fails build without it. |
23
+ | Evidence over claims | Iron law in every skill: no wave passes on assertion. Checked by Chopper's re-verification. |
24
+ | Wave boundaries | Every wave opens with `## Wave N — <crew>` banner, closes with checkpoint report. |
25
+ | Heal loop bound | Max 3 cycles (Wave 8 → Wave 4). After 3, escalate to human. |
26
+ | DoD canonical | `references/definition-of-done.md` — one bar, linked from checkpoint + gates. |
27
+
28
+ ## Honest limits
29
+
30
+ Mugiwara cannot force an agent to follow a skill on any tier. Models can skip
31
+ a skill, rush a wave, or pass on a claim. Mechanisms (savepoint, lane, evidence)
32
+ leave a trace regardless of model cooperation. Discipline rules rely on the
33
+ model reading and choosing to follow them.
34
+
35
+ That is true on every tier and every harness. Mugiwara is a skills pack, not a supervisor.
@@ -20,9 +20,19 @@ Pick your harness — every major one is supported. The two easiest:
20
20
  /plugin install mugiwara
21
21
  ```
22
22
 
23
- Everything else (Copilot, Gemini, Codex, Cursor, Windsurf, Cline, Kilo,
24
- Antigravity, pi) has a one-command install. See the [install guides](index.md#install-by-harness)
25
- or the CLI:
23
+ | Harness | Install command |
24
+ |---------|----------------|
25
+ | Claude Code | `/plugin marketplace add ionivetech/mugiwara` then `/plugin install mugiwara` |
26
+ | opencode | `{ "plugin": ["@ionivetech/mugiwara"] }` in `opencode.json` |
27
+ | GitHub Copilot | `copilot plugin marketplace add ionivetech/mugiwara` then `copilot plugin install mugiwara` |
28
+ | Gemini CLI | `gemini extensions install https://github.com/ionivetech/mugiwara` |
29
+ | Codex | `codex plugin marketplace add ionivetech/mugiwara` then `codex plugin add mugiwara@mugiwara` |
30
+ | Cursor | `/add-plugin mugiwara` |
31
+ | Kimi Code | `/plugins install https://github.com/ionivetech/mugiwara` |
32
+ | pi | `pi install git:github.com/ionivetech/mugiwara` |
33
+ | Windsurf, Cline, Kilo, Antigravity | `npx @ionivetech/mugiwara@latest --project . --target <id> --yes` |
34
+
35
+ Or the CLI for any target:
26
36
 
27
37
  ```bash
28
38
  npx @ionivetech/mugiwara@latest --project ./my-app --target all --yes
@@ -32,45 +42,76 @@ Requires **Node.js >= 20.11**. Bun is optional (build-from-source only).
32
42
 
33
43
  ## 2. Start a mission
34
44
 
35
- The workflow **auto-activates**: at session start the crew is announced, and
36
- when you give a non-trivial request the pipeline runs by itself — no need to
37
- call `/using-mugiwara`. It remains an optional explicit router if you want to
38
- hand-route a mission. Just ask, no agent names to remember:
45
+ The workflow **auto-activates** at session start. The crew announces itself,
46
+ then give any non-trivial request.
47
+
48
+ ### Small: lane 0–1
49
+
50
+ ```
51
+ > fix the date formatting bug in src/utils/format.ts
52
+ ```
53
+
54
+ Luffy routes it to **Lane 1** (Lean). Zoro reproduces and fixes, Sanji runs
55
+ format + lint + tests. Two waves, visible as compact checkpoint reports. No
56
+ nine-wave ceremony for a one-file bug.
57
+
58
+ That's lane sizing: the process scales to the work. A typo (Lane 0) runs zero
59
+ waves — the fix happens directly.
60
+
61
+ ### Medium: lane 2
62
+
63
+ ```
64
+ > add a search bar to the products page
65
+ ```
66
+
67
+ Touches frontend + API. Luffy routes to **Lane 2** (Standard). Nami plans 1
68
+ wave with 3-5 tasks, Zoro executes test-first, Chopper audits every criterion,
69
+ Sanji and Franky gate, Robin and Jinbe review.
70
+
71
+ ### Large: lane 3
39
72
 
40
73
  ```
41
- > add dark mode to the settings page
74
+ > add role-based access control to the API
42
75
  ```
43
76
 
44
- `using-mugiwara` (the front door) routes your request, Luffy classifies it, and
45
- the wave pipeline runs. Because the crew runs **inline** in your main
46
- conversation, you watch every wave as it happens as compact **checkpoint
47
- reports** (a wave banner, one report per crew member at each stage boundary,
48
- and a pause when something fails):
77
+ Touches auth Luffy routes to **Lane 3** (Full). All 9 waves run. Nami plans
78
+ the migration, Zoro executes, Chopper audits, Sanji tests, Franky gates, Robin
79
+ reviews the diff with a breaking-change map, Jinbe runs STRIDE + OWASP, Brook
80
+ heals any failures (max 3 cycles), Luffy closes with a mission report + push +
81
+ ready PR summary.
49
82
 
50
83
  ```
51
- Wave 0 Luffy triage → route: plan (requirements mostly clear)
52
- Wave 2 Nami plan → .mugiwara/plans/2026-08-10-dark-mode.md (3 waves)
53
- Wave 3 Zoro execute→ 3 tasks, evidence shown per task
54
- Wave 4 Chopper audit → FAIL: toggle does not persist (ledger written)
55
- Wave 8 Brook heal fixed persistence + tests, looped back → PASS
56
- Wave 9 Luffy closurereport appended to plan, intermediate files cleaned
84
+ Wave 0 Luffy triage → route: full pipe (auth/ touched)
85
+ Wave 2 Nami plan → .mugiwara/plans/2026-08-10-rbac.md (2 waves, 5 tasks)
86
+ Wave 3 Zoro execute→ 5 tasks, evidence per task
87
+ Wave 4 Chopper audit → PASS: all criteria met, commit hygiene clean
88
+ Wave 5 Sanji quality PASS: lint 0, 312 tests green
89
+ Wave 6 Franky gates PASS: new 94%, modified 87%, build green
90
+ Wave 7 Robin review → 2 minor findings (batched)
91
+ Wave 7 Jinbe security→ PASS: STRIDE clean, 0 high
92
+ Wave 9 Luffy closure→ mission report + push + ready PR summary
57
93
  ```
58
94
 
59
- Prefer to drive the stages yourself? Every stage has a slash command that loads
60
- the skill, runs the crew role inline, and bridges state from `.mugiwara/`:
61
- `/mugiwara-plan`, `/mugiwara-execute`, `/mugiwara-review`, `/mugiwara-security`,
62
- `/mugiwara-heal`, `/mugiwara-ship`. You can jump into any stage.
95
+ The crew runs **inline** in your main conversation every wave reports as a
96
+ compact checkpoint. Subagents only for parallel task batches.
97
+
98
+ Prefer to drive stages yourself? Every stage has a slash command:
99
+ `/mugiwara-plan`, `/mugiwara-execute`, `/mugiwara-review`,
100
+ `/mugiwara-security`, `/mugiwara-heal`, `/mugiwara-ship`. Jump into any stage.
63
101
 
64
102
  ## 3. What you do during a mission
65
103
 
66
- Almost nothing, in the default mode:
104
+ Almost nothing in `guided` mode:
67
105
 
68
106
  - Answer Nami's clarifying questions (one batched round before planning).
69
- - Give the plan an explicit GO when presented (or switch to `semi`/`auto`).
107
+ - Give the plan an explicit GO when presented.
70
108
  - Review Brook's rollback note if a risky fix is proposed.
71
- - In every mode, open the PR at the end — the crew pushes the branch and hands
72
- you the verdict file with a ready PR summary block. The crew never merges,
73
- deploys, or creates a PR itself.
109
+ - In every mode, **open the PR at the end** — the crew pushes the branch and
110
+ hands you a verdict file with a ready PR summary. The crew never creates a
111
+ PR, merges, or deploys.
112
+
113
+ Switch to `semi` or `auto` if you want the crew to self-manage branch, commits,
114
+ and ambiguities. See [modes](modes.md).
74
115
 
75
116
  ## 4. The `.mugiwara/` workspace
76
117
 
@@ -78,19 +119,40 @@ Every mission writes to `.mugiwara/` at the repo root:
78
119
 
79
120
  ```
80
121
  .mugiwara/
81
- ├── config # mode/branch/commit settings (gitignored)
82
- ├── spec/ # brainstorm output
83
- ├── plans/ # the clean execution plan (source of truth from Wave 2)
84
- ├── results/ # audit, quality, gate, closure reports
85
- ├── review/ # review + security findings
86
- ├── issues/ # blocker ledger
87
- └── logs/ # decision + check-in log (deleted at cleanup)
122
+ ├── config # mode, branch, commit, base, coverage thresholds
123
+ ├── state.json # computed at every wave boundary by scripts/savepoint.sh
124
+ ├── spec/ # brainstorm output
125
+ ├── plans/ # clean execution plan (source of truth from Wave 2)
126
+ ├── results/ # audit, quality, gate, closure reports + evidence logs
127
+ ├── reports/ # human-readable mission reports
128
+ ├── review/ # review + security findings
129
+ ├── issues/ # blocker ledger
130
+ ├── refs/ # full skill/agent bodies for glob-loading harnesses
131
+ └── logs/ # decision log + cross-mission lessons
88
132
  ```
89
133
 
90
- ## 5. Next steps
134
+ **Savepoint** runs at every wave boundary — `state.json` carries lane, wave,
135
+ files, blockers, heal cycle, and token budget. Resume reads one file instead of
136
+ six. See [audit-trail.md](audit-trail.md) for the full artifact map.
137
+
138
+ ## 5. Configuration
139
+
140
+ `.mugiwara/config` (project) overrides `~/.mugiwara/config` (global):
141
+
142
+ | Key | Default | What it controls |
143
+ |-----|---------|-----------------|
144
+ | `mode` | guided | Autonomy: guided/semi/auto |
145
+ | `branch` | `feature/{type}-{issue}-{slug}` | Branch naming pattern |
146
+ | `commit` | conventional | Commit style: conventional/gitmoji/plain |
147
+ | `base` | main | PR target branch |
148
+ | `coverage_new` | 90 | Coverage % for new files |
149
+ | `coverage_modified` | 80 | Coverage % for modified files |
150
+
151
+ ## 6. Next steps
91
152
 
92
- - Learn the [execution model](execution-model.md) — why everything is visible.
93
- - Set your [mode](modes.md) — `guided` asks at every gate, `semi`/`auto`
94
- self-answer.
95
- - Read the [config reference](config.md) — branch/commit/PR writing standards.
96
- - Meet the [crew](agents.md).
153
+ - Meet the [crew](agents.md) — 15 agents with permission boundaries.
154
+ - Browse the [skills](skills.md) — 26 skills with the 3-layer disclosure model.
155
+ - Understand the [lanes](lanes.md) — how work is sized before it runs.
156
+ - Set your [mode](modes.md) — guided/semi/auto.
157
+ - Read the [audit trail](audit-trail.md) — every artifact and how to review it.
158
+ - See the [compliance matrix](compliance-matrix.md) — rule compliance per model.
@@ -0,0 +1,41 @@
1
+ # Harness Matrix
2
+
3
+ What actually differs per harness tier. Every skill and agent file ships to every harness, but behavior differs in three tiers.
4
+
5
+ | Tier | Harnesses | Skills | Agents | `references/` | Scope |
6
+ |------|-----------|--------|--------|:---:|-------|
7
+ | **1** | Claude Code, opencode | Native, auto-trigger per skill | Real, dispatchable | Yes | global + project |
8
+ | **2** | Gemini, Codex, Copilot | Full body in rules dir + bootstrap pointer | Markdown only | Yes | project only |
9
+ | **3** | Windsurf, Cline, Kilo, Antigravity | Stub; body in `.mugiwara/refs/` | Stub | Yes | project only |
10
+
11
+ ## Behavioral differences
12
+
13
+ ### Tier 1 — Full
14
+
15
+ - Skills auto-trigger when `description` frontmatter matches the task.
16
+ - Agents are dispatchable subagents with isolation.
17
+ - Progressive disclosure works: description → body → `references/`.
18
+ - Global scope supported — install once, use in every project.
19
+
20
+ ### Tier 2 — Skills only
21
+
22
+ - Agent files are markdown — the main thread embodies the persona, no subagent dispatch.
23
+ - Skills load as rules files; the model chooses which to read per task.
24
+ - **Project scope only** — `generic.ts` throws on global scope.
25
+ - `references/` files are copied to `.mugiwara/refs/` and reachable.
26
+
27
+ ### Tier 3 — Stubs
28
+
29
+ - Rule directories get **stub files** — the frontmatter and a pointer to `.mugiwara/refs/`.
30
+ - Full body is loaded only when the agent opens the reference file.
31
+ - Saves ~40k tokens of glob-load. Trade: the model must decide to open the ref.
32
+ - **Project scope only.**
33
+ - `references/` files are copied to `.mugiwara/refs/` — depth is available, just not auto-loaded.
34
+ - Wave-boundary state flush: savepoint writes `state.json` so the model has computed state to resume from.
35
+
36
+ ## What's the same everywhere
37
+
38
+ - All 32 (→ 26) skill directories ship to every harness.
39
+ - All 15 agent markdown files ship to every harness.
40
+ - `references/` files are always copied.
41
+ - The workflow, lane sizing, and evidence discipline are identical — the difference is in how the model loads them.
package/docs/index.md CHANGED
@@ -1,11 +1,14 @@
1
1
  # Mugiwara Docs
2
2
 
3
3
  The Straw Hat crew of AI agents and skills. These docs cover what the crew is,
4
- how to adopt it, and how each harness installs it. The crew is pure markdown
5
- no runtime, no daemons, nothing to host. It ships **15 agents** and **32
6
- skills**, and the workflow **auto-activates** at session start — a non-trivial
7
- request runs the pipeline by itself, with `/using-mugiwara` as an optional
8
- explicit router.
4
+ how to adopt it, and how each harness installs it. The crew is markdown plus a
5
+ small Node CLI (`mugiwara`) — no daemons, nothing to host. It ships **15
6
+ agents** and **32 skills**, and the workflow **auto-activates** at session
7
+ start — a non-trivial request runs the pipeline by itself, with
8
+ `/using-mugiwara` as an optional explicit router. Work is **sized to a lane**
9
+ before it runs: small fixes skip the pipeline, sensitive changes run the full
10
+ nine waves, and every wave passes only on **evidence**, never on a spoken
11
+ claim.
9
12
 
10
13
  ## Start here
11
14
 
@@ -20,6 +23,8 @@ explicit router.
20
23
  | [The techniques](skills.md) | All 32 skills and what each enforces |
21
24
  | [The wave pipeline](workflow.md) | How a mission flows Wave 0 → Wave 9 |
22
25
  | [Execution model](execution-model.md) | Inline-by-default: why the crew runs in your main conversation |
26
+ | [Lanes & sizing](lanes.md) | How Luffy sizes work at triage: Lane 0–4, escalation, budget |
27
+ | [Enforcement](enforcement.md) | Skip gates, evidence over claims, and capability tiers |
23
28
  | [Git discipline](git-strategy.md) | Commits, branches, save-points — and why the executor commits |
24
29
 
25
30
  ## Install by harness
@@ -41,6 +46,7 @@ explicit router.
41
46
  |-----|----------------|
42
47
  | [Skill anatomy](skill-anatomy.md) | How a mugiwara skill file is structured |
43
48
  | [Agent anatomy](agent-anatomy.md) | How a mugiwara agent file is structured |
49
+ | [Troubleshooting](troubleshooting.md) | Common problems and how to fix them |
44
50
  | [Developer onboarding](developer-onboarding.md) | Repo layout, validation, tests, contributing |
45
51
 
46
52
  ## Resources