mustflow 2.99.2 → 2.103.10
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/dist/cli/commands/run.js +11 -0
- package/dist/cli/commands/skill.js +76 -2
- package/dist/cli/i18n/en.js +2 -0
- package/dist/cli/i18n/es.js +2 -0
- package/dist/cli/i18n/fr.js +2 -0
- package/dist/cli/i18n/hi.js +2 -0
- package/dist/cli/i18n/ko.js +2 -0
- package/dist/cli/i18n/zh.js +2 -0
- package/dist/cli/lib/external-skill-import.js +455 -0
- package/dist/cli/lib/local-index/index.js +5 -1
- package/dist/cli/lib/local-index/sql.js +9 -1
- package/dist/cli/lib/run-plan.js +37 -0
- package/dist/core/change-impact.js +16 -0
- package/dist/core/code-outline.js +3 -13
- package/dist/core/config-chain.js +3 -13
- package/dist/core/dependency-graph.js +3 -13
- package/dist/core/docs-link-integrity.js +23 -4
- package/dist/core/env-contract.js +3 -13
- package/dist/core/export-diff.js +3 -3
- package/dist/core/ignored-directories.js +40 -0
- package/dist/core/public-json-contracts.js +16 -0
- package/dist/core/reference-drift.js +4 -2
- package/dist/core/related-files.js +3 -13
- package/dist/core/repo-merge-conflict-scan.js +3 -9
- package/dist/core/route-outline.js +3 -13
- package/dist/core/script-pack-suggestions.js +23 -12
- package/dist/core/secret-risk-scan.js +3 -13
- package/dist/core/skill-route-resolution.js +74 -6
- package/package.json +2 -2
- package/schemas/README.md +3 -0
- package/schemas/link-integrity-report.schema.json +1 -0
- package/schemas/reference-drift-report.schema.json +1 -0
- package/schemas/skill-import-report.schema.json +97 -0
- package/templates/default/i18n.toml +52 -10
- package/templates/default/locales/en/.mustflow/skills/INDEX.md +22 -2
- package/templates/default/locales/en/.mustflow/skills/ai-generated-code-hardening/SKILL.md +30 -7
- package/templates/default/locales/en/.mustflow/skills/api-request-performance-review/SKILL.md +12 -6
- package/templates/default/locales/en/.mustflow/skills/c-code-change/SKILL.md +371 -0
- package/templates/default/locales/en/.mustflow/skills/clarifying-question-gate/SKILL.md +53 -14
- package/templates/default/locales/en/.mustflow/skills/completion-evidence-gate/SKILL.md +26 -3
- package/templates/default/locales/en/.mustflow/skills/css-code-change/SKILL.md +74 -24
- package/templates/default/locales/en/.mustflow/skills/docs-prose-review/SKILL.md +36 -10
- package/templates/default/locales/en/.mustflow/skills/github-contribution-quality-gate/SKILL.md +27 -3
- package/templates/default/locales/en/.mustflow/skills/hot-path-performance-review/SKILL.md +20 -15
- package/templates/default/locales/en/.mustflow/skills/html-code-change/SKILL.md +37 -21
- package/templates/default/locales/en/.mustflow/skills/next-action-menu/SKILL.md +22 -7
- package/templates/default/locales/en/.mustflow/skills/quadratic-scan-review/SKILL.md +21 -19
- package/templates/default/locales/en/.mustflow/skills/react-code-change/SKILL.md +324 -0
- package/templates/default/locales/en/.mustflow/skills/routes.toml +24 -0
- package/templates/default/locales/en/.mustflow/skills/shell-code-change/SKILL.md +279 -0
- package/templates/default/locales/en/.mustflow/skills/structured-config-change/SKILL.md +170 -0
- package/templates/default/locales/en/.mustflow/skills/vertical-slice-tdd/SKILL.md +22 -8
- package/templates/default/manifest.toml +29 -1
package/dist/cli/commands/run.js
CHANGED
|
@@ -79,6 +79,14 @@ function reportRunPlanFailure(plan, reporter, lang) {
|
|
|
79
79
|
detail: getRunPlanDetail(plan, lang, 'run.error.blockedLongRunningCommandDetail'),
|
|
80
80
|
});
|
|
81
81
|
break;
|
|
82
|
+
case 'network_requires_approval':
|
|
83
|
+
case 'destructive_requires_approval':
|
|
84
|
+
case 'approval_policy_unreadable':
|
|
85
|
+
message = t(lang, 'run.error.approvalRequired', {
|
|
86
|
+
intent: plan.intentName,
|
|
87
|
+
detail: getRunPlanDetail(plan, lang, 'run.error.approvalRequiredDetail'),
|
|
88
|
+
});
|
|
89
|
+
break;
|
|
82
90
|
case 'cwd_outside_project':
|
|
83
91
|
message = t(lang, 'run.error.cwdOutsideProject', {
|
|
84
92
|
intent: plan.intentName,
|
|
@@ -327,6 +335,9 @@ export async function runRun(args, reporter, lang = 'en', options = {}) {
|
|
|
327
335
|
return plan.ok ? 0 : 1;
|
|
328
336
|
}
|
|
329
337
|
if (!plan.ok) {
|
|
338
|
+
if (json) {
|
|
339
|
+
reporter.stdout(JSON.stringify(createRunPreview(plan, 'plan-only'), null, 2));
|
|
340
|
+
}
|
|
330
341
|
reportRunPlanFailure(plan, reporter, lang);
|
|
331
342
|
writeLatestProfile(profiler, options, {
|
|
332
343
|
projectRoot,
|
|
@@ -5,28 +5,41 @@ import { resolveMustflowRoot } from '../lib/project-root.js';
|
|
|
5
5
|
import { listScriptPackScripts } from '../lib/script-pack-registry.js';
|
|
6
6
|
import { createScriptPackSuggestionReport, } from '../../core/script-pack-suggestions.js';
|
|
7
7
|
import { resolveSkillRoutes } from '../../core/skill-route-resolution.js';
|
|
8
|
+
import { createExternalSkillImportReport, } from '../lib/external-skill-import.js';
|
|
8
9
|
const SKILL_OPTIONS = [
|
|
9
10
|
{ name: '--json', kind: 'boolean' },
|
|
10
11
|
{ name: '--task', kind: 'string' },
|
|
11
12
|
{ name: '--path', kind: 'string' },
|
|
12
13
|
{ name: '--reason', kind: 'string' },
|
|
13
14
|
{ name: '--max-candidates', kind: 'string' },
|
|
15
|
+
{ name: '--install', kind: 'boolean' },
|
|
16
|
+
{ name: '--dry-run', kind: 'boolean' },
|
|
17
|
+
{ name: '--name', kind: 'string' },
|
|
18
|
+
{ name: '--ref', kind: 'string' },
|
|
14
19
|
];
|
|
15
20
|
export function getSkillHelp(lang = 'en') {
|
|
16
21
|
return renderHelp({
|
|
17
22
|
usage: 'mf skill route [options]',
|
|
18
23
|
summary: t(lang, 'command.skill.summary'),
|
|
19
24
|
options: [
|
|
25
|
+
{ label: 'route', description: 'Resolve installed skill route candidates' },
|
|
26
|
+
{ label: 'import <github-url>', description: 'Preview or install an external SKILL.md under .mustflow/external-skills/' },
|
|
20
27
|
{ label: '--task <text>', description: 'Task text used for route scoring' },
|
|
21
28
|
{ label: '--path <path>', description: 'Changed or expected path; may be repeated' },
|
|
22
29
|
{ label: '--reason <reason>', description: 'Classification or verification reason; may be repeated' },
|
|
23
30
|
{ label: '--max-candidates <count>', description: 'Maximum candidates to return, from 1 to 10' },
|
|
31
|
+
{ label: '--dry-run', description: 'Preview an external skill import without writing files; default for import' },
|
|
32
|
+
{ label: '--install', description: 'Install an external skill after previewing the same source' },
|
|
33
|
+
{ label: '--name <slug>', description: 'Override the installed external skill directory name' },
|
|
34
|
+
{ label: '--ref <ref>', description: 'Override the GitHub ref used for import' },
|
|
24
35
|
{ label: '--json', description: t(lang, 'cli.option.json') },
|
|
25
36
|
{ label: '-h, --help', description: t(lang, 'cli.option.help') },
|
|
26
37
|
],
|
|
27
38
|
examples: [
|
|
28
39
|
'mf skill route --task "change TypeScript CLI output" --path src/cli/index.ts --reason code_change --json',
|
|
29
40
|
'mf skill route --reason docs_change --path docs-site/src/content/docs/en/commands/context.md',
|
|
41
|
+
'mf skill import https://github.com/example/agent-skills/tree/main/review/security --dry-run --json',
|
|
42
|
+
'mf skill import https://github.com/example/agent-skills/blob/main/review/security/SKILL.md --install',
|
|
30
43
|
],
|
|
31
44
|
exitCodes: [
|
|
32
45
|
{ label: '0', description: 'Skill route candidates were resolved' },
|
|
@@ -51,10 +64,15 @@ function parseSkillArgs(args) {
|
|
|
51
64
|
return {
|
|
52
65
|
json: hasParsedCliOption(parsed, '--json'),
|
|
53
66
|
action: parsed.positionals[0] ?? null,
|
|
67
|
+
sourceUrl: parsed.positionals[1] ?? null,
|
|
54
68
|
taskText: getParsedCliStringOption(parsed, '--task'),
|
|
55
69
|
paths: getParsedCliStringOptions(parsed, '--path'),
|
|
56
70
|
reasons: getParsedCliStringOptions(parsed, '--reason'),
|
|
57
71
|
maxCandidates: parseMaxCandidates(getParsedCliStringOption(parsed, '--max-candidates')),
|
|
72
|
+
install: hasParsedCliOption(parsed, '--install'),
|
|
73
|
+
dryRun: hasParsedCliOption(parsed, '--dry-run'),
|
|
74
|
+
name: getParsedCliStringOption(parsed, '--name'),
|
|
75
|
+
ref: getParsedCliStringOption(parsed, '--ref'),
|
|
58
76
|
error: parsed.error,
|
|
59
77
|
};
|
|
60
78
|
}
|
|
@@ -101,7 +119,40 @@ function renderSkillRouteReport(report, lang) {
|
|
|
101
119
|
lines.push('', 'Read plan', ...report.read_plan.selected_skill_paths.map((skillPath) => `- read selected skill: ${skillPath}`), `- avoid by default: ${report.read_plan.avoid_by_default.join(', ') || t(lang, 'value.none')}`, `- fallback route metadata: ${report.read_plan.fallback_route_metadata.path}`, '', 'Source files', ...report.source_files.map((sourceFile) => `- ${sourceFile}`));
|
|
102
120
|
return lines.join('\n');
|
|
103
121
|
}
|
|
104
|
-
|
|
122
|
+
function renderSkillImportReport(report) {
|
|
123
|
+
const lines = [
|
|
124
|
+
'mustflow skill import',
|
|
125
|
+
`status: ${report.status}`,
|
|
126
|
+
`mode: ${report.mode}`,
|
|
127
|
+
`source: ${report.source?.source_url ?? 'none'}`,
|
|
128
|
+
`target: ${report.target?.skill_dir ?? 'none'}`,
|
|
129
|
+
`wrote_files: ${String(report.wrote_files)}`,
|
|
130
|
+
'',
|
|
131
|
+
'Files',
|
|
132
|
+
];
|
|
133
|
+
if (report.files.length === 0) {
|
|
134
|
+
lines.push('- none');
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
for (const file of report.files) {
|
|
138
|
+
lines.push(`- ${file.relative_path} (${file.kind}, ${file.bytes} bytes, ${file.sha256})`);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (report.warnings.length > 0) {
|
|
142
|
+
lines.push('', 'Warnings', ...report.warnings.map((warning) => `- ${warning}`));
|
|
143
|
+
}
|
|
144
|
+
if (report.issues.length > 0) {
|
|
145
|
+
lines.push('', 'Issues', ...report.issues.map((issue) => `- ${issue}`));
|
|
146
|
+
}
|
|
147
|
+
return lines.join('\n');
|
|
148
|
+
}
|
|
149
|
+
function parseImportMode(parsed) {
|
|
150
|
+
if (parsed.install && parsed.dryRun) {
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
return parsed.install ? 'install' : 'dry_run';
|
|
154
|
+
}
|
|
155
|
+
export async function runSkill(args, reporter, lang = 'en') {
|
|
105
156
|
if (hasCliOptionToken(args, '--help', ['-h'])) {
|
|
106
157
|
reporter.stdout(getSkillHelp(lang));
|
|
107
158
|
return 0;
|
|
@@ -111,13 +162,36 @@ export function runSkill(args, reporter, lang = 'en') {
|
|
|
111
162
|
printUsageError(reporter, formatCliOptionParseError(parsed.error, lang), 'mf skill --help', getSkillHelp(lang), lang);
|
|
112
163
|
return 1;
|
|
113
164
|
}
|
|
114
|
-
if (parsed.action !== 'route') {
|
|
165
|
+
if (parsed.action !== 'route' && parsed.action !== 'import') {
|
|
115
166
|
printUsageError(reporter, t(lang, parsed.action ? 'cli.error.unexpectedArgument' : 'cli.error.missingValue', {
|
|
116
167
|
argument: parsed.action ?? '',
|
|
117
168
|
option: 'route',
|
|
118
169
|
}), 'mf skill --help', getSkillHelp(lang), lang);
|
|
119
170
|
return 1;
|
|
120
171
|
}
|
|
172
|
+
if (parsed.action === 'import') {
|
|
173
|
+
const mode = parseImportMode(parsed);
|
|
174
|
+
if (mode === null) {
|
|
175
|
+
printUsageError(reporter, t(lang, 'cli.error.unexpectedValue', { option: '--install/--dry-run' }), 'mf skill --help', getSkillHelp(lang), lang);
|
|
176
|
+
return 1;
|
|
177
|
+
}
|
|
178
|
+
if (!parsed.sourceUrl) {
|
|
179
|
+
printUsageError(reporter, t(lang, 'cli.error.missingValue', { option: 'import <github-url>' }), 'mf skill --help', getSkillHelp(lang), lang);
|
|
180
|
+
return 1;
|
|
181
|
+
}
|
|
182
|
+
const report = await createExternalSkillImportReport(resolveMustflowRoot(), parsed.sourceUrl, {
|
|
183
|
+
mode,
|
|
184
|
+
name: parsed.name,
|
|
185
|
+
ref: parsed.ref,
|
|
186
|
+
});
|
|
187
|
+
if (parsed.json) {
|
|
188
|
+
reporter.stdout(JSON.stringify(report, null, 2));
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
reporter.stdout(renderSkillImportReport(report));
|
|
192
|
+
}
|
|
193
|
+
return report.ok ? 0 : 1;
|
|
194
|
+
}
|
|
121
195
|
if (Number.isNaN(parsed.maxCandidates)) {
|
|
122
196
|
printUsageError(reporter, t(lang, 'cli.error.unexpectedValue', { option: '--max-candidates' }), 'mf skill --help', getSkillHelp(lang), lang);
|
|
123
197
|
return 1;
|
package/dist/cli/i18n/en.js
CHANGED
|
@@ -1238,6 +1238,8 @@ Read these files before working:
|
|
|
1238
1238
|
"run.error.blockedShellBackgroundDetail": "Shell commands must not spawn background work.",
|
|
1239
1239
|
"run.error.blockedLongRunningCommand": 'Intent "{intent}" is blocked. {detail}',
|
|
1240
1240
|
"run.error.blockedLongRunningCommandDetail": "Command argv must describe a finite one-shot command, not a development server, watcher, shell wrapper, interpreter loop, or background process.",
|
|
1241
|
+
"run.error.approvalRequired": 'Intent "{intent}" requires approval. {detail}',
|
|
1242
|
+
"run.error.approvalRequiredDetail": "The repository approval policy requires explicit approval before this command intent can run.",
|
|
1241
1243
|
"run.error.cwdOutsideProject": 'Command "{intent}" has an invalid cwd: {detail}',
|
|
1242
1244
|
"run.error.cwdOutsideProjectDetail": "Intent cwd must stay inside the current root.",
|
|
1243
1245
|
"run.error.invalidTestTarget": 'Command "{intent}" received an invalid test target. {detail}',
|
package/dist/cli/i18n/es.js
CHANGED
|
@@ -1238,6 +1238,8 @@ Lee estos archivos antes de trabajar:
|
|
|
1238
1238
|
"run.error.blockedShellBackgroundDetail": "Los comandos de shell no deben iniciar trabajo en segundo plano.",
|
|
1239
1239
|
"run.error.blockedLongRunningCommand": 'La intención "{intent}" está bloqueada. {detail}',
|
|
1240
1240
|
"run.error.blockedLongRunningCommandDetail": "argv debe describir un comando finito de una sola ejecución, no un servidor de desarrollo, watcher, envoltorio de shell, bucle de intérprete o proceso en segundo plano.",
|
|
1241
|
+
"run.error.approvalRequired": 'La intención "{intent}" requiere aprobación. {detail}',
|
|
1242
|
+
"run.error.approvalRequiredDetail": "La política de aprobación del repositorio requiere aprobación explícita antes de ejecutar esta intención de comando.",
|
|
1241
1243
|
"run.error.cwdOutsideProject": 'El comando "{intent}" tiene un cwd no válido: {detail}',
|
|
1242
1244
|
"run.error.cwdOutsideProjectDetail": "El cwd de la intención debe permanecer dentro de la raíz actual.",
|
|
1243
1245
|
"run.error.invalidTestTarget": 'El comando "{intent}" recibió un objetivo de prueba no válido. {detail}',
|
package/dist/cli/i18n/fr.js
CHANGED
|
@@ -1238,6 +1238,8 @@ Lisez ces fichiers avant de travailler :
|
|
|
1238
1238
|
"run.error.blockedShellBackgroundDetail": "Les commandes shell ne doivent pas lancer de travail en arrière-plan.",
|
|
1239
1239
|
"run.error.blockedLongRunningCommand": 'L’intention "{intent}" est bloquée. {detail}',
|
|
1240
1240
|
"run.error.blockedLongRunningCommandDetail": "argv doit décrire une commande ponctuelle finie, pas un serveur de développement, un watcher, un wrapper shell, une boucle d'interpréteur ou un processus en arrière-plan.",
|
|
1241
|
+
"run.error.approvalRequired": 'L’intention "{intent}" nécessite une approbation. {detail}',
|
|
1242
|
+
"run.error.approvalRequiredDetail": "La politique d’approbation du dépôt exige une approbation explicite avant d’exécuter cette intention de commande.",
|
|
1241
1243
|
"run.error.cwdOutsideProject": 'La commande "{intent}" a un cwd non valide : {detail}',
|
|
1242
1244
|
"run.error.cwdOutsideProjectDetail": "Le cwd de l’intention doit rester dans la racine actuelle.",
|
|
1243
1245
|
"run.error.invalidTestTarget": 'La commande "{intent}" a reçu une cible de test invalide. {detail}',
|
package/dist/cli/i18n/hi.js
CHANGED
|
@@ -1238,6 +1238,8 @@ export const hiMessages = {
|
|
|
1238
1238
|
"run.error.blockedShellBackgroundDetail": "Shell commands background work शुरू नहीं कर सकतीं।",
|
|
1239
1239
|
"run.error.blockedLongRunningCommand": 'इंटेंट "{intent}" अवरुद्ध है। {detail}',
|
|
1240
1240
|
"run.error.blockedLongRunningCommandDetail": "argv में finite one-shot command होना चाहिए, development server, watcher, shell wrapper, interpreter loop, या background process नहीं।",
|
|
1241
|
+
"run.error.approvalRequired": 'इंटेंट "{intent}" को approval चाहिए। {detail}',
|
|
1242
|
+
"run.error.approvalRequiredDetail": "Repository approval policy के अनुसार इस command intent को चलाने से पहले explicit approval चाहिए।",
|
|
1241
1243
|
"run.error.cwdOutsideProject": 'कमांड "{intent}" का cwd अमान्य है: {detail}',
|
|
1242
1244
|
"run.error.cwdOutsideProjectDetail": "Intent cwd current root के अंदर रहना चाहिए।",
|
|
1243
1245
|
"run.error.invalidTestTarget": 'कमांड "{intent}" को अमान्य test target मिला। {detail}',
|
package/dist/cli/i18n/ko.js
CHANGED
|
@@ -1238,6 +1238,8 @@ export const koMessages = {
|
|
|
1238
1238
|
"run.error.blockedShellBackgroundDetail": "셸 명령은 백그라운드 작업을 시작하면 안 됩니다.",
|
|
1239
1239
|
"run.error.blockedLongRunningCommand": '명령 의도 "{intent}"가 차단되었습니다. {detail}',
|
|
1240
1240
|
"run.error.blockedLongRunningCommandDetail": "argv는 개발 서버, 감시 명령, 셸 래퍼, 인터프리터 반복 작업, 백그라운드 프로세스가 아니라 끝나는 단발성 명령이어야 합니다.",
|
|
1241
|
+
"run.error.approvalRequired": '명령 의도 "{intent}"는 승인이 필요합니다. {detail}',
|
|
1242
|
+
"run.error.approvalRequiredDetail": "저장소 승인 정책상 이 명령 의도를 실행하기 전에 명시적 승인이 필요합니다.",
|
|
1241
1243
|
"run.error.cwdOutsideProject": '명령 "{intent}"의 실행 위치(cwd)가 올바르지 않습니다: {detail}',
|
|
1242
1244
|
"run.error.cwdOutsideProjectDetail": "명령 실행 위치(cwd)는 현재 루트 안에 있어야 합니다.",
|
|
1243
1245
|
"run.error.invalidTestTarget": '명령 "{intent}"에 올바르지 않은 테스트 대상이 전달되었습니다. {detail}',
|
package/dist/cli/i18n/zh.js
CHANGED
|
@@ -1238,6 +1238,8 @@ export const zhMessages = {
|
|
|
1238
1238
|
"run.error.blockedShellBackgroundDetail": "Shell 命令不得启动后台工作。",
|
|
1239
1239
|
"run.error.blockedLongRunningCommand": '意图 "{intent}" 已被阻止。{detail}',
|
|
1240
1240
|
"run.error.blockedLongRunningCommandDetail": "argv 必须描述会结束的单次命令,而不是开发服务器、监听命令、shell 包装器、解释器循环或后台进程。",
|
|
1241
|
+
"run.error.approvalRequired": '意图 "{intent}" 需要审批。{detail}',
|
|
1242
|
+
"run.error.approvalRequiredDetail": "仓库审批策略要求在运行此命令意图前获得明确审批。",
|
|
1241
1243
|
"run.error.cwdOutsideProject": '命令 "{intent}" 的 cwd 无效:{detail}',
|
|
1242
1244
|
"run.error.cwdOutsideProjectDetail": "意图 cwd 必须位于当前根目录内。",
|
|
1243
1245
|
"run.error.invalidTestTarget": '命令 "{intent}" 收到无效测试目标。{detail}',
|