mustflow 2.113.0 → 2.114.5

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.
@@ -0,0 +1,256 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://mustflow.github.io/schemas/skill-update-report.schema.json",
4
+ "title": "mustflow skill update report",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schema_version",
9
+ "kind",
10
+ "command",
11
+ "action",
12
+ "ok",
13
+ "mode",
14
+ "status",
15
+ "check_state",
16
+ "skills",
17
+ "warnings",
18
+ "issues",
19
+ "wrote_files"
20
+ ],
21
+ "properties": {
22
+ "schema_version": { "const": "1" },
23
+ "kind": { "const": "skill_update_report" },
24
+ "command": { "const": "skill" },
25
+ "action": { "type": "string", "enum": ["outdated", "update"] },
26
+ "ok": { "type": "boolean" },
27
+ "mode": { "type": "string", "enum": ["check", "dry_run", "install"] },
28
+ "status": { "type": "string", "enum": ["checked", "preview", "updated", "rejected"] },
29
+ "check_state": { "$ref": "#/$defs/checkState" },
30
+ "skills": {
31
+ "type": "array",
32
+ "items": { "$ref": "#/$defs/skill" }
33
+ },
34
+ "warnings": {
35
+ "type": "array",
36
+ "items": { "type": "string" }
37
+ },
38
+ "issues": {
39
+ "type": "array",
40
+ "items": { "type": "string" }
41
+ },
42
+ "wrote_files": { "type": "boolean" }
43
+ },
44
+ "$defs": {
45
+ "checkState": {
46
+ "type": "object",
47
+ "additionalProperties": false,
48
+ "required": [
49
+ "state_path",
50
+ "stale_after_days",
51
+ "checked_at",
52
+ "previous_checked_at",
53
+ "next_check_due_at",
54
+ "stale_before_command"
55
+ ],
56
+ "properties": {
57
+ "state_path": { "const": ".mustflow/state/external-skills/update-check.json" },
58
+ "stale_after_days": { "const": 7 },
59
+ "checked_at": { "type": "string" },
60
+ "previous_checked_at": {
61
+ "oneOf": [
62
+ { "type": "string" },
63
+ { "type": "null" }
64
+ ]
65
+ },
66
+ "next_check_due_at": { "type": "string" },
67
+ "stale_before_command": { "type": "boolean" }
68
+ }
69
+ },
70
+ "skill": {
71
+ "type": "object",
72
+ "additionalProperties": false,
73
+ "required": [
74
+ "skill_name",
75
+ "ok",
76
+ "status",
77
+ "source",
78
+ "target",
79
+ "current_files",
80
+ "remote_files",
81
+ "changed_files",
82
+ "warnings",
83
+ "issues",
84
+ "wrote_files"
85
+ ],
86
+ "properties": {
87
+ "skill_name": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" },
88
+ "ok": { "type": "boolean" },
89
+ "status": { "type": "string", "enum": ["current", "outdated", "updated", "rejected"] },
90
+ "source": {
91
+ "oneOf": [
92
+ { "$ref": "#/$defs/source" },
93
+ { "type": "null" }
94
+ ]
95
+ },
96
+ "target": { "$ref": "#/$defs/target" },
97
+ "current_files": {
98
+ "type": "array",
99
+ "items": { "$ref": "#/$defs/file" }
100
+ },
101
+ "remote_files": {
102
+ "type": "array",
103
+ "items": { "$ref": "#/$defs/file" }
104
+ },
105
+ "changed_files": {
106
+ "type": "array",
107
+ "items": { "$ref": "#/$defs/fileChange" }
108
+ },
109
+ "script_trust": { "$ref": "#/$defs/scriptTrust" },
110
+ "warnings": {
111
+ "type": "array",
112
+ "items": { "type": "string" }
113
+ },
114
+ "issues": {
115
+ "type": "array",
116
+ "items": { "type": "string" }
117
+ },
118
+ "wrote_files": { "type": "boolean" }
119
+ }
120
+ },
121
+ "source": {
122
+ "type": "object",
123
+ "additionalProperties": false,
124
+ "required": ["input_url", "host", "owner", "repo", "ref", "skill_path", "source_url"],
125
+ "properties": {
126
+ "input_url": { "type": "string" },
127
+ "host": { "type": "string", "enum": ["github.com", "raw.githubusercontent.com"] },
128
+ "owner": { "type": "string" },
129
+ "repo": { "type": "string" },
130
+ "ref": { "type": "string" },
131
+ "skill_path": { "type": "string" },
132
+ "source_url": { "type": "string" }
133
+ }
134
+ },
135
+ "target": {
136
+ "type": "object",
137
+ "additionalProperties": false,
138
+ "required": ["root", "skill_name", "skill_dir", "provenance_path"],
139
+ "properties": {
140
+ "root": { "const": ".mustflow/external-skills" },
141
+ "skill_name": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" },
142
+ "skill_dir": { "type": "string", "pattern": "^\\.mustflow/external-skills/[a-z0-9]+(?:-[a-z0-9]+)*$" },
143
+ "provenance_path": {
144
+ "type": "string",
145
+ "pattern": "^\\.mustflow/external-skills/[a-z0-9]+(?:-[a-z0-9]+)*/mustflow-skill-source\\.json$"
146
+ }
147
+ }
148
+ },
149
+ "file": {
150
+ "type": "object",
151
+ "additionalProperties": false,
152
+ "required": ["relative_path", "kind", "bytes", "sha256"],
153
+ "properties": {
154
+ "relative_path": { "type": "string" },
155
+ "kind": { "type": "string", "enum": ["skill", "asset", "reference", "script"] },
156
+ "bytes": { "type": "integer", "minimum": 0 },
157
+ "sha256": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }
158
+ }
159
+ },
160
+ "fileChange": {
161
+ "type": "object",
162
+ "additionalProperties": false,
163
+ "required": ["relative_path", "status", "current_sha256", "remote_sha256"],
164
+ "properties": {
165
+ "relative_path": { "type": "string" },
166
+ "status": { "type": "string", "enum": ["added", "modified", "removed"] },
167
+ "current_sha256": {
168
+ "oneOf": [
169
+ { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
170
+ { "type": "null" }
171
+ ]
172
+ },
173
+ "remote_sha256": {
174
+ "oneOf": [
175
+ { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
176
+ { "type": "null" }
177
+ ]
178
+ }
179
+ }
180
+ },
181
+ "scriptTrust": {
182
+ "type": "object",
183
+ "additionalProperties": false,
184
+ "required": [
185
+ "requested",
186
+ "status",
187
+ "grants_command_authority",
188
+ "command_contract_path",
189
+ "include_entry",
190
+ "fragment_path",
191
+ "intents"
192
+ ],
193
+ "properties": {
194
+ "requested": { "type": "boolean" },
195
+ "status": { "type": "string", "enum": ["not_requested", "no_scripts", "planned", "trusted"] },
196
+ "grants_command_authority": { "type": "boolean" },
197
+ "command_contract_path": {
198
+ "oneOf": [
199
+ { "const": ".mustflow/config/commands.toml" },
200
+ { "type": "null" }
201
+ ]
202
+ },
203
+ "include_entry": {
204
+ "oneOf": [
205
+ { "type": "string", "pattern": "^commands/external-skills-[a-z0-9]+(?:-[a-z0-9]+)*\\.toml$" },
206
+ { "type": "null" }
207
+ ]
208
+ },
209
+ "fragment_path": {
210
+ "oneOf": [
211
+ { "type": "string", "pattern": "^\\.mustflow/config/commands/external-skills-[a-z0-9]+(?:-[a-z0-9]+)*\\.toml$" },
212
+ { "type": "null" }
213
+ ]
214
+ },
215
+ "intents": {
216
+ "type": "array",
217
+ "items": { "$ref": "#/$defs/trustedScriptIntent" }
218
+ }
219
+ }
220
+ },
221
+ "trustedScriptIntent": {
222
+ "type": "object",
223
+ "additionalProperties": false,
224
+ "required": [
225
+ "intent",
226
+ "script_path",
227
+ "argv",
228
+ "run_policy",
229
+ "network",
230
+ "destructive",
231
+ "approval_required"
232
+ ],
233
+ "properties": {
234
+ "intent": { "type": "string", "pattern": "^external_skill_[A-Za-z0-9_-]+$" },
235
+ "script_path": { "type": "string", "pattern": "^scripts/.+$" },
236
+ "argv": {
237
+ "type": "array",
238
+ "minItems": 2,
239
+ "items": { "type": "string" }
240
+ },
241
+ "run_policy": { "const": "agent_allowed" },
242
+ "network": { "const": true },
243
+ "destructive": { "const": true },
244
+ "approval_required": {
245
+ "type": "array",
246
+ "prefixItems": [
247
+ { "const": "network_access" },
248
+ { "const": "destructive_command" }
249
+ ],
250
+ "minItems": 2,
251
+ "maxItems": 2
252
+ }
253
+ }
254
+ }
255
+ }
256
+ }
@@ -50,13 +50,13 @@ translations.hi = { path = "locales/hi/.mustflow/docs/agent-workflow.md", source
50
50
  [documents."config.preferences"]
51
51
  source = "common/.mustflow/config/preferences.toml"
52
52
  source_locale = "en"
53
- revision = 4
53
+ revision = 5
54
54
  translations = {}
55
55
 
56
56
  [documents."config.technology"]
57
57
  source = "common/.mustflow/config/technology.toml"
58
58
  source_locale = "en"
59
- revision = 1
59
+ revision = 2
60
60
  translations = {}
61
61
 
62
62
  [documents."skills.index"]
@@ -224,7 +224,7 @@ translations = {}
224
224
  [documents."skill.memory-lifetime-review"]
225
225
  source = "locales/en/.mustflow/skills/memory-lifetime-review/SKILL.md"
226
226
  source_locale = "en"
227
- revision = 2
227
+ revision = 3
228
228
  translations = {}
229
229
 
230
230
  [documents."skill.desktop-memory-footprint-review"]
@@ -236,7 +236,7 @@ translations = {}
236
236
  [documents."skill.hot-path-performance-review"]
237
237
  source = "locales/en/.mustflow/skills/hot-path-performance-review/SKILL.md"
238
238
  source_locale = "en"
239
- revision = 2
239
+ revision = 6
240
240
  translations = {}
241
241
 
242
242
  [documents."skill.api-request-performance-review"]
@@ -272,7 +272,7 @@ translations = {}
272
272
  [documents."skill.web-render-performance-review"]
273
273
  source = "locales/en/.mustflow/skills/web-render-performance-review/SKILL.md"
274
274
  source_locale = "en"
275
- revision = 1
275
+ revision = 2
276
276
  translations = {}
277
277
 
278
278
  [documents."skill.core-web-vitals-field-review"]
@@ -290,13 +290,13 @@ translations = {}
290
290
  [documents."skill.client-bundle-pruning-review"]
291
291
  source = "locales/en/.mustflow/skills/client-bundle-pruning-review/SKILL.md"
292
292
  source_locale = "en"
293
- revision = 1
293
+ revision = 2
294
294
  translations = {}
295
295
 
296
296
  [documents."skill.frame-render-performance-review"]
297
297
  source = "locales/en/.mustflow/skills/frame-render-performance-review/SKILL.md"
298
298
  source_locale = "en"
299
- revision = 1
299
+ revision = 2
300
300
  translations = {}
301
301
 
302
302
  [documents."skill.motion-system-contract-review"]
@@ -386,7 +386,7 @@ translations = {}
386
386
  [documents."skill.quadratic-scan-review"]
387
387
  source = "locales/en/.mustflow/skills/quadratic-scan-review/SKILL.md"
388
388
  source_locale = "en"
389
- revision = 2
389
+ revision = 4
390
390
  translations = {}
391
391
 
392
392
  [documents."skill.type-state-modeling-review"]
@@ -404,7 +404,7 @@ translations = {}
404
404
  [documents."skill.async-timing-boundary-review"]
405
405
  source = "locales/en/.mustflow/skills/async-timing-boundary-review/SKILL.md"
406
406
  source_locale = "en"
407
- revision = 2
407
+ revision = 3
408
408
  translations = {}
409
409
 
410
410
  [documents."skill.concurrency-invariant-review"]
@@ -763,7 +763,7 @@ translations = {}
763
763
  [documents."skill.javascript-code-change"]
764
764
  source = "locales/en/.mustflow/skills/javascript-code-change/SKILL.md"
765
765
  source_locale = "en"
766
- revision = 3
766
+ revision = 6
767
767
  translations = {}
768
768
 
769
769
  [documents."skill.java-code-change"]
@@ -775,7 +775,7 @@ translations = {}
775
775
  [documents."skill.node-code-change"]
776
776
  source = "locales/en/.mustflow/skills/node-code-change/SKILL.md"
777
777
  source_locale = "en"
778
- revision = 2
778
+ revision = 4
779
779
  translations = {}
780
780
 
781
781
  [documents."skill.react-code-change"]
@@ -1056,7 +1056,7 @@ translations = {}
1056
1056
  [documents."skill.performance-budget-check"]
1057
1057
  source = "locales/en/.mustflow/skills/performance-budget-check/SKILL.md"
1058
1058
  source_locale = "en"
1059
- revision = 20
1059
+ revision = 24
1060
1060
  translations = {}
1061
1061
 
1062
1062
  [documents."skill.pattern-scout"]
@@ -2,7 +2,7 @@
2
2
  mustflow_doc: skill.async-timing-boundary-review
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: async-timing-boundary-review
@@ -63,6 +63,7 @@ The review question is not "how many milliseconds are safe?" It is "is the code
63
63
  - Completion signal available in the codebase: event, callback, listener, promise that resolves on real completion, `finish`, `close`, `fsync`, atomic rename, health check, listen callback, ack, status endpoint, observer, transition event, cancellation token, latch, barrier, fake clock, or deterministic scheduler.
64
64
  - Caller ownership: whether every caller awaits the returned Promise or whether the async work is fire-and-forget, debounced, event-handler-owned, framework-owned, or lifecycle-owned.
65
65
  - Operation identity and ordering model: operation id, entity id, attempt, causation id, generation, version, sequence, cancellation reason, idempotency key, and whether the apply step checks that the result still belongs to the current state.
66
+ - Scheduling and backpressure model: task, microtask, `process.nextTick`, timer, `requestAnimationFrame`, idle callback, `scheduler.yield`, worker message, bounded concurrency, debounce, throttle, and whether producers can outrun consumers.
66
67
  - Test evidence: current tests, fake timers, controlled promises, barriers, polling utilities, readiness probes, stress tests, CI logs, or missing configured verification.
67
68
 
68
69
  <!-- mustflow-section: preconditions -->
@@ -109,6 +110,9 @@ The review question is not "how many milliseconds are safe?" It is "is the code
109
110
  - The awaited Promise must represent the real work, not only scheduling the work.
110
111
  - Catch async `forEach`, `map` without `Promise.all`, missing `return` in `.then`, unawaited callers, swallowed catches, async event handlers whose business flow is not awaited, debounced promises, and event APIs that need explicit `load`, `error`, `finish`, or `close` wrapping.
111
112
  - In UI code, do not treat state setters, microtasks, or Promise resolution as proof that DOM layout or paint has happened.
113
+ - Do not use recursive `Promise.resolve().then(...)`, `queueMicrotask(...)`, or `process.nextTick(...)` loops as a general scheduler. They can starve rendering, input, timers, I/O, and shutdown work because the runtime drains those queues before moving on.
114
+ - Yield long work at the right boundary. Use `requestAnimationFrame` for visual writes, bounded tasks or feature-detected `scheduler.yield` for cooperative main-thread work, idle callbacks for non-urgent browser work, and worker offload when CPU work is too large to share the UI thread.
115
+ - Treat `Promise.all` as a failure-policy choice, not as automatic cancellation. If one failure should stop sibling work, wire cancellation to the underlying operations; if all outcomes matter, collect them with `allSettled`; if first success is enough, use the local `any` or fallback pattern.
112
116
  6. Define "once" by scope.
113
117
  - Name the scope: call, component mount, route lifetime, tab, process, deployment, worker, queue message, transaction retry, cron tick, or durable resource.
114
118
  - Make side effects idempotent when retries, remounts, StrictMode, HMR, reconnects, queue redelivery, transaction retries, multiple tabs, serverless cold starts, or rolling deploys can repeat them.
@@ -140,6 +144,7 @@ The review question is not "how many milliseconds are safe?" It is "is the code
140
144
  - Every fixed wait is classified as a true time contract, replaced with a completion signal, converted to bounded polling, or reported as residual risk.
141
145
  - The exact completion condition and boundary crossed by the old delay are named.
142
146
  - Promise, "once", event-loop, render, filesystem, process, worker, database, queue, external consistency, and test claims are checked where relevant.
147
+ - Microtask, next-tick, timer, frame, idle, bounded-concurrency, debounce, throttle, and cancellation scheduling claims are checked where relevant.
143
148
  - Latest-request-wins, generation or version guards, cancellation states, duplicate delivery, late success, outbox or inbox handoffs, and per-key ordering are checked where relevant.
144
149
  - Remaining waits have explicit reason, bound, cancellation, and diagnostic behavior when possible.
145
150
  - Verification covers the changed timing boundary or reports the missing configured intent.
@@ -2,7 +2,7 @@
2
2
  mustflow_doc: skill.client-bundle-pruning-review
3
3
  locale: en
4
4
  canonical: true
5
- revision: 1
5
+ revision: 2
6
6
  lifecycle: mustflow-owned
7
7
  authority: procedure
8
8
  name: client-bundle-pruning-review
@@ -29,9 +29,9 @@ metadata:
29
29
  <!-- mustflow-section: purpose -->
30
30
  ## Purpose
31
31
 
32
- Review frontend bundle weight by finding code shapes that keep bundlers from deleting unused client code, not by repeating generic advice about compression, images, or code splitting.
32
+ Review frontend bundle weight by finding code shapes that keep bundlers from deleting unused client code, not by repeating generic advice about compression, images, or code splitting. Treat compressed transfer size as only one receipt; the browser pays again when JavaScript is decompressed, parsed, compiled, evaluated, and run on the main thread.
33
33
 
34
- The review question is not "is code splitting enabled?" It is "which imports, package entrypoints, module formats, side-effect claims, client boundaries, polyfills, and chunk rules force unused code into the first route or shared vendor bundle?"
34
+ The review question is not "is code splitting enabled?" It is "which imports, package entrypoints, module formats, side-effect claims, client boundaries, polyfills, coverage gaps, and chunk rules force unused or late-use code into the first route or shared vendor bundle?"
35
35
 
36
36
  <!-- mustflow-section: use-when -->
37
37
  ## Use When
@@ -60,6 +60,7 @@ The review question is not "is code splitting enabled?" It is "which imports, pa
60
60
  - Framework boundary ledger: Next.js Server/Client Component boundary, `next/dynamic`, `optimizePackageImports`, React `lazy`, Angular `@defer`, Vue route lazy loading, Svelte/Astro island or hydration boundary, and whether code is required for first interaction.
61
61
  - Heavy-feature ledger: icons, UI component libraries, date locales, syntax highlighters, markdown, editors, charts, maps, PDF viewers, search/fuzzy libraries, Node polyfills, dev-only tools, logs, and CSS utility extraction.
62
62
  - Polyfill and target ledger: browser support target, Babel or TypeScript output target, `core-js` usage, Node polyfills, `process` or `Buffer` shims, Vite modulepreload polyfill, and esbuild/Webpack/Rollup define or drop settings.
63
+ - Measurement ledger: initial JavaScript transfer, decompressed size, parse, compile, evaluate, bootup or long-task time, route-specific Chrome Coverage or equivalent unused-code evidence, Resource Timing for preload or prefetch changes, manifest or chunk hash stability, and whether the evidence is flow-specific or a single refresh snapshot.
63
64
  - Existing tests, build output, bundle budgets, analyzer screenshots or reports, package metadata checks, and configured command-intent evidence.
64
65
 
65
66
  <!-- mustflow-section: preconditions -->
@@ -83,42 +84,47 @@ The review question is not "is code splitting enabled?" It is "which imports, pa
83
84
  ## Procedure
84
85
 
85
86
  1. Review first-route JavaScript separately from total build output. Name the route or entry users actually load first, then separate initial JS, route JS, shared vendor JS, CSS, and lazy chunks when evidence exists.
86
- 2. Prefer a failing bundle budget over human memory. If the repository has a budget pattern, enforce initial route JS and shared vendor growth with configured tests or release checks. If no configured budget exists, report the gap instead of inventing analyzer commands.
87
- 3. Suspect non-ESM packages first. Tree shaking depends on static imports and exports; CommonJS `require`, mixed module packages, dynamic require patterns, or ambiguous package entrypoints often keep unused code alive.
88
- 4. Replace broad utility imports. Avoid `import _ from 'lodash'`, broad date imports, or whole-library namespace imports on client paths when ESM or function-level imports preserve behavior.
89
- 5. Audit barrel files on hot client paths. `export *` design-system or icon barrels can force bundlers to inspect or include too much. Prefer direct subpath imports when the package owns that contract.
90
- 6. Split internal package exports by feature. Provide stable subpath exports such as component, icon, or helper entrypoints when `@scope/ui` as a single entry drags unrelated modules into client bundles.
91
- 7. Set `sideEffects` metadata carefully. Use `false` only when modules are truly side-effect-free, and preserve CSS imports, polyfills, global registrations, telemetry setup, and plugin initialization through an allowlist.
92
- 8. Treat Rollup or Vite `moduleSideEffects: false` as dangerous by default. Use a function or allowlist when CSS, polyfills, custom elements, plugin registration, or global patches exist.
93
- 9. Add PURE annotations only for pure wrapper calls. React `memo`, `forwardRef`, higher-order component factories, icon factories, and generated component wrappers may need `/* @__PURE__ */`, but never mark a call pure unless its arguments and call have no required side effects.
94
- 10. Move client boundaries inward. In Next.js style apps, avoid putting `'use client'` on pages, layouts, or broad shells when only a small search box, menu, chart, or control needs browser state.
95
- 11. Use Server Components or server-only code as a deletion boundary. Keep markdown parsing, CMS transforms, price formatting, permission checks, data shaping, and server-safe library use out of Client Components when interactivity does not require them.
96
- 12. Keep dynamic imports statically analyzable. `next/dynamic` and similar APIs need explicit import strings at module top level when preloading or chunk naming depends on static analysis.
97
- 13. Declare `React.lazy` and similar lazy components outside render functions. Recreating lazy definitions during render can reset state and blur split boundaries.
98
- 14. Lazy-load optional heavy widgets. Modals, charts, editors, maps, search, PDF viewers, markdown preview, syntax highlighting, and admin-only panels should not enter initial JS unless they are visible and necessary at first load.
99
- 15. Move external library imports to the event or visibility point when safe. Search libraries can load on focus or input, charts on tab open, maps on section reveal, markdown preview on preview mode, and editors on edit intent.
100
- 16. Use Angular `@defer`, Vue route lazy loading, Svelte/Astro islands, or framework-native deferral when that framework is present. Confirm the dependencies are not also imported eagerly outside the deferred boundary.
101
- 17. Use import modularization options cautiously. Next.js `optimizePackageImports` or equivalent compiler transforms can help large export surfaces, but verify the actual output and do not treat an experimental option as proof.
102
- 18. Audit icon imports. Prefer per-icon imports, stable subpath imports, or build-time SVG sprites over package roots or barrels that can pull an icon catalog into client JS.
103
- 19. Audit date locales. Import only needed locales, prefer platform `Intl` when it is enough, and keep server-format-able date work off the client path.
104
- 20. Split syntax highlighters, markdown processors, and code editors by language, mode, or worker boundary. Do not ship every grammar, theme, plugin, or editor worker for one small code block.
105
- 21. Avoid accidental Node polyfills in browser bundles. Do not fix `crypto`, `stream`, `buffer`, `process`, or `path` resolution errors by adding browser shims unless the browser feature truly needs them; prefer false fallbacks or server-only boundaries when possible.
106
- 22. Modernize browser targets only with product support evidence. Too-low Babel or TypeScript targets can inject helper and polyfill overhead; too-high targets can break real users.
107
- 23. Replace broad Babel polyfill imports. Avoid whole `core-js/stable` or blanket polyfill entrypoints when target-aware `preset-env` or explicit feature polyfills can cover the supported browsers.
108
- 24. Ensure dev-only branches fold at build time. `process.env.NODE_ENV`, `__DEV__`, `import.meta.env.DEV`, feature labels, and debug helpers must become constants for dead-code elimination to remove dev tooling.
109
- 25. Remove console calls safely. Do not blindly drop all console calls when arguments may have side effects. Prefer logging wrappers or pure-log configuration that preserves required argument behavior.
110
- 26. Avoid one giant vendor chunk. Manual chunk rules that put all `node_modules` in one vendor bundle can pull charts, editors, maps, and admin-only code into the first route and can change side-effect timing.
111
- 27. Check Vite modulepreload behavior. Disable the modulepreload polyfill only when supported browser targets make that safe; avoid preloading lazy route or widget chunks that are not needed soon.
112
- 28. Keep Tailwind and utility extraction finite. Avoid dynamic class string construction that production extraction cannot see, and avoid broad safelists that inflate CSS. Prefer complete static class strings or constrained maps.
113
- 29. Check inline asset thresholds. Large SVGs, fonts, or images inlined into JavaScript increase parse and transfer cost; use separate resources unless the asset is small and truly critical.
114
- 30. Label evidence honestly. If no configured bundle analyzer, budget, build output, or package-size proof exists, report the result as static import-graph risk or missing measurement, not a measured bundle reduction.
87
+ 2. Budget execution, not only gzip. Prefer initial JavaScript parse, compile, evaluate, bootup, and long-task budgets over compressed KB-only claims. Treat gzip or brotli size as transfer evidence, not proof that the main thread got faster.
88
+ 3. Compare analyzer receipts with coverage evidence. Bundle analyzers show what entered the build; route-specific Coverage or equivalent evidence shows what was unused in the flow. Check first entry, logged-in state, key route, checkout or save path, and heavy feature entry separately when those flows matter.
89
+ 4. Prefer a failing bundle budget over human memory. If the repository has a budget pattern, enforce initial route JS, shared vendor growth, evaluate time, or long-task growth with configured tests or release checks. If no configured budget exists, report the gap instead of inventing analyzer commands.
90
+ 5. Suspect non-ESM packages first. Tree shaking depends on static imports and exports; CommonJS `require`, mixed module packages, dynamic require patterns, or ambiguous package entrypoints often keep unused code alive.
91
+ 6. Replace broad utility imports. Avoid `import _ from 'lodash'`, broad date imports, or whole-library namespace imports on client paths when ESM or function-level imports preserve behavior.
92
+ 7. Audit barrel files on hot client paths. `export *` design-system or icon barrels can force bundlers to inspect or include too much. Prefer direct subpath imports when the package owns that contract.
93
+ 8. Split internal package exports by feature. Provide stable subpath exports such as component, icon, or helper entrypoints when `@scope/ui` as a single entry drags unrelated modules into client bundles.
94
+ 9. Set `sideEffects` metadata carefully. Use `false` only when modules are truly side-effect-free, and preserve CSS imports, polyfills, global registrations, telemetry setup, and plugin initialization through an allowlist.
95
+ 10. Treat Rollup or Vite `moduleSideEffects: false` as dangerous by default. Use a function or allowlist when CSS, polyfills, custom elements, plugin registration, or global patches exist.
96
+ 11. Add PURE annotations only for pure wrapper calls. React `memo`, `forwardRef`, higher-order component factories, icon factories, and generated component wrappers may need `/* @__PURE__ */`, but never mark a call pure unless its arguments and call have no required side effects.
97
+ 12. Move client boundaries inward. In Next.js style apps, avoid putting `'use client'` on pages, layouts, or broad shells when only a small search box, menu, chart, or control needs browser state.
98
+ 13. Use Server Components or server-only code as a deletion boundary. Keep markdown parsing, CMS transforms, price formatting, permission checks, data shaping, and server-safe library use out of Client Components when interactivity does not require them.
99
+ 14. Keep dynamic imports statically analyzable and outside the initial static graph. `next/dynamic` and similar APIs need explicit import strings at module top level when preloading or chunk naming depends on static analysis; `import()` does not help when the same module is statically imported by the first route, shell, barrel, or shared vendor path.
100
+ 15. Declare `React.lazy` and similar lazy components outside render functions. Recreating lazy definitions during render can reset state and blur split boundaries.
101
+ 16. Split by "the user can wait here," not by arbitrary component size. Route transitions, modal first open, editor mode, chart tab, map reveal, admin panel entry, or preview mode are stronger boundaries than small components that are needed together.
102
+ 17. Lazy-load optional heavy widgets. Modals, charts, editors, maps, search, PDF viewers, markdown preview, syntax highlighting, and admin-only panels should not enter initial JS unless they are visible and necessary at first load.
103
+ 18. Move external library imports to the event or visibility point when safe. Search libraries can load on focus or input, charts on tab open, maps on section reveal, markdown preview on preview mode, and editors on edit intent.
104
+ 19. Use Angular `@defer`, Vue route lazy loading, Svelte/Astro islands, or framework-native deferral when that framework is present. Confirm the dependencies are not also imported eagerly outside the deferred boundary.
105
+ 20. Use import modularization options cautiously. Next.js `optimizePackageImports` or equivalent compiler transforms can help large export surfaces, but verify the actual output and do not treat an experimental option as proof.
106
+ 21. Audit icon imports. Prefer per-icon imports, stable subpath imports, or build-time SVG sprites over package roots or barrels that can pull an icon catalog into client JS.
107
+ 22. Audit date locales. Import only needed locales, prefer platform `Intl` when it is enough, and keep server-format-able date work off the client path.
108
+ 23. Split syntax highlighters, markdown processors, and code editors by language, mode, or worker boundary. Do not ship every grammar, theme, plugin, or editor worker for one small code block.
109
+ 24. Avoid accidental Node polyfills in browser bundles. Do not fix `crypto`, `stream`, `buffer`, `process`, or `path` resolution errors by adding browser shims unless the browser feature truly needs them; prefer false fallbacks or server-only boundaries when possible.
110
+ 25. Modernize browser targets only with product support evidence. Too-low Babel or TypeScript targets can inject helper and polyfill overhead; too-high targets can break real users.
111
+ 26. Replace broad Babel polyfill imports. Avoid whole `core-js/stable` or blanket polyfill entrypoints when target-aware `preset-env` or explicit feature polyfills can cover the supported browsers.
112
+ 27. Ensure dev-only branches fold at build time. `process.env.NODE_ENV`, `__DEV__`, `import.meta.env.DEV`, feature labels, and debug helpers must become constants for dead-code elimination to remove dev tooling.
113
+ 28. Remove console calls safely. Do not blindly drop all console calls when arguments may have side effects. Prefer logging wrappers or pure-log configuration that preserves required argument behavior.
114
+ 29. Avoid one giant vendor chunk. Manual chunk rules that put all `node_modules` in one vendor bundle can pull charts, editors, maps, and admin-only code into the first route and can change side-effect timing.
115
+ 30. Check Vite and Rollup version semantics before copying old chunk advice. Confirm whether the project uses current `build.rollupOptions`, newer Rolldown aliases, `cssCodeSplit`, framework wrappers, and modulepreload behavior before changing chunk rules.
116
+ 31. Check Vite modulepreload, preload, and prefetch behavior with timing evidence. Disable the modulepreload polyfill only when supported browser targets make that safe; avoid preloading or prefetching lazy route or widget chunks that are not needed soon, and use Resource Timing or configured evidence when priority changes are claimed.
117
+ 32. Keep Tailwind and utility extraction finite. Avoid dynamic class string construction that production extraction cannot see, and avoid broad safelists that inflate CSS. Prefer complete static class strings or constrained maps.
118
+ 33. Check inline asset thresholds. Large SVGs, fonts, or images inlined into JavaScript increase parse and transfer cost, couple cache lifetimes, and can force re-downloads when an app chunk changes; use separate resources unless the asset is small and truly critical.
119
+ 34. Check long-term chunk cache stability. One source edit should not churn every chunk hash unless the graph contract requires it. Inspect manifest use, stable vendor or route chunks, and rarely-used heavy chunks when deployment cache behavior is part of the claim.
120
+ 35. Label evidence honestly. If no configured bundle analyzer, coverage report, Resource Timing, budget, build output, or package-size proof exists, report the result as static import-graph risk or missing measurement, not a measured bundle reduction.
115
121
 
116
122
  <!-- mustflow-section: postconditions -->
117
123
  ## Postconditions
118
124
 
119
125
  - First-route JS, route chunks, shared vendor chunks, package entrypoints, imports, barrels, side effects, client/server boundaries, dynamic imports, heavy optional features, polyfills, targets, chunk rules, CSS extraction, and inline assets are explicit where relevant.
120
126
  - CJS-heavy imports, broad package roots, hot-path barrels, missing subpath exports, unsafe side-effect metadata, missing PURE hints, broad client boundaries, eager heavy widgets, event-time libraries, icon catalogs, date locale packs, highlighter/editor language packs, Node polyfills, old browser targets, broad polyfills, un-folded dev code, unsafe console drops, giant vendor chunks, modulepreload spam, dynamic Tailwind classes, broad safelists, and large inline assets are fixed or reported.
121
- - Bundle-size claims are backed by current configured evidence or labeled as static import-graph risk, manual-only measurement, or missing evidence.
127
+ - Bundle-size, unused-code, initial-JS, evaluate-time, long-task, preload, prefetch, and cache-stability claims are backed by current configured evidence or labeled as static import-graph risk, manual-only measurement, or missing evidence.
122
128
  - Public import compatibility, CSS, polyfills, localization, accessibility, logging semantics, and framework behavior remain intact or are reported as tradeoffs.
123
129
 
124
130
  <!-- mustflow-section: verification -->
@@ -152,7 +158,7 @@ Use the narrowest configured test, build, docs, release, or mustflow intent that
152
158
 
153
159
  - Client bundle surface reviewed
154
160
  - First-route JS, route chunk, and shared vendor evidence
155
- - Import graph, package entry, side-effect, client boundary, lazy-loading, polyfill, target, chunk, CSS extraction, and inline asset ledgers
161
+ - Import graph, package entry, side-effect, client boundary, coverage, lazy-loading, polyfill, target, chunk, CSS extraction, preload or prefetch, inline asset, and cache-stability ledgers
156
162
  - Findings or fixes
157
163
  - Evidence level: measured, configured-test evidence, static import-graph risk, manual-only, missing, or not applicable
158
164
  - Command intents run