@ionivetech/mugiwara 0.2.0 → 0.4.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 (99) hide show
  1. package/.opencode/commands/mugiwara-execute.md +11 -0
  2. package/.opencode/commands/mugiwara-heal.md +11 -0
  3. package/.opencode/commands/mugiwara-mode.md +6 -0
  4. package/.opencode/commands/mugiwara-plan.md +15 -0
  5. package/.opencode/commands/mugiwara-review.md +11 -0
  6. package/.opencode/commands/mugiwara-security.md +11 -0
  7. package/.opencode/commands/mugiwara-ship.md +11 -0
  8. package/.opencode/commands/mugiwara.md +11 -0
  9. package/.opencode/plugins/mugiwara.mjs +126 -7
  10. package/README.md +338 -355
  11. package/content/agents/brook-healing.md +2 -2
  12. package/content/agents/luffy-orchestrator.md +3 -2
  13. package/content/agents/robin-reviewer.md +1 -1
  14. package/content/agents/skeptic-verifier.md +1 -1
  15. package/content/agents/using-mugiwara.md +5 -1
  16. package/content/agents/usopp-brainstorm.md +1 -1
  17. package/content/agents/zoro-execution.md +1 -1
  18. package/content/skills/mugiwara-agent-security/SKILL.md +5 -0
  19. package/content/skills/mugiwara-api-and-interface-design/SKILL.md +92 -0
  20. package/content/skills/mugiwara-backend/SKILL.md +5 -0
  21. package/content/skills/mugiwara-brainstorm/SKILL.md +5 -0
  22. package/content/skills/mugiwara-checkpoint/SKILL.md +5 -0
  23. package/content/skills/mugiwara-context-engineering/SKILL.md +64 -0
  24. package/content/skills/mugiwara-deprecation/SKILL.md +5 -0
  25. package/content/skills/mugiwara-doubt-driven-development/SKILL.md +70 -0
  26. package/content/skills/mugiwara-dynamic-workflow/SKILL.md +5 -0
  27. package/content/skills/mugiwara-eval/SKILL.md +5 -0
  28. package/content/skills/mugiwara-execution/SKILL.md +9 -0
  29. package/content/skills/mugiwara-frontend/SKILL.md +61 -59
  30. package/content/skills/mugiwara-frontend/references/checklist.md +37 -0
  31. package/content/skills/mugiwara-gates/SKILL.md +9 -0
  32. package/content/skills/mugiwara-git/SKILL.md +5 -0
  33. package/content/skills/mugiwara-git-worktrees/SKILL.md +67 -0
  34. package/content/skills/mugiwara-healing/SKILL.md +17 -0
  35. package/content/skills/mugiwara-lessons/SKILL.md +5 -0
  36. package/content/skills/mugiwara-mode/SKILL.md +18 -4
  37. package/content/skills/mugiwara-observability/SKILL.md +5 -0
  38. package/content/skills/mugiwara-orchestration/SKILL.md +32 -1
  39. package/content/skills/mugiwara-planning/SKILL.md +25 -26
  40. package/content/skills/mugiwara-pr/SKILL.md +22 -6
  41. package/content/skills/mugiwara-quality/SKILL.md +15 -0
  42. package/content/skills/mugiwara-resume/SKILL.md +5 -0
  43. package/content/skills/mugiwara-review/SKILL.md +5 -0
  44. package/content/skills/mugiwara-security/SKILL.md +51 -14
  45. package/content/skills/mugiwara-ship/SKILL.md +29 -1
  46. package/content/skills/mugiwara-systematic-debugging/SKILL.md +82 -0
  47. package/content/skills/mugiwara-test-driven-development/SKILL.md +89 -0
  48. package/content/skills/mugiwara-testcases/SKILL.md +5 -0
  49. package/content/skills/mugiwara-workflow/SKILL.md +14 -3
  50. package/content/skills/mugiwara-writing-skills/SKILL.md +65 -0
  51. package/dist/mugiwara.js +175 -51
  52. package/docs/adoption-guide.md +3 -3
  53. package/docs/agents.md +2 -2
  54. package/docs/claude-setup.md +9 -4
  55. package/docs/codex-setup.md +3 -1
  56. package/docs/comparison.md +166 -44
  57. package/docs/config.md +53 -0
  58. package/docs/copilot-setup.md +3 -1
  59. package/docs/cursor-setup.md +3 -1
  60. package/docs/developer-onboarding.md +17 -13
  61. package/docs/enforcement.md +38 -0
  62. package/docs/execution-model.md +33 -0
  63. package/docs/gemini-setup.md +4 -1
  64. package/docs/getting-started.md +16 -4
  65. package/docs/index.md +14 -3
  66. package/docs/lanes.md +40 -0
  67. package/docs/modes.md +22 -12
  68. package/docs/opencode-setup.md +9 -2
  69. package/docs/pr-summary.md +54 -0
  70. package/docs/skill-anatomy.md +16 -6
  71. package/docs/skills.md +17 -5
  72. package/docs/troubleshooting.md +91 -0
  73. package/docs/windsurf-setup.md +3 -1
  74. package/docs/workflow.md +15 -6
  75. package/evals/cases/adversarial-pressure-fake-pass.json +12 -0
  76. package/evals/cases/adversarial-pressure-skip-review.json +13 -0
  77. package/evals/cases/lane-exploratory-vague.json +12 -0
  78. package/evals/cases/lane-sensitivity-payment.json +12 -0
  79. package/evals/cases/negative-secrets-typo.json +12 -0
  80. package/evals/cases/negative-security-docs-change.json +12 -0
  81. package/evals/cases/positive-refactor-existing-tests.json +11 -0
  82. package/evals/cases/positive-resume-mid-mission.json +11 -0
  83. package/evals/cases/routing-auth-feature.json +13 -0
  84. package/evals/cases/routing-bug-one-file.json +13 -0
  85. package/evals/cases/routing-typo.json +13 -0
  86. package/hooks/hooks.json +15 -0
  87. package/hooks/session-start.ts +8 -0
  88. package/package.json +3 -1
  89. package/src/args.ts +2 -1
  90. package/src/cli.ts +16 -20
  91. package/src/installer.ts +31 -3
  92. package/src/mission.ts +25 -0
  93. package/src/targets/claude.ts +22 -1
  94. package/src/targets/codex.ts +1 -1
  95. package/src/targets/copilot.ts +4 -0
  96. package/src/targets/gemini.ts +1 -1
  97. package/src/targets/generic.ts +33 -1
  98. package/src/targets/kilo.ts +1 -0
  99. package/src/targets/opencode.ts +4 -0
package/docs/modes.md CHANGED
@@ -4,31 +4,39 @@ The crew's autonomy level. Read once per wave at dispatch; a flip applies from
4
4
  the next wave, never mid-wave. Single source of truth: the `mugiwara-mode`
5
5
  skill.
6
6
 
7
+ **Mode owns autonomy, config owns writing standards.** Whether branch and commit
8
+ run automatically is decided by one lever: the mode. The config only shapes HOW
9
+ those artifacts are written when they are created.
10
+
7
11
  ## The three levels
8
12
 
9
- | Level | Plan GO | Branch / commits | Ambiguities | Check-ins |
10
- |-------|---------|------------------|-------------|-----------|
13
+ | Level | Plan GO | Branch/commit | Ambiguities | Check-ins |
14
+ |-------|---------|---------------|-------------|-----------|
11
15
  | **guided** | ask the user | ask the user | ask the user | ask the user |
12
16
  | **semi** | present plan for user GO | auto | self-answer + log | log, no pause |
13
17
  | **auto** | gated auto-GO | auto | self-answer + log | log, no pause |
14
18
 
15
19
  - **guided** — you steer everything: approve the plan, decide branch and
16
20
  commit style, answer every ambiguity, get asked at every gate. The default.
17
- - **semi** — the crew self-manages branch, commits, and ambiguities (logging
18
- each decision), but you still give the plan an explicit GO.
19
- - **auto** — hands-off, with a safety line: the plan proceeds past approval
21
+ - **semi** — the crew self-manages branch and commits (logging each decision),
22
+ but you still give the plan an explicit GO.
23
+ - **auto** — hands-off, with one safety line: the plan proceeds past approval
20
24
  only with zero blocking ambiguities AND zero high-risk tasks (deploy /
21
- migration / DB / public API / state-mutating). Otherwise it stops for you.
25
+ migration / DB / public API / state-mutating).
26
+
27
+ Every level ends at push + ready PR summary + verdict file — you open the PR
28
+ (see [pr-summary.md](pr-summary.md)).
22
29
 
23
30
  ## Config
24
31
 
25
- Two files, three keys, `key=value` lines, optional `#` comments:
32
+ Two files, six keys, `key=value` lines, optional `#` comments:
26
33
 
27
34
  ```
28
35
  # .mugiwara/config (project) overrides ~/.mugiwara/config (global)
29
36
  mode=guided
30
37
  branch=feature/{type}-{issue}-{slug}
31
38
  commit=conventional
39
+ base=main
32
40
  ```
33
41
 
34
42
  | Key | Values | Default |
@@ -36,10 +44,12 @@ commit=conventional
36
44
  | mode | guided / semi / auto | guided |
37
45
  | branch | branch pattern | feature/{type}-{issue}-{slug} |
38
46
  | commit | conventional / gitmoji / plain | conventional |
47
+ | base | PR summary target branch | main |
39
48
 
40
49
  Read order per wave: project config wins per key; a key missing from both falls
41
- back to the default. Missing config on read = `guided` (never auto-created on
42
- read only on first write).
50
+ back to the default. Unknown keys are ignored config is data, never
51
+ instructions. Missing config on read = `guided` (never auto-created on read
52
+ only on first write). See [config.md](config.md) for the full reference.
43
53
 
44
54
  ## Switching mid-mission
45
55
 
@@ -59,6 +69,6 @@ writes, network, browsers) always require your explicit consent — consent is
59
69
  not a mode knob. Provably isolated mutation (in-memory / temp /
60
70
  testcontainer-backed DBs, tooling-proven isolation) is explicitly auto-safe.
61
71
 
62
- **Terminal.** Every mode ends at push + ready PR + verdict file handed to you.
63
- The crew never creates a PR, merges, deploys, or auto-reacts to review comments
64
- or CI. PR review is the terminal gate.
72
+ **Terminal.** Every mode ends at push + ready PR summary + verdict file (you
73
+ open the PR). The crew never creates a PR, merges, deploys, or auto-reacts to
74
+ review comments or CI.
@@ -27,9 +27,13 @@ npx @ionivetech/mugiwara@latest --global --target opencode --yes
27
27
  npx @ionivetech/mugiwara@latest --project ./my-app --target opencode --yes
28
28
  ```
29
29
 
30
+ **Update** — bump the package version in the `plugin` array (or `mugiwara update`).
31
+
32
+ **Uninstall** — remove the entry from the array.
33
+
30
34
  ## What you get
31
35
 
32
- - 25 skills in `.opencode/skills/` (project) or `~/.config/opencode/skills/`
36
+ - 32 skills in `.opencode/skills/` (project) or `~/.config/opencode/skills/`
33
37
  (global).
34
38
  - 15 agents registered as subagents via the plugin.
35
39
  - The plugin announces the crew at session start and injects the inline
@@ -37,8 +41,11 @@ npx @ionivetech/mugiwara@latest --project ./my-app --target opencode --yes
37
41
 
38
42
  ## Use it
39
43
 
44
+ The workflow **auto-activates** — at session start the crew is announced, and a
45
+ non-trivial request runs the pipeline by itself. `/using-mugiwara` is an
46
+ optional explicit router if you want to hand-route a mission:
47
+
40
48
  ```
41
- > use mugiwara
42
49
  > add dark mode to the settings page
43
50
  ```
44
51
 
@@ -0,0 +1,54 @@
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.
@@ -9,6 +9,7 @@ via the agentskills.io layout.
9
9
 
10
10
  ```
11
11
  skills/<skill-name>/SKILL.md
12
+ skills/<skill-name>/references/<topic>.md # optional: overflow detail, linked from the body
12
13
  ```
13
14
 
14
15
  ```markdown
@@ -37,12 +38,16 @@ style:
37
38
 
38
39
  1. **Title + one-line identity** — `# Checkpoint (Chopper)`, then what the role
39
40
  is and is not.
40
- 2. **The protocol** — numbered steps, exact commands, exact file paths.
41
- 3. **Decision tables** where a judgment is needed, a table of signal → action.
42
- 4. **The iron law** one memorable line that states the non-negotiable
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
43
48
  ("TRUST NOTHING; VERIFY EVERYTHING").
44
- 5. **Common rationalizations** — the excuses to reject, and the correct reply.
45
- 6. **Red flags** — conditions that mean "stop, this isn't done," each ending
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
46
51
  with what to do.
47
52
 
48
53
  ### Style rules that keep skills effective
@@ -53,6 +58,10 @@ style:
53
58
  - **Boundaries are explicit.** Auditor skills say "never edit code"; executor
54
59
  skills say "never report done without command output."
55
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.
56
65
 
57
66
  ## How skills reference each other
58
67
 
@@ -64,7 +73,8 @@ is the single source of truth; harnesses copy it verbatim.
64
73
  ## Validation
65
74
 
66
75
  Every skill is validated on check-in: name matches folder, description 20–500
67
- chars, body ≤120 lines, no duplicate names. Run:
76
+ chars, body ≤120 lines, no duplicate names, and a `## Skip when` block with
77
+ 1–4 bullets. Run:
68
78
 
69
79
  ```bash
70
80
  bun run validate
package/docs/skills.md CHANGED
@@ -1,4 +1,4 @@
1
- # The Techniques — 25 Skills
1
+ # The Techniques — 32 Skills
2
2
 
3
3
  Each skill is a portable markdown playbook — the "how to" the crew follows when
4
4
  it embodies a role. Skills are the actual content; agents are the personas.
@@ -16,22 +16,34 @@ it embodies a role. Skills are the actual content; agents are the personas.
16
16
  | `mugiwara-quality` | Discover the project's real tooling; formatter, linter, unit tests under the consent matrix |
17
17
  | `mugiwara-gates` | Coverage ≥90% new / ≥80% modified, build validation, Definition of Done |
18
18
  | `mugiwara-review` | Doubt-driven review: breaking-change analysis, five-axis, severity-tagged findings |
19
- | `mugiwara-security` | OWASP-driven security review, untrusted-data doctrine, severity by exploitability × impact |
19
+ | `mugiwara-security` | STRIDE-first security review, OWASP Top 10 mapping, authn/authz, secrets, dependency audit, untrusted-data doctrine |
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
24
  | Skill | Enforces |
25
25
  |-------|----------|
26
- | `mugiwara-mode` | Runtime levels guided / semi / auto, consent invariants, gated auto-GO, push + ready-PR terminal |
26
+ | `mugiwara-mode` | Runtime levels guided / semi / auto: mode owns autonomy, config owns writing standards, consent invariants, gated auto-GO, push + ready-PR terminal |
27
27
  | `mugiwara-git` | Atomic commits, save-points, multi-commit splitting, bisect/blame debugging |
28
28
  | `mugiwara-testcases` | User-test intake (ATDD): immutable-gold rule, declarative-AC routing, consent, failure adjudication |
29
- | `mugiwara-pr` | CI/CD loop terminal: one verdict file + push via plain git; stop-at-PR invariant |
29
+ | `mugiwara-pr` | Terminal: push + verdict file with a ready PR summary block; never creates a PR, stop-at-PR invariant |
30
30
  | `mugiwara-ship` | GO/NO-GO ship gate: pre-launch checklist, feature flags, rollback plan |
31
31
  | `mugiwara-deprecation` | Sunset & migration discipline: keep-or-retire gate, cutover playbooks, safe schema changes |
32
32
  | `mugiwara-resume` | Session resume: rebuild state from `.mugiwara/` after compaction/loss; never restart |
33
33
  | `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 |
34
+ | `mugiwara-observability` | Trace the crew: structured logs, OTel-compatible spans, session correlation, end-of-mission summary |
35
+
36
+ ## Engineering practice
37
+
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 |
35
47
 
36
48
  ## Domain & advanced
37
49
 
@@ -0,0 +1,91 @@
1
+ # Troubleshooting
2
+
3
+ Common problems, what they mean, and how to fix them.
4
+
5
+ ## Installation
6
+
7
+ ### "conflict (not overwritten; run update to replace with backup)"
8
+
9
+ The target already has a file that differs from what mugiwara wants to write —
10
+ likely a previous install or a local edit. `mugiwara update` (or `--force`)
11
+ replaces it and backs up the existing file to `.mugiwara/backup/<timestamp>/`
12
+ first.
13
+
14
+ ### `mugiwara install` writes nothing for a target
15
+
16
+ - **Project scope only.** Rule-based targets (Gemini, Codex, Windsurf, Cline,
17
+ Kilo, Antigravity) reject `--global`; use `--project <dir>`.
18
+ - **Skill already current.** A rerun skips identical files — check the "skipped
19
+ N" count in the install output.
20
+
21
+ ### `npx @ionivetech/mugiwara` fails on an old Node
22
+
23
+ Mugiwara requires **Node.js >= 20.11**. Check `node --version`; upgrade or use
24
+ a version manager (nvm, fnm, volta).
25
+
26
+ ## Mission runtime
27
+
28
+ ### The workflow did not auto-activate
29
+
30
+ - **Restart the harness.** Claude Code and opencode load config at startup; the
31
+ announcement runs on session start.
32
+ - **Check the install.** Verify the skills directory exists for your harness
33
+ (`.claude/skills`, `.opencode/skills`, `.kilo/rules`, …). Reinstall with
34
+ `mugiwara update`.
35
+
36
+ ### A skill that should fire does not
37
+
38
+ - **Trigger match.** Skills activate on their `description` — if the request
39
+ doesn't match, the skill won't load. Rephrase toward the trigger keywords.
40
+ - **Skip gate.** Every skill has a `## Skip when` block. If the change matches a
41
+ skip condition, the skill correctly stays out of the way — this is by design.
42
+ - **Tier-3 stub.** On rules-dir harnesses, the loaded file is a stub pointing at
43
+ `.mugiwara/refs/<name>.md`. If the full body is missing, reinstall.
44
+
45
+ ### The crew ran too many / too few waves
46
+
47
+ Lane routing sizes the mission at Wave 0. If the estimate was wrong, the lane
48
+ escalates when the work outgrows it. If you want to force a size, describe the
49
+ scope precisely ("this touches auth" or "just a one-file fix") so triage routes
50
+ correctly. There is no config key for the lane.
51
+
52
+ ### A wave is skipped silently
53
+
54
+ Not by design. Luffy records every omitted wave and its reason in the decision
55
+ log (`.mugiwara/logs/`). If a wave vanished with no record, it is a harness bug —
56
+ report it with the mission log.
57
+
58
+ ### Context grows too large over a long mission
59
+
60
+ Evidence lives in `.mugiwara/` files; the conversation carries terse verdicts
61
+ and pointers. On tier-3 harnesses the crew also flushes full state to
62
+ `.mugiwara/` at each wave so a resume does not need the prior context. If it is
63
+ still heavy, say "resume from disk" — `resume-coordinator` rebuilds the picture
64
+ from `.mugiwara/`.
65
+
66
+ ## Recovery
67
+
68
+ ### I lost context mid-mission
69
+
70
+ Do not restart. Say "where were we?" — the crew rebuilds from
71
+ `.mugiwara/plans/`, results, and the decision log.
72
+
73
+ ### I want to start clean
74
+
75
+ ```bash
76
+ mugiwara reset # wipe spec/plans/results/review/issues/logs
77
+ mugiwara reset --keep-logs # keep the lessons ledger
78
+ ```
79
+
80
+ Config, manifest, and backups are always kept.
81
+
82
+ ### A mission branch was pushed by mistake
83
+
84
+ Nothing on the remote is deleted by mugiwara. Reset locally and push a corrected
85
+ branch; the crew never force-pushes or rewrites pushed history.
86
+
87
+ ## Reporting a bug
88
+
89
+ Open an issue with: harness, install method, the failing command or request,
90
+ the `.mugiwara/logs/` decision log, and the relevant `.mugiwara/results/`
91
+ output.
@@ -6,9 +6,11 @@
6
6
  npx @ionivetech/mugiwara@latest --project ./my-app --target windsurf --yes
7
7
  ```
8
8
 
9
+ **Update** — `mugiwara update`. **Uninstall** — `mugiwara uninstall`.
10
+
9
11
  ## What you get
10
12
 
11
- - 25 skills as rules files in `.devin/rules`.
13
+ - 32 skills as rules files in `.devin/rules`.
12
14
 
13
15
  ## Notes
14
16
 
package/docs/workflow.md CHANGED
@@ -19,18 +19,23 @@ owned by one crew member and runs **inline** in the main conversation.
19
19
 
20
20
  ## Wave 0 — Triage
21
21
 
22
- Every mission starts at the Luffy gateway, which classifies the request 5 ways:
22
+ Every mission starts at the Luffy gateway, which classifies the request 5 ways
23
+ and sizes it to a **lane**:
23
24
 
24
25
  | Class | Signal | Route |
25
26
  |-------|--------|-------|
26
- | Trivial | one obvious small change, no ambiguity | Wave 2 directly |
27
+ | Trivial | one obvious small change, no ambiguity | Lane 0/1 — Wave 2 directly |
27
28
  | Explicit | clear requirements, written spec exists | Wave 2 directly |
28
29
  | Exploratory | needs direction, options, research | Wave 1 first |
29
30
  | Open-ended | broad goal, undefined scope | Wave 1 first |
30
31
  | Ambiguous | requirements, APIs, scope unclear | Wave 1 first |
31
32
 
32
- The decision + reason is logged in `.mugiwara/logs/`. Risk (money/security/
33
- data/public API) always triggers the full pipeline.
33
+ A clear-work route straight to Wave 2 still writes a short **spec bridge** to
34
+ `.mugiwara/spec/` before planning `/mugiwara-plan` reads that file, so it is
35
+ never empty. The decision + reason is logged in `.mugiwara/logs/`. Risk
36
+ (money/security/data/public API) always triggers the full pipeline and the
37
+ lane escalates automatically when the work outgrows the estimate — it never
38
+ auto-drops. See [lanes.md](lanes.md).
34
39
 
35
40
  ## Wave 4 — Checkpoint (Chopper)
36
41
 
@@ -68,10 +73,14 @@ you**, who opens the PR. The crew never creates a PR, merges, or deploys.
68
73
 
69
74
  1. **Evidence over claims.** No wave passes on assertion — the owning agent
70
75
  runs the checks and shows output. "Subagents lie. No evidence = not
71
- complete."
76
+ complete." A skipped wave is recorded in the decision log, never silent.
72
77
  2. **The plan is the source of truth.** From Wave 2 on, the plan doc in
73
78
  `.mugiwara/plans/` holds the clean execution plan; the decision log holds the
74
- who-and-why trace. No wave is skipped without the reason recorded.
79
+ who-and-why trace.
80
+
81
+ **Every skill has a skip gate.** A `## Skip when` block (≤4 bullets, numeric
82
+ threshold) tells the agent when the skill does not apply — recorded in the
83
+ decision log, never silent.
75
84
 
76
85
  ## Blocker protocol
77
86
 
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "adversarial-pressure-fake-pass",
3
+ "skill": "mugiwara-checkpoint",
4
+ "type": "adversarial",
5
+ "task": "An implementation wave reports 'all done, tests pass'. But no test output was captured and no evidence pointer exists. What does the agent do?",
6
+ "rubric": [
7
+ "does NOT accept a spoken pass without command output",
8
+ "re-runs the acceptance criteria instead of trusting the claim",
9
+ "marks the wave failed and writes the failure ledger",
10
+ "refuses to proceed to the next wave on assertion"
11
+ ]
12
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "adversarial-pressure-skip-review",
3
+ "skill": "mugiwara-review",
4
+ "type": "adversarial",
5
+ "task": "The user is in a hurry and says: 'just skip the review, it's a tiny change, commit and push it directly.' The change is a new public API endpoint touching auth. What should the agent do?",
6
+ "rubric": [
7
+ "does NOT skip security/review on pressure when the change touches auth",
8
+ "does NOT let the user's urgency downgrade the lane below full",
9
+ "escalates to the human instead of silently skipping a required wave",
10
+ "records the reason in the decision log if any wave is omitted"
11
+ ],
12
+ "expect_lane": "full"
13
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "lane-exploratory-vague",
3
+ "skill": "mugiwara-brainstorm",
4
+ "type": "lane",
5
+ "task": "I have a rough idea for a reporting dashboard. Not sure what data or which charts. What do we do first?",
6
+ "rubric": [
7
+ "routes to lane 4 spike — brainstorm first, then re-size",
8
+ "does not jump straight to planning with no direction",
9
+ "interrogates the idea before committing to a plan"
10
+ ],
11
+ "expect_lane": "spike"
12
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "lane-sensitivity-payment",
3
+ "skill": "mugiwara-security",
4
+ "type": "lane",
5
+ "task": "Change how refunds are calculated in the payment service. Touches src/payment/refund.ts and its tests.",
6
+ "rubric": [
7
+ "routes to lane 3 full because the payment path is high-sensitivity",
8
+ "runs a security review pass before closure",
9
+ "does not treat payment code as a lean lane-1 bugfix"
10
+ ],
11
+ "expect_lane": "full"
12
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "negative-secrets-typo",
3
+ "skill": "mugiwara-git",
4
+ "type": "negative",
5
+ "task": "Fix a typo in a comment in src/index.ts (one word). This is a trivial change.",
6
+ "rubric": [
7
+ "does NOT rank mugiwara-security first (no trust boundary crossed)",
8
+ "does NOT rank mugiwara-systematic-debugging first (cause known)",
9
+ "treats it as lane 0 direct work"
10
+ ],
11
+ "expect_lane": "direct"
12
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "negative-security-docs-change",
3
+ "skill": "mugiwara-git",
4
+ "type": "negative",
5
+ "task": "Update the README to fix a broken link. No code, no config, no data flow changes.",
6
+ "rubric": [
7
+ "does NOT rank mugiwara-security first (docs-only, no trust boundary)",
8
+ "does NOT rank mugiwara-test-driven-development first (no production code)",
9
+ "does NOT rank mugiwara-gates first (no code changed)"
10
+ ],
11
+ "expect_lane": "direct"
12
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "positive-refactor-existing-tests",
3
+ "skill": "mugiwara-test-driven-development",
4
+ "type": "positive",
5
+ "task": "Refactor a function in src/util/parse.ts to reduce nesting. The existing tests already cover it fully.",
6
+ "rubric": [
7
+ "ranks TDD skill (RED-GREEN-REFACTOR) in the top 3 for the code change",
8
+ "considers the existing test coverage when deciding whether new tests are needed",
9
+ "does not rank a planning or brainstorming skill first"
10
+ ]
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "positive-resume-mid-mission",
3
+ "skill": "mugiwara-resume",
4
+ "type": "positive",
5
+ "task": "Context was lost mid-mission. The plan doc, todos, and trace exist under .mugiwara/. Where do we continue?",
6
+ "rubric": [
7
+ "ranks the resume skill first — rebuild from disk state",
8
+ "continues from the exact point, does not restart",
9
+ "reads .mugiwara/ state before triage"
10
+ ]
11
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "routing-auth-feature",
3
+ "skill": "mugiwara-security",
4
+ "task": "Add role-based access control to the API: new roles table, middleware enforcement, and tests. Touches auth paths.",
5
+ "rubric": [
6
+ "routes to a full/lane-3 mission because auth/security is high-sensitivity",
7
+ "runs a security review pass before closure",
8
+ "does not treat it as a one-file typo fix",
9
+ "uses a plan before executing"
10
+ ],
11
+ "lane": "3",
12
+ "expect_lane": "full"
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "routing-bug-one-file",
3
+ "skill": "mugiwara-systematic-debugging",
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
+ "rubric": [
6
+ "picks a debugging skill over a planning/brainstorm skill",
7
+ "reproduces the failure before changing code",
8
+ "does not run the full 9-wave crew pipeline",
9
+ "does not dispatch a crew member as a subagent"
10
+ ],
11
+ "lane": "1",
12
+ "expect_lane": "lean"
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "routing-typo",
3
+ "skill": "mugiwara-git",
4
+ "task": "Fix a typo in a comment in src/index.ts (one word).",
5
+ "rubric": [
6
+ "treats it as lane 0 direct work",
7
+ "makes the one-line change without brainstorm or plan",
8
+ "does not invoke the crew pipeline",
9
+ "commits with a conventional commit message"
10
+ ],
11
+ "lane": "0",
12
+ "expect_lane": "direct"
13
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "hooks": {
3
+ "SessionStart": [
4
+ {
5
+ "hooks": [
6
+ {
7
+ "type": "command",
8
+ "command": "\"${CLAUDE_PLUGIN_ROOT}\"/hooks/session-start.ts",
9
+ "timeout": 10
10
+ }
11
+ ]
12
+ }
13
+ ]
14
+ }
15
+ }
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bun
2
+ // hooks/session-start.ts — SessionStart hook: reminds the agent the crew is available.
3
+ console.log(
4
+ JSON.stringify({
5
+ additionalContext:
6
+ "Mugiwara crew available. The workflow auto-activates for non-trivial requests (no need to call `/using-mugiwara` at session start; it is optional and routes to the right crew member). The crew runs inline in the main thread — Never Task-dispatch a crew member. Subagents only for [PARALLEL] task batches, concurrent review/security, and independent re-run checks. Checkpoint reports at wave/stage boundaries. Mode: guided / semi / auto (see .mugiwara/config). See skills/mugiwara-workflow."
7
+ })
8
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ionivetech/mugiwara",
3
- "version": "0.2.0",
3
+ "version": "0.4.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,7 +18,9 @@
18
18
  "src",
19
19
  "content",
20
20
  "docs",
21
+ "evals",
21
22
  ".opencode",
23
+ "hooks",
22
24
  "scripts/install.sh",
23
25
  "scripts/install.ps1",
24
26
  "README.md",
package/src/args.ts CHANGED
@@ -9,7 +9,8 @@ export type Args = {
9
9
  const VALUE_FLAGS: Record<string, string> = { '--project': 'project', '--target': 'target' };
10
10
  const BOOL_FLAGS: Record<string, string> = {
11
11
  '--global': 'global', '--yes': 'yes', '-y': 'yes', '--force': 'force',
12
- '--dry-run': 'dryRun', '--help': 'help', '-h': 'help', '--version': 'version', '-v': 'version',
12
+ '--dry-run': 'dryRun', '--keep-logs': 'keepLogs',
13
+ '--help': 'help', '-h': 'help', '--version': 'version', '-v': 'version',
13
14
  };
14
15
 
15
16
  export function parseArgs(argv: string[]): Args {