@ionivetech/mugiwara 0.5.5 → 0.6.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 (145) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +3 -2
  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/commands/mugiwara-continue.md +16 -0
  7. package/.opencode/commands/mugiwara-execute.md +6 -4
  8. package/.opencode/commands/mugiwara-heal.md +6 -4
  9. package/.opencode/commands/mugiwara-plan.md +6 -4
  10. package/.opencode/commands/mugiwara-review.md +6 -4
  11. package/.opencode/commands/mugiwara-security.md +6 -4
  12. package/.opencode/commands/mugiwara-ship.md +6 -4
  13. package/.opencode/commands/mugiwara.md +4 -2
  14. package/.opencode/commands/using-mugiwara.md +7 -13
  15. package/.opencode/plugins/mugiwara.mjs +18 -6
  16. package/AGENTS.md +1 -1
  17. package/GEMINI.md +1 -1
  18. package/README.md +251 -120
  19. package/content/agents/brook-healing.md +17 -3
  20. package/content/agents/chopper-checkpoint.md +17 -3
  21. package/content/agents/eval-runner.md +17 -2
  22. package/content/agents/franky-gates.md +19 -5
  23. package/content/agents/jinbe-security.md +19 -3
  24. package/content/agents/luffy-orchestrator.md +6 -3
  25. package/content/agents/memory-keeper.md +15 -0
  26. package/content/agents/nami-planner.md +21 -6
  27. package/content/agents/onboarding-guide.md +145 -0
  28. package/content/agents/resume-coordinator.md +21 -5
  29. package/content/agents/robin-reviewer.md +18 -3
  30. package/content/agents/sanji-quality.md +19 -4
  31. package/content/agents/skeptic-verifier.md +18 -3
  32. package/content/agents/usopp-brainstorm.md +17 -3
  33. package/content/agents/zoro-execution.md +18 -3
  34. package/content/skills/mugiwara-backend/SKILL.md +1 -1
  35. package/content/skills/mugiwara-brainstorm/SKILL.md +5 -1
  36. package/content/skills/mugiwara-checkpoint/SKILL.md +2 -2
  37. package/content/skills/mugiwara-contract-first/SKILL.md +2 -36
  38. package/content/skills/mugiwara-contract-first/references/process.md +37 -0
  39. package/content/skills/mugiwara-execution/SKILL.md +30 -13
  40. package/content/skills/mugiwara-execution/references/resume-batching.md +32 -0
  41. package/content/skills/mugiwara-frontend/SKILL.md +1 -1
  42. package/content/skills/mugiwara-gates/SKILL.md +32 -30
  43. package/content/skills/mugiwara-healing/SKILL.md +1 -1
  44. package/content/skills/mugiwara-orchestration/SKILL.md +41 -25
  45. package/content/skills/mugiwara-orchestration/references/delegation-pillars.md +40 -0
  46. package/content/skills/mugiwara-orchestration/references/triage-escalation.md +96 -0
  47. package/content/skills/mugiwara-planning/SKILL.md +23 -27
  48. package/content/skills/mugiwara-planning/references/plan-template.md +42 -0
  49. package/content/skills/mugiwara-pr/SKILL.md +2 -2
  50. package/content/skills/mugiwara-quality/SKILL.md +10 -6
  51. package/content/skills/mugiwara-resume/SKILL.md +7 -2
  52. package/content/skills/mugiwara-review/SKILL.md +20 -1
  53. package/content/skills/mugiwara-review/references/code-attributes.md +38 -0
  54. package/content/skills/mugiwara-root-cause/SKILL.md +3 -30
  55. package/content/skills/mugiwara-root-cause/references/process.md +35 -0
  56. package/content/skills/mugiwara-security/SKILL.md +17 -32
  57. package/content/skills/mugiwara-security/references/owasp-top10.md +12 -0
  58. package/content/skills/mugiwara-security/references/rationalizations.md +8 -0
  59. package/content/skills/mugiwara-ship/SKILL.md +5 -4
  60. package/content/skills/mugiwara-workflow/SKILL.md +74 -77
  61. package/content/skills/mugiwara-workflow/references/workspace-layout.md +50 -0
  62. package/content/skills/using-mugiwara/SKILL.md +8 -19
  63. package/dist/mugiwara.js +107 -41
  64. package/gemini-extension.json +1 -1
  65. package/hooks/session-start.ts +1 -1
  66. package/package.json +11 -4
  67. package/plugin.json +1 -1
  68. package/references/multi-actor.md +1 -1
  69. package/scripts/evidence.sh +12 -5
  70. package/scripts/gate-selftest.ts +266 -0
  71. package/scripts/initiative.ts +248 -0
  72. package/scripts/lane.sh +15 -0
  73. package/scripts/mission-report.sh +90 -12
  74. package/scripts/onboard.ts +292 -0
  75. package/scripts/release-notes.ts +42 -13
  76. package/scripts/savepoint.sh +97 -50
  77. package/scripts/validate-content.ts +77 -0
  78. package/scripts/verify-install.ts +72 -0
  79. package/src/installer.ts +34 -7
  80. package/src/mission.ts +7 -5
  81. package/src/targets/claude.ts +20 -3
  82. package/src/targets/generic.ts +1 -1
  83. package/src/targets/opencode.ts +31 -10
  84. package/docs/concepts/agents.md +0 -53
  85. package/docs/concepts/audit-trail.md +0 -65
  86. package/docs/concepts/comparison.md +0 -58
  87. package/docs/concepts/config.md +0 -55
  88. package/docs/concepts/cost.md +0 -45
  89. package/docs/concepts/execution-model.md +0 -92
  90. package/docs/concepts/git-strategy.md +0 -62
  91. package/docs/concepts/lanes.md +0 -82
  92. package/docs/concepts/modes.md +0 -73
  93. package/docs/concepts/pr-summary.md +0 -54
  94. package/docs/concepts/skills.md +0 -55
  95. package/docs/concepts/workflow.md +0 -89
  96. package/docs/getting-started.md +0 -158
  97. package/docs/index.md +0 -56
  98. package/docs/install/antigravity.md +0 -45
  99. package/docs/install/claude.md +0 -77
  100. package/docs/install/cli.md +0 -115
  101. package/docs/install/codex.md +0 -44
  102. package/docs/install/copilot.md +0 -45
  103. package/docs/install/cursor.md +0 -45
  104. package/docs/install/gemini.md +0 -44
  105. package/docs/install/index.md +0 -53
  106. package/docs/install/kimi.md +0 -45
  107. package/docs/install/opencode.md +0 -143
  108. package/docs/install/pi.md +0 -46
  109. package/docs/reference/adoption-guide.md +0 -72
  110. package/docs/reference/agent-anatomy.md +0 -72
  111. package/docs/reference/compliance-matrix.md +0 -81
  112. package/docs/reference/developer-onboarding.md +0 -89
  113. package/docs/reference/enforcement.md +0 -35
  114. package/docs/reference/harness-matrix.md +0 -41
  115. package/docs/reference/skill-anatomy.md +0 -71
  116. package/docs/troubleshooting.md +0 -91
  117. package/evals/cases/_no-skill.json +0 -16
  118. package/evals/cases/adversarial-pressure-fake-pass.json +0 -25
  119. package/evals/cases/adversarial-pressure-skip-review.json +0 -25
  120. package/evals/cases/lane-exploratory-vague.json +0 -24
  121. package/evals/cases/lane-sensitivity-payment.json +0 -24
  122. package/evals/cases/positive-refactor-existing-tests.json +0 -25
  123. package/evals/cases/positive-resume-mid-mission.json +0 -24
  124. package/evals/cases/routing-agent-security.json +0 -25
  125. package/evals/cases/routing-auth-feature.json +0 -26
  126. package/evals/cases/routing-backend.json +0 -25
  127. package/evals/cases/routing-bug-one-file.json +0 -26
  128. package/evals/cases/routing-claim-audit.json +0 -25
  129. package/evals/cases/routing-context-budget.json +0 -25
  130. package/evals/cases/routing-contract-first.json +0 -25
  131. package/evals/cases/routing-execution.json +0 -25
  132. package/evals/cases/routing-frontend.json +0 -26
  133. package/evals/cases/routing-gates.json +0 -25
  134. package/evals/cases/routing-git.json +0 -25
  135. package/evals/cases/routing-healing.json +0 -25
  136. package/evals/cases/routing-lessons.json +0 -25
  137. package/evals/cases/routing-orchestration.json +0 -25
  138. package/evals/cases/routing-planning.json +0 -26
  139. package/evals/cases/routing-pr.json +0 -25
  140. package/evals/cases/routing-quality.json +0 -25
  141. package/evals/cases/routing-ship.json +0 -26
  142. package/evals/cases/routing-sunset.json +0 -25
  143. package/evals/cases/routing-using-mugiwara.json +0 -25
  144. package/evals/cases/routing-workflow.json +0 -25
  145. package/evals/floor.json +0 -6
@@ -1,53 +0,0 @@
1
- # The Crew — 14 Agents
2
-
3
- Every agent is a focused specialist. The main thread embodies each role inline
4
- using its skill; you can also summon any member directly. "Dispatch" below
5
- means "route the mission to this role."
6
-
7
- The front door is the `using-mugiwara` skill — load it for crew overview.
8
- Slash command: `/using-mugiwara`.
9
-
10
- | Agent | Crew member | Role | Summon for |
11
- |-------|-------------|------|------------|
12
- | `luffy-orchestrator` | Luffy | Captain — 5-way triage, check-ins, decisions, closure | mission start, wave boundaries, escalations |
13
- | `usopp-brainstorm` | Usopp | Critical friend — interrogates, researches, no rubber-stamps | vague ideas, direction, options |
14
- | `nami-planner` | Nami | Planner — interview-first, full-context scan, scaled plans | turning an idea into an execution plan |
15
- | `zoro-execution` | Zoro | Executor — inline sequential tasks, parallel worker batches, evidence per task | executing an approved plan |
16
- | `chopper-checkpoint` | Chopper | Auditor — verify-everything, deduped re-runs, failure ledger | auditing a wave's results |
17
- | `sanji-quality` | Sanji | Quality — discover real tooling, format/lint/test | after checkpoint passes |
18
- | `franky-gates` | Franky | Gates — coverage, build, Definition of Done, binary verdicts | after quality checks |
19
- | `robin-reviewer` | Robin | Reviewer — doubt-driven diff review, breaking-change map first | after gates pass |
20
- | `jinbe-security` | Jinbe | Security — STRIDE, OWASP, secrets, injection, dependencies | security audit of a diff |
21
- | `brook-healing` | Brook | Healer — reads the ledger, root-cause fixes, ≤3 cycles | any wave produced failures |
22
- | `skeptic-verifier` | Skeptic | Adversarial verifier — doubts every output, does NOT validate | high-stakes verdicts, plans, reviews |
23
- | `eval-runner` | Eval Runner | Harness tester — task suites, judge-agent comparison | verifying mugiwara itself works |
24
- | `resume-coordinator` | Resume Coordinator | Resumer — rebuilds state from `.mugiwara/`, continues never restarts | context loss, new session mid-mission |
25
- | `memory-keeper` | Memory Keeper | Institutional memory — surfaces past lessons, captures new ones | mission start + closure |
26
-
27
- ## How to summon
28
-
29
- Say a crew member's name in your request:
30
-
31
- ```
32
- > Chopper, audit the last wave against the plan
33
- > Nami, plan this out
34
- ```
35
-
36
- Luffy still records the route and its reason, and direct calls do not skip
37
- check-ins. The harness stays coherent either way.
38
-
39
- ## Who never does what
40
-
41
- - **Luffy** never implements code.
42
- - **Chopper** never fixes findings — reports them.
43
- - **Skeptic** never validates — doubts.
44
- - **Robin/Jinbe** never implement — findings to Brook.
45
- - Crew members never dispatch each other. Workers are subagents, never crew.
46
-
47
- ## The crew ships whole
48
-
49
- Every install gets all 14 agents and all 26 skills. No project-type selection —
50
- the harness routes each task to the right specialist.
51
-
52
- See [skills.md](skills.md) for the 26 techniques, or
53
- [workflow.md](workflow.md) for the pipeline.
@@ -1,65 +0,0 @@
1
- # Audit Trail
2
-
3
- Every artifact the Mugiwara crew produces — what writes it, when, and how to
4
- read it as a reviewer.
5
-
6
- ## The artifacts
7
-
8
- | Artifact | Path | Written by | When | For |
9
- |----------|------|-----------|------|-----|
10
- | **Plan doc** | `.mugiwara/plans/YYYY-MM-DD-<mission>.md` | Nami (planning) | Wave 2 | Zero-context executor — waves, tasks, criteria, risk |
11
- | **Spec** | `.mugiwara/spec/YYYY-MM-DD-<mission>.md` | Usopp (brainstorm) / Luffy (spec bridge) | Wave 0–1 | Bridge from idea to plan — goal, acceptance, constraints |
12
- | **State** | `.mugiwara/state.json` | `scripts/savepoint.sh` | Every wave boundary | Computed mission state: lane, wave, files, blockers, token budget, evidence paths |
13
- | **Decision log** | `.mugiwara/logs/YYYY-MM-DD-<mission>.md` | Luffy (orchestrator) | Every wave | Route reason, check-in verdicts, mode flips, decisions |
14
- | **Blocker ledger** | `.mugiwara/issues/YYYY-MM-DD-<mission>-blockers.md` | Any agent | On blocker hit | Row per blocker: wave, task, symptom, attempted, help-needed |
15
- | **Todo list** | `.mugiwara/results/<mission>-todos.md` | Zoro (execution) | Wave 3 | Checkbox per task, checked with evidence pointer |
16
- | **Audit report** | `.mugiwara/results/YYYY-MM-DD-<mission>-audit.md` | Chopper (checkpoint) | Wave 4 | Per-task evidence, commit hygiene, parallel-conflict, honest classification |
17
- | **Quality report** | `.mugiwara/results/YYYY-MM-DD-<mission>-quality.md` | Sanji (quality) | Wave 5 | Formatter/linter/unit/user-test results |
18
- | **Gate verdict** | `.mugiwara/results/YYYY-MM-DD-<mission>-gates.md` | Franky (gates) | Wave 6 | Coverage thresholds from config, build exit, DoD verdict |
19
- | **Review findings** | `.mugiwara/review/YYYY-MM-DD-<mission>-review.md` | Robin (review) | Wave 7 | Severity-tagged: path:line → problem → fix |
20
- | **Security report** | `.mugiwara/review/YYYY-MM-DD-<mission>-security.md` | Jinbe (security) | Wave 7 | STRIDE, OWASP mapping, checklist, CVSS severity |
21
- | **Heal report** | `.mugiwara/results/YYYY-MM-DD-<mission>-heal.md` | Brook (healing) | Wave 8 | Fixed list, escalated list, updated ledger |
22
- | **Closure report** | `.mugiwara/results/YYYY-MM-DD-<mission>-closure.md` | Luffy (orchestrator) | Wave 9 | Mission summary, per-wave outcomes, deferred items, lessons |
23
- | **Mission report** | `.mugiwara/reports/YYYY-MM-DD-<mission>.md` | `scripts/mission-report.sh` | Wave 9 | Human-readable summary: what changed, gates, state, token cost |
24
- | **PR verdict** | `.mugiwara/results/YYYY-MM-DD-<mission>-pr-verdict.md` | Luffy (orchestrator) | Wave 9 | Ready PR summary block for the user to open the PR |
25
- | **Trace** | `.mugiwara/results/<mission>-trace.md` | Resume coordinator | Every dispatch | Dispatch → outcome — drives resume (legacy; state.json preferred) |
26
- | **Lessons ledger** | `.mugiwara/logs/lessons.md` | Memory Keeper | Cross-mission | One row per real lesson, append-only, all actors share |
27
- | **Evidence logs** | `.mugiwara/results/<label>-<hash>.log` | `scripts/evidence.sh` | On demand | Command stdout/stderr capture with timestamp and exit code |
28
-
29
- ## How to read as a reviewer
30
-
31
- 1. **Start with the mission report** (`reports/`) — one file, what changed, gates, token cost.
32
- 2. **Check the gate verdict** (`results/<mission>-gates.md`) — coverage from config, build, DoD. Any FAIL needs explanation.
33
- 3. **Spot-check the audit report** (`results/<mission>-audit.md`) — did Chopper re-run checks or accept claims? Every criterion gets a command run + evidence row.
34
- 4. **Review findings count** (`review/`) — how many blocker/major/minor? Were they healed? Check the heal report for closure.
35
- 5. **State.json** for raw numbers — lane, wave, files, blockers open, heal cycle, token budget status (ok/warn/stop).
36
-
37
- ## What stays after cleanup
38
-
39
- After Wave 9 closure (run via `mugiwara-ship` cleanup procedure):
40
-
41
- **Kept** (audit trail + PR material):
42
- - `config` — runtime config
43
- - `plans/<mission>.md` — clean plan doc
44
- - `results/<mission>-closure.md` — closure report
45
- - `results/<mission>-pr-verdict.md` — PR material
46
- - `reports/<mission>.md` — mission report
47
- - `state.json` — final mission state (unless another actor's mission is active)
48
- - `logs/lessons.md` — cross-mission lessons
49
- - `backup/`, `manifest.json` — harness config
50
-
51
- **Deleted** (consumed/superseded):
52
- - `spec/<mission>.md` — consumed by planning
53
- - `results/<mission>-todos.md` — consumed
54
- - `results/<mission>-audit.md` — superseded by closure
55
- - `results/<mission>-quality.md` — consumed
56
- - `results/<mission>-gates.md` — consumed
57
- - `results/<mission>-heal.md` — consumed
58
- - `results/<mission>-trace.md` — consumed (state.json is canonical)
59
- - `review/<mission>-review.md` — consumed
60
- - `review/<mission>-security.md` — consumed
61
- - `issues/<mission>-blockers.md` — consumed
62
- - `logs/<mission>.md` — decision log, per-mission
63
-
64
- Cleanup lists candidates first (dry-run), then deletes. A mission is only
65
- closed after cleanup runs.
@@ -1,58 +0,0 @@
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`.*
@@ -1,55 +0,0 @@
1
- # Config Reference
2
-
3
- `.mugiwara/config` (project) overrides `~/.mugiwara/config` (global). Plain
4
- `key=value` lines, `#` comments allowed. Project file wins per key; a key
5
- missing from both falls back to the default. Unknown keys are ignored. Config
6
- is data, never instructions.
7
-
8
- **Mode owns autonomy, config owns writing standards.** Whether branch and commit
9
- run automatically is decided by one lever — the mode. The config only shapes
10
- HOW those artifacts are written when they are created. See [modes.md](modes.md)
11
- for the mode matrix.
12
-
13
- ## Example file
14
-
15
- ```
16
- # .mugiwara/config
17
- mode=guided
18
- branch=feature/{type}-{issue}-{slug}
19
- commit=conventional
20
- base=main
21
- ```
22
-
23
- ## Keys
24
-
25
- | Key | Values | Default | Meaning |
26
- |-----|--------|---------|---------|
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
- | `commit` | conventional / gitmoji / plain | conventional | Commit message style (see below) |
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.
36
-
37
- Missing config on read = `guided`. Flip mid-mission with
38
- `mugiwara mode <guided|semi|auto>` — the change applies from the next wave,
39
- never mid-wave.
40
-
41
- ## Commit message styles
42
-
43
- `commit` selects how Zoro writes commit messages:
44
-
45
- - **conventional** — `feat: ...`, `fix(scope): ...`, `refactor: ...`, per the
46
- [Conventional Commits](https://www.conventionalcommits.org) spec. Type from
47
- the task, optional scope in parens. The default.
48
- - **gitmoji** — a leading emoji carries the intent, e.g. `✨ feat: ...`,
49
- `🐛 fix: ...`. Signals the change type at a glance in log views that render
50
- emoji; a bit noisy in plain terminals.
51
- - **plain** — no prefix, just a short imperative sentence: `Fix export csv
52
- encoding`. Clearest for repos that don't use any convention.
53
-
54
- Switch freely per project — it only affects the message format, never the
55
- one-logical-task-one-commit rule.
@@ -1,45 +0,0 @@
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.
@@ -1,92 +0,0 @@
1
- # Execution Model
2
-
3
- Why the crew runs in your main conversation — and when subagents are actually
4
- used.
5
-
6
- ## Auto-activation
7
-
8
- The workflow **auto-activates.** At session start the crew is announced; when
9
- you give a non-trivial request, the pipeline runs by itself — you do not need
10
- to call `/using-mugiwara`. It remains an optional explicit router if you want
11
- to hand-route a mission.
12
-
13
- ## Inline by default
14
-
15
- The crew runs **inline**. The main thread embodies each crew role using that
16
- member's skill, so every wave plays out in your main conversation and you watch
17
- it happen:
18
-
19
- - Luffy's triage, Nami's planning, Zoro's execution, Chopper's audit, Sanji's
20
- quality, Franky's gates, Robin/Jinbe's review, Brook's healing, Luffy's
21
- closure — all performed in the main thread.
22
- - Evidence is written to `.mugiwara/` files; the conversation carries terse
23
- verdicts and evidence pointers.
24
-
25
- ## When subagents ARE used
26
-
27
- Subagents exist to parallelize, never to hide work:
28
-
29
- 1. **`[PARALLEL]` task batches** — independent tasks that touch no shared files
30
- or interfaces run concurrently, one per worker subagent. This is the only
31
- place Zoro delegates.
32
- 2. **Parallel fixes** — Brook spawns workers for independent heal fixes.
33
- 3. **Background / long-running checks** — work that would stall the
34
- conversation.
35
- 4. **Check subagents** — Chopper, Robin, and Jinbe may spawn subagents for
36
- independent re-runs or diff passes.
37
-
38
- Worker results return as reports; the main thread summarizes them inline with
39
- evidence pointers.
40
-
41
- ## Why not dispatch every wave to a subagent?
42
-
43
- Every harness — Claude Code, opencode, Codex, Cursor, Gemini — hides subagent
44
- internals behind a click or a side panel. If each wave ran as a subagent, you'd
45
- be clicking through the whole mission to see what happened. Running the crew in
46
- the main conversation is the only way the process is genuinely visible.
47
-
48
- There's also a context cost to deep nesting: crew-inside-crew subagents bloat
49
- context and hide decisions. Inline keeps the user in the loop and the story
50
- linear.
51
-
52
- ## Rules that keep it sane
53
-
54
- - Crew members never dispatch another crew member. A role that must split work
55
- returns the split to the main thread, which spawns the workers.
56
- - Escalation = "blocked" + ledger row returned to the main thread.
57
- - Sequential work never takes a subagent round-trip — no skipping, no hidden
58
- reordering, plan order is plan order.
59
-
60
- ## Checkpoint reports
61
-
62
- You see progress as **checkpoint reports**, not a firehose: a wave banner
63
- (`## Wave N — <crew> (<skill>)`), one compact report per crew member at each
64
- stage boundary (what ran / result / evidence pointer), a progress summary per
65
- wave, and a pause when something fails or gets risky. Subagents are used only
66
- where they genuinely help: independent `[PARALLEL]` task batches, Brook's
67
- reviewer/security re-verification workers, and background checks.
68
-
69
- ## Manual stages
70
-
71
- Prefer to drive the stages yourself? Every stage has a slash command that loads
72
- the skill, runs the crew role inline, and bridges state from `.mugiwara/`:
73
-
74
- | Command | Runs | Reads state from |
75
- |---------|------|------------------|
76
- | `/mugiwara-plan` | Nami | `.mugiwara/spec/` |
77
- | `/mugiwara-execute` | Zoro | `.mugiwara/plans/` |
78
- | `/mugiwara-review` | Robin | `.mugiwara/results/` + diff |
79
- | `/mugiwara-security` | Jinbe | `.mugiwara/results/` + diff |
80
- | `/mugiwara-heal` | Brook | `.mugiwara/issues/` |
81
- | `/mugiwara-ship` | Luffy | plan + results |
82
-
83
- You can jump into any stage — e.g. run `/mugiwara-plan` first, then
84
- `/mugiwara-execute` later when you're ready.
85
-
86
- ## Trade-off
87
-
88
- Inline execution grows the main-thread context over a long mission. The crew
89
- mitigates this: evidence goes to `.mugiwara/` files, reports are terse, and
90
- subagents isolate the genuinely heavy parallel work. For missions that must
91
- minimize main-context growth, the crew supports dispatching specific waves to a
92
- subagent — at the cost of visibility.
@@ -1,62 +0,0 @@
1
- # Git Strategy
2
-
3
- Commits, branches, save-points — and why the executor commits, not the closer.
4
-
5
- ## Who commits and when
6
-
7
- **Zoro commits during execution, per logical task.** The executor is the one
8
- making the changes, so it commits at the moment each unit of work passes its
9
- acceptance criteria. This gives:
10
-
11
- - **Save-points** — rollback is one `git reset --hard <save-point>` away.
12
- - **Reversibility** — every commit is one logical change you can name.
13
- - **Bisectability** — a regression points at the exact commit that introduced it.
14
-
15
- Luffy does NOT re-commit at closure. The closer pushes the mission branch and
16
- writes the PR verdict — re-slicing history at the end means one giant diff, no
17
- save-points, and a painful bisect.
18
-
19
- ## Commit granularity: logical tasks, not micro-steps
20
-
21
- A commit = one **logical change** (a feature, a fix, a refactor). The plan's
22
- tasks are sized at that granularity — see `mugiwara-planning`.
23
-
24
- - Adjacent trivial changes (typo, formatting, one-line tweak) fold into the
25
- neighboring logical task's commit.
26
- - Never one commit per keystroke; never a wave of micro-commits.
27
- - If the plan slices finer than a logical change, group adjacent tasks into one
28
- commit and note the grouping in the execution report.
29
-
30
- ## The rules (from `mugiwara-git`)
31
-
32
- 1. **Atomic commits.** One logical change per commit; each commit compiles and
33
- passes the relevant checks — never commit a broken tree.
34
- 2. **Exact staging.** `git add` specific files and paths, never `git add -A`
35
- sweeping an unrelated commit.
36
- 3. **Save-points before risky work.** Commit the working state with a naming
37
- intent message (`checkpoint: before renderer migration`) before refactors,
38
- migrations, or merges.
39
- 4. **Match repo style.** Inspect `git log --oneline -20` before the first
40
- commit and copy the observed conventions (prefix style, case, body usage).
41
- 5. **Never commit secrets.** Scan for `.env*`, keys, tokens before every
42
- commit. A secret already committed = treat as compromised, rotate, purge,
43
- file a security finding.
44
-
45
- ## Branches
46
-
47
- One branch per mission, from the config `branch` key:
48
-
49
- ```
50
- branch=feature/{type}-{issue}-{slug}
51
- ```
52
-
53
- `{type}` = feat/fix/chore/refactor from the task, `{issue}` = ticket/key
54
- reference (fallback: date), `{slug}` = kebab-case mission title. Created before
55
- the first task commit; never force-push once pushed. No mugiwara-prefixed
56
- branch names.
57
-
58
- ## Terminal step
59
-
60
- Every mode ends the same way: save-point commit → `git push -u origin <branch>`
61
- → PR verdict file written (per `mugiwara-pr`) → branch + verdict handed to you,
62
- who opens the PR. The crew never creates a PR, merges, or deploys.
@@ -1,82 +0,0 @@
1
- # Lanes & Sizing
2
-
3
- The crew sizes a mission before it runs. Lane is computed from the diff by
4
- `scripts/lane.sh` — deterministic, not estimated.
5
-
6
- ## The lanes
7
-
8
- | Lane | Picks when | Waves | Token budget |
9
- |------|-----------|-------|:------:|
10
- | **0 · Direct** | typo, rename, 1 file <20 LOC | none | ~0 |
11
- | **1 · Lean** | bug in 1-2 files, <50 LOC | execute → quality | ~4k |
12
- | **2 · Standard** | feature, 3-8 files | plan → execute → audit → review | ~10k |
13
- | **3 · Full** | architecture, migration, 9+ files, or auth/payment/API touched | all 9 waves | ~20k |
14
- | **4 · Spike** | exploratory, needs direction | brainstorm → re-triage | ~3k |
15
-
16
- ## How lane is computed
17
-
18
- `scripts/lane.sh <base-ref>` runs `git diff --name-only` against the base ref
19
- and applies deterministic rules:
20
-
21
- | Diff | Lane |
22
- |------|------|
23
- | 0 files changed | Direct |
24
- | 1 file, <20 LOC added | Direct |
25
- | 1 file, ≥20 LOC added | Lean |
26
- | 2 files | Lean |
27
- | 3–8 files | Standard |
28
- | 9+ files | Full |
29
-
30
- **Sensitive path escalation.** Files matching these patterns always escalate to
31
- Lane 3 (Full), regardless of file count:
32
-
33
- ```
34
- auth/ payment/ billing/ crypto/ secrets/ .env
35
- migration/ .sql schema. .prisma .terraform .tf
36
- ```
37
-
38
- Use `--json` for machine output:
39
-
40
- ```json
41
- {
42
- "lane": "full",
43
- "reason": "sensitive paths (src/auth/login.ts) — escalated from standard",
44
- "files_touched": 5,
45
- "sensitive_paths": ["src/auth/login.ts"],
46
- "base": "main"
47
- }
48
- ```
49
-
50
- ## Token budget
51
-
52
- Every lane has a budget enforced by `scripts/savepoint.sh` at each wave
53
- boundary. The harness sets `MUGIWARA_TOKENS` env var with estimated tokens
54
- consumed.
55
-
56
- | Status | Condition | Action |
57
- |--------|-----------|--------|
58
- | ok | tokens < 1.5× budget | Continue |
59
- | warn | tokens ≥ 1.5× budget | Log warning to decision log |
60
- | stop | tokens ≥ 3× budget | Write state, report to user, pause mission |
61
-
62
- Budget guidance, not a hard kill switch. The model decides whether to stop —
63
- savepoint just writes the status to `state.json`.
64
-
65
- ## Escalation
66
-
67
- Lane **escalates when work outgrows the estimate.** At every wave boundary,
68
- `scripts/savepoint.sh` re-checks the diff. If files grew or a sensitive path
69
- appeared, lane rises. A lane **never auto-drops.** Under-process costs more
70
- than over-process.
71
-
72
- Manual escalation: if the user says "this is bigger than I thought — run the
73
- full pipeline," Luffy records it in the decision log and escalates.
74
-
75
- ## SPIKE lane (Lane 4)
76
-
77
- Exploratory missions start at Lane 4. Usopp brainstorms, then the mission is
78
- re-triaged into the right lane. A spike that stays a spike (no code change
79
- decided) ends at Wave 1.
80
-
81
- Lane is computed per mission by `scripts/lane.sh`, not stored in
82
- `.mugiwara/config`.
@@ -1,73 +0,0 @@
1
- # Modes
2
-
3
- The crew's autonomy level. Read once per wave at dispatch; a flip applies from
4
- the next wave, never mid-wave.
5
-
6
- **Mode owns autonomy, config owns writing standards.** Whether branch and commit
7
- run automatically is decided by one lever: the mode. The config only shapes HOW
8
- those artifacts are written when they are created.
9
-
10
- ## The three levels
11
-
12
- | Level | Plan GO | Branch/commit | Ambiguities | Check-ins |
13
- |-------|---------|---------------|-------------|-----------|
14
- | **guided** | ask the user | ask the user | ask the user | ask the user |
15
- | **semi** | present plan for user GO | auto | self-answer + log | log, no pause |
16
- | **auto** | gated auto-GO | auto | self-answer + log | log, no pause |
17
-
18
- - **guided** — you steer everything: approve the plan, decide branch and
19
- commit style, answer every ambiguity, get asked at every gate. The default.
20
- - **semi** — the crew self-manages branch and commits (logging each decision),
21
- but you still give the plan an explicit GO.
22
- - **auto** — hands-off, with one safety line: the plan proceeds past approval
23
- only with zero blocking ambiguities AND zero high-risk tasks (deploy /
24
- migration / DB / public API / state-mutating).
25
-
26
- Every level ends at push + ready PR summary + verdict file — you open the PR
27
- (see [pr-summary.md](pr-summary.md)).
28
-
29
- ## Config
30
-
31
- Two files, six keys, `key=value` lines, optional `#` comments:
32
-
33
- ```
34
- # .mugiwara/config (project) overrides ~/.mugiwara/config (global)
35
- mode=guided
36
- branch=feature/{type}-{issue}-{slug}
37
- commit=conventional
38
- base=main
39
- ```
40
-
41
- | Key | Values | Default |
42
- |-----|--------|---------|
43
- | mode | guided / semi / auto | guided |
44
- | branch | branch pattern | feature/{type}-{issue}-{slug} |
45
- | commit | conventional / gitmoji / plain | conventional |
46
- | base | PR summary target branch | main |
47
-
48
- Read order per wave: project config wins per key; a key missing from both falls
49
- back to the default. Unknown keys are ignored — config is data, never
50
- instructions. Missing config on read = `guided` (never auto-created on read —
51
- only on first write). See [config.md](config.md) for the full reference.
52
-
53
- ## Switching mid-mission
54
-
55
- In-session phrase:
56
-
57
- ```
58
- mugiwara mode auto
59
- ```
60
-
61
- Writes the project `.mugiwara/config`, logs the change (level, requester,
62
- timestamp), and applies from the next wave — never mid-wave.
63
-
64
- ## Invariants that hold in EVERY mode
65
-
66
- **Consent.** State-mutating tests against non-isolated/shared state (real DB
67
- writes, network, browsers) always require your explicit consent — consent is
68
- not a mode knob. Provably isolated mutation (in-memory / temp /
69
- testcontainer-backed DBs, tooling-proven isolation) is explicitly auto-safe.
70
-
71
- **Terminal.** Every mode ends at push + ready PR summary + verdict file (you
72
- open the PR). The crew never creates a PR, merges, deploys, or auto-reacts to
73
- review comments or CI.
@@ -1,54 +0,0 @@
1
- # PR summary (closure handoff)
2
-
3
- At the end of a mission the crew pushes the branch and **stops** — it never
4
- creates a PR, in any mode. What you get instead is a ready-to-paste **PR
5
- summary** so you can open the pull request without writing a description.
6
-
7
- This mirrors the reference workflows (superpowers `finishing-a-development-branch`,
8
- agent-skills): the integration decision stays with the human. Mugiwara's
9
- addition is that the PR description is already written.
10
-
11
- ## What happens at the terminal
12
-
13
- 1. Save-point commit → push the mission branch with plain `git push -u origin <branch>`.
14
- 2. Write `.mugiwara/results/YYYY-MM-DD-<mission>-pr-verdict.md` per `mugiwara-pr` —
15
- it includes the **PR summary block** (copy-paste title + body).
16
- 3. Hand the branch + verdict file to you. You open the PR and paste the block.
17
-
18
- No `gh` CLI, no PR API calls, no auto-reaction to review comments or CI.
19
-
20
- ## The PR summary block
21
-
22
- The verdict file's PR summary is shaped by `.mugiwara/config` (project) /
23
- `~/.mugiwara/config` (global):
24
-
25
- | Key | Default | What it shapes |
26
- |-----|---------|----------------|
27
- | `base` | `main` | The target branch named in the PR summary |
28
-
29
- Example:
30
-
31
- ```
32
- mode=guided
33
- branch=feature/{type}-{issue}-{slug}
34
- commit=conventional
35
- base=main
36
- ```
37
-
38
- The title is a concise `{type}: {summary}` line from mission metadata; the body
39
- is the verdict-file PR summary block (what changed, evidence, checks). The
40
- summary is **material, never posted** — the crew's job ends at push.
41
-
42
- ## Why no auto-create
43
-
44
- - PR creation is an external, irreversible side effect (public artifact, CI
45
- trigger, reviewer notifications) — keeping it human avoids surprise and
46
- security surface.
47
- - The crew never needs forge credentials (`gh` auth, API tokens), so there is
48
- nothing to leak and nothing to configure.
49
- - The stop-at-PR invariant holds in every mode: no auto-reaction to review
50
- comments, no auto-healing CI, no merge, no deploy.
51
-
52
- See [`mugiwara-pr`](../content/skills/mugiwara-pr/SKILL.md) for the terminal
53
- procedure and [`mugiwara-mode`](../content/skills/mugiwara-mode/SKILL.md) for
54
- the mode contract.