darknecrocities/skillbuilder/api-design
Claude Code and agent skill by darknecrocities/skillbuilder
- community
Checking that the SKILL.md file is still in the repository.
API contract design and OpenAPI 3.1 specification skill. Enforces RFC 7807 problem details, idempotency headers, and consistent status codes.
Install
npx vskill@latest install darknecrocities/skillbuilder/api-designSKILL.md
The same SKILL.md was published earlier as darknecrocities/skillbuilder/api-design.
API Contract Design & OpenAPI 3.1 (/api-design)
Philosophy: APIs are permanent contracts. Design first. Standardize errors with RFC 7807. Enforce idempotency on state-changing operations. Paginate with cursors, never unbounded offsets.
This skill establishes API contract standards, RESTful resource modeling, OpenAPI 3.1 specifications, uniform error semantics, and backward-compatibility rules.
1. Quick Navigation & Progressive Disclosure
| Resource Type | Document | Description | |
|---|---|---|---|
| Reference | references/rfc-7807-problem-details.md | Standardized error schemas, type URIs, problem detail envelopes. | |
| Reference | references/idempotency-and-versioning.md | Idempotency keys, state caching, URI versioning, deprecation headers. | |
| Utility | scripts/validate_openapi_spec.py | CLI linter auditing OpenAPI specs for RFC 7807 compliance and security schemes. |
2. RESTful Contract Architecture
2. Core API Contract Standards
2.1 RFC 7807 Problem Details Error Envelope
Every error response must use Content-Type application/problem+json:
2.2 Cursor-Based Pagination Standard
Never implement unbounded queries or naive offset-based pagination (OFFSET 10000) for large collections. Use cursor pagination:
- Query Parameters:
?limit=20&cursor=<opaque_base64_string> - Cursor encoding: Opaque Base64 of
(sort_value, id)tuple to guarantee stable deterministic sorting across insertions.
2.3 Idempotency Key Specification
- Header:
Idempotency-Key: <UUIDv4> - Required on all payment, checkout, reservation, or email dispatch endpoints.
- Server validates that replayed requests with the same key and same payload return the identical cached response without re-executing side effects.
- If payload differs for the same key, return
422 Unprocessable Entity(ERR_IDEMPOTENCY_PAYLOAD_MISMATCH).
2.4 Status Code Hierarchy
200 OK: Successful read or update mutation.201 Created: Resource created. Must includeLocation: /v1/resources/{id}.204 No Content: Successful delete with empty body.400 Bad Request: Schema validation failure.401 Unauthorized: Missing or expired token.403 Forbidden: Authenticated caller lacks permissions.404 Not Found: Target resource does not exist.409 Conflict: Unique constraint violation or state collision.422 Unprocessable Entity: Business logic invariant violation.429 Too Many Requests: Rate limit exhausted. Must includeRetry-After: <seconds>.500 Internal Server Error: Server exception. Never leak stack traces.
3. Deprecation & Sunset Standards
When deprecating an API endpoint or version:
- Announce deprecation at least 90 days prior to removal.
- Emit standard HTTP deprecation headers on every response:
Deprecation: @1735689600(Unix timestamp of deprecation announcement)Sunset: Wed, 11 Nov 2026 00:00:00 GMT(Date of scheduled turn-off)Link: <https://docs.example.com/migrations/v2>; rel="deprecation"
- Log usage metrics to identify clients still calling deprecated endpoints.
4. OpenAPI Specification Validator CLI
Validate OpenAPI 3.1 YAML/JSON specifications against contract rules:
Verifies:
- All routes have explicit
responseswith status codes. - Error schemas reference RFC 7807 problem details structure.
- Mutation endpoints support
Idempotency-Keyheaders where appropriate. - Collections enforce pagination parameters.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/api-design/SKILL.md
Popularity
- Repository stars
- 13
- Repository forks
- 2
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/darknecrocities/skillbuilder/api-design)