bun-development
Skill10 starsChanged 39 days agoMITView on GitHub
Complete Bun.js ecosystem guidance for runtime APIs, file I/O, package management, testing, SQLite, and security; use proactively when setting up Bun projects, replacing Node.js APIs with Bun-native APIs, writing bun test suites, implementing Bun.serve services, using bun:sqlite with prepared statements, configuring workspaces and lockfiles, hardening shell and SQL boundaries, or optimizing Bun performance and migration workflows.
8 other projects use a version of this.
Adopted by
Most recently taken up by
- ValorVie/custom-skillstheir own version, first seen Nov 8, 2026
- GabrielMartinMoran/mindtheir own version, first seen Nov 1, 2026
- xfstudio/skillstheir own version, first seen Oct 13, 2026
- Tgoldi/claude-skillstheir own version, first seen Oct 13, 2026
- involvex/youtube-music-clitheir own version, first seen Oct 8, 2026
- jasonjgardner/blockbench-mcp-plugintheir own version, first seen May 22, 2026
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- jasonjgardner/blockbench-mcp-plugin★ 595same name
- involvex/youtube-music-cli★ 477same name
- GabrielMartinMoran/mind★ 193same name
- xfstudio/skills★ 9same name
- ValorVie/custom-skills★ 5same name
- yumazak/joy★ 4same name
- ai4brands-design/claude-skills★ 2same name
- Tgoldi/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository81 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/development/biome-complete/AGENTS.mdAGENTS.md
- skills/development/bun-development/AGENTS.mdAGENTS.md
- skills/development/commanderjs/AGENTS.mdAGENTS.md
- skills/documentation/markdown-authoring/AGENTS.mdAGENTS.md
- skills/package-mgmt/mise-complete/AGENTS.mdAGENTS.md
- skills/testing/bdd-testing/AGENTS.mdAGENTS.md
- agents-mdSkill
- cache-auditSkill
- context-radar-auditSkill
- create-contextSkill
- guided-interviewSkill
- handover-document-creatorSkill
- load-contextSkill
- pick-modelSkill
- pinSkill
- professional-honestySkill
- rules-managementSkill
- save-contextSkill
- session-reflectionSkill
- socratic-methodSkill
- vault-captureSkill
- vault-consolidateSkill
- vault-fetchSkill
- vault-searchSkill
- bird-fortune-political-satireSkill
- brooker-esque-media-satireSkill
- clarke-dawe-esqueSkill
- comedy-style-skill-generatorSkill
- cunk-esque-mockumentarySkill
- gervais-esque-cringe-satireSkill
- monty-python-esqueSkill
- pryor-esque-confessional-standupSkill
- rock-esque-observational-standupSkill
- biome-completeSkill
- commanderjsSkill
- conventional-commitsSkill
- humanizerSkill
- journal-entry-importSkill
- markdown-authoringSkill
- mermaid-diagramsSkill
- plain-englishSkill
- professional-communicationSkill
- sop-structureSkill
- logql-generatorSkill
- mise-completeSkill
- context-indexSkill
- create-context-fileSkill
- follow-upSkill
- goal-trackerSkill
- nasa-pm-lessonsSkill
- plan-createSkill
- plan-executeSkill
- plan-reviewSkill
- risk-registerSkill
- tech-debtSkill
- tech-evaluationSkill
- blast-radiusSkill
- bridgeSkill
- challengeSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 4 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 8 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 13
Prefer Bun-native APIs over Node.js shims: one runtime, one set of semantics.
- Distinctive: line 14
Treat every string that crosses a shell or SQL boundary as hostile until it is bound or passed as an argument.
- Distinctive: line 15
Keep installs deterministic: one package manager, one lockfile, no drift.
- Very specific: line 38
If bun install fails: check bun.lock/bun.lockb for merge conflicts, resolve them, and re-run bun install.
- Very specific: line 39
If tests fail after dependency changes: run bun test to isolate regressions before proceeding.
- Distinctive: line 41
If validation fails: revert the last change, confirm the error, and address the specific failure before re-validating.
- Distinctive: line 43
Document decisions with links to exact references used.
- Very specific: line 188
GOOD: run bun test straight after the change and fix regressions before proceeding.
“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Bun Development
Navigation hub for Bun guidance focused on production-safe implementation.
Philosophy
- Prefer Bun-native APIs over Node.js shims: one runtime, one set of semantics.
- Treat every string that crosses a shell or SQL boundary as hostile until it is bound or passed as an argument.
- Keep installs deterministic: one package manager, one lockfile, no drift.
- Validate every change by running it, not by reading it.
When to Use
- You need Bun-native runtime APIs (
Bun.file,Bun.write,Bun.serve) - You are writing or debugging tests with
bun test - You are adding
bun:sqliteusage with transactions or prepared statements - You are setting dependency/workspace policy in a Bun project
- You need deterministic security guardrails for shell/SQL inputs
When Not to Use
- The project standard runtime is strictly Node.js with no Bun support
- You need framework-specific guidance not covered by Bun APIs
- The task is only package-agnostic JavaScript refactoring
Workflow
- Confirm Bun is available and lock dependency strategy.
- Choose the category (runtime, file I/O, testing, sqlite, package, security).
- Implement with copy/paste commands from Quick Commands.
- Apply anti-pattern checks before finalizing.
- If
bun installfails: checkbun.lock/bun.lockbfor merge conflicts, resolve them, and re-runbun install. - If tests fail after dependency changes: run
bun testto isolate regressions before proceeding.
- If
- Validate behavior with tests or execution checks.
- If validation fails: revert the last change, confirm the error, and address the specific failure before re-validating.
- For SQL validation (
rgfinds non-prepared statements in existing code): refactor each flagged call to usedb.prepare(...)with bound parameters before merging; do not leave raw interpolations in place. - Document decisions with links to exact references used.
Quick Commands
Verify Runtime
bun --versionExpected: a Bun version is printed.
Install Dependencies
bun installExpected: lockfile is updated consistently (bun.lock/bun.lockb per project setup).
Run Script
bun run src/index.tsExpected: script executes without Node.js runtime shims.
Execute Tests
bun testExpected: failing assertions clearly identify behavior regressions.
Start HTTP Service
bun run server.tsExpected: service binds configured port and handles requests via Bun.serve.
Validate SQL Pattern
rg -n "query\\(|prepare\\(" srcExpected: queries in new code paths use prepared statements where input is user-controlled. If raw query( calls with interpolated values are found in existing code, refactor them to db.prepare(...) with bound parameters before proceeding.
Categories by Priority
| Priority | Category | Impact | Prefix |
| 1 | Runtime & Core APIs | CRITICAL | runtime- |
| 2 | File I/O Operations | CRITICAL | file- |
| 3 | Testing Framework | HIGH | testing- |
| 4 | SQLite Integration | HIGH | sqlite- |
| 5 | Package Management | MEDIUM | package- |
| 6 | Security Practices | MEDIUM | security- |
Anti-Patterns
NEVER mix Node.js fs calls into Bun-native file workflows
WHY: mixed APIs create inconsistent behaviour and miss Bun performance advantages.
BAD:
import { readFileSync } from "node:fs";
const config = readFileSync("./config.json", "utf8");GOOD:
const config = await Bun.file("./config.json").text();NEVER run npm install in Bun-managed repositories
WHY: mixed package managers cause lockfile drift and nondeterministic installs.
BAD: npm install
GOOD: bun install
NEVER interpolate untrusted input into SQL strings
WHY: direct interpolation can introduce SQL injection vulnerabilities.
BAD:
db.query(`SELECT * FROM users WHERE email = '${email}'`).all();GOOD:
db.prepare("SELECT * FROM users WHERE email = ?").all(email);NEVER pass unescaped user input into shell commands
WHY: shell interpolation enables command injection.
BAD:
await Bun.spawn(["sh", "-c", userInput]).exited;GOOD:
const safePath = Bun.file(userProvidedPath);
await safePath.text();NEVER leave raw interpolated query( calls in existing code once flagged
WHY: the SQL validation step exists to find them, and an unrefactored hit is a live injection path.
BAD: merging while an interpolated db.query call that rg flagged is still present.
GOOD: refactor each flagged call to db.prepare(...) with bound parameters before merging.
NEVER ignore a lockfile merge conflict when bun install fails
WHY: an unresolved bun.lock/bun.lockb conflict leaves installs nondeterministic.
BAD: re-running bun install repeatedly without opening the lockfile.
GOOD: resolve the conflict markers, then re-run bun install.
NEVER skip bun test after changing dependencies
WHY: dependency changes can cause regressions that only a test run isolates.
BAD: updating packages and moving straight to the next step.
GOOD: run bun test straight after the change and fix regressions before proceeding.
NEVER keep going after a failed validation
WHY: stacking changes on a failing state hides which change broke behaviour.
BAD: continuing to edit while the validation error is unexplained.
GOOD: revert the last change, confirm the error, then address the specific failure before re-validating.
NEVER finalise a change without running the anti-pattern checks
WHY: the checks are the guard against the injection and package-manager mistakes above.
BAD: finishing straight after implementation.
GOOD: apply the anti-pattern checks (step 4 of the Workflow) before finalising.
NEVER record a decision without linking the reference you used
WHY: unlinked decisions cannot be re-checked when Bun behaviour changes.
BAD: "Used Bun.file because it is better."
GOOD: "Used Bun.file per references/file-io-patterns.md."
References
| Topic | Reference | When to Use |
| Runtime globals | references/runtime-globals.md | Using Bun runtime globals |
| HTTP server | references/runtime-http-server.md | Building services with Bun.serve |
| File I/O patterns | references/file-io-patterns.md | Reading and writing files |
| Bun vs Node file APIs | references/file-vs-node.md | Migrating from node:fs |
| Globbing | references/file-glob.md | Matching files by pattern |
| Test runner | references/testing-bun-test.md | Writing bun test suites |
| Matchers | references/testing-matchers.md | Choosing assertions |
| Mocking | references/testing-mocking.md | Mocking modules and functions |
| Snapshots | references/testing-snapshots.md | Snapshot testing |
| SQLite | references/sqlite-basics.md | Using bun:sqlite |
| Workspaces | references/pm-workspaces-agent-instructions.md | Package and workspace policy |
| Shell safety | references/runtime-shell.md | Running subprocesses safely |
| Passwords | references/runtime-password.md | Hashing and verifying passwords |
External Links
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

