elysia-patterns
Use this skill when implementing Elysia.js patterns — Eden Treaty client, WebSocket handlers, auth/guard macros, custom plugins, performance optimization, and…
Skill by j4flmao
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/j4flmao-elysia-patterns
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: backend, security
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 26, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/elysia-patterns
What's inside
- Skill name
elysia-patterns- Description
- Use this skill when implementing Elysia.js patterns — Eden Treaty client, WebSocket handlers, auth/guard macros, custom plugins, performance optimization, and type-safe validation. This skill enforces: type-safe client-server communication, macro-based guards, schema-first validation. Requires Bun (bun create elysia). Do NOT use for: Express middleware patterns, Node.js streams, or non-Elysia frameworks.
- License
- MIT
- Instructions
- 500 lines in SKILL.md · view on GitHub
Agent Skills spec issues
- name: "elysia-patterns" does not match folder "patterns"
- compatibility: must be text of at most 500 characters
Files (7)
- SKILL.md
- eden-treaty.md · references/
- elysia-auth.md · references/
- elysia-performance.md · references/
- elysia-plugins.md · references/
- elysia-validation.md · references/
- elysia-websocket.md · references/
SKILL.md (first lines)
# Elysia Patterns
## Purpose
Implement Elysia.js-specific patterns — Eden Treaty type-safe client, WebSocket with Bun, macro-based guards, custom plugins, and validation patterns.
## Agent Protocol
### Trigger
User request includes: `elysia pattern`, `elysia eden treaty`, `elysia websocket`, `elysia plugin`, `elysia macro`, `elysia validation`, `elysia type safe`.
### Input Context
- Elysia version and plugin set
- Server-side patterns needed (auth, middleware, validation)
- Client-side (React, Svelte, Vue) for Eden Treaty
### Output Artifact
Code examples for the requested patterns — plugin, macro, WebSocket handler, Eden client.
### Response Format
Code-first: pattern name, problem, implementation. Compress output.
### Completion Criteria
- Pattern implemented with type safety
- Schema validation applied
- Error handling included
- Test example provided
### Max Response Length
4096 tokens
## Architecture Decision Trees
### Eden Treaty vs tRPC vs REST+OpenAPI
| Criterion | Eden Treaty | tRPC | REST+OpenAPI |
|-----------|-------------|------|--------------|
| Backend | Elysia only | TypeScript servers (Node, Bun, Deno, edge adapters) | Any |
| Type safety | Full-stack inference | Full-stack inference | Generated client |
| Setup | Single `typeof app` | Manual procedure defs | External tooling |
| File upload | Declarative | Manual | Multipart |
| Websocket | Via plugin | Via subscription | Separate |
| Flexibility | Elysia-native | tRPC server | Any HTTP |
Decision: Elysia backend + any frontend → Eden Treaty. tRPC backend → tRPC fits better. Multi-language clients → REST+OpenAPI.
### Macro vs Middleware vs Plugin
| Pattern | Scope | Use Case |
|---------|-------|----------|
| Macro (`.macro()`, enabled per route or `guard`) | Route-level | Auth check, permission guard |
| Middleware (`onRequest`, `beforeHandle`) | Global or group | Logging, CORS, rate limit |
| Plugin (`new Elysia({name})`) | Modular feature | User module, auth module |
Decision: Reusable route modifier → Macro. Cross-cutting concern → Middleware. Standalone feature → Plugin.
## Workflow
### Step 1: Eden Treaty Full-Stack Setup
```typescript
// server/src/app.ts — EXPORT TYPE
import { Elysia } from 'elysia'
import { userModule } from './modules/users'
export const app = new Elysia()
.use(userModule)
.get('/health', () => ({ status: 'ok' }))
export type App = typeof app
// client/src/api.ts
import { treaty } from '@elysiajs/eden' // Eden Treaty 2
import type { App } from '../../server/src/app'
export const client = treaty<App>('localhost:3000', {
headers: () => ({
authorization: `Bearer ${localStorage.getItem('token')}`,
}),
})
// Usage (e.g. inside a data-fetching hook)
export async function loadUser(id: string) {
const { data, error } = await client.users({ id }).get()
if (error) throw new Error(`Failed to load user ${id}: HTTP ${error.status}`)
return data
}
```
### Step 2: WebSocket Pattern
```typescript
// src/plugins/realtime.ts — WebSocket support is built into Elysia (Bun's uWebSockets), no plugin needed
import { Elysia, t } from 'elysia'
export const realtimePlugin = new Elysia({ name: 'realtime' })
.ws('/ws/orders/:orderId', {
body: t.Object({
type: t.String(),
payload: t.Any(),
}),
async open(ws) {
ws.subscribe(`order:${ws.data.params.orderId}`)
ws.send({ type: 'connected', payload: { orderId: ws.data.params.orderId } })
},
async message(ws, message) {
// Broadcast to all subscribers of this order
ws.publish(`order:${ws.data.params.orderId}`, message)
},
async close(ws) {
ws.unsubscribe(`order:${ws.data.params.orderId}`)
},
})
// Emit from service code (app = the listening Elysia instance)
function notifyOrderStatus(orderId: string, status: string) {
app.server?.publish(`order:${orderId}`, JSON.stringify({
type: 'status_update',
payload: { orderId, status },
}))From j4flmao/agent-skills, MIT.
More from j4flmao/agent-skills
- 0.610score
dotnet-patterns
j4flmao
Use this skill when implementing .NET patterns — MediatR pipelines, CQRS, Result pattern, EF Core patterns, pipeline behaviors, and event sourcing.
SkillBFreshness: B★ 34Claude Code +9 - 0.607score
llm-finetuning
j4flmao
Best practices for dataset preparation and PEFT/LoRA fine-tuning.
SkillBFreshness: B★ 34Claude Code +9 - 0.607score
genai-vision
j4flmao
Integrating Stable Diffusion for vision generation and Whisper for audio/multimodal tasks.
SkillBFreshness: B★ 34Claude Code +9 - 0.605score
bun
j4flmao
Use this skill when building with Bun runtime — Bun APIs, testing, package management, shell scripting, hot reload, SQLite, file I/O.
SkillBFreshness: B★ 34Claude Code +9 - 0.605score
elixir
j4flmao
Use this skill when building with Elixir — Phoenix framework, OTP, BEAM, LiveView, Ecto, supervision trees.
SkillBFreshness: B★ 34Claude Code +9 - 0.605score
deno
j4flmao
Use this skill when building with Deno — TypeScript runtime, Deno Deploy, Fresh framework, Deno std library.
SkillBFreshness: B★ 34Claude Code +9 - 0.605score
micronaut
j4flmao
Use this skill when building Micronaut applications — compile-time DI, reactive HTTP server, AOT optimization, GraalVM native image.
SkillBFreshness: B★ 34Claude Code +9 - 0.601score
kotlin-architecture
j4flmao
Use this skill when designing Kotlin backend architecture — Ktor, Spring WebFlux, http4k.
SkillBFreshness: B★ 34Claude Code +9 - 0.601score
nestjs-patterns
j4flmao
Use this skill when implementing NestJS patterns — CQRS with @nestjs/cqrs, guards/interceptors/pipes/filters, event sourcing, custom decorators…
SkillBFreshness: B★ 34Claude Code +9 - 0.601score
kotlin-backend-patterns
j4flmao
Use this skill when implementing Kotlin backend patterns — repository pattern, service layer, DTO mapping, DI setup (Koin, Kodein), testing with MockK, and…
SkillBFreshness: B★ 34Claude Code +9 - 0.601score
nestjs-architecture
j4flmao
Use this skill when structuring NestJS applications — module-based architecture, dependency injection, provider scopes, dynamic modules, and monorepo structure.
SkillBFreshness: B★ 34Claude Code +9 - 0.601score
nodejs-architecture
j4flmao
Use this skill when designing Node.js backend architecture — Express, Fastify, Hono.
SkillBFreshness: B★ 34Claude Code +9
Signals
- Stars
- 34
- Forks
- 4
- Open issues
- 0
- Last commit (this folder)
- Aug 15, 2026 (2 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/j4flmao/agent-skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from j4flmao
- 0.610score
dotnet-patterns
j4flmao
Use this skill when implementing .NET patterns — MediatR pipelines, CQRS, Result pattern, EF Core patterns, pipeline behaviors, and event sourcing.
SkillBFreshness: B★ 34Claude Code +9 - 0.607score
llm-finetuning
j4flmao
Best practices for dataset preparation and PEFT/LoRA fine-tuning.
SkillBFreshness: B★ 34Claude Code +9 - 0.607score
genai-vision
j4flmao
Integrating Stable Diffusion for vision generation and Whisper for audio/multimodal tasks.
SkillBFreshness: B★ 34Claude Code +9 - 0.605score
deno
j4flmao
Use this skill when building with Deno — TypeScript runtime, Deno Deploy, Fresh framework, Deno std library.
SkillBFreshness: B★ 34Claude Code +9 - 0.605score
bun
j4flmao
Use this skill when building with Bun runtime — Bun APIs, testing, package management, shell scripting, hot reload, SQLite, file I/O.
SkillBFreshness: B★ 34Claude Code +9 - 0.605score
elixir
j4flmao
Use this skill when building with Elixir — Phoenix framework, OTP, BEAM, LiveView, Ecto, supervision trees.
SkillBFreshness: B★ 34Claude Code +9
Cite this page
elysia-patterns skill. Agent Mart. https://agentmart.dev/skills/j4flmao-elysia-patterns (last updated 2026-10-24)