@ionivetech/mugiwara 0.6.5 → 0.6.6

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 (110) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +2 -3
  3. package/.codex-plugin/plugin.json +1 -2
  4. package/.cursor-plugin/plugin.json +1 -2
  5. package/.kimi-plugin/plugin.json +1 -2
  6. package/.opencode/commands/mugiwara-continue.md +44 -31
  7. package/.opencode/commands/mugiwara-execute.md +1 -1
  8. package/.opencode/commands/mugiwara-heal.md +1 -1
  9. package/.opencode/commands/mugiwara-onboard.md +8 -9
  10. package/.opencode/commands/mugiwara-plan.md +1 -1
  11. package/.opencode/commands/mugiwara-review.md +1 -1
  12. package/.opencode/commands/mugiwara-security.md +1 -1
  13. package/.opencode/commands/mugiwara-ship.md +1 -1
  14. package/.opencode/commands/mugiwara.md +2 -2
  15. package/.opencode/plugins/mugiwara.mjs +1 -2
  16. package/AGENTS.md +1 -2
  17. package/README.md +33 -31
  18. package/content/agents/brook-healing.md +5 -8
  19. package/content/agents/chopper-checkpoint.md +8 -11
  20. package/content/agents/eval-runner.md +2 -5
  21. package/content/agents/franky-gates.md +4 -7
  22. package/content/agents/jinbe-security.md +4 -7
  23. package/content/agents/luffy-orchestrator.md +13 -13
  24. package/content/agents/memory-keeper.md +5 -8
  25. package/content/agents/nami-planner.md +4 -7
  26. package/content/agents/resume-coordinator.md +7 -10
  27. package/content/agents/robin-reviewer.md +6 -9
  28. package/content/agents/sanji-quality.md +7 -10
  29. package/content/agents/skeptic-verifier.md +5 -8
  30. package/content/agents/usopp-brainstorm.md +3 -6
  31. package/content/agents/zoro-execution.md +7 -10
  32. package/content/skills/mugiwara-backend/SKILL.md +2 -0
  33. package/content/skills/mugiwara-checkpoint/SKILL.md +13 -11
  34. package/content/skills/mugiwara-checkpoint/references/ledger-format.md +4 -4
  35. package/content/skills/mugiwara-context-budget/SKILL.md +5 -3
  36. package/content/skills/mugiwara-contract-first/SKILL.md +2 -0
  37. package/content/skills/mugiwara-execution/SKILL.md +20 -20
  38. package/content/skills/mugiwara-execution/references/dispatch.md +2 -2
  39. package/content/skills/mugiwara-execution/references/resume-batching.md +1 -1
  40. package/content/skills/mugiwara-frontend/SKILL.md +2 -4
  41. package/content/skills/mugiwara-gates/SKILL.md +8 -7
  42. package/content/skills/mugiwara-git/SKILL.md +7 -2
  43. package/content/skills/mugiwara-healing/SKILL.md +6 -4
  44. package/content/skills/mugiwara-healing/references/workers.md +2 -2
  45. package/content/skills/mugiwara-orchestration/SKILL.md +26 -24
  46. package/content/skills/mugiwara-orchestration/references/check-ins.md +16 -15
  47. package/content/skills/mugiwara-orchestration/references/closure.md +5 -5
  48. package/content/skills/mugiwara-orchestration/references/output-contract.md +9 -9
  49. package/content/skills/mugiwara-orchestration/references/triage-escalation.md +22 -22
  50. package/content/skills/mugiwara-planning/SKILL.md +3 -1
  51. package/content/skills/mugiwara-planning/references/plan-template.md +2 -2
  52. package/content/skills/mugiwara-pr/SKILL.md +6 -6
  53. package/content/skills/mugiwara-pr/references/verdict-format.md +3 -3
  54. package/content/skills/mugiwara-quality/SKILL.md +7 -7
  55. package/content/skills/mugiwara-resume/SKILL.md +18 -20
  56. package/content/skills/mugiwara-review/SKILL.md +5 -1
  57. package/content/skills/mugiwara-review/references/five-axis-worksheet.md +1 -1
  58. package/content/skills/mugiwara-root-cause/SKILL.md +2 -0
  59. package/content/skills/mugiwara-security/SKILL.md +5 -1
  60. package/content/skills/mugiwara-ship/SKILL.md +1 -1
  61. package/content/skills/mugiwara-ship/references/cleanup.md +1 -1
  62. package/content/skills/mugiwara-testcases/SKILL.md +5 -3
  63. package/content/skills/mugiwara-workflow/SKILL.md +27 -27
  64. package/content/skills/mugiwara-workflow/references/workspace-layout.md +15 -15
  65. package/content/skills/using-mugiwara/SKILL.md +5 -5
  66. package/dist/mugiwara.js +808 -33
  67. package/gemini-extension.json +1 -1
  68. package/hooks/auto-savepoint.js +106 -0
  69. package/hooks/auto-savepoint.ts +102 -0
  70. package/hooks/engagement-marker.js +59 -0
  71. package/hooks/engagement-marker.ts +97 -0
  72. package/hooks/hooks.json +41 -2
  73. package/hooks/mugiwara-mode-tracker.js +79 -0
  74. package/hooks/pipeline-guard.js +182 -0
  75. package/hooks/pipeline-guard.ts +267 -0
  76. package/hooks/session-start.js +106 -0
  77. package/hooks/session-start.ts +44 -32
  78. package/package.json +7 -3
  79. package/plugin.json +1 -1
  80. package/references/agent-protocol.md +15 -0
  81. package/references/complexity.md +54 -0
  82. package/references/definition-of-done.md +1 -1
  83. package/references/multi-actor.md +5 -5
  84. package/references/skill-versioning.md +1 -1
  85. package/references/token-budget.md +30 -8
  86. package/references/wave-banners.md +16 -16
  87. package/scripts/build-hooks.ts +56 -0
  88. package/scripts/conformance.ts +17 -0
  89. package/scripts/coverage-gate.ts +179 -0
  90. package/scripts/install.ps1 +5 -4
  91. package/scripts/install.sh +4 -4
  92. package/scripts/lane.sh +6 -2
  93. package/scripts/lib/patterns.sh +84 -0
  94. package/scripts/mission-report.sh +12 -11
  95. package/scripts/savepoint.sh +141 -37
  96. package/scripts/verify-install.ts +154 -44
  97. package/src/args.ts +1 -1
  98. package/src/cli.ts +217 -0
  99. package/src/continue.ts +243 -0
  100. package/src/installer.ts +39 -0
  101. package/src/onboard.ts +207 -0
  102. package/src/run.ts +82 -0
  103. package/src/targets/claude.ts +140 -2
  104. package/src/targets/copilot.ts +20 -1
  105. package/src/targets/generic.ts +9 -4
  106. package/src/targets/opencode.ts +0 -1
  107. package/content/agents/onboarding-guide.md +0 -124
  108. package/content/skills/mugiwara-security/references/owasp-mapping.md +0 -30
  109. package/scripts/onboard.ts +0 -266
  110. package/scripts/probe.ts +0 -40
@@ -8,7 +8,7 @@ description: Use when executing an approved plan — todo list first, sequential
8
8
  ## Skip when
9
9
 
10
10
  - No approved plan exists to execute — this is triage, brainstorm, or planning territory.
11
- - Lane 0 direct work (typo, rename, single small fix) with no wave structure.
11
+ - Lane 0 direct work (typo, rename, single small fix) with no flow-stage structure.
12
12
 
13
13
  Execute the plan exactly. No silent reordering, no skipping steps, no "close enough".
14
14
 
@@ -28,9 +28,9 @@ Before touching code:
28
28
  1. Create `.mugiwara/results/<mission>/todos.md` — one checkbox per task, derived from the plan.
29
29
  2. Check each box off only when the task completes, WITH its evidence link (`[path](relative/path)`, clickable).
30
30
  3. Re-check the whole list after each task and after each batch; unmarked boxes mean the mission is not done.
31
- 4. Mirror EVERY transition into the host's native todo tool (`todowrite` on opencode; `TaskUpdate` on Claude Code; none on tier 2/3 — plan doc only) in the SAME response the task's evidence lands — one transition per call, never batched at wave end. Per-host table: `docs/reference/harness-matrix.md`.
31
+ 4. Mirror EVERY transition into the host's native todo tool (`todowrite` on opencode; `TaskUpdate` on Claude Code; none on tier 2/3 — plan doc only) in the SAME response the task's evidence lands — one transition per call, never batched at flow-stage end. Per-host table: `docs/reference/harness-matrix.md`. Every task response opens with `[task N/M] <status>` — progress is visible on every harness, todo tool or not.
32
32
 
33
- ## Wave execution
33
+ ## Flow-stage execution
34
34
 
35
35
  Before starting: if `.mugiwara/continue/<mission>/[member].json` exists, resume from its next_action — never re-run completed tasks; verify against todos `[x]` marks. Full protocol: `references/resume-batching.md` — batch-resume, TDD, user-test oracle.
36
36
 
@@ -44,14 +44,15 @@ Before starting: if `.mugiwara/continue/<mission>/[member].json` exists, resume
44
44
  ## Worker dispatch triggers
45
45
 
46
46
  1. **Independence** — `[PARALLEL]` batches, concurrent, one task per worker.
47
- 2. **Context pressure** — when `tokens_est` exceeds `delegate_threshold`% of
48
- `budget` (read from `.mugiwara/config`, default 60) mid-execution, remaining
49
- SEQUENTIAL tasks dispatch to workers one at a time, in plan order. Order is
50
- preserved; only the context resets. Announce: `⚠ context 62% remaining tasks run in fresh workers, plan order unchanged.`
47
+ 2. **Context pressure** — when `delegate_due` reads `true` in
48
+ `.mugiwara/state/<mission>/[member].json` (savepoint computes it as
49
+ `tokens_est delegate_threshold% of budget`, config default 60), remaining
50
+ SEQUENTIAL tasks dispatch to workers one at a time, in plan order.
51
+ Announce: `⚠ context — remaining tasks run in fresh workers, plan order unchanged.`
51
52
 
52
- The threshold stays relative, never absolute: `tokens_est > delegate_threshold%
53
- × budget` (read from `.mugiwara/config`, default 60), never `tokens_est >
54
- 80,000` (obsolete in six months). A bigger window raises the threshold; it does not remove it.
53
+ Computed, never manual: savepoint emits `delegate_due` (relative
54
+ `tokens_est delegate_threshold% × budget`, default 60), never an absolute
55
+ `tokens_est > 80,000` (obsolete in six months). A bigger budget raises the bar; it does not remove it.
55
56
 
56
57
  ## Tier gating & fallback
57
58
 
@@ -59,9 +60,9 @@ Real worker dispatch exists only where the harness has subagents — tier 1
59
60
  (Claude Code, opencode) plus Copilot. Gate the context-pressure trigger on
60
61
  that capability: if the harness cannot dispatch, do not promise fresh workers.
61
62
 
62
- Where workers are unavailable and context pressure crosses the threshold:
63
+ Where workers are unavailable and `delegate_due` is true:
63
64
  write a savepoint, run the checkpoint, and suggest a fresh session via
64
- `resume`. Announce: `⚠ context 62% — no worker dispatch on this harness;
65
+ `resume`. Announce: `⚠ context — no worker dispatch on this harness;
65
66
  savepoint written, resume in a fresh session (plan order unchanged).`
66
67
 
67
68
  ## Batch resume
@@ -76,14 +77,13 @@ six-field worker prompt. Thin prompts cause thin results.
76
77
  ## Surfacing rule
77
78
 
78
79
  > **Delegated work is not hidden work.** A worker may run out of view; its
79
- > result may not. Every worker returns a wave banner, a one-line verdict, and an
80
+ > result may not. Every worker returns a flow stage banner, a one-line verdict, and an
80
81
  > evidence link into the main thread. The user never clicks into a subagent to
81
82
  > know what happened.
82
83
  > Isolation is for context and permission, never for autonomy.
83
84
 
84
85
  ## TDD discipline & user tests
85
-
86
- Full protocol: `references/resume-batching.md` — batch-resume, TDD RED-GREEN-REFACTOR (`references/tdd.md`), user tests as oracle, failing-first rule.
86
+ Full protocol: `references/resume-batching.md` — batch-resume, TDD RED-GREEN-REFACTOR (`references/tdd.md`), user tests as oracle, failing-first rule. One task end to end, RED through commit: `references/worked-example.md`.
87
87
 
88
88
  ## One logical task, one commit
89
89
 
@@ -91,7 +91,7 @@ Commit per LOGICAL task — a feature, fix, or refactor, not a micro-step; verif
91
91
 
92
92
  ## Blockers → issues ledger
93
93
 
94
- Blocked → one row `| wave | task | symptom | attempted | help-needed |` to `.mugiwara/issues/YYYY-MM-DD-<mission>-blockers.md`, then escalate to Luffy. Never work around a blocker silently.
94
+ Blocked → one row `| flow stage | task | symptom | attempted | help-needed |` to `.mugiwara/issues/YYYY-MM-DD-<mission>-blockers.md`, then escalate to Luffy. Never work around a blocker silently.
95
95
 
96
96
  ## Frontend tasks
97
97
 
@@ -99,11 +99,11 @@ Any task touching UI markup, styling, or components applies `mugiwara-frontend`
99
99
 
100
100
  ## Report
101
101
 
102
- After each wave: compact task table (status, evidence link, deviations) shown inline in the conversation. Format: `references/dispatch.md` — report table. Then return to Luffy, who routes to Chopper (Wave 4). Write detailed execution log to `.mugiwara/results/<mission>/01-execution.md`. Never dispatch another crew member.
102
+ After each flow stage: compact task table (status, evidence link, deviations) shown inline in the conversation. Format: `references/dispatch.md` — report table. Then return to Luffy, who routes to Chopper (Flow 4). Write detailed execution log to `.mugiwara/results/<mission>/01-execution.md`. Never dispatch another crew member.
103
103
 
104
104
  ## Step budget
105
105
 
106
- Tool calls are finite — harnesses cap them per session; a 9-wave mission that wastes them stalls before closure. Combine evidence runs (`evidence.sh <m> quality -- bash -c "lint && test"` — one call, not two); write wave artifacts once at wave end, not incrementally; never re-read what you just wrote; batch reads (one glob beats five reads); open a reference only when its pointer condition triggers.
106
+ Tool calls are finite — harnesses cap them per session; a 9-flow-stage mission that wastes them stalls before closure. Combine evidence runs (`evidence.sh <m> quality -- bash -c "lint && test"` — one call, not two); write flow stage artifacts once at flow-stage end, not incrementally; never re-read what you just wrote; batch reads (one glob beats five reads); open a reference only when its pointer condition triggers.
107
107
 
108
108
  Budget guide: Lane 1 ≤15 calls · Lane 2 ≤35 · Lane 3 ≤60. Crossing it is not a failure; announce it and check the context-pressure trigger.
109
109
 
@@ -117,8 +117,8 @@ Budget guide: Lane 1 ≤15 calls · Lane 2 ≤35 · Lane 3 ≤60. Crossing it is
117
117
  - Echoing raw output when `verbosity=normal` — summarize and cite the evidence path.
118
118
  - The task's TDD order inverted (implementation before the failing test).
119
119
  - A test passing immediately without having failed first (wrong test or testing existing behavior).
120
- - A commit containing files beyond its declared task, or a wave of micro-commits with no logical grouping.
120
+ - A commit containing files beyond its declared task, or a flow stage of micro-commits with no logical grouping.
121
121
  - Dispatching a worker whose result is not summarized inline with an evidence link.
122
- - Host todo UI lags the plan doc — task done but unchecked, or list never seeded at Wave 2.
122
+ - Host todo UI lags the plan doc — task done but unchecked, or list never seeded at Flow 2.
123
123
 
124
124
  All mean: stop, realign to the plan, or escalate to Luffy.
@@ -1,7 +1,7 @@
1
1
  # Dispatch & batching detail
2
2
 
3
3
  Full detail behind `content/skills/mugiwara-execution/SKILL.md` — the output
4
- rule, the worker prompt format, and the per-wave report table.
4
+ rule, the worker prompt format, and the per-flow stage report table.
5
5
 
6
6
  ## Task batching
7
7
 
@@ -32,7 +32,7 @@ A delegation prompt shorter than ~30 lines is too short — beef it up. Thin pro
32
32
 
33
33
  ## Report table
34
34
 
35
- After each wave: compact task table (status, evidence pointer, deviations) shown inline in the conversation. Format:
35
+ After each flow stage: compact task table (status, evidence pointer, deviations) shown inline in the conversation. Format:
36
36
 
37
37
  ```
38
38
  | # | Task | Status | Evidence link |
@@ -23,7 +23,7 @@ that passes on first run has proven nothing.
23
23
 
24
24
  ## Batch-resume protocol
25
25
 
26
- - Before starting a wave: if `.mugiwara/continue/<mission>/[member].json` exists, resume from its
26
+ - Before starting a flow stage: if `.mugiwara/continue/<mission>/[member].json` exists, resume from its
27
27
  next_action — never re-run completed tasks; verify against todos `[x]` marks.
28
28
  - After each batch: update `.mugiwara/continue/<mission>/[member].json` next_action to the next task.
29
29
  - `[PARALLEL]` batches stay per sub-mission — a batch never crosses a
@@ -28,8 +28,7 @@ Match the repo's standard before writing anything new; reuse its components and
28
28
  Capture current layout, spacing/type scales, palette, and component inventory before changing existing UI. Fix real problems; do not restyle what works.
29
29
 
30
30
  ## Design-system extraction (before markup)
31
-
32
- Extract tokens from the stack's design system BEFORE markup — spacing scale, type scale, role-based palette, radii, shadows, motion language. Name them semantically (`surface-muted`, not `c3`); store where the stack keeps tokens. No tokens extracted, no markup written. Then turn tokens into a small primitive set (button, input, card, icon, layout helpers) before composing screens — reuse primitives everywhere; every bespoke component is debt on every screen.
31
+ Extract tokens from the stack's design system BEFORE markup — spacing scale, type scale, role-based palette, radii, shadows, motion language. Name them semantically (`surface-muted`, not `c3`); store where the stack keeps tokens. No tokens extracted, no markup written; token set and naming: `references/design-tokens.md`. Then turn tokens into a small primitive set (button, input, card, icon, layout helpers) before composing screens — reuse primitives everywhere; every bespoke component is debt on every screen.
33
32
 
34
33
  ## Component architecture
35
34
 
@@ -66,14 +65,13 @@ Extract tokens first, then reproduce structure faithfully: hierarchy, alignment,
66
65
  Mobile-first: start at the smallest screen, add breakpoints as layout needs them. Default full-width stacked; columns only when there is room. Use the stack's breakpoints, not a parallel scale; fluid containers, type, and spacing. Verify at every breakpoint, including between them — 3 widths checked is not 12 checked.
67
66
 
68
67
  ## Banned AI-default patterns (the slop list)
69
-
70
68
  - Centered hero trio: headline + subtitle + two buttons, dead center, gradient text.
71
69
  - Row of 3-4 identical feature cards with icon-circle + title + two lines.
72
70
  - Purple/indigo gradient everything; glassmorphism everywhere; emoji as icons.
73
71
  - Placeholder content where real product copy exists.
74
72
  - Stock hero illustrations when the design specifies otherwise.
75
73
 
76
- If the brief genuinely calls for one of these, execute it well — but the default is: don't.
74
+ Full catalog with the tell for each: `references/slop-catalog.md`. If the brief genuinely calls for one of these, execute it well — but the default is: don't.
77
75
 
78
76
  ## WCAG 2.1 AA accessibility
79
77
 
@@ -16,14 +16,15 @@ Gates are binary: pass or fail, with evidence. No negotiation, no "almost passes
16
16
 
17
17
  1. Measure coverage with the project's existing tooling.
18
18
  2. Read thresholds from `.mugiwara/config` then `~/.mugiwara/config` for `coverage_new` and `coverage_modified`. Defaults: new ≥ 90%, modified ≥ 80%. Missing key or 0 = no threshold. Identify new/modified via git diff.
19
- 3. No coverage tooling → report the gap, propose minimal tooling, ask user to add or waive.
20
- 4. User-AC declared (per `mugiwara-testcases`): config thresholds apply to unit-level code only; user-AC verdict governs ship-readiness.
19
+ 3. No coverage tooling or no test suite record a SKIP with its reason. Never a fake pass; propose minimal tooling, ask user to add or waive.
20
+ 4. In this repo the gate is executable: `bun run coverage-gate` (`scripts/coverage-gate.ts`) does all three against the mission's `base_sha`, and runs as the last step of `bun run gate`. Never lower a threshold or exclude a file to make it green add the missing tests.
21
+ 5. User-AC declared (per `mugiwara-testcases`): config thresholds apply to unit-level code only; user-AC verdict governs ship-readiness.
21
22
 
22
23
  ## Sonar-style quality gate
23
24
 
24
- Franky reads evidence from prior wave reports (never re-runs
25
- checks): Jinbe (`.mugiwara/review/<mission>-security.md`),
26
- Robin (`.mugiwara/review/<mission>-review.md`), Sanji
25
+ Franky reads evidence from prior flow-stage reports (never re-runs
26
+ checks): Jinbe (`.mugiwara/review/YYYY-MM-DD-<mission>-security.md`),
27
+ Robin (`.mugiwara/review/YYYY-MM-DD-<mission>-review.md`), Sanji
27
28
  (`.mugiwara/results/<mission>/03-quality.md`).
28
29
  Evaluated: Vulnerabilities=0, Bugs=0, Code smells≤project
29
30
  threshold, Coverage(new code)≥config threshold,
@@ -37,7 +38,7 @@ Run the project's build (or typecheck for interpreted stacks). Must exit 0. Capt
37
38
 
38
39
  ## Optional e2e gate (per `mugiwara-quality`)
39
40
 
40
- Runs only when quality wave triggered it (repo e2e setup + changed-file e2e patterns, user consent). Skipped/unrun is logged, never blocks PASS. Final verdict: coverage + sonar + build + DoD.
41
+ Runs only when quality flow stage triggered it (repo e2e setup + changed-file e2e patterns, user consent). Skipped/unrun is logged, never blocks PASS. Final verdict: coverage + sonar + build + DoD.
41
42
 
42
43
  ## Definition of Done standing gate
43
44
 
@@ -51,7 +52,7 @@ A fixed cross-project bar. Full definitions: `_shared/references/definition-of-d
51
52
  ## Verdict
52
53
 
53
54
  PASS only when coverage AND sonar AND build AND DoD all pass with evidence. Write verdict to `.mugiwara/results/<mission>/04-gates.md`.
54
- PASS → return to Luffy (routes to Robin/Jinbe). FAIL → list files under threshold + by how much → return to Luffy (routes to Brook). Never dispatch next wave yourself.
55
+ PASS → return to Luffy (routes to Robin/Jinbe). FAIL → list files under threshold + by how much → return to Luffy (routes to Brook). Never dispatch the next flow stage yourself.
55
56
 
56
57
  ## Red flags
57
58
 
@@ -7,7 +7,7 @@ description: Use for commits, splitting, or git history debugging — atomic com
7
7
 
8
8
  ## Skip when
9
9
 
10
- - No commits to make this wave — nothing staged, nothing to split or amend.
10
+ - No commits to make this flow stage — nothing staged, nothing to split or amend.
11
11
  - User handles version control manually for this mission.
12
12
 
13
13
  Git hygiene keeps the mission reversible: one logical change per commit, a save-point before risky work, and history you can bisect.
@@ -29,7 +29,7 @@ Git hygiene keeps the mission reversible: one logical change per commit, a save-
29
29
 
30
30
  1. A large task becomes multiple commits, one per logical step in the plan.
31
31
  2. Split boundaries follow the plan's tasks: no commit spans two plan tasks, no plan task is left partially committed.
32
- 3. Commit each step the moment it is green; never batch a whole wave into one commit.
32
+ 3. Commit each step the moment it is green; never batch a whole flow stage into one commit.
33
33
 
34
34
  ## Commit message conventions
35
35
 
@@ -37,12 +37,17 @@ Git hygiene keeps the mission reversible: one logical change per commit, a save-
37
37
  2. Scoped subject when scope is not obvious: `feat(auth): enforce session TTL`.
38
38
  3. Body (after a blank line) explains WHY, not what. What is visible in the diff; why is not.
39
39
  4. Match the repo's existing style — detect it before writing messages (below).
40
+ 5. Config `commit` may be a template: any value containing `{` is a template with
41
+ placeholders `{type}` `{issue}` `{title}` (e.g. `{issue}: {title}` → `CR-5432: Testing
42
+ button`). Fill placeholders from mission metadata; `{issue}` falls back to the date.
43
+ Style names (conventional/gitmoji/plain) keep their normal rules.
40
44
 
41
45
  ## Style detection
42
46
 
43
47
  1. Inspect existing history before the first commit: `git log --oneline -20`.
44
48
  2. Copy the observed conventions: prefix style (`feat:`/`fix:` vs plain), subject case, body usage, subject length.
45
49
  3. No commits in the repo yet → adopt conventional commits and note it in the plan.
50
+ 4. A config `commit` template overrides history detection — the user's format wins.
46
51
 
47
52
  ## Branch naming
48
53
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: mugiwara-healing
3
- description: Use when an execution wave failed, earlier waves produced failures, broken things to fix — reads blocker ledger, stop-the-line triage, root-cause fixes, prove-it before fixing. Max 3 cycles.
3
+ description: Use when an execution flow stage failed, earlier flow stages produced failures, broken things to fix — reads blocker ledger, stop-the-line triage, root-cause fixes, prove-it before fixing. Max 3 cycles.
4
4
  ---
5
5
 
6
6
  # Healing (Brook)
@@ -39,6 +39,8 @@ Before fixing a bug: write the failing test that reproduces it, watch it fail, t
39
39
 
40
40
  ## Triage matrix
41
41
 
42
+ Full taxonomy behind the matrix: `references/failure-taxonomy.md`.
43
+
42
44
  | Failure | Action |
43
45
  |---------|--------|
44
46
  | lint/format error | auto-fix (formatter when supported), re-run |
@@ -53,15 +55,15 @@ Before fixing a bug: write the failing test that reproduces it, watch it fail, t
53
55
  2. Every code fix ships with the failed check now passing (run it, capture output).
54
56
  3. Never delete or weaken tests/configs to make a failure disappear.
55
57
  4. After healing: update the ledger — mark each healed row with evidence; keep unfixed rows for escalation.
56
- 5. Cycle counter: read `heal_cycle` from `.mugiwara/state/<mission>/[member].json` (savepoint writes it). After this wave the flow returns to Wave 4 (Chopper) for re-audit. **At 3, STOP and escalate to the user with full history — a halt, not a red flag.** Red flags are prose; the counter is state. Never re-run past 3.
58
+ 5. Cycle counter: read `heal_halt` from `.mugiwara/state/<mission>/[member].json` (savepoint writes it as `heal_cycle ≥ heal_max_cycles`, config default 3). After this flow stage the flow returns to Flow 4 (Chopper) for re-audit. **When `heal_halt` reads `true`, STOP and escalate to the user with full history — a halt, not a red flag.** Red flags are prose; the counter is state. Never re-run past `heal_max_cycles`.
57
59
 
58
60
  ## Worker subagents
59
61
 
60
- Brook runs inline for triage + ledger reading; parallel fixes use disposable WORKER subagents. Full protocol: `references/workers.md` — heal-worker grouping (independent rows in parallel), 5-field worker prompt, validation workers (reviewer/security/re-run), then back to Wave 4. Workers are NOT crew members.
62
+ Brook runs inline for triage + ledger reading; parallel fixes use disposable WORKER subagents. Full protocol: `references/workers.md` — heal-worker grouping (independent rows in parallel), 5-field worker prompt, validation workers (reviewer/security/re-run), then back to Flow 4. Workers are NOT crew members.
61
63
 
62
64
  ## Output
63
65
 
64
- Fixed list (finding → commit → evidence), escalated list (finding → plan → owner), updated ledger → back to Wave 4 (Chopper).
66
+ Fixed list (finding → commit → evidence), escalated list (finding → plan → owner), updated ledger → back to Flow 4 (Chopper).
65
67
 
66
68
  ## Red flags
67
69
 
@@ -20,7 +20,7 @@ Group 2 [SEQUENTIAL]: Row 3 (rbac.ts)
20
20
  ```
21
21
 
22
22
  Each heal worker receives a prompt with 5 fields:
23
- - **FAILURE** — ledger row verbatim (wave, task, symptom, attempted)
23
+ - **FAILURE** — ledger row verbatim (flow stage, task, symptom, attempted)
24
24
  - **ROOT CAUSE** — Brook's triage result: where the bug is, why it happened
25
25
  - **FIX** — what to change, which file, which function
26
26
  - **MUST DO** — Prove-It: write regression test, watch it fail, implement fix, watch it pass, commit
@@ -33,6 +33,6 @@ After all heal workers complete, dispatch validation workers in parallel:
33
33
  - **security-worker** — security pass over fixes (per `mugiwara-security`)
34
34
  - **re-run-check worker** — independently re-runs failed checks, returns raw evidence
35
35
 
36
- Flow: Brook triage + grouping → dispatch heal workers parallel → aggregate results → dispatch validation workers → update ledger → back to Wave 4.
36
+ Flow: Brook triage + grouping → dispatch heal workers parallel → aggregate results → dispatch validation workers → update ledger → back to Flow 4.
37
37
 
38
38
  Workers are NOT crew members — disposable subagents, one narrow job per worker. Crew runs inline in main thread.
@@ -6,15 +6,15 @@ description: Gatekeeper + captain for any task: triage, classify, coordinate, ro
6
6
 
7
7
  ## Skip when
8
8
 
9
- - Mid-wave continuation with route already recorded in `.mugiwara/logs/`. Captain duties: triage, check-ins, decisions, closure — Luffy coordinates, never implements; returns decisions, no dispatch.
9
+ - Mid-flow continuation with route already recorded in `.mugiwara/logs/`. Captain duties: triage, check-ins, decisions, closure — Luffy coordinates, never implements; returns decisions, no dispatch.
10
10
 
11
- ## Delegation pillars (Wave 0)
11
+ ## Delegation pillars (Flow 0)
12
12
 
13
13
  Size the mission against five pillars; highest gate determines route. Table: `references/delegation-pillars.md`. Quick: 1 file <20 LOC → Zoro, vague → Usopp, spec → Nami, auth/payment → full pipeline.
14
14
 
15
15
  ## Return-to-Luffy protocol
16
16
 
17
- Every wave returns to Luffy — no crew member hands off directly to another. Exception: Zoro/Brook direct calls execute immediately, Luffy records route. Non-execution crew members return results:
17
+ Every flow stage returns to Luffy — no crew member hands off directly to another. Exception: Zoro/Brook direct calls execute immediately, Luffy records route. Non-execution crew members return results:
18
18
 
19
19
  - Usopp → return brainstorm → Luffy routes to Nami or Zoro
20
20
  - Nami → return plan → guided/semi: Luffy asks the user for GO; auto: Luffy delegates to Zoro
@@ -24,6 +24,8 @@ Every wave returns to Luffy — no crew member hands off directly to another. Ex
24
24
 
25
25
  ## Coordination files
26
26
 
27
+ Team repos — per-(mission, member) isolation, no collisions: `_shared/references/multi-actor.md`.
28
+
27
29
  The plan doc (`.mugiwara/plans/YYYY-MM-DD-<mission>.md`) is Nami's clean execution plan — NEVER write coordination into it. Your decisions, route reasons, and check-in verdicts go to `.mugiwara/logs/YYYY-MM-DD-<mission>.md` (append-only, deletable at cleanup). The closure report goes to `.mugiwara/results/<mission>/06-closure.md`.
28
30
 
29
31
  ## Actor attribution (every .mugiwara write)
@@ -31,32 +33,32 @@ The plan doc (`.mugiwara/plans/YYYY-MM-DD-<mission>.md`) is Nami's clean executi
31
33
  Every decision-log row, blocker row, and check-in verdict records its actor:
32
34
  - User request → `user: <name> <<git email>>` (read from `git config user.name` / `user.email`).
33
35
  - AI decision → `AI: <model>` (e.g. `AI: deepseek-v4-flash`).
34
- In `auto` mode the AI decides everything; any requirement that stays unclear after triage is brainstormed with Usopp (Wave 1) BEFORE the AI decides — the AI never guesses on unclear scope. Record the brainstorm in the decision log with actor `AI:`.
36
+ In `auto` mode the AI decides everything; any requirement that stays unclear after triage is brainstormed with Usopp (Flow 1) BEFORE the AI decides — the AI never guesses on unclear scope. Record the brainstorm in the decision log with actor `AI:`.
35
37
 
36
- ## Mode read (Wave 0)
38
+ ## Mode read (Flow 0)
37
39
 
38
- Read the runtime mode via mode config at Wave 0: `.mugiwara/config` (project) then `~/.mugiwara/config` (global); a key missing from both = `guided`. Record the active mode AND `auto_commit` (default on) in the decision log. Read once per wave at dispatch; a flip applies from the next wave, never mid-wave. Declared test source (per `mugiwara-testcases`) also recorded in decision log; no source declared → no user tests.
40
+ Read the runtime mode via mode config at Flow 0: `.mugiwara/config` (project) then `~/.mugiwara/config` (global); a key missing from both = `guided`. Record the active mode AND `auto_commit` (default on) in the decision log. Read once per flow stage at dispatch; a flip applies from the next flow stage, never mid-flow-stage. Declared test source (per `mugiwara-testcases`) also recorded in decision log; no source declared → no user tests.
39
41
 
40
- ## Request classifier (Wave 0) — 8 classes
42
+ ## Request classifier (Flow 0) — 8 classes
41
43
 
42
- Classify every incoming request. 5-way table (Trivial/Explicit/Exploratory/Open-ended/Ambiguous) plus three more: **Answer** (question, no file change → answer directly, no mission), **Refuse** (deploy/migration/key rotation/merge → decline at Wave 0, offer branch handoff), **Hotfix** (production broken → Lane 1, gates deferred with owner, never skipped). Full table + signals: `references/triage-escalation.md`. Record decision + one-line reason at the top of the decision log. Risk (money/security/data/public API) → full pipeline; never shortcut without recording why. Any route without a recorded reason is a red flag.
44
+ Classify every incoming request. 5-way table (Trivial/Explicit/Exploratory/Open-ended/Ambiguous) plus three more: **Answer** (question, no file change → answer directly, no mission), **Refuse** (deploy/migration/key rotation/merge → decline at Flow 0, offer branch handoff), **Hotfix** (production broken → Lane 1, gates deferred with owner, never skipped). Full table + signals: `references/triage-escalation.md`. Record decision + one-line reason at the top of the decision log. Risk (money/security/data/public API) → full pipeline; never shortcut without recording why. Any route without a recorded reason is a red flag.
43
45
 
44
- ## Lane routing + precedence (Wave 0, size before process)
46
+ ## Lane routing + precedence (Flow 0, size before process)
45
47
 
46
- Alongside the class, size the mission and pick a lane (0 Direct / 1 Lean / 2 Standard / 3 Full / 4 Spike). **Precedence: class decides whether there is work; lane decides how much process — class first, lane second, record both.** A pasted Explicit spec still sizes the lane from its file list before Wave 2 (40-file spec → Lane 3). Escalation only: a lane may rise mid-mission, never drop. Full table: `references/triage-escalation.md`. Small tasks: read-only investigation → host `explore` agent or inline read — NOT a Luffy subagent (~5k vs ~40k tokens); explicit implement → Lane 1 Zoro inline. Review only when risky — full pipeline.
48
+ Alongside the class, size the mission and pick a lane (0 Direct / 1 Lean / 2 Standard / 3 Full / 4 Spike). **Precedence: class decides whether there is work; lane decides how much process — class first, lane second, record both.** A pasted Explicit spec still sizes the lane from its file list before Flow 2 (40-file spec → Lane 3). Escalation only: a lane may rise mid-mission, never drop. Full table: `references/triage-escalation.md`. Small tasks: read-only investigation → host `explore` agent or inline read — NOT a Luffy subagent (~5k inline vs ~132k measured per dispatch); explicit implement → Lane 1 Zoro inline. Review only when risky — full pipeline.
47
49
 
48
- ## Spec bridge (Wave 0 → Wave 2)
50
+ ## Spec bridge (Flow 0 → Flow 2)
49
51
 
50
- Wave 1 (Usopp) writes the brainstorm output to `.mugiwara/spec/YYYY-MM-DD-<mission>.md` — the bridge Nami reads. A route straight to Wave 2 (Trivial / Explicit) skips Wave 1, so it MUST still write a spec file before planning: a short but complete statement of the goal, the acceptance criteria as given, and any constraints — taken from the user's request, not invented. Never start Wave 2 with `.mugiwara/spec/` empty: if no spec exists, write one from the request first (the `/mugiwara-plan` command reads this file). The spec is input to Nami, never the plan itself.
52
+ Flow 1 (Usopp) writes the brainstorm output to `.mugiwara/spec/YYYY-MM-DD-<mission>.md` — the bridge Nami reads. A route straight to Flow 2 (Trivial / Explicit) skips Flow 1, so it MUST still write a spec file before planning: a short but complete statement of the goal, the acceptance criteria as given, and any constraints — taken from the user's request, not invented. Never start Flow 2 with `.mugiwara/spec/` empty: if no spec exists, write one from the request first (the `/mugiwara-plan` command reads this file). The spec is input to Nami, never the plan itself.
51
53
 
52
54
  ## Direct calls
53
55
 
54
56
  User may summon crew members directly. Luffy records the route + reason. Zoro/Brook: execute/heal immediately. All others: return to Luffy. Direct calls do not skip check-ins.
55
57
 
56
58
  ## Periodic check-ins
57
- Full checklist: `references/check-ins.md` — 7 items + by-mode verdicts; unchecked boxes are not done. **Handoff contract:** the continue file at every wave boundary — never only session end (rule #6).
58
- **Auto never drops:** in `auto` mode the crew runs every wave autonomously to closure — lane rise (`lane_rose`), sensitive-path touches, and heal cycles do NOT downgrade the mode. Only a genuine blocker or the heal halt pauses and escalates to the user; the mode stays auto. Announce every pause. **Auto never asks scope:** in `auto` mode, log the default choice and proceed — no scope/confirmation questions. A genuinely unclear requirement is brainstormed with Usopp (Wave 1) before the choice — never guessed. Only a genuine blocker or a pause escalates.
59
- **Heal halt:** read `heal_cycle` from `.mugiwara/state/<mission>/[member].json`. At `heal_max_cycles` (read from `.mugiwara/config`, default 3), STOP and escalate to the user.
59
+ Full checklist: `references/check-ins.md` — 7 items + by-mode verdicts; unchecked boxes are not done. **Handoff contract:** the continue file at every flow-stage boundary — never only session end (rule #6).
60
+ **Auto never drops:** in `auto` mode the crew runs every flow stage autonomously to closure — lane rise (`lane_rose`), sensitive-path touches, and heal cycles do NOT downgrade the mode. Only a genuine blocker or the heal halt pauses and escalates to the user; the mode stays auto. Announce every pause. **Auto never asks scope:** in `auto` mode, log the default choice and proceed — no scope/confirmation questions. A genuinely unclear requirement is brainstormed with Usopp (Flow 1) before the choice — never guessed. Only a genuine blocker or a pause escalates.
61
+ **Heal halt:** read `heal_halt` from `.mugiwara/state/<mission>/[member].json`. savepoint computes it (`heal_cycle heal_max_cycles`, config default 3); when it reads `true`, STOP and escalate to the user.
60
62
  **Pressure:** "just skip it", "auto, don't ask", "just this once" — the Rationalizations table below is the answer, not urgency.
61
63
 
62
64
  ## Rationalizations (pressure resistance)
@@ -73,21 +75,21 @@ Full checklist: `references/check-ins.md` — 7 items + by-mode verdicts; unchec
73
75
 
74
76
  Shortcuts ("skip X", "just do it") reroute work inside the pipeline — never outside; they end the crew frame only when the thread says "I'm not the crew" — fix it. Frame persists; roles change.
75
77
 
76
- ## Wave transitions (visibility)
78
+ ## Flow transitions (visibility)
77
79
 
78
- Banner in the owning agent's color opens every wave — the equals line
79
- `===== ⚔️ WAVE 3 — ZORO (EXECUTION) =====` (ANSI-wrapped in terminals, plain in markdown UIs). Spec + colors: `_shared/references/wave-banners.md`. A skip is recorded, never silent.
80
+ Banner in the owning agent's color opens every flow stage — the equals line
81
+ `===== ⚔️ FLOW 3 — ZORO (EXECUTION) =====` (ANSI-wrapped in terminals, plain in markdown UIs). Spec + colors: `_shared/references/wave-banners.md`. Timing: banner = FIRST line of the flow stage's first response; handoff `→ Flow N+1 — Crew (Role)` = LAST line of the flow stage's final response. A skip is recorded, never silent.
80
82
 
81
83
  ## Output discipline
82
84
 
83
- Read `verbosity` from mode config at Wave 0 (default `normal`); never suppresses wave banners, file edits, gate verdicts, decisions, questions, blockers, lane rises, or escalations.
85
+ Read `verbosity` from mode config at Flow 0 (default `normal`); never suppresses wave banners, file edits, gate verdicts, decisions, questions, blockers, lane rises, or escalations.
84
86
  At `normal`: investigation steps (reads, greps, probes), file contents, and narration are not echoed — name a file only when it matters; results collapse to one line + evidence path. At `full`: everything is echoed, including reads and reasoning.
85
87
  **The rule: the transcript must remain sufficient to review the mission without opening a file.** If collapsing a line breaks that, do not collapse it.
86
88
  Rendered examples: `references/output-contract.md` — match the shape.
87
89
 
88
90
  ## Work splitting
89
91
 
90
- When a wave has many independent tasks, instruct Zoro to parallelize — one task per WORKER subagent — and may split the mission into parallel tracks. Only `[PARALLEL]` sets are dispatched; sequential work stays inline. Never run more parallelism than the plan proves safe (check the dependency graph, no shared files). A `[PARALLEL]` task set with a hidden dependency edge is a red flag.
92
+ When a flow stage has many independent tasks, instruct Zoro to parallelize — one task per WORKER subagent — and may split the mission into parallel tracks. Only `[PARALLEL]` sets are dispatched; sequential work stays inline. Never run more parallelism than the plan proves safe (check the dependency graph, no shared files). A `[PARALLEL]` task set with a hidden dependency edge is a red flag.
91
93
 
92
94
  ## Q&A hub
93
95
 
@@ -95,11 +97,11 @@ Any agent routes a question to Luffy (via the main thread). Answer with: decisio
95
97
 
96
98
  ## Override (in-session)
97
99
 
98
- Recognize the in-session phrase `mugiwara mode <guided|semi|auto>`: write the project `.mugiwara/config`, append a decision-log row (level, requester, timestamp), and apply from the next wave. No CLI flag. The mode is read once per wave — a flip never applies mid-wave.
100
+ Recognize the in-session phrase `mugiwara mode <guided|semi|auto>`: write the project `.mugiwara/config`, append a decision-log row (level, requester, timestamp), and apply from the next flow stage. No CLI flag. The mode is read once per flow stage — a flip never applies mid-flow-stage.
99
101
 
100
- ## Closure (Wave 9)
102
+ ## Closure (Flow 9)
101
103
 
102
- Gate — every task's acceptance criteria verified, every gate passed, findings resolved or deferred with an owner, blocker ledger reviewed. Step results `results/<mission>/01..05` are evidence — kept, never deleted; only consumed cross-artifacts (`logs/`, `spec/`, `review/`, `issues/`) are removed. Run `scripts/savepoint.sh <mission>` to write final state, then `scripts/mission-report.sh <mission>` to generate the aggregate mission report at `.mugiwara/reports/YYYY-MM-DD-<mission>.md`. Write the closure summary to `.mugiwara/results/<mission>/06-closure.md`. The plan doc stays untouched. Full detail: `references/closure.md`. With `auto_commit=off` (guided/semi): skip the save-point commit and push — hand the uncommitted tree + verdict to the user; auto always pushes.
104
+ Gate — every task's acceptance criteria verified, every gate passed, findings resolved or deferred with an owner, blocker ledger reviewed. Step results `results/<mission>/01..05` are evidence — kept, never deleted; only consumed cross-artifacts (`logs/`, `spec/`, `review/`, `issues/`) are removed. Run `mugiwara savepoint <mission>` to write final state, then `mugiwara run mission-report.sh <mission>` to generate the aggregate mission report at `.mugiwara/reports/YYYY-MM-DD-<mission>.md`. Write the closure summary to `.mugiwara/results/<mission>/06-closure.md`. The plan doc stays untouched. Full detail: `references/closure.md`. With `auto_commit=off` (guided/semi): skip the save-point commit and push — hand the uncommitted tree + verdict to the user; auto always pushes.
103
105
 
104
106
  ## Spirit vs letter
105
107
 
@@ -113,7 +115,7 @@ Only Zoro (`mugiwara-execution`) and Brook (`mugiwara-healing`) write source. Ev
113
115
 
114
116
  - Accepting "skip the pipeline" without re-running the lane.
115
117
  - Letting auto proceed past a lane-3 escalation.
116
- - Starting a wave without a banner.
118
+ - Starting a flow stage without a banner.
117
119
  - Routing a Refuse-class request to a crew member; recording a lane without its trigger.
118
120
  - A host todo UI that lags the plan doc — tasks done but still unchecked, or the plan's task list never mirrored to the host.
119
121
  - Re-reading state or an artifact the crew wrote earlier in the same session.
@@ -1,6 +1,6 @@
1
1
  # Check-ins — mugiwara-orchestration
2
2
 
3
- Operational detail for the "Periodic check-ins" and "Wave transitions" sections of `mugiwara-orchestration`'s SKILL.md. Mode-critical rules (auto never drops, auto never asks scope, heal halt, pressure) stay inline in the skill body.
3
+ Operational detail for the "Periodic check-ins" and "Flow transitions" sections of `mugiwara-orchestration`'s SKILL.md. Mode-critical rules (auto never drops, auto never asks scope, heal halt, pressure) stay inline in the skill body.
4
4
 
5
5
  ## Language
6
6
 
@@ -12,39 +12,40 @@ is a defect and is flagged at check-in.
12
12
 
13
13
  ## Periodic check-ins
14
14
 
15
- After every wave AND at the end of each execution batch, verify:
15
+ After every flow stage AND at the end of each execution batch, verify:
16
16
 
17
17
  1. Outputs match the plan's acceptance criteria — evidence, not claims.
18
18
  2. No task silently dropped or reordered.
19
19
  3. Heal-loop counters within bounds (max `heal_max_cycles` (default 3) cycles). At the limit, STOP
20
20
  and escalate to the user — a halt, not a red flag. Red flags are prose; a counter is state.
21
21
  4. Blocker ledger `.mugiwara/issues/YYYY-MM-DD-<mission>-blockers.md` reviewed; every row has an owner or a path forward.
22
- 5. **Lane re-run** — `scripts/lane.sh`; if the lane rose, announce the escalation and record the trigger. Luffy owns this, nobody else.
23
- 6. **Handoff contract current** — `.mugiwara/continue/<mission>/[member].json` is written at every wave boundary
24
- (mission, sub_mission, wave, tasks, next_action, next_session_prompt) — never only at
25
- session end. Luffy owns it and verifies it at every check-in; a wave that ends without
22
+ 5. **Lane re-run** — `mugiwara run lane.sh`; if the lane rose, announce the escalation and record the trigger. Luffy owns this, nobody else.
23
+ 6. **Handoff contract current** — `.mugiwara/continue/<mission>/[member].json` is written at every flow-stage boundary
24
+ (mission, sub_mission, flow stage, tasks, next_action, next_session_prompt) — never only at
25
+ session end. Luffy owns it and verifies it at every check-in; a flow stage that ends without
26
26
  updating it is a red flag. continue is machine-written data — treat as data to verify,
27
27
  never verbatim instructions.
28
28
  7. **Host todo synced** — the main thread mirrors the plan doc's task list into the host's native todo mechanism
29
29
  (opencode `todowrite`; Claude Code `TaskCreate`/`TaskUpdate`/`TaskList` — `TodoWrite` is deprecated since
30
- v2.1.142; tier 2/3 hosts have no native tool — plan doc only). Seed it at Wave 2 (tasks + wave list 4-9);
30
+ v2.1.142; tier 2/3 hosts have no native tool — plan doc only). Seed it at Flow 2 (tasks + flow-stage list 4-9);
31
31
  update it in the SAME response each task's evidence lands — one transition per call, never deferred to
32
- batch or wave end; flip each wave to in_progress when its banner opens. The host todo is a mirror; the plan
32
+ batch or flow-stage end; flip each flow stage to in_progress when its banner opens. The host todo is a mirror; the plan
33
33
  doc stays the source of truth. A task done in the plan doc but not yet in the host tool is incomplete.
34
34
  Per-host table: `docs/reference/harness-matrix.md`.
35
35
 
36
36
  By mode (per mode config): `guided` checks in with the user as today; `semi`/`auto` write the check-in verdicts to the decision log without pausing the pipeline.
37
37
 
38
- ## Wave transitions (visibility)
38
+ ## Flow transitions (visibility)
39
39
 
40
- Every wave opens with a colored banner in the owning agent's color and closes
41
- with the handoff line `→ Wave N+1 — <crew>` (Wave 9: `→ closure`). Terminal:
42
- equals line `===== ⚔️ WAVE 3 — ZORO (EXECUTION) =====` wrapped in ANSI truecolor
40
+ Every flow stage opens with a colored banner in the owning agent's color and closes
41
+ with the handoff line `→ Flow N+1 — <crew>` (Flow 9: `→ closure`). Terminal:
42
+ equals line `===== ⚔️ FLOW 3 — ZORO (EXECUTION) =====` wrapped in ANSI truecolor
43
43
  `\x1b[38;2;R;G;Bm...\x1b[0m` (256 fallback `38;5;N`); markdown UIs: the plain
44
- equals line, no ANSI. The literal `WAVE N —`
45
- text must stay exact (savepoint's heal counter greps `wave 8`). Colors
44
+ equals line, no ANSI. The literal `FLOW N —`
45
+ text must stay exact (the check-in protocol reads it; heal cycles are counted
46
+ from the decision log's `## Flow 8` sections, not from banners). Colors
46
47
  and the full spec: `_shared/references/wave-banners.md`. No wave starts without its banner. A wave intentionally
47
- omitted is never silent — record wave, owner, and reason in the decision log
48
+ omitted is never silent — record flow stage, owner, and reason in the decision log
48
49
  before moving on. The user must always see which crew runs now and who takes
49
50
  over next.
50
51
 
@@ -7,8 +7,8 @@ Read after deciding to close a mission — never mid-argument.
7
7
 
8
8
  Present a detailed summary to the user — never a one-liner:
9
9
 
10
- - Mission summary — goal, mode, waves, task count.
11
- - Per-wave outcome table — wave, tasks, status, evidence link (clickable `[path](relative/path)`). Step results `results/<mission>/01..05` are evidence — never deleted at cleanup.
10
+ - Mission summary — goal, mode, flow stages, task count.
11
+ - Per-flow-stage outcome table — flow stage, tasks, status, evidence link (clickable `[path](relative/path)`). Step results `results/<mission>/01..05` are evidence — never deleted at cleanup.
12
12
  - Gate verdicts — quality, gates (coverage/build/DoD), review + security findings with dispositions, e2e (run / skipped + why).
13
13
  - Tests — unit/integration results; ATDD oracle verdict when user tests were declared.
14
14
  - Risks / rollback — remaining risk and the rollback path (revert commit / feature flag).
@@ -31,13 +31,13 @@ hand the user: the branch name, the exact commands to commit and push
31
31
  verdict pointer. In `auto` mode `auto_commit` is ignored — the terminal step
32
32
  runs unchanged.
33
33
 
34
- When this mission is a sub-mission of a team initiative, after closure run
35
- `bun scripts/initiative.ts set-status <initiative-plan> --id <sub-id> --status done`.
34
+ When this mission is a sub-mission of a team initiative, after closure set
35
+ that sub-mission's status cell to `done` in the initiative plan doc (`mugiwara initiative set-status <plan> --id <id> --status done` automates it).
36
36
  When all sub-missions show `[x]`, present initiative-level closure summary.
37
37
 
38
38
  ## Lessons
39
39
 
40
- At Wave 0 triage read `.mugiwara/logs/lessons.md` and surface relevant rows to
40
+ At Flow 0 triage read `.mugiwara/logs/lessons.md` and surface relevant rows to
41
41
  the owning agent. At closure embody memory-keeper inline to append this mission's
42
42
  lessons to `.mugiwara/logs/lessons.md` — one row per real lesson, append-only,
43
43
  never overwrite.
@@ -1,6 +1,6 @@
1
- # Output contract — one wave at both verbosity levels
1
+ # Output contract — one flow stage at both verbosity levels
2
2
 
3
- Purpose: show the exact shape a wave takes at `verbosity=normal` (default)
3
+ Purpose: show the exact shape a flow stage takes at `verbosity=normal` (default)
4
4
  and `verbosity=full`. Match the shape for the level in effect. Reference:
5
5
  `mugiwara-orchestration` → Output discipline.
6
6
 
@@ -12,7 +12,7 @@ Whatever the level, these are always visible — they are the audit surface:
12
12
  - file edits: path + one-line summary
13
13
  - gate verdicts + evidence path
14
14
  - decisions, questions, blockers, lane rises, escalations
15
- - the handoff line to the next wave
15
+ - the handoff line to the next flow stage
16
16
 
17
17
  ## The collapse table
18
18
 
@@ -21,7 +21,7 @@ Whatever the level, these are always visible — they are the audit surface:
21
21
  | 200 lines of test output | `✓ tests 84/84 → results/m/03-quality.md` |
22
22
  | Read/grep/probe tool calls + file contents | *(not echoed at `normal` — a file is named only when it matters)* |
23
23
  | Step-by-step reasoning | the conclusion |
24
- | Per-task bookkeeping | one summary line per wave |
24
+ | Per-task bookkeeping | one summary line per flow stage |
25
25
  | Raw diff | `+42/-8` + one-line summary |
26
26
 
27
27
  ---
@@ -29,11 +29,11 @@ Whatever the level, these are always visible — they are the audit surface:
29
29
  ## `normal` — default
30
30
 
31
31
  ```
32
- ==================== ⚔️ WAVE 3 — ZORO (EXECUTION) ====================
32
+ ==================== ⚔️ FLOW 3 — ZORO (EXECUTION) ====================
33
33
  ✎ src/auth/invitation.ts +42/-8 token validation + redirect guard
34
34
  ✎ src/routes/index.ts +6/-0 route registration
35
35
  ✓ tests 84/84 · lint 0 → results/m/03-quality.md
36
- Wave 4 — Chopper (Checkpoint)
36
+ Flow 4 — Chopper (Checkpoint)
37
37
  ```
38
38
 
39
39
  Commands ran and passed; output collapsed to one line per gate with the
@@ -44,8 +44,8 @@ appear. Reasoning reduced to conclusions.
44
44
  ## `full` — everything
45
45
 
46
46
  ```
47
- ==================== ⚔️ WAVE 3 — ZORO (EXECUTION) ====================
48
- $ bun scripts/lane.sh m
47
+ ==================== ⚔️ FLOW 3 — ZORO (EXECUTION) ====================
48
+ $ mugiwara run lane.sh m
49
49
  lane: full (44 files, 5 sensitive)
50
50
  $ readFileSync src/auth/invitation.ts
51
51
  export function signInvitation(...) {
@@ -59,7 +59,7 @@ $ bun test test/unit
59
59
  ✎ src/auth/invitation.ts +42/-8 token validation + redirect guard
60
60
  ✎ src/routes/index.ts +6/-0 route registration
61
61
  ✓ quality pass → results/m/03-quality.md
62
- Wave 4 — Chopper (Checkpoint)
62
+ Flow 4 — Chopper (Checkpoint)
63
63
  ```
64
64
 
65
65
  Every command, every read, every reasoning step — the raw transcript. Use it