generating-rest-apis
Generate complete REST API implementations from OpenAPI specifications or database schemas. Use when generating RESTful API implementations. Trigger with phrases like "generate REST API", "create RESTful API", or "build REST endpoints".
Best use case
generating-rest-apis is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Generate complete REST API implementations from OpenAPI specifications or database schemas. Use when generating RESTful API implementations. Trigger with phrases like "generate REST API", "create RESTful API", or "build REST endpoints".
Teams using generating-rest-apis 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
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/generating-rest-apis/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How generating-rest-apis Compares
| Feature / Agent | generating-rest-apis | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Generate complete REST API implementations from OpenAPI specifications or database schemas. Use when generating RESTful API implementations. Trigger with phrases like "generate REST API", "create RESTful API", or "build REST endpoints".
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
# 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
| 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 documentationRelated Skills
versioning-apis
Implement API versioning with backward compatibility, deprecation notices, and migration paths. Use when managing API versions and backward compatibility. Trigger with phrases like "version the API", "manage API versions", or "handle API versioning".
generating-unit-tests
This skill enables Claude to automatically generate comprehensive unit tests from source code. It is triggered when the user requests unit tests, test cases, or test suites for specific files or code snippets. The skill supports multiple testing frameworks including Jest, pytest, JUnit, and others, intelligently detecting the appropriate framework or using one specified by the user. Use this skill when the user asks to "generate tests", "create unit tests", or uses the shortcut "gut" followed by a file path.
throttling-apis
Implement API throttling policies to protect backend services from overload. Use when controlling API request rates. Trigger with phrases like "throttle API", "control request rate", or "add throttling".
generating-test-reports
This skill generates comprehensive test reports with coverage metrics, trends, and stakeholder-friendly formats (HTML, PDF, JSON). It aggregates test results from various frameworks, calculates key metrics (coverage, pass rate, duration), and performs trend analysis. Use this skill when the user requests a test report, coverage analysis, failure analysis, or historical comparisons of test runs. Trigger terms include "test report", "coverage report", "testing trends", "failure analysis", and "historical test data".
generating-test-doubles
This skill uses the test-doubles-generator plugin to automatically create mocks, stubs, spies, and fakes for unit testing. It analyzes dependencies in the code and generates appropriate test doubles based on the chosen testing framework, such as Jest, Sinon, or others. Use this skill when you need to generate test doubles, mocks, stubs, spies, or fakes to isolate units of code during testing. Trigger this skill by requesting test double generation or using the `/gen-doubles` or `/gd` command.
generating-test-data
This skill enables Claude to generate realistic test data for software development. It uses the test-data-generator plugin to create users, products, orders, and custom schemas for comprehensive testing. Use this skill when you need to populate databases, simulate user behavior, or create fixtures for automated tests. Trigger phrases include "generate test data", "create fake users", "populate database", "generate product data", "create test orders", or "generate data based on schema". This skill is especially useful for populating testing environments or creating sample data for demonstrations.
generating-stored-procedures
This skill uses the stored-procedure-generator plugin to create production-ready stored procedures, functions, triggers, and custom database logic. It supports PostgreSQL, MySQL, and SQL Server. Use this skill when the user asks to "generate stored procedure", "create database function", "write a trigger", or needs help with "database logic", "optimizing database performance", or "ensuring transaction safety" in their database. The skill is activated by requests related to database stored procedures, functions, or triggers.
rest-endpoint-designer
Rest Endpoint Designer - Auto-activating skill for API Development. Triggers on: rest endpoint designer, rest endpoint designer Part of the API Development skill category.
rate-limiting-apis
Implement sophisticated rate limiting with sliding windows, token buckets, and quotas. Use when protecting APIs from excessive requests. Trigger with phrases like "add rate limiting", "limit API requests", or "implement rate limits".
generating-orm-code
This skill enables Claude to generate ORM models and database schemas. It is triggered when the user requests the creation of ORM models, database schemas, or wishes to generate code for interacting with databases. The skill supports various ORMs including TypeORM, Prisma, Sequelize, SQLAlchemy, Django ORM, Entity Framework, and Hibernate. Use this skill when the user mentions terms like "ORM model", "database schema", "generate entities", "create migrations", or specifies a particular ORM framework like "TypeORM entities" or "SQLAlchemy models". It facilitates both database-to-code and code-to-database schema generation.
monitoring-apis
Build real-time API monitoring dashboards with metrics, alerts, and health checks. Use when tracking API health and performance metrics. Trigger with phrases like "monitor the API", "add API metrics", or "setup API monitoring".
mocking-apis
Generate mock API servers for testing and development with realistic response data. Use when creating mock APIs for development and testing. Trigger with phrases like "create mock API", "generate API mock", or "setup mock server".