@ionivetech/mugiwara 0.1.3 → 0.2.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.
Files changed (56) hide show
  1. package/.opencode/plugins/mugiwara.mjs +102 -0
  2. package/README.md +196 -216
  3. package/content/agents/brook-healing.md +8 -2
  4. package/content/agents/chopper-checkpoint.md +9 -4
  5. package/content/agents/eval-runner.md +5 -1
  6. package/content/agents/franky-gates.md +9 -4
  7. package/content/agents/jinbe-security.md +5 -1
  8. package/content/agents/luffy-orchestrator.md +14 -8
  9. package/content/agents/memory-keeper.md +4 -0
  10. package/content/agents/nami-planner.md +12 -5
  11. package/content/agents/resume-coordinator.md +5 -1
  12. package/content/agents/robin-reviewer.md +5 -1
  13. package/content/agents/sanji-quality.md +7 -3
  14. package/content/agents/skeptic-verifier.md +5 -1
  15. package/content/agents/using-mugiwara.md +11 -7
  16. package/content/agents/usopp-brainstorm.md +9 -3
  17. package/content/agents/zoro-execution.md +16 -11
  18. package/content/skills/mugiwara-backend/SKILL.md +12 -0
  19. package/content/skills/mugiwara-brainstorm/SKILL.md +28 -1
  20. package/content/skills/mugiwara-checkpoint/SKILL.md +8 -6
  21. package/content/skills/mugiwara-deprecation/SKILL.md +77 -0
  22. package/content/skills/mugiwara-dynamic-workflow/SKILL.md +3 -3
  23. package/content/skills/mugiwara-execution/SKILL.md +32 -15
  24. package/content/skills/mugiwara-gates/SKILL.md +4 -0
  25. package/content/skills/mugiwara-git/SKILL.md +10 -0
  26. package/content/skills/mugiwara-healing/SKILL.md +9 -3
  27. package/content/skills/mugiwara-mode/SKILL.md +63 -0
  28. package/content/skills/mugiwara-orchestration/SKILL.md +26 -8
  29. package/content/skills/mugiwara-planning/SKILL.md +50 -25
  30. package/content/skills/mugiwara-pr/SKILL.md +51 -0
  31. package/content/skills/mugiwara-quality/SKILL.md +19 -2
  32. package/content/skills/mugiwara-resume/SKILL.md +6 -4
  33. package/content/skills/mugiwara-testcases/SKILL.md +52 -0
  34. package/content/skills/mugiwara-workflow/SKILL.md +36 -13
  35. package/docs/adoption-guide.md +72 -0
  36. package/docs/agent-anatomy.md +72 -0
  37. package/docs/agents.md +51 -0
  38. package/docs/claude-setup.md +38 -0
  39. package/docs/codex-setup.md +24 -0
  40. package/docs/comparison.md +63 -0
  41. package/docs/copilot-setup.md +27 -0
  42. package/docs/cursor-setup.md +23 -0
  43. package/docs/developer-onboarding.md +85 -0
  44. package/docs/execution-model.md +59 -0
  45. package/docs/gemini-setup.md +24 -0
  46. package/docs/getting-started.md +84 -0
  47. package/docs/git-strategy.md +62 -0
  48. package/docs/index.md +45 -0
  49. package/docs/modes.md +64 -0
  50. package/docs/opencode-setup.md +47 -0
  51. package/docs/rule-based-setup.md +31 -0
  52. package/docs/skill-anatomy.md +73 -0
  53. package/docs/skills.md +61 -0
  54. package/docs/windsurf-setup.md +16 -0
  55. package/docs/workflow.md +80 -0
  56. package/package.json +19 -2
@@ -0,0 +1,102 @@
1
+ // mugiwara — OpenCode plugin.
2
+ //
3
+ // Registers the Mugiwara crew (25 skills + 15 agents) with OpenCode from the
4
+ // npm/git package, and announces the crew at session start. No runtime, no
5
+ // deps — reads the markdown source of truth (content/) at config load.
6
+ //
7
+ // Install: add to opencode.json
8
+ // { "plugin": ["@ionivetech/mugiwara"] }
9
+ // or from the git repo:
10
+ // { "plugin": ["mugiwara@git+https://github.com/ionivetech/mugiwara.git"] }
11
+
12
+ import { readdirSync, readFileSync } from 'node:fs';
13
+ import { dirname, join } from 'node:path';
14
+ import { fileURLToPath } from 'node:url';
15
+
16
+ const __dirname = dirname(fileURLToPath(import.meta.url));
17
+
18
+ const contentDir = join(__dirname, '..', '..', 'content');
19
+ const skillsDir = join(contentDir, 'skills');
20
+ const agentsDir = join(contentDir, 'agents');
21
+
22
+ const ANNOUNCE =
23
+ "Mugiwara crew available. Start non-trivial missions by invoking `using-mugiwara` (or ask 'how do I use mugiwara?') - it routes you to the right crew member. Run the crew pipeline inline: embody ONE crew role at a time in the main conversation using its skill, wait for its report, then move to the next. Subagents only for [PARALLEL] task batches and background checks. Crew members never dispatch each other. See skills/mugiwara-workflow.";
24
+
25
+ // OpenCode per-agent tuning. Content stays portable markdown; these knobs
26
+ // (color, temperature, permission, steps) are opencode-only.
27
+ const CREW = {
28
+ 'using-mugiwara': { color: '#84cc16', temperature: 0.2, steps: 10 },
29
+ 'luffy-orchestrator': { color: '#ef4444', temperature: 0.2, steps: 15 },
30
+ 'usopp-brainstorm': { color: '#f59e0b', temperature: 0.6, steps: 15 },
31
+ 'nami-planner': { color: '#f97316', temperature: 0.2, steps: 15 },
32
+ 'zoro-execution': { color: '#22c55e', temperature: 0.1, steps: 30 },
33
+ 'chopper-checkpoint': { color: '#3b82f6', temperature: 0.1, permission: { edit: 'deny' }, steps: 15 },
34
+ 'sanji-quality': { color: '#a855f7', temperature: 0.1, permission: { edit: 'deny' }, steps: 10 },
35
+ 'franky-gates': { color: '#06b6d4', temperature: 0.1, permission: { edit: 'deny' }, steps: 10 },
36
+ 'robin-reviewer': { color: '#8b5cf6', temperature: 0.2, permission: { edit: 'deny' }, steps: 15 },
37
+ 'jinbe-security': { color: '#6366f1', temperature: 0.2, permission: { edit: 'deny' }, steps: 15 },
38
+ 'brook-healing': { color: '#ec4899', temperature: 0.1, steps: 20 },
39
+ 'skeptic-verifier': { color: '#64748b', temperature: 0.1, permission: { edit: 'deny' }, steps: 12 },
40
+ 'eval-runner': { color: '#14b8a6', temperature: 0.2, steps: 15 },
41
+ 'resume-coordinator': { color: '#d97706', temperature: 0.2, steps: 10 },
42
+ 'memory-keeper': { color: '#d946ef', temperature: 0.2, steps: 8 },
43
+ };
44
+
45
+ function parseFrontmatter(text) {
46
+ const m = text.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/);
47
+ if (!m) throw new Error('Missing frontmatter fence (---)');
48
+ const data = {};
49
+ for (const line of m[1].split(/\r?\n/)) {
50
+ if (!line.trim()) continue;
51
+ const i = line.indexOf(':');
52
+ if (i === -1) continue;
53
+ data[line.slice(0, i).trim()] = line.slice(i + 1).trim();
54
+ }
55
+ return { data, body: text.slice(m[0].length) };
56
+ }
57
+
58
+ function readAgents() {
59
+ const agents = {};
60
+ let files;
61
+ try {
62
+ files = readdirSync(agentsDir).filter((f) => f.endsWith('.md'));
63
+ } catch {
64
+ return agents;
65
+ }
66
+ for (const f of files) {
67
+ const name = f.replace(/\.md$/, '');
68
+ let parsed;
69
+ try {
70
+ parsed = parseFrontmatter(readFileSync(join(agentsDir, f), 'utf8'));
71
+ } catch {
72
+ continue;
73
+ }
74
+ if (!parsed.data.description || !parsed.body) continue;
75
+ agents[name] = { description: parsed.data.description, mode: 'subagent', prompt: parsed.body };
76
+ if (CREW[name]) agents[name] = { ...agents[name], ...CREW[name] };
77
+ }
78
+ return agents;
79
+ }
80
+
81
+ export default async () => ({
82
+ config: (config) => {
83
+ config.skills = config.skills || {};
84
+ config.skills.paths = config.skills.paths || [];
85
+ if (!config.skills.paths.includes(skillsDir)) config.skills.paths.push(skillsDir);
86
+
87
+ config.agent = config.agent || {};
88
+ for (const [name, agent] of Object.entries(readAgents())) {
89
+ if (config.agent[name]) continue;
90
+ config.agent[name] = agent;
91
+ }
92
+ },
93
+
94
+ // ponytail-proven hook; appends the announce string to the system prompt.
95
+ 'experimental.chat.system.transform': async (_input, output) => {
96
+ if (output.system.length > 0) {
97
+ output.system[output.system.length - 1] += '\n\n' + ANNOUNCE;
98
+ } else {
99
+ output.system.push(ANNOUNCE);
100
+ }
101
+ },
102
+ });