MCPInstall
elysiajs avatar

elysiajs

Build, debug, or migrate Elysia v2 TypeScript backends with validation, plugins, typed clients, and deployment. Use for Elysia projects or explicit Elysia requests.

Installs
14.7K
Last 24h
+166
Trending rank
#1424
Security
Warn

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/elysiajs/skills --skill elysiajs
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads elysiajs automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

Security audits

Independent scans of the skill's instructions and bundled files, each dated to when it ran.

Gen Agent Trust Hub PassSAFE ·The skill provides comprehensive documentation and examples for developing backend servers with the ElysiaJS framework. It follows industry best practices for security, such as recommending environment variables for secrets and providing guidance on XSS protection and input validation. No malicious patterns, obfuscation, or unauthorized data access were detected.· Audited
Socket PassNo alerts· Audited
Snyk PassLOW ·Risk: LOW · No issues· Audited
Runlayer WarnMEDIUM ·2/54 files flagged· Audited
ZeroLeaks PassNONE ·Score: 93/100 · 2 sections analyzed· Audited

SKILL.md

The instructions your agent reads when the skill is triggered.

Elysia v2

Start here

  1. Inspect package.json, the lockfile, runtime, and app structure. Keep existing versions and conventions unless the user requests a migration.
  2. This skill describes 2.0.0-rc.0 or newer. For v1, use migration to recognize differences, not as permission to upgrade. Check installed types when a different beta disagrees.
  3. Read only the references the task needs. Versions lists the source revision, package baselines, and verification limits.
  4. Check types and exercise the affected route, including its rejection path. See testing.

Essential rules

  • Options precede the handler. .get(path, options, handler), .get(path, handler), and .get(path, staticValue) are valid.
  • Keep the returned type. Chain calls or bind the result to a new variable. Reassigning let app = new Elysia() does not widen its inferred type.
  • Order hooks before routes. Parent hooks before .use(child) reach the child's routes. onRequest runs before routing and is the exception to registration order. See lifecycle.
  • Declare typed dependencies. Each independently defined instance should .use() its providers. Parent runtime inheritance does not give a child those static types. See composition.
  • Name shared plugins. name and seed deduplicate hooks. Plugin factories still execute on each call.
  • Return expected failures. status() and problem() send ordinary responses. A returned Error enters error hooks and contributes to the route's return type. Thrown errors are absent from that inferred type. Explicit error details can remain public in production. See errors.
  • Infer types from schemas. Use UnwrapSchema or UnwrapModels. TypeBox 1.x has no schema .static. Keep handlers inline and pass plain values to services.
  • Choose context lifetime. decorate and state are shared. derive runs per request after validation, in the beforeHandle queue.
  • Guard schemas override by default. A route replaces the corresponding inherited schema. Use schema: 'merge' on the guard when both must apply.
  • Register optional capabilities. File MIME validation needs a detector. WebSockets need elysia/websocket. Node needs @elysia/node and Node 22.18 or newer.
  • Always consult with an actual documentation for the latest features, examples, and references. The skill is a guide to the documentation, not a replacement.

For Elysia 1 use: https://elysiajs.com/llms.txt For Elysia 2 use: https://next.elysiajs.com/llms.txt

Minimal app and test

Use the project's test runner. This Bun example opens no port.

// src/app.ts
import { Elysia, t } from 'elysia'

export const app = new Elysia()
	.get('/users/:id', {
		params: t.Object({ id: t.Number() })
	}, ({ params }) => ({ id: params.id }))

export type App = typeof app
// test/app.test.ts
import { expect, test } from 'bun:test'
import { app } from '../src/app'

test('coerces the id and rejects nonnumeric input', async () => {
	const response = await app.handle('/users/42')
	expect(response.status).toBe(200)
	expect(await response.json()).toEqual({ id: 42 })
	expect((await app.handle('/users/nope')).status).toBe(422)
})

Run bun test and the project's type check. For new projects, see runtime setup. Keep .listen() in the process entry. See project structure.

Choose a reference

TaskRead
Versions, peer dependencies, source versus docsVersions
Configuration, routing, context, files, streamsCore API
Hooks, parsing, derived context, disposalLifecycle
Plugins, hook scope, guards, macrosComposition
Schemas, coercion, uploads, inferred typesValidation
Expected errors, exception mapping, production responsesErrors
Folders, services, models, dependency injectionProject structure
Cookie values, validation, signingCookies
WebSocket routesWebSockets
Route tests, type checks, lazy pluginsTesting
Typed client callsEden
OpenAPI schemas and documentationOpenAPI
Bun, Node, Deno, Workers, frontend framework integrationRuntimes
Bundles, AOT, binaries, Docker, deploymentDeployment
Traces, spans, request timingObservability
CORS, JWT, static files, cron, HTML, GraphQLOfficial plugins
Databases and external librariesDrizzle, Prisma, Better Auth, AI SDK, React Email
v1 syntax and migrationMigration
Find an example by patternPattern index

Defaults for a new project

Default to Bun and t schemas. Keep small apps in one file; split by feature as needed. Add Eden for typed clients and OpenAPI for API documentation.

FAQ

What does the elysiajs skill do?

Build, debug, or migrate Elysia v2 TypeScript backends with validation, plugins, typed clients, and deployment. Use for Elysia projects or explicit Elysia requests.

How do I install elysiajs?

Run npx skills add https://github.com/elysiajs/skills --skill elysiajs in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/elysiajs/ (personal) or .claude/skills/elysiajs/ (project).

Which AI agents can use elysiajs?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is elysiajs safe to install?

Security partners have reviewed it: Gen Agent Trust Hub passed; Socket passed; Snyk passed; Runlayer flagged items to review; ZeroLeaks passed. As with any skill, read the SKILL.md and bundled scripts before installing.

Who maintains elysiajs?

It is published by elysiajs in elysiajs/skills. It has 14,716 recorded installs.

Popular code quality & workflow skills

View category →
mattpocock avatar

grill-me

mattpocock/skills

A relentless interview to sharpen a plan or design.

Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.

mattpocock avatar

handoff

mattpocock/skills

Compact the current conversation into a handoff document for another agent to pick up.

mattpocock avatar

domain-modeling

mattpocock/skills

Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.

mattpocock avatar

codebase-design

mattpocock/skills

Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.

mattpocock avatar

diagnosing-bugs

mattpocock/skills

Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.