bun-runtime
Bun 作为运行时、包管理器、打包器和测试运行器。何时选择 Bun 而非 Node、迁移注意事项以及 Vercel 支持。
Best use case
bun-runtime is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Bun 作为运行时、包管理器、打包器和测试运行器。何时选择 Bun 而非 Node、迁移注意事项以及 Vercel 支持。
Teams using bun-runtime should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/bun-runtime/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How bun-runtime Compares
| Feature / Agent | bun-runtime | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Bun 作为运行时、包管理器、打包器和测试运行器。何时选择 Bun 而非 Node、迁移注意事项以及 Vercel 支持。
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Bun 运行时
Bun 是一个快速的全能 JavaScript 运行时和工具集:运行时、包管理器、打包器和测试运行器。
## 何时使用
* **优先选择 Bun** 用于:新的 JS/TS 项目、安装/运行速度很重要的脚本、使用 Bun 运行时的 Vercel 部署,以及当您想要单一工具链(运行 + 安装 + 测试 + 构建)时。
* **优先选择 Node** 用于:最大的生态系统兼容性、假定使用 Node 的遗留工具,或者当某个依赖项存在已知的 Bun 问题时。
在以下情况下使用:采用 Bun、从 Node 迁移、编写或调试 Bun 脚本/测试,或在 Vercel 或其他平台上配置 Bun。
## 工作原理
* **运行时**:开箱即用的 Node 兼容运行时(基于 JavaScriptCore,用 Zig 实现)。
* **包管理器**:`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` 用于可重复的部署。
## 示例
### 运行和安装
```bash
# 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
```
### 脚本和环境变量
```bash
bun run --env-file=.env dev
FOO=bar bun run script.ts
```
### 测试
```bash
bun test
bun test --watch
```
```typescript
// test/example.test.ts
import { expect, test } from "bun:test";
test("add", () => {
expect(1 + 2).toBe(3);
});
```
### 运行时 API
```typescript
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`。
* 保持依赖项最新;Bun 和生态系统发展迅速。Related Skills
ai-runtime-toolkit
AI Runtime工具装备系统,支持8个内部专业工具和10+个外部CLI工具的整合管理,提供工具发现、执行和配置功能,遵循整合优于创造的设计理念
ai-runtime-memory
AI Runtime分层记忆系统,支持SQL风格的事件查询、时间线管理,以及记忆的智能固化和检索,用于项目历史追踪和经验传承
Tokio — Async Runtime for Rust
You are an expert in Tokio, the asynchronous runtime for Rust that powers most of the Rust async ecosystem. You help developers build high-performance network applications, concurrent services, and I/O-bound systems using Tokio's task scheduler, async I/O primitives, channels, timers, and synchronization utilities — handling millions of concurrent connections with minimal memory overhead.
Falco — Runtime Threat Detection
## Overview
pubsub-subscription-config
Pubsub Subscription Config - Auto-activating skill for GCP Skills. Triggers on: pubsub subscription config, pubsub subscription config Part of the GCP Skills skill category.
providing-performance-optimization-advice
Provide comprehensive prioritized performance optimization recommendations for frontend, backend, and infrastructure. Use when analyzing bottlenecks or seeking improvement strategies. Trigger with phrases like "optimize performance", "improve speed", or "performance recommendations".
property-based-test-helper
Property Based Test Helper - Auto-activating skill for Test Automation. Triggers on: property based test helper, property based test helper Part of the Test Automation skill category.
prometheus-config-generator
Prometheus Config Generator - Auto-activating skill for DevOps Advanced. Triggers on: prometheus config generator, prometheus config generator Part of the DevOps Advanced skill category.
profiling-application-performance
Execute this skill enables AI assistant to profile application performance, analyzing cpu usage, memory consumption, and execution time. it is triggered when the user requests performance analysis, bottleneck identification, or optimization recommendations. the... Use when optimizing performance. Trigger with phrases like 'optimize', 'performance', or 'speed up'.
product-brief
Structured product brief and PRD creation assistant. Use when the user needs to write a product brief, PRD, feature spec, or any document that defines what to build and why. Triggers include "product brief", "PRD", "spec", "feature doc", "write a brief", "define this feature", or when scoping work for engineering.
processing-computer-vision-tasks
Process images using object detection, classification, and segmentation. Use when requesting "analyze image", "object detection", "image classification", or "computer vision". Trigger with relevant phrases based on skill purpose.
processing-api-batches
Optimize bulk API requests with batching, throttling, and parallel execution. Use when processing bulk API operations efficiently. Trigger with phrases like "process bulk requests", "batch API calls", or "handle batch operations".