@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.
- 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/_no-skill.json +16 -0
- package/evals/cases/adversarial-pressure-fake-pass.json +21 -8
- package/evals/cases/adversarial-pressure-skip-review.json +19 -7
- package/evals/cases/lane-exploratory-vague.json +18 -6
- package/evals/cases/lane-sensitivity-payment.json +18 -6
- package/evals/cases/positive-refactor-existing-tests.json +22 -8
- package/evals/cases/positive-resume-mid-mission.json +20 -7
- package/evals/cases/routing-agent-security.json +25 -0
- package/evals/cases/routing-auth-feature.json +20 -7
- package/evals/cases/routing-backend.json +25 -0
- package/evals/cases/routing-bug-one-file.json +21 -8
- package/evals/cases/routing-claim-audit.json +25 -0
- package/evals/cases/routing-context-budget.json +25 -0
- package/evals/cases/routing-contract-first.json +25 -0
- package/evals/cases/routing-execution.json +25 -0
- package/evals/cases/routing-frontend.json +26 -0
- package/evals/cases/routing-gates.json +25 -0
- package/evals/cases/routing-git.json +25 -0
- package/evals/cases/routing-healing.json +25 -0
- package/evals/cases/routing-lessons.json +25 -0
- package/evals/cases/routing-orchestration.json +25 -0
- package/evals/cases/routing-planning.json +26 -0
- package/evals/cases/routing-pr.json +25 -0
- package/evals/cases/routing-proof-order.json +25 -0
- package/evals/cases/routing-quality.json +25 -0
- package/evals/cases/routing-ship.json +26 -0
- package/evals/cases/routing-sunset.json +25 -0
- package/evals/cases/routing-workflow.json +25 -0
- package/evals/floor.json +6 -0
- package/package.json +6 -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/probe.ts +40 -0
- package/scripts/release-notes.ts +65 -0
- package/scripts/retrieval-eval.ts +261 -0
- package/scripts/run-evals.ts +149 -0
- package/scripts/savepoint.sh +166 -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
- package/evals/cases/negative-secrets-typo.json +0 -12
- package/evals/cases/negative-security-docs-change.json +0 -12
- package/evals/cases/routing-typo.json +0 -13
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mugiwara-resume
|
|
3
|
-
description: Use when
|
|
3
|
+
description: Use when mission interrupted, context lost, or new session mid-mission — rebuild from .mugiwara/state.json, continue never restart.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Session Resume (Never Start Over)
|
|
@@ -10,47 +10,58 @@ description: Use when a mission is interrupted, context is lost or compacted, or
|
|
|
10
10
|
- Fresh mission: no `.mugiwara/` state exists to rebuild from.
|
|
11
11
|
- No interruption, compaction, or new-session-mid-mission happened.
|
|
12
12
|
|
|
13
|
-
The host AI can lose context — compaction,
|
|
14
|
-
|
|
15
|
-
##
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
13
|
+
The host AI can lose context — compaction, new session, crash. Disk state is truth. Rebuild from one file, continue from exact point, never restart.
|
|
14
|
+
|
|
15
|
+
## State contract
|
|
16
|
+
|
|
17
|
+
Resume reads one file: `.mugiwara/state.json`. All position data is computed at every wave boundary by `scripts/savepoint.sh`.
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"mission": "2026-08-11-invitation-accepted",
|
|
22
|
+
"actor": "farid",
|
|
23
|
+
"branch": "feature/feat-MKR-412",
|
|
24
|
+
"lane": "full",
|
|
25
|
+
"lane_reason": "auth/ path touched",
|
|
26
|
+
"wave": 5,
|
|
27
|
+
"mode": "guided",
|
|
28
|
+
"base_sha": "a3f1c2e",
|
|
29
|
+
"files_touched": 11,
|
|
30
|
+
"loc_delta": 340,
|
|
31
|
+
"sensitive_paths": ["src/auth/invitation.ts"],
|
|
32
|
+
"tasks": { "done": 7, "total": 12 },
|
|
33
|
+
"blockers_open": 1,
|
|
34
|
+
"heal_cycle": 1,
|
|
35
|
+
"tokens_est": 14200,
|
|
36
|
+
"budget": 20000,
|
|
37
|
+
"evidence": [".mugiwara/results/wave4-audit.md"],
|
|
38
|
+
"updated_at": "2026-08-11T12:40:00Z"
|
|
39
|
+
}
|
|
40
|
+
```
|
|
27
41
|
|
|
28
42
|
## Resume protocol
|
|
29
43
|
|
|
30
|
-
Read
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
4. Blocker ledger → open rows (they have owners / are mid-heal).
|
|
36
|
-
5. Config → the mode. Read `.mugiwara/config` (project) then `~/.mugiwara/config` (global) before re-deriving position; missing = `guided`. If a per-mission override row exists in the decision log (`.mugiwara/logs/YYYY-MM-DD-<mission>.md`), that level wins over the config file for this mission.
|
|
37
|
-
6. Re-derive position: wave N, tasks remaining, open blockers, heal counter, and the resumed mode.
|
|
38
|
-
7. State it in one line: "Resumed: Wave 5, tasks 5.3-5.7 pending, 1 blocker (env), heal counter 1, mode semi." Then CONTINUE — do not re-verify completed waves unless the trace shows a failure.
|
|
44
|
+
1. Read `.mugiwara/state.json`. If absent, this is a fresh mission — no resume needed.
|
|
45
|
+
2. Derive position from fields: wave N, tasks done/total, blockers open, heal cycle, mode.
|
|
46
|
+
3. If `state.json` is stale or corrupted, fall back to legacy files: plan doc → todos → trace → blocker ledger → config. Then write a fresh `state.json`.
|
|
47
|
+
4. State it: "Resumed: Wave 5, 7/12 tasks, 1 blocker, heal cycle 1, mode guided."
|
|
48
|
+
5. Continue — do not re-verify completed waves.
|
|
39
49
|
|
|
40
50
|
## Rules
|
|
41
51
|
|
|
42
52
|
1. Never trust memory over disk — disk is truth.
|
|
43
|
-
2. Never re-run completed work —
|
|
53
|
+
2. Never re-run completed work — state.json proves it.
|
|
44
54
|
3. Never skip the resume read — guessing position = drift.
|
|
45
|
-
4. If
|
|
55
|
+
4. If state.json is absent and no legacy files exist → fresh mission, escalate to Luffy.
|
|
46
56
|
|
|
47
|
-
##
|
|
57
|
+
## Rationalizations
|
|
48
58
|
|
|
49
|
-
|
|
59
|
+
- "I remember where we were" → memory lies after compaction; disk is truth.
|
|
60
|
+
- "Re-running is safer" → wastes the mission; trust state.json.
|
|
61
|
+
- "I'll update state later" → savepoint.sh runs at every wave boundary; state is always current.
|
|
50
62
|
|
|
51
|
-
##
|
|
63
|
+
## Red flags
|
|
52
64
|
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
- Red flags: reading any file out of order, re-doing a wave the trace shows complete, skipping the blocker ledger, inventing state instead of escalating, a resume position stated without citing the files.
|
|
65
|
+
- Resume position stated without citing state.json or legacy files.
|
|
66
|
+
- Re-doing a wave state.json shows complete.
|
|
67
|
+
- Inventing state instead of escalating when files are missing.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mugiwara-review
|
|
3
|
-
description: Use after
|
|
3
|
+
description: Use after gates pass to review PR diff, code review — breaking-change map via caller mapping, five-axis review, severity-tagged findings. Max 3 cycles.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Review (Robin)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Five-Axis Review Worksheet
|
|
2
|
+
|
|
3
|
+
One verdict + evidence per axis. No axis passes on assertion.
|
|
4
|
+
|
|
5
|
+
## Axes
|
|
6
|
+
|
|
7
|
+
| Axis | Question | Evidence required |
|
|
8
|
+
|------|----------|-------------------|
|
|
9
|
+
| Correctness | Does the change break anything that currently works? | Re-run caller tests, verify edge cases |
|
|
10
|
+
| Readability | Can a new team member understand the diff in 5 minutes? | Naming convention check, function length, comment quality |
|
|
11
|
+
| Architecture | Does the change fit the existing system structure? | No parallel patterns, no new abstraction without need |
|
|
12
|
+
| Security | Any security regression or new attack surface? | STRIDE on changed surface, checklist pass |
|
|
13
|
+
| Performance | Any N+1, O(n²), or unbounded resource use introduced? | Profiler output or manual analysis of hot path |
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
Axis: Correctness
|
|
19
|
+
Verdict: PASS
|
|
20
|
+
Evidence: npm test -- --shard=1/2 passes (312 tests), caller grep confirms all
|
|
21
|
+
imports of renamed function updated
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
Axis: Security
|
|
26
|
+
Verdict: FAIL
|
|
27
|
+
Evidence: New endpoint POST /api/export has no authz middleware. Missing rate
|
|
28
|
+
limit on file generation (DoS risk).
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Rules
|
|
32
|
+
|
|
33
|
+
- One verdict per axis. "Partial pass" = FAIL.
|
|
34
|
+
- Evidence is command output or file path, never a paraphrase.
|
|
35
|
+
- FAIL on any axis → overall review FAIL → Brook (Wave 8).
|
|
36
|
+
- PASS on all 5 → forward to closure.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Severity Rubric
|
|
2
|
+
|
|
3
|
+
For review findings. Every finding gets a severity backed by criteria.
|
|
4
|
+
|
|
5
|
+
| Severity | Definition | Examples | Action |
|
|
6
|
+
|----------|-----------|----------|--------|
|
|
7
|
+
| **blocker** | public-break with no migration path, wrong behavior shipped, security hole | renamed public API with callers unfixed, authz bypass, data loss | Fix before merge |
|
|
8
|
+
| **major** | internal-break with callers unfixed, missed contract, behavior change outside declared scope | changed function signature, missing error handling, N+1 in hot path | Fix this mission |
|
|
9
|
+
| **minor** | polish, style drift, batched items | inconsistent naming, missing test for edge case, duplicated 3-line helper | May batch with Brook |
|
|
10
|
+
|
|
11
|
+
## CVSS-style for security
|
|
12
|
+
|
|
13
|
+
| Severity | Exploitability × Impact |
|
|
14
|
+
|----------|------------------------|
|
|
15
|
+
| Critical | Reachable + tooling exists + pre-auth → data loss/auth bypass/RCE |
|
|
16
|
+
| High | Reachable + limited tooling → PII leak, privilege escalation |
|
|
17
|
+
| Medium | Requires auth/conditions → partial exposure |
|
|
18
|
+
| Low | Defense-in-depth gaps, no known exploit path |
|
|
19
|
+
|
|
20
|
+
Security findings are never "minor by default." Every finding gets the matrix.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: mugiwara-
|
|
3
|
-
description: Use
|
|
2
|
+
name: mugiwara-root-cause
|
|
3
|
+
description: Use for debugging bugs — debug, bug, crash, error, recurring, intermittent, track it down. 4-phase: reproduce, localize, reduce, fix+guard. Root cause hunt.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Systematic Debugging
|
|
@@ -16,6 +16,8 @@ A failure is a stopping event, not a speed bump. Do not guess, do not patch. Wal
|
|
|
16
16
|
|
|
17
17
|
Any bug, unexplained failure, crash, or regression in code, tests, or config. When the cause is unknown, the fix is not obvious, or the failure is intermittent. Standalone discipline — use it before any fix ships, and escalate when a phase cannot complete.
|
|
18
18
|
|
|
19
|
+
Framework code from docs, not memory: `references/source-grounding.md`.
|
|
20
|
+
|
|
19
21
|
## Process
|
|
20
22
|
|
|
21
23
|
### Phase 1 — Reproduce
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Four-Phase Debugging — Worked Example
|
|
2
|
+
|
|
3
|
+
A real bug traced end to end through reproduce → localize → reduce → fix + guard.
|
|
4
|
+
|
|
5
|
+
## The bug report
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
Title: Users see "null" instead of display name on profile page
|
|
9
|
+
Severity: medium
|
|
10
|
+
Reported: Aug 2026
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Phase 1 — Reproduce
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Create user with no displayName
|
|
17
|
+
$ curl -X POST /api/users -d '{"email":"test@ex.com"}'
|
|
18
|
+
{"id": "u_42", "email": "test@ex.com"}
|
|
19
|
+
|
|
20
|
+
# Fetch profile
|
|
21
|
+
$ curl /api/users/u_42
|
|
22
|
+
{"id": "u_42", "displayName": "null", "email": "test@ex.com"}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Expected: `displayName` should be `null` (JSON null) or omitted, not string `"null"`.
|
|
26
|
+
|
|
27
|
+
## Phase 2 — Localize
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
$ git grep -n 'displayName' src/
|
|
31
|
+
src/models/user.ts:12: displayName?: string | null;
|
|
32
|
+
src/services/user-profile.ts:34: return user.displayName ?? 'null';
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Bug at `src/services/user-profile.ts:34`: `?? 'null'` is the string `"null"`, not the JavaScript `null` value. The default should be `null` or `undefined`.
|
|
36
|
+
|
|
37
|
+
## Phase 3 — Reduce
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
// Before (broken):
|
|
41
|
+
return user.displayName ?? 'null'; // string "null"!
|
|
42
|
+
|
|
43
|
+
// Minimal reproduction:
|
|
44
|
+
const result = undefined ?? 'null'; // "null" — this is a string
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The `??` operator returns the right operand only when the left is `null`/`undefined`. But `'null'` is a truthy string — it's never the `null` value.
|
|
48
|
+
|
|
49
|
+
## Phase 4 — Fix + Guard
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
// Fix:
|
|
53
|
+
return user.displayName ?? null; // JSON null
|
|
54
|
+
|
|
55
|
+
// Guard test:
|
|
56
|
+
it('returns null for missing displayName, not string "null"', () => {
|
|
57
|
+
const user = { id: 'u_42', email: 'test@ex.com' };
|
|
58
|
+
const profile = buildProfile(user);
|
|
59
|
+
expect(profile.displayName).toBeNull(); // was: toBe('null')
|
|
60
|
+
});
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
$ npm test -- user-profile.test.ts
|
|
65
|
+
PASS user-profile.test.ts
|
|
66
|
+
✓ returns null for missing displayName, not string "null"
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Lesson
|
|
70
|
+
|
|
71
|
+
String `"null"` ≠ JavaScript `null`. The `??` operator with a string default is almost always a bug. Grep the codebase: `git grep "?? '"` to find similar patterns.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mugiwara-security
|
|
3
|
-
description: Use for
|
|
3
|
+
description: Use for security audit of a diff — STRIDE, OWASP Top 10, secrets, injection, authn/authz, authorization, RBAC, roles, permissions, dependency audit. Findings to .mugiwara/review/.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Security (Jinbe)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# OWASP Top 10 Mapping
|
|
2
|
+
|
|
3
|
+
Required when the project handles payments, health data, or PII.
|
|
4
|
+
|
|
5
|
+
| Code | Category | Review area |
|
|
6
|
+
|------|----------|-------------|
|
|
7
|
+
| A01 | Broken access control | authz gaps, IDOR, missing server-side checks |
|
|
8
|
+
| A02 | Cryptographic failures | PII in transit/at rest, weak crypto, exposed secrets |
|
|
9
|
+
| A03 | Injection | SQL/NoSQL/OS/template injection, unsanitized input to exec/render |
|
|
10
|
+
| A04 | Insecure design | missing threat model, trust-boundary failures |
|
|
11
|
+
| A05 | Misconfiguration | default creds, verbose errors, permissive headers, debug on |
|
|
12
|
+
| A06 | Vulnerable components | dependency audit, known-vuln check, outdated libs |
|
|
13
|
+
| A07 | Authn failures | broken sessions, brute-forceable login, credential reuse |
|
|
14
|
+
| A08 | Integrity | insecure deserialization, supply-chain tamper |
|
|
15
|
+
| A09 | Logging/monitoring | PII in logs, missing audit trail, silent failures |
|
|
16
|
+
| A10 | SSRF | server-side requests to attacker-controlled targets, URL validation |
|
|
17
|
+
|
|
18
|
+
## How to map
|
|
19
|
+
|
|
20
|
+
For each security check run, record which OWASP category it covers. A handled
|
|
21
|
+
category with no mapping row = documentation gap in the security report.
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
| OWASP | Check | Verdict |
|
|
25
|
+
|-------|-------|---------|
|
|
26
|
+
| A01 | Authz on /api/admin routes | PASS |
|
|
27
|
+
| A02 | TLS enforced, no hardcoded secrets | PASS |
|
|
28
|
+
| A03 | SQL params in user query handler | PASS |
|
|
29
|
+
| A06 | npm audit: 0 critical/high | PASS |
|
|
30
|
+
```
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# STRIDE Worksheet
|
|
2
|
+
|
|
3
|
+
Map every application surface to STRIDE before running security checks.
|
|
4
|
+
|
|
5
|
+
## Surface inventory
|
|
6
|
+
|
|
7
|
+
List every surface where data, requests, or state cross trust levels:
|
|
8
|
+
|
|
9
|
+
- HTTP endpoints (REST, GraphQL, gRPC)
|
|
10
|
+
- CLI arguments and environment variables
|
|
11
|
+
- File uploads, database reads/writes
|
|
12
|
+
- External API calls, webhooks
|
|
13
|
+
- Rendered output (HTML, JSON, logs)
|
|
14
|
+
- Config files, secret stores
|
|
15
|
+
|
|
16
|
+
## STRIDE per surface
|
|
17
|
+
|
|
18
|
+
| STRIDE | Ask of each surface |
|
|
19
|
+
|--------|---------------------|
|
|
20
|
+
| Spoofing | Can an identity be forged or impersonated? |
|
|
21
|
+
| Tampering | Can data in transit or at rest be altered undetected? |
|
|
22
|
+
| Repudiation | Can an action occur without a traceable actor? |
|
|
23
|
+
| Info disclosure | Can data leak to an unintended party? |
|
|
24
|
+
| DoS | Can the surface be exhausted or taken down? |
|
|
25
|
+
| Elevation | Can a caller gain privileges beyond their grant? |
|
|
26
|
+
|
|
27
|
+
## Example
|
|
28
|
+
|
|
29
|
+
| Surface | S | T | R | I | D | E | Notes |
|
|
30
|
+
|---------|---|---|---|---|---|---|-------|
|
|
31
|
+
| POST /api/invite | ✅ | ✅ | — | ⚠️ | — | ✅ | Email exposed in error response |
|
|
32
|
+
| GET /api/users/:id | ✅ | — | — | ⚠️ | — | ✅ | IDOR: no ownership check |
|
|
33
|
+
| config upload | — | ✅ | — | — | — | — | YAML parsing, no schema validation |
|
|
34
|
+
|
|
35
|
+
✅ = threat present, ⚠️ = partial mitigation, — = not applicable
|
|
36
|
+
|
|
37
|
+
A surface with no STRIDE row is a modeling gap, not a safe surface.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mugiwara-ship
|
|
3
|
-
description: Use at mission end
|
|
3
|
+
description: Use at mission end — pre-launch checklist, feature flags, staged rollout, mandatory rollback plan. Binary GO/NO-GO.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Ship Gate (Luffy, Franky)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: mugiwara-
|
|
3
|
-
description: Use when
|
|
2
|
+
name: mugiwara-sunset
|
|
3
|
+
description: Use when removing, deleting, deprecating old code, legacy APIs, v1 endpoints — keep-or-retire gate, safe DB migrations, phased cutovers. Every removal needs a plan.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Deprecation & Migration (Brook)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mugiwara-testcases
|
|
3
|
-
description: Use when
|
|
3
|
+
description: Use when mission declares user test cases, e2e, playwright, cypress, integration tests — intake formats, immutable-gold rule, consent, failure adjudication.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Test Cases (ATDD Contract)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Test Intake Formats
|
|
2
|
+
|
|
3
|
+
Single home for the ATDD contract. Referenced by `mugiwara-quality` and `mugiwara-gates`.
|
|
4
|
+
|
|
5
|
+
## Format 1: Executable tests (user test files)
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
Path: tests/acceptance/invitation-flow.test.ts
|
|
9
|
+
Type: integration
|
|
10
|
+
Commands: npm run test:acceptance -- invitation-flow
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Imported as immutable gold. Never edit, never skip. Run failing first, green at end.
|
|
14
|
+
|
|
15
|
+
## Format 2: Declarative acceptance (Gherkin/markdown AC)
|
|
16
|
+
|
|
17
|
+
```gherkin
|
|
18
|
+
Feature: Invitation flow
|
|
19
|
+
Scenario: User accepts invitation
|
|
20
|
+
Given an invitation exists for "user@example.com"
|
|
21
|
+
When the user clicks the invitation link
|
|
22
|
+
Then the user is redirected to onboarding
|
|
23
|
+
And the invitation status changes to "accepted"
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The crew translates this to a project test file. Write the test, watch it fail, implement, re-run green.
|
|
27
|
+
|
|
28
|
+
## Format 3: Command-verifiable
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
Acceptance: curl -X POST /api/invite -d '{"email":"test@ex.com"}' | jq .status
|
|
32
|
+
Expected: "sent"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Run directly. No translation needed.
|
|
36
|
+
|
|
37
|
+
## Rules
|
|
38
|
+
|
|
39
|
+
- No declared test source → no user tests for the mission.
|
|
40
|
+
- Executable user tests = immutable gold. Change requires user consent + ledger row.
|
|
41
|
+
- Declarative AC tests are model-written → extra Chopper scrutiny (can encode the bug).
|
|
42
|
+
- Cross-cutting user ACs (e2e flow spanning tasks) → plan-level criteria, re-run at checkpoint against whole diff.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mugiwara-workflow
|
|
3
|
-
description: Use at
|
|
3
|
+
description: Use at start of any non-trivial mission — Luffy triage gateway, full pipeline: brainstorm/plan/execute/checkpoint/quality/gates/review/heal/closure waves.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Mugiwara Workflow
|
|
@@ -36,9 +36,11 @@ Every mission creates and works inside `.mugiwara/` at the repo root:
|
|
|
36
36
|
```
|
|
37
37
|
.mugiwara/
|
|
38
38
|
├── config # runtime mode config: mode/branch/commit/pr key=value (gitignored; project overrides global)
|
|
39
|
+
├── state.json # computed mission state at every wave boundary (scripts/savepoint.sh)
|
|
39
40
|
├── spec/ # brainstorm output: YYYY-MM-DD-<mission>.md
|
|
40
|
-
├── plans/ # plan doc: YYYY-MM-DD-<mission>.md — CLEAN, Nami-only, source of truth from Wave 2
|
|
41
|
+
├── plans/ # plan doc: YYYY-MM-DD-<mission>.md — CLEAN, Nami-only, source of truth from Wave 2
|
|
41
42
|
├── results/ # wave results: audit/quality/gate reports, todos, closure report
|
|
43
|
+
├── reports/ # human-readable mission reports: YYYY-MM-DD-<mission>.md
|
|
42
44
|
├── review/ # review + security findings
|
|
43
45
|
├── issues/ # blocker log: YYYY-MM-DD-<mission>-blockers.md
|
|
44
46
|
└── logs/ # Luffy's decision + check-in log: YYYY-MM-DD-<mission>.md (deleted at cleanup)
|
|
@@ -58,7 +60,7 @@ At session start, after context loss, or on any "where were we?" — embody `res
|
|
|
58
60
|
|
|
59
61
|
Front door: embody `using-mugiwara` inline (the router) — it routes to the right crew member and records the route. For a full triage embody `luffy-orchestrator` inline. NEVER start directly with brainstorming or planning. Luffy classifies every request 5 ways (Trivial / Explicit / Exploratory / Open-ended / Ambiguous) and routes: Trivial and Explicit → Wave 2 directly; Exploratory, Open-ended, and Ambiguous → Wave 1 brainstorm first. Alongside the class, Luffy sizes the mission and picks a lane (0 Direct / 1 Lean / 2 Standard / 3 Full / 4 Spike) — small work skips the pipeline, sensitive work never sneaks through the lean path. The user may summon any crew member directly — Luffy still records the route.
|
|
60
62
|
|
|
61
|
-
Alongside triage, read the mode config per
|
|
63
|
+
Alongside triage, read the mode config per mode config: `.mugiwara/config` (project) then `~/.mugiwara/config` (global); a key missing from both = `guided`. Lazy-create the project config on first WRITE only, never auto-create on read.
|
|
62
64
|
|
|
63
65
|
## Waves
|
|
64
66
|
|
|
@@ -69,7 +71,7 @@ Alongside triage, read the mode config per `mugiwara-mode`: `.mugiwara/config` (
|
|
|
69
71
|
| 2 Planning | Nami | mugiwara-planning | plan doc: waves/tasks/criteria, parallel markers |
|
|
70
72
|
| 3 Execution | Zoro | mugiwara-execution | implemented tasks with evidence |
|
|
71
73
|
| 4 Checkpoint | Chopper | mugiwara-checkpoint | audit report + failure ledger |
|
|
72
|
-
| 4.5 Adversarial | Skeptic | mugiwara-
|
|
74
|
+
| 4.5 Adversarial | Skeptic | mugiwara-claim-audit | findings report + failure ledger |
|
|
73
75
|
| 5 Quality | Sanji | mugiwara-quality | formatter/linter/test results |
|
|
74
76
|
| 6 Gates | Franky | mugiwara-gates | coverage + build verdict |
|
|
75
77
|
| 7 Review | Robin ∥ Jinbe | mugiwara-review + mugiwara-security | severity-tagged findings |
|
|
@@ -88,7 +90,7 @@ Never silently work around a blocker. Brook reads this ledger at Wave 8 to decid
|
|
|
88
90
|
|
|
89
91
|
## Cleanup
|
|
90
92
|
|
|
91
|
-
At closure (Wave 9), after the terminal step, run
|
|
93
|
+
At closure (Wave 9), after the terminal step, run cleanup per `mugiwara-ship`: delete consumed intermediates — superseded results, review, issues, the decision log in `logs/`, and consumed spec. Keep the plan doc, closure report, PR verdict, mission report, `config`, `state.json`, and cross-mission state (`logs/lessons.md`, `backup/`, `manifest.json`). List candidates before deleting.
|
|
92
94
|
|
|
93
95
|
## Rules
|
|
94
96
|
|
|
@@ -96,29 +98,24 @@ At closure (Wave 9), after the terminal step, run the cleanup procedure in `mugi
|
|
|
96
98
|
2. No wave skipped without the reason recorded in the decision log (`.mugiwara/logs/`) — name the wave, owner, and reason at the moment of omission.
|
|
97
99
|
3. Heal loop is bounded: Wave 8 → Wave 4, max 3 cycles. After that, escalate to the human with full history.
|
|
98
100
|
4. Any agent may consult Luffy mid-flight (embody `luffy-orchestrator` inline) for decisions and escalations.
|
|
99
|
-
5. Wave 7 runs Robin and Jinbe
|
|
100
|
-
6. The plan doc
|
|
101
|
-
7. Frontend
|
|
102
|
-
8.
|
|
103
|
-
9.
|
|
104
|
-
10. The crew never merges and never deploys — push the branch + hand the verdict file to the user, who opens the PR; PR review is the terminal gate in every mode.
|
|
101
|
+
5. Wave 7 runs Robin and Jinbe in parallel over the same diff.
|
|
102
|
+
6. The plan doc is the single source of truth from Wave 2 onward.
|
|
103
|
+
7. Frontend tasks in Wave 3 must apply `mugiwara-frontend`.
|
|
104
|
+
8. On session start or context loss — resume via `resume-coordinator` before any wave; never start over.
|
|
105
|
+
9. Push branch + hand verdict file to the user, who opens the PR; crew never merges, never deploys.
|
|
105
106
|
|
|
106
107
|
## Iron Law
|
|
107
108
|
|
|
108
|
-
EVIDENCE OVER CLAIMS. No wave passes on assertion — the owning agent runs the checks and shows output.
|
|
109
|
-
|
|
110
|
-
## Verification gate (every completion claim)
|
|
111
|
-
|
|
112
|
-
A claim is only as strong as the evidence produced in the same turn that made it. "Done", "passes", and "fixed" each name a command that would prove them — run that command, read its full output, then speak. A result from an earlier run, a guess, or a worker's word for it is not proof; re-run it and diff the work against the tree before reporting. Trust is not a substitute for verification.
|
|
109
|
+
EVIDENCE OVER CLAIMS. No wave passes on assertion — the owning agent runs the checks and shows output. "Done", "passes", and "fixed" must be proved by running the check command in the same turn; no stale results, no guesses, no worker's word for it.
|
|
113
110
|
|
|
114
111
|
## Red flags
|
|
115
112
|
|
|
116
|
-
- A wave
|
|
113
|
+
- A wave passes on a spoken claim with no command output.
|
|
117
114
|
- Heal loop beyond 3 cycles with the same failure still open.
|
|
118
|
-
-
|
|
119
|
-
- Execution
|
|
120
|
-
- Mission artifacts
|
|
121
|
-
- Wave order drifts
|
|
122
|
-
-
|
|
115
|
+
- Wave skipped with no reason recorded in the decision log.
|
|
116
|
+
- Execution before triage (Wave 0).
|
|
117
|
+
- Mission artifacts outside `.mugiwara/`.
|
|
118
|
+
- Wave order drifts (e.g. quality before checkpoint).
|
|
119
|
+
- Blocker worked around silently with no ledger row.
|
|
123
120
|
|
|
124
|
-
All mean: stop
|
|
121
|
+
All mean: stop, diagnose with Chopper's ledger, decide continue/retry/escalate.
|
package/dist/mugiwara.js
CHANGED
|
@@ -494,21 +494,45 @@ function writeManifest(file, data) {
|
|
|
494
494
|
}
|
|
495
495
|
|
|
496
496
|
// src/mission.ts
|
|
497
|
-
import { existsSync as existsSync5, rmSync as rmSync2 } from "node:fs";
|
|
497
|
+
import { existsSync as existsSync5, rmSync as rmSync2, readFileSync as readFileSync4 } from "node:fs";
|
|
498
498
|
import { join as join7 } from "node:path";
|
|
499
|
-
function
|
|
499
|
+
function activeActor(projectDir) {
|
|
500
|
+
const stateFile = join7(projectDir, ".mugiwara", "state.json");
|
|
501
|
+
if (!existsSync5(stateFile))
|
|
502
|
+
return null;
|
|
503
|
+
try {
|
|
504
|
+
const state = JSON.parse(readFileSync4(stateFile, "utf8"));
|
|
505
|
+
return state.actor || null;
|
|
506
|
+
} catch {
|
|
507
|
+
return null;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
function resetMission(projectDir, keepLogs, force) {
|
|
500
511
|
const root = join7(projectDir, ".mugiwara");
|
|
501
512
|
if (!existsSync5(root))
|
|
502
513
|
return { removed: [], kept: [] };
|
|
514
|
+
if (!force) {
|
|
515
|
+
const actor = activeActor(projectDir);
|
|
516
|
+
if (actor) {
|
|
517
|
+
return { removed: [], kept: [], blocked: `Active mission for '${actor}'. Use --force to override.` };
|
|
518
|
+
}
|
|
519
|
+
}
|
|
503
520
|
const removed = [];
|
|
504
521
|
const kept = [];
|
|
505
|
-
for (const dir of ["spec", "plans", "results", "review", "issues"]) {
|
|
522
|
+
for (const dir of ["spec", "plans", "results", "review", "issues", "reports"]) {
|
|
506
523
|
const p = join7(root, dir);
|
|
507
524
|
if (existsSync5(p)) {
|
|
508
525
|
rmSync2(p, { recursive: true, force: true });
|
|
509
526
|
removed.push(dir);
|
|
510
527
|
}
|
|
511
528
|
}
|
|
529
|
+
for (const f of ["state.json"]) {
|
|
530
|
+
const p = join7(root, f);
|
|
531
|
+
if (existsSync5(p)) {
|
|
532
|
+
rmSync2(p);
|
|
533
|
+
removed.push(f);
|
|
534
|
+
}
|
|
535
|
+
}
|
|
512
536
|
if (!keepLogs) {
|
|
513
537
|
const p = join7(root, "logs");
|
|
514
538
|
if (existsSync5(p)) {
|
|
@@ -553,13 +577,18 @@ async function run(argv) {
|
|
|
553
577
|
}
|
|
554
578
|
function resetCmd(flags) {
|
|
555
579
|
const projectDir = resolve(str(flags.project) ?? process.cwd());
|
|
556
|
-
const
|
|
557
|
-
|
|
558
|
-
|
|
580
|
+
const force = flag(flags.force);
|
|
581
|
+
const result = resetMission(projectDir, flag(flags.keepLogs), force);
|
|
582
|
+
if (result.blocked) {
|
|
583
|
+
console.error(`✗ ${result.blocked}`);
|
|
584
|
+
process.exit(1);
|
|
585
|
+
}
|
|
586
|
+
if (result.removed.length)
|
|
587
|
+
console.log(`removed: ${result.removed.join(", ")}`);
|
|
559
588
|
else
|
|
560
589
|
console.log("nothing to remove.");
|
|
561
|
-
if (kept.length)
|
|
562
|
-
console.log(`kept: ${kept.join(", ")}`);
|
|
590
|
+
if (result.kept.length)
|
|
591
|
+
console.log(`kept: ${result.kept.join(", ")}`);
|
|
563
592
|
}
|
|
564
593
|
async function resolveOptions(flags) {
|
|
565
594
|
const interactive = !flag(flags.yes);
|
package/docs/agents.md
CHANGED
|
@@ -44,8 +44,8 @@ check-ins. The harness stays coherent either way.
|
|
|
44
44
|
|
|
45
45
|
## The crew ships whole
|
|
46
46
|
|
|
47
|
-
Every install gets all 15 agents and all
|
|
47
|
+
Every install gets all 15 agents and all 26 skills. No project-type selection —
|
|
48
48
|
the harness routes each task to the right specialist.
|
|
49
49
|
|
|
50
|
-
See [skills.md](skills.md) for the
|
|
50
|
+
See [skills.md](skills.md) for the 26 techniques, or
|
|
51
51
|
[workflow.md](workflow.md) for the pipeline.
|