PluginBench
Skill
Pass
Audit score 90

bun

brianlovin/agent-config

Use Bun as your JavaScript/TypeScript runtime, package manager, and build tool instead of Node.js, npm, and Vite.

What is bun?

Bun is a fast all-in-one JavaScript runtime and toolkit that replaces Node.js, npm, pnpm, and Vite. Use this skill to configure your agent to leverage Bun's built-in APIs for HTTP servers, databases, file operations, and testing, along with command mappings for common development tasks.

  • Replace npm/pnpm with `bun install` and `bun run` for faster package management
  • Use Bun.serve() for HTTP servers with built-in WebSocket, HTTPS, and routing instead of Express
  • Access native SQLite, Redis, and Postgres clients via `bun:sqlite`, `Bun.redis`, and `Bun.sql`
  • Run tests with `bun:test` instead of Jest or Vitest
  • Build and bundle with `bun build` instead of Webpack or esbuild
  • Execute shell commands with `Bun.$` template literals

How to install bun

npx skills add https://github.com/brianlovin/agent-config --skill bun
Prerequisites
  • Bun runtime installed on the system
Claude Code
Cursor
Windsurf
Cline

How to use bun

  1. 1.Replace `node` commands with `bun` (e.g., `bun file.ts` instead of `node file.ts`)
  2. 2.Use `bun install` instead of `npm install` or `pnpm install`
  3. 3.Use `bun run <script>` to execute npm scripts defined in package.json
  4. 4.Use `bun test` to run tests written with `bun:test`
  5. 5.For HTTP servers, use `Bun.serve()` with routes instead of Express
  6. 6.For databases, import from `bun:sqlite`, `Bun.redis`, or `Bun.sql` instead of third-party packages
  7. 7.For frontend development, create an HTML file with a `<script type="module">` tag and run `bun --hot ./server.ts` for HMR

Use cases

Good for
  • Building a full-stack TypeScript application with Bun.serve() for the backend and React frontend with HMR
  • Running a test suite with `bun test` and `bun:test` assertions
  • Creating a CLI tool that executes shell commands with `Bun.$` and reads/writes files with `Bun.file()`
  • Setting up a real-time API server with WebSocket support using `Bun.serve()`
  • Migrating from Node.js/npm to Bun by using the command mappings for drop-in compatibility
Who it's for
  • Full-stack TypeScript developers
  • Backend engineers building APIs and servers
  • Frontend developers using React or other frameworks
  • DevOps and tooling engineers writing CLI applications
  • Teams seeking faster package installation and runtime performance

bun FAQ

Do I need to install dotenv separately?

No. Bun automatically loads `.env` files, so you can remove the dotenv dependency.

Can I use Bun with React?

Yes. Bun's bundler automatically transpiles `.tsx` and `.jsx` files. Use HTML imports with `Bun.serve()` and include a `<script type="module">` tag pointing to your React entry file.

What testing framework should I use?

Use `bun:test`, which is built into Bun. Import `test` and `expect` from `bun:test` and run tests with `bun test`.

Can I replace Express with Bun.serve()?

Yes. `Bun.serve()` provides HTTP server, routing, WebSocket, and HTTPS support natively, eliminating the need for Express.

How do I enable hot module reloading during development?

Run `bun --hot ./server.ts` to start your server with HMR enabled. Bun will automatically reload modules on file changes.

Full instructions (SKILL.md)

Source of truth, from brianlovin/agent-config.


name: bun description: Use Bun instead of Node.js, npm, pnpm, or vite. Provides command mappings, Bun-specific APIs, and development patterns.

Bun Runtime

Use Bun as the default JavaScript/TypeScript runtime and package manager.

Command Mappings

Instead ofUse
node file.tsbun file.ts
ts-node file.tsbun file.ts
npm installbun install
npm run scriptbun run script
jest / vitestbun test
webpack / esbuildbun build

Bun automatically loads .env files - don't use dotenv.

Bun-Specific APIs

Prefer these over Node.js equivalents:

APIPurposeDon't use
Bun.serve()HTTP server with WebSocket, HTTPS, routesexpress
bun:sqliteSQLite databasebetter-sqlite3
Bun.redisRedis clientioredis
Bun.sqlPostgres clientpg, postgres.js
Bun.file()File operationsnode:fs readFile/writeFile
Bun.$\cmd``Shell commandsexeca
WebSocketWebSocket client (built-in)ws

Testing

Use bun:test for tests:

import { test, expect } from "bun:test";

test("description", () => {
  expect(1).toBe(1);
});

Run with bun test.

Frontend Development

Use HTML imports with Bun.serve() instead of Vite. Supports React, CSS, Tailwind.

Server:

import index from "./index.html"

Bun.serve({
  routes: {
    "/": index,
    "/api/users/:id": {
      GET: (req) => Response.json({ id: req.params.id }),
    },
  },
  development: { hmr: true, console: true }
})

HTML file:

<html>
  <body>
    <script type="module" src="./app.tsx"></script>
  </body>
</html>

Bun's bundler transpiles .tsx, .jsx, .js automatically. CSS is bundled via <link> tags.

Run with bun --hot ./server.ts for HMR.

Documentation

For detailed API docs, see node_modules/bun-types/docs/**.md.