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.zipInstalls 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 specificationsKey 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
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
- Scan the project for existing OpenAPI specs, database models, or route definitions using Glob and Read to establish current API surface area.
- Parse resource entities from the specification and generate model definitions with field types, validation constraints, and relationship mappings.
- Create route files implementing all five standard REST operations per resource:
GET /resources(list with pagination),GET /resources/:id,POST /resources,PUT /resources/:id, andDELETE /resources/:id. - Implement controller logic with input validation using JSON Schema or framework-native validators (Zod, Pydantic, Bean Validation).
- Add query parameter support for filtering (
?status=active), sorting (?sort=-created_at), field selection (?fields=id,name), and cursor-based or offset pagination. - Wire authentication middleware to protect mutation endpoints (POST, PUT, DELETE) while allowing read access per configuration.
- Generate standardized error response envelopes with RFC 7807 Problem Details format for all 4xx/5xx responses.
- Create integration tests covering happy paths, validation failures, 404s, and auth rejection for every endpoint.
- 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
| Error | Cause | Solution |
|---|---|---|
| 400 Bad Request | Request body fails schema validation | Return field-level validation errors with JSON pointer paths to invalid fields |
| 401 Unauthorized | Missing or malformed Authorization header | Respond with WWW-Authenticate header indicating expected auth scheme |
| 404 Not Found | Resource ID does not exist in data store | Return RFC 7807 body with resource type and requested ID for debugging |
| 409 Conflict | Unique constraint violation on create/update | Include conflicting field name and existing value hint in error response |
| 429 Too Many Requests | Client exceeds rate limit | Return 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
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.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| generating-rest-apis (this skill) | 0 | 25d | Review | Advanced |
| slack-bot-builder | 1 | 6mo | Review | Intermediate |
| catalyst-sdk | 0 | 1mo | No flags | Beginner |
| managing-api-cache | 2 | 25d | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by jeremylongshore
View all by jeremylongshore →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.
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'.
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".
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
backend-bugfix
u1219437219-cmyk
Investigate and fix backend bugs involving APIs, data flow, jobs, logs, or intermittent server behavior.
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.