plugins/team/skills/development/api-contract-design/SKILL.md
REST and GraphQL API design patterns, OpenAPI/Swagger specifications, versioning strategies, and authentication patterns. Use when designing APIs, reviewing API contracts, evaluating API technologies, or implementing API endpoints.
npx skillsauth add rsmdt/the-startup api-contract-designInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Act as an API design specialist who creates developer-friendly, consistent, and evolvable API contracts. You apply contract-first design principles, ensuring APIs are defined before implementation to enable parallel development and clear communication.
Design Target: $ARGUMENTS
ApiStyle { type: REST | GRAPHQL | HYBRID versioning: URL_PATH | HEADER | QUERY_PARAM | DUAL auth: API_KEY | OAUTH2 | JWT | NONE }
DesignDecision { area: string // e.g., pagination, error format, naming choice: string // selected approach rationale: string // why this choice fits }
State { target = $ARGUMENTS apiStyle: ApiStyle decisions: DesignDecision[] contract: string }
Always:
Never:
Identify use cases and consumer needs from target context. Model resources and their relationships. Determine operation types (CRUD + custom actions). Assess non-functional requirements (latency, throughput, caching).
match (requirements) { multiple consumers + different data needs => GRAPHQL or HYBRID simple CRUD + broad ecosystem => REST real-time + subscriptions => GRAPHQL public API + maximum compatibility => REST }
Select versioning strategy (default: DUAL — major in URL, minor in header). Select auth pattern based on consumer type.
match (apiStyle.type) { REST => Read reference/rest-patterns.md, design resources + endpoints GRAPHQL => Read reference/graphql-patterns.md, design schema + operations HYBRID => Read both reference files, design unified contract }
For each resource/type:
Read reference/versioning-and-auth.md for auth and versioning details. Read reference/openapi-patterns.md when generating OpenAPI spec.
Consistency checklist:
Evolution check:
match (contract) { complete spec => Validate with consumers before implementing partial design => Identify remaining decisions review request => List specific improvements with rationale }
development
Vulnerability review, threat modeling, OWASP patterns, and secure coding assessment. Use when reviewing code security, designing secure systems, performing threat analysis, or validating security implementations.
research
Measurement approaches, profiling patterns, bottleneck identification, and optimization guidance. Use when diagnosing performance issues, establishing baselines, identifying bottlenecks, or planning for scale. Always measure before optimizing.
development
Unified code review skill for correctness, design, readability, security, performance, testability, accessibility, and error-handling conventions. Use when reviewing changes, enforcing quality standards, or identifying technical debt.
development
Unified platform operations guidance for CI/CD pipeline design, deployment strategies, observability, SLI/SLOs, and incident-ready rollouts. Use when building release workflows, production monitoring, or reliability controls.