api-design
Guided API design workflow from requirements to documented API specification. Creates OpenAPI-style specs with validation schemas.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Guided API design workflow from requirements to documented API specification. Creates OpenAPI-style specs with validation schemas.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Generate customized .claude/ harness framework with Fusion Architecture (GAN-inspired + Domain Specialists). TRIGGER when user wants to set up AI-assisted development structure, create a new project harness, add structure to existing projects, or mentions 'harness', 'scaffold', 'framework setup'. Supports all domains through template + dynamic generation.
Negotiates 'done' criteria between Generator, Evaluator, and architect-lead before implementation begins. Converts subjective goals into testable, gradable criteria with clear domain responsibilities.
Guided database migration workflow — from schema design to rollback documentation.
Production incident response workflow — triage, root cause analysis, and resolution.
Track, categorize, and prioritize technical debt across the codebase.
Save current progress with structured handoff artifact. Enables context reset for long-running tasks and session recovery.
| name | api-design |
| description | Guided API design workflow from requirements to documented API specification. Creates OpenAPI-style specs with validation schemas. |
| user-invocable | true |
You are facilitating the API Design process. Your role is to guide the creation of well-designed, documented API specifications.
API design ensures:
REQUIREMENTS -> ENDPOINT DESIGN -> SCHEMA DEFINITION -> ERROR DESIGN -> DOCUMENTATION
For each endpoint:
| Method | Purpose | Example |
|---|---|---|
| GET | Retrieve resource(s) | GET /users, GET /users/{id} |
| POST | Create resource | POST /users |
| PUT | Update resource | PUT /users/{id} |
| DELETE | Remove resource | DELETE /users/{id} |
Define request and response schemas:
Request Schema:
{
"type": "object",
"properties": {
"field1": { "type": "string", "required": true },
"field2": { "type": "integer", "minimum": 0 }
},
"required": ["field1"]
}
Response Schema:
{
"type": "object",
"properties": {
"data": { "type": "object" },
"meta": {
"type": "object",
"properties": {
"timestamp": { "type": "string", "format": "date-time" },
"version": { "type": "string" }
}
}
}
}
Define error responses:
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid input",
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
}
| Code | HTTP Status | Description |
|---|---|---|
| VALIDATION_ERROR | 400 | Invalid request data |
| AUTHENTICATION_ERROR | 401 | Missing/invalid auth |
| FORBIDDEN | 403 | Insufficient permissions |
| NOT_FOUND | 404 | Resource not found |
| CONFLICT | 409 | Resource conflict |
| INTERNAL_ERROR | 500 | Server error |
Create API specification document:
# API Specification: [Resource Name]
## Overview
[Description of the API resource]
## Base URL
`/api/v1/[resource]`
## Authentication
[Authentication requirements]
## Rate Limiting
[Limits if applicable]
---
## Endpoints
### List [Resources]
**GET** `/api/v1/[resource]`
**Description**: Retrieve list of [resources]
**Query Parameters**:
| Name | Type | Required | Description |
|------|------|----------|-------------|
| page | int | No | Page number (default: 1) |
| limit | int | No | Items per page (default: 20) |
**Response**: `200 OK`
```json
{
"data": [...],
"meta": {
"total": 100,
"page": 1,
"limit": 20
}
}
POST /api/v1/[resource]
Description: Create a new [resource]
Request Body:
{
"field1": "value",
"field2": 123
}
Response: 201 Created
{
"data": { ... },
"meta": { ... }
}
Errors:
GET /api/v1/[resource]/{id}
Description: Retrieve a specific [resource]
Path Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| id | int | Yes | Resource ID |
Response: 200 OK
{
"data": { ... },
"meta": { ... }
}
Errors:
PUT /api/v1/[resource]/{id}
Description: Update a [resource]
Request Body:
{
"field1": "new value"
}
Response: 200 OK
Errors:
DELETE /api/v1/[resource]/{id}
Description: Delete a [resource]
Response: 204 No Content
Errors:
## Design Principles
1. **Consistent Naming**: Use nouns for resources, plural for collections
2. **Versioned APIs**: Include version in URL (`/api/v1/`)
3. **Stateless**: No server-side sessions, use tokens
4. **Documented**: Every endpoint has documentation
5. **Error Consistent**: Same error format across all endpoints
## Anti-Patterns to Avoid
- Verbs in URLs (`/getUsers` instead of `GET /users`)
- Inconsistent error formats
- Missing authentication documentation
- Undocumented endpoints
- Mixed naming conventions
## Usage
/api-design [resource description]
Example:
/api-design User management with CRUD operations
## Coordination
- backend-lead reviews API designs
- frontend-lead confirms frontend can consume API
- architect-lead approves cross-service APIs