AI Skill StudioAI Skill Studio
Skills
Presets:

Target Standard & File Format

AI Agent Rules & Skills
Context Shields & Privacy (Ignore Files)
Integrations & Machine Documentation
AI Governance & Multi-Agent Planning Suite

Cursor Rule Scope

.cursor/rules/*.mdc

Scopes rule to matching files. Use **/* for global workspace scope.

When ON, Cursor injects this rule in every generation context.

Identity & Activation Rules

3 chips
Scoped domain keywords evaluated in real time
api-routescode-auditsrefactoring
Suggested Chips:

Technology Stack Context

Engineering Philosophy

Flexible & Adaptable

Architectural & Code Quality Conventions

Less rigid & configurable

Agent Behavioral Guardrails

Select active rules
Security & Trust Boundaries
Always included
  • Untrusted Content Is Data
  • Encoded Payloads
  • Least-Privilege File Access
  • Confirm Irreversible Actions
  • Secret Handling
  • Validation Failures
  • Conflicting Requests

Step-by-Step Workflow Procedures

Bun & Elysia Cursor Rules (.mdc) | High-Performance TypeScript Backend

Generate Bun and Elysia.js Cursor rules enforcing TypeBox schema validation, Eden Treaty client type safety, and zero-overhead native Bun APIs. 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.

Target Path
.cursor/rules/bun-elysia.mdc
Execution Scope
Glob pattern match
Specification Format
Frontmatter MDC (.mdc)
AI Tool Support
Cursor
02 / WHY IT HELPS

What this file changes for Bun & Elysia / Hono

Without it

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.

What the file tells the agent
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 / CODE PATTERNS

Bun & Elysia / Hono: code to avoid and code to write instead

Avoid
// 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 });
});
Write instead
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 Cursor Rules (.mdc) via Terminal

1

Step 1: Open Project Directory & Verify Target Placement

Open your terminal and navigate to your project root folder where the .cursor/rules/bun-elysia.mdc 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:

.cursor/rules/bun-elysia.mdc
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 .cursor/rules/bun-elysia.mdc:

Terminal One-Liner Install

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

Raw API Stream
$mkdir -p ".cursor/rules" && curl -fsSL "https://www.devscratchpad.tech/api/raw/cursor-rules/bun-elysia" -o ".cursor/rules/bun-elysia.mdc"
3

Step 3: Check that Cursor uses it

Cursor picks up rules in .cursor/rules/ automatically. This one attaches when files matching its globs are in the request, or when you @-mention it.

05 / ROUTE DIRECTORY & CROSS-TOOLING
Format Pillar Hub

Cursor rules generator: .cursor/rules/*.mdc for your stack

Cursor Rules (.mdc): how it works, where the file goes, and every Cursor Rules preset.

/cursor-rules Directory
06 / RELATED DEVELOPER TOOLS

Tools for Bun & Elysia / Hono work

Browser-based utilities to test, format and inspect the code your AI tool writes. Nothing you paste is uploaded.

View all 28 tools

Live Repository & Schema Ingestion

Inspect any public or private GitHub repository, or paste SQL DDL and Prisma models directly in AI Skill Studio to auto-generate authentic rules. Zero server transmission.

Launch AI Skill Studio

Migrating from Legacy .cursorrules or CLAUDE.md?

Use the free, in-browser converter to turn one long rules file into Cursor .mdc, Claude SKILL.md or Windsurf rules.

Convert Rules Free
07 / 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.