About bun
bun is a skill for developers working with Bun’s runtime, package manager, test runner, bundler, and Node.js compatibility. It guides repository inspection, adoption, troubleshooting, migration, and focused verification.
Key features
- 01Inspect Bun setup and project configuration
- 02Guide runtime and package-manager workflows
- 03Cover tests, builds, and Node.js compatibility
- 04Recommend focused verification commands
Use cases
- 01Adopting Bun in an existing project
- 02Migrating installs and scripts to Bun
- 03Troubleshooting Bun version or lockfile changes
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ dobroslavradosavljevic/ skills --skill bunAfter installing, type/bunin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
agents/openai.yamlreferences/node-compat-config.mdpackage-manager.mdruntime-apis.mdsource-map.mdtest-bundler-build.mdusage-guide.mdDetails
From the project READMEBun
Use this skill when work touches the Bun runtime, package manager, test runner, bundler, bunfig.toml, Node compatibility, or migrating installs/scripts to Bun.
Snapshot: [email protected], @types/[email protected] / [email protected] (captured 2026-09-18, re-verified 2026-10-01 — still latest stable). Refresh from source-map.md if versions differ.
Workflow
- Inspect the local Bun surface:
bun --version/bun --revision(stable line is 1.4.x; preferbun upgradetoward 1.4.2 when APIs matter).- Lockfile:
bun.lock(text;lockfileVersion2, or 3 with nested/version-scoped overrides) vs legacybun.lockb. package.jsonscripts, workspaces, catalogs, overrides,trustedDependencies, optionalnativeDependencies/ignoreScripts/selfContained.bunfig.toml(project + optional global),.npmrc,@types/bun, and TypeScript 6/7"types": ["bun"].- Whether code uses Bun-native APIs (
Bun.serve,Bun.Image,bun:sqlite, …) or Node APIs (node:*).
- For day-to-day how-to, progressive adoption, and troubleshooting, follow usage-guide.md first.
- Refresh docs when versions drift or the task touches Redis/SQL/HTTP2/HTTP3/FFI, lockfile/linker/
globalStore, or a 1.3→1.4 upgrade. Start from source-map.md. - Route deeper detail:
- Runtime APIs, HTTP, files, shell, Image/WebView/markdown/cron, SQLite/Redis/S3/SQL: runtime-apis.md.
- Install, lockfile, workspaces, trust, bunx, CI, audit/dedupe/prune: package-manager.md.
bun test,bun build,--compile, init/create: test-bundler-build.md.- Node 26 compat, globals, watch/hot, bunfig, 1.3→1.4 breaking changes: node-compat-config.md.
- Prefer Bun-native APIs and
bun/bunxcommands for greenfield Bun projects. Keep Node APIs when the codebase is already Node-shaped and works. - Verify with the narrowest useful
buncommand (bun test,bun run,bun ci, or a focusedBun.servesmoke).
Core Judgment
- Bun is runtime + package manager + test runner + bundler in one binary — not “just a faster Node”. 1.4 is a Rust rewrite of that binary with a larger stdlib (Image, WebView, markdown, cron, Terminal, XML/JSON5/JSONL).
- Prefer
bun/bunxovernpm/npx/yarn/pnpmin commands for Bun projects. - Commit
bun.lock. CI install:bun ci(frozen lockfile). - Dependency lifecycle scripts are blocked by default unless trusted — check
bun pm untrustedafter adding native packages (sharp, etc.). - New workspace lockfiles default to isolated linker (
configVersion: 1); legacy lockfiles stay hoisted. Global virtual store is opt-in ([install] globalStore = true) and only applies to isolated. - Prefer
Bun.servefor new HTTP services; know the default 10s idle timeout (SSE needsserver.timeout(req, 0)). HTTP/2 (http2: true) and HTTP/3 (http3: true) are experimental. - Prefer
bun:sqlite/Bun.SQL/Bun.redis/Bun.Imageover heavier Node clients when writing Bun-first code. bun --watchhard-restarts;bun --hotsoft-reloads (globalThispersists) — good for servers.- Bun flags go before
run:bun --watch run dev, notbun run dev --watch. Bun.envis a launch snapshot; preferprocess.envwhen values change at runtime.bun builddoes not typecheck or emit.d.ts— runtscwhen types matter.bun:ffiis engine-native in 1.4 (cstringis a plain string). Prefer Node-API natives for production-critical FFI.- 1.3→1.4: Bun reports Node.js 26 (
process.versions.modules147);bunfig.tomlstrings must be quoted. Full list: node-compat-config.md.
Verification
Prefer repository-owned commands. For meaningful Bun work, cover the relevant subset:
bun --versionand confirm lockfile / linker /globalStoreexpectations.- Focused
bun test(path or-tpattern);--parallel/ coverage / junit when CI cares. bun ciorbun install --frozen-lockfileafter lockfile edits.- Smoke
bun run <entry>orBun.servewithport: 0+fetch. - After native deps:
bun pm untrusted/ trust as needed. - After
bun build/--compile: run the output on the target platform. - Node-compat migrations: run the same suite under Bun and note partial modules.
- After a 1.3→1.4 bump: native addons rebuilt for
NODE_MODULE_VERSION147; quotedbunfig.toml; nores.writeHeader().
Report which checks ran, which did not, and any Bun version assumptions that remain.