@ionivetech/mugiwara 0.4.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 (97) hide show
  1. package/README.md +231 -371
  2. package/content/agents/brook-healing.md +2 -2
  3. package/content/agents/chopper-checkpoint.md +2 -1
  4. package/content/agents/eval-runner.md +4 -4
  5. package/content/agents/franky-gates.md +1 -1
  6. package/content/agents/jinbe-security.md +2 -1
  7. package/content/agents/luffy-orchestrator.md +3 -3
  8. package/content/agents/memory-keeper.md +1 -1
  9. package/content/agents/nami-planner.md +2 -2
  10. package/content/agents/resume-coordinator.md +8 -9
  11. package/content/agents/robin-reviewer.md +3 -2
  12. package/content/agents/sanji-quality.md +1 -1
  13. package/content/agents/skeptic-verifier.md +4 -3
  14. package/content/agents/using-mugiwara.md +3 -3
  15. package/content/agents/usopp-brainstorm.md +3 -3
  16. package/content/agents/zoro-execution.md +4 -3
  17. package/content/skills/mugiwara-agent-security/SKILL.md +14 -2
  18. package/content/skills/mugiwara-backend/SKILL.md +2 -8
  19. package/content/skills/mugiwara-backend/references/source-backed-example.md +77 -0
  20. package/content/skills/mugiwara-brainstorm/SKILL.md +2 -2
  21. package/content/skills/mugiwara-checkpoint/SKILL.md +2 -2
  22. package/content/skills/mugiwara-checkpoint/references/ledger-format.md +34 -0
  23. package/content/skills/{mugiwara-doubt-driven-development → mugiwara-claim-audit}/SKILL.md +2 -2
  24. package/content/skills/{mugiwara-context-engineering → mugiwara-context-budget}/SKILL.md +2 -2
  25. package/content/skills/mugiwara-context-budget/references/context-budget.md +37 -0
  26. package/content/skills/{mugiwara-api-and-interface-design → mugiwara-contract-first}/SKILL.md +4 -2
  27. package/content/skills/mugiwara-contract-first/references/versioning-playbook.md +36 -0
  28. package/content/skills/mugiwara-execution/SKILL.md +4 -2
  29. package/content/skills/mugiwara-execution/references/worked-example.md +88 -0
  30. package/content/skills/mugiwara-frontend/SKILL.md +13 -14
  31. package/content/skills/mugiwara-frontend/references/design-tokens.md +25 -0
  32. package/content/skills/mugiwara-frontend/references/slop-catalog.md +19 -0
  33. package/content/skills/mugiwara-gates/SKILL.md +4 -4
  34. package/content/skills/mugiwara-git/SKILL.md +1 -1
  35. package/content/skills/mugiwara-healing/SKILL.md +34 -7
  36. package/content/skills/mugiwara-healing/references/failure-taxonomy.md +23 -0
  37. package/content/skills/mugiwara-lessons/SKILL.md +1 -1
  38. package/content/skills/mugiwara-orchestration/SKILL.md +5 -5
  39. package/content/skills/mugiwara-planning/SKILL.md +2 -2
  40. package/content/skills/mugiwara-planning/references/anti-patterns.md +17 -0
  41. package/content/skills/mugiwara-planning/references/plan-template.md +46 -0
  42. package/content/skills/mugiwara-pr/SKILL.md +1 -1
  43. package/content/skills/{mugiwara-test-driven-development → mugiwara-proof-order}/SKILL.md +2 -2
  44. package/content/skills/mugiwara-proof-order/references/proof-order-examples.md +62 -0
  45. package/content/skills/mugiwara-quality/SKILL.md +3 -3
  46. package/content/skills/mugiwara-resume/SKILL.md +44 -33
  47. package/content/skills/mugiwara-review/SKILL.md +1 -1
  48. package/content/skills/mugiwara-review/references/five-axis-worksheet.md +36 -0
  49. package/content/skills/mugiwara-review/references/severity-rubric.md +20 -0
  50. package/content/skills/{mugiwara-systematic-debugging → mugiwara-root-cause}/SKILL.md +4 -2
  51. package/content/skills/mugiwara-root-cause/references/four-phase-worked.md +71 -0
  52. package/content/skills/mugiwara-security/SKILL.md +1 -1
  53. package/content/skills/mugiwara-security/references/owasp-mapping.md +30 -0
  54. package/content/skills/mugiwara-security/references/stride-worksheet.md +37 -0
  55. package/content/skills/mugiwara-ship/SKILL.md +1 -1
  56. package/content/skills/{mugiwara-deprecation → mugiwara-sunset}/SKILL.md +2 -2
  57. package/content/skills/mugiwara-testcases/SKILL.md +1 -1
  58. package/content/skills/mugiwara-testcases/references/intake-formats.md +42 -0
  59. package/content/skills/mugiwara-workflow/SKILL.md +20 -23
  60. package/dist/mugiwara.js +37 -8
  61. package/docs/agents.md +2 -2
  62. package/docs/audit-trail.md +65 -0
  63. package/docs/comparison.md +43 -170
  64. package/docs/compliance-matrix.md +81 -0
  65. package/docs/config.md +4 -2
  66. package/docs/cost.md +45 -0
  67. package/docs/enforcement.md +32 -35
  68. package/docs/getting-started.md +103 -41
  69. package/docs/harness-matrix.md +41 -0
  70. package/docs/lanes.md +65 -23
  71. package/docs/skill-anatomy.md +42 -54
  72. package/docs/skills.md +36 -54
  73. package/evals/cases/positive-refactor-existing-tests.json +1 -1
  74. package/evals/cases/routing-bug-one-file.json +1 -1
  75. package/package.json +5 -4
  76. package/references/definition-of-done.md +42 -0
  77. package/references/multi-actor.md +44 -0
  78. package/references/skill-versioning.md +44 -0
  79. package/references/source-grounding.md +23 -0
  80. package/references/token-budget.md +34 -0
  81. package/scripts/evidence.sh +37 -0
  82. package/scripts/lane.sh +74 -0
  83. package/scripts/mission-report.sh +88 -0
  84. package/scripts/release-notes.ts +65 -0
  85. package/scripts/retrieval-eval.ts +152 -0
  86. package/scripts/run-evals.ts +113 -0
  87. package/scripts/savepoint.sh +165 -0
  88. package/scripts/sync-version.ts +30 -0
  89. package/scripts/validate-content.ts +226 -0
  90. package/src/cli.ts +8 -3
  91. package/src/mission.ts +26 -3
  92. package/content/skills/mugiwara-dynamic-workflow/SKILL.md +0 -90
  93. package/content/skills/mugiwara-eval/SKILL.md +0 -87
  94. package/content/skills/mugiwara-git-worktrees/SKILL.md +0 -67
  95. package/content/skills/mugiwara-mode/SKILL.md +0 -77
  96. package/content/skills/mugiwara-observability/SKILL.md +0 -59
  97. package/content/skills/mugiwara-writing-skills/SKILL.md +0 -65
@@ -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/lanes.md CHANGED
@@ -1,40 +1,82 @@
1
1
  # Lanes & Sizing
2
2
 
3
- The crew sizes a mission before it runs. At Wave 0, Luffy sizes the request
4
- and picks a lane. The lane decides how many waves run so a one-file typo does
5
- not pay for the full nine-wave pipeline.
3
+ The crew sizes a mission before it runs. Lane is computed from the diff by
4
+ `scripts/lane.sh`deterministic, not estimated.
6
5
 
7
6
  ## The lanes
8
7
 
9
- | Lane | Picks when | Waves | Budget |
10
- |------|-----------|-------|--------|
8
+ | Lane | Picks when | Waves | Token budget |
9
+ |------|-----------|-------|:------:|
11
10
  | **0 · Direct** | typo, rename, 1 file <20 LOC | none | ~0 |
12
11
  | **1 · Lean** | bug in 1-2 files, <50 LOC | execute → quality | ~4k |
13
- | **2 · Standard** | feature, 3-8 files | plan → execute → checkpoint → review | ~10k |
14
- | **3 · Full** | architecture, migration, auth/payment, API | 9 waves | ~20k |
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 |
15
14
  | **4 · Spike** | exploratory, needs direction | brainstorm → re-triage | ~3k |
16
15
 
17
- Budget is a guidance, not a meter: at ~1.5× estimated tokens warn, at 3× stop,
18
- write the state to `.mugiwara/` and report how to continue — never silently
19
- run on.
16
+ ## How lane is computed
20
17
 
21
- ## How Luffy sizes
18
+ `scripts/lane.sh <base-ref>` runs `git diff --name-only` against the base ref
19
+ and applies deterministic rules:
22
20
 
23
- Size from the diff:
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 |
24
29
 
25
- - 1 file <20 LOC Lane 0 (Direct).
26
- - 1-2 files Lane 1 (Lean).
27
- - 3-8 files → Lane 2 (Standard).
28
- - 9+ files, or the diff touches `auth/`, `payment/`, `migrations/`, or
29
- `security/` Lane 3 (Full).
30
- - Exploratory, needs direction Lane 4 (Spike).
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`.
31
64
 
32
65
  ## Escalation
33
66
 
34
- The lane **escalates when the work outgrows the estimate** the diff grew, a
35
- sensitive path got touched mid-mission, or failures repeat. Escalation is
36
- automatic; a lane **never auto-drops**. Under-process is more expensive than
37
- over-process.
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.
38
80
 
39
- The lane is decided by Luffy at triage, per mission it is not stored in
81
+ Lane is computed per mission by `scripts/lane.sh`, not stored in
40
82
  `.mugiwara/config`.
@@ -1,23 +1,20 @@
1
1
  # Skill Anatomy
2
2
 
3
- Every mugiwara skill is a single portable `SKILL.md` file. No code, no runtime —
4
- just frontmatter plus a playbook the agent follows. This is the format skills
5
- ship in for Claude Code, opencode, Copilot, Cursor, Gemini, and 70+ other tools
6
- via the agentskills.io layout.
3
+ Every mugiwara skill is a single `SKILL.md` file. No code, no runtime — just
4
+ frontmatter plus a playbook the agent follows.
7
5
 
8
6
  ## File structure
9
7
 
10
8
  ```
11
9
  skills/<skill-name>/SKILL.md
12
- skills/<skill-name>/references/<topic>.md # optional: overflow detail, linked from the body
10
+ skills/<skill-name>/references/<topic>.md # optional: overflow detail
13
11
  ```
14
12
 
15
13
  ```markdown
16
14
  ---
17
15
  name: mugiwara-checkpoint
18
- description: Use after an execution wave to audit results against the plan. Runs every acceptance criterion as a command or file inspect, verifies commit hygiene and parallel-file safety, classifies failures honestly, appends ledger rows, and issues a Definition-of-Done verdict. Auditor only - never fixes code.
16
+ description: Use after an execution wave to audit results against the plan.
19
17
  ---
20
-
21
18
  # Checkpoint (Chopper)
22
19
 
23
20
  <playbook body>
@@ -27,57 +24,48 @@ description: Use after an execution wave to audit results against the plan. Runs
27
24
 
28
25
  | Field | Required | Notes |
29
26
  |-------|----------|-------|
30
- | `name` | yes | lowercase, hyphen-separated, matches the folder name, ≤64 chars |
31
- | `description` | yes | 20–500 chars; what it does AND when to trigger. Front-load the trigger keywords. Skills without a description are filtered out. |
32
- | `license`, `compatibility`, `metadata` | no | optional extras |
33
-
34
- ## The playbook body
35
-
36
- The body is the actual behavior. Well-formed mugiwara skills follow a house
37
- style:
38
-
39
- 1. **Title + one-line identity** — `# Checkpoint (Chopper)`, then what the role
40
- is and is not.
41
- 2. **Skip when** — required. ≤4 bullets, numeric threshold, telling the agent
42
- when this skill does not apply (e.g. "no UI code touched", "<3 files").
43
- Without it the content validator fails the build. A skipped skill is
44
- recorded in the decision log, never silent.
45
- 3. **The protocol** — numbered steps, exact commands, exact file paths.
46
- 4. **Decision tables** — where a judgment is needed, a table of signal → action.
47
- 5. **The iron law** one memorable line that states the non-negotiable
48
- ("TRUST NOTHING; VERIFY EVERYTHING").
49
- 6. **Common rationalizations** the excuses to reject, and the correct reply.
50
- 7. **Red flags** conditions that mean "stop, this isn't done," each ending
51
- with what to do.
52
-
53
- ### Style rules that keep skills effective
54
-
55
- - **Evidence over claims.** A skill says what to run, never what to assume.
56
- - **Concrete, never aspirational.** Exact paths, exact commands; "works
57
- correctly" is banned as an acceptance criterion.
58
- - **Boundaries are explicit.** Auditor skills say "never edit code"; executor
59
- skills say "never report done without command output."
60
- - **≤120 lines.** Skills that grow past that get split, not stretched.
61
- - **Progressive disclosure.** Keep the trigger-scannable description and the
62
- decision tree in the body; when a section exceeds roughly 15–20 lines, move
63
- the detail to a `references/<topic>.md` file and drop a one-line pointer in
64
- the body saying what to read and why.
65
-
66
- ## How skills reference each other
67
-
68
- Skills cross-reference by name: an agent's frontmatter lists its held skills
69
- (`skills: mugiwara-checkpoint`), and skills defer to each other (e.g.
70
- `mugiwara-quality` defers to `mugiwara-mode` for the consent contract). Content
71
- is the single source of truth; harnesses copy it verbatim.
27
+ | `name` | yes | lowercase, hyphen-separated, matches folder name, ≤64 chars |
28
+ | `description` | yes | 20–500 chars; trigger conditions + disambiguators only. Front-load trigger keywords. |
29
+ | `license`/`compatibility`/`metadata` | no | optional |
30
+
31
+ ## Playbook body
32
+
33
+ 1. **Title + one-line identity** role name and what it does/doesn't do.
34
+ 2. **Skip when** — required. ≤4 bullets, numeric threshold. Validator fails
35
+ build without it.
36
+ 3. **Protocol** — numbered steps, exact commands, exact file paths.
37
+ 4. **Decision tables** — signal → action.
38
+ 5. **Iron law** — one memorable non-negotiable line.
39
+ 6. **Common rationalizations** excuses + correct reply.
40
+ 7. **Red flags** stop conditions + what to do.
41
+
42
+ ## Style rules
43
+
44
+ - **Evidence over claims.** Say what to run, never what to assume.
45
+ - **Concrete, never aspirational.** Exact paths, exact commands.
46
+ - **≤120 lines.** Grow beyond split or move to `references/`.
47
+ - **Progressive disclosure.** Sections >15–20 lines move to
48
+ `references/<topic>.md`; body gets a one-line pointer saying what to read
49
+ and why.
50
+ - **220-char description ceiling.** Descriptions carry trigger vocabulary, not
51
+ procedure. Procedure belongs in the body.
52
+
53
+ ## Three-layer discipline
54
+
55
+ | Stays in body | Moves to references |
56
+ |---------------|---------------------|
57
+ | Skip when, red flags, rationalizations | Worked examples |
58
+ | "Never do X" rules | Long checklists |
59
+ | Step order, decision trees | Reference tables, edge cases, templates |
60
+
61
+ Test: body = what changes behavior on every run. References = what you open
62
+ after deciding to do the work.
72
63
 
73
64
  ## Validation
74
65
 
75
- Every skill is validated on check-in: name matches folder, description 20–500
76
- chars, body ≤120 lines, no duplicate names, and a `## Skip when` block with
77
- 1–4 bullets. Run:
78
-
79
66
  ```bash
80
67
  bun run validate
81
68
  ```
82
69
 
83
- See [developer-onboarding.md](developer-onboarding.md).
70
+ Checks: name matches folder, description 20–500 chars, body ≤120 lines, no
71
+ duplicate names, `## Skip when` block with 1–4 bullets.
package/docs/skills.md CHANGED
@@ -1,73 +1,55 @@
1
- # The Techniques — 32 Skills
1
+ # The Techniques — 26 Skills
2
2
 
3
3
  Each skill is a portable markdown playbook — the "how to" the crew follows when
4
- it embodies a role. Skills are the actual content; agents are the personas.
4
+ it embodies a role.
5
5
 
6
6
  ## Core pipeline
7
7
 
8
- | Skill | Enforces |
9
- |-------|----------|
10
- | `mugiwara-workflow` | The harness entry point: inline execution model, gateway triage, wave pipeline, workspace layout, blocker protocol, cleanup |
11
- | `mugiwara-orchestration` | Luffy's captain behavior: 5-way classifier, check-ins, work splitting, decision log, closure |
12
- | `mugiwara-brainstorm` | Usopp's critical sparring: interrogate, research facts, cut over-engineering, recommend |
13
- | `mugiwara-planning` | Interview-first, full-context scan, wave plans with parallel/sequential markers + anti-patterns |
14
- | `mugiwara-execution` | Todo list, sequential tasks inline + parallel worker batches, 6-field delegation for parallel work, one commit per logical task |
15
- | `mugiwara-checkpoint` | Verify-everything audit — deduped and scoped to the wave's diff; failure rows to the blocker ledger |
16
- | `mugiwara-quality` | Discover the project's real tooling; formatter, linter, unit tests under the consent matrix |
17
- | `mugiwara-gates` | Coverage ≥90% new / ≥80% modified, build validation, Definition of Done |
18
- | `mugiwara-review` | Doubt-driven review: breaking-change analysis, five-axis, severity-tagged findings |
19
- | `mugiwara-security` | STRIDE-first security review, OWASP Top 10 mapping, authn/authz, secrets, dependency audit, untrusted-data doctrine |
8
+ | Skill | Teaches |
9
+ |-------|---------|
10
+ | `mugiwara-workflow` | Harness entry: inline execution, gateway triage, wave pipeline, workspace, blocker protocol, cleanup |
11
+ | `mugiwara-orchestration` | Captain: 5-way classifier, check-ins, work splitting, decision log, closure |
12
+ | `mugiwara-brainstorm` | Critical sparring: interrogate, research facts, cut over-engineering, recommend |
13
+ | `mugiwara-planning` | Interview-first, full-context scan, wave plans with parallel/sequential markers |
14
+ | `mugiwara-execution` | Todo list, sequential inline + parallel worker batches, 6-field delegation, one commit per task |
15
+ | `mugiwara-checkpoint` | Verify-everything audit — deduped re-runs scoped to wave diff; failure rows to blocker ledger |
16
+ | `mugiwara-quality` | Discover project tooling; formatter, linter, unit tests under consent matrix |
17
+ | `mugiwara-gates` | Coverage ≥90% new / ≥80% modified, build, Definition of Done |
18
+ | `mugiwara-review` | Doubt-driven review: breaking-change map, five-axis, severity-tagged findings |
19
+ | `mugiwara-security` | STRIDE-first security review, OWASP Top 10, authn/authz, secrets, untrusted-data |
20
20
  | `mugiwara-healing` | Reads the ledger, Stop-the-Line + Prove-It root-cause fixes, rollback prep |
21
21
 
22
22
  ## Mission control
23
23
 
24
- | Skill | Enforces |
25
- |-------|----------|
26
- | `mugiwara-mode` | Runtime levels guided / semi / auto: mode owns autonomy, config owns writing standards, consent invariants, gated auto-GO, push + ready-PR terminal |
24
+ | Skill | Teaches |
25
+ |-------|---------|
27
26
  | `mugiwara-git` | Atomic commits, save-points, multi-commit splitting, bisect/blame debugging |
28
- | `mugiwara-testcases` | User-test intake (ATDD): immutable-gold rule, declarative-AC routing, consent, failure adjudication |
29
- | `mugiwara-pr` | Terminal: push + verdict file with a ready PR summary block; never creates a PR, stop-at-PR invariant |
27
+ | `mugiwara-testcases` | User-test intake: immutable-gold rule, declarative-AC routing, consent, failure adjudication |
28
+ | `mugiwara-pr` | Terminal: push + verdict file with ready PR summary; never creates a PR |
30
29
  | `mugiwara-ship` | GO/NO-GO ship gate: pre-launch checklist, feature flags, rollback plan |
31
- | `mugiwara-deprecation` | Sunset & migration discipline: keep-or-retire gate, cutover playbooks, safe schema changes |
32
- | `mugiwara-resume` | Session resume: rebuild state from `.mugiwara/` after compaction/loss; never restart |
30
+ | `mugiwara-sunset` | Sunset & migration: keep-or-retire gate, cutover playbooks, safe schema changes |
31
+ | `mugiwara-resume` | Session resume: rebuild state from `.mugiwara/state.json`; never restart |
33
32
  | `mugiwara-lessons` | Cross-mission memory: actionable lessons ledger, read at triage, written at closure |
34
- | `mugiwara-observability` | Trace the crew: structured logs, OTel-compatible spans, session correlation, end-of-mission summary |
35
33
 
36
34
  ## Engineering practice
37
35
 
38
- | Skill | Enforces |
39
- |-------|----------|
40
- | `mugiwara-writing-skills` | Meta-skill: how mugiwara authors skills anatomy, ≤120-line rule, progressive disclosure, anti-rationalization |
41
- | `mugiwara-systematic-debugging` | 4-phase root-cause discipline: reproduce → localize → reduce → fix + guard; stop-the-line, prove-it first |
42
- | `mugiwara-test-driven-development` | RED-GREEN-REFACTOR, proof-of-when, test pyramid, one test = one behavior |
43
- | `mugiwara-api-and-interface-design` | Contract-first design, error semantics, boundary validation, backward compatibility, versioning |
44
- | `mugiwara-doubt-driven-development` | Adversarial fresh-context verification of in-flight decisions: claim extract doubt reconcile stop |
45
- | `mugiwara-git-worktrees` | Isolated parallel branches via `git worktree`, branch hygiene, safe cleanup |
46
- | `mugiwara-context-engineering` | Token/context management: feed selectively, trust-sort sources, progressive disclosure, rules files |
36
+ | Skill | Teaches |
37
+ |-------|---------|
38
+ | `mugiwara-proof-order` | RED-GREEN-REFACTOR proof value from WHEN the test runs, not that it exists |
39
+ | `mugiwara-root-cause` | 4-phase: reproduce → localize → reduce → fix + guard; stop-the-line |
40
+ | `mugiwara-contract-first` | Contract-first design, error semantics, boundary validation, backward compatibility |
41
+ | `mugiwara-claim-audit` | Adversarial verification: CLAIM EXTRACT DOUBT RECONCILE → STOP |
42
+ | `mugiwara-context-budget` | Token/context management: feed selectively, trust-sort sources, the window is a budget |
47
43
 
48
- ## Domain & advanced
44
+ ## Domain
49
45
 
50
- | Skill | Enforces |
51
- |-------|----------|
52
- | `mugiwara-frontend` | Anti-slop frontend: audit-first redesigns, design-system extraction, slop list |
53
- | `mugiwara-backend` | Backend/server code: repo standards first, API design, data integrity, error handling, security |
54
- | `mugiwara-agent-security` | Secure the agent layer: prompt injection, memory poisoning, excessive agency, secrets, sandboxing |
55
- | `mugiwara-dynamic-workflow` | Runtime workflow patterns: fan-out-and-synthesize, tournament, loop-until-done, classify-and-act |
56
- | `mugiwara-eval` | Test the harness itself: task suites, judge-agent rubric comparison, pass/fail per case |
46
+ | Skill | Teaches |
47
+ |-------|---------|
48
+ | `mugiwara-frontend` | Anti-slop frontend: audit-first redesigns, design-system extraction, WCAG 2.1 AA |
49
+ | `mugiwara-backend` | Backend/server code: repo standards first, source-backed code, data integrity |
50
+ | `mugiwara-agent-security` | Agent layer: prompt injection, memory poisoning, excessive agency, MCP trust, sandboxing |
57
51
 
58
- ## Anatomy of a skill
52
+ ## Anatomy
59
53
 
60
- Every skill is a single `SKILL.md` with frontmatter + a playbook body:
61
-
62
- ```markdown
63
- ---
64
- name: mugiwara-checkpoint
65
- description: Use after an execution wave to audit results against the plan. ...
66
- ---
67
-
68
- # Checkpoint (Chopper)
69
-
70
- <playbook: protocol, rules, red flags, iron law>
71
- ```
72
-
73
- See [skill-anatomy.md](skill-anatomy.md) for the details.
54
+ Every skill is a `SKILL.md` with frontmatter + playbook body. See
55
+ [skill-anatomy.md](skill-anatomy.md).
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "positive-refactor-existing-tests",
3
- "skill": "mugiwara-test-driven-development",
3
+ "skill": "mugiwara-testcases",
4
4
  "type": "positive",
5
5
  "task": "Refactor a function in src/util/parse.ts to reduce nesting. The existing tests already cover it fully.",
6
6
  "rubric": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "routing-bug-one-file",
3
- "skill": "mugiwara-systematic-debugging",
3
+ "skill": "mugiwara-root-cause",
4
4
  "task": "There is a bug in src/utils/format.ts where dates render one month off. It is a single-file bug. How should the agent approach this?",
5
5
  "rubric": [
6
6
  "picks a debugging skill over a planning/brainstorm skill",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ionivetech/mugiwara",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "The Straw Hat crew of AI agents and skills: brainstorm, plan, execute, checkpoint, quality, gates, review, security, self-healing. Installs into Claude Code, opencode, Copilot, Gemini, Codex, Cursor, Kimi, pi, Windsurf, Cline, Kilo, Antigravity.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -18,11 +18,11 @@
18
18
  "src",
19
19
  "content",
20
20
  "docs",
21
+ "references",
21
22
  "evals",
23
+ "scripts",
22
24
  ".opencode",
23
25
  "hooks",
24
- "scripts/install.sh",
25
- "scripts/install.ps1",
26
26
  "README.md",
27
27
  "LICENSE"
28
28
  ],
@@ -39,8 +39,9 @@
39
39
  "test:watch": "vitest",
40
40
  "typecheck": "tsc --noEmit",
41
41
  "build": "bun build src/cli.ts --outfile dist/mugiwara.js --target node --format esm",
42
- "validate": "bun scripts/validate-content.ts",
42
+ "validate": "bun scripts/validate-content.ts --check-manifest --check-docs",
43
43
  "evals": "bun scripts/run-evals.ts",
44
+ "retrieval-eval": "bun scripts/retrieval-eval.ts",
44
45
  "sync-version": "bun scripts/sync-version.ts",
45
46
  "prepack": "bun run build && bun run sync-version"
46
47
  },