Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/playforge-coding/scratch4js/rspack-best-practicesnpx skills add playforge-coding/scratch4js --skill rspack-best-practicesgit clone --depth 1 https://github.com/playforge-coding/scratch4jsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/playforge-coding/scratch4js/rspack-best-practices)<a href="https://agentmods.dev/skills/playforge-coding/scratch4js/rspack-best-practices"><img src="https://agentmods.dev/badge/skills/playforge-coding/scratch4js/rspack-best-practices.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00042 | $0.00612 |
| Opus 5 | $0.00021 | $0.00306 |
| Sonnet 5 | $0.00008 | $0.00122 |
| Haiku 4.5 | $0.00004 | $0.00061 |
Grade A, and why
rspack-best-practices scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
This is a copy
100% identical to rspack-best-practices — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 71 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Rspack Best Practices
Apply these rules when writing or reviewing Rspack projects.
Configuration
- Use
rspack.config.tsanddefineConfig - Define explicit
entryvalues for multi-page applications - Keep one main config and branch by
process.env.NODE_ENVonly when needed - Keep rule conditions narrow and explicit (
test,include,exclude,resourceQuery) - Prefer built-in Rspack plugins/loaders over community JS alternatives when equivalent features exist
CLI
If @rspack/cli is installed:
- Use
rspack devfor local development - Use
rspack buildfor production build - Use
rspack previewonly for local production preview
Type checking
- Use
ts-checker-rspack-pluginfor integrated dev/build type checks - Or run
tsc --noEmit/vue-tsc --noEmitas an explicit script step
CSS
Choose one strategy:
- Built-in CSS (
type: 'css' | 'css/auto' | 'css/module') for modern setups css-loader+CssExtractRspackPluginfor webpack migration compatibilitystyle-loaderfor pure style-in-JS runtime injection scenarios
Optional:
- Use
builtin:lightningcss-loaderwhen goals are syntax downgrade + vendor prefixing - Use
sass-loader/less-loaderfor preprocessing Sass/Less files - Use
@tailwindcss/webpackfor Tailwind CSS integration
Bundle size optimization
- Prefer dynamic
import()for non-critical code paths - Prefer lightweight libraries where possible
- Keep
targetaligned with real compatibility requirements
Asset management
- Import source-managed assets from project source directories, not from
public - Reference
publicfiles by absolute URL path - Prefer asset modules (
asset,asset/resource,asset/inline,asset/source) over legacyfile-loader/url-loader/raw-loader
Profiling
- Use Node CPU profiling (
--cpu-prof) when JavaScript-side overhead is suspected - Use
RSPACK_PROFILE=OVERVIEWand analyze trace output for compiler-phase bottlenecks - Replace known slow stacks first (
babel-loader, PostCSS, terser) with Rspack built-ins when feasible
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 71 lines · 42 tokens per session scan A 240e80896a38
rspack-best-practices is a skill published in the GitHub repository playforge-coding/scratch4js (1 stars, last pushed 2mo ago), licensed MPL-2.0. It adds 42 tokens to every session and 612 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to rspack-best-practices, differing in 0 lines, and is treated as a copy.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.
auto-perf-optimize
Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.
chat-perf
Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.
chat-pet-sprite-creation
Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.
cpu-profile-analysis
Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…