Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

rspeedy-bundle-size

БесплатноЗапускает вложенные скриптыНе проверен

Analyze and reduce the bundle size of rspeedy/Lynx (ReactLynx) apps — the size / `.lynx.bundle` lever (not runtime perf, types, or CI). Use when the user…

lynx-communityот lynx-community★ 28 звёзд на GitHub

Об этом скилле

Rspeedy Bundle Optimization

A measure-first workflow for shrinking the bundle of a rspeedy/Lynx app. The central discipline: don't guess where the bytes are — measure, then attack the biggest lever first. Most "optimize the bundle" requests fail by starting with micro-tree-shaking when the real weight is media assets or main-thread leakage.

Verify against source — do not guess

The rspeedy / ReactLynx build behaves in non-obvious ways, and guessing is how you end up confidently wrong. When you're unsure how the build, the layers, the ES targets, or stats/rsdoctor output actually behave, read the source — don't infer from naming or memory. The whole toolchain is open source; clone or browse it and grep for the relevant plugin/util:

The toolchain layers as Rspack → Rsbuild → Rspeedy (each builds on the one before), so a behavior may live in any layer — follow it down:

(Exact file paths aren't pinned here — they move between versions. Search by symbol, e.g. the ES-target util, the stats-json plugin, the entry/layer setup.) Several facts in this skill — main=ES2019 / background=ES2015, stats.json carrying layer, the entry→two-layer split — were each confirmed by reading the source or running a real build, not assumed. Hold new claims to the same bar.

NO GUESS — trace the real module graph, never narrate an import chain

When the question is "why is X bundled / who imports Y / what's the chain from the entry to Z", you must trace the actual module graph — never describe a plausible chain from package.json, intuition, or a half-answer like "it comes in via the dependency tree, scope-hoisted into ./entry.tsx + 4630 modules." That + N modules is the bundler hiding the edge from you, not an answer. To get the real edges:

  1. Build with tools.rspack setting optimization.moduleIds: 'named' AND optimization.concatenateModules: false. Scope-hoisting (concatenateModules: true, the prod default) collapses importer edges — every hoisted module's importer is reported as the whole concatenated group ("./entry.tsx + N modules"), so you literally cannot see who imports what. Disabling it is mandatory for chain tracing (it inflates size substantially — ~+70% observed on one project, varies by module graph — so it's analysis-only; revert after). De-concat also disables __split__, so components already split off the main thread reappear inflated in main-thread.js — cross-check any "huge popup/modal" against the real build before calling it a lazy-load candidate (see rspeedy-gotchas.md §11).
  2. Read the actual importer edges from stats.json's reasons[].moduleName (each module lists the modules that import it). On a big multi-entry build this file can reach hundreds of MB to ~1 GB — too big for readFileSync (ERR_STRING_TOO_LONG); stream it (grep / readline). (A single-page build with the default stats preset is far smaller — only stats: { all: true } or a many-page merge blows it up; see measure-with-rsdoctor.md.)
  3. Walk the chain hop by hop and report the exact file at each hop. If you can't back a hop with a real reason edge, you don't have the chain — say so, don't invent it.

Real example this rule comes from: an app's 1388-icon bloat looked like "app → business component lib → UI lib → icon barrel" — but the app imported none of those packages directly (0 hits in src/); only the de-concat reasons revealed the true edges. A narrated chain would have pointed the owner at the wrong file. A dependency chain without real reason-edges behind it is a guess; do not present guesses as chains.

When to use this skill

  • "帮我优化一下包体积" / "reduce the bundle size of this rspeedy app"
  • "为什么我的包这么大" / "what is making this bundle large"
  • After a build, the user wants the size broken down and a prioritized plan
  • Deciding whether tree-shaking is even worth it, vs media compression vs main-thread cleanup

A distinct cause of an oversized bundle is mangle failure — readable module-prefixed names (common_EVENT_NAME, utils_toSomething) surviving in the production chunk, usually from eval() poisoning under ModuleConcatenation. It's covered as part of the JS lever in references/three-levers.md §Lever 2.

When NOT to use this skill

This is the bundle-size / .lynx.bundle lever only — it optimizes shipped bytes, not anything else. Route elsewhere for:

  • Runtime / render performance (jank, slow first paint, frame drops) — a diff
Полный SKILL.md на GitHub

Установить rspeedy-bundle-size в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/assets/gate.awkreferences/assets/mt-cutpoint-analyzer.mjsreferences/assets/mt-leak-analyzer.mjsreferences/assets/plugin-strip-mt-telemetry.tsreferences/assets/scan-levers.mjsreferences/assets/signatures.cjsreferences/assets/strip-mt-telemetry-loader.cjsreferences/cross-project-triage.mdreferences/dual-thread-architecture.mdreferences/measure-with-rsdoctor.mdreferences/rspeedy-gotchas.mdreferences/three-levers.md

FAQ

Что делает скилл rspeedy-bundle-size?

Analyze and reduce the bundle size of rspeedy/Lynx (ReactLynx) apps — the size / `.lynx.bundle` lever (not runtime perf, types, or CI). Use when the user wants to optimize 包体积 / bundle size, find what is making a rspeedy bundle large, decide which size lever to pull, or shrink `main-thread.js` by stripping background-only code (jsb / telemetry / request / monitor SDKs) out of the render path via `__BACKGROUND__` / `'background only'` gating. Covers media, JS-background, and main-thread layers, plus mangle/eval-poisoning bloat, i18n-locale duplication, duplicate-package dedup, extractStr/compile knobs, and lazy/dynamic-component splitting (first-screen vs total size). Measure-first and evidence-based — produces a prioritized report; changes code only when asked.

Как установить скилл rspeedy-bundle-size?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл rspeedy-bundle-size запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить rspeedy-bundle-size с