generate-api

Solid

Generate API implementations from contracts — route definitions, handler skeletons, request/response schemas, and error types. Use when the user asks to implement an API endpoint or service with a framework, after an API contract already exists from api-design.

API & Backend 0 stars 0 forks Updated today MIT

Install

View on GitHub

Quality Score: 78/100

Stars 20%
0
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Generate-API (API 实现生成) Generate API implementations (route handlers, schemas, errors) from a pre-existing contract. ## When to Use - "Generate an Express.js endpoint for creating a user" - "Implement the API from the OpenAPI spec" - "Create route handlers for the user service" - "Build a RESTful API from the api-design contract" ## When Not to Use - Designing the API contract (endpoints, methods, data model) → route to api-design first - Designing the database schema behind the API → route to database-design - Full-stack scaffolding without a contract → route to api-design first, then return here ## Procedure 0. **Prerequisite check** — verify an API contract exists (from api-design skill output). If not, route to api-design first and stop. Do not generate implementation without a contract. 1. **Parse the contract** — extract endpoints, HTTP methods, path parameters, request/response schemas from the api-design output or OpenAPI spec. 2. **Generate route definitions** — map each endpoint to a route registration file (e.g., `routes/users.ts`). 3. **Generate handler skeletons** — create handler functions for each route, with typed parameters. 4. **Generate schema types** — create request/response TypeScript interfaces or type definitions, derived from the contract. 5. **Generate error types** — create custom error classes or error response types for documented error codes. ## Pitfalls - **Skipping prerequisite check**: Generating implementation without a contract pr...

Details

Author
AVA-2568
Repository
AVA-2568/MY_SKILL
Created
2 days ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category