| name | bun |
| description | Bun runtime conventions, APIs, and toolchain. Invoke whenever task involves any interaction with Bun — serving HTTP, file I/O, shell scripting, testing, bundling, or package management with Bun. |
Bun
Use Bun APIs, not Node.js polyfills. If Bun provides a native API for it, use it.
Bun is a batteries-included JavaScript runtime. It replaces Node.js, npm, Jest, and webpack with a single tool. Prefer
Bun-native APIs (Bun.serve, Bun.file, Bun.$, bun:sqlite, bun:test) over Node.js equivalents unless portability
is an explicit requirement.
References
- HTTP server — [
${CLAUDE_SKILL_DIR}/references/server.md]: Route types, file response patterns, WebSocket
pub/sub, server config
- File I/O and processes — [
${CLAUDE_SKILL_DIR}/references/io-and-processes.md]: File I/O details, shell API,
child processes, workers
- Testing — [
${CLAUDE_SKILL_DIR}/references/testing.md]: Test modifiers, parametrized tests, mocking, snapshots,
CLI flags
- SQLite, bundler, plugins — [
${CLAUDE_SKILL_DIR}/references/ecosystem.md]: SQLite API, bundler options, plugins,
macros
- Configuration — [
${CLAUDE_SKILL_DIR}/references/config-and-compat.md]: bunfig.toml sections, Node.js
compatibility, env vars
Prefer Bun-Native APIs
Rule: if Bun.* or bun:* has it, use it. Fall back to node:* only when there's no Bun-native alternative or when
portability to Node.js is required.
Core mappings: Bun.serve() over http.createServer(), / over , over
, over , over Jest/Vitest, over ,
over wrappers, over . Use for directory ops — no
Bun API yet. Use Web Streams API over .