GE

generating-rest-apis

Automates scaffolding of RESTful APIs from existing OpenAPI specifications or database schemas.

Install

mkdir -p .claude/skills/generating-rest-apis && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/8355" && unzip -o skill.zip -d .claude/skills/generating-rest-apis && rm skill.zip

Installs to .claude/skills/generating-rest-apis

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Generate complete REST API implementations from OpenAPI specifications
70 charsno explicit “when” trigger
Advanced

Key capabilities

  • Scaffold CRUD endpoints for resources
  • Generate model definitions with validation and relationships
  • Implement controller logic with input validation
  • Add query parameter support for filtering and pagination
  • Wire authentication middleware to protect mutation endpoints
  • Generate standardized error response envelopes

How it works

The skill parses resource definitions to generate complete REST API implementations, including CRUD endpoints, model definitions, validation, and error handling across various backend frameworks.

Inputs & outputs

You give it
OpenAPI specification, database schema, or resource definitions
You get back
Generated route files, controller logic, ORM models, middleware, OpenAPI specification, and integration tests

When to use generating-rest-apis

  • Scaffolding CRUD endpoints
  • Converting OpenAPI specs to API code
  • Generating route files from database models
  • Implementing standard REST patterns

About this skill

Generating REST APIs

Overview

Generate complete, production-ready REST API implementations from OpenAPI specifications, database schemas, or resource definitions. Scaffold CRUD endpoints with proper HTTP method semantics, content negotiation, pagination, filtering, and HATEOAS link generation across Express, FastAPI, Spring Boot, and Gin frameworks.

Prerequisites

  • Node.js 18+ with Express/Fastify, or Python 3.10+ with FastAPI/Flask, or Java 17+ with Spring Boot, or Go 1.21+ with Gin/Echo
  • OpenAPI 3.0+ specification or database schema (SQL DDL, Prisma, Sequelize models)
  • HTTP testing tool: curl, httpie, or Postman
  • Database server (PostgreSQL, MySQL, MongoDB) accessible for ORM integration
  • Package manager configured (npm, pip, Maven, or go modules)

Instructions

  1. Scan the project for existing OpenAPI specs, database models, or route definitions using Glob and Read to establish current API surface area.
  2. Parse resource entities from the specification and generate model definitions with field types, validation constraints, and relationship mappings.
  3. Create route files implementing all five standard REST operations per resource: GET /resources (list with pagination), GET /resources/:id, POST /resources, PUT /resources/:id, and DELETE /resources/:id.
  4. Implement controller logic with input validation using JSON Schema or framework-native validators (Zod, Pydantic, Bean Validation).
  5. Add query parameter support for filtering (?status=active), sorting (?sort=-created_at), field selection (?fields=id,name), and cursor-based or offset pagination.
  6. Wire authentication middleware to protect mutation endpoints (POST, PUT, DELETE) while allowing read access per configuration.
  7. Generate standardized error response envelopes with RFC 7807 Problem Details format for all 4xx/5xx responses.
  8. Create integration tests covering happy paths, validation failures, 404s, and auth rejection for every endpoint.
  9. Produce or update the OpenAPI 3.0 specification to match the generated implementation.

See ${CLAUDE_SKILL_DIR}/references/implementation.md for the full step-by-step implementation guide.

Output

  • ${CLAUDE_SKILL_DIR}/src/routes/ - Express/Fastify route definitions with HTTP method handlers
  • ${CLAUDE_SKILL_DIR}/src/controllers/ - Business logic separated from routing
  • ${CLAUDE_SKILL_DIR}/src/models/ - ORM models with validation rules and relationships
  • ${CLAUDE_SKILL_DIR}/src/middleware/auth.js - JWT/API key authentication middleware
  • ${CLAUDE_SKILL_DIR}/src/middleware/validate.js - Request schema validation middleware
  • ${CLAUDE_SKILL_DIR}/openapi.yaml - Generated OpenAPI 3.0 specification
  • ${CLAUDE_SKILL_DIR}/tests/ - Integration test suite per resource endpoint

Error Handling

ErrorCauseSolution
400 Bad RequestRequest body fails schema validationReturn field-level validation errors with JSON pointer paths to invalid fields
401 UnauthorizedMissing or malformed Authorization headerRespond with WWW-Authenticate header indicating expected auth scheme
404 Not FoundResource ID does not exist in data storeReturn RFC 7807 body with resource type and requested ID for debugging
409 ConflictUnique constraint violation on create/updateInclude conflicting field name and existing value hint in error response
429 Too Many RequestsClient exceeds rate limitReturn Retry-After header with seconds until next allowed request window

Refer to ${CLAUDE_SKILL_DIR}/references/errors.md for comprehensive error patterns.

Examples

E-commerce product API: Generate CRUD endpoints for a Product resource with nested Category relationships, image upload handling, and inventory tracking fields with optimistic concurrency via ETags.

Multi-tenant SaaS API: Scaffold tenant-scoped endpoints where all queries automatically filter by tenant_id extracted from JWT claims, with tenant isolation enforced at the middleware layer.

Public read API with admin writes: Create a dual-access API where GET endpoints are publicly cacheable (Cache-Control headers) while POST/PUT/DELETE require admin-role JWT tokens.

See ${CLAUDE_SKILL_DIR}/references/examples.md for additional examples.

Resources

  • OpenAPI Specification 3.1: https://spec.openapis.org/oas/v3.1.0
  • RFC 7807 Problem Details for HTTP APIs
  • JSON:API Specification for standardized response formatting
  • Express.js, FastAPI, Spring Boot, and Gin framework documentation

Prerequisites

Node.js 18+ with Express/Fastify, or Python 3.10+ with FastAPI/Flask, or Java 17+ with Spring Boot, or Go 1.21+ with Gin/EchoOpenAPI 3.0+ specification or database schema (SQL DDL, Prisma, Sequelize models)HTTP testing tool: curl, httpie, or PostmanDatabase server (PostgreSQL, MySQL, MongoDB) accessible for ORM integration

How it compares

This skill automates the creation of a full REST API implementation from a specification, providing a structured and standardized output with built-in features like pagination, filtering, and error handling, unlike manual API development.

Compared to similar skills

generating-rest-apis side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
generating-rest-apis (this skill)027dReviewAdvanced
slack-bot-builder16moReviewIntermediate
catalyst-sdk01moNo flagsBeginner
managing-api-cache227dReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

You might also like

slack-bot-builder

davila7

Build Slack apps using the Bolt framework across Python, JavaScript, and Java. Covers Block Kit for rich UIs, interactive components, slash commands, event handling, OAuth installation flows, and Workflow Builder integration. Focus on best practices for production-ready Slack apps. Use when: slack bot, slack app, bolt framework, block kit, slash command.

11

catalyst-sdk

catalystbyzoho

Catalyst SDKs — initialization patterns, service access, and method reference for Node.js, Web (browser), Python, Java, Android, iOS, and Flutter. Trigger on 'SDK', 'zcatalyst-sdk-node', 'Node.js SDK', 'Web SDK', 'Python SDK', 'Java SDK', 'Android SDK', 'iOS SDK', 'Flutter SDK', or 'initialize SDK'.

00

managing-api-cache

jeremylongshore

Implement intelligent API response caching with Redis, Memcached, and CDN integration. Use when optimizing API performance with caching. Trigger with phrases like "add caching", "optimize API performance", or "implement cache layer".

220

migrate-backend-to-dts

Azure-Samples

Migrate existing Azure Durable Functions apps from existing backend storage providers (Azure Storage, Netherite, MSSQL) to the Durable Task Scheduler. Use when switching backends, converting to azureManaged storage provider, upgrading from Azure Storage default provider, migrating from Netherite Eve

00

backend-bugfix

u1219437219-cmyk

Investigate and fix backend bugs involving APIs, data flow, jobs, logs, or intermittent server behavior.

00

telegram-bot-builder

davila7

Expert in building Telegram bots that solve real problems - from simple automation to complex AI-powered bots. Covers bot architecture, the Telegram Bot API, user experience, monetization strategies, and scaling bots to thousands of users. Use when: telegram bot, bot api, telegram automation, chat bot telegram, tg bot.

106130

Search skills

Search the agent skills registry