[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M758548FYJCXRBGRQEJZRRHN":3,"skill-same:01M758548FYJCXRBGRQEJZRRHN":46},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":28,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M758548FYJCXRBGRQEJZRRHN","benchmarking",null,"nubjs\u002Fnub","nubjs","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6785695?v=4","01M7583N3EYYHSNB6FJQXCDMQH","Nub","01M7583N44MVMSN8385QEF3C8V",4440,"MIT","https:\u002F\u002Fgithub.com\u002Fnubjs\u002Fnub\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fbenchmarking\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: benchmarking\ndescription: Comparative install-benchmarking methodology for nub vs npm\u002Fpnpm\u002Fbun — cold\u002Fwarm protocol, genuine-cold cache isolation, load-robust measurement, and the anti-juicing honesty bar. Invoke (via the Skill tool) whenever you need to benchmark `nub install` against another package manager, produce or update the homepage\u002Fblog install numbers, or verify a perf claim before it ships. Encodes the hard-won gotchas: time setup OUTSIDE the measurement (hyperfine `--prepare`), the cache lives on DISK so env-var isolation is NOT trustworthy (bun ignores `BUN_INSTALL_CACHE_DIR`\u002F`$HOME` — wipe the real path), VERIFY every cold is genuine via an offline-fails check, and only measure wall-clock on a quiet machine (gate on low load) with file counts as a load-independent cross-check. Pairs with `pm-perf-tracing` for the internal Rust phase decomposition.\nmetadata:\n  internal: true\n---\n\n# benchmarking\n\nHonest, reproducible **comparative install benchmarks** of `nub install` against npm \u002F pnpm \u002F bun — the external, wall-clock-and-file-count method. For decomposing where the time goes INSIDE a single nub install, use [`pm-perf-tracing`](..\u002Fpm-perf-tracing\u002FSKILL.md) instead.\n\nApplies to: benchmarking against another PM, refreshing homepage\u002Fblog install numbers, verifying a perf claim before it ships. **A single non-genuine cell discredits the whole table.**\n\n## The tool: hyperfine\n\n`\u002Fopt\u002Fhomebrew\u002Fbin\u002Fhyperfine` is the canonical timer. The load-bearing flag is `--prepare`, which runs setup BEFORE each timed run, untimed. **Never time setup.**\n\n```sh\n# COLD: empty the tool's REAL cache + wipe node_modules before each run (untimed), then time the install.\nhyperfine --warmup 0 --runs 5 \\\n  --prepare 'rm -rf node_modules && d=\"$(bun pm cache)\" && rm -rf \"${d:?}\"' \\\n  'bun install --ignore-scripts'\n\n# WARM-RELINK: cache populated, wipe ONLY node_modules before each run.\nhyperfine --warmup 1 --runs 5 \\\n  --prepare 'rm -rf node_modules' \\\n  'nub install --ignore-scripts'\n\n# WARM-SAT: node_modules already present (idempotency path) — no prepare wipe.\nhyperfine --warmup 1 --runs 5 'nub install --ignore-scripts'\n```\n\nPrefer median + spread (min–max) over the mean — contention skews the mean.\n\n## The cold \u002F warm protocol\n\n`node_modules` is deleted before EVERY timed run, cold and warm, always in `--prepare`. The cold\u002Fwarm axis differs only in global-cache state:\n\n- **cold** — the tool's real cache is EMPTY (genuine download).\n- **warm-relink** — cache populated, `node_modules` wiped (the link-from-store path; the homepage number).\n- **warm-sat** — `node_modules` already present; a separate, clearly-labeled scenario, not the headline.\n\n## GENUINE-COLD per tool — the cache is on DISK\n\nA \"cold\" run is only cold if the tool's real on-disk cache is gone. Setting a cache-dir env var does not guarantee that — **bun ignores `BUN_INSTALL_CACHE_DIR` and `$HOME`**, resolving its cache via the OS passwd home. You must wipe the disk path.\n\n| tool | real cache path | clear command for cold |\n|---|---|---|\n| nub | its store (`NUB_CACHE_DIR` + `XDG_DATA_HOME`\u002F`XDG_CACHE_HOME`) | `rm -rf \"$NUB_CACHE_DIR\" \"$XDG_DATA_HOME\" \"$XDG_CACHE_HOME\"` |\n| npm | `~\u002F.npm\u002F_cacache` (or `--cache \u003Cdir>`) | `rm -rf \u003Ccache>` (the `--cache` dir you pass) |\n| pnpm | `pnpm store path` (or `--store-dir \u003Cdir>`) | `rm -rf \u003Cstore>` (or `pnpm store prune`) |\n| **bun** | **`bun pm cache`** = the real `~\u002F.bun\u002Finstall\u002Fcache` | **`rm -rf \"$(bun pm cache)\"`** — env vars do NOT relocate it |\n\n## VERIFY each cold is genuine — the offline-fails check\n\nAfter wiping a cache, an `--offline` install MUST FAIL. A pass means the cache wasn't cleared (wrong disk path), and any \"cold\" number from it is a warm-link artifact. Run this for every tool before trusting a cold number:\n\n| tool | expected after cache wipe | genuine? |\n|---|---|---|\n| nub | `rc≠0`, \"not available in the local cache\" | FAIL → genuine |\n| pnpm | `rc=1`, `ERR_PNPM_NO_OFFLINE_TARBALL` | FAIL → genuine |\n| npm | `rc≠0`, cache-miss error | FAIL → genuine |\n| bun | if `bun install --offline` SUCCEEDS → cache NOT cleared → bun cold is NOT genuine |\n\nA true bun cold needs a clean container, or wiping the user's real cache (destructive — don't, unless in Docker).\n\n## Apples-to-apples isolation\n\n- Each tool gets its OWN cache dir.\n- `--ignore-scripts` for ALL tools (or `--allow-scripts` for all — same on both sides).\n- Identical fixture, identical lockfile throughout (use a `--frozen-lockfile`\u002F`--frozen` equivalent where the tool offers one).\n- **Interleave tool order round-robin** (nub → npm → bun → pnpm, repeat) — never all-of-one-then-the-other — so drift in host load hits every tool equally.\n\n## Load discipline — measure only on a quiet machine\n\n- **Check the load average before measuring and only proceed when the machine is quiet.** A dedicated quiet box or a CI runner near zero load is ideal for anything that will be published.\n- **On a shared dev host, WAIT for load to fall below a threshold — don't measure above it.** A practical gate is a 1-minute load average under ~40 (pick a threshold the machine actually reaches; below ~5 is ideal on a dedicated box). Poll, wait, then run; abort and retry if it spikes mid-run.\n- **Report the load that held during the run** alongside the numbers.\n- **File counts and store-entry counts are exact and load-independent** — a robust cross-check, and the clearest way to tell the dedup story. They complement a properly-measured time, not replace it.\n\n## File-count forensics (the load-independent crux)\n\n```sh\nfind node_modules -type f -o -type l | wc -l          # total materialized entries\nls -d node_modules\u002F**\u002Fcore-js node_modules\u002Fcore-js    # physical copies of a duplicated dep (dedup story)\n```\n\nReach for this first — exact, reproducible, immune to load.\n\n## The honesty bar (anti-juicing)\n\n- VERIFY every cold is genuine (offline-fails check) BEFORE citing it.\n- **NEVER compare one tool's genuine-cold to another's warm-link** — the exact misleading comparison the offline check exists to prevent.\n- Report what was actually measured, caveats included (which colds are genuine, host load, sample size).\n- The homepage cites the WARM number because it is the honest, reproducible one.\n- A single non-genuine cell discredits the whole table. When in doubt, exclude the cell and say why.\n\n## Process hygiene (this runs on the maintainer's machine)\n\nShort-lived install\u002Fmeasurement processes reap themselves. The hazard is a **long-lived process a bench starts and forgets**:\n\n- **Never leave a dev server running.** If a bench starts one, tear it down in the same run (`trap '…kill…' EXIT INT TERM`).\n- **Docker: `docker run --rm`, and confirm `docker ps` is empty when done.**\n\n## Reference template\n\n`\u002Ftmp\u002Fcs-bench-final.sh` is a working 4-tool harness (nub \u002F npm \u002F bun \u002F pnpm) — per-tool isolated cache dirs, `--ignore-scripts` for all, interleaved round-robin order, `node_modules` wiped before every run, median\u002Fspread helpers. Read its structure before hand-rolling a new one; adapt the cache paths and fixture, keep the protocol.\n\n## Internal decomposition\n\nWhen a comparative number raises \"WHY is nub's phase X slow?\", switch to [`pm-perf-tracing`](..\u002Fpm-perf-tracing\u002FSKILL.md): `RUST_LOG=debug nub install` for the `phase:resolve\u002Ffetch\u002Flink` split, and the gated `AUBE_DIAG_FILE` per-file linker strategy tally.\n","# benchmarking\n\nHonest, reproducible **comparative install benchmarks** of `nub install` against npm \u002F pnpm \u002F bun — the external, wall-clock-and-file-count method. For decomposing where the time goes INSIDE a single nub install, use [`pm-perf-tracing`](..\u002Fpm-perf-tracing\u002FSKILL.md) instead.\n\nApplies to: benchmarking against another PM, refreshing homepage\u002Fblog install numbers, verifying a perf claim before it ships. **A single non-genuine cell discredits the whole table.**\n\n## The tool: hyperfine\n\n`\u002Fopt\u002Fhomebrew\u002Fbin\u002Fhyperfine` is the canonical timer. The load-bearing flag is `--prepare`, which runs setup BEFORE each timed run, untimed. **Never time setup.**\n\n```sh\n# COLD: empty the tool's REAL cache + wipe node_modules before each run (untimed), then time the install.\nhyperfine --warmup 0 --runs 5 \\\n  --prepare 'rm -rf node_modules && d=\"$(bun pm cache)\" && rm -rf \"${d:?}\"' \\\n  'bun install --ignore-scripts'\n\n# WARM-RELINK: cache populated, wipe ONLY node_modules before each run.\nhyperfine --warmup 1 --runs 5 \\\n  --prepare 'rm -rf node_modules' \\\n  'nub install --ignore-scripts'\n\n# WARM-SAT: node_modules already present (idempotency path) — no prepare wipe.\nhyperfine --warmup 1 --runs 5 'nub install --ignore-scripts'\n```\n\nPrefer median + spread (min–max) over the mean — contention skews the mean.\n\n## The cold \u002F warm protocol\n\n`node_modules` is deleted before EVERY timed run, cold and warm, always in `--prepare`. The cold\u002Fwarm axis differs only in global-cache state:\n\n- **cold** — the tool's real cache is EMPTY (genuine download).\n- **warm-relink** — cache populated, `node_modules` wiped (the link-from-store path; the homepage number).\n- **warm-sat** — `node_modules` already present; a separate, clearly-labeled scenario, not the headline.\n\n## GENUINE-COLD per tool — the cache is on DISK\n\nA \"cold\" run is only cold if the tool's real on-disk cache is gone. Setting a cache-dir env var does not guarantee that — **bun ignores `BUN_INSTALL_CACHE_DIR` and `$HOME`**, resolving its cache via the OS passwd home. You must wipe the disk path.\n\n| tool | real cache path | clear command for cold |\n|---|---|---|\n| nub | its store (`NUB_CACHE_DIR` + `XDG_DATA_HOME`\u002F`XDG_CACHE_HOME`) | `rm -rf \"$NUB_CACHE_DIR\" \"$XDG_DATA_HOME\" \"$XDG_CACHE_HOME\"` |\n| npm | `~\u002F.npm\u002F_cacache` (or `--cache \u003Cdir>`) | `rm -rf \u003Ccache>` (the `--cache` dir you pass) |\n| pnpm | `pnpm store path` (or `--store-dir \u003Cdir>`) | `rm -rf \u003Cstore>` (or `pnpm store prune`) |\n| **bun** | **`bun pm cache`** = the real `~\u002F.bun\u002Finstall\u002Fcache` | **`rm -rf \"$(bun pm cache)\"`** — env vars do NOT relocate it |\n\n## VERIFY each cold is genuine — the offline-fails check\n\nAfter wiping a cache, an `--offline` install MUST FAIL. A pass means the cache wasn't cleared (wrong disk path), and any \"cold\" number from it is a warm-link artifact. Run this for every tool before trusting a cold number:\n\n| tool | expected after cache wipe | genuine? |\n|---|---|---|\n| nub | `rc≠0`, \"not available in the local cache\" | FAIL → genuine |\n| pnpm | `rc=1`, `ERR_PNPM_NO_OFFLINE_TARBALL` | FAIL → genuine |\n| npm | `rc≠0`, cache-miss error | FAIL → genuine |\n| bun | if `bun install --offline` SUCCEEDS → cache NOT cleared → bun cold is NOT genuine |\n\nA true bun cold needs a clean container, or wiping the user's real cache (destructive — don't, unless in Docker).\n\n## Apples-to-apples isolation\n\n- Each tool gets its OWN cache dir.\n- `--ignore-scripts` for ALL tools (or `--allow-scripts` for all — same on both sides).\n- Identical fixture, identical lockfile throughout (use a `--frozen-lockfile`\u002F`--frozen` equivalent where the tool offers one).\n- **Interleave tool order round-robin** (nub → npm → bun → pnpm, repeat) — never all-of-one-then-the-other — so drift in host load hits every tool equally.\n\n## Load discipline — measure only on a quiet machine\n\n- **Check the load average before measuring and only proceed when the machine is quiet.** A dedicated quiet box or a CI runner near zero load is ideal for anything that will be published.\n- **On a shared dev host, WAIT for load to fall below a threshold — don't measure above it.** A practical gate is a 1-minute load average under ~40 (pick a threshold the machine actually reaches; below ~5 is ideal on a dedicated box). Poll, wait, then run; abort and retry if it spikes mid-run.\n- **Report the load that held during the run** alongside the numbers.\n- **File counts and store-entry counts are exact and load-independent** — a robust cross-check, and the clearest way to tell the dedup story. They complement a properly-measured time, not replace it.\n\n## File-count forensics (the load-independent crux)\n\n```sh\nfind node_modules -type f -o -type l | wc -l          # total materialized entries\nls -d node_modules\u002F**\u002Fcore-js node_modules\u002Fcore-js    # physical copies of a duplicated dep (dedup story)\n```\n\nReach for this first — exact, reproducible, immune to load.\n\n## The honesty bar (anti-juicing)\n\n- VERIFY every cold is genuine (offline-fails check) BEFORE citing it.\n- **NEVER compare one tool's genuine-cold to another's warm-link** — the exact misleading comparison the offline check exists to prevent.\n- Report what was actually measured, caveats included (which colds are genuine, host load, sample size).\n- The homepage cites the WARM number because it is the honest, reproducible one.\n- A single non-genuine cell discredits the whole table. When in doubt, exclude the cell and say why.\n\n## Process hygiene (this runs on the maintainer's machine)\n\nShort-lived install\u002Fmeasurement processes reap themselves. The hazard is a **long-lived process a bench starts and forgets**:\n\n- **Never leave a dev server running.** If a bench starts one, tear it down in the same run (`trap '…kill…' EXIT INT TERM`).\n- **Docker: `docker run --rm`, and confirm `docker ps` is empty when done.**\n\n## Reference template\n\n`\u002Ftmp\u002Fcs-bench-final.sh` is a working 4-tool harness (nub \u002F npm \u002F bun \u002F pnpm) — per-tool isolated cache dirs, `--ignore-scripts` for all, interleaved round-robin order, `node_modules` wiped before every run, median\u002Fspread helpers. Read its structure before hand-rolling a new one; adapt the cache paths and fixture, keep the protocol.\n\n## Internal decomposition\n\nWhen a comparative number raises \"WHY is nub's phase X slow?\", switch to [`pm-perf-tracing`](..\u002Fpm-perf-tracing\u002FSKILL.md): `RUST_LOG=debug nub install` for the `phase:resolve\u002Ffetch\u002Flink` split, and the gated `AUBE_DIAG_FILE` per-file linker strategy tally.\n",{},"main","9b734566fd36ceed8379f67a92291bc68af60801",".claude\u002Fskills\u002Fbenchmarking",71,"https:\u002F\u002Fgithub.com\u002Fnubjs\u002Fnub","https:\u002F\u002Fnubjs.com","https:\u002F\u002Fgithub.com\u002Fnubjs","The all-in-one Node.js toolkit","2026-11-14 14:11:35",{"source":7,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add nubjs\u002Fnub --skill benchmarking",{"tool":38,"command":39},"bunx","bunx skills add nubjs\u002Fnub --skill benchmarking",{"tool":41,"command":42},"pnpm","pnpm dlx skills add nubjs\u002Fnub --skill benchmarking","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fnubjs\u002Fnub\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fbenchmarking\u002FSKILL.md",true,[],[47,53,59,66,73,80],{"skillNo":48,"name":49,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":18},"01M758BSH88RVXBG8TPCT427TY","nub","https:\u002F\u002Fgithub.com\u002Fnubjs\u002Fnub\u002Fblob\u002Fmain\u002Fskills\u002Fnub\u002FSKILL.md",[],[],{"skillNo":54,"name":49,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":18},"01M758BKPRHXS5MS27WG908PBG","This project uses nub, a single Rust CLI that runs on the project's installed Node and replaces the everyday Node toolchain. ALWAYS prefer nub over node, bun, npm, npx, pnpm, and yarn for: executing JS\u002FTS files, running package.json scripts, the npx-equivalent, installing dependencies, watch mode, and Node version management. Surfaces whenever you would otherwise reach for node\u002Fbun\u002Fnpm\u002Fnpx or a package manager.","https:\u002F\u002Fgithub.com\u002Fnubjs\u002Fnub\u002Fblob\u002Fmain\u002Fsite\u002Fpublic\u002Fskill.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":18},"01M758BCR8A21H8P4TQ0YRHTC7","worktree","Create and manage isolated git worktrees for parallel build\u002Ftest\u002Flanding work on the nub repo. Invoke (via the Skill tool) whenever you need a fresh worktree to land a change, when you want to know what `.worktreeinclude` does or how to add an entry, or when cleaning up after a merge. Encodes the one-command setup (`nub scripts\u002Fnew-worktree.ts \u003Cslug>` or `node …`) that bakes in the proven recipe — worktree off origin\u002Fmain (vendor\u002Faube is plain in-tree files now, no submodule init), the shared CARGO_TARGET_DIR (`~\u002F.cache\u002Fnub\u002Fshared-target`) that all worktrees reuse, and applying `.worktreeinclude` — plus the eagerly-pull-the-shared-tree discipline and the safe cleanup path. Pairs with the `dev-loop` build skill.","https:\u002F\u002Fgithub.com\u002Fnubjs\u002Fnub\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fworktree\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":18},"01M758B9NZ1GQMD1A6B25NK0D9","windows-vm-test","Run ad-hoc Nub tests and debugging probes in the maintainer's existing local Windows 11 ARM64 QEMU\u002FHVF VM when its external disk and runbook are present. Use for interactive win32-arm64 or Windows-on-ARM x64-emulation checks; use ci-adhoc-test for true x64-native behavior or when the local VM is unavailable.","https:\u002F\u002Fgithub.com\u002Fnubjs\u002Fnub\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fwindows-vm-test\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":18},"01M758B2JHMBB6YJTGYSJR65S4","visual-review","Verify UI\u002Flayout\u002Fstyling changes are correct by computing occlusion, clipping, and alignment from the browser's resolved paint order via the chrome-devtools MCP `evaluate_script` tool — instead of eyeballing a flat screenshot. Invoke BEFORE declaring any UI, site, or styling\u002Flayout change correct. Screenshots have no depth buffer, so z-index\u002Focclusion\u002Fclip bugs are exactly where \"just look at it\" fails; the `evaluate_script` routines below turn those fuzzy visual judgments into deterministic measurements — including optical center-of-mass, which measures the glyph ink's true visual center so differently-sized labels can be aligned by more than eye.","https:\u002F\u002Fgithub.com\u002Fnubjs\u002Fnub\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fvisual-review\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":18},"01M758AWPM7CE440NBAYJHD44J","type-declarations","Add, audit, or update @nubjs\u002Ftypes declarations for Nub runtime APIs. Use whenever Nub adds or changes a user-visible global, built-in method, module loader type, or TC39 proposal; when TypeScript or @types\u002Fnode gains an overlapping declaration; and before every release to reconcile runtime changes since the previous tag. Covers conflict-safe global augmentation, compiler-version routing, fixture matrices, and package verification.","https:\u002F\u002Fgithub.com\u002Fnubjs\u002Fnub\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftype-declarations\u002FSKILL.md",[],[]]