mustflow 2.28.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 (44) hide show
  1. package/dist/cli/commands/context.js +1 -0
  2. package/dist/cli/commands/help.js +55 -1
  3. package/dist/cli/commands/tech.js +346 -0
  4. package/dist/cli/i18n/en.js +1 -0
  5. package/dist/cli/i18n/es.js +1 -0
  6. package/dist/cli/i18n/fr.js +1 -0
  7. package/dist/cli/i18n/hi.js +1 -0
  8. package/dist/cli/i18n/ko.js +1 -0
  9. package/dist/cli/i18n/zh.js +1 -0
  10. package/dist/cli/index.js +1 -0
  11. package/dist/cli/lib/agent-context.js +16 -0
  12. package/dist/cli/lib/command-registry.js +6 -0
  13. package/dist/cli/lib/validation/index.js +11 -0
  14. package/dist/cli/lib/validation/primitives.js +5 -0
  15. package/dist/core/technology-preferences.js +189 -0
  16. package/package.json +1 -1
  17. package/schemas/context-report.schema.json +61 -0
  18. package/templates/default/common/.mustflow/config/mustflow.toml +8 -0
  19. package/templates/default/common/.mustflow/config/technology.toml +20 -0
  20. package/templates/default/i18n.toml +78 -12
  21. package/templates/default/locales/en/.mustflow/skills/INDEX.md +33 -1
  22. package/templates/default/locales/en/.mustflow/skills/code-review/SKILL.md +15 -5
  23. package/templates/default/locales/en/.mustflow/skills/codebase-orientation/SKILL.md +15 -8
  24. package/templates/default/locales/en/.mustflow/skills/command-intent-mapping-gate/SKILL.md +124 -0
  25. package/templates/default/locales/en/.mustflow/skills/completion-evidence-gate/SKILL.md +178 -0
  26. package/templates/default/locales/en/.mustflow/skills/contract-sync-check/SKILL.md +9 -3
  27. package/templates/default/locales/en/.mustflow/skills/dependency-reality-check/SKILL.md +6 -3
  28. package/templates/default/locales/en/.mustflow/skills/evidence-stall-breaker/SKILL.md +166 -0
  29. package/templates/default/locales/en/.mustflow/skills/external-prompt-injection-defense/SKILL.md +8 -6
  30. package/templates/default/locales/en/.mustflow/skills/provenance-license-gate/SKILL.md +131 -0
  31. package/templates/default/locales/en/.mustflow/skills/public-json-contract-change/SKILL.md +133 -0
  32. package/templates/default/locales/en/.mustflow/skills/restricted-handoff-resume/SKILL.md +122 -0
  33. package/templates/default/locales/en/.mustflow/skills/routes.toml +60 -0
  34. package/templates/default/locales/en/.mustflow/skills/runtime-target-selection/SKILL.md +203 -0
  35. package/templates/default/locales/en/.mustflow/skills/rust-code-change/SKILL.md +55 -18
  36. package/templates/default/locales/en/.mustflow/skills/secret-exposure-response/SKILL.md +125 -0
  37. package/templates/default/locales/en/.mustflow/skills/security-privacy-review/SKILL.md +10 -1
  38. package/templates/default/locales/en/.mustflow/skills/skill-authoring/SKILL.md +9 -5
  39. package/templates/default/locales/en/.mustflow/skills/source-freshness-check/SKILL.md +3 -2
  40. package/templates/default/locales/en/.mustflow/skills/structure-first-engineering/SKILL.md +205 -0
  41. package/templates/default/locales/en/.mustflow/skills/template-install-surface-sync/SKILL.md +131 -0
  42. package/templates/default/locales/en/AGENTS.md +8 -7
  43. package/templates/default/locales/ko/AGENTS.md +8 -7
  44. package/templates/default/manifest.toml +66 -1
@@ -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
@@ -2,7 +2,7 @@
2
2
  mustflow_doc: skill.rust-code-change
3
3
  locale: en
4
4
  canonical: true
5
- revision: 2
5
+ revision: 3
6
6
  lifecycle: mustflow-owned
7
7
  authority: procedure
8
8
  name: rust-code-change
@@ -30,6 +30,11 @@ metadata:
30
30
 
31
31
  Preserve Rust ownership, error, trait, feature, async runtime, unsafe, and public crate boundaries while making a focused change. A Rust change is successful only when it clarifies ownership and contracts, not when it merely silences the borrow checker.
32
32
 
33
+ Rust's compiler feedback can be especially useful for AI-assisted work because it rejects many
34
+ invalid states with concrete errors. That benefit has a real cost: compile time, target-directory
35
+ growth, native toolchain setup, release-profile slowness, and smoke-target selection must be managed
36
+ instead of treated as incidental.
37
+
33
38
  <!-- mustflow-section: use-when -->
34
39
  ## Use When
35
40
 
@@ -45,10 +50,11 @@ Preserve Rust ownership, error, trait, feature, async runtime, unsafe, and publi
45
50
  <!-- mustflow-section: required-inputs -->
46
51
  ## Required Inputs
47
52
 
48
- - `Cargo.toml`, workspace manifests, lockfile policy, toolchain config, rustfmt, clippy, feature flags, docs.rs metadata, optional dependencies, and CI hints.
53
+ - `Cargo.toml`, workspace manifests, lockfile policy, toolchain config, rustfmt, clippy, feature flags, docs.rs metadata, optional dependencies, build profiles, target directory or cache policy, and CI hints.
49
54
  - Relevant `src/lib.rs`, `src/main.rs`, modules, public re-exports, tests, examples, and docs examples.
50
55
  - Existing error handling convention and async runtime.
51
56
  - Public crate status, minimum supported Rust version, feature support policy, and downstream compatibility expectations when available.
57
+ - Host and build-loop constraints: OS, shell, native toolchain prerequisites, VM or remote-builder use, release profile, LTO, workspace size, disk budget, and configured smoke or focused-check intents.
52
58
  - Configured verification intents.
53
59
 
54
60
  <!-- mustflow-section: preconditions -->
@@ -57,6 +63,9 @@ Preserve Rust ownership, error, trait, feature, async runtime, unsafe, and publi
57
63
  - Determine whether the change affects ownership flow, public API, feature gates, optional dependencies, error contract, async runtime, or unsafe invariants.
58
64
  - Read local patterns before adding traits, lifetimes, clones, locks, boxed errors, feature bounds, or `Send + Sync + 'static` constraints.
59
65
  - Treat `clone`, `Arc<Mutex<_>>`, explicit lifetimes, `'static`, `Box<dyn Error>`, `unwrap`, feature changes, and `unsafe` as suspicious until their contract impact is justified.
66
+ - Identify the intended edit-check-test loop before choosing a broad build. Treat whole-workspace
67
+ checks, release builds, fat LTO, cross-compiles, and sanitizer-style runs as expensive evidence
68
+ unless the command contract declares them as the normal focused path.
60
69
 
61
70
  <!-- mustflow-section: allowed-edits -->
62
71
  ## Allowed Edits
@@ -66,25 +75,38 @@ Preserve Rust ownership, error, trait, feature, async runtime, unsafe, and publi
66
75
  - Keep feature-gated code and public re-exports synchronized.
67
76
  - Touch unsafe code only with explicit invariants preserved in nearby comments.
68
77
  - Add feature, async, or unsafe verification notes when configured command intents are missing.
78
+ - Keep build cache cleanup, remote compilation, VM escape hatches, and native toolchain repair as
79
+ explicit environment or manual maintenance decisions. Do not hide them inside ordinary code fixes
80
+ or verification.
69
81
 
70
82
  <!-- mustflow-section: procedure -->
71
83
  ## Procedure
72
84
 
73
- 1. Read Cargo metadata, features, optional dependencies, docs.rs metadata, toolchain config, public exports, relevant modules, and tests.
85
+ 1. Read Cargo metadata, features, optional dependencies, docs.rs metadata, toolchain config, build profiles, public exports, relevant modules, and tests.
74
86
  2. Classify the change as ownership, API, error, feature, async, unsafe, dependency, or test-only.
75
- 3. Resolve ownership problems in this order: identify the real owner, shrink borrow scopes, fix function signatures to accept references or slices when ownership is unnecessary, distinguish transfer from sharing, then consider clone or shared ownership only when the semantics require it.
76
- 4. Before adding `clone`, verify it is a cheap handle clone such as `Arc`, `Rc`, or `Bytes`, a small intentional value clone, or a true independent ownership split. Reject large collection clones, loop clones, clone-then-borrow code, and whole-state clones made only to satisfy `spawn`.
77
- 5. Before adding `Arc<Mutex<_>>`, verify multiple owners truly need shared mutable state. Keep critical sections short, document lock order when relevant, and do not hold a lock guard across `.await`, I/O, callbacks, or user code.
78
- 6. Use explicit lifetimes only to describe real borrow relationships. Do not add `'static` or `T: 'static` to public APIs merely because an internal task boundary requires it.
79
- 7. Use concrete error enums for library APIs when callers need to classify failures. Keep `Box<dyn Error>` mostly to binaries, examples, tests, prototypes, or explicitly opaque error policies.
80
- 8. Avoid `unwrap` and vague `expect` in production paths. They are allowed only for tests, examples, startup policy, or invariants already proven by nearby code.
81
- 9. If feature flags change, treat default features, no-default builds, all-features builds, optional dependency implicit features, public re-exports, docs examples, and feature-gated trait impls as compatibility surfaces. Features should be additive.
82
- 10. Treat public re-exports, public dependency types, generic bounds, trait item sets, error enum variants, `#[non_exhaustive]`, and MSRV as public API. Tightened bounds, added required trait methods, removed re-exports, or changed error variants require compatibility review.
83
- 11. Do not mix async runtimes. A Tokio crate should not casually gain `async-std` or runtime-specific APIs in library core. Do not call blocking I/O or CPU-heavy work in async paths without an established boundary such as async-native APIs, a blocking pool, or a dedicated worker.
84
- 12. For async spawning, avoid leaking internal `Send + Sync + 'static` requirements into public APIs. Prefer owned task state, smaller spawn boundaries, local task structures, or caller-owned runtime decisions.
85
- 13. Touch `unsafe` only when a safe design cannot express the required behavior. Every unsafe block needs a nearby `SAFETY:` explanation; every public `unsafe fn` needs `# Safety` docs. Keep unsafe scopes small and wrap them in safe abstractions only when callers have no hidden safety obligations.
86
- 14. For FFI, keep Rust ABI types out of C boundaries. Use explicit ownership, `#[repr(C)]` where required, raw pointer plus length pairs, `CStr`/`CString`, RAII wrappers, null handling, panic boundaries, and documented thread-safety evidence before manual `Send` or `Sync`.
87
- 15. Choose configured verification intents that cover format, lint, build, tests, feature combinations, docs, public API, unsafe, and FFI risk when available.
87
+ 3. Model the build loop before broad edits:
88
+ - identify the smallest package, crate, feature set, smoke target, or test that covers the risk;
89
+ - check whether `target/` or an equivalent cache may grow enough to affect local disk budget;
90
+ - treat cleaning build caches as a manual maintenance tradeoff because it can turn later
91
+ compile checks into cold, expensive builds;
92
+ - on Windows native targets, distinguish ordinary shells from developer toolchain shells when
93
+ MSVC, SDK, linker, or environment setup is required;
94
+ - treat VM builds, remote builders, release profiles, fat LTO, and whole-workspace checks as
95
+ environment and verification choices that must be reported when they dominate iteration cost.
96
+ 4. Resolve ownership problems in this order: identify the real owner, shrink borrow scopes, fix function signatures to accept references or slices when ownership is unnecessary, distinguish transfer from sharing, then consider clone or shared ownership only when the semantics require it.
97
+ 5. Before adding `clone`, verify it is a cheap handle clone such as `Arc`, `Rc`, or `Bytes`, a small intentional value clone, or a true independent ownership split. Reject large collection clones, loop clones, clone-then-borrow code, and whole-state clones made only to satisfy `spawn`.
98
+ 6. Before adding `Arc<Mutex<_>>`, verify multiple owners truly need shared mutable state. Keep critical sections short, document lock order when relevant, and do not hold a lock guard across `.await`, I/O, callbacks, or user code.
99
+ 7. Use explicit lifetimes only to describe real borrow relationships. Do not add `'static` or `T: 'static` to public APIs merely because an internal task boundary requires it.
100
+ 8. Use concrete error enums for library APIs when callers need to classify failures. Keep `Box<dyn Error>` mostly to binaries, examples, tests, prototypes, or explicitly opaque error policies.
101
+ 9. Avoid `unwrap`, vague `expect`, and unbounded `panic!` in production paths. They are allowed only for tests, examples, startup policy, panic-boundary adapters, or invariants already proven by nearby code.
102
+ 10. If feature flags change, treat default features, no-default builds, all-features builds, optional dependency implicit features, public re-exports, docs examples, and feature-gated trait impls as compatibility surfaces. Features should be additive.
103
+ 11. Treat public re-exports, public dependency types, generic bounds, trait item sets, error enum variants, `#[non_exhaustive]`, and MSRV as public API. Tightened bounds, added required trait methods, removed re-exports, or changed error variants require compatibility review.
104
+ 12. Do not mix async runtimes. A Tokio crate should not casually gain `async-std` or runtime-specific APIs in library core. Do not call blocking I/O or CPU-heavy work in async paths without an established boundary such as async-native APIs, a blocking pool, or a dedicated worker.
105
+ 13. For async spawning, avoid leaking internal `Send + Sync + 'static` requirements into public APIs. Prefer owned task state, smaller spawn boundaries, local task structures, or caller-owned runtime decisions.
106
+ 14. Touch `unsafe` only when a safe design cannot express the required behavior. Every unsafe block needs a nearby `SAFETY:` explanation; every public `unsafe fn` needs `# Safety` docs. Keep unsafe scopes small and wrap them in safe abstractions only when callers have no hidden safety obligations.
107
+ 15. For FFI, keep Rust ABI types out of C boundaries. Use explicit ownership, `#[repr(C)]` where required, raw pointer plus length pairs, `CStr`/`CString`, RAII wrappers, null handling, panic boundaries, and documented thread-safety evidence before manual `Send` or `Sync`.
108
+ 16. Calibrate performance claims. Do not claim Rust made a system faster from compile success, empty-database timings, warm-cache microbenchmarks, local-only runs, or debug versus release confusion. Require representative data size, concurrency, target hardware, profile, and measurement method before reporting speed claims.
109
+ 17. Choose configured verification intents that cover format, lint, build, tests, feature combinations, docs, public API, unsafe, FFI, smoke targets, package artifact, and release-profile risk when available.
88
110
 
89
111
  <!-- mustflow-section: rejection-criteria -->
90
112
  ## Review Rejection Criteria
@@ -96,10 +118,13 @@ Reject or revise the patch when any of these appear without strong local justifi
96
118
  - New public `'static`, `Send`, or `Sync` bounds that exist only because an internal task was spawned.
97
119
  - New public `Box<dyn Error>` in a library where callers need typed failures.
98
120
  - New production `unwrap` or vague `expect` on I/O, parse, environment, network, FFI, lock, or user input paths.
121
+ - New unbounded `panic!` paths, index assumptions, or unchecked slicing in production paths without a documented invariant or panic boundary.
99
122
  - Feature changes that remove APIs, change type meaning, rename features, expose internal optional dependency names, or fail default/no-default/all-features reasoning.
100
123
  - Public dependency types, re-exports, trait bounds, trait methods, or error enum variants changed without semver review.
101
124
  - Async runtime mixing, blocking I/O in async paths, or runtime ownership moved into a library core without a clear boundary.
102
125
  - Unsafe blocks without `SAFETY:` comments, unsafe functions without `# Safety`, undocumented manual `Send`/`Sync`, or FFI that exposes Rust layout types across C ABI.
126
+ - Whole-workspace, release, or fat-LTO verification treated as the normal agent loop when a smaller configured smoke or related target should exist.
127
+ - Performance superiority claims based on non-representative workloads, empty databases, local-only timings, or unspecified build profile.
103
128
 
104
129
  <!-- mustflow-section: postconditions -->
105
130
  ## Postconditions
@@ -108,7 +133,9 @@ Reject or revise the patch when any of these appear without strong local justifi
108
133
  - Public API, features, optional dependencies, and error contracts are synchronized.
109
134
  - Async runtime ownership is preserved and blocking work is isolated.
110
135
  - Unsafe and FFI invariants are preserved or no unsafe code was touched.
111
- - Missing feature, semver, docs, unsafe, or FFI verification is reported.
136
+ - Build-loop cost, target/cache impact, smoke-target coverage, and native toolchain prerequisites
137
+ are handled or reported.
138
+ - Missing feature, semver, docs, unsafe, FFI, smoke, package, or performance verification is reported.
112
139
 
113
140
  <!-- mustflow-section: verification -->
114
141
  ## Verification
@@ -122,16 +149,19 @@ Use configured oneshot command intents when available:
122
149
  - `docs_validate_fast`
123
150
  - `mustflow_check`
124
151
 
125
- Report whether configured feature-combination, documentation, semver, Miri, sanitizer, and downstream-style verification exists when those surfaces change.
152
+ Report whether configured feature-combination, documentation, semver, Miri, sanitizer, smoke-target,
153
+ package artifact, release-profile, and downstream-style verification exists when those surfaces change.
126
154
 
127
155
  When configured intents exist for these risks, prefer coverage equivalent to:
128
156
 
129
157
  - formatting and linting
130
158
  - workspace checks and tests
159
+ - focused smoke targets for the changed crate, command, API route, or engine invariant
131
160
  - default, no-default, all-features, and relevant feature combinations
132
161
  - doctests and docs build for public crates
133
162
  - public API or semver compatibility checks for published crates
134
163
  - Miri or sanitizer-style checks for unsafe, raw pointer, FFI, or manual concurrency primitives
164
+ - representative benchmark or load checks when performance claims are introduced
135
165
 
136
166
  <!-- mustflow-section: failure-handling -->
137
167
  ## Failure Handling
@@ -141,11 +171,18 @@ When configured intents exist for these risks, prefer coverage equivalent to:
141
171
  - If public API compatibility cannot be verified, report the exact exported symbols, trait bounds, feature gates, or errors at risk.
142
172
  - If async runtime or blocking boundaries are unclear, stop that part and inspect the runtime ownership before editing further.
143
173
  - If unsafe invariants are unclear, stop that part and request or inspect stronger evidence.
174
+ - If the build loop is too expensive, reduce the verification scope to the configured related or
175
+ smoke intent when available, or report the missing command contract instead of running broad raw
176
+ builds.
177
+ - If host toolchain setup is missing, report the prerequisite rather than running global installer,
178
+ repair, or shell-environment commands.
179
+ - If performance claims lack representative evidence, downgrade or remove the claim.
144
180
 
145
181
  <!-- mustflow-section: output-format -->
146
182
  ## Output Format
147
183
 
148
184
  - Boundary checked
185
+ - Build-loop, cache, smoke target, and toolchain notes
149
186
  - Ownership, feature, async, or unsafe impact
150
187
  - Public API or error impact
151
188
  - Files changed
@@ -0,0 +1,125 @@
1
+ ---
2
+ mustflow_doc: skill.secret-exposure-response
3
+ locale: en
4
+ canonical: true
5
+ revision: 1
6
+ lifecycle: mustflow-owned
7
+ authority: procedure
8
+ name: secret-exposure-response
9
+ description: Apply this skill when a real or plausible secret, token, credential, private key, session value, password, connection string, or sensitive key material appears in repository files, generated artifacts, logs, command output, screenshots, fixtures, docs, package output, or final reports.
10
+ metadata:
11
+ mustflow_schema: "1"
12
+ mustflow_kind: procedure
13
+ pack_id: mustflow.core
14
+ skill_id: mustflow.core.secret-exposure-response
15
+ command_intents:
16
+ - changes_status
17
+ - changes_diff_summary
18
+ - docs_validate_fast
19
+ - test_release
20
+ - mustflow_check
21
+ ---
22
+
23
+ # Secret Exposure Response
24
+
25
+ <!-- mustflow-section: purpose -->
26
+ ## Purpose
27
+
28
+ Handle secret-looking exposure as an incident-style containment task instead of an ordinary security review or cosmetic redaction.
29
+
30
+ <!-- mustflow-section: use-when -->
31
+ ## Use When
32
+
33
+ - A real or plausible API key, token, private key, password, session cookie, OAuth credential, service-account value, connection string, signing secret, webhook secret, certificate key, recovery code, or production-like credential appears.
34
+ - Secret-looking material appears in tracked files, untracked files, generated artifacts, logs, command output, screenshots, fixtures, docs, templates, package output, cache, run receipts, or final reports.
35
+ - A task asks to remove, redact, report, package, publish, screenshot, paste, or summarize content that includes possible credential material.
36
+ - A previous command or tool output exposed sensitive values and the next response or edit could copy them further.
37
+
38
+ <!-- mustflow-section: do-not-use-when -->
39
+ ## Do Not Use When
40
+
41
+ - The task only adds placeholder environment variable names or fake examples; use `config-env-change` for normal config work.
42
+ - The task is a broad security review with no exposed or plausible credential value; use `security-privacy-review`.
43
+ - The value is clearly non-secret test data and cannot be confused with a real credential after inspecting the surrounding context.
44
+
45
+ <!-- mustflow-section: required-inputs -->
46
+ ## Required Inputs
47
+
48
+ - Exposure surface: file, generated artifact, command output, screenshot, docs, fixture, package output, cache, or final report.
49
+ - Secret type if inferable without repeating the value.
50
+ - Whether the surface is tracked, untracked, generated, public, packaged, ignored, local-only, or already shared outside the repository.
51
+ - Scope of allowed remediation: redaction, deletion, placeholder replacement, docs rewrite, fixture rewrite, package-output cleanup, or report-only.
52
+ - Whether rotation, revocation, history rewrite, provider dashboard action, or user action is required but outside the current command contract.
53
+ - Relevant command-intent contract entries for status, diff, docs, package, release, or mustflow validation.
54
+
55
+ <!-- mustflow-section: preconditions -->
56
+ ## Preconditions
57
+
58
+ - The task matches the Use When conditions and does not match the Do Not Use When exclusions.
59
+ - Required inputs are available, or missing inputs can be reported without guessing.
60
+ - Higher-priority instructions and `.mustflow/config/commands.toml` have been checked for the current scope.
61
+
62
+ <!-- mustflow-section: allowed-edits -->
63
+ ## Allowed Edits
64
+
65
+ - Remove, redact, or replace exposed values with safe placeholders in in-scope files.
66
+ - Update docs, fixtures, templates, tests, examples, generated-package inputs, or final-report wording to avoid re-exposure.
67
+ - Add local fake-value conventions only where they prevent recurrence and match repository style.
68
+ - Do not print, quote, copy, commit, push, publish, or package the secret value.
69
+ - Do not rotate, revoke, rewrite Git history, delete backups, or contact providers unless the user explicitly requests that action and the repository contract supports it.
70
+
71
+ <!-- mustflow-section: procedure -->
72
+ ## Procedure
73
+
74
+ 1. Stop ordinary work long enough to contain copying. Do not repeat the secret value in messages, patches, logs, docs, or final reports.
75
+ 2. Classify the exposure surface without echoing the value: tracked file, untracked file, generated artifact, docs, fixture, package output, command output, screenshot, cache, run receipt, or final report.
76
+ 3. Determine whether the value is real, plausible, fake, or unknown from surrounding context without making a false safety claim.
77
+ 4. Remove or replace the value in in-scope repository files using a safe placeholder that cannot be mistaken for a real credential.
78
+ 5. Check nearby examples, docs, templates, fixtures, generated-package inputs, and final-report text for copied variants of the same value.
79
+ 6. If the value may have entered generated artifacts, package output, screenshots, run receipts, logs, or caches, report the affected surfaces and clean only those that are in scope and allowed.
80
+ 7. If the value may be real or already shared, report that rotation or revocation is required. Do not claim redaction alone fixes exposure.
81
+ 8. If the secret is tracked in Git history, report the history exposure and do not rewrite history unless explicitly requested.
82
+ 9. If the secret is outside the current repository or in a provider dashboard, stop at the boundary and describe the required owner action without revealing the value.
83
+ 10. Run the smallest configured verification that covers the changed docs, templates, package, or mustflow contract.
84
+
85
+ <!-- mustflow-section: postconditions -->
86
+ ## Postconditions
87
+
88
+ - The secret value is not repeated in patches, docs, examples, package inputs, generated artifacts, or final reports.
89
+ - In-scope repository surfaces no longer contain the exposed value.
90
+ - Remaining rotation, revocation, history, package, cache, screenshot, or external-sharing risks are reported without revealing the value.
91
+ - The final report distinguishes redaction from credential invalidation.
92
+
93
+ <!-- mustflow-section: verification -->
94
+ ## Verification
95
+
96
+ Use configured oneshot command intents when available:
97
+
98
+ - `changes_status`
99
+ - `changes_diff_summary`
100
+ - `docs_validate_fast`
101
+ - `test_release`
102
+ - `mustflow_check`
103
+
104
+ Use a narrower configured test, build, package, or documentation intent when it better proves the changed exposure surface.
105
+
106
+ <!-- mustflow-section: failure-handling -->
107
+ ## Failure Handling
108
+
109
+ - If the value might be real, treat it as real for reporting and avoid echoing it.
110
+ - If remediation requires deleting generated artifacts, rewriting Git history, rotating provider keys, or changing external systems, stop at the approval boundary and report the required owner action.
111
+ - If command output includes the value, summarize only the affected surface and never paste the raw output.
112
+ - If a fixture genuinely needs a secret-shaped value, replace it with an unmistakable fake and document that it is non-functional.
113
+ - If verification would reprint the secret, skip that command and report the reason.
114
+
115
+ <!-- mustflow-section: output-format -->
116
+ ## Output Format
117
+
118
+ - Exposure surfaces reviewed
119
+ - Secret type classification without value
120
+ - Redaction, omission, or placeholder changes made
121
+ - Generated, package, docs, fixture, cache, log, screenshot, and final-report surfaces checked when relevant
122
+ - Rotation, revocation, history, or external-owner actions still required
123
+ - Command intents run
124
+ - Skipped checks and reasons
125
+ - Remaining exposure risk