This scaffolds REST API endpoints with validation, error handling, and proper TypeScript types baked in. You get templates for Next.js App Router and Express that include Zod schema validation, appropriate HTTP status codes, and structured error responses. It's opinionated about the basics like logging errors without exposing internals and using consistent response formats. If you're tired of writing the same boilerplate every time you add a new route, or you want your team's endpoints to follow the same patterns, this gives you a solid starting structure. The templates are practical starting points, not production-ready code, but they handle the tedious parts correctly.
npx -y skills add onewave-ai/claude-skills --skill api-endpoint-scaffolder --agent claude-codeInstalls into .claude/skills of the current project.
When creating a new API endpoint:
// 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 }
);
}
}
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;
prisma/skills
firebase/agent-skills
Dexploarer/hyper-forge
itsmostafa/aws-agent-skills
prisma/skills