Skip to main content
skill CX Codex

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

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add OneWave-AI/claude-skills --skill api-endpoint-scaffolder -a claude-code
Open on GitHub

What 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/orders with Zod validation and a 201 response.
  • Add a GET handler in app/api/[resource]/route.ts following 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-code

2Manually: put the files in place

~/.claude/skills/api-endpoint-scaffolder/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/api-endpoint-scaffolder/

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

Similar skills

All skills for Backend and APIs →

From the same set185

The whole set →
ramping-rep-tracker ramping-rep-tracker sets 30, 60, 90, and 120-day ramp milestones for sales onboarding. Tracks weekly activity expectations and early risk indicators. CX Codex +1 323installs territory-planning-optimizer territory-planning-optimizer assigns sales accounts by revenue potential, geography, and relationships while calculating TAM/SAM and balancing workloads. CX Codex +1 320installs sports-podcast-outline-generator sports-podcast-outline-generator builds a sports podcast episode plan: segment timing, debate topics, listener questions and ad break slots. CX Codex +1 320installs post-game-press-conference-simulator post-game-press-conference-simulator generates realistic press conference interviews for coaches and athletes. Useful for sports stories, game dialogues, or covering wins, losses, controversies, and injuries. CX Codex +1 320installs error-boundary-creator error-boundary-creator sets up error boundaries, fallback UIs, and crash reporting for React and Next.js apps. Keeps uncaught component crashes from breaking the entire page. CX Codex +1 316installs docker-debugger The docker-debugger skill helps investigate container, Dockerfile, networking, and docker-compose problems. Use it when a build fails or a container behaves unexpectedly. CX Codex +1 314installs scout scout reads the running conversation and names the skill or subagent that fits the task, with a short plan for using them together. CX Codex +1 314installs test-coverage-improver test-coverage-improver — a skill that identifies coverage gaps and generates missing tests for critical code paths. CX Codex +1 312installs

Project sponsors

Companies that keep this analytics open