---
name: "bun-native-http-server-sqlite"
description: "Run high-throughput HTTP servers and embedded SQLite queries with Bun native APIs."
metadata:
  author: "Jarred Sumner"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "use bun.serve"
  - "query bun:sqlite database"
  - "run bun native websockets"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Bun Native HTTP Server & High-Speed Embedded SQLite

Develops applications using Bun: Bun.serve({ fetch, port }), WebSockets with per-socket data, Bun's built-in bun:sqlite database with prepared statements, and environment variable loading.

## When to Invoke
Invoke this skill whenever you need to:
- use bun.serve
- query bun:sqlite database
- run bun native websockets

## Execution SOP & Rules
1. Start server: Bun.serve({ port: 3000, fetch(req, server) { return new Response('Hello Bun!'); } }).
2. Connect SQLite: import { Database } from 'bun:sqlite'; const db = new Database('app.db').
3. Execute prepared statement: const query = db.query('SELECT * FROM users WHERE id = ?'); query.get(1).
4. Enable WebSockets: pass websocket: { message(ws, msg) { ws.send('Echo: ' + msg); } } to Bun.serve.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
