api-endpoint-scaffolder — Claude Code skill: what it does
api-endpoint-scaffolder — a skill that scaffolds REST endpoints from templates for Next.js App Router and Express: Zod schemas, status codes, error handling.
MIT 317 installs ★ 440 updated 2026-10-20
npx skills add OneWave-AI/claude-skills --skill api-endpoint-scaffolder -a claude-codeWhat api-endpoint-scaffolder does
The skill pairs a short checklist with ready-made code. The agent names the framework, picks the HTTP method, writes request and response types, then implements. Those four steps come from the instructions.
Two templates ship inside: a Next.js App Router handler at app/api/[resource]/route.ts and an Express router. Both are TypeScript, both import zod to check the request body. In the Next.js file a ZodError becomes a 400 with error details, anything else a 500. A status-code table runs from 200 to 500, and the best-practices list reminds about rate limiting and OpenAPI docs.
Templates assume TypeScript and zod. On plain JavaScript, or with Yup doing validation, the scaffold needs rewriting before the agent pastes it in.
What it helps with
- create a POST route with Zod body validation
- map responses to the right status codes
- add error handling to an Express router
- declare request and response types before coding
- put rate limiting on a public endpoint
Example prompts for the agent
- Scaffold
POST /api/orderswith Zod validation and a 201 response. - Add a GET handler in
app/api/[resource]/route.tsfollowing the skill's template. - Rewrite this Express router with a Zod schema and
next(error)in the catch block.
How to install api-endpoint-scaffolder
1Skills CLI (Vercel)
npx skills add OneWave-AI/claude-skills --skill api-endpoint-scaffolder -a claude-code2Manually: put the files in place
~/.claude/skills/api-endpoint-scaffolder/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/api-endpoint-scaffolder/
1Skills CLI (Vercel)
npx skills add OneWave-AI/claude-skills --skill api-endpoint-scaffolder -a codex2Manually: put the files in place
.agents/skills/api-endpoint-scaffolder/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add OneWave-AI/claude-skills --skill api-endpoint-scaffolder -a cursor2Manually: put the files in place
.cursor/skills/api-endpoint-scaffolder/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install OneWave-AI/claude-skills api-endpoint-scaffolder2Manually: put the files in place
.github/skills/api-endpoint-scaffolder/SKILL.md1Skills CLI (Vercel)
npx skills add OneWave-AI/claude-skills --skill api-endpoint-scaffolder -a gemini-cli2Platform CLI
gemini skills install https://github.com/OneWave-AI/claude-skills --path api-endpoint-scaffolderManually: put the files in place
.devin/skills/api-endpoint-scaffolder/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add OneWave-AI/claude-skills --skill api-endpoint-scaffolder -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about api-endpoint-scaffolder
How to install api-endpoint-scaffolder in Claude Code?
Run npx skills add OneWave-AI/claude-skills --skill api-endpoint-scaffolder -a claude-code. The skill lands at ~/.claude/skills/api-endpoint-scaffolder/SKILL.md.
What does api-endpoint-scaffolder do?
It walks the agent through building a REST endpoint: framework and method first, then types, validation and error responses.
Which frameworks are covered?
Code templates exist for Next.js App Router and Express. The instructions tell the agent to identify the framework first, with Express, Next.js and FastAPI named as examples.
Source text
SKILL.md · MIT
---
name: api-endpoint-scaffolder
description: Generate REST API endpoints with proper structure, validation, error handling, and types. Use when creating new API routes, endpoints, or backend services.
---
# API Endpoint Scaffolder
## Instructions
When creating a new API endpoint:
1. **Identify the framework** (Express, Next.js, FastAPI, etc.)
2. **Determine HTTP method** (GET, POST, PUT, PATCH, DELETE)
3. **Define request/response types**
4. **Implement with best practices**
## Templates
### Next.js App Router (TypeScript)
```typescript
// app/api/[resource]/route.ts
import { NextRequest, NextResponse } from 'next/server';
import { z } from 'zod';
const RequestSchema = z.object({
// Define your schema
});
export async function GET(request: NextRequest) {
try {
const { searchParams } = new URL(request.url);
// Implementation
return NextResponse.json({ data }, { status: 200 });
} catch (error) {
console.error('[API] Error:', error);
return NextResponse.json(
{ error: 'Internal server error' },
{ status: 500 }
);
}
}
export async function POST(request: NextRequest) {
try {
const body = await request.json();
const validated = RequestSchema.parse(body);
// Implementation
return NextResponse.json({ data }, { status: 201 });
} catch (error) {
if (error instanceof z.ZodError) {
return NextResponse.json(
{ error: 'Validation failed', details: error.errors },
{ status: 400 }
);
}
return NextResponse.json(
{ error: 'Internal server error' },
{ status: 500 }
);
}
}
```
### Express (TypeScript)
```typescript
import { Router, Request, Response, NextFunction } from 'express';
import { z } from 'zod';
const router = Router();
const CreateSchema = z.object({
// Define schema
});
router.post('/', async (req: Request, res: Response, next: NextFunction) => {
try {
const data = CreateSchema.parse(req.body);
// Implementation
res.status(201).json({ success: true, data });
} catch (error) {
next(error);
}
});
export default router;
```
## Best Practices
1. **Always validate input** using Zod, Yup, or similar
2. **Use proper HTTP status codes**:
- 200: Success
- 201: Created
- 400: Bad Request
- 401: Unauthorized
- 403: Forbidden
- 404: Not Found
- 500: Server Error
3. **Log errors** but don't expose internals to clients
4. **Use consistent response format**
5. **Add rate limiting** for public endpoints
6. **Document with OpenAPI/Swagger** when possible
© OneWave-AI · MIT · OneWave-AI/claude-skills