@ionivetech/mugiwara 0.5.3 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +2 -2
- package/.codex-plugin/plugin.json +2 -2
- package/.cursor-plugin/plugin.json +2 -2
- package/.kimi-plugin/plugin.json +2 -2
- package/.opencode/plugins/mugiwara.mjs +2 -1
- package/AGENTS.md +1 -1
- package/README.md +155 -263
- package/content/agents/zoro-execution.md +1 -2
- package/content/skills/using-mugiwara/SKILL.md +1 -1
- package/dist/mugiwara.js +113 -60
- package/docs/{modes.md → concepts/modes.md} +1 -2
- package/docs/{skills.md → concepts/skills.md} +1 -1
- package/docs/getting-started.md +8 -8
- package/docs/index.md +22 -22
- package/docs/{install-antigravity.md → install/antigravity.md} +1 -1
- package/docs/{install-claude.md → install/claude.md} +4 -2
- package/docs/{install-cli.md → install/cli.md} +19 -7
- package/docs/{install-codex.md → install/codex.md} +1 -1
- package/docs/{install-copilot.md → install/copilot.md} +1 -1
- package/docs/{install-cursor.md → install/cursor.md} +1 -1
- package/docs/{install-gemini.md → install/gemini.md} +1 -1
- package/docs/{install.md → install/index.md} +11 -11
- package/docs/{install-kimi.md → install/kimi.md} +1 -1
- package/docs/{install-opencode.md → install/opencode.md} +20 -6
- package/docs/{install-pi.md → install/pi.md} +1 -1
- package/docs/{adoption-guide.md → reference/adoption-guide.md} +2 -2
- package/docs/{harness-matrix.md → reference/harness-matrix.md} +2 -2
- package/gemini-extension.json +1 -1
- package/package.json +2 -2
- package/plugin.json +2 -2
- package/scripts/evidence.sh +1 -1
- package/scripts/mission-report.sh +60 -73
- package/scripts/retrieval-eval.ts +1 -2
- package/scripts/run-evals.ts +1 -1
- package/scripts/savepoint.sh +1 -1
- package/scripts/validate-content.ts +7 -7
- package/src/args.ts +1 -1
- package/src/cli.ts +49 -22
- package/src/frontmatter.ts +3 -3
- package/src/installer.ts +10 -8
- package/src/targets/opencode.ts +22 -1
- package/docs/claude-setup.md +0 -43
- package/docs/codex-setup.md +0 -26
- package/docs/copilot-setup.md +0 -29
- package/docs/cursor-setup.md +0 -25
- package/docs/gemini-setup.md +0 -27
- package/docs/opencode-setup.md +0 -54
- package/docs/rule-based-setup.md +0 -31
- package/docs/windsurf-setup.md +0 -18
- /package/.opencode/{plugins/mugiwara-helpers.mjs → mugiwara-helpers.mjs} +0 -0
- /package/docs/{agents.md → concepts/agents.md} +0 -0
- /package/docs/{audit-trail.md → concepts/audit-trail.md} +0 -0
- /package/docs/{comparison.md → concepts/comparison.md} +0 -0
- /package/docs/{config.md → concepts/config.md} +0 -0
- /package/docs/{cost.md → concepts/cost.md} +0 -0
- /package/docs/{execution-model.md → concepts/execution-model.md} +0 -0
- /package/docs/{git-strategy.md → concepts/git-strategy.md} +0 -0
- /package/docs/{lanes.md → concepts/lanes.md} +0 -0
- /package/docs/{pr-summary.md → concepts/pr-summary.md} +0 -0
- /package/docs/{workflow.md → concepts/workflow.md} +0 -0
- /package/docs/{agent-anatomy.md → reference/agent-anatomy.md} +0 -0
- /package/docs/{compliance-matrix.md → reference/compliance-matrix.md} +0 -0
- /package/docs/{developer-onboarding.md → reference/developer-onboarding.md} +0 -0
- /package/docs/{enforcement.md → reference/enforcement.md} +0 -0
- /package/docs/{skill-anatomy.md → reference/skill-anatomy.md} +0 -0
package/dist/mugiwara.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/cli.ts
|
|
4
|
-
import { existsSync as
|
|
4
|
+
import { existsSync as existsSync7, readdirSync as readdirSync3, rmSync as rmSync3 } from "node:fs";
|
|
5
5
|
import { homedir as homedir2 } from "node:os";
|
|
6
|
-
import { resolve } from "node:path";
|
|
7
|
-
import {
|
|
6
|
+
import { join as join8, resolve } from "node:path";
|
|
7
|
+
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
8
8
|
|
|
9
9
|
// src/args.ts
|
|
10
10
|
var VALUE_FLAGS = { "--project": "project", "--target": "target" };
|
|
@@ -15,6 +15,7 @@ var BOOL_FLAGS = {
|
|
|
15
15
|
"--force": "force",
|
|
16
16
|
"--dry-run": "dryRun",
|
|
17
17
|
"--keep-logs": "keepLogs",
|
|
18
|
+
"--check": "check",
|
|
18
19
|
"--help": "help",
|
|
19
20
|
"-h": "help",
|
|
20
21
|
"--version": "version",
|
|
@@ -93,10 +94,10 @@ function parseFrontmatter(text) {
|
|
|
93
94
|
for (const line of m[1].split(/\r?\n/)) {
|
|
94
95
|
if (!line.trim())
|
|
95
96
|
continue;
|
|
96
|
-
const i = line.indexOf(":");
|
|
97
|
+
const i = line.indexOf(": ");
|
|
97
98
|
if (i === -1)
|
|
98
|
-
throw new Error(`Bad frontmatter line: ${line}`);
|
|
99
|
-
data[line.slice(0, i).trim()] = line.slice(i +
|
|
99
|
+
throw new Error(`Bad frontmatter line (missing ': ' separator): ${line}`);
|
|
100
|
+
data[line.slice(0, i).trim()] = line.slice(i + 2).trim();
|
|
100
101
|
}
|
|
101
102
|
return { data, body: text.slice(m[0].length) };
|
|
102
103
|
}
|
|
@@ -151,7 +152,11 @@ var target = {
|
|
|
151
152
|
};
|
|
152
153
|
|
|
153
154
|
// src/targets/opencode.ts
|
|
154
|
-
import {
|
|
155
|
+
import { existsSync as existsSync2, readdirSync, copyFileSync as copyFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
156
|
+
import { dirname as dirname2, join as join2 } from "node:path";
|
|
157
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
158
|
+
var here2 = dirname2(fileURLToPath2(import.meta.url));
|
|
159
|
+
var COMMANDS_SRC = join2(here2, "..", "..", ".opencode", "commands");
|
|
155
160
|
var CREW = {
|
|
156
161
|
"luffy-orchestrator": { color: "#ef4444", temperature: 0.2, steps: 15 },
|
|
157
162
|
"usopp-brainstorm": { color: "#f59e0b", temperature: 0.6, steps: 15 },
|
|
@@ -206,6 +211,25 @@ ${body}` };
|
|
|
206
211
|
refsDir({ scope, projectDir, home }, skillName) {
|
|
207
212
|
const root = scope === "global" ? join2(home, ".config", "opencode") : join2(projectDir, ".opencode");
|
|
208
213
|
return join2(root, "skills", skillName, "references");
|
|
214
|
+
},
|
|
215
|
+
postInstall({ scope, projectDir, home, dryRun }) {
|
|
216
|
+
const root = scope === "global" ? join2(home, ".config", "opencode") : join2(projectDir, ".opencode");
|
|
217
|
+
const dstDir = join2(root, "commands");
|
|
218
|
+
if (dryRun)
|
|
219
|
+
return { written: [], notes: [] };
|
|
220
|
+
if (!existsSync2(COMMANDS_SRC))
|
|
221
|
+
return { written: [], notes: [] };
|
|
222
|
+
mkdirSync2(dstDir, { recursive: true });
|
|
223
|
+
const written = [];
|
|
224
|
+
for (const f of readdirSync(COMMANDS_SRC)) {
|
|
225
|
+
if (!f.endsWith(".md"))
|
|
226
|
+
continue;
|
|
227
|
+
const src = join2(COMMANDS_SRC, f);
|
|
228
|
+
const dst = join2(dstDir, f);
|
|
229
|
+
copyFileSync2(src, dst);
|
|
230
|
+
written.push(dst);
|
|
231
|
+
}
|
|
232
|
+
return { written, notes: [] };
|
|
209
233
|
}
|
|
210
234
|
};
|
|
211
235
|
|
|
@@ -237,7 +261,7 @@ var target3 = {
|
|
|
237
261
|
};
|
|
238
262
|
|
|
239
263
|
// src/targets/generic.ts
|
|
240
|
-
import { existsSync as
|
|
264
|
+
import { existsSync as existsSync3, writeFileSync } from "node:fs";
|
|
241
265
|
import { join as join4 } from "node:path";
|
|
242
266
|
function makeGeneric(opts) {
|
|
243
267
|
const { id, label, rulesDir, bootstrapFile, bootstrapPointer, tier = bootstrapPointer ? 2 : 3 } = opts;
|
|
@@ -320,7 +344,7 @@ ${body}` };
|
|
|
320
344
|
const notes = [];
|
|
321
345
|
const written = [];
|
|
322
346
|
const file = join4(projectDir, bootstrapFile);
|
|
323
|
-
if (!
|
|
347
|
+
if (!existsSync3(file)) {
|
|
324
348
|
if (!dryRun)
|
|
325
349
|
writeFileSync(file, `${bootstrapPointer}
|
|
326
350
|
`);
|
|
@@ -397,19 +421,20 @@ var targets = { claude: target, opencode: target2, copilot: target3, gemini: tar
|
|
|
397
421
|
var TARGET_IDS = Object.keys(targets);
|
|
398
422
|
|
|
399
423
|
// src/installer.ts
|
|
400
|
-
import { existsSync as
|
|
401
|
-
import { dirname as
|
|
424
|
+
import { existsSync as existsSync4, mkdirSync as mkdirSync3, readFileSync as readFileSync2, readdirSync as readdirSync2, writeFileSync as writeFileSync2, copyFileSync as copyFileSync3, rmSync } from "node:fs";
|
|
425
|
+
import { dirname as dirname3, join as join5 } from "node:path";
|
|
402
426
|
import { homedir } from "node:os";
|
|
403
|
-
|
|
404
|
-
var
|
|
427
|
+
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
428
|
+
var CONTENT_DIR = join5(dirname3(fileURLToPath3(import.meta.url)), "..", "content");
|
|
429
|
+
var pkg = JSON.parse(readFileSync2(join5(dirname3(fileURLToPath3(import.meta.url)), "..", "package.json"), "utf8"));
|
|
405
430
|
var VERSION = pkg.version;
|
|
406
431
|
function collectContent() {
|
|
407
|
-
const skillNames =
|
|
432
|
+
const skillNames = readdirSync2(join5(CONTENT_DIR, "skills"), { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => e.name);
|
|
408
433
|
const skills = skillNames.map((name) => {
|
|
409
434
|
const { data, body } = parseFrontmatter(readFileSync2(join5(CONTENT_DIR, "skills", name, "SKILL.md"), "utf8"));
|
|
410
435
|
return { name, data, body, refs: collectRefs(join5(CONTENT_DIR, "skills", name)) };
|
|
411
436
|
});
|
|
412
|
-
const agents =
|
|
437
|
+
const agents = readdirSync2(join5(CONTENT_DIR, "agents")).filter((f) => f.endsWith(".md")).map((f) => {
|
|
413
438
|
const { data, body } = parseFrontmatter(readFileSync2(join5(CONTENT_DIR, "agents", f), "utf8"));
|
|
414
439
|
return { name: f.replace(/\.md$/, ""), data, body, refs: [] };
|
|
415
440
|
});
|
|
@@ -417,9 +442,9 @@ function collectContent() {
|
|
|
417
442
|
}
|
|
418
443
|
function collectRefs(skillDir) {
|
|
419
444
|
const refsDir = join5(skillDir, "references");
|
|
420
|
-
if (!
|
|
445
|
+
if (!existsSync4(refsDir))
|
|
421
446
|
return [];
|
|
422
|
-
return
|
|
447
|
+
return readdirSync2(refsDir, { recursive: true }).map((f) => String(f)).filter((f) => f.endsWith(".md")).map((rel) => ({ relPath: rel, text: readFileSync2(join5(refsDir, rel), "utf8") }));
|
|
423
448
|
}
|
|
424
449
|
function installTo(target10, opts) {
|
|
425
450
|
const { scope, projectDir, dryRun = false, force = false } = opts;
|
|
@@ -429,7 +454,7 @@ function installTo(target10, opts) {
|
|
|
429
454
|
const backupRoot = join5(scope === "global" ? home : projectDir, ".mugiwara");
|
|
430
455
|
const result = { written: [], skipped: [], backedUp: [], notes: [] };
|
|
431
456
|
const writeOne = (absPath, text) => {
|
|
432
|
-
if (
|
|
457
|
+
if (existsSync4(absPath)) {
|
|
433
458
|
if (readFileSync2(absPath, "utf8") === text) {
|
|
434
459
|
result.skipped.push(absPath);
|
|
435
460
|
return;
|
|
@@ -440,15 +465,17 @@ function installTo(target10, opts) {
|
|
|
440
465
|
return;
|
|
441
466
|
}
|
|
442
467
|
const ts = new Date().toISOString().replace(/[:.]/g, "-");
|
|
443
|
-
const
|
|
468
|
+
const fileName = absPath.replace(/[^a-zA-Z0-9]+/g, "_");
|
|
469
|
+
const backupDir = join5(backupRoot, "backup", `${ts}-${target10.id}`);
|
|
470
|
+
const backupFile = join5(backupDir, fileName);
|
|
444
471
|
if (!dryRun) {
|
|
445
|
-
|
|
446
|
-
|
|
472
|
+
mkdirSync3(backupDir, { recursive: true });
|
|
473
|
+
copyFileSync3(absPath, backupFile);
|
|
447
474
|
}
|
|
448
475
|
result.backedUp.push(absPath);
|
|
449
476
|
}
|
|
450
477
|
if (!dryRun) {
|
|
451
|
-
|
|
478
|
+
mkdirSync3(dirname3(absPath), { recursive: true });
|
|
452
479
|
writeFileSync2(absPath, text);
|
|
453
480
|
}
|
|
454
481
|
result.written.push(absPath);
|
|
@@ -488,7 +515,7 @@ function installTo(target10, opts) {
|
|
|
488
515
|
function removeInstalled(manifest, { dryRun = false } = {}) {
|
|
489
516
|
const removed = [];
|
|
490
517
|
for (const f of manifest.files) {
|
|
491
|
-
if (
|
|
518
|
+
if (existsSync4(f)) {
|
|
492
519
|
if (!dryRun)
|
|
493
520
|
rmSync(f);
|
|
494
521
|
removed.push(f);
|
|
@@ -496,13 +523,12 @@ function removeInstalled(manifest, { dryRun = false } = {}) {
|
|
|
496
523
|
}
|
|
497
524
|
if (!dryRun) {
|
|
498
525
|
for (const f of manifest.files) {
|
|
499
|
-
let d =
|
|
500
|
-
while (
|
|
501
|
-
|
|
502
|
-
const parent = dirname2(d);
|
|
503
|
-
if (parent === d)
|
|
526
|
+
let d = dirname3(f);
|
|
527
|
+
while (existsSync4(d) && readdirSync2(d).length === 0) {
|
|
528
|
+
if (d.endsWith("/.mugiwara") || d === dirname3(d))
|
|
504
529
|
break;
|
|
505
|
-
d
|
|
530
|
+
rmSync(d, { recursive: true, force: true });
|
|
531
|
+
d = dirname3(d);
|
|
506
532
|
}
|
|
507
533
|
}
|
|
508
534
|
}
|
|
@@ -510,26 +536,26 @@ function removeInstalled(manifest, { dryRun = false } = {}) {
|
|
|
510
536
|
}
|
|
511
537
|
|
|
512
538
|
// src/manifest.ts
|
|
513
|
-
import { existsSync as
|
|
514
|
-
import { dirname as
|
|
539
|
+
import { existsSync as existsSync5, mkdirSync as mkdirSync4, readFileSync as readFileSync3, writeFileSync as writeFileSync3 } from "node:fs";
|
|
540
|
+
import { dirname as dirname4, join as join6 } from "node:path";
|
|
515
541
|
function manifestPath({ scope, projectDir, home }) {
|
|
516
542
|
return scope === "global" ? join6(home, ".mugiwara", "manifest.json") : join6(projectDir, ".mugiwara", "manifest.json");
|
|
517
543
|
}
|
|
518
544
|
function readManifest(file) {
|
|
519
|
-
return
|
|
545
|
+
return existsSync5(file) ? JSON.parse(readFileSync3(file, "utf8")) : null;
|
|
520
546
|
}
|
|
521
547
|
function writeManifest(file, data) {
|
|
522
|
-
|
|
548
|
+
mkdirSync4(dirname4(file), { recursive: true });
|
|
523
549
|
writeFileSync3(file, JSON.stringify(data, null, 2) + `
|
|
524
550
|
`);
|
|
525
551
|
}
|
|
526
552
|
|
|
527
553
|
// src/mission.ts
|
|
528
|
-
import { existsSync as
|
|
554
|
+
import { existsSync as existsSync6, rmSync as rmSync2, readFileSync as readFileSync4 } from "node:fs";
|
|
529
555
|
import { join as join7 } from "node:path";
|
|
530
556
|
function activeActor(projectDir) {
|
|
531
557
|
const stateFile = join7(projectDir, ".mugiwara", "state.json");
|
|
532
|
-
if (!
|
|
558
|
+
if (!existsSync6(stateFile))
|
|
533
559
|
return null;
|
|
534
560
|
try {
|
|
535
561
|
const state = JSON.parse(readFileSync4(stateFile, "utf8"));
|
|
@@ -540,7 +566,7 @@ function activeActor(projectDir) {
|
|
|
540
566
|
}
|
|
541
567
|
function resetMission(projectDir, keepLogs, force) {
|
|
542
568
|
const root = join7(projectDir, ".mugiwara");
|
|
543
|
-
if (!
|
|
569
|
+
if (!existsSync6(root))
|
|
544
570
|
return { removed: [], kept: [] };
|
|
545
571
|
if (!force) {
|
|
546
572
|
const actor = activeActor(projectDir);
|
|
@@ -552,29 +578,29 @@ function resetMission(projectDir, keepLogs, force) {
|
|
|
552
578
|
const kept = [];
|
|
553
579
|
for (const dir of ["spec", "plans", "results", "review", "issues", "reports"]) {
|
|
554
580
|
const p = join7(root, dir);
|
|
555
|
-
if (
|
|
581
|
+
if (existsSync6(p)) {
|
|
556
582
|
rmSync2(p, { recursive: true, force: true });
|
|
557
583
|
removed.push(dir);
|
|
558
584
|
}
|
|
559
585
|
}
|
|
560
586
|
for (const f of ["state.json"]) {
|
|
561
587
|
const p = join7(root, f);
|
|
562
|
-
if (
|
|
588
|
+
if (existsSync6(p)) {
|
|
563
589
|
rmSync2(p);
|
|
564
590
|
removed.push(f);
|
|
565
591
|
}
|
|
566
592
|
}
|
|
567
593
|
if (!keepLogs) {
|
|
568
594
|
const p = join7(root, "logs");
|
|
569
|
-
if (
|
|
595
|
+
if (existsSync6(p)) {
|
|
570
596
|
rmSync2(p, { recursive: true, force: true });
|
|
571
597
|
removed.push("logs");
|
|
572
598
|
}
|
|
573
|
-
} else if (
|
|
599
|
+
} else if (existsSync6(join7(root, "logs"))) {
|
|
574
600
|
kept.push("logs");
|
|
575
601
|
}
|
|
576
602
|
for (const f of ["config", "manifest.json", "backup"]) {
|
|
577
|
-
if (
|
|
603
|
+
if (existsSync6(join7(root, f)))
|
|
578
604
|
kept.push(f);
|
|
579
605
|
}
|
|
580
606
|
return { removed, kept };
|
|
@@ -623,25 +649,31 @@ function resetCmd(flags) {
|
|
|
623
649
|
}
|
|
624
650
|
async function resolveOptions(flags) {
|
|
625
651
|
const interactive = !flag(flags.yes);
|
|
652
|
+
if (interactive && !process.stdin.isTTY) {
|
|
653
|
+
throw new Error("Not a terminal. Run with --yes and --global or --project <dir> --target <ids|all>");
|
|
654
|
+
}
|
|
626
655
|
const rl = interactive ? createRl() : null;
|
|
627
656
|
try {
|
|
628
657
|
let scope = flag(flags.global) ? "global" : str(flags.project) ? "project" : null;
|
|
629
658
|
if (!scope) {
|
|
630
|
-
if (!interactive)
|
|
631
|
-
|
|
632
|
-
|
|
659
|
+
if (!interactive) {
|
|
660
|
+
scope = "project";
|
|
661
|
+
} else
|
|
662
|
+
scope = await choose(rl, "Install scope?", ["global (user-wide)", "project (this repo)"]) === 0 ? "global" : "project";
|
|
633
663
|
}
|
|
634
664
|
const projectDir = resolve(str(flags.project) ?? process.cwd());
|
|
635
|
-
if (scope === "project" && !
|
|
665
|
+
if (scope === "project" && !existsSync7(projectDir))
|
|
636
666
|
throw new Error(`Project dir not found: ${projectDir}`);
|
|
637
667
|
let targetIds = str(flags.target)?.split(",").map((s) => s.trim()) ?? null;
|
|
638
668
|
if (targetIds && targetIds.includes("all"))
|
|
639
669
|
targetIds = [...TARGET_IDS];
|
|
640
670
|
if (!targetIds) {
|
|
641
|
-
if (!interactive)
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
671
|
+
if (!interactive) {
|
|
672
|
+
targetIds = [...TARGET_IDS];
|
|
673
|
+
} else {
|
|
674
|
+
const idx = await multiChoose(rl, "Target AI agents?", ["all targets", ...TARGET_IDS]);
|
|
675
|
+
targetIds = idx.includes(0) ? [...TARGET_IDS] : idx.map((i) => TARGET_IDS[i - 1]);
|
|
676
|
+
}
|
|
645
677
|
}
|
|
646
678
|
for (const id of targetIds) {
|
|
647
679
|
if (!targets[id])
|
|
@@ -701,6 +733,14 @@ async function uninstall(flags) {
|
|
|
701
733
|
const file = manifestPath({ scope, projectDir, home });
|
|
702
734
|
const manifest = readManifest(file);
|
|
703
735
|
if (!manifest) {
|
|
736
|
+
if (scope === "project") {
|
|
737
|
+
const globalFile = manifestPath({ scope: "global", projectDir, home });
|
|
738
|
+
if (existsSync7(globalFile)) {
|
|
739
|
+
console.log(`No project manifest found, but a global install exists. Try:
|
|
740
|
+
mugiwara uninstall --global`);
|
|
741
|
+
return;
|
|
742
|
+
}
|
|
743
|
+
}
|
|
704
744
|
console.log("Nothing installed (no manifest found).");
|
|
705
745
|
return;
|
|
706
746
|
}
|
|
@@ -715,8 +755,20 @@ async function uninstall(flags) {
|
|
|
715
755
|
}
|
|
716
756
|
}
|
|
717
757
|
const removed = removeInstalled(manifest, { dryRun: flag(flags.dryRun) });
|
|
718
|
-
if (!flag(flags.dryRun))
|
|
758
|
+
if (!flag(flags.dryRun)) {
|
|
719
759
|
rmSync3(file);
|
|
760
|
+
const mugiDir = join8(scope === "global" ? home : projectDir, ".mugiwara");
|
|
761
|
+
if (existsSync7(mugiDir) && readdirSync3(mugiDir).length === 0) {
|
|
762
|
+
rmSync3(mugiDir, { recursive: true, force: true });
|
|
763
|
+
}
|
|
764
|
+
if (manifest.targets.includes("opencode")) {
|
|
765
|
+
const opencodeCache = join8(home, ".cache", "opencode", "packages", "@ionivetech");
|
|
766
|
+
if (existsSync7(opencodeCache)) {
|
|
767
|
+
rmSync3(opencodeCache, { recursive: true, force: true });
|
|
768
|
+
console.log(" cleared opencode npm cache (stale plugin versions)");
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
}
|
|
720
772
|
console.log(`OK removed ${removed.length} files`);
|
|
721
773
|
}
|
|
722
774
|
function list(flags) {
|
|
@@ -731,7 +783,12 @@ function list(flags) {
|
|
|
731
783
|
if (!m)
|
|
732
784
|
continue;
|
|
733
785
|
found = true;
|
|
734
|
-
|
|
786
|
+
if (flag(flags.check)) {
|
|
787
|
+
const missing = m.files.filter((f) => !existsSync7(f));
|
|
788
|
+
console.log(`${label}: v${m.version} targets=${m.targets.join(",")} files=${m.files.length} missing=${missing.length} installed=${m.installedAt}`);
|
|
789
|
+
} else {
|
|
790
|
+
console.log(`${label}: v${m.version} targets=${m.targets.join(",")} files=${m.files.length} installed=${m.installedAt}`);
|
|
791
|
+
}
|
|
735
792
|
}
|
|
736
793
|
if (!found)
|
|
737
794
|
console.log("No mugiwara installation found.");
|
|
@@ -740,10 +797,11 @@ function help() {
|
|
|
740
797
|
console.log(`mugiwara ${VERSION} — the Straw Hat crew for AI agents
|
|
741
798
|
|
|
742
799
|
Usage:
|
|
743
|
-
mugiwara [install] install the crew (
|
|
800
|
+
mugiwara [install] install the crew (wizard; with --yes uses project + all)
|
|
744
801
|
mugiwara update replace existing files (backs up differences first)
|
|
745
802
|
mugiwara uninstall remove installed files via manifest
|
|
746
803
|
mugiwara list show installations
|
|
804
|
+
mugiwara list --check health check: show installations + missing files
|
|
747
805
|
mugiwara reset wipe mission state (spec/plans/results/review/issues[/logs])
|
|
748
806
|
mugiwara --help this help
|
|
749
807
|
mugiwara --version print version
|
|
@@ -752,18 +810,13 @@ Flags:
|
|
|
752
810
|
--global user-wide install
|
|
753
811
|
--project <dir> project install (default: cwd)
|
|
754
812
|
--target <ids|all> comma-separated: ${TARGET_IDS.join(", ")}
|
|
755
|
-
--yes, -y non-interactive (
|
|
813
|
+
--yes, -y non-interactive (defaults: project, all targets)
|
|
756
814
|
--force overwrite differing files (with backup)
|
|
757
815
|
--dry-run print actions without writing
|
|
816
|
+
--check with list: report missing files (health check)
|
|
758
817
|
--keep-logs with reset: keep .mugiwara/logs (lessons ledger survives)`);
|
|
759
818
|
}
|
|
760
|
-
var
|
|
761
|
-
if (entry !== undefined) {
|
|
762
|
-
try {
|
|
763
|
-
entry = realpathSync(entry);
|
|
764
|
-
} catch {}
|
|
765
|
-
}
|
|
766
|
-
var isMain = entry !== undefined && import.meta.url === pathToFileURL(entry).href;
|
|
819
|
+
var isMain = process.argv[1] !== undefined && fileURLToPath4(import.meta.url) === resolve(process.argv[1]);
|
|
767
820
|
if (isMain) {
|
|
768
821
|
run(process.argv.slice(2)).catch((err) => {
|
|
769
822
|
console.error(`mugiwara: ${err.message}`);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# Modes
|
|
2
2
|
|
|
3
3
|
The crew's autonomy level. Read once per wave at dispatch; a flip applies from
|
|
4
|
-
the next wave, never mid-wave.
|
|
5
|
-
skill.
|
|
4
|
+
the next wave, never mid-wave.
|
|
6
5
|
|
|
7
6
|
**Mode owns autonomy, config owns writing standards.** Whether branch and commit
|
|
8
7
|
run automatically is decided by one lever: the mode. The config only shapes HOW
|
package/docs/getting-started.md
CHANGED
|
@@ -111,7 +111,7 @@ Almost nothing in `guided` mode:
|
|
|
111
111
|
PR, merges, or deploys.
|
|
112
112
|
|
|
113
113
|
Switch to `semi` or `auto` if you want the crew to self-manage branch, commits,
|
|
114
|
-
and ambiguities. See [modes](modes.md).
|
|
114
|
+
and ambiguities. See [modes](concepts/modes.md).
|
|
115
115
|
|
|
116
116
|
## 4. The `.mugiwara/` workspace
|
|
117
117
|
|
|
@@ -133,7 +133,7 @@ Every mission writes to `.mugiwara/` at the repo root:
|
|
|
133
133
|
|
|
134
134
|
**Savepoint** runs at every wave boundary — `state.json` carries lane, wave,
|
|
135
135
|
files, blockers, heal cycle, and token budget. Resume reads one file instead of
|
|
136
|
-
six. See [audit-trail.md](audit-trail.md) for the full artifact map.
|
|
136
|
+
six. See [audit-trail.md](concepts/audit-trail.md) for the full artifact map.
|
|
137
137
|
|
|
138
138
|
## 5. Configuration
|
|
139
139
|
|
|
@@ -150,9 +150,9 @@ six. See [audit-trail.md](audit-trail.md) for the full artifact map.
|
|
|
150
150
|
|
|
151
151
|
## 6. Next steps
|
|
152
152
|
|
|
153
|
-
- Meet the [crew](agents.md) — 14 agents with permission boundaries.
|
|
154
|
-
- Browse the [skills](skills.md) — 26 skills with the 3-layer disclosure model.
|
|
155
|
-
- Understand the [lanes](lanes.md) — how work is sized before it runs.
|
|
156
|
-
- Set your [mode](modes.md) — guided/semi/auto.
|
|
157
|
-
- Read the [audit trail](audit-trail.md) — every artifact and how to review it.
|
|
158
|
-
- See the [compliance matrix](compliance-matrix.md) — rule compliance per model.
|
|
153
|
+
- Meet the [crew](concepts/agents.md) — 14 agents with permission boundaries.
|
|
154
|
+
- Browse the [skills](concepts/skills.md) — 26 skills with the 3-layer disclosure model.
|
|
155
|
+
- Understand the [lanes](concepts/lanes.md) — how work is sized before it runs.
|
|
156
|
+
- Set your [mode](concepts/modes.md) — guided/semi/auto.
|
|
157
|
+
- Read the [audit trail](concepts/audit-trail.md) — every artifact and how to review it.
|
|
158
|
+
- See the [compliance matrix](reference/compliance-matrix.md) — rule compliance per model.
|
package/docs/index.md
CHANGED
|
@@ -15,39 +15,39 @@ claim.
|
|
|
15
15
|
| Doc | What it covers |
|
|
16
16
|
|-----|----------------|
|
|
17
17
|
| [Getting started](getting-started.md) | Install, first mission, what you see in the chat |
|
|
18
|
-
| [Adoption guide](adoption-guide.md) | Pick the harness, pick the mode, fit the crew to your workflow |
|
|
19
|
-
| [Modes](modes.md) | guided / semi / auto — the autonomy levels, what each asks you |
|
|
20
|
-
| [Config](config.md) | Full reference for `.mugiwara/config` keys and commit styles |
|
|
21
|
-
| [Auto-PR](pr-summary.md) | What the crew hands off at closure: push + a ready-to-paste PR summary (it never creates a PR) |
|
|
22
|
-
| [The crew](agents.md) | All 14 agents and when to summon each |
|
|
23
|
-
| [The techniques](skills.md) | All 32 skills and what each enforces |
|
|
24
|
-
| [The wave pipeline](workflow.md) | How a mission flows Wave 0 → Wave 9 |
|
|
25
|
-
| [Execution model](execution-model.md) | Inline-by-default: why the crew runs in your main conversation |
|
|
26
|
-
| [Lanes & sizing](lanes.md) | How Luffy sizes work at triage: Lane 0–4, escalation, budget |
|
|
27
|
-
| [Enforcement](enforcement.md) | Skip gates, evidence over claims, and capability tiers |
|
|
28
|
-
| [Git discipline](git-strategy.md) | Commits, branches, save-points — and why the executor commits |
|
|
18
|
+
| [Adoption guide](reference/adoption-guide.md) | Pick the harness, pick the mode, fit the crew to your workflow |
|
|
19
|
+
| [Modes](concepts/modes.md) | guided / semi / auto — the autonomy levels, what each asks you |
|
|
20
|
+
| [Config](concepts/config.md) | Full reference for `.mugiwara/config` keys and commit styles |
|
|
21
|
+
| [Auto-PR](concepts/pr-summary.md) | What the crew hands off at closure: push + a ready-to-paste PR summary (it never creates a PR) |
|
|
22
|
+
| [The crew](concepts/agents.md) | All 14 agents and when to summon each |
|
|
23
|
+
| [The techniques](concepts/skills.md) | All 32 skills and what each enforces |
|
|
24
|
+
| [The wave pipeline](concepts/workflow.md) | How a mission flows Wave 0 → Wave 9 |
|
|
25
|
+
| [Execution model](concepts/execution-model.md) | Inline-by-default: why the crew runs in your main conversation |
|
|
26
|
+
| [Lanes & sizing](concepts/lanes.md) | How Luffy sizes work at triage: Lane 0–4, escalation, budget |
|
|
27
|
+
| [Enforcement](reference/enforcement.md) | Skip gates, evidence over claims, and capability tiers |
|
|
28
|
+
| [Git discipline](concepts/git-strategy.md) | Commits, branches, save-points — and why the executor commits |
|
|
29
29
|
|
|
30
30
|
## Install by harness
|
|
31
31
|
|
|
32
32
|
| Harness | Guide |
|
|
33
33
|
|---------|-------|
|
|
34
|
-
| Claude Code | [claude
|
|
35
|
-
| opencode | [opencode
|
|
36
|
-
| GitHub Copilot | [copilot
|
|
37
|
-
| Gemini CLI | [gemini
|
|
38
|
-
| Codex | [codex
|
|
39
|
-
| Cursor | [cursor
|
|
40
|
-
| Windsurf | [
|
|
41
|
-
| Cline / Kilo / Antigravity | [
|
|
34
|
+
| Claude Code | [install/claude.md](install/claude.md) |
|
|
35
|
+
| opencode | [install/opencode.md](install/opencode.md) |
|
|
36
|
+
| GitHub Copilot | [install/copilot.md](install/copilot.md) |
|
|
37
|
+
| Gemini CLI | [install/gemini.md](install/gemini.md) |
|
|
38
|
+
| Codex | [install/codex.md](install/codex.md) |
|
|
39
|
+
| Cursor | [install/cursor.md](install/cursor.md) |
|
|
40
|
+
| Windsurf | [install/cli.md](install/cli.md) |
|
|
41
|
+
| Cline / Kilo / Antigravity | [install/cli.md](install/cli.md) |
|
|
42
42
|
|
|
43
43
|
## Reference
|
|
44
44
|
|
|
45
45
|
| Doc | What it covers |
|
|
46
46
|
|-----|----------------|
|
|
47
|
-
| [Skill anatomy](skill-anatomy.md) | How a mugiwara skill file is structured |
|
|
48
|
-
| [Agent anatomy](agent-anatomy.md) | How a mugiwara agent file is structured |
|
|
47
|
+
| [Skill anatomy](reference/skill-anatomy.md) | How a mugiwara skill file is structured |
|
|
48
|
+
| [Agent anatomy](reference/agent-anatomy.md) | How a mugiwara agent file is structured |
|
|
49
49
|
| [Troubleshooting](troubleshooting.md) | Common problems and how to fix them |
|
|
50
|
-
| [Developer onboarding](developer-onboarding.md) | Repo layout, validation, tests, contributing |
|
|
50
|
+
| [Developer onboarding](reference/developer-onboarding.md) | Repo layout, validation, tests, contributing |
|
|
51
51
|
|
|
52
52
|
## Resources
|
|
53
53
|
|
|
@@ -11,7 +11,7 @@ session-start hook.
|
|
|
11
11
|
## Install
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
/plugin marketplace add ionivetech/mugiwara && /plugin install mugiwara
|
|
14
|
+
/plugin marketplace add ionivetech/mugiwara && /plugin install mugiwara
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
## How it works
|
|
@@ -52,10 +52,12 @@ Or start any task — the crew auto-activates at session start.
|
|
|
52
52
|
## Configuration
|
|
53
53
|
|
|
54
54
|
After install, configure mugiwara in `.mugiwara/config` (project) or
|
|
55
|
-
`~/.mugiwara/config` (global). See [
|
|
55
|
+
`~/.mugiwara/config` (global). See [config.md](../concepts/config.md).
|
|
56
56
|
|
|
57
57
|
Switch autonomy mode with `/mugiwara-mode guided|semi|auto`.
|
|
58
58
|
|
|
59
|
+
Or set permanently in `.mugiwara/config`: `mode=guided`.
|
|
60
|
+
|
|
59
61
|
## Troubleshooting
|
|
60
62
|
|
|
61
63
|
### Plugin not showing up
|
|
@@ -66,14 +66,25 @@ what mugiwara crew members are available?
|
|
|
66
66
|
## Update
|
|
67
67
|
|
|
68
68
|
```bash
|
|
69
|
-
mugiwara update
|
|
70
|
-
|
|
69
|
+
npx @ionivetech/mugiwara@latest update --project . --target <id> --yes
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Or with global CLI:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
mugiwara update --project . --target <id> --yes
|
|
71
76
|
```
|
|
72
77
|
|
|
73
78
|
## Uninstall
|
|
74
79
|
|
|
75
80
|
```bash
|
|
76
|
-
mugiwara uninstall
|
|
81
|
+
npx @ionivetech/mugiwara@latest uninstall --project .
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Or with global CLI:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
mugiwara uninstall --project .
|
|
77
88
|
```
|
|
78
89
|
|
|
79
90
|
## Global install
|
|
@@ -88,16 +99,17 @@ Installs to `~/.devin/rules/` (Windsurf), `~/.clinerules/` (Cline), or
|
|
|
88
99
|
## Configuration
|
|
89
100
|
|
|
90
101
|
After install, configure mugiwara in `.mugiwara/config` (project) or
|
|
91
|
-
`~/.mugiwara/config` (global). See [
|
|
102
|
+
`~/.mugiwara/config` (global). See [config.md](../concepts/config.md).
|
|
92
103
|
|
|
93
104
|
## CLI reference
|
|
94
105
|
|
|
95
106
|
```bash
|
|
96
107
|
mugiwara install # wizard (interactive)
|
|
97
|
-
mugiwara install --
|
|
98
|
-
mugiwara update
|
|
99
|
-
mugiwara uninstall
|
|
108
|
+
npx @ionivetech/mugiwara@latest install --yes # non-interactive (project + all)
|
|
109
|
+
mugiwara update --project . --target <id> --yes # replace existing files
|
|
110
|
+
mugiwara uninstall --project . # remove what manifest recorded
|
|
100
111
|
mugiwara list # show installations
|
|
112
|
+
mugiwara list --check # health check (missing files)
|
|
101
113
|
mugiwara reset --keep-logs # wipe mission state, keep lessons
|
|
102
114
|
mugiwara reset --force # override multi-actor guard
|
|
103
115
|
```
|
|
@@ -42,4 +42,4 @@ copilot plugin uninstall mugiwara
|
|
|
42
42
|
## Configuration
|
|
43
43
|
|
|
44
44
|
After install, configure mugiwara in `.mugiwara/config` (project) or
|
|
45
|
-
`~/.mugiwara/config` (global). See [
|
|
45
|
+
`~/.mugiwara/config` (global). See [config.md](../concepts/config.md).
|
|
@@ -41,4 +41,4 @@ gemini extensions remove mugiwara
|
|
|
41
41
|
## Configuration
|
|
42
42
|
|
|
43
43
|
After install, configure mugiwara in `.mugiwara/config` (project) or
|
|
44
|
-
`~/.mugiwara/config` (global). See [
|
|
44
|
+
`~/.mugiwara/config` (global). See [config.md](../concepts/config.md).
|
|
@@ -9,16 +9,16 @@ Requires **Node.js >= 20.11** on the host machine.
|
|
|
9
9
|
|
|
10
10
|
| Platform | Install doc | Native plugin? |
|
|
11
11
|
|----------|-------------|:---:|
|
|
12
|
-
| Claude Code | [
|
|
13
|
-
| OpenCode | [
|
|
14
|
-
| Gemini CLI | [
|
|
15
|
-
| Codex | [
|
|
16
|
-
| GitHub Copilot | [
|
|
17
|
-
| Cursor | [
|
|
18
|
-
| Antigravity | [
|
|
19
|
-
| Kimi Code | [
|
|
20
|
-
| Pi | [
|
|
21
|
-
| Windsurf / Cline / Kilo | [
|
|
12
|
+
| Claude Code | [claude](claude.md) | ✅ |
|
|
13
|
+
| OpenCode | [opencode](opencode.md) | ✅ |
|
|
14
|
+
| Gemini CLI | [gemini](gemini.md) | ✅ |
|
|
15
|
+
| Codex | [codex](codex.md) | ✅ |
|
|
16
|
+
| GitHub Copilot | [copilot](copilot.md) | ✅ |
|
|
17
|
+
| Cursor | [cursor](cursor.md) | ✅ |
|
|
18
|
+
| Antigravity | [antigravity](antigravity.md) | ✅ |
|
|
19
|
+
| Kimi Code | [kimi](kimi.md) | ✅ |
|
|
20
|
+
| Pi | [pi](pi.md) | ✅ |
|
|
21
|
+
| Windsurf / Cline / Kilo | [cli](cli.md) | CLI-based |
|
|
22
22
|
|
|
23
23
|
## One-liner
|
|
24
24
|
|
|
@@ -46,7 +46,7 @@ what mugiwara crew members are available?
|
|
|
46
46
|
|
|
47
47
|
## Configuration
|
|
48
48
|
|
|
49
|
-
See [
|
|
49
|
+
See [config.md](../concepts/config.md) for all `.mugiwara/config` options.
|
|
50
50
|
|
|
51
51
|
## Report issues
|
|
52
52
|
|