CURSOR RULESBun & 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.
.cursor/rules/bun-elysia.mdcWhat this file changes for Bun & Elysia / Hono
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.
Bun & Elysia / Hono: code to avoid and code to write instead
// 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 });
});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 }),
}),
}
);How to Install Bun & Elysia / Hono Cursor Rules (.mdc) via Terminal
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:
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.
mkdir -p ".cursor/rules" && curl -fsSL "https://www.devscratchpad.tech/api/raw/cursor-rules/bun-elysia" -o ".cursor/rules/bun-elysia.mdc"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.
Cursor rules generator: .cursor/rules/*.mdc for your stack
Cursor Rules (.mdc): how it works, where the file goes, and every Cursor Rules preset.
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.
cURL to JavaScript Fetch
Translate bash cURL commands into JavaScript fetch() API calls.
cURL to Python Requests
Translate bash cURL commands into Python `requests` code.
JSON Formatter & Validator
Format, validate, and minify JSON with interactive syntax highlighting.
HMAC Generator
Compute Hash-based Message Authentication Codes (HMAC) using SHA256, SHA512, etc.
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.
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.
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.