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.
Об этом скилле
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:
- Endpoint path (e.g.,
/api/users/profile) - HTTP methods needed (GET, POST, PUT, DELETE)
- Authentication required? (default: yes)
- Rate limiting config (requests/window)
- Request/response schema
Procedure
Step 1: Create Route File
Path: apps/web/app/api/{path}/route.ts
Use the template in templates.md.
Step 2: Add Rate Limiting (if needed)
Import from existing pattern:
import { createRateLimiter } from '@acme/security';
import { withRateLimit } from '../_lib/withRateLimit';
Step 3: Add Request Validation
Use Zod for schema validation:
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 for test template.
Step 5: Verify
Run these commands:
pnpm typecheck- Type checkpnpm lint- Lint checkpnpm test:integration- Run tests
Checklist
- Route file created at correct path
- Authentication check using
getCurrentUser()inside the handler - Rate limiting applied via
withRateLimit - 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/authfor auth inside the handler function - ALWAYS apply rate limiting to user-facing endpoints via
withRateLimit - NEVER expose internal errors to clients
- NEVER skip request validation
- If unsure about rate limit config, ask user
Установить api-endpoint-scaffold в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGrepGlobWriteEditВложенные файлы
FAQ
Что делает скилл 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.
Как установить скилл api-endpoint-scaffold?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл api-endpoint-scaffold запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic