Agent skill

Bun Dev Server

by involvex in involvex/youtube-music-cli

Set up high-performance development servers with Hot Module Replacement.

MITAuto-check: notesFrontend & Design

Install Bun Dev Server

skills CLI
$ npx skills add involvex/youtube-music-cli --skill bun-dev-server -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install involvex/youtube-music-cli bun-dev-server --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/involvex/youtube-music-cli.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/bun-dev-server .claude/skills/bun-dev-server && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
bun-dev-server
GitHub stars
456
Token cost
~2.9k tokens
SKILL.md length
351 words
Files
2 (incl. references)
Skills in repo
6
Repo updated
First seen
Licence
MIT

At a glance

Set up high-performance development servers with Hot Module Replacement.

  • Works in 11 steps: Determine Server Type → Check Prerequisites → Install Dependencies → …
  • Creating dev servers for web apps
  • SKILL.md covers Workflow, Testing the Setup, Troubleshooting and Performance Tips, plus 2 more sections
  • Calls bun and curl

What it does

Bun Dev Server is an agent skill from involvex/youtube-music-cli. Set up high-performance development servers with Hot Module Replacement. Use when creating dev servers for web apps, setting up React Fast Refresh, or configuring API servers with live reload.

Its SKILL.md is about 2.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/hmr-examples.md`). Compatibility notes: Requires Bun 1.0+

It sits in Frontend & Design. It works with React and YouTube. The repository describes itself as: A powerful Terminal User Interface (TUI) music player for YouTube Music. The licence is MIT.

When your agent uses it

  • Creating dev servers for web apps
  • Setting up React Fast Refresh
  • Configuring API servers with live reload

Example prompts

  • “/bun-dev-server”

Requirements

  • Compatibility (from SKILL.md): Requires Bun 1.0+
  • Pre-approved tools (allowed-tools): Bash, Write, Read

Workflow steps

11 steps, taken from the step headings in SKILL.md.

  1. Determine Server Type
  2. Check Prerequisites
  3. Install Dependencies
  4. Create Server Configuration
  5. Configure React Fast Refresh (Advanced)
  6. Environment Configuration
  7. Update package.json Scripts
  8. Configure TypeScript
  9. Create Project Structure
  10. Advanced: HTTPS for Local Development
  11. Proxy Configuration (for existing backends)

What it can do on your machine

Read from SKILL.md and the folder at commit d4c5809. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash
    • Write
    • Read

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • bun
    • curl

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use curl, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Requires Bun 1.0+

    From compatibility in the SKILL.md frontmatter.

Context cost

Bun Dev Server loads about 2.9k tokens when it runs, and up to ~5.2k if it reads all its reference files. Until then it costs about 52 tokens; SKILL.md has 351 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~52
When it runs · the whole SKILL.md, loaded when a task matches
~2.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:298
    Create `.env.development`:
  • NoteMentions a .env fileSKILL.md:312
    Create `.env.production`:
  • NoteMentions a .env fileSKILL.md:398
    ├── .env.development
  • NoteMentions a .env fileSKILL.md:399
    ├── .env.production
  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Bash, Write, Read

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from involvex/youtube-music-cli at commit d4c5809, republished under its MIT licence (© involvex). 351 words, ~2,867 tokens.

Download SKILL.mdSave it as .claude/skills/bun-dev-server/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
bun-dev-server
description
Set up high-performance development servers with Hot Module Replacement. Use when creating dev servers for web apps, setting up React Fast Refresh, or configuring API servers with live reload.
allowed-tools
Bash, Write, Read
compatibility
Requires Bun 1.0+
metadata.author
dale
metadata.category
bun-runtime
metadata.tags
bun, dev-server, hmr, react, hot-reload

Bun Development Server Setup

You are assisting with setting up a high-performance development server using Bun.serve with Hot Module Replacement (HMR) and React Fast Refresh.

Workflow

1. Determine Server Type

Ask the user what type of development server they need:

  • React/Frontend App: SPA with React Fast Refresh
  • API Server: REST/GraphQL API with auto-reload
  • Full-Stack App: Frontend + API combined
  • Static Server: File server with live reload
2. Check Prerequisites
bash
# Verify Bun installation
bun --version

# Check if project has package.json
ls -la package.json

If no package.json exists, suggest running bun init first.

3. Install Dependencies

For React Apps:

bash
bun add react react-dom
bun add -d @types/react @types/react-dom

For API with Hono (recommended):

bash
bun add hono

For Full-Stack:

bash
bun add react react-dom hono
bun add -d @types/react @types/react-dom
4. Create Server Configuration
React Development Server

Create server.ts in the project root:

typescript
import type { ServerWebSocket } from "bun";

const clients = new Set<ServerWebSocket<unknown>>();

const server = Bun.serve({
  port: 3000,

  async fetch(request, server) {
    const url = new URL(request.url);

    // WebSocket for HMR
    if (url.pathname === "/_hmr") {
      const upgraded = server.upgrade(request);
      if (upgraded) return undefined;
      return new Response("WebSocket upgrade failed", { status: 500 });
    }

    // Serve index.html for SPA routing
    if (url.pathname === "/" || !url.pathname.includes(".")) {
      return new Response(
        Bun.file("public/index.html"),
        { headers: { "Content-Type": "text/html" } }
      );
    }

    // Serve static files
    const filePath = `public${url.pathname}`;
    const file = Bun.file(filePath);

    if (await file.exists()) {
      return new Response(file);
    }

    return new Response("Not Found", { status: 404 });
  },

  websocket: {
    open(ws) {
      clients.add(ws);
      console.log("HMR client connected");
    },

    close(ws) {
      clients.delete(ws);
      console.log("HMR client disconnected");
    },

    message(ws, message) {
      // Handle client messages if needed
    },
  },
});

console.log(`🚀 Dev server running at http://localhost:${server.port}`);

// Watch for file changes
const watcher = Bun.file.watch(import.meta.dir + "/src", {
  recursive: true,
});

for await (const event of watcher) {
  if (event.kind === "change" && event.path.endsWith(".tsx")) {
    console.log(`📝 File changed: ${event.path}`);

    // Notify all connected clients to reload
    for (const client of clients) {
      client.send(JSON.stringify({ type: "reload" }));
    }
  }
}

Create public/index.html:

html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Bun + React App</title>
</head>
<body>
  <div id="root"></div>
  <script type="module" src="/src/index.tsx"></script>

  <!-- HMR Client -->
  <script>
    const ws = new WebSocket('ws://localhost:3000/_hmr');

    ws.addEventListener('message', (event) => {
      const data = JSON.parse(event.data);

      if (data.type === 'reload') {
        console.log('🔄 Reloading...');
        window.location.reload();
      }
    });

    ws.addEventListener('close', () => {
      console.log('❌ HMR connection lost. Reconnecting...');
      setTimeout(() => window.location.reload(), 1000);
    });
  </script>
</body>
</html>

Create src/index.tsx:

typescript
import { render } from 'react-dom';
import App from './App';

const root = document.getElementById('root');
render(<App />, root);

Create src/App.tsx:

typescript
export default function App() {
  return (
    <div>
      <h1>Welcome to Bun + React!</h1>
      <p>Edit src/App.tsx to see HMR in action</p>
    </div>
  );
}
API Server with Hono

Create server.ts:

typescript
import { Hono } from 'hono';
import { cors } from 'hono/cors';
import { logger } from 'hono/logger';

const app = new Hono();

// Middleware
app.use('*', cors());
app.use('*', logger());

// Routes
app.get('/', (c) => {
  return c.json({ message: 'Welcome to Bun API' });
});

app.get('/api/health', (c) => {
  return c.json({ status: 'ok', timestamp: Date.now() });
});

// Example POST endpoint
app.post('/api/users', async (c) => {
  const body = await c.req.json();
  return c.json({ created: true, data: body }, 201);
});

// Start server
const server = Bun.serve({
  port: process.env.PORT || 3000,
  fetch: app.fetch,
});

console.log(`🚀 API server running at http://localhost:${server.port}`);
Full-Stack Server

Create server.ts:

typescript
import { Hono } from 'hono';
import { serveStatic } from 'hono/bun';

const app = new Hono();

// API routes
const api = new Hono();

api.get('/health', (c) => c.json({ status: 'ok' }));
api.get('/users', (c) => c.json({ users: [] }));

app.route('/api', api);

// Serve static files
app.use('/*', serveStatic({ root: './public' }));

// SPA fallback
app.get('*', (c) => c.html(Bun.file('public/index.html')));

const server = Bun.serve({
  port: 3000,
  fetch: app.fetch,
});

console.log(`🚀 Full-stack server at http://localhost:${server.port}`);
5. Configure React Fast Refresh (Advanced)

For true React Fast Refresh, create hmr-runtime.ts:

typescript
// React Fast Refresh runtime
let timeout: Timer | null = null;

export function refresh() {
  if (timeout) clearTimeout(timeout);

  timeout = setTimeout(() => {
    // Re-import the App component
    import('./App.tsx?t=' + Date.now()).then((module) => {
      const { render } = require('react-dom');
      const root = document.getElementById('root');
      render(module.default(), root);
    });
  }, 100);
}

// Listen for HMR events
if (import.meta.hot) {
  import.meta.hot.accept(() => {
    refresh();
  });
}
6. Environment Configuration

Create .env.development:

bash
# Server
PORT=3000
NODE_ENV=development

# API
API_URL=http://localhost:3000/api

# Features
ENABLE_HMR=true

Create .env.production:

bash
# Server
PORT=8080
NODE_ENV=production

# API
API_URL=https://api.example.com

# Features
ENABLE_HMR=false

Load environment in server.ts:

typescript
// Environment is loaded automatically by Bun
const isDev = process.env.NODE_ENV === 'development';
const port = process.env.PORT || 3000;
7. Update package.json Scripts

Add development scripts:

json
{
  "scripts": {
    "dev": "bun run --hot server.ts",
    "dev:watch": "bun run --watch server.ts",
    "start": "NODE_ENV=production bun run server.ts",
    "build": "bun build src/index.tsx --outdir=dist --minify",
    "clean": "rm -rf dist"
  }
}

Script explanations:

  • dev: Run with hot reload (restarts on file changes)
  • dev:watch: Watch mode (faster, but doesn't reload on crash)
  • start: Production mode
  • build: Build frontend for production
8. Configure TypeScript

Update tsconfig.json:

json
{
  "compilerOptions": {
    "target": "ES2022",
    "lib": ["ES2022", "DOM", "DOM.Iterable"],
    "module": "ESNext",
    "moduleResolution": "bundler",
    "jsx": "react-jsx",
    "types": ["bun-types"],
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "resolveJsonModule": true,
    "allowImportingTsExtensions": true,
    "noEmit": true,
    "paths": {
      "@/*": ["./src/*"]
    }
  },
  "include": ["src/**/*", "server.ts"]
}
9. Create Project Structure

Generate complete project structure:

project/
├── server.ts              # Development server
├── src/
│   ├── index.tsx         # App entry point
│   ├── App.tsx           # Main component
│   ├── components/       # React components
│   └── styles/           # CSS files
├── public/
│   ├── index.html        # HTML template
│   └── assets/           # Static assets
├── .env.development
├── .env.production
├── package.json
├── tsconfig.json
└── README.md
10. Advanced: HTTPS for Local Development

For HTTPS support (needed for some browser APIs):

typescript
import { readFileSync } from 'fs';

const server = Bun.serve({
  port: 3000,
  tls: {
    cert: readFileSync('./localhost.pem'),
    key: readFileSync('./localhost-key.pem'),
  },
  fetch: app.fetch,
});

console.log(`🔒 HTTPS server at https://localhost:${server.port}`);

Generate certificates with:

bash
# Install mkcert first: brew install mkcert
mkcert -install
mkcert localhost 127.0.0.1 ::1
Show full SKILL.md (143 more words)Show less
11. Proxy Configuration (for existing backends)

If user needs to proxy API requests to another server:

typescript
const app = new Hono();

// Proxy /api requests to backend
app.all('/api/*', async (c) => {
  const url = new URL(c.req.url);
  const backendUrl = `http://localhost:8080${url.pathname}${url.search}`;

  const response = await fetch(backendUrl, {
    method: c.req.method,
    headers: c.req.raw.headers,
    body: c.req.method !== 'GET' ? await c.req.raw.text() : undefined,
  });

  return new Response(response.body, {
    status: response.status,
    headers: response.headers,
  });
});

Testing the Setup

After creation, guide user to test:

bash
# 1. Start dev server
bun run dev

# 2. Open browser
open http://localhost:3000

# 3. Make a change to src/App.tsx
# 4. Verify HMR reloads the page

# 5. Test API endpoints
curl http://localhost:3000/api/health

Troubleshooting

HMR not working
typescript
// Check if WebSocket connection is established
// Open browser console and look for:
// "HMR client connected"

// If not, verify:
// 1. Port is correct
// 2. No firewall blocking WebSocket
// 3. Server is running with --hot flag
Port already in use
bash
# Find process using port 3000
lsof -ti:3000

# Kill the process
kill -9 $(lsof -ti:3000)

# Or use a different port
PORT=3001 bun run dev
CORS issues

Add CORS headers to server:

typescript
app.use('*', cors({
  origin: 'http://localhost:3000',
  credentials: true,
}));

Performance Tips

  1. Use --hot for development: Faster than --watch for most cases
  2. Minimize file watcher scope: Watch only src/ directory
  3. Use HTTP/2: Enable for faster parallel loading
  4. Cache static assets: Add Cache-Control headers
typescript
app.use('/assets/*', async (c, next) => {
  await next();
  c.header('Cache-Control', 'public, max-age=31536000');
});

Completion Checklist

  • ✅ Development server created
  • ✅ HMR configured and tested
  • ✅ Environment variables set up
  • ✅ Package.json scripts added
  • ✅ Project structure organized
  • ✅ TypeScript configured
  • ✅ Browser successfully connects
  • ✅ File changes trigger reload

Next Steps

Suggest to the user:

  1. Add error boundaries for better error handling
  2. Set up ESLint and Prettier
  3. Configure path aliases in tsconfig.json
  4. Add development vs production builds
  5. Consider adding bun-test for testing

© involvex, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in .agents/skills/bun-dev-server of involvex/youtube-music-cli.

  • SKILL.md
  • references/hmr-examples.md

Open the folder on GitHubat commit d4c5809

Compare with similar skills

Bun Dev Server next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Bun Dev Server compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Bun Dev Server this skillinvolvex/youtube-music-cli456—~2.9kAutomated safety check: NotesMIT
Web Artifacts Builderanthropics/skills180k41 repos~769Automated safety check: PassApache-2.0
React Doctormakeplane/plane61k12 repos~657Automated safety check: PassAGPL-3.0
React Router Developmentremix-run/react-router57k1 repos~1.5kAutomated safety check: PassMIT
React UI State PatternsChrisWiles/claude-code-showcase6.1k8 repos~1.6kAutomated safety check: PassNone
GSAP Core Animationgreensock/gsap-skills16k4 repos~3.7kAutomated safety check: PassMIT

Similar skills

  • Web Artifacts Builder

    anthropics/skills

    Official

    Builds multi-component claude.ai HTML artifacts as a small React, TypeScript and Tailwind project, then bundles it into one shareable HTML file.

    180k GitHub starsUsed in 41 repos~769 tokens
    Frontend & DesignAuto-check passed
  • React Doctor

    makeplane/plane

    Scans React code for lint, accessibility, bundle size and architecture issues, reports a health score and checks that changes do not lower it.

    61k GitHub starsUsed in 12 repos~657 tokens
    Frontend & DesignAuto-check passed
  • React Router Development

    remix-run/react-router

    Guides work on React Router apps by first identifying whether the app uses Framework, Data or Declarative mode, then loading the matching reference and the installed package docs.

    57k GitHub starsUsed in 1 repo~1.5k tokens
    Frontend & DesignAuto-check passed
  • React UI State Patterns

    ChrisWiles/claude-code-showcase

    Sets patterns for React interfaces: when to show loading spinners or skeletons, how to surface errors, how to disable buttons during async work and how to handle empty lists.

    6.1k GitHub starsUsed in 8 repos~1.6k tokens
    Frontend & DesignAuto-check passed
  • GSAP Core Animation

    greensock/gsap-skills

    Covers the GSAP core API for tweens, easing, staggers, defaults and matchMedia, and when to choose GSAP over CSS animations or other JavaScript animation libraries.

    16k GitHub starsUsed in 4 repos~3.7k tokens
    Frontend & DesignAuto-check passed
  • Builds single-file interactive HTML prototypes rendered with the real LobeHub UI components and written as production-style React, so they can later be split into files.

    83k GitHub stars~1.6k tokensUpdated today
    Frontend & DesignAuto-check passed

More from involvex/youtube-music-cli

  • React State Management

    involvex/youtube-music-cli

    Master modern React state management with Redux Toolkit, Zustand, Jotai, and React Query.

    456 GitHub starsUsed in 13 repos~3k tokens
    Auto-check passed
  • Bun Win32

    involvex/youtube-music-cli

    Win32 FFI binding lifecycle for @bun-win32/ packages (Win32 DLL bindings via bun:ffi on Windows).

    456 GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Bun Build

    involvex/youtube-music-cli

    Create optimized production bundles with Bun's native bundler.

    456 GitHub stars~2.1k tokensUpdated today
    Auto-check: notes
  • Bun Test

    involvex/youtube-music-cli

    Configure Bun's built-in test runner with Jest-compatible APIs.

    456 GitHub stars~2.3k tokensUpdated today
    Auto-check: notes
  • Bun Init

    involvex/youtube-music-cli

    Initialize a new Bun project with TypeScript and optimal configuration.

    456 GitHub stars~2.1k tokensUpdated today
    Auto-check: notes

Works with

Questions about Bun Dev Server

What does Bun Dev Server do?

Set up high-performance development servers with Hot Module Replacement. Bun Dev Server is an agent skill from involvex/youtube-music-cli. Set up high-performance development servers with Hot Module Replacement.

When should I use Bun Dev Server?

Bun Dev Server fits situations like: creating dev servers for web apps; setting up React Fast Refresh; configuring API servers with live reload.

How do I install Bun Dev Server in Claude Code?

Run `npx skills add involvex/youtube-music-cli --skill bun-dev-server -a claude-code`. Or copy the skill folder (.agents/skills/bun-dev-server in involvex/youtube-music-cli) into .claude/skills/bun-dev-server in your project. Claude Code loads it when a task matches its description.

How do I install Bun Dev Server in Codex?

Run `npx skills add involvex/youtube-music-cli --skill bun-dev-server -a codex`. Or copy the skill folder (.agents/skills/bun-dev-server in involvex/youtube-music-cli) into .agents/skills/bun-dev-server in your project. Codex loads it when a task matches its description.

Can I use Bun Dev Server in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add involvex/youtube-music-cli --skill bun-dev-server -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/bun-dev-server, .gemini/skills/bun-dev-server, .github/skills/bun-dev-server and .opencode/skills/bun-dev-server in your project.

What does Bun Dev Server need to run?

Going by SKILL.md and its folder, Bun Dev Server needs the command-line tools its instructions call (bun and curl). Its frontmatter pre-approves these tools: Bash, Write, Read. Compatibility (from SKILL.md): Requires Bun 1.0+.

Does Bun Dev Server access the network?

SKILL.md contains no URLs. Its commands use curl, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Bun Dev Server safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file; pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Bun Dev Server use?

Bun Dev Server is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Bun Dev Server use?

About 2.9k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.3k tokens, read only when the agent opens those files.

What are the alternatives to Bun Dev Server?

Skills that share tags, products or a category with Bun Dev Server: Web Artifacts Builder (anthropics/skills, 180k stars), React Doctor (makeplane/plane, 61k stars), React Router Development (remix-run/react-router, 57k stars) and React UI State Patterns (ChrisWiles/claude-code-showcase, 6.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Bun Dev Server?

involvex (a GitHub user) maintains it in involvex/youtube-music-cli, which has 456 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on October 8, 2026.

Source: involvex/youtube-music-cli on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.