一键导入
bun-runtime
Master Bun runtime workflows for full-stack development. Monorepos, bunx, lockfiles, performance optimization, and integration patterns.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Master Bun runtime workflows for full-stack development. Monorepos, bunx, lockfiles, performance optimization, and integration patterns.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Web scraping, site crawling, search, structured data extraction, and AI-powered research with Firecrawl CLI. Use when you need full page content as markdown, JS-rendered pages, anti-bot bypass, crawling entire documentation sites, extracting structured data with schemas, or deep web research. Prefer WebFetch for quick questions about a known URL. Prefer WebSearch for finding links without full content.
Build production-grade MCP (Model Context Protocol) servers with observability, correlation ID tracing, and dual logging. Use when creating new MCP servers, adding tools to existing servers, implementing file logging, debugging MCP issues, wrapping CLI tools with spawnSyncCollect, or following Side Quest marketplace patterns. Covers @side-quest/core/mcp declarative API, @side-quest/core/spawn CLI wrapper patterns, Zod schemas, Bun runtime, and 9 gold standard patterns validated across Kit plugin (18 tools). Includes error handling, response format switching, MCP annotations, and graceful degradation.
Unified inbox processor - handles ALL content types (clippings, transcriptions, VTT files, attachments) with parallel subagents and single-table review. Routes to appropriate creator based on proposed_template.
Build production-grade CLI tools with Bun. Reference implementation covering argument parsing patterns (--flag value, --flag=value, --flag), dual markdown/JSON output, error handling, subcommands, and testing. Use when building CLIs, designing argument parsing, implementing command structures, reviewing CLI quality, or learning Bun CLI best practices.
Pure Bun-native filesystem utilities from @side-quest/core/fs. Use when you need command-injection-safe filesystem operations, prefer Bun over node:fs, or want token-efficient fs helpers. All functions use Bun.spawn, Bun.file(), or Bun.write() - no node:fs dependencies.
Expert guidance for building and maintaining the Para Obsidian inbox processing system - a security-hardened automation framework for processing PDFs and attachments with AI-powered metadata extraction. Use when building inbox processors, implementing security patterns (TOCTOU, command injection prevention, atomic writes), designing interactive CLIs with suggestion workflows, integrating LLM detection, implementing idempotency with SHA256 registries, or working with the para-obsidian inbox codebase. Covers engine/interface separation, suggestion-based architecture, confidence scoring, error taxonomy, structured logging, and testing patterns. Useful when user mentions inbox automation, PDF processing, document classification, security-hardened file processing, or interactive CLI design.
| name | bun-runtime |
| description | Master Bun runtime workflows for full-stack development. Monorepos, bunx, lockfiles, performance optimization, and integration patterns. |
| triggers | ["bun runtime","bunx","monorepo","bun workflows","bun performance","fast startup"] |
Leverage Bun's integrated toolkit for faster development. From one-off commands with bunx to optimizing monorepos, master the workflows that keep full-stack teams moving.
Bun is a complete toolkit in a single binary:
All in one. No configuration. No separate tools.
Replace globally installed CLI tools with bunx. Each command runs the latest version without cluttering your environment.
# ❌ Old way (npm)
npm install -g eslint
npx eslint .
# ✅ New way (Bun)
bunx eslint .
bunx eslint --fix .
# Always uses latest version, no global pollution
# Create projects
bunx create-vite@latest my-app --template react-ts
bunx create-next-app@latest my-blog
# Run tools
bunx eslint . --fix
bunx prettier . --write
bunx tsc --noEmit
# Utilities
bunx tsx script.ts # Run TypeScript directly
bunx esbuild app.ts # Bundle app
bunx http-server . # Quick HTTP server
Define workspaces in root package.json for seamless monorepo management.
{
"name": "my-workspace",
"private": true,
"workspaces": [
"packages/*",
"apps/*",
"plugins/*"
]
}
my-workspace/
├── package.json # Root (defines workspaces)
├── packages/
│ ├── core/ # Shared library
│ │ ├── package.json
│ │ └── src/
│ └── utils/
│ ├── package.json
│ └── src/
├── apps/
│ ├── web/ # Next.js app
│ │ ├── package.json
│ │ └── src/
│ └── mobile/ # React Native
│ ├── package.json
│ └── src/
└── plugins/ # Claude Code plugins
├── my-plugin/
│ ├── package.json
│ └── src/
Use workspace:* protocol for local dependencies:
{
"name": "@myapp/web",
"dependencies": {
"@myapp/core": "workspace:*",
"@myapp/utils": "workspace:*"
}
}
Benefits:
bun install in root# Install all dependencies
bun install
# Run script in specific workspace
bun --filter web run dev
# Run test in all workspaces with changes
bun test --recursive
# List workspaces
bun workspaces list
Bun creates a binary lockfile (bun.lockb) for fast, reliable builds.
# Generate lockfile
bun install
# Commit bun.lockb to git
git add bun.lockb
git commit -m "chore: update dependencies"
# CI: Install with frozen lockfile
bun install --frozen-lockfile
# Production: Skip dev dependencies
bun install --production
{
"dependencies": {
"react": "^18.2.0", // Patch updates ok
"typescript": "5.7.2" // Exact version (no updates)
}
}
# Bundle with default settings
bun build ./src/index.ts --outdir=./dist
# Minify and split chunks
bun build ./src/index.ts --minify --splitting
# Watch mode
bun build ./src/index.ts --watch
# Run all tests
bun test
# Run specific test file
bun test src/math.test.ts
# Watch mode (rerun on changes)
bun test --watch
# Coverage
bun test --coverage
No separate test runner needed. It's built in.
Bun has 4x faster startup than Node:
# Node.js
time node script.js
# real 0m0.345s
# Bun
time bun script.ts
# real 0m0.085s
[run]
logLevel = "error"
# Install all dependencies
bun install
# Run dev server for web app
bun --filter web run dev
# Run tests for changed packages
bun test --recursive
# Build everything
bun --filter "*" run build
# Create new CLI package
mkdir packages/my-cli
cd packages/my-cli
# Create package.json with bin entry
cat > package.json << EOF
{
"name": "@myapp/my-cli",
"bin": {
"my-cli": "./src/cli.ts"
},
"scripts": {
"test": "bun test"
}
}
EOF
# Back in root
bun install
# Test CLI from anywhere
bun my-cli --help
# scripts/deploy.ts (executable)
#!/usr/bin/env bun
import { $ } from "bun";
const env = process.env.NODE_ENV || "staging";
console.log(`Deploying to ${env}...`);
await $`git push origin main`;
await $`bun --filter web run build`;
await $`vercel deploy --prod`;
console.log("✅ Deployed!");
# Run it
chmod +x scripts/deploy.ts
./scripts/deploy.ts
# bunx create-next-app + Bun
bunx create-next-app@latest my-app --bun
cd my-app
# Next.js + Bun
bun run dev
bun run build
bun start
# Create Vite project
bunx create-vite@latest my-app --template react
cd my-app
# Use Bun
bun install
bun run dev
bun run build
# No configuration needed
bun run my-script.ts
# Watch mode
bun --watch src/index.ts
# Type checking (in CI)
bunx tsc --noEmit
npm inside a Bun project — Use bun insteadworkspace:* for local depsbun install — Faster, lockb is optimizedbunx — For one-off commandsbun test — Native, no config neededbun create or bunx to scaffoldbun install (creates bun.lockb).bunfig.toml if custom config neededbun.lockb to gitbun run for scriptsbun test for testingbunx for one-off tools| Task | Node.js | Bun |
|---|---|---|
| Startup | 0.3s | 0.08s |
| Install (100 packages) | 45s | 8s |
| Test run | 2.3s | 1.1s |
| Build (esbuild equiv.) | 1.5s | 0.4s |
Bun is 4-10x faster for typical full-stack workflows.
bun --help # All commands
bun install --help # Install options
bun run --help # Run options
bun test --help # Test options
Q: Is Bun production-ready? A: Yes, for most use cases. Check Bun's compatibility for your specific packages.
Q: Should I switch from Node.js? A: For new projects, yes. For existing, evaluate package compatibility first.
Q: Will my npm packages work? A: Most do. Bun is npm-compatible. Test critical dependencies first.
Q: How do I handle CI/CD with Bun?
A: Install Bun in CI, use bun install --frozen-lockfile, then bun run.
Q: Can I use Bun with monorepos? A: Absolutely. Workspaces make monorepos effortless.
Last Updated: 2025-12-05 Status: Reference Implementation Related: BUN_CLI_STANDARD.md, Bun Documentation