doncheli/don-cheli-sdd / .agent/skills/doncheli-api-contract
doncheli-api-contract
VerifiedDesign complete API contracts covering endpoints, auth, rate limiting, error handling, retries, circuit breaker and idempotency. Activate when user mentions "api contract", "api design", "endpoint", "webhook", "REST", "GraphQL", "OpenAPI", "design the API".
Don Cheli: API Contract Designer
Instructions
- Identify the API style: REST, GraphQL, gRPC, Webhook, or mixed
- For each resource/operation, define:
- Method + path (REST) or operation name (GraphQL/gRPC)
- Request schema: headers, path params, query params, body
- Response schemas: success + all error cases
- Design cross-cutting concerns:
- Auth: mechanism (JWT, OAuth2, API Key, mTLS), scopes, token lifetime
- Rate limiting: strategy (token bucket / leaky bucket), limits per tier, headers exposed
- Error handling: standard error envelope, HTTP status mapping, error codes catalog
- Retries: which operations are safe to retry, backoff strategy, max attempts
- Circuit breaker: thresholds, half-open probe, fallback behavior
- Idempotency: which operations require idempotency keys, TTL, conflict semantics
- Define versioning strategy (URL path, header, or content negotiation)
- Flag breaking vs. non-breaking changes policy
Output Format
## API Contract: <service/feature name>
### Style & Version
- Protocol: REST / GraphQL / gRPC / Webhook
- Base URL: …
- Version: v1 (strategy: <path/header/content-negotiation>)
### Endpoints / Operations
#### <METHOD> <path>
**Purpose:** …
**Auth required:** yes/no — scope: …
**Request:**
```json
{
"field": "type — description"
}
Response 200:
{ … }
Error responses:
| Status | Code | Meaning |
|---|---|---|
| 400 | INVALID_INPUT | … |
| 409 | CONFLICT | … |
Idempotency: required / not required — key:
Cross-Cutting Concerns
Auth: … Rate Limiting: X req/min per API key; headers: X-RateLimit-Remaining, X-RateLimit-Reset Retry Policy: safe methods (GET, PUT, DELETE) — exponential backoff, max 3 attempts Circuit Breaker: open at 50% error rate over 10s window; half-open probe after 30s Error Envelope:
{ "error": { "code": "…", "message": "…", "trace_id": "…" } }
Breaking Change Policy
- Breaking: removing fields, changing types, removing endpoints → requires major version bump
- Non-breaking: adding optional fields, new endpoints → compatible within same version
## Quality Gate
- Every endpoint must have at least one documented error response
- Idempotency policy must be explicit (required or not required) for every mutating operation
- Auth scopes must be listed for every endpoint that requires authentication
- Rate limit headers must be named consistently across all endpoints
## Do not use this skill when
- The API already exists and the user wants to review it (use doncheli-review instead)
- The user only wants implementation, not contract design (use doncheli-implement instead)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |