Install
$ agentstack add skill-rstackjs-agent-skills-rslib-best-practices ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Rslib Best Practices
Apply these rules when writing or reviewing Rslib library projects.
Configuration
- Use
rslib.config.tsanddefineConfig - Check Rslib-specific configurations first (e.g.,
lib.*), and also leverage Rsbuild configurations (e.g.,source.*,output.*,tools.*) as needed - For deep-level or advanced configuration needs, use
tools.rspackortools.bundlerChainto access Rspack's native configurations - In TypeScript projects, prefer
tsconfig.jsonpath aliases
CLI
- Use
rslibto build - Use
rslib --watchto build in watch mode for local development - Use
rslib inspectto inspect final Rslib/Rsbuild/Rspack configs
Output
- Prefer to build pure-ESM package with
"type": "module"inpackage.json - Prefer to use bundleless mode with
output.targetset to'web'when building component libraries - Prefer to use bundle mode when building Node.js utility libraries
- Ensure
exportsfield inpackage.jsonis correctly configured and matches the actual JavaScript output and declaration files output of different formats (ESM, CJS, etc.)
Declaration files
- Prefer to enable declaration file generation with
lib.dts: trueor detailed configurations - For faster type generation, enable
lib.dts.tsgoexperimental feature with@typescript/native-previewinstalled
Dependencies
- Prefer to place dependencies to be bundled in
devDependenciesin bundle mode and dependencies independenciesandpeerDependencieswill be automatically externalized (not bundled) by default - Verify the build output and dependency specifiers in
package.jsoncarefully to ensure no missing dependency errors occur when consumers install and use this package
Build optimization
- Keep syntax target in
lib.syntaxaligned with real compatibility requirements to enable better optimizations - Avoid format-specific APIs in source code for better compatibility with different output formats
- Prefer lightweight dependencies to reduce bundle size
Toolchain integration
- Prefer to use Rstest with
@rstest/adapter-rslibfor writing tests - Prefer to use Rspress for writing library documentation, with
@rspress/plugin-previewand@rspress/plugin-api-docgenfor component previews and API docs
Debugging
- Run with
DEBUG=rsbuildwhen diagnosing config resolution or plugin behavior - Read generated files in
dist/.rsbuildto confirm final Rsbuild/Rspack config, not assumed config
Documentation
- For the latest Rslib docs, read https://rslib.rs/llms.txt
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: rstackjs
- Source: rstackjs/agent-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.