Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

bunjs

БесплатноБез исполняемых скриптовНе проверен

Use when building Bun.js/Hono applications, implementing HTTP endpoints, setting up Prisma/SQLite, writing Zod validation, or using Bun's test runner. See…

MadAppGangот MadAppGang★ 290 звёзд на GitHub

Об этом скилле

Bun.js Backend Patterns

Overview

Bun runtime patterns for building fast TypeScript backend services. This skill covers core Bun features, HTTP servers with Hono, database access with Prisma, validation with Zod, error handling, testing, and configuration patterns.

When to use this skill:

  • Implementing basic HTTP endpoints and route handlers
  • Setting up middleware patterns (CORS, logging, auth)
  • Working with SQLite or PostgreSQL databases
  • Implementing request validation with Zod
  • Writing tests with Bun's native test runner
  • Basic file operations and WebSocket handling

For advanced topics, see:

  • dev:bunjs-architecture - Layered architecture, clean code patterns, camelCase conventions
  • dev:bunjs-production - Docker, AWS, Redis caching, security, CI/CD
  • dev:bunjs-apidog - OpenAPI specs and Apidog integration

Why Bun

Bun fundamentally transforms TypeScript backend development by:

  • Native TypeScript execution - No build steps in development
  • Lightning-fast performance - 3-4x faster than Node.js for many operations
  • Unified toolkit - Built-in test runner, bundler, and transpiler
  • Drop-in compatibility - Most Node.js APIs and npm packages work
  • Developer experience - Hot reload with --hot, instant feedback

Stack Overview

  • Bun 1.x (runtime, package manager, test runner, bundler)
  • TypeScript 5.7 (strict mode)
  • Hono 4.6 (ultra-fast web framework, TypeScript-first)
  • Prisma 6.2 (type-safe ORM)
  • Biome 2.3 (formatting + linting, replaces ESLint + Prettier)
  • Zod (runtime validation)
  • PostgreSQL 17 / SQLite (database)

Project Structure

project-root/
├── src/
│   ├── server.ts              # Entry point (starts server)
│   ├── app.ts                 # Hono app initialization & middleware
│   ├── config.ts              # Environment configuration
│   ├── core/                  # Core utilities (errors, logger, responses)
│   ├── database/
│   │   ├── client.ts          # Prisma client setup
│   │   └── repositories/      # Data access layer (Prisma queries)
│   ├── services/              # Business logic layer
│   ├── controllers/           # HTTP handlers (calls services)
│   ├── middleware/            # Hono middleware (auth, validation, etc.)
│   ├── routes/                # API route definitions
│   ├── schemas/               # Zod validation schemas
│   ├── types/                 # TypeScript type definitions
│   └── utils/                 # Utility functions
├── tests/
│   ├── unit/                  # Unit tests
│   └── integration/           # Integration tests (API + DB)
├── prisma/                    # Prisma schema & migrations
├── tsconfig.json              # TypeScript config
├── biome.json                 # Biome config
├── package.json               # Bun-managed dependencies
└── bun.lockb                  # Bun lockfile

Key Principles:

  • Structure by technical capability, not by feature
  • Each layer has single responsibility
  • No HTTP handling in services, no business logic in controllers
  • Easy to test components in isolation

Quick Start

# Initialize project
bun init

# Install dependencies
bun add hono @hono/node-server zod @prisma/client bcrypt jsonwebtoken
bun add -d @types/node @types/jsonwebtoken @types/bcrypt typescript prisma @biomejs/biome @types/bun

# Initialize tools
bunx tsc --init
bunx prisma init
bunx @biomejs/biome init

package.json scripts:

{
  "scripts": {
    "dev": "bun --hot src/server.ts",
    "start": "NODE_ENV=production bun src/server.ts",
    "build": "bun build src/server.ts --target bun --outdir dist",
    "test": "bun test",
    "test:watch": "bun test --watch",
    "lint": "biome lint --write",
    "format": "biome format --write",
    "check": "biome check --write",
    "typecheck": "tsc --noEmit",
    "db:generate": "prisma generate",
    "db:migrate": "prisma migrate dev",
    "db:studio": "prisma studio"
  }
}

TypeScript Configuration

tsconfig.json (key settings):

{
  "compilerOptions": {
    "target": "ES2022",
    "module": "ESNext",
    "lib": ["ES2022"],
    "moduleResolution": "bundler",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true,
    "resolveJsonModule": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "noImplicitReturns": true,
    "types": ["bun-types"],
    "baseUrl": ".",
    "paths": {
      "@core/*": ["src/core/*"],
      "@database/*": ["src/database/*"],
      "@services/*": ["src/services/*"],
      "@/*": ["src/*"]
    }
  }
}

Critical settings:

  • "strict": true - Enable all strict checks
  • "moduleResolution": "bundler" - Aligns with Bun's resolver
  • Use paths for clean imports (@core/*, @services/*)

HTTP Server with Hono

Basic Server Setup

Entry point (src/server.ts):

import { serve } from '@hono/node-server';
import { app } from './
Полный SKILL.md на GitHub

Установить bunjs в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл bunjs?

Use when building Bun.js/Hono applications, implementing HTTP endpoints, setting up Prisma/SQLite, writing Zod validation, or using Bun's test runner. See bunjs-architecture for layered patterns, bunjs-production for deployment.

Как установить скилл bunjs?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл bunjs запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить bunjs с