/engineering:api-design-firstfrom engineering
Designs HTTP APIs as contracts before code, producing OpenAPI 3.1 specs with auth, error, idempotency, and observability artifacts. Useful when designing new APIs or normalizing existing ones.
Ships in engineering. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Acknowledgement: Shared by Peter Bamuhigire, techguypeter.com, +256 784 464178.
Design APIs as contracts before code. This skill produces the OpenAPI 3.1 contract and its companion auth / error / idempotency / observability artifacts that downstream frontend, mobile, SDK, security, and reliability skills depend on.
reliability-engineering and observability-monitoring.vibe-security-skill; this skill only records the auth model.graphql-patterns.system-architecture-design.database-design-engineering.tenant_id propagation can be proven.SKILL.md, then load only the references needed for the task (for example openapi-workflow.md for a greenfield design; auth-and-security.md for an auth choice; rest-conventions.md for URL / status-code review).skill-composition-standards/references/openapi-contract.md.tenant_id from the request body — enables cross-tenant data leaks.Access-Control-Allow-Origin: * with credentials — browsers ignore, auth breaks, security hole opens.Skill-specific anti-patterns:
POST /api/v1/invoices { "franchise_id": 42, "amount": 100 }. Fix: derive franchise_id from the authenticated token server-side; ignore any tenant field on the wire.GET /api/v1/invoices/999 returns 403 Forbidden when invoice 999 belongs to another tenant. Fix: return 404 Not Found — 403 leaks that the resource exists.Access-Control-Allow-Origin: * plus Access-Control-Allow-Credentials: true. Fix: echo only origins from an allow-list; set credentials true only for those origins.INSERT INTO api_keys (key) VALUES ('sk_live_abc123'). Fix: store key_hash = SHA-256(key), return the raw key once on creation, never again.GET /api/v1/invoices/{id} because nobody "should" be using it. Fix: ship as v2, keep v1 unchanged, emit Deprecation + Sunset headers on v1.POST /api/v1/payments charges the card. Network retry charges it again. Fix: require Idempotency-Key header, store (tenant, user, key) -> response for 24 h, replay the stored response on duplicate.GET /api/v1/invoices?per_page=100000. Fix: clamp per_page to a hard maximum (e.g. 100) server-side."invoice_number": 1042, or the client sends its own number on create. Fix: return document numbers as strings, ignore client numbers, require Idempotency-Key on numbered creates and store it on the document row so a replay returns the same number (tenant-document-numbering).Idempotency-Key, scope, TTL.Skill-specific outputs:
| Artifact | Consumed by | Template |
|---|---|---|
| OpenAPI 3.1 contract | frontend, mobile, SDK, advanced-testing-strategy (contract tests) | skill-composition-standards/references/openapi-contract.md |
| Error model | frontend, mobile, advanced-testing-strategy | skill-composition-standards/references/error-model.md |
| Auth model | vibe-security-skill, mobile-rbac, ios-rbac | inline in spec (components.securitySchemes) + role/scope matrix in auth-and-security.md |
| Idempotency map | reliability-engineering, stripe-payments | inline table — see references/auth-and-security.md |
| Observability notes | observability-monitoring | inline table — see references/implementation-checklist.md |
| Category | Artifact | Format | Example |
|---|---|---|---|
| Correctness | OpenAPI contract | Markdown doc plus OpenAPI YAML covering paths, schemas, and error responses | docs/api/openapi-checkout.yml |
| Correctness | Contract test results | CI log or recorded report from API contract tests against the OpenAPI spec | docs/api/contract-tests-2026-04-16.md |
observability-monitoring.graphql-patterns — schema-first Apollo Server + TypeScript patterns when choosing GraphQL over REST for client-shaped reads.Skill-specific references:
observability-monitoring, hand-off table to other skills.Load these skills first:
system-architecture-design — produces the context map and critical-flow table consumed below.database-design-engineering — produces the access-pattern list that shapes resource design.world-class-engineering — the shared release gate this skill ships into.Load alongside:
vibe-security-skill for threat modelling of the auth model produced here.graphql-patterns whenever building or auditing a GraphQL API (it owns the GraphQL hardening guidance).| Artifact | Produced by | Required? | Why |
|---|---|---|---|
| Context map | system-architecture-design | required | Defines service/module boundaries the API sits inside |
| Critical-flow table | system-architecture-design | required | Supplies latency/availability targets for endpoints |
| Access-pattern list | database-design-engineering | required | Read/write shapes drive resource model and pagination choices |
| Failure-mode list | system-architecture-design | optional | Informs degradation behaviour on dependency outages |
| Threat model | vibe-security-skill | optional | Informs auth, rate-limit, and abuse-case rules |
| Tenancy model | database-design-engineering | required | Proves tenant isolation at the API boundary |
auth-and-security.md.Idempotency-Key.| Caller shape | Choose | Failure mode if wrong |
|---|---|---|
| Server-to-server, trusted partner, long-lived | API Key (SHA-256 hashed) | JWT: can't be revoked fast; raw-key storage: leak = instant compromise |
| Web app with user consent, third-party accessed | OAuth2 Authorization Code | Implicit flow: token leaks via URL history; ROPC: phishing vector |
| Service-to-service with scopes, standards-compliant | OAuth2 Client Credentials | API key: no standardised scopes or introspection |
| First-party mobile app / SPA | JWT access + refresh (short) | Long-lived JWT: revocation impossible; session cookie: breaks on iOS |
| Legacy / tightly-controlled client with no user flow | OAuth2 ROPC (last resort) | Credentials pass through the API surface — avoid when any alternative |
| Change | Action | Failure mode if wrong |
|---|---|---|
| Adding optional field, endpoint, or enum value | Ship in current version, mark non-breaking | Spawning a new version for a safe change: client churn |
| Removing or renaming a field | Ship as new major version, sunset old | Mutating existing version: silent parsing failures in clients |
| Changing response shape or required params | Ship as new major version, sunset old | As above |
| Bug fix that narrows behaviour clients may depend on | Ship behind a header flag, deprecate quietly | Silent fix: clients relying on the bug break in production |
| Endpoint class | Require Idempotency-Key? | TTL | Failure mode if skipped |
|---|---|---|---|
| Payment, refund, charge | yes | 24 h | Double charges on retry |
| Order/invoice creation | yes | 24 h | Duplicate orders on network retry |
| Outbound email / webhook dispatch | yes | 7 d | Duplicate user-visible side effects |
| Inventory movement | yes | 24 h | Phantom stock changes |
| Read-only (GET, HEAD) | no | n/a | n/a |
| Partial update without external effect | optional | 1 h | Benign — but worth enabling on sensitive ops |
| Resource shape | Header | Failure mode if wrong |
|---|---|---|
| Public, rarely changes (prices) | public, max-age=3600 | no-store: wastes bandwidth, slow clients |
| Per-user private | private, max-age=300 | public: leaks via shared CDN cache |
| Sensitive or mutable (auth, cart) | no-store | public: security incident |
| Situation | Choose |
|---|---|
| Multiple clients with diverging field needs | GraphQL |
| Public API, webhooks, file uploads | REST |
| Simple CRUD | REST |
| Real-time subscriptions | GraphQL subscriptions |
Failure mode if wrong: GraphQL-first for simple CRUD buys query-complexity DoS risk with no field-flexibility payoff; REST-first for multi-client heavy-reads pushes clients into over-fetch and N+1 round trips.
This table is the REST/GraphQL shortcut only. For real-time, service-to-service, event, or callback interactions (SSE, WebSocket, gRPC, webhooks, broker messaging), decide per interaction with references/api-style-selection.md; one-way live updates rarely need GraphQL subscriptions or WebSocket.
Full spec skeleton and per-step detail in references/openapi-workflow.md.
For partner, public, long-lived, or workflow-heavy APIs, also load references/practical-api-architecture.md.
For consumer ergonomics, endpoint naming, pagination, embedding, versioning, and test expectations, load references/api-you-wont-hate-rules.md.
The canonical envelope produced by this skill — every downstream client depends on it:
{
"success": true,
"data": { "id": 123 },
"meta": { "page": 1, "per_page": 25, "total": 142 }
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "The amount field is required.",
"documentation_url": "https://api.example.com/errors#VALIDATION_ERROR",
"fields": { "amount": ["Required"] }
}
}
Detail, status-code mapping, and pagination mechanics live in references/rest-conventions.md.
skill-composition-standards — normalisation standard this skill was rewritten against; templates for the OpenAPI contract and error model live there.observability-monitoring — consumes the observability notes table to build SLOs, alerts, and runbooks.reliability-engineering — consumes the idempotency map for retry and circuit-breaker design.deployment-release-engineering — consumes the versioning plan for migration choreography and rollback windows.vibe-security-skill — consumes the auth model to build the threat model and abuse-case list.Default to contract design and validation. Write specifications or generate clients only when authorised; do not deploy gateways, rotate credentials, or change production routes without approval.
If consumers, traffic evidence, or the current contract are unavailable, produce a read-only draft with assumptions and unresolved compatibility risks; do not claim implementation readiness.
references/api-error-handling.md (opens in a new tab)references/api-error-handling/examples/ApiClient.js (opens in a new tab)references/api-error-handling/examples/InvoicesEndpoint.php (opens in a new tab)references/api-error-handling/references/ApiResponse.php (opens in a new tab)references/api-error-handling/references/CustomExceptions.php (opens in a new tab)references/api-error-handling/references/ExceptionHandler.php (opens in a new tab)references/api-error-handling/references/bootstrap.php (opens in a new tab)references/api-error-handling/references/contract-validation.md (opens in a new tab)references/api-error-handling/references/skill-deep-dive.md (opens in a new tab)references/api-pagination.md (opens in a new tab)references/api-pagination/references/skill-deep-dive.md (opens in a new tab)references/api-security-owasp-top10.md (opens in a new tab)references/api-style-selection.md (opens in a new tab)references/api-testing-verification.md (opens in a new tab)references/api-you-wont-hate-rules.md (opens in a new tab)references/apis-for-ai-agents-and-data.md (opens in a new tab)references/auth-and-security.md (opens in a new tab)references/implementation-checklist.md (opens in a new tab)references/json-payload-and-schema-design.md (opens in a new tab)references/openapi-workflow.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
openapi, api-design, contract-first, api-versioning, rate-limiting, idempotency
npx claudepluginhub peterbamuhigire/chwezi-dev-engine --plugin engineering169 skills in this plugin
/accounting-engineUse when designing or implementing double-entry accounting policy and an embedded ledger engine for invoices, payments, stock, balanced postings, mapped accounts, idempotency, reversals, period locks, audit trails, and financial statements./accounting-finance-controllerUse when coordinating accounting and finance implementation reviews, doctrine routing, control evidence, remediation priorities, and release decisions across a software system./advanced-testing-strategyUse when designing or reviewing test strategy for production systems, APIs, mobile apps, SaaS platforms, ERP workflows, and AI-enabled systems. Covers unit, integration, contract, end-to-end, regression, release-gate, and risk-based testing decisions.Other plugins' skills for the same job