@ionivetech/mugiwara 0.1.3 → 0.3.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 (83) 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 +11 -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 +221 -0
  10. package/README.md +351 -324
  11. package/content/agents/brook-healing.md +8 -2
  12. package/content/agents/chopper-checkpoint.md +9 -4
  13. package/content/agents/eval-runner.md +5 -1
  14. package/content/agents/franky-gates.md +9 -4
  15. package/content/agents/jinbe-security.md +5 -1
  16. package/content/agents/luffy-orchestrator.md +15 -8
  17. package/content/agents/memory-keeper.md +4 -0
  18. package/content/agents/nami-planner.md +12 -5
  19. package/content/agents/resume-coordinator.md +5 -1
  20. package/content/agents/robin-reviewer.md +6 -2
  21. package/content/agents/sanji-quality.md +7 -3
  22. package/content/agents/skeptic-verifier.md +6 -2
  23. package/content/agents/using-mugiwara.md +16 -8
  24. package/content/agents/usopp-brainstorm.md +9 -3
  25. package/content/agents/zoro-execution.md +16 -11
  26. package/content/skills/mugiwara-api-and-interface-design/SKILL.md +87 -0
  27. package/content/skills/mugiwara-backend/SKILL.md +12 -0
  28. package/content/skills/mugiwara-brainstorm/SKILL.md +28 -1
  29. package/content/skills/mugiwara-checkpoint/SKILL.md +8 -6
  30. package/content/skills/mugiwara-context-engineering/SKILL.md +59 -0
  31. package/content/skills/mugiwara-deprecation/SKILL.md +77 -0
  32. package/content/skills/mugiwara-doubt-driven-development/SKILL.md +65 -0
  33. package/content/skills/mugiwara-dynamic-workflow/SKILL.md +3 -3
  34. package/content/skills/mugiwara-execution/SKILL.md +36 -15
  35. package/content/skills/mugiwara-frontend/SKILL.md +58 -56
  36. package/content/skills/mugiwara-frontend/references/checklist.md +37 -0
  37. package/content/skills/mugiwara-gates/SKILL.md +8 -0
  38. package/content/skills/mugiwara-git/SKILL.md +10 -0
  39. package/content/skills/mugiwara-git-worktrees/SKILL.md +62 -0
  40. package/content/skills/mugiwara-healing/SKILL.md +21 -3
  41. package/content/skills/mugiwara-mode/SKILL.md +72 -0
  42. package/content/skills/mugiwara-orchestration/SKILL.md +44 -8
  43. package/content/skills/mugiwara-planning/SKILL.md +57 -34
  44. package/content/skills/mugiwara-pr/SKILL.md +62 -0
  45. package/content/skills/mugiwara-quality/SKILL.md +29 -2
  46. package/content/skills/mugiwara-resume/SKILL.md +6 -4
  47. package/content/skills/mugiwara-security/SKILL.md +38 -1
  48. package/content/skills/mugiwara-ship/SKILL.md +24 -1
  49. package/content/skills/mugiwara-systematic-debugging/SKILL.md +77 -0
  50. package/content/skills/mugiwara-test-driven-development/SKILL.md +84 -0
  51. package/content/skills/mugiwara-testcases/SKILL.md +52 -0
  52. package/content/skills/mugiwara-workflow/SKILL.md +42 -13
  53. package/content/skills/mugiwara-writing-skills/SKILL.md +60 -0
  54. package/dist/mugiwara.js +42 -26
  55. package/docs/adoption-guide.md +72 -0
  56. package/docs/agent-anatomy.md +72 -0
  57. package/docs/agents.md +51 -0
  58. package/docs/claude-setup.md +43 -0
  59. package/docs/codex-setup.md +26 -0
  60. package/docs/comparison.md +63 -0
  61. package/docs/config.md +50 -0
  62. package/docs/copilot-setup.md +29 -0
  63. package/docs/cursor-setup.md +25 -0
  64. package/docs/developer-onboarding.md +85 -0
  65. package/docs/execution-model.md +92 -0
  66. package/docs/gemini-setup.md +27 -0
  67. package/docs/getting-started.md +96 -0
  68. package/docs/git-strategy.md +62 -0
  69. package/docs/index.md +50 -0
  70. package/docs/modes.md +74 -0
  71. package/docs/opencode-setup.md +54 -0
  72. package/docs/pr-summary.md +54 -0
  73. package/docs/rule-based-setup.md +31 -0
  74. package/docs/skill-anatomy.md +78 -0
  75. package/docs/skills.md +73 -0
  76. package/docs/windsurf-setup.md +18 -0
  77. package/docs/workflow.md +80 -0
  78. package/hooks/hooks.json +15 -0
  79. package/hooks/session-start.ts +8 -0
  80. package/package.json +20 -2
  81. package/src/targets/claude.ts +18 -1
  82. package/src/targets/codex.ts +1 -1
  83. package/src/targets/gemini.ts +1 -1
@@ -0,0 +1,54 @@
1
+ # opencode Setup
2
+
3
+ opencode is a fully supported target — native skills + agents via the opencode
4
+ plugin.
5
+
6
+ ## Install via the plugin
7
+
8
+ Add to `opencode.json`:
9
+
10
+ ```json
11
+ { "plugin": ["@ionivetech/mugiwara"] }
12
+ ```
13
+
14
+ Or from the git repo directly:
15
+
16
+ ```json
17
+ { "plugin": ["mugiwara@git+https://github.com/ionivetech/mugiwara.git"] }
18
+ ```
19
+
20
+ ## Install via CLI
21
+
22
+ ```bash
23
+ # global install
24
+ npx @ionivetech/mugiwara@latest --global --target opencode --yes
25
+
26
+ # project install
27
+ npx @ionivetech/mugiwara@latest --project ./my-app --target opencode --yes
28
+ ```
29
+
30
+ **Update** — bump the package version in the `plugin` array (or `mugiwara update`).
31
+
32
+ **Uninstall** — remove the entry from the array.
33
+
34
+ ## What you get
35
+
36
+ - 32 skills in `.opencode/skills/` (project) or `~/.config/opencode/skills/`
37
+ (global).
38
+ - 15 agents registered as subagents via the plugin.
39
+ - The plugin announces the crew at session start and injects the inline
40
+ execution model into the system prompt.
41
+
42
+ ## Use it
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
+
48
+ ```
49
+ > add dark mode to the settings page
50
+ ```
51
+
52
+ Restart opencode after installing — config is loaded once at startup. The crew
53
+ runs inline in your main conversation; subagents only for `[PARALLEL]` batches
54
+ and background checks. You never need to click into a subagent to see progress.
@@ -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.
@@ -0,0 +1,31 @@
1
+ # Rule-Based Targets: Cline, Kilo, Antigravity, pi, Kimi
2
+
3
+ These targets install the crew as markdown rule files your tool picks up from a
4
+ conventions directory. Skills-only — the crew pipeline runs through the rules.
5
+
6
+ ## Install
7
+
8
+ ```bash
9
+ # all rule-based targets in one go
10
+ npx @ionivetech/mugiwara@latest --project ./my-app --target cline,kilo,antigravity --yes
11
+ ```
12
+
13
+ | Harness | Target id | Installs as |
14
+ |---------|-----------|-------------|
15
+ | Cline | `cline` | Rules in `.clinerules` |
16
+ | Kilo Code | `kilo` | Rules in `.kilo/rules` + `kilo.jsonc` pointer |
17
+ | Antigravity | `antigravity` | Rules in `.agents/rules` |
18
+
19
+ ## pi and Kimi
20
+
21
+ - **pi** — `pi install git:github.com/ionivetech/mugiwara` (declared via the
22
+ `"pi"` key in `package.json`).
23
+ - **Kimi Code** — `/plugins install https://github.com/ionivetech/mugiwara`
24
+ (`.kimi-plugin/plugin.json`).
25
+
26
+ ## Notes
27
+
28
+ All rule-based targets are **project-only** — skipped (with a note) on
29
+ `--global` installs. Targets with a bootstrap file (Gemini, Codex, Kilo) create
30
+ it if absent and otherwise tell you the line to add, so your tool points at the
31
+ crew.
@@ -0,0 +1,78 @@
1
+ # Skill Anatomy
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.
7
+
8
+ ## File structure
9
+
10
+ ```
11
+ skills/<skill-name>/SKILL.md
12
+ skills/<skill-name>/references/<topic>.md # optional: overflow detail, linked from the body
13
+ ```
14
+
15
+ ```markdown
16
+ ---
17
+ 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.
19
+ ---
20
+
21
+ # Checkpoint (Chopper)
22
+
23
+ <playbook body>
24
+ ```
25
+
26
+ ## Frontmatter
27
+
28
+ | Field | Required | Notes |
29
+ |-------|----------|-------|
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. **The protocol** — numbered steps, exact commands, exact file paths.
42
+ 3. **Decision tables** — where a judgment is needed, a table of signal → action.
43
+ 4. **The iron law** — one memorable line that states the non-negotiable
44
+ ("TRUST NOTHING; VERIFY EVERYTHING").
45
+ 5. **Common rationalizations** — the excuses to reject, and the correct reply.
46
+ 6. **Red flags** — conditions that mean "stop, this isn't done," each ending
47
+ with what to do.
48
+
49
+ ### Style rules that keep skills effective
50
+
51
+ - **Evidence over claims.** A skill says what to run, never what to assume.
52
+ - **Concrete, never aspirational.** Exact paths, exact commands; "works
53
+ correctly" is banned as an acceptance criterion.
54
+ - **Boundaries are explicit.** Auditor skills say "never edit code"; executor
55
+ skills say "never report done without command output."
56
+ - **≤120 lines.** Skills that grow past that get split, not stretched.
57
+ - **Progressive disclosure.** Keep the trigger-scannable description and the
58
+ decision tree in the body; when a section exceeds roughly 15–20 lines, move
59
+ the detail to a `references/<topic>.md` file and drop a one-line pointer in
60
+ the body saying what to read and why.
61
+
62
+ ## How skills reference each other
63
+
64
+ Skills cross-reference by name: an agent's frontmatter lists its held skills
65
+ (`skills: mugiwara-checkpoint`), and skills defer to each other (e.g.
66
+ `mugiwara-quality` defers to `mugiwara-mode` for the consent contract). Content
67
+ is the single source of truth; harnesses copy it verbatim.
68
+
69
+ ## Validation
70
+
71
+ Every skill is validated on check-in: name matches folder, description 20–500
72
+ chars, body ≤120 lines, no duplicate names. Run:
73
+
74
+ ```bash
75
+ bun run validate
76
+ ```
77
+
78
+ See [developer-onboarding.md](developer-onboarding.md).
package/docs/skills.md ADDED
@@ -0,0 +1,73 @@
1
+ # The Techniques — 32 Skills
2
+
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.
5
+
6
+ ## Core pipeline
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 |
20
+ | `mugiwara-healing` | Reads the ledger, Stop-the-Line + Prove-It root-cause fixes, rollback prep |
21
+
22
+ ## Mission control
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 |
27
+ | `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 |
30
+ | `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 |
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, 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 |
47
+
48
+ ## Domain & advanced
49
+
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 |
57
+
58
+ ## Anatomy of a skill
59
+
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.
@@ -0,0 +1,18 @@
1
+ # Windsurf Setup
2
+
3
+ ## Install
4
+
5
+ ```bash
6
+ npx @ionivetech/mugiwara@latest --project ./my-app --target windsurf --yes
7
+ ```
8
+
9
+ **Update** — `mugiwara update`. **Uninstall** — `mugiwara uninstall`.
10
+
11
+ ## What you get
12
+
13
+ - 32 skills as rules files in `.devin/rules`.
14
+
15
+ ## Notes
16
+
17
+ Windsurf is a **project-only** target. Skills-only — the crew pipeline runs
18
+ through the rule files.
@@ -0,0 +1,80 @@
1
+ # The Wave Pipeline
2
+
3
+ A mission runs as ten waves (plus one optional adversarial pass). Each wave is
4
+ owned by one crew member and runs **inline** in the main conversation.
5
+
6
+ | Wave | Owner | Skill | Output |
7
+ |------|-------|-------|--------|
8
+ | 0 Triage | Luffy | `mugiwara-orchestration` | 5-way route decision + reason |
9
+ | 1 Brainstorm | Usopp | `mugiwara-brainstorm` | refined direction, options, recommendation |
10
+ | 2 Planning | Nami | `mugiwara-planning` | plan doc: waves, tasks, acceptance criteria |
11
+ | 3 Execution | Zoro | `mugiwara-execution` | implemented tasks with evidence |
12
+ | 4 Checkpoint | Chopper | `mugiwara-checkpoint` | audit report + failure ledger |
13
+ | 4.5 Adversarial | Skeptic | `mugiwara-dynamic-workflow` | findings report (optional) |
14
+ | 5 Quality | Sanji | `mugiwara-quality` | formatter/linter/test results |
15
+ | 6 Gates | Franky | `mugiwara-gates` | coverage + build verdict |
16
+ | 7 Review | Robin ∥ Jinbe | `mugiwara-review` + `mugiwara-security` | severity-tagged findings |
17
+ | 8 Healing | Brook | `mugiwara-healing` | fixes; loops back to Wave 4, max 3 cycles |
18
+ | 9 Closure | Luffy | `mugiwara-orchestration` | closure report + push + PR verdict handed to you |
19
+
20
+ ## Wave 0 — Triage
21
+
22
+ Every mission starts at the Luffy gateway, which classifies the request 5 ways:
23
+
24
+ | Class | Signal | Route |
25
+ |-------|--------|-------|
26
+ | Trivial | one obvious small change, no ambiguity | Wave 2 directly |
27
+ | Explicit | clear requirements, written spec exists | Wave 2 directly |
28
+ | Exploratory | needs direction, options, research | Wave 1 first |
29
+ | Open-ended | broad goal, undefined scope | Wave 1 first |
30
+ | Ambiguous | requirements, APIs, scope unclear | Wave 1 first |
31
+
32
+ The decision + reason is logged in `.mugiwara/logs/`. Risk (money/security/
33
+ data/public API) always triggers the full pipeline.
34
+
35
+ ## Wave 4 — Checkpoint (Chopper)
36
+
37
+ The verify-everything gate. After execution, Chopper re-runs every acceptance
38
+ criterion — but efficiently:
39
+
40
+ - **Deduped**: each unique check command runs once per wave, scoped to the
41
+ files this wave changed. No running `npm test` once per task.
42
+ - **Scoped by diff**: `git diff --name-only <wave-base>..HEAD` decides what
43
+ actually needs re-verification.
44
+ - **Commit hygiene**: one `git log --stat` pass, not per-commit.
45
+ - Failures land in the blocker ledger `.mugiwara/issues/` with honest
46
+ code-vs-env classification.
47
+
48
+ ## Wave 7 — Review
49
+
50
+ Robin (doubt-driven review) and Jinbe (security) run in parallel. Robin maps
51
+ breaking changes to callers before reading the diff; Jinbe runs STRIDE + OWASP.
52
+ Findings are severity-tagged with path:line.
53
+
54
+ ## Wave 8 — Healing
55
+
56
+ Brook reads the blocker ledger and fixes root causes, proving each fix by
57
+ re-running the failed check. The loop returns to Wave 4 — max 3 cycles, then
58
+ escalation to you.
59
+
60
+ ## Wave 9 — Closure
61
+
62
+ Luffy runs the ship gate, writes the closure report, deletes superseded
63
+ intermediate files, then the terminal step in every mode: **save-point commit →
64
+ push the mission branch → write the PR verdict file → hand branch + verdict to
65
+ you**, who opens the PR. The crew never creates a PR, merges, or deploys.
66
+
67
+ ## The two rules that hold it together
68
+
69
+ 1. **Evidence over claims.** No wave passes on assertion — the owning agent
70
+ runs the checks and shows output. "Subagents lie. No evidence = not
71
+ complete."
72
+ 2. **The plan is the source of truth.** From Wave 2 on, the plan doc in
73
+ `.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.
75
+
76
+ ## Blocker protocol
77
+
78
+ Any agent that hits a blocker appends a row
79
+ (`wave | task | symptom | attempted | help-needed`) to the ledger and escalates.
80
+ Never a silent workaround. Brook heals what the ledger lists.
@@ -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,9 +1,15 @@
1
1
  {
2
2
  "name": "@ionivetech/mugiwara",
3
- "version": "0.1.3",
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, Windsurf, Cline, Kilo, Antigravity.",
3
+ "version": "0.3.0",
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",
7
+ "main": "./.opencode/plugins/mugiwara.mjs",
8
+ "exports": {
9
+ ".": "./.opencode/plugins/mugiwara.mjs",
10
+ "./plugin": "./.opencode/plugins/mugiwara.mjs",
11
+ "./package.json": "./package.json"
12
+ },
7
13
  "bin": {
8
14
  "mugiwara": "dist/mugiwara.js"
9
15
  },
@@ -11,11 +17,19 @@
11
17
  "dist",
12
18
  "src",
13
19
  "content",
20
+ "docs",
21
+ ".opencode",
22
+ "hooks",
14
23
  "scripts/install.sh",
15
24
  "scripts/install.ps1",
16
25
  "README.md",
17
26
  "LICENSE"
18
27
  ],
28
+ "pi": {
29
+ "skills": [
30
+ "./content/skills"
31
+ ]
32
+ },
19
33
  "engines": {
20
34
  "node": ">=20.11"
21
35
  },
@@ -35,9 +49,13 @@
35
49
  "skills",
36
50
  "claude-code",
37
51
  "opencode",
52
+ "opencode-plugin",
38
53
  "copilot",
39
54
  "gemini",
40
55
  "codex",
56
+ "cursor",
57
+ "kimi",
58
+ "pi",
41
59
  "windsurf",
42
60
  "cline",
43
61
  "multi-agent",
@@ -1,8 +1,13 @@
1
1
  // src/targets/claude.ts
2
- import { join } from 'node:path';
2
+ import { existsSync, readFileSync, mkdirSync, copyFileSync } from 'node:fs';
3
+ import { dirname, join } from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
3
5
  import { stringifyFrontmatter, type FrontmatterData } from '../frontmatter.ts';
4
6
  import type { Target } from '../installer.ts';
5
7
 
8
+ const here = dirname(fileURLToPath(import.meta.url));
9
+ const HOOK_SRC = join(here, '..', '..', 'hooks', 'session-start.ts');
10
+
6
11
  export const target: Target = {
7
12
  id: 'claude',
8
13
  label: 'Claude Code',
@@ -22,4 +27,16 @@ export const target: Target = {
22
27
  if (data.tools) fm.tools = data.tools;
23
28
  return { relPath: `${data.name}.md`, text: stringifyFrontmatter(fm, body) };
24
29
  },
30
+ postInstall({ scope, projectDir, home, dryRun }) {
31
+ // Wire the SessionStart hook (inline doctrine) into the installed .claude dir.
32
+ const root = scope === 'global' ? join(home, '.claude') : join(projectDir, '.claude');
33
+ const hookFile = join(root, 'hooks', 'session-start.ts');
34
+ if (dryRun) return { written: [], notes: [] };
35
+ if (existsSync(HOOK_SRC) && !existsSync(hookFile)) {
36
+ mkdirSync(dirname(hookFile), { recursive: true });
37
+ copyFileSync(HOOK_SRC, hookFile);
38
+ return { written: [hookFile], notes: [] };
39
+ }
40
+ return { written: [], notes: [] };
41
+ },
25
42
  };
@@ -6,5 +6,5 @@ export const target = makeGeneric({
6
6
  label: 'Codex',
7
7
  rulesDir: '.codex/mugiwara',
8
8
  bootstrapFile: 'AGENTS.md',
9
- bootstrapPointer: 'Mugiwara crew installed in .codex/mugiwara/ — read .codex/mugiwara/mugiwara-workflow.md to run the pipeline.',
9
+ bootstrapPointer: 'Mugiwara crew installed in .codex/mugiwara/ — read .codex/mugiwara/mugiwara-workflow.md to run the pipeline inline in the main conversation.',
10
10
  });
@@ -6,5 +6,5 @@ export const target = makeGeneric({
6
6
  label: 'Gemini',
7
7
  rulesDir: '.gemini/mugiwara',
8
8
  bootstrapFile: 'GEMINI.md',
9
- bootstrapPointer: 'Mugiwara crew installed in .gemini/mugiwara/ — read .gemini/mugiwara/mugiwara-workflow.md to run the pipeline.',
9
+ bootstrapPointer: 'Mugiwara crew installed in .gemini/mugiwara/ — read .gemini/mugiwara/mugiwara-workflow.md to run the pipeline inline in the main conversation.',
10
10
  });