docs/zh-CN/skills/bun-runtime/SKILL.md
Bun 作为运行时、包管理器、打包器和测试运行器。何时选择 Bun 而非 Node、迁移注意事项以及 Vercel 支持。
npx skillsauth add affaan-m/everything-claude-code bun-runtimeInstall 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 是一个快速的全能 JavaScript 运行时和工具集:运行时、包管理器、打包器和测试运行器。
在以下情况下使用:采用 Bun、从 Node 迁移、编写或调试 Bun 脚本/测试,或在 Vercel 或其他平台上配置 Bun。
bun install 比 npm/yarn 快得多。在当前 Bun 中,锁文件默认为 bun.lock(文本);旧版本使用 bun.lockb(二进制)。bun test,具有类似 Jest 的 API。从 Node 迁移:将 node script.js 替换为 bun run script.js 或 bun script.js。运行 bun install 代替 npm install;大多数包都能工作。使用 bun run 来执行 npm 脚本;使用 bun x 进行 npx 风格的临时运行。支持 Node 内置模块;在存在 Bun API 的地方优先使用它们以获得更好的性能。
Vercel:在项目设置中将运行时设置为 Bun。构建命令:bun run build 或 bun build ./src/index.ts --outdir=dist。安装命令:bun install --frozen-lockfile 用于可重复的部署。
# Install dependencies (creates/updates bun.lock or bun.lockb)
bun install
# Run a script or file
bun run dev
bun run src/index.ts
bun src/index.ts
bun run --env-file=.env dev
FOO=bar bun run script.ts
bun test
bun test --watch
// test/example.test.ts
import { expect, test } from "bun:test";
test("add", () => {
expect(1 + 2).toBe(3);
});
const file = Bun.file("package.json");
const json = await file.json();
Bun.serve({
port: 3000,
fetch(req) {
return new Response("Hello");
},
});
bun.lock 或 bun.lockb)以实现可重复的安装。bun run。对于 TypeScript,Bun 原生运行 .ts。data-ai
Run team-based orchestration for agent squads using work items, ownership, agent Kanban, merge gates, and control pane handoffs.
data-ai
Design task-local harnesses, eval gates, and reusable skill extraction for Claude dynamic workflow mode and other adaptive agent harnesses.
development
React component testing with React Testing Library, Vitest/Jest, MSW for network mocking, accessibility assertions with axe, and the decision boundary between component tests and Playwright/Cypress end-to-end runs. Use when writing or fixing tests for React components, hooks, or pages.
tools
React and Next.js performance optimization patterns adapted from Vercel Engineering's React Best Practices (https://github.com/vercel-labs/agent-skills). Organizes 70+ rules across 8 priority categories — waterfalls, bundle size, server-side, client fetching, re-render, rendering, JS micro-perf, advanced. Use when writing, reviewing, or refactoring React/Next.js code for performance.