ワンクリックで
api-contract
Generate or validate OpenAPI and AsyncAPI specs from code or requirements with consistent naming, errors, and pagination
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Generate or validate OpenAPI and AsyncAPI specs from code or requirements with consistent naming, errors, and pagination
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Create Architecture Decision Records using the Michael Nygard template with context, decision, alternatives, and consequences
Generate CHANGELOG.md from git history in Keep a Changelog format with Added, Changed, Deprecated, Removed, Fixed, and Security categories
Generate CI/CD pipeline config for detected platform with lint, test, build, and deploy stages
Scan dependencies for CVEs, outdated packages, license issues, and unused deps to produce a prioritized remediation list
Guide deployment processes including CI/CD pipeline creation, environment setup, and rollback procedures
Analyze Dockerfile and produce optimized version with multi-stage builds, layer caching, minimal base, and security hardening
| name | api-contract |
| description | Generate or validate OpenAPI and AsyncAPI specs from code or requirements with consistent naming, errors, and pagination |
| license | MIT |
| compatibility | opencode |
| metadata | {"audience":"developers","workflow":"general"} |
Use this skill when you need to:
Discover: Analyze existing API code or requirements
Design resource model: Map domain entities to API resources
/users, /orders)/users/{id}/orders)Define endpoints: Specify each operation
Standardize patterns: Apply consistent conventions
Generate spec: Produce the OpenAPI/AsyncAPI document
Validate: Check spec for completeness and correctness
| Element | Convention | Example |
|---|---|---|
| Paths | kebab-case, plural nouns | /api/v1/user-accounts |
| Query params | camelCase | ?pageSize=20&sortBy=createdAt |
| Request/response fields | camelCase | { "firstName": "Jane" } |
| Schema names | PascalCase | UserAccount, OrderItem |
| Enum values | UPPER_SNAKE_CASE | "ORDER_PENDING" |
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Human-readable description",
"details": [
{
"field": "email",
"message": "Must be a valid email address",
"code": "INVALID_FORMAT"
}
],
"requestId": "req_abc123"
}
}
| Code | Usage |
|---|---|
| 200 | Successful GET, PUT, PATCH |
| 201 | Successful POST that creates a resource |
| 204 | Successful DELETE with no response body |
| 400 | Validation error or malformed request |
| 401 | Missing or invalid authentication |
| 403 | Authenticated but insufficient permissions |
| 404 | Resource not found |
| 409 | Conflict (duplicate, state violation) |
| 422 | Semantically invalid request |
| 429 | Rate limit exceeded |
| 500 | Unexpected server error |
# Query parameters
parameters:
- name: page
in: query
schema:
type: integer
minimum: 1
default: 1
- name: pageSize
in: query
schema:
type: integer
minimum: 1
maximum: 100
default: 20
# Response envelope
PagedResponse:
type: object
properties:
data:
type: array
items: { $ref: '#/components/schemas/Item' }
pagination:
type: object
properties:
page: { type: integer }
pageSize: { type: integer }
totalItems: { type: integer }
totalPages: { type: integer }
/api/v1/...)requestId in all error responses for traceabilityX-RateLimit-Limit, X-RateLimit-Remaining)$ref for reusable schemas over inline definitions