bun-guidelineslisted
Install: claude install-skill NomadicDaddy/aidd
# Bun Guidelines
> **Version**: Target Bun **1.3.x** with a **1.3.14** workspace baseline. Pin the major with
> `oven/bun:1` in containers; pin exact versions in CI.
> **Install**: `curl -fsSL https://bun.sh/install | bash` (macOS/Linux) or `pwsh -c "irm bun.sh/install.ps1 | iex"` (Windows).
>
> Bun is a JavaScript/TypeScript runtime, package manager, bundler, and test runner in one binary. This guide covers the practices that matter when Bun is the toolchain: package management, direct TS execution, the built-in server/test runner, and container packaging.
## Core Principles
1. Use one tool for the whole lifecycle (install, run, test, and build) instead of stitching together npm + tsx + jest + esbuild.
2. Run TypeScript and JSX directly. Do not add a separate transpile step for scripts and services.
3. Commit the text lockfile (`bun.lock`) and install with `--frozen-lockfile` in CI for reproducible builds.
4. Prefer Bun's built-in APIs (`Bun.serve`, `Bun.file`, `bun:sqlite`, `Bun.password`, `Bun.$`) over third-party equivalents when they fit.
5. Validate Node.js compatibility for native-addon-heavy, clustering, or advanced process-management workloads before adopting Bun for them.
## Package Management
Bun's package manager is a drop-in for npm/yarn/pnpm and is dramatically faster.
### Commands
```bash
bun install # Install all deps; writes/updates bun.lock
bun add hono # Add a dependency
bun add -d @types/node # Add a devDependency