skills/bun/SKILL.md
Use when using bun.lockb, bunfig.toml, bun install, Bun workspaces, Bun test, Bun runtime APIs, JS or TS scripts run with Bun, bundling, or Node compatibility checks for Bun.
npx skillsauth add cofin/flow bunInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Bun is a drop-in replacement for Node.js, focused on speed.
Bun.serve() is faster than Node's http module.Bun.file() and Bun.write() are optimized.bun run script.ts replaces ts-node.bun test is a Jest-compatible, ultra-fast test runner.```bash
bun test --watch
```
</example>
bun install is significantly faster than npm/yarn.This section details how to integrate Bun into high-performance, polyglot systems.
When integrating with Rust/Python backends:
Bun.connect() and Bun.listen() with abstract namespaces (Linux) or file paths (macOS) if Shm not available.JSON.stringify on hot paths.apache-arrow js package) for zero-copy structure sharing.napi-rs): Preferred for stability and complex logic. It maps Rust Structs to JS Classes easily.bun:ffi): faster for simple C function calls but harder to maintain for complex objects.
napi-rs for business logic, bun:ffi only for ultra-thin C wrappers.Buffer vs Uint8Array. Node compatibility layers might copy. Use Uint8Array natively where possible.Bun.serve() relies on ReadableStream. Buffering the entire request body (await req.text()) defeats the purpose of streaming; process chunks if possible.bunx @biomejs/biome) for instant linting/formatting.Bun.env, Bun.sleep, but generally avoid Node.js globals unless necessary for library compatibility.bun.lockb for deterministic builds.Add guardrails instructions here. </guardrails>
<validation> ## ValidationAdd validation instructions here. </validation>
testing
Use when syncing Beads state to markdown, checking Flow status, refreshing context docs, validating task markers, or reporting ready/blocked Flow work.
testing
Use when initializing Flow in a repo, configuring .agents, installing or checking Beads bd, setting local-only sync policy, or creating first project context files.
data-ai
Use when drafting PRDs, researching, planning, refining, revising, or creating .agents/specs/<flow_id>/spec.md worksheets for Flow.
testing
Use when implementing Flow tasks from Beads or spec.md, claiming ready work, applying TDD, recording task notes, committing, and syncing after task state changes.