@ionivetech/mugiwara 0.4.0 → 0.5.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.
Files changed (128) hide show
  1. package/README.md +231 -371
  2. package/content/agents/brook-healing.md +2 -2
  3. package/content/agents/chopper-checkpoint.md +2 -1
  4. package/content/agents/eval-runner.md +4 -4
  5. package/content/agents/franky-gates.md +1 -1
  6. package/content/agents/jinbe-security.md +2 -1
  7. package/content/agents/luffy-orchestrator.md +3 -3
  8. package/content/agents/memory-keeper.md +1 -1
  9. package/content/agents/nami-planner.md +2 -2
  10. package/content/agents/resume-coordinator.md +8 -9
  11. package/content/agents/robin-reviewer.md +3 -2
  12. package/content/agents/sanji-quality.md +1 -1
  13. package/content/agents/skeptic-verifier.md +4 -3
  14. package/content/agents/using-mugiwara.md +3 -3
  15. package/content/agents/usopp-brainstorm.md +3 -3
  16. package/content/agents/zoro-execution.md +4 -3
  17. package/content/skills/mugiwara-agent-security/SKILL.md +14 -2
  18. package/content/skills/mugiwara-backend/SKILL.md +2 -8
  19. package/content/skills/mugiwara-backend/references/source-backed-example.md +77 -0
  20. package/content/skills/mugiwara-brainstorm/SKILL.md +2 -2
  21. package/content/skills/mugiwara-checkpoint/SKILL.md +2 -2
  22. package/content/skills/mugiwara-checkpoint/references/ledger-format.md +34 -0
  23. package/content/skills/{mugiwara-doubt-driven-development → mugiwara-claim-audit}/SKILL.md +2 -2
  24. package/content/skills/{mugiwara-context-engineering → mugiwara-context-budget}/SKILL.md +2 -2
  25. package/content/skills/mugiwara-context-budget/references/context-budget.md +37 -0
  26. package/content/skills/{mugiwara-api-and-interface-design → mugiwara-contract-first}/SKILL.md +4 -2
  27. package/content/skills/mugiwara-contract-first/references/versioning-playbook.md +36 -0
  28. package/content/skills/mugiwara-execution/SKILL.md +4 -2
  29. package/content/skills/mugiwara-execution/references/worked-example.md +88 -0
  30. package/content/skills/mugiwara-frontend/SKILL.md +13 -14
  31. package/content/skills/mugiwara-frontend/references/design-tokens.md +25 -0
  32. package/content/skills/mugiwara-frontend/references/slop-catalog.md +19 -0
  33. package/content/skills/mugiwara-gates/SKILL.md +4 -4
  34. package/content/skills/mugiwara-git/SKILL.md +1 -1
  35. package/content/skills/mugiwara-healing/SKILL.md +34 -7
  36. package/content/skills/mugiwara-healing/references/failure-taxonomy.md +23 -0
  37. package/content/skills/mugiwara-lessons/SKILL.md +1 -1
  38. package/content/skills/mugiwara-orchestration/SKILL.md +5 -5
  39. package/content/skills/mugiwara-planning/SKILL.md +2 -2
  40. package/content/skills/mugiwara-planning/references/anti-patterns.md +17 -0
  41. package/content/skills/mugiwara-planning/references/plan-template.md +46 -0
  42. package/content/skills/mugiwara-pr/SKILL.md +1 -1
  43. package/content/skills/{mugiwara-test-driven-development → mugiwara-proof-order}/SKILL.md +2 -2
  44. package/content/skills/mugiwara-proof-order/references/proof-order-examples.md +62 -0
  45. package/content/skills/mugiwara-quality/SKILL.md +3 -3
  46. package/content/skills/mugiwara-resume/SKILL.md +44 -33
  47. package/content/skills/mugiwara-review/SKILL.md +1 -1
  48. package/content/skills/mugiwara-review/references/five-axis-worksheet.md +36 -0
  49. package/content/skills/mugiwara-review/references/severity-rubric.md +20 -0
  50. package/content/skills/{mugiwara-systematic-debugging → mugiwara-root-cause}/SKILL.md +4 -2
  51. package/content/skills/mugiwara-root-cause/references/four-phase-worked.md +71 -0
  52. package/content/skills/mugiwara-security/SKILL.md +1 -1
  53. package/content/skills/mugiwara-security/references/owasp-mapping.md +30 -0
  54. package/content/skills/mugiwara-security/references/stride-worksheet.md +37 -0
  55. package/content/skills/mugiwara-ship/SKILL.md +1 -1
  56. package/content/skills/{mugiwara-deprecation → mugiwara-sunset}/SKILL.md +2 -2
  57. package/content/skills/mugiwara-testcases/SKILL.md +1 -1
  58. package/content/skills/mugiwara-testcases/references/intake-formats.md +42 -0
  59. package/content/skills/mugiwara-workflow/SKILL.md +20 -23
  60. package/dist/mugiwara.js +37 -8
  61. package/docs/agents.md +2 -2
  62. package/docs/audit-trail.md +65 -0
  63. package/docs/comparison.md +43 -170
  64. package/docs/compliance-matrix.md +81 -0
  65. package/docs/config.md +4 -2
  66. package/docs/cost.md +45 -0
  67. package/docs/enforcement.md +32 -35
  68. package/docs/getting-started.md +103 -41
  69. package/docs/harness-matrix.md +41 -0
  70. package/docs/lanes.md +65 -23
  71. package/docs/skill-anatomy.md +42 -54
  72. package/docs/skills.md +36 -54
  73. package/evals/cases/_no-skill.json +16 -0
  74. package/evals/cases/adversarial-pressure-fake-pass.json +21 -8
  75. package/evals/cases/adversarial-pressure-skip-review.json +19 -7
  76. package/evals/cases/lane-exploratory-vague.json +18 -6
  77. package/evals/cases/lane-sensitivity-payment.json +18 -6
  78. package/evals/cases/positive-refactor-existing-tests.json +22 -8
  79. package/evals/cases/positive-resume-mid-mission.json +20 -7
  80. package/evals/cases/routing-agent-security.json +25 -0
  81. package/evals/cases/routing-auth-feature.json +20 -7
  82. package/evals/cases/routing-backend.json +25 -0
  83. package/evals/cases/routing-bug-one-file.json +21 -8
  84. package/evals/cases/routing-claim-audit.json +25 -0
  85. package/evals/cases/routing-context-budget.json +25 -0
  86. package/evals/cases/routing-contract-first.json +25 -0
  87. package/evals/cases/routing-execution.json +25 -0
  88. package/evals/cases/routing-frontend.json +26 -0
  89. package/evals/cases/routing-gates.json +25 -0
  90. package/evals/cases/routing-git.json +25 -0
  91. package/evals/cases/routing-healing.json +25 -0
  92. package/evals/cases/routing-lessons.json +25 -0
  93. package/evals/cases/routing-orchestration.json +25 -0
  94. package/evals/cases/routing-planning.json +26 -0
  95. package/evals/cases/routing-pr.json +25 -0
  96. package/evals/cases/routing-proof-order.json +25 -0
  97. package/evals/cases/routing-quality.json +25 -0
  98. package/evals/cases/routing-ship.json +26 -0
  99. package/evals/cases/routing-sunset.json +25 -0
  100. package/evals/cases/routing-workflow.json +25 -0
  101. package/evals/floor.json +6 -0
  102. package/package.json +6 -4
  103. package/references/definition-of-done.md +42 -0
  104. package/references/multi-actor.md +44 -0
  105. package/references/skill-versioning.md +44 -0
  106. package/references/source-grounding.md +23 -0
  107. package/references/token-budget.md +34 -0
  108. package/scripts/evidence.sh +37 -0
  109. package/scripts/lane.sh +74 -0
  110. package/scripts/mission-report.sh +88 -0
  111. package/scripts/probe.ts +40 -0
  112. package/scripts/release-notes.ts +65 -0
  113. package/scripts/retrieval-eval.ts +261 -0
  114. package/scripts/run-evals.ts +149 -0
  115. package/scripts/savepoint.sh +166 -0
  116. package/scripts/sync-version.ts +30 -0
  117. package/scripts/validate-content.ts +226 -0
  118. package/src/cli.ts +8 -3
  119. package/src/mission.ts +26 -3
  120. package/content/skills/mugiwara-dynamic-workflow/SKILL.md +0 -90
  121. package/content/skills/mugiwara-eval/SKILL.md +0 -87
  122. package/content/skills/mugiwara-git-worktrees/SKILL.md +0 -67
  123. package/content/skills/mugiwara-mode/SKILL.md +0 -77
  124. package/content/skills/mugiwara-observability/SKILL.md +0 -59
  125. package/content/skills/mugiwara-writing-skills/SKILL.md +0 -65
  126. package/evals/cases/negative-secrets-typo.json +0 -12
  127. package/evals/cases/negative-security-docs-change.json +0 -12
  128. package/evals/cases/routing-typo.json +0 -13
@@ -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.
@@ -1,12 +0,0 @@
1
- {
2
- "name": "negative-secrets-typo",
3
- "skill": "mugiwara-git",
4
- "type": "negative",
5
- "task": "Fix a typo in a comment in src/index.ts (one word). This is a trivial change.",
6
- "rubric": [
7
- "does NOT rank mugiwara-security first (no trust boundary crossed)",
8
- "does NOT rank mugiwara-systematic-debugging first (cause known)",
9
- "treats it as lane 0 direct work"
10
- ],
11
- "expect_lane": "direct"
12
- }
@@ -1,12 +0,0 @@
1
- {
2
- "name": "negative-security-docs-change",
3
- "skill": "mugiwara-git",
4
- "type": "negative",
5
- "task": "Update the README to fix a broken link. No code, no config, no data flow changes.",
6
- "rubric": [
7
- "does NOT rank mugiwara-security first (docs-only, no trust boundary)",
8
- "does NOT rank mugiwara-test-driven-development first (no production code)",
9
- "does NOT rank mugiwara-gates first (no code changed)"
10
- ],
11
- "expect_lane": "direct"
12
- }
@@ -1,13 +0,0 @@
1
- {
2
- "name": "routing-typo",
3
- "skill": "mugiwara-git",
4
- "task": "Fix a typo in a comment in src/index.ts (one word).",
5
- "rubric": [
6
- "treats it as lane 0 direct work",
7
- "makes the one-line change without brainstorm or plan",
8
- "does not invoke the crew pipeline",
9
- "commits with a conventional commit message"
10
- ],
11
- "lane": "0",
12
- "expect_lane": "direct"
13
- }