en un clic
api-design
Design API contracts with OpenAPI specifications
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Menu
Design API contracts with OpenAPI specifications
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Basé sur la classification professionnelle SOC
Create Architecture Decision Record
Assess architecture decisions tradeoffs and edge cases
Design database schemas with migrations and repository interfaces
Break requests into parallel tasks for team execution
Audit dependencies for vulnerabilities and plan upgrades
Structured incident investigation and resolution
| name | api-design |
| description | Design API contracts with OpenAPI specifications |
| allowed-tools | Read, Write, Glob, Grep |
Interactive workflow for designing API contracts. Produces OpenAPI 3.1 specifications and optionally generates typed client code.
Analyze the feature requirements to identify:
Output: Resource inventory table with relationships.
For each resource, design the URL following .claude/rules/api-design.md:
GET /api/v1/{resources} # List (paginated)
POST /api/v1/{resources} # Create
GET /api/v1/{resources}/{id} # Get by ID
PUT /api/v1/{resources}/{id} # Full update
PATCH /api/v1/{resources}/{id} # Partial update
DELETE /api/v1/{resources}/{id} # Delete
For nested resources: /api/v1/{parent}/{parentId}/{children}
For actions: POST /api/v1/{resources}/{id}/{action}
Output: Complete URL structure table with HTTP methods and descriptions.
For each endpoint, define:
Rules:
snake_case in JSON2024-01-15T10:30:00Z)tenant_id in response (from server context, never from request)Output: Schema definitions for all request/response types.
For each endpoint, define error responses using RFC 7807 Problem Details:
Output: Error catalog with types, status codes, and example responses.
Generate a complete OpenAPI 3.1 YAML specification file including:
Write to: docs/spec/api/openapi.yaml (or feature-specific file)
If requested, generate typed client interfaces:
TypeScript:
// Generated from OpenAPI spec
export interface User {
id: string;
tenant_id: string;
name: string;
email: string;
role: 'admin' | 'member' | 'viewer';
created_at: string;
updated_at: string;
}
export interface CreateUserInput {
name: string;
email: string;
role: 'admin' | 'member' | 'viewer';
}
Go:
type User struct {
ID uuid.UUID `json:"id"`
TenantID uuid.UUID `json:"tenant_id"`
Name string `json:"name"`
Email string `json:"email"`
Role Role `json:"role"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Present the complete API design for review:
Ask the user to confirm or request changes before generating the final spec files.