Use when designing, reviewing, or planning REST or GraphQL APIs — endpoint structure, schema design, versioning, error handling, pagination, URI naming, or choosing between REST and GraphQL. Also triggers for OpenAPI spec creation and API contract review.
88%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
When NOT to use:
api-design.
Skip the notice when the user asked for the skill by name or slash command; spelling and spacing need not match.
A phrase from this skill's own trigger list is not a name — naming the work is not naming the skill.These apply regardless of REST or GraphQL:
Use the references below as scoped guidance. Some references describe broad consensus, while others document strong defaults or ecosystem-specific patterns.
| Design Task | Reference | When to Load |
|---|---|---|
| REST vs GraphQL decision | rest-vs-graphql.md | Starting a new API or evaluating a paradigm shift |
| REST endpoint design | rest-design.md | Designing REST resources, methods, status codes |
| GraphQL schema/query/mutation design | graphql-design.md | Designing GraphQL types, queries, mutations, subscriptions |
| URI/URL naming | uri-design.md | Naming endpoints, path segments, query parameters |
| API versioning | versioning.md | Planning version strategy, deprecation, migration |
| Error responses | error-handling.md | Designing error formats, status code usage, RFC 9457 |
| Pagination and filtering | pagination-filtering.md | Lists, collections, search results, sorting |
| FastAPI implementation | fastapi-practices.md | Building APIs with FastAPI specifically |
How to use this table: Load only the references relevant to the current task.
For a new API design, start with rest-vs-graphql.md, then load the paradigm-specific reference.
For targeted questions (e.g., "how should we version this?"), load only that reference.
For the full decision tree and tradeoff matrix, load rest-vs-graphql.md.
| Mistake | Fix |
|---|---|
Verbs in REST URIs (/getUsers, /createOrder) | Use nouns + HTTP methods for CRUD; verbs only for controller resources (POST /orders/{id}/cancel) |
| Exposing database IDs/structure in API | Abstract with slugs, UUIDs, and domain-oriented shapes; use a mapping layer, not auto-serialization |
| Inconsistent error formats across endpoints | Define one error schema, use it everywhere |
| No pagination on collection endpoints | Paginate unbounded or growth-prone collections; small bounded reference data may not need it — always set default and max page sizes when pagination is used |
| Breaking changes without versioning | Use additive changes; version when breaking is unavoidable |
Generic GraphQL mutations (updateEntity) | Use specific semantic mutations (publishPost, archiveOrder) |
| Auth logic in resolvers/handlers instead of business layer | Delegate authorization to domain services |
| Nullable everything / non-null everything | Be intentional: non-null only when you can guarantee presence |
ahgraber/skills
1456a06
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.