From epieczko-betty
**api.define** scaffolds OpenAPI and AsyncAPI specifications from enterprise-compliant templates, generating production-ready API contracts with best practices built-in.
npx claudepluginhub joshuarweaver/cascade-code-general-misc-1 --plugin epieczko-bettyThis skill uses the workspace's default tool permissions.
**api.define** scaffolds OpenAPI and AsyncAPI specifications from enterprise-compliant templates, generating production-ready API contracts with best practices built-in.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
api.define scaffolds OpenAPI and AsyncAPI specifications from enterprise-compliant templates, generating production-ready API contracts with best practices built-in.
Quickly create API specifications that follow enterprise guidelines:
python skills/api.define/api_define.py <service_name> [spec_type] [options]
| Parameter | Required | Description | Default |
|---|---|---|---|
service_name | Yes | Service/API name | - |
spec_type | No | openapi or asyncapi | openapi |
--template | No | Template name | zalando |
--output-dir | No | Output directory | specs |
--version | No | API version | 1.0.0 |
python skills/api.define/api_define.py user-service openapi --template=zalando
Output: specs/user-service.openapi.yaml
Generated spec includes:
x-api-id, x-audience)python skills/api.define/api_define.py user-service asyncapi
Output: specs/user-service.asyncapi.yaml
Generated spec includes:
python skills/api.define/api_define.py order-api openapi \
--output-dir=api-specs \
--version=2.0.0
For a service named user-service, the generated OpenAPI spec includes:
Paths:
GET /users - List users with paginationPOST /users - Create new userGET /users/{user_id} - Get user by IDPUT /users/{user_id} - Update userDELETE /users/{user_id} - Delete userSchemas:
User - Main resource schemaUserCreate - Creation payload schemaUserUpdate - Update payload schemaPagination - Pagination metadataProblem - RFC 7807 error schemaResponses:
200 - Success (with X-Flow-ID header)201 - Created (with Location and X-Flow-ID headers)204 - No Content (for deletes)400 - Bad Request (application/problem+json)404 - Not Found (application/problem+json)409 - Conflict (application/problem+json)500 - Internal Error (application/problem+json)Security:
Required Metadata:
x-api-id - Unique UUIDx-audience - Target audience (company-internal)contact - Team contact informationThe skill automatically extracts resource names from service names:
| Service Name | Resource | Plural |
|---|---|---|
user-service | user | users |
order-api | order | orders |
payment-gateway | payment | payments |
The skill automatically applies proper naming:
| Context | Convention | Example |
|---|---|---|
| Paths | kebab-case | /user-profiles |
| Properties | snake_case | user_id |
| Schemas | TitleCase | UserProfile |
| Operations | camelCase | getUserById |
The generated specs are designed to pass api.validate with zero errors:
# Generate spec
python skills/api.define/api_define.py user-service
# Validate (should pass)
python skills/api.validate/api_validate.py specs/user-service.openapi.yaml zalando
# workflows/api_first_development.yaml
steps:
- skill: api.define
args:
- "user-service"
- "openapi"
- "--template=zalando"
output: spec_path
- skill: api.validate
args:
- "{spec_path}"
- "zalando"
required: true
After generation, customize the spec:
User:
properties:
user_id: ...
email: # Add this
type: string
format: email
/users/search: # Add new endpoint
post:
summary: Search users
info:
contact:
name: Your Team Name # Update this
email: team@company.com
{
"status": "success",
"data": {
"spec_path": "specs/user-service.openapi.yaml",
"spec_content": {...},
"api_id": "d0184f38-b98d-11e7-9c56-68f728c1ba70",
"template_used": "zalando",
"service_name": "user-service"
}
}
pip install pyyaml
| Template | Spec Type | Description |
|---|---|---|
zalando | OpenAPI | Zalando-compliant with all required fields |
basic | AsyncAPI | Basic event-driven API structure |
0.1.0 - Initial implementation with Zalando template support