mustflow 2.27.0 → 2.29.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 (52) hide show
  1. package/README.md +2 -2
  2. package/dist/cli/commands/context.js +1 -0
  3. package/dist/cli/commands/help.js +55 -1
  4. package/dist/cli/commands/tech.js +346 -0
  5. package/dist/cli/i18n/en.js +1 -0
  6. package/dist/cli/i18n/es.js +1 -0
  7. package/dist/cli/i18n/fr.js +1 -0
  8. package/dist/cli/i18n/hi.js +1 -0
  9. package/dist/cli/i18n/ko.js +1 -0
  10. package/dist/cli/i18n/zh.js +1 -0
  11. package/dist/cli/index.js +1 -0
  12. package/dist/cli/lib/agent-context.js +16 -0
  13. package/dist/cli/lib/command-registry.js +6 -0
  14. package/dist/cli/lib/run-plan.js +11 -3
  15. package/dist/cli/lib/validation/index.js +11 -0
  16. package/dist/cli/lib/validation/primitives.js +5 -0
  17. package/dist/core/command-contract-validation.js +15 -12
  18. package/dist/core/command-env.js +43 -0
  19. package/dist/core/command-intent-eligibility.js +2 -1
  20. package/dist/core/contract-lint.js +2 -1
  21. package/dist/core/technology-preferences.js +189 -0
  22. package/package.json +1 -1
  23. package/schemas/commands.schema.json +4 -1
  24. package/schemas/context-report.schema.json +61 -0
  25. package/templates/default/common/.mustflow/config/commands.toml +1 -0
  26. package/templates/default/common/.mustflow/config/mustflow.toml +8 -0
  27. package/templates/default/common/.mustflow/config/technology.toml +20 -0
  28. package/templates/default/i18n.toml +78 -12
  29. package/templates/default/locales/en/.mustflow/skills/INDEX.md +33 -1
  30. package/templates/default/locales/en/.mustflow/skills/code-review/SKILL.md +15 -5
  31. package/templates/default/locales/en/.mustflow/skills/codebase-orientation/SKILL.md +15 -8
  32. package/templates/default/locales/en/.mustflow/skills/command-intent-mapping-gate/SKILL.md +124 -0
  33. package/templates/default/locales/en/.mustflow/skills/completion-evidence-gate/SKILL.md +178 -0
  34. package/templates/default/locales/en/.mustflow/skills/contract-sync-check/SKILL.md +9 -3
  35. package/templates/default/locales/en/.mustflow/skills/dependency-reality-check/SKILL.md +6 -3
  36. package/templates/default/locales/en/.mustflow/skills/evidence-stall-breaker/SKILL.md +166 -0
  37. package/templates/default/locales/en/.mustflow/skills/external-prompt-injection-defense/SKILL.md +8 -6
  38. package/templates/default/locales/en/.mustflow/skills/provenance-license-gate/SKILL.md +131 -0
  39. package/templates/default/locales/en/.mustflow/skills/public-json-contract-change/SKILL.md +133 -0
  40. package/templates/default/locales/en/.mustflow/skills/restricted-handoff-resume/SKILL.md +122 -0
  41. package/templates/default/locales/en/.mustflow/skills/routes.toml +60 -0
  42. package/templates/default/locales/en/.mustflow/skills/runtime-target-selection/SKILL.md +203 -0
  43. package/templates/default/locales/en/.mustflow/skills/rust-code-change/SKILL.md +55 -18
  44. package/templates/default/locales/en/.mustflow/skills/secret-exposure-response/SKILL.md +125 -0
  45. package/templates/default/locales/en/.mustflow/skills/security-privacy-review/SKILL.md +10 -1
  46. package/templates/default/locales/en/.mustflow/skills/skill-authoring/SKILL.md +9 -5
  47. package/templates/default/locales/en/.mustflow/skills/source-freshness-check/SKILL.md +3 -2
  48. package/templates/default/locales/en/.mustflow/skills/structure-first-engineering/SKILL.md +205 -0
  49. package/templates/default/locales/en/.mustflow/skills/template-install-surface-sync/SKILL.md +131 -0
  50. package/templates/default/locales/en/AGENTS.md +8 -7
  51. package/templates/default/locales/ko/AGENTS.md +8 -7
  52. package/templates/default/manifest.toml +66 -1
@@ -0,0 +1,133 @@
1
+ ---
2
+ mustflow_doc: skill.public-json-contract-change
3
+ locale: en
4
+ canonical: true
5
+ revision: 1
6
+ lifecycle: mustflow-owned
7
+ authority: procedure
8
+ name: public-json-contract-change
9
+ description: Apply this skill when public machine-readable JSON, JSONL, schema-backed reports, stdout/stderr machine output, exit-code semantics tied to JSON output, compatibility fixtures, or documented automation-facing JSON contracts are created, changed, reviewed, or reported.
10
+ metadata:
11
+ mustflow_schema: "1"
12
+ mustflow_kind: procedure
13
+ pack_id: mustflow.core
14
+ skill_id: mustflow.core.public-json-contract-change
15
+ command_intents:
16
+ - changes_status
17
+ - changes_diff_summary
18
+ - test_related
19
+ - docs_validate_fast
20
+ - test_release
21
+ - mustflow_check
22
+ ---
23
+
24
+ # Public JSON Contract Change
25
+
26
+ <!-- mustflow-section: purpose -->
27
+ ## Purpose
28
+
29
+ Protect automation consumers from silent JSON, JSONL, stream, schema, fixture, and exit-code drift.
30
+
31
+ <!-- mustflow-section: use-when -->
32
+ ## Use When
33
+
34
+ - A command, report, exported file, package artifact, template, fixture, or documented example exposes JSON or JSONL to scripts, tests, schemas, dashboards, release checks, or other non-human consumers.
35
+ - A change adds, removes, renames, retypes, reclassifies, or documents a JSON field, JSONL packet, status value, schema version, path field, timestamp field, error shape, or compatibility fixture.
36
+ - A command's `--json`, `--jsonl`, `--format json`, schema-backed report, stdout/stderr split, or exit-code behavior changes.
37
+ - A compatibility claim depends on old fixtures, schema validation, package inclusion, or examples that users may parse.
38
+
39
+ <!-- mustflow-section: do-not-use-when -->
40
+ ## Do Not Use When
41
+
42
+ - The JSON is private in-process data with no public CLI, package, schema, fixture, template, documentation, or test contract.
43
+ - The task changes only human-readable CLI text, color, help wording, warnings, or deprecations; use `cli-output-contract-review`.
44
+ - The JSON is an HTTP, OpenAPI, GraphQL, RPC, or SDK request/response contract; use `api-contract-change`.
45
+ - The task is only a broad template or docs alignment check with no JSON contract; use `contract-sync-check` or a narrower template skill.
46
+
47
+ <!-- mustflow-section: required-inputs -->
48
+ ## Required Inputs
49
+
50
+ - Affected command, report, package artifact, fixture, or file path.
51
+ - Output modes: human text, JSON, JSONL, stdout, stderr, redirected or piped behavior, and terminal-only formatting.
52
+ - Exit-code expectations for success, partial success, validation failure, blocked, skipped, deprecated, and internal-error states.
53
+ - Current schema files, schema ids, schema versions, status enums, JSONL packet types, docs examples, package inclusion lists, tests, and old compatibility fixtures.
54
+ - Producer code, downstream parser or validator code when present, and known automation consumers.
55
+ - Compatibility policy or release expectation, including whether a break requires a version bump, deprecation period, or explicit migration note.
56
+ - Relevant command-intent entries for related tests, docs validation, release checks, and mustflow validation.
57
+
58
+ <!-- mustflow-section: preconditions -->
59
+ ## Preconditions
60
+
61
+ - The task matches the Use When conditions and does not match the Do Not Use When exclusions.
62
+ - Existing JSON tests, schemas, docs examples, package fixtures, and compatibility fixtures have been inspected before changing the contract.
63
+ - Command execution remains governed by `.mustflow/config/commands.toml`; this skill does not authorize raw commands.
64
+
65
+ <!-- mustflow-section: allowed-edits -->
66
+ ## Allowed Edits
67
+
68
+ - Update JSON producer code, schema files, fixtures, package inclusion metadata, docs examples, tests, and templates that describe the same public contract.
69
+ - Add optional fields, compatibility aliases, deprecation metadata, or explicit schema-version notes when they preserve consumers.
70
+ - Do not silently remove, rename, retype, require, reinterpret, or move public JSON fields.
71
+ - Do not mix prose, colors, progress text, or terminal controls into JSON stdout or JSONL streams.
72
+ - Do not route machine-readable results, diagnostics, and errors to streams inconsistently with the documented contract.
73
+ - Do not treat a snapshot or golden file as sufficient proof for JSON compatibility without field, stream, exit-code, and schema assertions.
74
+
75
+ <!-- mustflow-section: procedure -->
76
+ ## Procedure
77
+
78
+ 1. Identify every public machine-readable surface: command output mode, JSON object fields, JSONL packet types, stdout, stderr, exit code, schema file, fixture, package artifact, docs example, template copy, and compatibility fixture.
79
+ 2. Name the source of truth for the contract. Prefer explicit schemas and producer code for JSON shape, command code for exit status and streams, and package metadata for installed fixture availability.
80
+ 3. Map each contract surface to its consumer: human reader, script, parser, schema validator, release test, installed template, docs example, dashboard, or downstream repository.
81
+ 4. Classify the change as internal-only, additive-compatible, corrective-compatible, deprecating, compatibility-sensitive, or breaking.
82
+ 5. Treat these as compatibility-sensitive by default: required field addition, field removal, field rename, field type change, enum or status meaning change, constraint strengthening, object-to-array or array-to-object change, null versus missing-field change, timestamp format change, path normalization change, schema-version change, JSONL packet-type change, stream-routing change, and exit-code meaning change.
83
+ 6. Keep machine output pure. JSON stdout must contain parseable JSON only; JSONL must contain one structured JSON object per line; diagnostics, warnings, debug notes, and progress belong on stderr unless the contract says otherwise.
84
+ 7. Check JSONL finality. Streaming output should expose stable packet kinds and a final packet that carries completion status, timestamp semantics, and any partial, blocked, skipped, deprecated, or unverified state.
85
+ 8. Preserve exit-code meaning. A zero exit code should mean the command's public contract succeeded, not merely that a sub-step executed. Nonzero category changes are breaking unless the repository declares otherwise.
86
+ 9. Compare old and new fixtures when compatibility matters. If a `tests/fixtures/schema-backcompat/<version>/public-json-fixtures.json` style fixture exists, keep it parseable and update validation expectations without erasing historical shape.
87
+ 10. Use snapshot and golden-output files only as review aids. Add or preserve assertions for field presence, primitive types, enum values, null versus missing semantics, stream split, exit code, and schema validation where existing test structure supports it.
88
+ 11. Synchronize schemas, fixtures, examples, package file lists, docs, templates, and release notes when the contract changes. If a surface is intentionally stale or deferred, record why.
89
+ 12. Route version impact through the repository versioning policy when the change is breaking, deprecating, package-visible, or template-visible.
90
+ 13. Verify with the narrowest configured command intents that cover JSON contract, docs, package, and mustflow metadata changes.
91
+
92
+ <!-- mustflow-section: postconditions -->
93
+ ## Postconditions
94
+
95
+ - Public JSON and JSONL contracts, schemas, fixtures, package metadata, docs examples, stream routing, and exit-code meanings agree.
96
+ - Compatibility-sensitive changes are explicitly classified.
97
+ - Any skipped backcompat, schema, stream, exit-code, package, docs, or template surface is named with risk.
98
+
99
+ <!-- mustflow-section: verification -->
100
+ ## Verification
101
+
102
+ Use configured oneshot command intents when available:
103
+
104
+ - `changes_status`
105
+ - `changes_diff_summary`
106
+ - `test_related`
107
+ - `docs_validate_fast`
108
+ - `test_release`
109
+ - `mustflow_check`
110
+
111
+ Use broader configured tests when the JSON producer is cross-cutting or no narrower related test covers schema, stream, fixture, and exit-code behavior.
112
+
113
+ <!-- mustflow-section: failure-handling -->
114
+ ## Failure Handling
115
+
116
+ - If old fixtures fail, treat the failure as contract drift until the fixture is proven obsolete.
117
+ - If no schema exists for public JSON, preserve existing tests and report the missing schema rather than inventing an unrequested schema system.
118
+ - If only human-output snapshots cover JSON behavior, add focused coverage when the repository test policy supports it or report the missing proof.
119
+ - If stdout and stderr are mixed in machine mode, fix stream routing before claiming automation compatibility.
120
+ - If compatibility is intentionally broken, report affected consumers and version impact before finalizing.
121
+
122
+ <!-- mustflow-section: output-format -->
123
+ ## Output Format
124
+
125
+ - Public JSON or JSONL contract changed
126
+ - Source of truth used
127
+ - Compatibility classification
128
+ - Fields, packet types, status meanings, streams, and exit codes reviewed
129
+ - Schemas, fixtures, docs, tests, packages, and templates synchronized
130
+ - Backcompat fixture coverage checked or missing
131
+ - Command intents run
132
+ - Skipped checks and reasons
133
+ - Remaining JSON contract risk
@@ -0,0 +1,122 @@
1
+ ---
2
+ mustflow_doc: skill.restricted-handoff-resume
3
+ locale: en
4
+ canonical: true
5
+ revision: 1
6
+ lifecycle: mustflow-owned
7
+ authority: procedure
8
+ name: restricted-handoff-resume
9
+ description: Apply this skill when a task is paused, resumed, handed off, context-compacted, blocked, or reported as incomplete and the next agent or user needs a bounded restart point.
10
+ metadata:
11
+ mustflow_schema: "1"
12
+ mustflow_kind: procedure
13
+ pack_id: mustflow.core
14
+ skill_id: mustflow.core.restricted-handoff-resume
15
+ command_intents:
16
+ - changes_status
17
+ - changes_diff_summary
18
+ - mustflow_check
19
+ ---
20
+
21
+ # Restricted Handoff Resume
22
+
23
+ <!-- mustflow-section: purpose -->
24
+ ## Purpose
25
+
26
+ Create bounded handoff or resume evidence without storing hidden reasoning, secrets, raw transcripts, full terminal logs, or authority-changing summaries in project files.
27
+
28
+ <!-- mustflow-section: use-when -->
29
+ ## Use When
30
+
31
+ - A task is incomplete, blocked, paused, interrupted, context-compacted, resumed, or explicitly handed to another agent or future session.
32
+ - A final report needs to preserve a restart point, changed files, verification receipts, skipped checks, blockers, or next safe action.
33
+ - A user asks to continue later, resume previous work, summarize work for another agent, or explain what remains.
34
+ - Repository handoff policy is disabled or report-only and the agent must avoid creating worklogs, plans, tasks, or raw state files.
35
+
36
+ <!-- mustflow-section: do-not-use-when -->
37
+ ## Do Not Use When
38
+
39
+ - The task is complete and the final report only needs normal completion evidence; use `completion-evidence-gate`.
40
+ - The repository explicitly configures a richer work-item or handoff system and the user asks to use that system.
41
+ - The task asks to archive or persist full transcripts, hidden reasoning, raw terminal logs, secrets, or unrelated session history.
42
+
43
+ <!-- mustflow-section: required-inputs -->
44
+ ## Required Inputs
45
+
46
+ - Current user goal and the latest instruction that controls the task.
47
+ - Current changed files, in-scope files, and out-of-scope files that must not be touched.
48
+ - Command intents run, failed, skipped, manual-only, or missing.
49
+ - Verification receipts or current command-result summaries when available.
50
+ - Blocking condition, unresolved decision, approval boundary, or next safe action.
51
+ - Repository handoff, retention, compaction, generated-state, and reporting policy.
52
+
53
+ <!-- mustflow-section: preconditions -->
54
+ ## Preconditions
55
+
56
+ - The task matches the Use When conditions and does not match the Do Not Use When exclusions.
57
+ - Required inputs are available, or missing inputs can be reported without guessing.
58
+ - Higher-priority instructions and `.mustflow/config/commands.toml` have been checked for the current scope.
59
+
60
+ <!-- mustflow-section: allowed-edits -->
61
+ ## Allowed Edits
62
+
63
+ - When repository handoff policy is report-only or disabled, do not create project files solely to preserve handoff state.
64
+ - When a configured handoff surface exists and the user requests it, write only bounded restart evidence allowed by that surface.
65
+ - Update docs, skills, templates, or tests that define handoff behavior when the task explicitly changes handoff procedure.
66
+ - Do not store hidden reasoning, secrets, full chat transcripts, full terminal output, raw command logs, private URLs, credentials, or unrelated work history.
67
+ - Do not turn a handoff summary into authority over current files, current user instructions, or command contracts.
68
+
69
+ <!-- mustflow-section: procedure -->
70
+ ## Procedure
71
+
72
+ 1. Refresh the nearest instructions required by the repository policy before writing a final report or handoff.
73
+ 2. Identify whether the task is complete, incomplete, blocked, paused, or resumed.
74
+ 3. If the task is resumed after compaction or handoff, compare the summary with current files and current user instructions before acting on it.
75
+ 4. Keep the handoff bounded to the current task: objective, latest controlling instruction, files touched, files intentionally avoided, commands run, commands skipped, failures, blockers, and next safe action.
76
+ 5. Source-link claims to current files, configured command intents, or run summaries. Do not make a compacted summary outrank current repository evidence.
77
+ 6. Exclude hidden reasoning, raw terminal logs, full transcripts, secrets, tokens, credentials, personal data, private URLs, and unrelated work history.
78
+ 7. If repository handoff is disabled or report-only, keep the restart information in the final report instead of creating `.mustflow/` state files.
79
+ 8. If a configured handoff surface exists, write only the bounded fields allowed by that surface and avoid raw logs.
80
+ 9. For blocked work, state the exact boundary: missing approval, missing command intent, missing source, failed verification, ambiguous instruction, or external-system requirement.
81
+ 10. For resumed work, name what was verified against current files and what may still be stale.
82
+ 11. Run only configured status or validation intents that are appropriate for the report boundary.
83
+
84
+ <!-- mustflow-section: postconditions -->
85
+ ## Postconditions
86
+
87
+ - The next agent or user can restart from a concrete, bounded point.
88
+ - The handoff does not include hidden reasoning, secrets, full transcripts, full terminal logs, or unrelated session history.
89
+ - The handoff is lower authority than current files, current user instructions, and command contracts.
90
+ - Disabled or report-only handoff policy is respected.
91
+
92
+ <!-- mustflow-section: verification -->
93
+ ## Verification
94
+
95
+ Use configured oneshot command intents when available:
96
+
97
+ - `changes_status`
98
+ - `changes_diff_summary`
99
+ - `mustflow_check`
100
+
101
+ Use docs or release validation only when the handoff procedure itself changes docs, templates, package output, or mustflow-owned files.
102
+
103
+ <!-- mustflow-section: failure-handling -->
104
+ ## Failure Handling
105
+
106
+ - If a summary conflicts with current files or current user instructions, follow the current source and report the conflict.
107
+ - If a secret or private value appears in handoff input, activate `secret-exposure-response` and omit the value.
108
+ - If the task needs a project handoff file but handoff is disabled or no configured surface exists, keep the handoff in the final report and state the missing surface.
109
+ - If command receipts are missing, report that the command was not verified through mustflow instead of claiming it passed.
110
+ - If the user asks for full raw logs or hidden reasoning, provide a bounded operational summary instead.
111
+
112
+ <!-- mustflow-section: output-format -->
113
+ ## Output Format
114
+
115
+ - Task status: complete, incomplete, blocked, paused, or resumed
116
+ - Latest controlling instruction
117
+ - Files touched and files intentionally avoided
118
+ - Commands run, failed, skipped, manual-only, or missing
119
+ - Verification evidence and stale-summary checks
120
+ - Next safe action or blocking boundary
121
+ - Excluded sensitive or raw content categories
122
+ - Remaining resume risk
@@ -48,12 +48,36 @@ route_type = "authoring"
48
48
  priority = 80
49
49
  applies_to_reasons = ["mustflow_config_change", "mustflow_docs_change"]
50
50
 
51
+ [routes."command-intent-mapping-gate"]
52
+ category = "workflow_contracts"
53
+ route_type = "primary"
54
+ priority = 68
55
+ applies_to_reasons = ["docs_change", "mustflow_docs_change", "mustflow_config_change", "package_metadata_change", "security_change", "release_risk", "unknown_change"]
56
+
51
57
  [routes."cli-output-contract-review"]
52
58
  category = "workflow_contracts"
53
59
  route_type = "adjunct"
54
60
  priority = 65
55
61
  applies_to_reasons = ["public_api_change", "behavior_change", "docs_change"]
56
62
 
63
+ [routes."public-json-contract-change"]
64
+ category = "workflow_contracts"
65
+ route_type = "primary"
66
+ priority = 82
67
+ applies_to_reasons = ["public_api_change", "behavior_change", "docs_change", "test_change", "package_metadata_change", "release_risk"]
68
+
69
+ [routes."completion-evidence-gate"]
70
+ category = "workflow_contracts"
71
+ route_type = "adjunct"
72
+ priority = 85
73
+ applies_to_reasons = ["unknown_change", "code_change", "behavior_change", "public_api_change", "test_change", "docs_change", "mustflow_docs_change", "mustflow_config_change", "package_metadata_change", "release_risk"]
74
+
75
+ [routes."restricted-handoff-resume"]
76
+ category = "workflow_contracts"
77
+ route_type = "primary"
78
+ priority = 64
79
+ applies_to_reasons = ["unknown_change", "docs_change", "mustflow_docs_change", "mustflow_config_change", "workflow_change"]
80
+
57
81
  [routes."facade-pattern"]
58
82
  category = "architecture_patterns"
59
83
  route_type = "primary"
@@ -114,6 +138,18 @@ route_type = "adjunct"
114
138
  priority = 42
115
139
  applies_to_reasons = ["unknown_change", "code_change", "behavior_change", "public_api_change", "security_change", "privacy_change", "data_change", "migration_change", "package_metadata_change"]
116
140
 
141
+ [routes."runtime-target-selection"]
142
+ category = "general_code"
143
+ route_type = "primary"
144
+ priority = 78
145
+ applies_to_reasons = ["unknown_change", "code_change", "behavior_change", "migration_change", "package_metadata_change", "release_risk"]
146
+
147
+ [routes."structure-first-engineering"]
148
+ category = "general_code"
149
+ route_type = "adjunct"
150
+ priority = 76
151
+ applies_to_reasons = ["code_change", "behavior_change", "public_api_change", "data_change", "migration_change", "security_change", "performance_change"]
152
+
117
153
  [routes."cpp-code-change"]
118
154
  category = "general_code"
119
155
  route_type = "primary"
@@ -228,6 +264,12 @@ route_type = "adjunct"
228
264
  priority = 25
229
265
  applies_to_reasons = ["public_api_change", "package_metadata_change", "mustflow_config_change"]
230
266
 
267
+ [routes."template-install-surface-sync"]
268
+ category = "workflow_contracts"
269
+ route_type = "primary"
270
+ priority = 78
271
+ applies_to_reasons = ["mustflow_docs_change", "mustflow_config_change", "package_metadata_change", "docs_change", "test_change", "release_risk"]
272
+
231
273
  [routes."date-number-audit"]
232
274
  category = "workflow_contracts"
233
275
  route_type = "adjunct"
@@ -336,6 +378,18 @@ route_type = "primary"
336
378
  priority = 30
337
379
  applies_to_reasons = ["security_change", "privacy_change"]
338
380
 
381
+ [routes."secret-exposure-response"]
382
+ category = "security_privacy"
383
+ route_type = "event"
384
+ priority = 90
385
+ applies_to_reasons = ["security_change", "privacy_change", "docs_change", "package_metadata_change", "release_risk"]
386
+
387
+ [routes."provenance-license-gate"]
388
+ category = "security_privacy"
389
+ route_type = "adjunct"
390
+ priority = 58
391
+ applies_to_reasons = ["security_change", "docs_change", "code_change", "package_metadata_change", "release_risk"]
392
+
339
393
  [routes."config-env-change"]
340
394
  category = "security_privacy"
341
395
  route_type = "primary"
@@ -360,6 +414,12 @@ route_type = "event"
360
414
  priority = 20
361
415
  applies_to_reasons = ["command_failure"]
362
416
 
417
+ [routes."evidence-stall-breaker"]
418
+ category = "bug_failure"
419
+ route_type = "event"
420
+ priority = 70
421
+ applies_to_reasons = ["unknown_change", "code_change", "behavior_change", "docs_change", "mustflow_docs_change"]
422
+
363
423
  [routes."external-prompt-injection-defense"]
364
424
  category = "security_privacy"
365
425
  route_type = "adjunct"
@@ -0,0 +1,203 @@
1
+ ---
2
+ mustflow_doc: skill.runtime-target-selection
3
+ locale: en
4
+ canonical: true
5
+ revision: 1
6
+ lifecycle: mustflow-owned
7
+ authority: procedure
8
+ name: runtime-target-selection
9
+ description: Apply this skill when choosing, migrating, rewriting, or justifying a primary language, runtime, framework, compile target, or execution environment for a feature, service, backend, engine, CLI, desktop app, or large codebase slice.
10
+ metadata:
11
+ mustflow_schema: "1"
12
+ mustflow_kind: procedure
13
+ pack_id: mustflow.core
14
+ skill_id: mustflow.core.runtime-target-selection
15
+ command_intents:
16
+ - changes_status
17
+ - changes_diff_summary
18
+ - docs_validate_fast
19
+ - test_related
20
+ - test_release
21
+ - mustflow_check
22
+ ---
23
+
24
+ # Runtime Target Selection
25
+
26
+ <!-- mustflow-section: purpose -->
27
+ ## Purpose
28
+
29
+ Choose or review a language and runtime target from repository evidence, feedback-loop cost,
30
+ deployment constraints, verification needs, ecosystem maturity, and operational ownership.
31
+
32
+ This skill prevents "rewrite it in the language the agent likes" decisions. Strong compiler
33
+ feedback can make AI-assisted implementation safer, but that benefit is only real when the build
34
+ loop, smoke targets, cache policy, host toolchain, package artifacts, and deployment path are
35
+ designed for it.
36
+
37
+ <!-- mustflow-section: use-when -->
38
+ ## Use When
39
+
40
+ - A task proposes choosing, replacing, migrating, or rewriting the main language, runtime,
41
+ framework, backend, engine, CLI, worker, desktop shell, or compile target.
42
+ - A codebase slice is moved between JavaScript, TypeScript, Python, Go, Rust, C++, Zig, Dart,
43
+ Tauri, Node, Bun, browser, edge, serverless, native, or embedded environments.
44
+ - The argument for a target depends on AI coding ease, compiler feedback, performance, reliability,
45
+ binary distribution, developer machine constraints, remote build machines, VM performance, or
46
+ package ecosystem maturity.
47
+ - A migration plan needs smoke-target selection, build-cache expectations, artifact size, command
48
+ intents, or CI/deployment coverage before implementation.
49
+
50
+ <!-- mustflow-section: do-not-use-when -->
51
+ ## Do Not Use When
52
+
53
+ - The language and runtime are already fixed and the task only changes files inside that language;
54
+ use the language-specific skill such as `rust-code-change`, `go-code-change`,
55
+ `typescript-code-change`, `node-code-change`, or `python-code-change`.
56
+ - The task only changes a database schema, API contract, UI, or deployment config without a runtime
57
+ target decision.
58
+ - The user explicitly asks for a short opinion without repository-backed implementation or
59
+ migration work.
60
+
61
+ <!-- mustflow-section: required-inputs -->
62
+ ## Required Inputs
63
+
64
+ - Current language and runtime surfaces: package manifests, lockfiles, workspace files, toolchain
65
+ files, CI config, Docker or deployment config, build scripts, command-contract entries, tests, and
66
+ generated artifact rules.
67
+ - Target options being compared, including the reason for considering each target.
68
+ - Product or system need: MVP speed, iteration loop, backend reliability, engine correctness,
69
+ desktop shell, embedded constraints, data workload, public package compatibility, or operations.
70
+ - Developer and CI environment constraints: OS, shell, VM, remote builder, cache location, disk
71
+ budget, native toolchain prerequisites, and available one-shot verification.
72
+ - Migration boundary: strangler slice, bridge adapter, generated bindings, dual runtime period,
73
+ rollback path, smoke targets, and compatibility fixtures.
74
+ - Performance, correctness, or reliability claims and the representative workload needed to prove
75
+ them.
76
+
77
+ <!-- mustflow-section: preconditions -->
78
+ ## Preconditions
79
+
80
+ - The task matches the Use When conditions and does not match the Do Not Use When exclusions.
81
+ - Higher-priority instructions and `.mustflow/config/commands.toml` have been checked for the
82
+ current scope.
83
+ - External advice, AI output, forum posts, benchmarks, or anecdotes have been treated as hypotheses,
84
+ not repository facts.
85
+ - A language-specific skill will still be applied after the target is selected and files in that
86
+ language are edited.
87
+
88
+ <!-- mustflow-section: allowed-edits -->
89
+ ## Allowed Edits
90
+
91
+ - Update decision records, skill procedures, route metadata, migration plans, command-contract
92
+ proposals, tests, fixtures, or docs that directly support the selected runtime target.
93
+ - Add only the smallest migration scaffold needed to prove the selected boundary when the user asks
94
+ for implementation.
95
+ - Do not run unconfigured installers, toolchain repair commands, package installs, remote builds,
96
+ long-running watchers, or cleanup commands.
97
+ - Do not rewrite a large codebase solely because one language has a better reputation with AI.
98
+ - Do not present toy benchmarks, empty databases, local-only machine results, or compile success as
99
+ production performance proof.
100
+
101
+ <!-- mustflow-section: procedure -->
102
+ ## Procedure
103
+
104
+ 1. Name the decision and boundary.
105
+ - Is this a new feature target, service rewrite, backend migration, engine rewrite, CLI target,
106
+ desktop shell, embedded target, or build/deployment target?
107
+ - Identify the smallest slice that can prove the choice without committing the whole codebase.
108
+ 2. Compare targets by feedback loop, not developer taste.
109
+ - Python or TypeScript can be appropriate for fast MVPs, scripts, UI-heavy products, and broad
110
+ ecosystem integration.
111
+ - Go can be appropriate for many services where simple deployment, fast builds, concurrency, and
112
+ maintainability matter more than maximum type-level guarantees.
113
+ - Rust can be appropriate for correctness-sensitive backends, engines, native shells, high-load
114
+ services, FFI, local-first performance, and memory-safety-critical code, but it raises build
115
+ cache, compile-time, native toolchain, and profile-management costs.
116
+ - C++ or Zig choices need ecosystem, toolchain, ABI, packaging, and team fluency evidence rather
117
+ than novelty claims.
118
+ 3. Inspect environment reality.
119
+ - Check OS, shell, native toolchain prerequisites, VM or container constraints, CI images,
120
+ remote builders, deployment runtime, and package artifact expectations.
121
+ - On Windows native Rust or C++ targets, distinguish ordinary shells from developer toolchain
122
+ shells when MSVC or SDK environment variables are required.
123
+ 4. Model the build loop.
124
+ - Estimate whether the normal edit-check-test loop is seconds, minutes, or hours for the
125
+ changed slice.
126
+ - Identify build-cache directories, target or artifact growth, and whether cleanup is a manual
127
+ maintenance action rather than a routine fix during active development.
128
+ - Treat expensive settings such as full release optimization, fat LTO, whole-workspace builds,
129
+ sanitizer runs, and cross-compiles as release or focused verification unless the command
130
+ contract explicitly declares them as normal checks.
131
+ 5. Define smoke targets before migration.
132
+ - Choose a small set of representative smoke targets: CLI command, API route, worker path,
133
+ database operation, desktop shell action, FFI boundary, public package import, or engine
134
+ invariant.
135
+ - Keep smoke targets stable and bounded so an AI agent can verify progress without compiling or
136
+ testing the whole world every loop.
137
+ - Report missing smoke or install verification intents instead of inventing raw commands.
138
+ 6. Plan migration boundaries.
139
+ - Prefer strangler slices, adapters, compatibility fixtures, and dual-run comparison where a
140
+ large rewrite would otherwise hide regressions.
141
+ - Identify data formats, public APIs, package entries, generated bindings, config, logs,
142
+ metrics, and operational handoff surfaces that must stay compatible.
143
+ 7. Calibrate performance and correctness claims.
144
+ - Compiler success proves type and build constraints, not product correctness.
145
+ - Microbenchmarks, empty databases, local-only measurements, and warm-cache runs are not enough
146
+ for production claims.
147
+ - Require representative workload, cold/warm distinction, data size, concurrency, target
148
+ hardware, build profile, and measurement method before reporting speed superiority.
149
+ 8. Select the target or report the blocked decision.
150
+ - Pick the target only when the runtime fit, feedback loop, verification, deployment, and
151
+ migration boundary are known enough.
152
+ - If one of those is missing, report the missing evidence and the safest reversible next slice.
153
+
154
+ <!-- mustflow-section: postconditions -->
155
+ ## Postconditions
156
+
157
+ - Runtime choice is tied to the project boundary, not generic language preference.
158
+ - Build-loop cost, cache and artifact impact, smoke targets, and verification coverage are explicit.
159
+ - Migration boundary, rollback or compatibility strategy, and unverified claims are named.
160
+ - Language-specific follow-up skills are selected before code in that language changes.
161
+
162
+ <!-- mustflow-section: verification -->
163
+ ## Verification
164
+
165
+ Use configured oneshot command intents when available:
166
+
167
+ - `changes_status`
168
+ - `changes_diff_summary`
169
+ - `docs_validate_fast`
170
+ - `test_related`
171
+ - `test_release`
172
+ - `mustflow_check`
173
+
174
+ Use language-specific configured intents after files in a selected language change. Report missing
175
+ smoke, install, package, cross-target, native toolchain, benchmark, or deployment verification
176
+ instead of inventing raw commands.
177
+
178
+ <!-- mustflow-section: failure-handling -->
179
+ ## Failure Handling
180
+
181
+ - If the target decision rests on external anecdotes, treat them as hypotheses and require current
182
+ repository evidence before editing broad surfaces.
183
+ - If the build loop is too expensive for normal agent iteration, reduce the migration slice, add a
184
+ configured smoke intent proposal, or report the missing command contract.
185
+ - If native toolchain setup is missing, report the prerequisite instead of running global repair or
186
+ installer commands.
187
+ - If a performance claim cannot be measured on a representative workload, remove or qualify the
188
+ claim.
189
+ - If a language-specific skill exposes a stronger risk after selection, follow the narrower skill
190
+ and revisit the target decision if necessary.
191
+
192
+ <!-- mustflow-section: output-format -->
193
+ ## Output Format
194
+
195
+ - Decision boundary
196
+ - Candidate targets and chosen target
197
+ - Environment and build-loop evidence
198
+ - Smoke targets and verification coverage
199
+ - Migration boundary and compatibility surfaces
200
+ - Performance or correctness claims accepted, downgraded, or deferred
201
+ - Command intents run
202
+ - Skipped checks and reasons
203
+ - Remaining runtime-target risk