Bun & Elysia / Hono CLAUDE.md Generator | Free & Offline

Production-grade architectural rulebook for Bun & Elysia / Hono. Engineered to eliminate LLM hallucinations, enforce strict deterministic conventions, and prevent architectural drift across Cursor IDE, Claude Code CLI, and autonomous multi-agent pipelines.

Target Path
CLAUDE.md
Execution Scope
Root Workspace Context
Specification Format
Project Memory (.md)
AI Tool Support
Claude Code & Agent Workflows
02 / DRIFT ANALYSIS & VALUE PROPOSITION

Failure Patterns Prevented for Bun & Elysia / Hono

Without This Rule (Default LLM Behavior)Vulnerable

Bun and Elysia provide blazingly fast HTTP backends with TypeBox runtime validation and end-to-end type safety. Outdated AI models frequently hallucinate Node.js core modules, slow express-style middlewares, and redundant JSON serialization.

Hallucination Symptoms
  • Invokes deprecated or removed APIs from older model training weights
  • Generates conflicting configuration files and invalid imports
  • Silently drops type-safety, boundaries, or transaction isolation
With This Rule (Guaranteed Invariants)Deterministic
Use Elysia's native t schema builder (powered by TypeBox) for request body, query, and parameter validation.
Leverage native Bun.serve(), Bun.file(), and Bun.password instead of slow Node.js polyfills or external dependencies.
Structure plugins using .use() and define explicit Eden Treaty contracts for frontend consumption.
Handle application errors using Elysia .onError(({ code, error, set }) => ...) with typed error codes.
Ensure zero unhandled promise rejections and use strict type inference for all endpoint responses.
03 / VERIFIED CODE PATTERNS

Code Standards: Anti-Pattern vs Verified Implementation

Discouraged Anti-Pattern
// Discouraged: Node.js bcrypt imports, unvalidated body, and Express paradigms
import bcrypt from "bcrypt";
app.post("/users", async (req: any, res: any) => {
  const hash = await bcrypt.hash(req.body.password, 10);
  res.json({ success: true });
});
Verified Production Standard
import { Elysia, t } from "elysia";

export const app = new Elysia()
  .onError(({ code, set }) => {
    if (code === "NOT_FOUND") {
      set.status = 404;
      return { ok: false, error: "Resource not found" };
    }
  })
  .post(
    "/api/users",
    async ({ body, set }) => {
      const hash = await Bun.password.hash(body.password);
      set.status = 201;
      return { ok: true, email: body.email };
    },
    {
      body: t.Object({
        email: t.String({ format: "email" }),
        password: t.String({ minLength: 8 }),
      }),
    }
  );
04 / REPOSITORY PLACEMENT & 3-STEP TERMINAL INSTALLATION

How to Install Bun & Elysia / Hono CLAUDE.md Repository Guidelines via Terminal

1

Step 1: Open Project Directory & Verify Target Placement

Open your terminal and navigate to your project root folder where the CLAUDE.md file will reside. Ensure the file is placed at the exact path below relative to your project root so the AI engine automatically loads it:

CLAUDE.md
2

Step 2: Fetch Rule File via Terminal Command

Run curl, PowerShell, or wget to stream the rule directly from the DevScratchpad raw API endpoint and write it to CLAUDE.md:

Terminal One-Liner Install

Run directly in your project root to stream and write this rule file with one command.

Raw API Stream
$curl -fsSL "https://www.devscratchpad.tech/api/raw/claude-md/bun-elysia" -o "CLAUDE.md"
3

Step 3: Verify and Activate with AI Agent

Launch your AI coding assistant (Claude Code & Agent Workflows). The assistant will automatically discover CLAUDE.md in your repository and apply the architectural guardrails, type constraints, and verification protocols during code generation.

05 / ROUTE DIRECTORY & CROSS-TOOLING
Format Pillar HubComprehensive Manual

CLAUDE.md Repository Guidelines Directory

Inspect the complete specification manual, glob patterns, directory rules, and all available presets in our central directory.

/claude-md Directory
06 / FREQUENTLY ASKED QUESTIONS

Technical FAQ: Bun & Elysia / Hono AI Rulebooks

Why use TypeBox instead of Zod with Elysia?

Elysia is tightly integrated with TypeBox through its t builder, which compiles to high-performance JavaScript validators that are orders of magnitude faster than runtime reflection.

Is this rulebook compatible with Hono on Bun?

Yes, the conventions for native Bun APIs, context extractors, and edge TypeScript performance apply smoothly to Hono as well.