api-endpoint-scaffold

Scaffold new Next.js API endpoints with authentication, rate limiting, and tests. Use when creating new API routes, adding endpoints, or building API features.

16 stars

Best use case

api-endpoint-scaffold is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Scaffold new Next.js API endpoints with authentication, rate limiting, and tests. Use when creating new API routes, adding endpoints, or building API features.

Teams using api-endpoint-scaffold should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/api-endpoint-scaffold/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/backend/api-endpoint-scaffold/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/api-endpoint-scaffold/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How api-endpoint-scaffold Compares

Feature / Agentapi-endpoint-scaffoldStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Scaffold new Next.js API endpoints with authentication, rate limiting, and tests. Use when creating new API routes, adding endpoints, or building API features.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# API Endpoint Scaffold

Creates production-ready API endpoints following this repo's patterns.

## When to Use

- "Create an endpoint for..."
- "Add API route for..."
- "I need a POST/GET endpoint"
- "Build an API for {feature}"

## Prerequisites

Before creating an endpoint, confirm:

1. Endpoint path (e.g., `/api/users/profile`)
2. HTTP methods needed (GET, POST, PUT, DELETE)
3. Authentication required? (default: yes)
4. Rate limiting config (requests/window)
5. Request/response schema

## Procedure

### Step 1: Create Route File

Path: `apps/web/app/api/{path}/route.ts`

Use the template in [templates.md](./templates.md).

### Step 2: Add Rate Limiting (if needed)

Import from existing pattern:

```typescript
import { withUserRateLimit } from '../_lib/withUserRateLimit';
import { createRateLimiter } from '@acme/security';
```

### Step 3: Add Request Validation

Use Zod for schema validation:

```typescript
import { z } from 'zod';

const RequestSchema = z.object({
  field: z.string().min(1),
});
```

### Step 4: Create Integration Test

Path: `packages/tests/src/{feature}.test.ts`

See [templates.md](./templates.md) for test template.

### Step 5: Verify

Run these commands:

1. `pnpm typecheck` - Type check
2. `pnpm lint` - Lint check
3. `pnpm test:integration` - Run tests

## Checklist

- [ ] Route file created at correct path
- [ ] Authentication check using `getCurrentUser()`
- [ ] Rate limiting applied via `withUserRateLimit`
- [ ] Request validation with Zod
- [ ] Proper error responses (400, 401, 403, 429, 500)
- [ ] Integration test created
- [ ] TypeScript types pass
- [ ] ESLint passes

## Guardrails

- ALWAYS use `getCurrentUser()` from `@acme/auth` for auth
- ALWAYS apply rate limiting to user-facing endpoints
- NEVER expose internal errors to clients
- NEVER skip request validation
- If unsure about rate limit config, ask user

Related Skills

python-development-python-scaffold

16
from diegosouzapw/awesome-omni-skill

You are a Python project architecture expert specializing in scaffolding production-ready Python applications. Generate complete project structures with modern tooling (uv, FastAPI, Django), type hint

api-route-scaffold

16
from diegosouzapw/awesome-omni-skill

Create new Next.js API routes following project patterns. Use when user mentions "new endpoint", "add API", "create route", or "POST/GET handler".

api-integration-test-scaffolder

16
from diegosouzapw/awesome-omni-skill

Generates integration tests for frontend → backend → Genkit flow connections. Use when creating E2E API tests.

api-endpoint

16
from diegosouzapw/awesome-omni-skill

Create or modify API endpoints in IdeaForge backend. Triggers: new route, controller, service, repository, CRUD operation, Zod validation, API debugging. Pattern: Routes → Controller → Service → Repository.

api-endpoint-pattern

16
from diegosouzapw/awesome-omni-skill

Standards for creating and organizing HTTP API endpoints using the Echo framework

api-endpoint-generator

16
from diegosouzapw/awesome-omni-skill

Generates CRUD REST API endpoints with request validation, TypeScript types, consistent response formats, error handling, and documentation. Includes route handlers, validation schemas (Zod/Joi), typed responses, and usage examples. Use when building "REST API", "CRUD endpoints", "API routes", or "backend endpoints".

api-endpoint-design

16
from diegosouzapw/awesome-omni-skill

API endpoint design and testing for vehicle insurance data platform. Use when designing new API endpoints, testing existing ones, validating response formats, or debugging API issues. Covers 11 core endpoints including 3 new pie chart distribution endpoints, parameter validation, error handling, and integration patterns.

api-endpoint-creator

16
from diegosouzapw/awesome-omni-skill

Guides standardized REST API endpoint creation following team conventions. Use when creating new API endpoints.

api-endpoint-builder

16
from diegosouzapw/awesome-omni-skill

Build REST API endpoints when designing or implementing API routes with security best practices. Not for client-side fetching or non-API logic.

add-api-endpoint

16
from diegosouzapw/awesome-omni-skill

Create API layer components for a new entity. Includes usecase interactors (internal/usecase/), proto definitions (schema/proto/), gRPC handlers (internal/infrastructure/grpc/), and DI registration. Use when adding CRUD endpoints or Step 3 of CRUD workflow (after add-domain-entity).

Add Admin API Endpoint

16
from diegosouzapw/awesome-omni-skill

Add a new endpoint or endpoints to Ghost's Admin API at `ghost/api/admin/**`.

m365-agent-scaffolder

16
from diegosouzapw/awesome-omni-skill

Quickly scaffolds new Microsoft 365 Copilot declarative agent (M365 agent, copilot agent, agent, declarative copilot, copilot) projects using ATK CLI. Collects project information and creates the initial project structure. Use only when creating a new empty M365 Copilot agent project from scratch.