@ionivetech/mugiwara 0.5.5 → 0.6.1
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.
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +3 -2
- package/.codex-plugin/plugin.json +1 -1
- package/.cursor-plugin/plugin.json +1 -1
- package/.kimi-plugin/plugin.json +1 -1
- package/.opencode/commands/mugiwara-continue.md +16 -0
- package/.opencode/commands/mugiwara-execute.md +6 -4
- package/.opencode/commands/mugiwara-heal.md +6 -4
- package/.opencode/commands/mugiwara-plan.md +6 -4
- package/.opencode/commands/mugiwara-review.md +6 -4
- package/.opencode/commands/mugiwara-security.md +6 -4
- package/.opencode/commands/mugiwara-ship.md +6 -4
- package/.opencode/commands/mugiwara.md +4 -2
- package/.opencode/commands/using-mugiwara.md +7 -13
- package/.opencode/mugiwara-helpers.mjs +24 -0
- package/.opencode/plugins/mugiwara.mjs +28 -8
- package/AGENTS.md +1 -1
- package/GEMINI.md +1 -1
- package/README.md +311 -127
- package/content/agents/brook-healing.md +17 -3
- package/content/agents/chopper-checkpoint.md +17 -3
- package/content/agents/eval-runner.md +17 -2
- package/content/agents/franky-gates.md +19 -5
- package/content/agents/jinbe-security.md +19 -3
- package/content/agents/luffy-orchestrator.md +6 -3
- package/content/agents/memory-keeper.md +15 -0
- package/content/agents/nami-planner.md +21 -6
- package/content/agents/onboarding-guide.md +145 -0
- package/content/agents/resume-coordinator.md +21 -5
- package/content/agents/robin-reviewer.md +18 -3
- package/content/agents/sanji-quality.md +19 -4
- package/content/agents/skeptic-verifier.md +18 -3
- package/content/agents/usopp-brainstorm.md +17 -3
- package/content/agents/zoro-execution.md +18 -3
- package/content/skills/mugiwara-backend/SKILL.md +1 -1
- package/content/skills/mugiwara-brainstorm/SKILL.md +12 -1
- package/content/skills/mugiwara-checkpoint/SKILL.md +2 -2
- package/content/skills/mugiwara-contract-first/SKILL.md +2 -36
- package/content/skills/mugiwara-contract-first/references/process.md +37 -0
- package/content/skills/mugiwara-execution/SKILL.md +51 -34
- package/content/skills/mugiwara-execution/references/dispatch.md +41 -0
- package/content/skills/mugiwara-execution/references/resume-batching.md +32 -0
- package/content/skills/mugiwara-frontend/SKILL.md +1 -1
- package/content/skills/mugiwara-gates/SKILL.md +32 -30
- package/content/skills/mugiwara-healing/SKILL.md +1 -1
- package/content/skills/mugiwara-orchestration/SKILL.md +59 -39
- package/content/skills/mugiwara-orchestration/references/closure.md +34 -0
- package/content/skills/mugiwara-orchestration/references/delegation-pillars.md +40 -0
- package/content/skills/mugiwara-orchestration/references/triage-escalation.md +97 -0
- package/content/skills/mugiwara-planning/SKILL.md +29 -27
- package/content/skills/mugiwara-planning/references/plan-template.md +42 -0
- package/content/skills/mugiwara-pr/SKILL.md +9 -2
- package/content/skills/mugiwara-quality/SKILL.md +17 -6
- package/content/skills/mugiwara-resume/SKILL.md +7 -2
- package/content/skills/mugiwara-review/SKILL.md +20 -1
- package/content/skills/mugiwara-review/references/code-attributes.md +38 -0
- package/content/skills/mugiwara-root-cause/SKILL.md +3 -30
- package/content/skills/mugiwara-root-cause/references/process.md +35 -0
- package/content/skills/mugiwara-security/SKILL.md +17 -32
- package/content/skills/mugiwara-security/references/owasp-top10.md +12 -0
- package/content/skills/mugiwara-security/references/rationalizations.md +8 -0
- package/content/skills/mugiwara-ship/SKILL.md +13 -10
- package/content/skills/mugiwara-testcases/SKILL.md +7 -0
- package/content/skills/mugiwara-workflow/SKILL.md +74 -77
- package/content/skills/mugiwara-workflow/references/workspace-layout.md +50 -0
- package/content/skills/using-mugiwara/SKILL.md +13 -18
- package/dist/mugiwara.js +293 -47
- package/gemini-extension.json +1 -1
- package/hooks/mugiwara-mode-tracker.ts +0 -0
- package/hooks/session-start.ts +1 -1
- package/package.json +11 -4
- package/plugin.json +1 -1
- package/references/multi-actor.md +1 -1
- package/scripts/evidence.sh +28 -6
- package/scripts/gate-selftest.ts +317 -0
- package/scripts/initiative.ts +262 -0
- package/scripts/lane.sh +18 -1
- package/scripts/mission-report.sh +237 -36
- package/scripts/onboard.ts +292 -0
- package/scripts/release-notes.ts +42 -13
- package/scripts/savepoint.sh +151 -60
- package/scripts/validate-content.ts +97 -0
- package/scripts/verify-install.ts +72 -0
- package/src/cli.ts +20 -3
- package/src/installer.ts +71 -8
- package/src/mission.ts +117 -5
- package/src/targets/claude.ts +45 -9
- package/src/targets/generic.ts +1 -1
- package/src/targets/opencode.ts +31 -10
- package/docs/concepts/agents.md +0 -53
- package/docs/concepts/audit-trail.md +0 -65
- package/docs/concepts/comparison.md +0 -58
- package/docs/concepts/config.md +0 -55
- package/docs/concepts/cost.md +0 -45
- package/docs/concepts/execution-model.md +0 -92
- package/docs/concepts/git-strategy.md +0 -62
- package/docs/concepts/lanes.md +0 -82
- package/docs/concepts/modes.md +0 -73
- package/docs/concepts/pr-summary.md +0 -54
- package/docs/concepts/skills.md +0 -55
- package/docs/concepts/workflow.md +0 -89
- package/docs/getting-started.md +0 -158
- package/docs/index.md +0 -56
- package/docs/install/antigravity.md +0 -45
- package/docs/install/claude.md +0 -77
- package/docs/install/cli.md +0 -115
- package/docs/install/codex.md +0 -44
- package/docs/install/copilot.md +0 -45
- package/docs/install/cursor.md +0 -45
- package/docs/install/gemini.md +0 -44
- package/docs/install/index.md +0 -53
- package/docs/install/kimi.md +0 -45
- package/docs/install/opencode.md +0 -143
- package/docs/install/pi.md +0 -46
- package/docs/reference/adoption-guide.md +0 -72
- package/docs/reference/agent-anatomy.md +0 -72
- package/docs/reference/compliance-matrix.md +0 -81
- package/docs/reference/developer-onboarding.md +0 -89
- package/docs/reference/enforcement.md +0 -35
- package/docs/reference/harness-matrix.md +0 -41
- package/docs/reference/skill-anatomy.md +0 -71
- package/docs/troubleshooting.md +0 -91
- package/evals/cases/_no-skill.json +0 -16
- package/evals/cases/adversarial-pressure-fake-pass.json +0 -25
- package/evals/cases/adversarial-pressure-skip-review.json +0 -25
- package/evals/cases/lane-exploratory-vague.json +0 -24
- package/evals/cases/lane-sensitivity-payment.json +0 -24
- package/evals/cases/positive-refactor-existing-tests.json +0 -25
- package/evals/cases/positive-resume-mid-mission.json +0 -24
- package/evals/cases/routing-agent-security.json +0 -25
- package/evals/cases/routing-auth-feature.json +0 -26
- package/evals/cases/routing-backend.json +0 -25
- package/evals/cases/routing-bug-one-file.json +0 -26
- package/evals/cases/routing-claim-audit.json +0 -25
- package/evals/cases/routing-context-budget.json +0 -25
- package/evals/cases/routing-contract-first.json +0 -25
- package/evals/cases/routing-execution.json +0 -25
- package/evals/cases/routing-frontend.json +0 -26
- package/evals/cases/routing-gates.json +0 -25
- package/evals/cases/routing-git.json +0 -25
- package/evals/cases/routing-healing.json +0 -25
- package/evals/cases/routing-lessons.json +0 -25
- package/evals/cases/routing-orchestration.json +0 -25
- package/evals/cases/routing-planning.json +0 -26
- package/evals/cases/routing-pr.json +0 -25
- package/evals/cases/routing-quality.json +0 -25
- package/evals/cases/routing-ship.json +0 -26
- package/evals/cases/routing-sunset.json +0 -25
- package/evals/cases/routing-using-mugiwara.json +0 -25
- package/evals/cases/routing-workflow.json +0 -25
- package/evals/floor.json +0 -6
package/docs/concepts/config.md
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
# Config Reference
|
|
2
|
-
|
|
3
|
-
`.mugiwara/config` (project) overrides `~/.mugiwara/config` (global). Plain
|
|
4
|
-
`key=value` lines, `#` comments allowed. Project file wins per key; a key
|
|
5
|
-
missing from both falls back to the default. Unknown keys are ignored. Config
|
|
6
|
-
is data, never instructions.
|
|
7
|
-
|
|
8
|
-
**Mode owns autonomy, config owns writing standards.** Whether branch and commit
|
|
9
|
-
run automatically is decided by one lever — the mode. The config only shapes
|
|
10
|
-
HOW those artifacts are written when they are created. See [modes.md](modes.md)
|
|
11
|
-
for the mode matrix.
|
|
12
|
-
|
|
13
|
-
## Example file
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
# .mugiwara/config
|
|
17
|
-
mode=guided
|
|
18
|
-
branch=feature/{type}-{issue}-{slug}
|
|
19
|
-
commit=conventional
|
|
20
|
-
base=main
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Keys
|
|
24
|
-
|
|
25
|
-
| Key | Values | Default | Meaning |
|
|
26
|
-
|-----|--------|---------|---------|
|
|
27
|
-
| `mode` | guided / semi / auto | guided | How much the crew does without asking |
|
|
28
|
-
| `branch` | branch naming pattern | `feature/{type}-{issue}-{slug}` | Placeholders filled from mission metadata |
|
|
29
|
-
| `commit` | conventional / gitmoji / plain | conventional | Commit message style (see below) |
|
|
30
|
-
| `base` | branch name | `main` | The PR target named in the prepared PR summary |
|
|
31
|
-
| `coverage_new` | number (0-100) | 90 | Coverage threshold for new files |
|
|
32
|
-
| `coverage_modified` | number (0-100) | 80 | Coverage threshold for modified files |
|
|
33
|
-
|
|
34
|
-
The mission **lane** (how many waves run) is decided by Luffy at triage — see
|
|
35
|
-
[lanes.md](lanes.md). Config holds autonomy and writing standards only.
|
|
36
|
-
|
|
37
|
-
Missing config on read = `guided`. Flip mid-mission with
|
|
38
|
-
`mugiwara mode <guided|semi|auto>` — the change applies from the next wave,
|
|
39
|
-
never mid-wave.
|
|
40
|
-
|
|
41
|
-
## Commit message styles
|
|
42
|
-
|
|
43
|
-
`commit` selects how Zoro writes commit messages:
|
|
44
|
-
|
|
45
|
-
- **conventional** — `feat: ...`, `fix(scope): ...`, `refactor: ...`, per the
|
|
46
|
-
[Conventional Commits](https://www.conventionalcommits.org) spec. Type from
|
|
47
|
-
the task, optional scope in parens. The default.
|
|
48
|
-
- **gitmoji** — a leading emoji carries the intent, e.g. `✨ feat: ...`,
|
|
49
|
-
`🐛 fix: ...`. Signals the change type at a glance in log views that render
|
|
50
|
-
emoji; a bit noisy in plain terminals.
|
|
51
|
-
- **plain** — no prefix, just a short imperative sentence: `Fix export csv
|
|
52
|
-
encoding`. Clearest for repos that don't use any convention.
|
|
53
|
-
|
|
54
|
-
Switch freely per project — it only affects the message format, never the
|
|
55
|
-
one-logical-task-one-commit rule.
|
package/docs/concepts/cost.md
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# Token Cost Model
|
|
2
|
-
|
|
3
|
-
Three-layer token architecture. Every layer has a cost and a purpose.
|
|
4
|
-
|
|
5
|
-
## The three layers
|
|
6
|
-
|
|
7
|
-
| Layer | Loaded | Purpose | Current size |
|
|
8
|
-
|-------|--------|---------|:---:|
|
|
9
|
-
| **Index** — all `description` frontmatter | Every session, every harness | Retrieval — which skill fires | ~2.9k tokens |
|
|
10
|
-
| **Body** — SKILL.md content | When the skill triggers | Capability — how well it performs | ~1.2k avg / skill |
|
|
11
|
-
| **References** — `references/*.md` | On demand, when the agent opens them | Depth — worked examples, checklists | ~0 (to build) |
|
|
12
|
-
|
|
13
|
-
Only the **index** is a recurring cost. Body and references pay only when used.
|
|
14
|
-
|
|
15
|
-
## Index budget
|
|
16
|
-
|
|
17
|
-
- **Target:** 1.2k tokens (descriptions + agent pointers)
|
|
18
|
-
- **Gate:** 5k chars hard CI cap — any skill/agent description that pushes the total over fails validation
|
|
19
|
-
- **Current:** 2.9k tokens, loaded on every session
|
|
20
|
-
|
|
21
|
-
Reduction path:
|
|
22
|
-
1. Prune 32 → 26 skills: ~2.5k
|
|
23
|
-
2. Descriptions → trigger-only (~150 chars): ~1.8k
|
|
24
|
-
3. Agent descriptions → pointer lines: ~1.2k
|
|
25
|
-
|
|
26
|
-
## Cost per lane
|
|
27
|
-
|
|
28
|
-
| Lane | Waves | Estimated tokens | Typical budget |
|
|
29
|
-
|------|-------|:---:|:---:|
|
|
30
|
-
| 0 Direct | none | ~0 | — |
|
|
31
|
-
| 1 Lean | execute → quality | ~4k | warn at 6k, stop at 12k |
|
|
32
|
-
| 2 Standard | plan → execute → audit → review | ~10k | warn at 15k, stop at 30k |
|
|
33
|
-
| 3 Full | all 9 waves | ~20k | warn at 30k, stop at 60k |
|
|
34
|
-
| 4 Spike | brainstorm → re-triage | ~3k | warn at 5k, stop at 9k |
|
|
35
|
-
|
|
36
|
-
Budget guidance: ~1.5× warns, 3× stops. Write state to `.mugiwara/state.json` before stopping.
|
|
37
|
-
|
|
38
|
-
## Per-mission cost
|
|
39
|
-
|
|
40
|
-
`state.json` carries `tokens_est` — the estimated tokens consumed by this mission. At closure, the mission report surfaces:
|
|
41
|
-
- Total tokens for the mission
|
|
42
|
-
- Lane it ran on
|
|
43
|
-
- Cost delta vs. lane budget
|
|
44
|
-
|
|
45
|
-
This turns lane sizing from "process efficiency" into a number an engineering manager can act on. No other skills pack produces this because no other pack sizes work.
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
# Execution Model
|
|
2
|
-
|
|
3
|
-
Why the crew runs in your main conversation — and when subagents are actually
|
|
4
|
-
used.
|
|
5
|
-
|
|
6
|
-
## Auto-activation
|
|
7
|
-
|
|
8
|
-
The workflow **auto-activates.** At session start the crew is announced; when
|
|
9
|
-
you give a non-trivial request, the pipeline runs by itself — you do not need
|
|
10
|
-
to call `/using-mugiwara`. It remains an optional explicit router if you want
|
|
11
|
-
to hand-route a mission.
|
|
12
|
-
|
|
13
|
-
## Inline by default
|
|
14
|
-
|
|
15
|
-
The crew runs **inline**. The main thread embodies each crew role using that
|
|
16
|
-
member's skill, so every wave plays out in your main conversation and you watch
|
|
17
|
-
it happen:
|
|
18
|
-
|
|
19
|
-
- Luffy's triage, Nami's planning, Zoro's execution, Chopper's audit, Sanji's
|
|
20
|
-
quality, Franky's gates, Robin/Jinbe's review, Brook's healing, Luffy's
|
|
21
|
-
closure — all performed in the main thread.
|
|
22
|
-
- Evidence is written to `.mugiwara/` files; the conversation carries terse
|
|
23
|
-
verdicts and evidence pointers.
|
|
24
|
-
|
|
25
|
-
## When subagents ARE used
|
|
26
|
-
|
|
27
|
-
Subagents exist to parallelize, never to hide work:
|
|
28
|
-
|
|
29
|
-
1. **`[PARALLEL]` task batches** — independent tasks that touch no shared files
|
|
30
|
-
or interfaces run concurrently, one per worker subagent. This is the only
|
|
31
|
-
place Zoro delegates.
|
|
32
|
-
2. **Parallel fixes** — Brook spawns workers for independent heal fixes.
|
|
33
|
-
3. **Background / long-running checks** — work that would stall the
|
|
34
|
-
conversation.
|
|
35
|
-
4. **Check subagents** — Chopper, Robin, and Jinbe may spawn subagents for
|
|
36
|
-
independent re-runs or diff passes.
|
|
37
|
-
|
|
38
|
-
Worker results return as reports; the main thread summarizes them inline with
|
|
39
|
-
evidence pointers.
|
|
40
|
-
|
|
41
|
-
## Why not dispatch every wave to a subagent?
|
|
42
|
-
|
|
43
|
-
Every harness — Claude Code, opencode, Codex, Cursor, Gemini — hides subagent
|
|
44
|
-
internals behind a click or a side panel. If each wave ran as a subagent, you'd
|
|
45
|
-
be clicking through the whole mission to see what happened. Running the crew in
|
|
46
|
-
the main conversation is the only way the process is genuinely visible.
|
|
47
|
-
|
|
48
|
-
There's also a context cost to deep nesting: crew-inside-crew subagents bloat
|
|
49
|
-
context and hide decisions. Inline keeps the user in the loop and the story
|
|
50
|
-
linear.
|
|
51
|
-
|
|
52
|
-
## Rules that keep it sane
|
|
53
|
-
|
|
54
|
-
- Crew members never dispatch another crew member. A role that must split work
|
|
55
|
-
returns the split to the main thread, which spawns the workers.
|
|
56
|
-
- Escalation = "blocked" + ledger row returned to the main thread.
|
|
57
|
-
- Sequential work never takes a subagent round-trip — no skipping, no hidden
|
|
58
|
-
reordering, plan order is plan order.
|
|
59
|
-
|
|
60
|
-
## Checkpoint reports
|
|
61
|
-
|
|
62
|
-
You see progress as **checkpoint reports**, not a firehose: a wave banner
|
|
63
|
-
(`## Wave N — <crew> (<skill>)`), one compact report per crew member at each
|
|
64
|
-
stage boundary (what ran / result / evidence pointer), a progress summary per
|
|
65
|
-
wave, and a pause when something fails or gets risky. Subagents are used only
|
|
66
|
-
where they genuinely help: independent `[PARALLEL]` task batches, Brook's
|
|
67
|
-
reviewer/security re-verification workers, and background checks.
|
|
68
|
-
|
|
69
|
-
## Manual stages
|
|
70
|
-
|
|
71
|
-
Prefer to drive the stages yourself? Every stage has a slash command that loads
|
|
72
|
-
the skill, runs the crew role inline, and bridges state from `.mugiwara/`:
|
|
73
|
-
|
|
74
|
-
| Command | Runs | Reads state from |
|
|
75
|
-
|---------|------|------------------|
|
|
76
|
-
| `/mugiwara-plan` | Nami | `.mugiwara/spec/` |
|
|
77
|
-
| `/mugiwara-execute` | Zoro | `.mugiwara/plans/` |
|
|
78
|
-
| `/mugiwara-review` | Robin | `.mugiwara/results/` + diff |
|
|
79
|
-
| `/mugiwara-security` | Jinbe | `.mugiwara/results/` + diff |
|
|
80
|
-
| `/mugiwara-heal` | Brook | `.mugiwara/issues/` |
|
|
81
|
-
| `/mugiwara-ship` | Luffy | plan + results |
|
|
82
|
-
|
|
83
|
-
You can jump into any stage — e.g. run `/mugiwara-plan` first, then
|
|
84
|
-
`/mugiwara-execute` later when you're ready.
|
|
85
|
-
|
|
86
|
-
## Trade-off
|
|
87
|
-
|
|
88
|
-
Inline execution grows the main-thread context over a long mission. The crew
|
|
89
|
-
mitigates this: evidence goes to `.mugiwara/` files, reports are terse, and
|
|
90
|
-
subagents isolate the genuinely heavy parallel work. For missions that must
|
|
91
|
-
minimize main-context growth, the crew supports dispatching specific waves to a
|
|
92
|
-
subagent — at the cost of visibility.
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
# Git Strategy
|
|
2
|
-
|
|
3
|
-
Commits, branches, save-points — and why the executor commits, not the closer.
|
|
4
|
-
|
|
5
|
-
## Who commits and when
|
|
6
|
-
|
|
7
|
-
**Zoro commits during execution, per logical task.** The executor is the one
|
|
8
|
-
making the changes, so it commits at the moment each unit of work passes its
|
|
9
|
-
acceptance criteria. This gives:
|
|
10
|
-
|
|
11
|
-
- **Save-points** — rollback is one `git reset --hard <save-point>` away.
|
|
12
|
-
- **Reversibility** — every commit is one logical change you can name.
|
|
13
|
-
- **Bisectability** — a regression points at the exact commit that introduced it.
|
|
14
|
-
|
|
15
|
-
Luffy does NOT re-commit at closure. The closer pushes the mission branch and
|
|
16
|
-
writes the PR verdict — re-slicing history at the end means one giant diff, no
|
|
17
|
-
save-points, and a painful bisect.
|
|
18
|
-
|
|
19
|
-
## Commit granularity: logical tasks, not micro-steps
|
|
20
|
-
|
|
21
|
-
A commit = one **logical change** (a feature, a fix, a refactor). The plan's
|
|
22
|
-
tasks are sized at that granularity — see `mugiwara-planning`.
|
|
23
|
-
|
|
24
|
-
- Adjacent trivial changes (typo, formatting, one-line tweak) fold into the
|
|
25
|
-
neighboring logical task's commit.
|
|
26
|
-
- Never one commit per keystroke; never a wave of micro-commits.
|
|
27
|
-
- If the plan slices finer than a logical change, group adjacent tasks into one
|
|
28
|
-
commit and note the grouping in the execution report.
|
|
29
|
-
|
|
30
|
-
## The rules (from `mugiwara-git`)
|
|
31
|
-
|
|
32
|
-
1. **Atomic commits.** One logical change per commit; each commit compiles and
|
|
33
|
-
passes the relevant checks — never commit a broken tree.
|
|
34
|
-
2. **Exact staging.** `git add` specific files and paths, never `git add -A`
|
|
35
|
-
sweeping an unrelated commit.
|
|
36
|
-
3. **Save-points before risky work.** Commit the working state with a naming
|
|
37
|
-
intent message (`checkpoint: before renderer migration`) before refactors,
|
|
38
|
-
migrations, or merges.
|
|
39
|
-
4. **Match repo style.** Inspect `git log --oneline -20` before the first
|
|
40
|
-
commit and copy the observed conventions (prefix style, case, body usage).
|
|
41
|
-
5. **Never commit secrets.** Scan for `.env*`, keys, tokens before every
|
|
42
|
-
commit. A secret already committed = treat as compromised, rotate, purge,
|
|
43
|
-
file a security finding.
|
|
44
|
-
|
|
45
|
-
## Branches
|
|
46
|
-
|
|
47
|
-
One branch per mission, from the config `branch` key:
|
|
48
|
-
|
|
49
|
-
```
|
|
50
|
-
branch=feature/{type}-{issue}-{slug}
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
`{type}` = feat/fix/chore/refactor from the task, `{issue}` = ticket/key
|
|
54
|
-
reference (fallback: date), `{slug}` = kebab-case mission title. Created before
|
|
55
|
-
the first task commit; never force-push once pushed. No mugiwara-prefixed
|
|
56
|
-
branch names.
|
|
57
|
-
|
|
58
|
-
## Terminal step
|
|
59
|
-
|
|
60
|
-
Every mode ends the same way: save-point commit → `git push -u origin <branch>`
|
|
61
|
-
→ PR verdict file written (per `mugiwara-pr`) → branch + verdict handed to you,
|
|
62
|
-
who opens the PR. The crew never creates a PR, merges, or deploys.
|
package/docs/concepts/lanes.md
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
# Lanes & Sizing
|
|
2
|
-
|
|
3
|
-
The crew sizes a mission before it runs. Lane is computed from the diff by
|
|
4
|
-
`scripts/lane.sh` — deterministic, not estimated.
|
|
5
|
-
|
|
6
|
-
## The lanes
|
|
7
|
-
|
|
8
|
-
| Lane | Picks when | Waves | Token budget |
|
|
9
|
-
|------|-----------|-------|:------:|
|
|
10
|
-
| **0 · Direct** | typo, rename, 1 file <20 LOC | none | ~0 |
|
|
11
|
-
| **1 · Lean** | bug in 1-2 files, <50 LOC | execute → quality | ~4k |
|
|
12
|
-
| **2 · Standard** | feature, 3-8 files | plan → execute → audit → review | ~10k |
|
|
13
|
-
| **3 · Full** | architecture, migration, 9+ files, or auth/payment/API touched | all 9 waves | ~20k |
|
|
14
|
-
| **4 · Spike** | exploratory, needs direction | brainstorm → re-triage | ~3k |
|
|
15
|
-
|
|
16
|
-
## How lane is computed
|
|
17
|
-
|
|
18
|
-
`scripts/lane.sh <base-ref>` runs `git diff --name-only` against the base ref
|
|
19
|
-
and applies deterministic rules:
|
|
20
|
-
|
|
21
|
-
| Diff | Lane |
|
|
22
|
-
|------|------|
|
|
23
|
-
| 0 files changed | Direct |
|
|
24
|
-
| 1 file, <20 LOC added | Direct |
|
|
25
|
-
| 1 file, ≥20 LOC added | Lean |
|
|
26
|
-
| 2 files | Lean |
|
|
27
|
-
| 3–8 files | Standard |
|
|
28
|
-
| 9+ files | Full |
|
|
29
|
-
|
|
30
|
-
**Sensitive path escalation.** Files matching these patterns always escalate to
|
|
31
|
-
Lane 3 (Full), regardless of file count:
|
|
32
|
-
|
|
33
|
-
```
|
|
34
|
-
auth/ payment/ billing/ crypto/ secrets/ .env
|
|
35
|
-
migration/ .sql schema. .prisma .terraform .tf
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
Use `--json` for machine output:
|
|
39
|
-
|
|
40
|
-
```json
|
|
41
|
-
{
|
|
42
|
-
"lane": "full",
|
|
43
|
-
"reason": "sensitive paths (src/auth/login.ts) — escalated from standard",
|
|
44
|
-
"files_touched": 5,
|
|
45
|
-
"sensitive_paths": ["src/auth/login.ts"],
|
|
46
|
-
"base": "main"
|
|
47
|
-
}
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
## Token budget
|
|
51
|
-
|
|
52
|
-
Every lane has a budget enforced by `scripts/savepoint.sh` at each wave
|
|
53
|
-
boundary. The harness sets `MUGIWARA_TOKENS` env var with estimated tokens
|
|
54
|
-
consumed.
|
|
55
|
-
|
|
56
|
-
| Status | Condition | Action |
|
|
57
|
-
|--------|-----------|--------|
|
|
58
|
-
| ok | tokens < 1.5× budget | Continue |
|
|
59
|
-
| warn | tokens ≥ 1.5× budget | Log warning to decision log |
|
|
60
|
-
| stop | tokens ≥ 3× budget | Write state, report to user, pause mission |
|
|
61
|
-
|
|
62
|
-
Budget guidance, not a hard kill switch. The model decides whether to stop —
|
|
63
|
-
savepoint just writes the status to `state.json`.
|
|
64
|
-
|
|
65
|
-
## Escalation
|
|
66
|
-
|
|
67
|
-
Lane **escalates when work outgrows the estimate.** At every wave boundary,
|
|
68
|
-
`scripts/savepoint.sh` re-checks the diff. If files grew or a sensitive path
|
|
69
|
-
appeared, lane rises. A lane **never auto-drops.** Under-process costs more
|
|
70
|
-
than over-process.
|
|
71
|
-
|
|
72
|
-
Manual escalation: if the user says "this is bigger than I thought — run the
|
|
73
|
-
full pipeline," Luffy records it in the decision log and escalates.
|
|
74
|
-
|
|
75
|
-
## SPIKE lane (Lane 4)
|
|
76
|
-
|
|
77
|
-
Exploratory missions start at Lane 4. Usopp brainstorms, then the mission is
|
|
78
|
-
re-triaged into the right lane. A spike that stays a spike (no code change
|
|
79
|
-
decided) ends at Wave 1.
|
|
80
|
-
|
|
81
|
-
Lane is computed per mission by `scripts/lane.sh`, not stored in
|
|
82
|
-
`.mugiwara/config`.
|
package/docs/concepts/modes.md
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
# Modes
|
|
2
|
-
|
|
3
|
-
The crew's autonomy level. Read once per wave at dispatch; a flip applies from
|
|
4
|
-
the next wave, never mid-wave.
|
|
5
|
-
|
|
6
|
-
**Mode owns autonomy, config owns writing standards.** Whether branch and commit
|
|
7
|
-
run automatically is decided by one lever: the mode. The config only shapes HOW
|
|
8
|
-
those artifacts are written when they are created.
|
|
9
|
-
|
|
10
|
-
## The three levels
|
|
11
|
-
|
|
12
|
-
| Level | Plan GO | Branch/commit | Ambiguities | Check-ins |
|
|
13
|
-
|-------|---------|---------------|-------------|-----------|
|
|
14
|
-
| **guided** | ask the user | ask the user | ask the user | ask the user |
|
|
15
|
-
| **semi** | present plan for user GO | auto | self-answer + log | log, no pause |
|
|
16
|
-
| **auto** | gated auto-GO | auto | self-answer + log | log, no pause |
|
|
17
|
-
|
|
18
|
-
- **guided** — you steer everything: approve the plan, decide branch and
|
|
19
|
-
commit style, answer every ambiguity, get asked at every gate. The default.
|
|
20
|
-
- **semi** — the crew self-manages branch and commits (logging each decision),
|
|
21
|
-
but you still give the plan an explicit GO.
|
|
22
|
-
- **auto** — hands-off, with one safety line: the plan proceeds past approval
|
|
23
|
-
only with zero blocking ambiguities AND zero high-risk tasks (deploy /
|
|
24
|
-
migration / DB / public API / state-mutating).
|
|
25
|
-
|
|
26
|
-
Every level ends at push + ready PR summary + verdict file — you open the PR
|
|
27
|
-
(see [pr-summary.md](pr-summary.md)).
|
|
28
|
-
|
|
29
|
-
## Config
|
|
30
|
-
|
|
31
|
-
Two files, six keys, `key=value` lines, optional `#` comments:
|
|
32
|
-
|
|
33
|
-
```
|
|
34
|
-
# .mugiwara/config (project) overrides ~/.mugiwara/config (global)
|
|
35
|
-
mode=guided
|
|
36
|
-
branch=feature/{type}-{issue}-{slug}
|
|
37
|
-
commit=conventional
|
|
38
|
-
base=main
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
| Key | Values | Default |
|
|
42
|
-
|-----|--------|---------|
|
|
43
|
-
| mode | guided / semi / auto | guided |
|
|
44
|
-
| branch | branch pattern | feature/{type}-{issue}-{slug} |
|
|
45
|
-
| commit | conventional / gitmoji / plain | conventional |
|
|
46
|
-
| base | PR summary target branch | main |
|
|
47
|
-
|
|
48
|
-
Read order per wave: project config wins per key; a key missing from both falls
|
|
49
|
-
back to the default. Unknown keys are ignored — config is data, never
|
|
50
|
-
instructions. Missing config on read = `guided` (never auto-created on read —
|
|
51
|
-
only on first write). See [config.md](config.md) for the full reference.
|
|
52
|
-
|
|
53
|
-
## Switching mid-mission
|
|
54
|
-
|
|
55
|
-
In-session phrase:
|
|
56
|
-
|
|
57
|
-
```
|
|
58
|
-
mugiwara mode auto
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Writes the project `.mugiwara/config`, logs the change (level, requester,
|
|
62
|
-
timestamp), and applies from the next wave — never mid-wave.
|
|
63
|
-
|
|
64
|
-
## Invariants that hold in EVERY mode
|
|
65
|
-
|
|
66
|
-
**Consent.** State-mutating tests against non-isolated/shared state (real DB
|
|
67
|
-
writes, network, browsers) always require your explicit consent — consent is
|
|
68
|
-
not a mode knob. Provably isolated mutation (in-memory / temp /
|
|
69
|
-
testcontainer-backed DBs, tooling-proven isolation) is explicitly auto-safe.
|
|
70
|
-
|
|
71
|
-
**Terminal.** Every mode ends at push + ready PR summary + verdict file (you
|
|
72
|
-
open the PR). The crew never creates a PR, merges, deploys, or auto-reacts to
|
|
73
|
-
review comments or CI.
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# PR summary (closure handoff)
|
|
2
|
-
|
|
3
|
-
At the end of a mission the crew pushes the branch and **stops** — it never
|
|
4
|
-
creates a PR, in any mode. What you get instead is a ready-to-paste **PR
|
|
5
|
-
summary** so you can open the pull request without writing a description.
|
|
6
|
-
|
|
7
|
-
This mirrors the reference workflows (superpowers `finishing-a-development-branch`,
|
|
8
|
-
agent-skills): the integration decision stays with the human. Mugiwara's
|
|
9
|
-
addition is that the PR description is already written.
|
|
10
|
-
|
|
11
|
-
## What happens at the terminal
|
|
12
|
-
|
|
13
|
-
1. Save-point commit → push the mission branch with plain `git push -u origin <branch>`.
|
|
14
|
-
2. Write `.mugiwara/results/YYYY-MM-DD-<mission>-pr-verdict.md` per `mugiwara-pr` —
|
|
15
|
-
it includes the **PR summary block** (copy-paste title + body).
|
|
16
|
-
3. Hand the branch + verdict file to you. You open the PR and paste the block.
|
|
17
|
-
|
|
18
|
-
No `gh` CLI, no PR API calls, no auto-reaction to review comments or CI.
|
|
19
|
-
|
|
20
|
-
## The PR summary block
|
|
21
|
-
|
|
22
|
-
The verdict file's PR summary is shaped by `.mugiwara/config` (project) /
|
|
23
|
-
`~/.mugiwara/config` (global):
|
|
24
|
-
|
|
25
|
-
| Key | Default | What it shapes |
|
|
26
|
-
|-----|---------|----------------|
|
|
27
|
-
| `base` | `main` | The target branch named in the PR summary |
|
|
28
|
-
|
|
29
|
-
Example:
|
|
30
|
-
|
|
31
|
-
```
|
|
32
|
-
mode=guided
|
|
33
|
-
branch=feature/{type}-{issue}-{slug}
|
|
34
|
-
commit=conventional
|
|
35
|
-
base=main
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
The title is a concise `{type}: {summary}` line from mission metadata; the body
|
|
39
|
-
is the verdict-file PR summary block (what changed, evidence, checks). The
|
|
40
|
-
summary is **material, never posted** — the crew's job ends at push.
|
|
41
|
-
|
|
42
|
-
## Why no auto-create
|
|
43
|
-
|
|
44
|
-
- PR creation is an external, irreversible side effect (public artifact, CI
|
|
45
|
-
trigger, reviewer notifications) — keeping it human avoids surprise and
|
|
46
|
-
security surface.
|
|
47
|
-
- The crew never needs forge credentials (`gh` auth, API tokens), so there is
|
|
48
|
-
nothing to leak and nothing to configure.
|
|
49
|
-
- The stop-at-PR invariant holds in every mode: no auto-reaction to review
|
|
50
|
-
comments, no auto-healing CI, no merge, no deploy.
|
|
51
|
-
|
|
52
|
-
See [`mugiwara-pr`](../content/skills/mugiwara-pr/SKILL.md) for the terminal
|
|
53
|
-
procedure and [`mugiwara-mode`](../content/skills/mugiwara-mode/SKILL.md) for
|
|
54
|
-
the mode contract.
|
package/docs/concepts/skills.md
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
# The Techniques — 26 Skills
|
|
2
|
-
|
|
3
|
-
Each skill is a portable markdown playbook — the "how to" the crew follows when
|
|
4
|
-
it embodies a role.
|
|
5
|
-
|
|
6
|
-
## Core pipeline
|
|
7
|
-
|
|
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
|
-
| `mugiwara-healing` | Reads the ledger, Stop-the-Line + Prove-It root-cause fixes, rollback prep |
|
|
21
|
-
|
|
22
|
-
## Mission control
|
|
23
|
-
|
|
24
|
-
| Skill | Teaches |
|
|
25
|
-
|-------|---------|
|
|
26
|
-
| `mugiwara-git` | Atomic commits, save-points, multi-commit splitting, bisect/blame debugging |
|
|
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 |
|
|
29
|
-
| `mugiwara-ship` | GO/NO-GO ship gate: pre-launch checklist, feature flags, rollback plan |
|
|
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 |
|
|
32
|
-
| `mugiwara-lessons` | Cross-mission memory: actionable lessons ledger, read at triage, written at closure |
|
|
33
|
-
|
|
34
|
-
## Engineering practice
|
|
35
|
-
|
|
36
|
-
| Skill | Teaches |
|
|
37
|
-
|-------|---------|
|
|
38
|
-
| `using-mugiwara` | Front-door router — explains the crew, classifies missions, routes to specialist |
|
|
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 |
|
|
43
|
-
|
|
44
|
-
## Domain
|
|
45
|
-
|
|
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 |
|
|
51
|
-
|
|
52
|
-
## Anatomy
|
|
53
|
-
|
|
54
|
-
Every skill is a `SKILL.md` with frontmatter + playbook body. See
|
|
55
|
-
[skill-anatomy.md](../reference/skill-anatomy.md).
|
|
@@ -1,89 +0,0 @@
|
|
|
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
|
-
and sizes it to a **lane**:
|
|
24
|
-
|
|
25
|
-
| Class | Signal | Route |
|
|
26
|
-
|-------|--------|-------|
|
|
27
|
-
| Trivial | one obvious small change, no ambiguity | Lane 0/1 — Wave 2 directly |
|
|
28
|
-
| Explicit | clear requirements, written spec exists | Wave 2 directly |
|
|
29
|
-
| Exploratory | needs direction, options, research | Wave 1 first |
|
|
30
|
-
| Open-ended | broad goal, undefined scope | Wave 1 first |
|
|
31
|
-
| Ambiguous | requirements, APIs, scope unclear | Wave 1 first |
|
|
32
|
-
|
|
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).
|
|
39
|
-
|
|
40
|
-
## Wave 4 — Checkpoint (Chopper)
|
|
41
|
-
|
|
42
|
-
The verify-everything gate. After execution, Chopper re-runs every acceptance
|
|
43
|
-
criterion — but efficiently:
|
|
44
|
-
|
|
45
|
-
- **Deduped**: each unique check command runs once per wave, scoped to the
|
|
46
|
-
files this wave changed. No running `npm test` once per task.
|
|
47
|
-
- **Scoped by diff**: `git diff --name-only <wave-base>..HEAD` decides what
|
|
48
|
-
actually needs re-verification.
|
|
49
|
-
- **Commit hygiene**: one `git log --stat` pass, not per-commit.
|
|
50
|
-
- Failures land in the blocker ledger `.mugiwara/issues/` with honest
|
|
51
|
-
code-vs-env classification.
|
|
52
|
-
|
|
53
|
-
## Wave 7 — Review
|
|
54
|
-
|
|
55
|
-
Robin (doubt-driven review) and Jinbe (security) run in parallel. Robin maps
|
|
56
|
-
breaking changes to callers before reading the diff; Jinbe runs STRIDE + OWASP.
|
|
57
|
-
Findings are severity-tagged with path:line.
|
|
58
|
-
|
|
59
|
-
## Wave 8 — Healing
|
|
60
|
-
|
|
61
|
-
Brook reads the blocker ledger and fixes root causes, proving each fix by
|
|
62
|
-
re-running the failed check. The loop returns to Wave 4 — max 3 cycles, then
|
|
63
|
-
escalation to you.
|
|
64
|
-
|
|
65
|
-
## Wave 9 — Closure
|
|
66
|
-
|
|
67
|
-
Luffy runs the ship gate, writes the closure report, deletes superseded
|
|
68
|
-
intermediate files, then the terminal step in every mode: **save-point commit →
|
|
69
|
-
push the mission branch → write the PR verdict file → hand branch + verdict to
|
|
70
|
-
you**, who opens the PR. The crew never creates a PR, merges, or deploys.
|
|
71
|
-
|
|
72
|
-
## The two rules that hold it together
|
|
73
|
-
|
|
74
|
-
1. **Evidence over claims.** No wave passes on assertion — the owning agent
|
|
75
|
-
runs the checks and shows output. "Subagents lie. No evidence = not
|
|
76
|
-
complete." A skipped wave is recorded in the decision log, never silent.
|
|
77
|
-
2. **The plan is the source of truth.** From Wave 2 on, the plan doc in
|
|
78
|
-
`.mugiwara/plans/` holds the clean execution plan; the decision log holds the
|
|
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.
|
|
84
|
-
|
|
85
|
-
## Blocker protocol
|
|
86
|
-
|
|
87
|
-
Any agent that hits a blocker appends a row
|
|
88
|
-
(`wave | task | symptom | attempted | help-needed`) to the ledger and escalates.
|
|
89
|
-
Never a silent workaround. Brook heals what the ledger lists.
|