Agent Skills: api-development

Use when creating or modifying Elysia API routes. Ensures proper validation with t schema, auth guards, error handling, and performance patterns.

UncategorizedID: programming-in-th/programming.in.th/api-development

Install this agent skill to your local

pnpm dlx add-skill https://github.com/programming-in-th/programming.in.th/tree/HEAD/.claude/skills/api-development

Skill Files

Browse the full folder contents for api-development.

Download Skill

Loading file tree…

.claude/skills/api-development/SKILL.md

Skill Metadata

Name
api-development
Description
Use when creating or modifying Elysia API routes. Ensures proper validation with t schema, auth guards, error handling, and performance patterns.

See API patterns for full reference.

Quick example:

import { Elysia, t } from 'elysia'
import { prisma } from '@/lib/prisma'

new Elysia()
  .get('/tasks/:id', async ({ params, status }) => {
    const task = await prisma.task.findUnique({
      where: { id: params.id },
      select: { id: true, title: true }
    })
    if (!task) return status(404, { error: 'Not found' })
    return task
  }, {
    params: t.Object({ id: t.String() })
  })

Checklist: t.Object validation, auth guards, selective Prisma fields, pagination, proper status codes.