
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- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads elysiajs automatically when relevant.
- 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.
SKILL.md
The instructions your agent reads when the skill is triggered.
Elysia v2
Start here
- Inspect
package.json, the lockfile, runtime, and app structure. Keep existing versions and conventions unless the user requests a migration. - 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.
- Read only the references the task needs. Versions lists the source revision, package baselines, and verification limits.
- 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.onRequestruns 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.
nameandseeddeduplicate hooks. Plugin factories still execute on each call. - Return expected failures.
status()andproblem()send ordinary responses. A returnedErrorenters 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
UnwrapSchemaorUnwrapModels. TypeBox 1.x has no schema.static. Keep handlers inline and pass plain values to services. - Choose context lifetime.
decorateandstateare shared.deriveruns per request after validation, in thebeforeHandlequeue. - 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/nodeand 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
| Task | Read |
|---|---|
| Versions, peer dependencies, source versus docs | Versions |
| Configuration, routing, context, files, streams | Core API |
| Hooks, parsing, derived context, disposal | Lifecycle |
| Plugins, hook scope, guards, macros | Composition |
| Schemas, coercion, uploads, inferred types | Validation |
| Expected errors, exception mapping, production responses | Errors |
| Folders, services, models, dependency injection | Project structure |
| Cookie values, validation, signing | Cookies |
| WebSocket routes | WebSockets |
| Route tests, type checks, lazy plugins | Testing |
| Typed client calls | Eden |
| OpenAPI schemas and documentation | OpenAPI |
| Bun, Node, Deno, Workers, frontend framework integration | Runtimes |
| Bundles, AOT, binaries, Docker, deployment | Deployment |
| Traces, spans, request timing | Observability |
| CORS, JWT, static files, cron, HTML, GraphQL | Official plugins |
| Databases and external libraries | Drizzle, Prisma, Better Auth, AI SDK, React Email |
| v1 syntax and migration | Migration |
| Find an example by pattern | Pattern 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
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
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.
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.
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.