api-routes
Generate secure TanStack Start API routes with authentication, rate limiting, validation, and proper error handling. Use when creating API endpoints, REST resources, or backend logic.
npx skills add majiayu000/claude-skill-registry --skill api-routes --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# API Route Generator Create production-ready API endpoints following this project's security-first patterns. ## Quick Start Template ```typescript import { createFileRoute } from '@tanstack/react-router' import { eq } from 'drizzle-orm' import { db } from '@/db' import { tableName } from '@/db/schema' import { errorResponse, requireAuth, simpleErrorResponse, successResponse, } from '@/lib/api' import { checkRateLimit } from '@/lib/rate-limit' export const Route = createFileRoute('/api/resource')({ server: { handlers: { GET: async ({ request }) => { try { // 1. Rate limiting const rateLimit = await checkRateLimit(request, 'api') if (!rateLimit.allowed) { return new Response( JSON.stringify({ error: 'Too many requests' }), { status: 429, headers: { 'Retry-After': String(rateLimit.retryAfter) }, }, ) } // 2. Authentication const auth = await requireAuth(request) if (!auth.success) return auth.response // 3. Business logic const items = await db.select().from(tableName) // 4. Success response return successResponse({ items }) } catch (error) { return errorResponse('Failed to fetch', error) } }, }, }, }) ``` ## Authentication Patterns ### User Authentication (any logged-in user) ```typ
- Quick Start Template
- Authentication Patterns
- User Authentication (any logged-in user)
- Admin Authentication
- Optional Authentication (public with user context)
- Response Helpers
- Input Validation
- Required Fields
- Localized String Validation
- URL Parameter Validation
- CRUD Operations
- List with Pagination, Filtering, Sorting
- Create with Transaction
- Update (PATCH)
What does the api-routes skill do?
Generate secure TanStack Start API routes with authentication, rate limiting, validation, and proper error handling. Use when creating API endpoints, REST resources, or backend logic.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill api-routes --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
