用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/47ng/nuqs --skill bundle-size-bake-off命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | bundle-size-bake-off |
| description | Run a "bake-off" to reduce the bundle size impact of changes using subagents |
| metadata | {"author":"François Best <francoisbest.com>"} |
Spin up a number of subagents (as told by the user or 4 by default) to find an implementation that yields a smaller bundle size for the current PR, branch or changes we're working on.
To measure the bundle size: pnpm build --filter nuqs && pnpm run --filter nuqs test:size
pnpm run --filter nuqs test:size will print the size on stdout. pnpm run --filter nuqs build:size-json will write it to a packages/nuqs/size.json file. Both will fail if the size is over the limit.The main metric we want to reduce is the Client bundle size (minified & brotli-compressed).
size-limit does all the processing and gives out a metric, no other build steps are needed: this is a trial and error process.
You (the main agent) are not to do this work yourself: delegate it to N subagents. Each subagent works in its own worktree. (you create them and set them up with pnpm setup:worktree at the baseline SHA1), with the following instructions:
Try both small incremental steps and larger changes. Sometimes moving back and trying something else will give a better result (use a gradient descent approach, avoid local minima).
Note: some changes will play better with compression than others (sometimes, duplication will give better results than abstractions due to dictionaries).
The changes must:
Any violation is a failure condition, and that candidate is to be dismissed.
Once subagents have reported their findings, give the user a short report:
Example:
| Name | Client | Tree-shaken | Server |
| ----------------------------- | ------: | ----------: | ------: |
| Baseline | 5,920 B │ 4,288 B │ 3,786 B │
| 1. Inline parser helpers | -308 B | -112 B | -32 B |
| 2. Split shared state helpers | -240 B | -64 B | -16 B |
| 3. Remove wrapper functions | -128 B | -32 B | +2 B |
What they did:
1. removes call layers from the client path.
2. keeps server-only code out of the client bundle.
3. lets the bundler inline small calls.
Once the user has accepted the changes: