mustflow 2.74.6 → 2.74.7

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.
@@ -2,6 +2,8 @@ import { printUsageError, renderHelp } from '../lib/cli-output.js';
2
2
  import { t } from '../lib/i18n.js';
3
3
  import { formatCliOptionParseError, getParsedCliStringOption, hasCliOptionToken, hasParsedCliOption, parseCliOptions, } from '../lib/option-parser.js';
4
4
  import { resolveMustflowRoot } from '../lib/project-root.js';
5
+ import { listScriptPackScripts } from '../lib/script-pack-registry.js';
6
+ import { createScriptPackSuggestionReport, } from '../../core/script-pack-suggestions.js';
5
7
  import { resolveSkillRoutes } from '../../core/skill-route-resolution.js';
6
8
  const SKILL_OPTIONS = [
7
9
  { name: '--json', kind: 'boolean' },
@@ -56,6 +58,29 @@ function parseSkillArgs(args) {
56
58
  error: parsed.error,
57
59
  };
58
60
  }
61
+ function selectedSkillNames(report) {
62
+ return [...new Set([
63
+ ...(report.selected.main ? [report.selected.main.skill] : []),
64
+ ...report.selected.adjuncts.map((candidate) => candidate.skill),
65
+ ...report.candidates.map((candidate) => candidate.skill),
66
+ ])];
67
+ }
68
+ function createSkillRouteScriptPackSuggestions(mustflowRoot, report, paths) {
69
+ const suggestionReport = createScriptPackSuggestionReport(mustflowRoot, {
70
+ changed: false,
71
+ phases: ['before_change', 'during_change', 'review'],
72
+ skills: selectedSkillNames(report),
73
+ paths,
74
+ scripts: listScriptPackScripts(),
75
+ });
76
+ return {
77
+ status: suggestionReport.status,
78
+ input: suggestionReport.input,
79
+ analyzed_paths: suggestionReport.analyzed_paths,
80
+ suggestions: suggestionReport.suggestions,
81
+ issues: suggestionReport.issues,
82
+ };
83
+ }
59
84
  function renderSkillRouteReport(report, lang) {
60
85
  const lines = [
61
86
  'mustflow skill route',
@@ -97,7 +122,8 @@ export function runSkill(args, reporter, lang = 'en') {
97
122
  printUsageError(reporter, t(lang, 'cli.error.unexpectedValue', { option: '--max-candidates' }), 'mf skill --help', getSkillHelp(lang), lang);
98
123
  return 1;
99
124
  }
100
- const report = resolveSkillRoutes(resolveMustflowRoot(), {
125
+ const mustflowRoot = resolveMustflowRoot();
126
+ const report = resolveSkillRoutes(mustflowRoot, {
101
127
  taskText: parsed.taskText,
102
128
  paths: parsed.paths,
103
129
  reasons: parsed.reasons,
@@ -108,6 +134,7 @@ export function runSkill(args, reporter, lang = 'en') {
108
134
  ...report,
109
135
  command: 'skill',
110
136
  action: 'route',
137
+ script_pack_suggestions: createSkillRouteScriptPackSuggestions(mustflowRoot, report, parsed.paths),
111
138
  }, null, 2));
112
139
  return 0;
113
140
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mustflow",
3
- "version": "2.74.6",
3
+ "version": "2.74.7",
4
4
  "description": "Agent workflow documents and CLI for mustflow repository roots.",
5
5
  "type": "module",
6
6
  "license": "MIT-0",
package/schemas/README.md CHANGED
@@ -72,8 +72,9 @@ Current schemas:
72
72
  `mf script-pack run repo/generated-boundary check <path...> --json`, containing candidate path
73
73
  classifications for generated, ignored, protected, vendor, and cache boundaries before or after edits
74
74
  - `skill-route-report.schema.json`: output of `mf skill route --json`, containing compact route
75
- candidates, selected main and adjunct skills, score breakdowns, route read plans, and source
76
- route shards without granting command authority or replacing selected `SKILL.md` reads
75
+ candidates, selected main and adjunct skills, score breakdowns, route read plans, source route
76
+ shards, and optional read-only script-pack helper suggestions without granting command authority
77
+ or replacing selected `SKILL.md` reads
77
78
  - `route-fixture.schema.json`: parsed `.mustflow/skills/route-fixtures.json`, containing strict
78
79
  skill-route golden cases with required and forbidden route expectations
79
80
  - `latest-run-pointer.schema.json`: `.mustflow/state/runs/latest.json` when `mf verify` writes a
@@ -153,9 +153,147 @@
153
153
  "gap_notes": {
154
154
  "type": "array",
155
155
  "items": { "type": "string" }
156
+ },
157
+ "script_pack_suggestions": {
158
+ "type": "object",
159
+ "additionalProperties": false,
160
+ "required": ["status", "input", "analyzed_paths", "suggestions", "issues"],
161
+ "properties": {
162
+ "status": { "type": "string", "enum": ["suggested", "empty", "partial"] },
163
+ "input": { "$ref": "#/$defs/scriptPackSuggestionInput" },
164
+ "analyzed_paths": {
165
+ "type": "array",
166
+ "items": { "$ref": "#/$defs/scriptPackAnalyzedPath" }
167
+ },
168
+ "suggestions": {
169
+ "type": "array",
170
+ "items": { "$ref": "#/$defs/scriptPackSuggestion" }
171
+ },
172
+ "issues": {
173
+ "type": "array",
174
+ "items": { "type": "string" }
175
+ }
176
+ }
156
177
  }
157
178
  },
158
179
  "$defs": {
180
+ "scriptPackPhase": {
181
+ "type": "string",
182
+ "enum": ["before_change", "during_change", "after_change", "review"]
183
+ },
184
+ "scriptPackSurface": {
185
+ "type": "string",
186
+ "enum": [
187
+ "config",
188
+ "docs",
189
+ "generated",
190
+ "package",
191
+ "schema",
192
+ "skill",
193
+ "source",
194
+ "template",
195
+ "test",
196
+ "unknown"
197
+ ]
198
+ },
199
+ "scriptPackSuggestionInput": {
200
+ "type": "object",
201
+ "additionalProperties": false,
202
+ "required": ["phases", "skills", "paths", "changed"],
203
+ "properties": {
204
+ "phases": {
205
+ "type": "array",
206
+ "items": { "$ref": "#/$defs/scriptPackPhase" }
207
+ },
208
+ "skills": {
209
+ "type": "array",
210
+ "items": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" }
211
+ },
212
+ "paths": {
213
+ "type": "array",
214
+ "items": { "type": "string" }
215
+ },
216
+ "changed": { "type": "boolean" }
217
+ }
218
+ },
219
+ "scriptPackAnalyzedPath": {
220
+ "type": "object",
221
+ "additionalProperties": false,
222
+ "required": ["path", "surfaces"],
223
+ "properties": {
224
+ "path": { "type": "string" },
225
+ "surfaces": {
226
+ "type": "array",
227
+ "items": { "$ref": "#/$defs/scriptPackSurface" },
228
+ "minItems": 1
229
+ }
230
+ }
231
+ },
232
+ "scriptPackSuggestion": {
233
+ "type": "object",
234
+ "additionalProperties": false,
235
+ "required": [
236
+ "script_ref",
237
+ "score",
238
+ "confidence",
239
+ "usage",
240
+ "phases",
241
+ "matched_phases",
242
+ "matched_skills",
243
+ "matched_surfaces",
244
+ "reasons",
245
+ "read_only",
246
+ "mutates",
247
+ "network",
248
+ "risk_level",
249
+ "cost",
250
+ "report_schema_file",
251
+ "run_hint"
252
+ ],
253
+ "properties": {
254
+ "script_ref": {
255
+ "type": "string",
256
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*/[a-z0-9]+(?:-[a-z0-9]+)*$"
257
+ },
258
+ "score": { "type": "integer", "minimum": 0 },
259
+ "confidence": { "type": "string", "enum": ["low", "medium", "high"] },
260
+ "usage": { "type": "string" },
261
+ "phases": {
262
+ "type": "array",
263
+ "items": { "$ref": "#/$defs/scriptPackPhase" },
264
+ "minItems": 1
265
+ },
266
+ "matched_phases": {
267
+ "type": "array",
268
+ "items": { "$ref": "#/$defs/scriptPackPhase" }
269
+ },
270
+ "matched_skills": {
271
+ "type": "array",
272
+ "items": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" }
273
+ },
274
+ "matched_surfaces": {
275
+ "type": "array",
276
+ "items": { "$ref": "#/$defs/scriptPackSurface" }
277
+ },
278
+ "reasons": {
279
+ "type": "array",
280
+ "items": { "type": "string" },
281
+ "minItems": 1
282
+ },
283
+ "read_only": { "type": "boolean" },
284
+ "mutates": { "type": "boolean" },
285
+ "network": { "type": "boolean" },
286
+ "risk_level": { "type": "string", "enum": ["low", "medium", "high"] },
287
+ "cost": { "type": "string", "enum": ["low", "medium", "high"] },
288
+ "report_schema_file": {
289
+ "anyOf": [
290
+ { "type": "string", "pattern": "^[a-z0-9-]+\\.schema\\.json$" },
291
+ { "type": "null" }
292
+ ]
293
+ },
294
+ "run_hint": { "type": "string" }
295
+ }
296
+ },
159
297
  "candidate": {
160
298
  "type": "object",
161
299
  "additionalProperties": false,
@@ -1,6 +1,6 @@
1
1
  id = "default"
2
2
  name = "default"
3
- version = "2.74.6"
3
+ version = "2.74.7"
4
4
  description = "Minimal workflow for LLM agents to read, edit, and verify their work in a repository."
5
5
  common_root = "common"
6
6
  locales_root = "locales"