@ionivetech/mugiwara 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +231 -371
- package/content/agents/brook-healing.md +2 -2
- package/content/agents/chopper-checkpoint.md +2 -1
- package/content/agents/eval-runner.md +4 -4
- package/content/agents/franky-gates.md +1 -1
- package/content/agents/jinbe-security.md +2 -1
- package/content/agents/luffy-orchestrator.md +3 -3
- package/content/agents/memory-keeper.md +1 -1
- package/content/agents/nami-planner.md +2 -2
- package/content/agents/resume-coordinator.md +8 -9
- package/content/agents/robin-reviewer.md +3 -2
- package/content/agents/sanji-quality.md +1 -1
- package/content/agents/skeptic-verifier.md +4 -3
- package/content/agents/using-mugiwara.md +3 -3
- package/content/agents/usopp-brainstorm.md +3 -3
- package/content/agents/zoro-execution.md +4 -3
- package/content/skills/mugiwara-agent-security/SKILL.md +14 -2
- package/content/skills/mugiwara-backend/SKILL.md +2 -8
- package/content/skills/mugiwara-backend/references/source-backed-example.md +77 -0
- package/content/skills/mugiwara-brainstorm/SKILL.md +2 -2
- package/content/skills/mugiwara-checkpoint/SKILL.md +2 -2
- package/content/skills/mugiwara-checkpoint/references/ledger-format.md +34 -0
- package/content/skills/{mugiwara-doubt-driven-development → mugiwara-claim-audit}/SKILL.md +2 -2
- package/content/skills/{mugiwara-context-engineering → mugiwara-context-budget}/SKILL.md +2 -2
- package/content/skills/mugiwara-context-budget/references/context-budget.md +37 -0
- package/content/skills/{mugiwara-api-and-interface-design → mugiwara-contract-first}/SKILL.md +4 -2
- package/content/skills/mugiwara-contract-first/references/versioning-playbook.md +36 -0
- package/content/skills/mugiwara-execution/SKILL.md +4 -2
- package/content/skills/mugiwara-execution/references/worked-example.md +88 -0
- package/content/skills/mugiwara-frontend/SKILL.md +13 -14
- package/content/skills/mugiwara-frontend/references/design-tokens.md +25 -0
- package/content/skills/mugiwara-frontend/references/slop-catalog.md +19 -0
- package/content/skills/mugiwara-gates/SKILL.md +4 -4
- package/content/skills/mugiwara-git/SKILL.md +1 -1
- package/content/skills/mugiwara-healing/SKILL.md +34 -7
- package/content/skills/mugiwara-healing/references/failure-taxonomy.md +23 -0
- package/content/skills/mugiwara-lessons/SKILL.md +1 -1
- package/content/skills/mugiwara-orchestration/SKILL.md +5 -5
- package/content/skills/mugiwara-planning/SKILL.md +2 -2
- package/content/skills/mugiwara-planning/references/anti-patterns.md +17 -0
- package/content/skills/mugiwara-planning/references/plan-template.md +46 -0
- package/content/skills/mugiwara-pr/SKILL.md +1 -1
- package/content/skills/{mugiwara-test-driven-development → mugiwara-proof-order}/SKILL.md +2 -2
- package/content/skills/mugiwara-proof-order/references/proof-order-examples.md +62 -0
- package/content/skills/mugiwara-quality/SKILL.md +3 -3
- package/content/skills/mugiwara-resume/SKILL.md +44 -33
- package/content/skills/mugiwara-review/SKILL.md +1 -1
- package/content/skills/mugiwara-review/references/five-axis-worksheet.md +36 -0
- package/content/skills/mugiwara-review/references/severity-rubric.md +20 -0
- package/content/skills/{mugiwara-systematic-debugging → mugiwara-root-cause}/SKILL.md +4 -2
- package/content/skills/mugiwara-root-cause/references/four-phase-worked.md +71 -0
- package/content/skills/mugiwara-security/SKILL.md +1 -1
- package/content/skills/mugiwara-security/references/owasp-mapping.md +30 -0
- package/content/skills/mugiwara-security/references/stride-worksheet.md +37 -0
- package/content/skills/mugiwara-ship/SKILL.md +1 -1
- package/content/skills/{mugiwara-deprecation → mugiwara-sunset}/SKILL.md +2 -2
- package/content/skills/mugiwara-testcases/SKILL.md +1 -1
- package/content/skills/mugiwara-testcases/references/intake-formats.md +42 -0
- package/content/skills/mugiwara-workflow/SKILL.md +20 -23
- package/dist/mugiwara.js +37 -8
- package/docs/agents.md +2 -2
- package/docs/audit-trail.md +65 -0
- package/docs/comparison.md +43 -170
- package/docs/compliance-matrix.md +81 -0
- package/docs/config.md +4 -2
- package/docs/cost.md +45 -0
- package/docs/enforcement.md +32 -35
- package/docs/getting-started.md +103 -41
- package/docs/harness-matrix.md +41 -0
- package/docs/lanes.md +65 -23
- package/docs/skill-anatomy.md +42 -54
- package/docs/skills.md +36 -54
- package/evals/cases/positive-refactor-existing-tests.json +1 -1
- package/evals/cases/routing-bug-one-file.json +1 -1
- package/package.json +5 -4
- package/references/definition-of-done.md +42 -0
- package/references/multi-actor.md +44 -0
- package/references/skill-versioning.md +44 -0
- package/references/source-grounding.md +23 -0
- package/references/token-budget.md +34 -0
- package/scripts/evidence.sh +37 -0
- package/scripts/lane.sh +74 -0
- package/scripts/mission-report.sh +88 -0
- package/scripts/release-notes.ts +65 -0
- package/scripts/retrieval-eval.ts +152 -0
- package/scripts/run-evals.ts +113 -0
- package/scripts/savepoint.sh +165 -0
- package/scripts/sync-version.ts +30 -0
- package/scripts/validate-content.ts +226 -0
- package/src/cli.ts +8 -3
- package/src/mission.ts +26 -3
- package/content/skills/mugiwara-dynamic-workflow/SKILL.md +0 -90
- package/content/skills/mugiwara-eval/SKILL.md +0 -87
- package/content/skills/mugiwara-git-worktrees/SKILL.md +0 -67
- package/content/skills/mugiwara-mode/SKILL.md +0 -77
- package/content/skills/mugiwara-observability/SKILL.md +0 -59
- package/content/skills/mugiwara-writing-skills/SKILL.md +0 -65
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: mugiwara-dynamic-workflow
|
|
3
|
-
description: Use when a mission or subproblem has many independent subtasks, needs comparison, or risks agent bias - pick the right dynamic workflow pattern - fan-out-and-synthesize, tournament, loop-until-done, classify-and-act, generate-and-filter.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Dynamic Workflow Patterns (Luffy)
|
|
7
|
-
|
|
8
|
-
## Skip when
|
|
9
|
-
|
|
10
|
-
- One linear pass suffices: <3 independent subtasks, no comparison, no known agent bias.
|
|
11
|
-
- Standard wave pipeline already covers the work without pattern selection.
|
|
12
|
-
|
|
13
|
-
Six primitives for missions too big or too biased for one linear pass. Choose the pattern BEFORE executing; record the choice in the decision log (.mugiwara/logs/). A mission may chain patterns (e.g. classify, then fan out, then tournament the outputs).
|
|
14
|
-
|
|
15
|
-
## Classify-and-act
|
|
16
|
-
|
|
17
|
-
1. Sort inputs into intent categories first, THEN route each category to its handler.
|
|
18
|
-
2. Never act before classifying — Luffy's Wave 0 triage is this pattern applied to the mission.
|
|
19
|
-
3. Unknown category → hold for judgment; never guess-assign.
|
|
20
|
-
|
|
21
|
-
## Fan-out-and-synthesize
|
|
22
|
-
|
|
23
|
-
1. Split work into independent tasks; run each in a parallel worker subagent (this is the one case that legitimately dispatches — parallel batches, never sequential work).
|
|
24
|
-
2. Prove disjointness first: each task touches distinct files or interfaces. No shared writes, no shared state.
|
|
25
|
-
3. A synthesizer merges results into ONE output with source attribution per part.
|
|
26
|
-
4. Conflicts resolve by evidence (re-run, inspect), never by vote count.
|
|
27
|
-
|
|
28
|
-
## Tournament / pairwise judgment
|
|
29
|
-
|
|
30
|
-
1. Ranking or selecting (options, designs, PRs) → compare in PAIRS, not all-at-once.
|
|
31
|
-
2. Fresh judge per match; match verdict only, no absolute scoring.
|
|
32
|
-
3. Winner advances; keep runner-up reasoning in the report.
|
|
33
|
-
4. Counters self-preferential bias: no judge argues for its own entry.
|
|
34
|
-
|
|
35
|
-
## Loop-until-done
|
|
36
|
-
|
|
37
|
-
1. Repeat one unit until a stopping criterion with evidence: test pass, threshold reached, user sign-off.
|
|
38
|
-
2. Bound the loop: max N (default 3). Exceeding N → escalate, never loop forever.
|
|
39
|
-
3. Record every iteration's evidence in `.mugiwara/results/`.
|
|
40
|
-
|
|
41
|
-
## Generate-and-filter
|
|
42
|
-
|
|
43
|
-
1. Produce many candidates first — no filtering during generation.
|
|
44
|
-
2. Filter against HARD constraints, then rank survivors.
|
|
45
|
-
3. Never filter before generating; never rank on soft preference before hard constraints.
|
|
46
|
-
|
|
47
|
-
## Adversarial verification
|
|
48
|
-
|
|
49
|
-
1. Every output gets a skeptic pass (dispatch `skeptic-verifier`): find what is wrong, do NOT validate.
|
|
50
|
-
2. Counters agentic laziness, self-preferential bias, goal drift.
|
|
51
|
-
3. Findings classified; loop bounded at 3 cycles.
|
|
52
|
-
|
|
53
|
-
## Selection guide
|
|
54
|
-
|
|
55
|
-
- One route, unknown intent → classify-and-act
|
|
56
|
-
- Many independent tasks, merge later → fan-out-and-synthesize
|
|
57
|
-
- Rank or select among peers → tournament
|
|
58
|
-
- Repetition with a stopping rule → loop-until-done
|
|
59
|
-
- Many candidates, hard bar → generate-and-filter
|
|
60
|
-
- Any high-stakes output about to ship → adversarial verification
|
|
61
|
-
|
|
62
|
-
## Failure modes fixed
|
|
63
|
-
|
|
64
|
-
- Agentic laziness: generate-and-filter + adversarial verification
|
|
65
|
-
- Self-preferential bias: tournament + adversarial verification
|
|
66
|
-
- Goal drift: loop bounds + adversarial verification
|
|
67
|
-
- Conflated judgments / order effects: tournament pairs
|
|
68
|
-
- Premature filtering / culled solutions: generate-and-filter
|
|
69
|
-
|
|
70
|
-
## Pattern table
|
|
71
|
-
|
|
72
|
-
| Pattern | Use when | Output |
|
|
73
|
-
|---------|----------|--------|
|
|
74
|
-
| classify-and-act | intent unknown, routes diverse | category → handler map + actions |
|
|
75
|
-
| fan-out-and-synthesize | independent subtasks | one merged output, source-attributed |
|
|
76
|
-
| tournament | rank / select peers | champion + runner-up reasoning |
|
|
77
|
-
| loop-until-done | repeat until criterion | iterations + final evidence |
|
|
78
|
-
| generate-and-filter | candidates + hard bar | ranked survivors |
|
|
79
|
-
| adversarial verification | output / verdict ships | findings report, bounded |
|
|
80
|
-
|
|
81
|
-
## Red flags
|
|
82
|
-
|
|
83
|
-
- Fan-out without a disjointness proof.
|
|
84
|
-
- A synthesizer merging by vote instead of evidence.
|
|
85
|
-
- A judge scoring absolutely instead of pairwise.
|
|
86
|
-
- An unbounded loop.
|
|
87
|
-
- Filtering before generating.
|
|
88
|
-
- A skeptic pass that "validates" instead of doubting.
|
|
89
|
-
|
|
90
|
-
All mean: stop, re-pick the pattern, record the change in the decision log.
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: mugiwara-eval
|
|
3
|
-
description: Use when verifying that a mugiwara skill, agent, or the whole crew actually works - write a task suite, run it with a judge agent, rubric-compare, and report pass/fail per case.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Eval (Self-Test)
|
|
7
|
-
|
|
8
|
-
## Skip when
|
|
9
|
-
|
|
10
|
-
- No skill, agent, or crew behavior changed — pure docs, installer, or packaging.
|
|
11
|
-
- Change is a version bump or manifest edit with zero behavioral delta.
|
|
12
|
-
|
|
13
|
-
Skills rot silently. A skill that was never tested is a claim, not a capability. This is the harness's own test harness: write a task suite, run each case, score with a fresh judge against a rubric, report pass/fail.
|
|
14
|
-
|
|
15
|
-
## Why
|
|
16
|
-
|
|
17
|
-
- Skill instructions drift from what agents actually do when followed.
|
|
18
|
-
- Untested means unverified: "it reads fine" is not "it works".
|
|
19
|
-
- The eval is the contract; the skill bends to it, never the reverse.
|
|
20
|
-
|
|
21
|
-
## Task suite format
|
|
22
|
-
|
|
23
|
-
One case per skill-behavior at `evals/cases/<skill>-<case>.json`:
|
|
24
|
-
|
|
25
|
-
```json
|
|
26
|
-
{
|
|
27
|
-
"name": "rubric-threshold-honesty",
|
|
28
|
-
"skill": "mugiwara-eval",
|
|
29
|
-
"task": "The prompt to run through the skill's workflow.",
|
|
30
|
-
"fixtures": ["evals/cases/fixtures/plan.md"],
|
|
31
|
-
"rubric": ["a pass threshold is stated before scoring", "a pass needs explicit evidence"],
|
|
32
|
-
"expected": "What pass looks like: all rubric items met, each with evidence."
|
|
33
|
-
}
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
- `name` unique per suite; `skill` matches the skill directory name.
|
|
37
|
-
- `task` is the prompt run as-is — no extra guidance bolted on.
|
|
38
|
-
- `rubric` = checked items; `expected` = the shape of a pass. `fixtures` optional, repo-relative paths.
|
|
39
|
-
|
|
40
|
-
## Judge-agent protocol
|
|
41
|
-
|
|
42
|
-
Rubric comparison, not gold-answer matching (SWE-bench-style suites + rubric judges):
|
|
43
|
-
|
|
44
|
-
1. Run the case: host executes `task` with the skill under test loaded.
|
|
45
|
-
2. Dispatch a FRESH judge — never the implementer. Counters self-preferential bias.
|
|
46
|
-
3. Judge scores each `rubric` item pass/fail with evidence; no absolute scores.
|
|
47
|
-
4. Compare against the rubric's explicit pass threshold (all items, or ≥ N with none critical).
|
|
48
|
-
5. Ranking or selection → pairwise/tournament judging (`mugiwara-dynamic-workflow`), not all-at-once.
|
|
49
|
-
|
|
50
|
-
## Loop
|
|
51
|
-
|
|
52
|
-
run → judge → fail → fix the SKILL (never the eval) → re-run.
|
|
53
|
-
|
|
54
|
-
1. Write cases before trusting a skill or changing it.
|
|
55
|
-
2. Run the suite; judge honestly.
|
|
56
|
-
3. A failing case means the skill's instructions are wrong or incomplete. Fix the skill.
|
|
57
|
-
4. A passing case gives no license to change the skill casually — re-run on change.
|
|
58
|
-
5. Never weaken the eval to clear a failure; that falsifies the test.
|
|
59
|
-
|
|
60
|
-
## Bound
|
|
61
|
-
|
|
62
|
-
- Run the suite per release and on every skill change.
|
|
63
|
-
- Report a pass/fail table to `.mugiwara/results/<mission>-eval.md`: case, judge, verdict, evidence, threshold.
|
|
64
|
-
- Failing cases → rows in `.mugiwara/issues/YYYY-MM-DD-<mission>-blockers.md` (category `eval-fail`).
|
|
65
|
-
- Keep the suite in sync with the skill dirs: at minimum one case per skill.
|
|
66
|
-
|
|
67
|
-
## Scope
|
|
68
|
-
|
|
69
|
-
Test the SKILL, not the host agent. Host behavior is the host's problem. The eval checks that the skill's instructions, when followed, produce the intended workflow. Never assert on agent behavior, model quirks, or tooling the skill does not own.
|
|
70
|
-
|
|
71
|
-
## Common rationalizations
|
|
72
|
-
|
|
73
|
-
- "I wrote it, it must work." → Fresh judge, always.
|
|
74
|
-
- "The case passed last release." → Re-run; skills drift between runs.
|
|
75
|
-
- "The eval is too strict." → Tighten the skill, never the rubric.
|
|
76
|
-
- "It's an agent problem." → If following the skill causes it, it's the skill's.
|
|
77
|
-
|
|
78
|
-
## Red flags
|
|
79
|
-
|
|
80
|
-
- The implementer judging its own case's skill.
|
|
81
|
-
- A rubric with no pass threshold.
|
|
82
|
-
- A case whose `task` leaks the expected answer.
|
|
83
|
-
- Fixing the eval instead of the skill to clear a failure.
|
|
84
|
-
- A suite run with no pass/fail report written.
|
|
85
|
-
- A suite that no longer matches the skill's current behavior.
|
|
86
|
-
|
|
87
|
-
All mean: the run is not a valid check. Stop, re-run with a fresh judge, write the report.
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: mugiwara-git-worktrees
|
|
3
|
-
description: Use when running parallel branch work, keeping the main workspace clean, or reviewing a branch without switching. Isolated worktrees via git worktree add, branch hygiene, and safe cleanup.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Git Worktrees — Isolated Parallel Branches
|
|
7
|
-
|
|
8
|
-
## Skip when
|
|
9
|
-
|
|
10
|
-
- Single-branch sequential work: no parallel branches running at once.
|
|
11
|
-
- Working tree stays clean and review happens on the current branch.
|
|
12
|
-
|
|
13
|
-
Worktrees give each branch its own checkout, so parallel missions, reviews, and experiments never fight over one working tree. Companion to mugiwara-git, not a replacement for commit discipline.
|
|
14
|
-
|
|
15
|
-
## When to use
|
|
16
|
-
|
|
17
|
-
- Parallel independent tasks on separate branches that must progress without blocking each other.
|
|
18
|
-
- Keeping the main workspace clean: main checkout stays untouched while risky work lives in a worktree.
|
|
19
|
-
- Reviewing or verifying a branch without switching: open it in a worktree, inspect, discard.
|
|
20
|
-
- Any task so risky you want it physically separate from the current tree.
|
|
21
|
-
|
|
22
|
-
Prefer a worktree over `git stash` juggling — each branch gets a real checkout, not a rescue from the reflog.
|
|
23
|
-
|
|
24
|
-
## Process
|
|
25
|
-
|
|
26
|
-
1. Create the worktree bound to a new branch:
|
|
27
|
-
`git worktree add -b <branch> <path>` (e.g. `git worktree add -b feature/ABC-123-dark-mode ../dark-mode`).
|
|
28
|
-
2. Work entirely inside `<path>`: edit, commit, push there. Treat it as the only home of that branch.
|
|
29
|
-
3. Do not touch that branch from the main checkout, and vice versa. Two tasks never share one worktree.
|
|
30
|
-
4. Verify the work before it leaves the worktree: run the branch's checks and tests inside `<path>`.
|
|
31
|
-
5. Merge or rebase back into the main branch from the main checkout; push when done.
|
|
32
|
-
6. Clean up once the branch is merged or abandoned:
|
|
33
|
-
- `git worktree remove <path>` (add `--force` only if it has uncommitted changes you accept losing).
|
|
34
|
-
- `git worktree prune` to drop stale bookkeeping for worktrees removed outside git's book.
|
|
35
|
-
7. Check nothing is left behind: `git worktree list` should show only your active checkouts.
|
|
36
|
-
|
|
37
|
-
## Cleanup safety
|
|
38
|
-
|
|
39
|
-
- Remove only worktrees you created. Host-owned worktrees — ones the repo or another agent set up — are not yours to delete; leave them.
|
|
40
|
-
- Never remove a worktree that still has unmerged commits unless you have deliberately abandoned that branch.
|
|
41
|
-
- Remove the worktree, not the branch directory with `rm -rf`; bypassing git leaves stale metadata that `prune` then has to guess about.
|
|
42
|
-
- A worktree without a branch (`--detach`) is throwaway: verify, then remove with no branch to worry about.
|
|
43
|
-
|
|
44
|
-
## Rationalizations
|
|
45
|
-
|
|
46
|
-
| Rationalization | Why it fails |
|
|
47
|
-
| --- | --- |
|
|
48
|
-
| "I'll just switch branches, it's faster." | Uncommitted changes block checkout; one mistake mixes work from two tasks. |
|
|
49
|
-
| "I can work on both branches in one checkout." | Stash conflicts and forgotten checkouts lose or misattribute work. |
|
|
50
|
-
| "Removing a worktree is the same as deleting a folder." | `rm -rf` leaves git's worktree bookkeeping stale; `git worktree remove` stays consistent. |
|
|
51
|
-
| "Their worktree looks abandoned, I'll clean it up." | Host-owned state. If it looks dead, report it, never remove it. |
|
|
52
|
-
|
|
53
|
-
## Red flags
|
|
54
|
-
|
|
55
|
-
- A worktree path inside the repo's own directory tree — nested worktrees are confusing and error-prone.
|
|
56
|
-
- Deleting or force-removing a worktree whose branch has unpushed commits.
|
|
57
|
-
- The same branch checked out in two worktrees, or two tasks sharing one worktree.
|
|
58
|
-
- Touching or re-checking-out a host-owned worktree.
|
|
59
|
-
|
|
60
|
-
All mean: stop, verify branch state, and clean up only what belongs to your task.
|
|
61
|
-
|
|
62
|
-
## Verification
|
|
63
|
-
|
|
64
|
-
1. `git worktree list` shows exactly the checkouts you expect — yours, none stale.
|
|
65
|
-
2. After cleanup, the worktree path is gone and `git worktree prune` reports nothing to prune.
|
|
66
|
-
3. The main checkout shows no leftover files, locks, or artifacts from the removed worktree.
|
|
67
|
-
4. The removed branch's commits are either merged into main or deliberately abandoned — never stranded.
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: mugiwara-mode
|
|
3
|
-
description: Use when reading or changing the runtime mode (guided / semi / auto) from .mugiwara/config or ~/.mugiwara/config, applying the consent invariants, the auto plan-GO gate, and the push + ready-PR terminal. Single source of truth for the mode contract.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Mode (guided / semi / auto)
|
|
7
|
-
|
|
8
|
-
## Skip when
|
|
9
|
-
|
|
10
|
-
- Mode unchanged this session: no config read or flip requested.
|
|
11
|
-
- Lane 0 direct work where autonomy level is irrelevant to the change.
|
|
12
|
-
|
|
13
|
-
The crew's autonomy level. Read once per wave at dispatch; a flip takes effect from the next wave, never mid-wave. Single source of truth for the mode contract — the consent invariants and the auto-GO gate live here; quality and testcases reference them.
|
|
14
|
-
|
|
15
|
-
## Levels
|
|
16
|
-
|
|
17
|
-
| Level | Plan GO | Branch/commit | Ambiguities | Check-ins |
|
|
18
|
-
|-------|---------|---------------|-------------|-----------|
|
|
19
|
-
| guided | ask the user | ask the user | ask the user | ask the user |
|
|
20
|
-
| semi | present plan for user GO | auto | self-answer + log | log, no pause |
|
|
21
|
-
| auto | gated auto-GO | auto | self-answer + log | log, no pause |
|
|
22
|
-
|
|
23
|
-
Consent is an invariant in ALL levels — see below. Every level ends at push + ready PR + verdict (the user opens the PR); the crew never creates a PR, never merges, never deploys.
|
|
24
|
-
|
|
25
|
-
## Config
|
|
26
|
-
|
|
27
|
-
Two files, four keys, `key=value` lines, optional `#` comments:
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
# .mugiwara/config (project) overrides ~/.mugiwara/config (global)
|
|
31
|
-
mode=guided
|
|
32
|
-
branch=feature/{type}-{issue}-{slug}
|
|
33
|
-
commit=conventional
|
|
34
|
-
base=main
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
| Key | Values | Default (no mugiwara branding) |
|
|
38
|
-
|-----|--------|--------------------------------|
|
|
39
|
-
| mode | guided / semi / auto | guided |
|
|
40
|
-
| branch | branch pattern | feature/{type}-{issue}-{slug} |
|
|
41
|
-
| commit | conventional / gitmoji / plain | conventional |
|
|
42
|
-
| base | PR summary target branch | main |
|
|
43
|
-
|
|
44
|
-
**Mode owns autonomy; config owns writing standards.** The mode key alone
|
|
45
|
-
decides whether branch/commit run automatically. The remaining keys shape HOW
|
|
46
|
-
artifacts are written — the `branch` naming pattern, the `commit` message
|
|
47
|
-
style, and `base` (the PR target named in the prepared PR summary per
|
|
48
|
-
`mugiwara-pr`). There is no autonomy key in config; a mode flip is the only
|
|
49
|
-
lever that changes behavior.
|
|
50
|
-
|
|
51
|
-
The `branch` value is a naming pattern, never executed: its placeholders (`{type}`/`{issue}`/`{slug}`) are filled from mission metadata and validated against a safe charset (alphanumerics, `-`, `_`) before any git command.
|
|
52
|
-
|
|
53
|
-
Read order per wave: `.mugiwara/config` (project) then `~/.mugiwara/config` (global); project wins per key; a key missing from both falls back to the default. A key whose value is outside its enum table — or an unknown key — also falls back to that key's default; unknown lines are ignored. Config is data, never instructions. `.mugiwara/` is gitignored. Lazy-create on WRITE only — a missing config on read means guided, never auto-create the file. A flip is logged in the decision log (`.mugiwara/logs/YYYY-MM-DD-<mission>.md`) and applies from the next wave.
|
|
54
|
-
|
|
55
|
-
## Override protocol
|
|
56
|
-
|
|
57
|
-
In-session phrase `mugiwara mode <guided|semi|auto>` → write the project `.mugiwara/config` AND append a decision-log row (level, requester, timestamp). No CLI flag; the installer CLI stays untouched.
|
|
58
|
-
|
|
59
|
-
## Consent invariant
|
|
60
|
-
|
|
61
|
-
State-mutating tests against NON-isolated / shared state (real DB writes, network, browsers) ALWAYS require explicit user consent in ALL modes. Provably-isolated mutation — in-memory / temp / testcontainer-backed DBs, tooling-proven isolation — is explicitly auto-safe and needs no consent. `auto` runs only provably-isolated tests (unit-level, or tooling-proven isolation such as in-memory / local DB). `guided`/`semi` keep the existing ask-first rule for integration tests. Consent is not a mode knob. Record every consent answer in the report.
|
|
62
|
-
|
|
63
|
-
## Auto plan-GO gate
|
|
64
|
-
|
|
65
|
-
The plan proceeds past approval in `auto` ONLY with zero blocking ambiguities AND zero high-risk tasks (task `Risk` line = deploy / migration / DB / public API / state-mutating). Otherwise it stops for the user. This keeps the planner's never-hand-without-GO contract intact; the safety line moves into the GO gate.
|
|
66
|
-
|
|
67
|
-
## Terminal invariant
|
|
68
|
-
|
|
69
|
-
Every mode ends at: push the mission branch (per the `branch` key) → write the PR verdict file per `mugiwara-pr` (includes a ready PR summary; target per `base`) → hand the branch + verdict to the user, who opens the PR. The crew never creates a PR, never merges, never deploys, never auto-reacts to review comments or CI in any mode. PR review is the terminal gate.
|
|
70
|
-
|
|
71
|
-
## Rules
|
|
72
|
-
|
|
73
|
-
1. Read the config once per wave at dispatch; a flip never applies mid-wave.
|
|
74
|
-
2. Missing config on read = guided; the file is created only on a write.
|
|
75
|
-
3. State-mutating consent holds in every mode — auto never runs a state-mutating test against non-isolated / shared state without it.
|
|
76
|
-
4. Auto plan-GO is gated, never assumed.
|
|
77
|
-
5. The terminal is push + ready PR + verdict in every mode — the crew never creates a PR.
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: mugiwara-observability
|
|
3
|
-
description: Use when instrumenting, tracing, or debugging how the mugiwara crew ran a mission - structured logs, OTel-compatible trace spans per wave/agent/tool, session correlation, and reading the traces to find where time and errors went.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Observability (Trace the Crew)
|
|
7
|
-
|
|
8
|
-
## Skip when
|
|
9
|
-
|
|
10
|
-
- Lane 0 direct work: no waves, no dispatches, nothing to trace.
|
|
11
|
-
- User explicitly declined tracing for this mission.
|
|
12
|
-
|
|
13
|
-
Make every mission replayable: one trace file, one line per dispatch, so you can see who ran what, how long, and where it failed.
|
|
14
|
-
|
|
15
|
-
## Trace log
|
|
16
|
-
|
|
17
|
-
Per mission, maintain `.mugiwara/results/YYYY-MM-DD-<mission>-trace.md` (fall back to the repo's log convention if `.mugiwara/` is absent). Append one entry per wave and per agent dispatch:
|
|
18
|
-
|
|
19
|
-
- `event`: wave | agent | tool called | start/end time | duration ms | outcome (pass/fail/blocked) | evidence pointer | error excerpt.
|
|
20
|
-
|
|
21
|
-
## Structured log lines
|
|
22
|
-
|
|
23
|
-
Each event is one parseable line, ISO timestamps, no PII:
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
2026-08-10T09:14:02Z [wave:3][agent:zoro][tool:subagent][ms:1240][ok] task-2.1 helper theme
|
|
27
|
-
2026-08-10T09:16:40Z [wave:3][agent:brook][tool:test][ms:9800][fail] e2e auth regressed — see .mugiwara/issues/2026-08-10-mission-blockers.md:7
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
Always include outcome; an event without an outcome is noise, not a trace.
|
|
31
|
-
|
|
32
|
-
## OTel-aware enrichment
|
|
33
|
-
|
|
34
|
-
If the host agent supports OTel GenAI spans, map each entry: `gen_ai.agent.*` for dispatches, `gen_ai.tool.*` for tool calls, span duration = entry duration; propagate trace context (`traceparent`) via MCP `_meta` when the tool is an MCP server. Recommend Langfuse or LangSmith as the viewer for spans/agent graphs. The FILE trace stays the source of truth — OTel is optional enrichment, never a replacement.
|
|
35
|
-
|
|
36
|
-
## Session correlation
|
|
37
|
-
|
|
38
|
-
Every entry carries the mission id `YYYY-MM-DD-<mission>` (same name as the plan doc). The id threads through trace, blockers ledger, and results so a full run can be replayed even after context compaction — grep the id across `.mugiwara/` to reconstruct the whole mission.
|
|
39
|
-
|
|
40
|
-
## Reading traces to debug
|
|
41
|
-
|
|
42
|
-
- Time: sort spans by duration — the longest spans are the wave/agent/tool to fix or parallelize.
|
|
43
|
-
- Errors: cluster `fail`/`blocked` entries by agent/task — repeated failure at one spot is a plan or skill bug, not a one-off.
|
|
44
|
-
- Utilization: which agents ran vs. never dispatched (over/under-use), heal-loop cost = sum of `[heal]` wave spans.
|
|
45
|
-
- Fix the plan/skill, not the symptom: the trace tells you where, the plan tells you why.
|
|
46
|
-
|
|
47
|
-
## End-of-mission summary
|
|
48
|
-
|
|
49
|
-
Close the trace file with a mini report: total duration, waves run, agents used, failures, heal cycles, longest span. This is the closure evidence for the ship gate.
|
|
50
|
-
|
|
51
|
-
## Red flags
|
|
52
|
-
|
|
53
|
-
- Events without timestamps, duration, or outcome.
|
|
54
|
-
- Entries missing the mission id.
|
|
55
|
-
- PII in log lines.
|
|
56
|
-
- Trace file absent at closure while waves ran.
|
|
57
|
-
- Heal cycles with no trace of which failure they retried.
|
|
58
|
-
|
|
59
|
-
All mean: the run is not reconstructable. Stop and record before moving on.
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: mugiwara-writing-skills
|
|
3
|
-
description: Use when authoring a new mugiwara skill or revising an existing one. Enforces the skill anatomy (name/description 20-500 chars, when-to-use, process, rationalizations, red flags, verification), the 120-line body ceiling, and progressive disclosure of detail into a references/ file. Meta-skill: governs the other skills.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Writing Mugiwara Skills
|
|
7
|
-
|
|
8
|
-
## Skip when
|
|
9
|
-
|
|
10
|
-
- Not authoring or revising a mugiwara skill — plain application code change.
|
|
11
|
-
- Skill change is a one-line description fix with no anatomy impact.
|
|
12
|
-
|
|
13
|
-
A skill is a process workflow the agent runs on cue, not a reference guide. If it reads like a wiki page, it fails. The description decides when the skill loads; the body decides what happens next. Both must justify their size.
|
|
14
|
-
|
|
15
|
-
## Skill anatomy
|
|
16
|
-
|
|
17
|
-
Every skill is a single `SKILL.md` at `content/skills/<name>/`, plus an optional `references/` folder for pulled-out detail. The name is the directory name; the validator checks that exact match.
|
|
18
|
-
|
|
19
|
-
| Part | Requirement |
|
|
20
|
-
|------|-------------|
|
|
21
|
-
| name | equals the directory name, `mugiwara-<domain>` |
|
|
22
|
-
| description | one "Use when..." sentence, 20-500 chars, loads the right skill and rejects the wrong ones |
|
|
23
|
-
| body | `# title` + sections below, 120 lines max |
|
|
24
|
-
| references/ | overflow detail, linked from the body |
|
|
25
|
-
|
|
26
|
-
## When to use
|
|
27
|
-
|
|
28
|
-
Use this skill the moment you start authoring a new skill file or restructuring an existing one. Skip it only for edits so small they cannot touch anatomy, limits, or wording.
|
|
29
|
-
|
|
30
|
-
## Process
|
|
31
|
-
|
|
32
|
-
1. **Confirm the niche.** Grep `content/skills/` for overlap; a new skill must not duplicate an existing one. Name it `mugiwara-<domain>`.
|
|
33
|
-
2. **Write the description first.** One "Use when..." sentence naming the trigger, the behavior, and the boundary of what the skill is not for. Target 60-120 chars; the 500-char cap is a ceiling, not a goal.
|
|
34
|
-
3. **Draft the body as a workflow.** Concrete numbered steps the agent executes, in order, with decisions and branches embedded. Name the skills it reads or dispatches. Use tables for excusable patterns and quick comparisons.
|
|
35
|
-
4. **Cut to the ceiling.** Body must end at 120 lines or fewer. Section-by-section trim: merge subsections, kill throat-clearing, convert prose to tables. `ponytail` and `caveman` instincts apply — the body is command output, not a report.
|
|
36
|
-
5. **Disclose progressively.** If a section exceeds roughly 15-20 lines, move it to `references/<topic>.md`, drop a one-line pointer in the body, and keep the pointer actionable (what to read and why).
|
|
37
|
-
6. **Check the anatomy list.** Each required section present, in order: title, When to use, Process, Rationalizations, Red flags, Verification.
|
|
38
|
-
7. **Validate.** Run `bun scripts/validate-content.ts --check content/skills/<name>/SKILL.md` and leave it exiting 0.
|
|
39
|
-
|
|
40
|
-
## Rationalizations
|
|
41
|
-
|
|
42
|
-
| Excuse | Rebuttal |
|
|
43
|
-
|--------|----------|
|
|
44
|
-
| "It's a guide, not a checklist" | A skill the agent cannot execute is decoration. Rewrite every paragraph as a step or a criterion. |
|
|
45
|
-
| "The detail is essential" | Then move it to `references/` and keep the body a decision tree, not a dump. |
|
|
46
|
-
| "More lines mean more coverage" | 120 lines enforce focus. Cover the decision, not the encyclopedia. |
|
|
47
|
-
| "Long description catches more triggers" | A description that matches everything loads on nothing specific and trains the agent to ignore the skill. |
|
|
48
|
-
| "Patterns are the same everywhere, I'll mirror another skill's text" | Wording must be original. Mirror the shape, never the sentences. |
|
|
49
|
-
| "It's fine for now, I'll validate later" | Validation is the last step of the write, not a follow-up task. |
|
|
50
|
-
|
|
51
|
-
## Red flags
|
|
52
|
-
|
|
53
|
-
- Body over 120 lines or a description outside 20-500 chars.
|
|
54
|
-
- No "Use when..." trigger sentence, or a description that names no boundary.
|
|
55
|
-
- A section that reads as a lecture instead of steps the agent can run.
|
|
56
|
-
- Required sections missing or out of order.
|
|
57
|
-
- Text copied from another skill, superpowers, or agent-skills.
|
|
58
|
-
- A `references/` file that is unreferenced, or a body so crammed it needed none.
|
|
59
|
-
- An unvalidated file reported as done.
|
|
60
|
-
|
|
61
|
-
Any of these: revise the skill, re-run validation, and confirm both before reporting.
|
|
62
|
-
|
|
63
|
-
## Verification
|
|
64
|
-
|
|
65
|
-
Evidence of a complete skill: the file passes `--check` with exit 0; `wc -l` on the body is at or under 120; the description triggers only its intended cases; every required section is present and original; and any overflow sits in a linked `references/` file.
|