Communitygithub.com

Bun スキル

高パフォーマンスなJavaScript/TypeScriptランタイム「Bun」を利用するためのスキルです。HTTPサーバー構築、パッケージ管理、テスト実行、バンドル、Node.jsからの移行を支援します。

Bun スキル とは?

このスキルは、オールインワンのJavaScript/TypeScriptランタイムであるBunを活用するための包括的なガイドを提供します。BunはNode.js、npm、webpack、Jestを単一のバイナリに統合しており、ネイティブのTypeScriptサポート、高パフォーマンスなHTTPサーバー(Bun.serve())、高速なパッケージマネージャー、バンドラー、Jest互換のテストランナーを備え、劇的なパフォーマンス向上を実現します。スキルでは、Bun.serve()によるREST APIサーバーの構築、bun installによる高速パッケージ管理、Bun.build()によるバンドル(ブラウザ・Bun・Nodeをターゲット)、bun testを用いたテスト実行(カバレッジ対応)、Bun.file()とBun.write()による高速ファイルI/O、Bun.passwordによる認証処理、Node.jsからの移行手順を具体的なコード例とともに説明しています。主要なプラットフォーム(ターミナル、CI/CD)で動作し、外部依存ゼロで高パフォーマンスな開発を実現します。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/TerminalSkills/skills/tree/HEAD/skills/bun

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Bun

概要

Bun は、Node.js、npm、webpack、Jest を単一のバイナリに置き換えるオールインワンの JavaScript/TypeScript ランタイムです。ネイティブの TypeScript サポート、高パフォーマンスな HTTP サーバー (Bun.serve())、高速なパッケージマネージャー、バンドラー、Jest 互換のテストランナーを備え、劇的なパフォーマンス向上を実現します。

使用方法

  • HTTP サーバーを作成する場合は、Bun.serve() を使用します。これは、組み込みの WebSocket サポート、TLS、ストリーミングレスポンスを備え、毎秒 10 万リクエスト以上を処理できます。
  • パッケージを管理する場合は、bun install(npm より 10~30 倍高速)、bun add、bun remove を使用し、読みやすい git diff のために bun.lock(テキスト形式)を推奨します。
  • バンドルする場合は、適切なターゲット("browser"、"bun"、"node")を指定して Bun.build() を使用し、splitting: true でコード分割を有効にし、ツリーシェイキングを設定します。
  • テストを作成する場合は、Jest 互換の API(describe、it、expect)を使用して bun test を実行し、スナップショットテスト、mock.module() によるモック、--coverage によるコードカバレッジを利用します。
  • ファイル I/O を行う場合は、Node.js の fs よりも Bun.file() と Bun.write() を優先して使用すると、ファイル操作が大幅に高速化され、Bun.Glob でパターンマッチングを行います。
  • 認証を処理する場合は、npm パッケージの代わりに Bun.password.hash() と Bun.password.verify() を使用して bcrypt/argon2 を利用します。
  • Node.js から移行する場合は、スクリプト内の node を bun に置き換え、package.json はそのまま維持し、ほとんどの npm パッケージが変更なしで動作することに注意してください。組み込みデータベースには SQLite の npm パッケージではなく bun:sqlite を使用します。

例

例1: 高パフォーマンスな API サーバーを構築する

ユーザーリクエスト: 「Bun の組み込み HTTP サーバーを使って REST API を作成して」

アクション:

  1. Bun.serve() とルートハンドラでサーバーを作成
  2. request.json() で JSON ボディを解析し、Response オブジェクトを返す
  3. リアルタイム機能のために WebSocket アップグレードを追加
  4. 認証に Bun.password、データストレージに bun:sqlite を使用

出力: 外部依存関係がなく、Bun の組み込み機能のみを使用した高速な API サーバー。

例2: Node.js プロジェクトを Bun に移行する

ユーザーリクエスト: 「Express プロジェクトを Node.js から Bun に切り替えて」

アクション:

  1. CI とローカル環境で npm install を bun install に置き換え
  2. package.json のスクリプトを更新し、node の代わりに bun run を使用
  3. dotenv を Bun の組み込み .env 読み込みに置き換え
  4. テストランナーを Jest から bun test に切り替え(テストファイルはそのまま)

出力: インストール、起動、テスト実行がより高速になった Bun ベースのプロジェクト。

ガイドライン

  • 新しい HTTP サーバーには Bun.serve() を使用します。これは Bun 上の Express よりも大幅に高速です。
  • ファイル操作には Node.js の fs よりも Bun.file() と Bun.write() を優先します。
  • ローカルデータには SQLite の npm パッケージを追加する代わりに bun:sqlite を使用します。
  • 認証には、ネイティブ依存関係をゼロにするために、bcrypt/argon2 の npm パッケージの代わりに Bun.password を使用します。
  • 読みやすい diff のために、bun.lock(テキスト形式)を git に保持します。
  • Jest と同じ API で劇的に高速な実行を実現するため、Jest の代わりに bun test でテストします。
  • ブラウザをターゲットにする場合は、Bun.build() で target: "browser" を使用します。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

TerminalSkills/skills

>- Run GitHub Actions locally with act. Use when a user asks to test GitHub Actions workflows locally, debug CI pipelines without pushing, or run workflows offline.

TerminalSkills/skills

>- You are an expert in AG2 (formerly AutoGen), the open-source multi-agent conversation framework. You help developers build systems where multiple AI agents collaborate through structured conversations — with tool use, human-in-the-loop, code execution, group chat orchestration, and nested conversations — for complex tasks like software development, research, and data analysis.

TerminalSkills/skills

>- Generate short-form videos with AI — script writing, text-to-speech narration, stock footage selection, subtitle generation, and video assembly. Use when: creating TikTok/YouTube Shorts/Reels content, automating video production, building content pipelines.

TerminalSkills/skills

>- Animate 3D objects and characters in Blender with Python. Use when the user wants to keyframe properties, create armatures and rigs, set up IK/FK chains, animate shape keys for facial animation, edit F-Curves, use the NLA editor to blend actions, add drivers for expression-based animation, or script any animation workflow in Blender.

TerminalSkills/skills

>- Automate motion capture and tracking workflows in Blender with Python. Use when the user wants to import BVH or FBX mocap data, retarget motion to armatures, track camera or object motion from video, solve camera motion, clean up motion capture data, or script any tracking pipeline in Blender.

TerminalSkills/skills

>- You are an expert in Bolt.new by StackBlitz, the AI-powered full-stack development environment that runs entirely in the browser. You help developers go from idea to deployed app in minutes using natural language prompts — Bolt generates complete applications with frontend, backend, database, and deployment, all running in a WebContainer without local setup.

TerminalSkills/skills

>- Self-host customer support with Chatwoot. Use when a user asks to set up open-source customer support, add live chat without SaaS costs, build a multi-channel inbox, or deploy a free Intercom alternative.

TerminalSkills/skills

>- You are an expert in Chi, the lightweight, idiomatic Go HTTP router built on `net/http`. You help developers build composable HTTP services using Chi's middleware stack, route groups, URL parameters, sub-routers, and context-based request scoping — providing Express-like ergonomics while staying 100% compatible with Go's standard library.

TerminalSkills/skills

When the user wants to edit, review, or improve existing marketing copy. Also use when the user mentions 'edit this copy,' 'review my copy,' 'copy feedback,' 'proofread,' 'polish this,' 'make this better,' or 'copy sweep.' This skill provides a systematic approach to editing marketing copy through multiple focused passes.

TerminalSkills/skills

>- Add live chat and customer support with Crisp. Use when a user asks to add a chat widget, implement live customer support, set up a help desk, create a knowledge base, or add a chatbot to a website.

TerminalSkills/skills

>- Assists with building custom interactive data visualizations using D3.js. Use when creating charts, graphs, maps, force layouts, or hierarchical diagrams that require fine-grained control beyond what charting libraries provide. Trigger words: d3, data visualization, chart, svg, scales, force graph, treemap, choropleth.

TerminalSkills/skills

dbt (data build tool) transforms data in your warehouse using SQL SELECT statements. Learn project setup, models, tests, documentation, incremental materializations, and integration with data warehouses like PostgreSQL, BigQuery, and Snowflake.

TerminalSkills/skills

>- You are an expert in dlt, the open-source Python library for building data pipelines. You help developers load data from any API, file, or database into warehouses and lakes using simple Python decorators — with automatic schema inference, incremental loading, and built-in data contracts. dlt is the "requests library for data pipelines.

TerminalSkills/skills

Data Version Control for ML projects. Track large datasets and models alongside Git, build reproducible ML pipelines, and run experiments with metric comparison. Works with any storage backend including S3, GCS, Azure, and local filesystems.

TerminalSkills/skills

>- You are an expert in E2B, the cloud platform for running AI-generated code in secure sandboxes. You help developers give AI agents the ability to execute code, install packages, read/write files, and run long processes in isolated cloud environments — each sandbox is a lightweight VM that boots in ~150ms with full Linux, filesystem, and networking.

TerminalSkills/skills

>- Transcode, convert, edit, and process audio and video with FFmpeg. Use when a user asks to convert video formats (webm to mp4, mkv to mp4), extract audio from video, compress video files, trim or cut clips, concatenate videos, add subtitles, create thumbnails, apply filters, change resolution or bitrate, re-encode media, create GIFs from video, add watermarks, normalize audio, stream media, or build automated media processing pipelines.

TerminalSkills/skills

>- Create advanced animations with GSAP. Use when building complex timelines, scroll-driven animations, SVG morphing, text animations, or high-performance web animations beyond CSS capabilities.

TerminalSkills/skills

>- Generate deterministic MP4 videos from HTML, CSS, media, and seekable animations using HeyGen's HyperFrames framework. Use when someone asks to "render HTML to video", "make a video with HyperFrames", "create a programmatic video", "turn an animation into MP4", "build a launch/product video from HTML", "render GSAP/Lottie/Three.js to video", or set up an agent-driven video pipeline. Covers init/preview/render/add/lint/inspect commands, data-* timing attributes, animation adapters, and the component catalog.

TerminalSkills/skills

When the user wants to perform load testing, stress testing, or performance testing of APIs and websites using k6. Also use when the user mentions "k6," "load test," "performance test," "stress test," "spike test," "soak test," "thresholds," "virtual users," or "VUs." For browser-based testing, see selenium.

TerminalSkills/skills

>- Lovable (formerly GPT Engineer) is a browser-based AI app builder that turns a natural-language description into a working full-stack web app with a built-in backend, authentication, database and one-click publishing. Use when the user wants to prototype or ship a web app with Lovable, write effective Lovable prompts, connect Supabase or GitHub, review generated security rules, or move a Lovable project into their own editor.

関連スキル