@ionivetech/mugiwara 0.6.6 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +2 -7
- package/.codex-plugin/plugin.json +2 -7
- package/.cursor-plugin/plugin.json +2 -7
- package/.kimi-plugin/plugin.json +2 -7
- package/.opencode/mugiwara-helpers.mjs +2 -2
- package/.opencode/plugins/mugiwara.mjs +3 -18
- package/AGENTS.md +5 -4
- package/GEMINI.md +3 -3
- package/README.md +203 -331
- package/content/agents/brook-healing.md +8 -4
- package/content/agents/chopper-checkpoint.md +7 -3
- package/content/agents/eval-runner.md +4 -4
- package/content/agents/franky-gates.md +4 -4
- package/content/agents/jinbe-security.md +6 -7
- package/content/agents/luffy-orchestrator.md +11 -13
- package/content/agents/memory-keeper.md +4 -4
- package/content/agents/nami-planner.md +4 -4
- package/content/agents/resume-coordinator.md +7 -7
- package/content/agents/robin-reviewer.md +7 -3
- package/content/agents/sanji-quality.md +2 -2
- package/content/agents/skeptic-verifier.md +2 -2
- package/content/agents/usopp-brainstorm.md +3 -3
- package/content/agents/zoro-execution.md +6 -6
- package/content/skills/mugiwara-backend/SKILL.md +54 -43
- package/content/skills/mugiwara-backend/references/database.md +61 -0
- package/content/skills/mugiwara-brainstorm/SKILL.md +1 -1
- package/content/skills/mugiwara-checkpoint/SKILL.md +23 -11
- package/content/skills/mugiwara-checkpoint/references/ledger-format.md +1 -1
- package/content/skills/mugiwara-contract-first/SKILL.md +46 -1
- package/content/skills/mugiwara-execution/SKILL.md +37 -37
- package/content/skills/mugiwara-execution/references/dispatch.md +1 -1
- package/content/skills/mugiwara-execution/references/execution-phase-flows.md +18 -0
- package/content/skills/mugiwara-execution/references/resume-batching.md +2 -2
- package/content/skills/mugiwara-frontend/SKILL.md +44 -43
- package/content/skills/mugiwara-frontend/references/checklist.md +14 -0
- package/content/skills/mugiwara-gates/SKILL.md +23 -14
- package/content/skills/mugiwara-healing/SKILL.md +26 -25
- package/content/skills/mugiwara-lessons/SKILL.md +2 -2
- package/content/skills/mugiwara-orchestration/SKILL.md +11 -11
- package/content/skills/mugiwara-orchestration/references/check-ins.md +2 -2
- package/content/skills/mugiwara-orchestration/references/closure.md +17 -12
- package/content/skills/mugiwara-orchestration/references/control-commands.md +14 -0
- package/content/skills/mugiwara-orchestration/references/triage-escalation.md +11 -1
- package/content/skills/mugiwara-planning/SKILL.md +26 -29
- package/content/skills/mugiwara-planning/references/large-campaign-subplan.md +41 -0
- package/content/skills/mugiwara-planning/references/plan-template.md +24 -2
- package/content/skills/mugiwara-quality/SKILL.md +21 -12
- package/content/skills/mugiwara-resume/SKILL.md +8 -3
- package/content/skills/mugiwara-review/SKILL.md +19 -13
- package/content/skills/mugiwara-security/SKILL.md +47 -36
- package/content/skills/mugiwara-ship/SKILL.md +1 -1
- package/content/skills/mugiwara-ship/references/cleanup.md +17 -16
- package/content/skills/mugiwara-workflow/SKILL.md +11 -17
- package/content/skills/mugiwara-workflow/references/adaptive-budget-governor.md +5 -0
- package/content/skills/mugiwara-workflow/references/benchmark-governor.md +53 -0
- package/content/skills/mugiwara-workflow/references/cognitive-output-governor.md +5 -0
- package/content/skills/mugiwara-workflow/references/large-campaign-subplan.md +29 -0
- package/content/skills/mugiwara-workflow/references/scope-code-governor.md +14 -0
- package/content/skills/mugiwara-workflow/references/stop-slop-governor.md +14 -0
- package/content/skills/mugiwara-workflow/references/workspace-layout.md +42 -38
- package/dist/mugiwara.js +1642 -528
- package/gemini-extension.json +1 -1
- package/hooks/auto-savepoint.js +18 -10
- package/hooks/auto-savepoint.ts +23 -23
- package/hooks/engagement-marker.js +1 -1
- package/hooks/engagement-marker.ts +1 -1
- package/hooks/pipeline-guard.js +17 -13
- package/hooks/pipeline-guard.ts +24 -20
- package/hooks/session-start.js +13 -10
- package/hooks/session-start.ts +24 -19
- package/package.json +2 -2
- package/plugin.json +1 -1
- package/references/complexity.md +27 -4
- package/references/definition-of-done.md +1 -1
- package/references/multi-actor.md +20 -2
- package/references/posture-routing.md +31 -0
- package/references/prose-style.md +54 -0
- package/scripts/benchmark-governor.ts +516 -0
- package/scripts/benchmark-thresholds.json +47 -0
- package/scripts/check-doc-links.ts +46 -0
- package/scripts/conformance.ts +6 -16
- package/scripts/coverage-gate.ts +20 -6
- package/scripts/gate-selftest.ts +138 -7
- package/scripts/lane.sh +54 -8
- package/scripts/lib/lane-base.sh +4 -4
- package/scripts/lib/patterns.sh +5 -0
- package/scripts/policy-force.ts +22 -0
- package/scripts/retrieval-eval.ts +10 -4
- package/scripts/savepoint.sh +155 -58
- package/scripts/validate-content.ts +43 -11
- package/scripts/verify-install.ts +9 -7
- package/src/adaptive-budget.ts +178 -0
- package/src/args.ts +4 -3
- package/src/budget.ts +47 -0
- package/src/check-artifacts.ts +45 -0
- package/src/cli.ts +257 -108
- package/src/cognition.ts +234 -0
- package/src/config.ts +107 -0
- package/src/context.ts +72 -0
- package/src/continue.ts +29 -10
- package/src/cost.ts +186 -0
- package/src/evidence.ts +160 -0
- package/src/installer.ts +25 -34
- package/src/integrity.ts +158 -0
- package/src/investigation.ts +72 -0
- package/src/mission.ts +341 -94
- package/src/policy.ts +156 -0
- package/src/posture.ts +86 -0
- package/src/provenance.ts +116 -0
- package/src/reporting.ts +225 -0
- package/src/rollback.ts +95 -0
- package/src/routing.ts +69 -0
- package/src/run.ts +2 -2
- package/src/scope.ts +321 -0
- package/src/sign.ts +235 -0
- package/src/slop.ts +306 -0
- package/src/targets/claude.ts +2 -2
- package/src/work.ts +273 -0
- package/.opencode/commands/mugiwara-execute.md +0 -13
- package/.opencode/commands/mugiwara-heal.md +0 -13
- package/.opencode/commands/mugiwara-onboard.md +0 -14
- package/.opencode/commands/mugiwara-plan.md +0 -17
- package/.opencode/commands/mugiwara-ship.md +0 -13
- package/.opencode/commands/using-mugiwara.md +0 -20
- package/content/skills/mugiwara-agent-security/SKILL.md +0 -58
- package/content/skills/mugiwara-agent-security/references/checklist.md +0 -20
- package/content/skills/mugiwara-context-budget/SKILL.md +0 -66
- package/content/skills/mugiwara-context-budget/references/context-budget.md +0 -37
- package/content/skills/mugiwara-pr/SKILL.md +0 -69
- package/content/skills/mugiwara-pr/references/verdict-format.md +0 -31
- package/content/skills/mugiwara-sunset/SKILL.md +0 -82
- package/content/skills/using-mugiwara/SKILL.md +0 -51
- package/references/token-budget.md +0 -56
- package/scripts/evidence.sh +0 -81
- package/scripts/initiative.ts +0 -296
- package/scripts/mission-report.sh +0 -293
- package/src/onboard.ts +0 -207
package/src/onboard.ts
DELETED
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
// src/onboard.ts — zero-LLM onboarding wizard (6 questions, writes .mugiwara/config).
|
|
2
|
-
// Runs on every platform via the `mugiwara onboard` CLI command. No LLM, no network.
|
|
3
|
-
import { existsSync, lstatSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
4
|
-
import { join } from 'node:path';
|
|
5
|
-
import { createRl, choose, confirm, type Rl } from './prompt.ts';
|
|
6
|
-
|
|
7
|
-
// Canonical key order for the written config. Keys the wizard does not ask
|
|
8
|
-
// about (auto_commit, delegate_threshold, heal_max_cycles, verbosity) are
|
|
9
|
-
// preserved from an existing config, never reset to defaults.
|
|
10
|
-
const DEFAULT_ORDER = [
|
|
11
|
-
'mode', 'branch', 'commit', 'auto_commit', 'coverage_new', 'coverage_modified',
|
|
12
|
-
'review_depth', 'quality_depth', 'delegate_threshold', 'heal_max_cycles', 'verbosity',
|
|
13
|
-
];
|
|
14
|
-
|
|
15
|
-
// Defaults for keys the wizard does not ask about — used only when the key is
|
|
16
|
-
// absent from an existing config (fresh install). Existing values always win.
|
|
17
|
-
const DEFAULTS: Record<string, string> = {
|
|
18
|
-
auto_commit: 'on',
|
|
19
|
-
delegate_threshold: '60',
|
|
20
|
-
heal_max_cycles: '3',
|
|
21
|
-
verbosity: 'normal',
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const BRANCH_PRESETS: Record<number, string> = {
|
|
25
|
-
1: 'feature/{type}-{issue}-{slug}',
|
|
26
|
-
2: 'feature/{slug}',
|
|
27
|
-
3: 'feat/{slug}',
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const COMMIT_PRESETS: Record<number, string> = {
|
|
31
|
-
1: 'conventional',
|
|
32
|
-
2: 'gitmoji',
|
|
33
|
-
3: 'plain',
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export function parseConfig(lines: string[]): Map<string, string> {
|
|
37
|
-
const map = new Map<string, string>();
|
|
38
|
-
for (const line of lines) {
|
|
39
|
-
const t = line.trim();
|
|
40
|
-
if (!t || t.startsWith('#')) continue;
|
|
41
|
-
const eq = t.indexOf('=');
|
|
42
|
-
if (eq === -1) continue;
|
|
43
|
-
const k = t.slice(0, eq).trim();
|
|
44
|
-
const v = t.slice(eq + 1).trim();
|
|
45
|
-
if (!map.has(k)) map.set(k, v);
|
|
46
|
-
}
|
|
47
|
-
return map;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export function buildConfig(existing: Map<string, string>, updates: Record<string, string>): string {
|
|
51
|
-
const merged = new Map(existing);
|
|
52
|
-
for (const [k, v] of Object.entries(updates)) merged.set(k, v);
|
|
53
|
-
const lines: string[] = [];
|
|
54
|
-
for (const k of DEFAULT_ORDER) {
|
|
55
|
-
const v = merged.get(k) ?? DEFAULTS[k];
|
|
56
|
-
if (v === undefined) continue;
|
|
57
|
-
lines.push(`${k}=${v}`);
|
|
58
|
-
merged.delete(k);
|
|
59
|
-
}
|
|
60
|
-
for (const [k, v] of merged) lines.push(`${k}=${v}`);
|
|
61
|
-
return lines.join('\n') + '\n';
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
async function askFreeText(rl: Rl, prompt: string): Promise<string> {
|
|
65
|
-
for (;;) {
|
|
66
|
-
const v = (await rl.question(prompt)).trim();
|
|
67
|
-
if (v) return v;
|
|
68
|
-
console.log(' Cannot be empty.');
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// Same guard the runtime helpers use: a symlinked config must never be
|
|
73
|
-
// overwritten through the wizard (the target file is not ours to write).
|
|
74
|
-
function assertNotSymlink(file: string): void {
|
|
75
|
-
if (!existsSync(file)) return;
|
|
76
|
-
try {
|
|
77
|
-
if (lstatSync(file).isSymbolicLink()) throw new Error(`refusing to follow symlink: ${file}`);
|
|
78
|
-
} catch (e) {
|
|
79
|
-
if ((e as { code?: string }).code === 'ENOENT') return;
|
|
80
|
-
throw e;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export async function runOnboard(projectDir: string): Promise<void> {
|
|
85
|
-
if (!process.stdin.isTTY) {
|
|
86
|
-
throw new Error('Not a terminal. Run `mugiwara onboard` in a terminal, or edit .mugiwara/config directly.');
|
|
87
|
-
}
|
|
88
|
-
const mugiwaraDir = join(projectDir, '.mugiwara');
|
|
89
|
-
const configPath = join(mugiwaraDir, 'config');
|
|
90
|
-
assertNotSymlink(configPath);
|
|
91
|
-
const existing = parseConfig(existsSync(configPath) ? readFileSync(configPath, 'utf8').split(/\r?\n/) : []);
|
|
92
|
-
|
|
93
|
-
const rl = createRl();
|
|
94
|
-
try {
|
|
95
|
-
console.log('');
|
|
96
|
-
console.log('╔══════════════════════════════════════╗');
|
|
97
|
-
console.log('║ Mugiwara Onboarding Wizard ║');
|
|
98
|
-
console.log('╚══════════════════════════════════════╝');
|
|
99
|
-
console.log('');
|
|
100
|
-
|
|
101
|
-
if (existing.size > 0) {
|
|
102
|
-
const redo = await confirm(rl, 'Existing .mugiwara/config found. Re-onboard?');
|
|
103
|
-
if (!redo) {
|
|
104
|
-
console.log('Onboarding cancelled. Config preserved.');
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
console.log('');
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// Q1 — branch pattern
|
|
111
|
-
const branchChoice = await choose(rl, 'Q1 — Branch naming pattern:', [
|
|
112
|
-
'Trunk-based — feature/{type}-{issue}-{slug}',
|
|
113
|
-
'GitFlow — feature/{slug}',
|
|
114
|
-
'GitHub Flow — feat/{slug}',
|
|
115
|
-
'Custom — enter your own pattern',
|
|
116
|
-
]);
|
|
117
|
-
let branch: string;
|
|
118
|
-
if (branchChoice === 3) {
|
|
119
|
-
branch = await askFreeText(rl, ' Branch pattern (placeholders: {type} {issue} {slug}, e.g. {issue}-{slug}): ');
|
|
120
|
-
} else {
|
|
121
|
-
branch = BRANCH_PRESETS[branchChoice + 1];
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// Q2 — autonomy mode
|
|
125
|
-
const modeIdx = await choose(rl, 'Q2 — Autonomy mode:', [
|
|
126
|
-
'guided — ask before every wave transition',
|
|
127
|
-
'semi — auto-advance through waves, pause on failures',
|
|
128
|
-
'auto — full auto-pilot',
|
|
129
|
-
]);
|
|
130
|
-
const mode = ['guided', 'semi', 'auto'][modeIdx];
|
|
131
|
-
|
|
132
|
-
// Q3 — review depth
|
|
133
|
-
const reviewIdx = await choose(rl, 'Q3 — Code review depth:', [
|
|
134
|
-
'full — breaking-change map, five-axis review, <=3 cycles',
|
|
135
|
-
'standard — five-axis review, 1 cycle',
|
|
136
|
-
'quick — diff-only, no caller-map',
|
|
137
|
-
]);
|
|
138
|
-
const reviewDepth = ['full', 'standard', 'quick'][reviewIdx];
|
|
139
|
-
|
|
140
|
-
// Q4 — quality depth
|
|
141
|
-
const qualityIdx = await choose(rl, 'Q4 — Quality check depth:', [
|
|
142
|
-
'full — format, lint, typecheck, test, build',
|
|
143
|
-
'standard — lint, typecheck, test',
|
|
144
|
-
'quick — test only',
|
|
145
|
-
]);
|
|
146
|
-
const qualityDepth = ['full', 'standard', 'quick'][qualityIdx];
|
|
147
|
-
|
|
148
|
-
// Q5 — coverage
|
|
149
|
-
const covIdx = await choose(rl, 'Q5 — Test coverage threshold:', [
|
|
150
|
-
'90/80 — new code 90%, modified 80%',
|
|
151
|
-
'80/70 — new code 80%, modified 70%',
|
|
152
|
-
'custom — enter your own values',
|
|
153
|
-
'none — 0/0, no coverage enforcement',
|
|
154
|
-
]);
|
|
155
|
-
let coverageNew = 90;
|
|
156
|
-
let coverageModified = 80;
|
|
157
|
-
if (covIdx === 1) { coverageNew = 80; coverageModified = 70; }
|
|
158
|
-
else if (covIdx === 2) {
|
|
159
|
-
coverageNew = Number.parseInt(await askFreeText(rl, ' Coverage for new code (%): '), 10) || 0;
|
|
160
|
-
coverageModified = Number.parseInt(await askFreeText(rl, ' Coverage for modified code (%): '), 10) || 0;
|
|
161
|
-
} else if (covIdx === 3) { coverageNew = 0; coverageModified = 0; }
|
|
162
|
-
|
|
163
|
-
// Q6 — commit style
|
|
164
|
-
const commitChoice = await choose(rl, 'Q6 — Commit style:', [
|
|
165
|
-
'Conventional Commits — feat:, fix:, chore:, docs:',
|
|
166
|
-
'Gitmoji — emoji-prefixed conventional',
|
|
167
|
-
'Plain — no prefix, imperative sentence',
|
|
168
|
-
'Custom template — enter your own (placeholders: {type} {issue} {title})',
|
|
169
|
-
]);
|
|
170
|
-
let commit: string;
|
|
171
|
-
if (commitChoice === 3) {
|
|
172
|
-
commit = await askFreeText(rl, ' Commit template (e.g. {issue}: {title}): ');
|
|
173
|
-
} else {
|
|
174
|
-
commit = COMMIT_PRESETS[commitChoice + 1];
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// ---- Write config ----
|
|
178
|
-
if (!existsSync(mugiwaraDir)) mkdirSync(mugiwaraDir, { recursive: true });
|
|
179
|
-
const body = buildConfig(existing, {
|
|
180
|
-
mode,
|
|
181
|
-
branch,
|
|
182
|
-
commit,
|
|
183
|
-
coverage_new: String(coverageNew),
|
|
184
|
-
coverage_modified: String(coverageModified),
|
|
185
|
-
review_depth: reviewDepth,
|
|
186
|
-
quality_depth: qualityDepth,
|
|
187
|
-
});
|
|
188
|
-
writeFileSync(configPath, `# .mugiwara/config — written by mugiwara onboard on ${new Date().toISOString().slice(0, 10)}\n${body}`);
|
|
189
|
-
|
|
190
|
-
// ---- Summary ----
|
|
191
|
-
console.log('╔══════════════════════════════════════╗');
|
|
192
|
-
console.log('║ Onboarding Complete ║');
|
|
193
|
-
console.log('╚══════════════════════════════════════╝');
|
|
194
|
-
console.log('');
|
|
195
|
-
console.log(` Branch pattern: ${branch}`);
|
|
196
|
-
console.log(` Autonomy mode: ${mode}`);
|
|
197
|
-
console.log(` Review depth: ${reviewDepth}`);
|
|
198
|
-
console.log(` Quality depth: ${qualityDepth}`);
|
|
199
|
-
console.log(` Coverage: ${coverageNew}/${coverageModified}`);
|
|
200
|
-
console.log(` Commit style: ${commit}`);
|
|
201
|
-
console.log('');
|
|
202
|
-
console.log(` Config written: ${configPath}`);
|
|
203
|
-
console.log('');
|
|
204
|
-
} finally {
|
|
205
|
-
rl.close();
|
|
206
|
-
}
|
|
207
|
-
}
|