skills/api-design/SKILL.md
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.
npx skillsauth add ahgraber/skills api-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.
When NOT to use:
When invoked by name, announce: "Using api-design to guide API design decisions."
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 |
development
Use when the user wants rigorous, non-sycophantic editorial feedback on a draft, essay, blog post, or argument through back-and-forth dialogue — pressure-testing thesis, structure, argument, clarity, tone, and evidence. Triggers: "be my sparring partner", "pressure-test this draft", "poke holes in my argument", "is this ready to publish", "sharpen this post", "where is this weak". Not for one-shot copyediting, proofreading, or ghostwriting.
testing
Use when distilling the through-line gist of one or more sources — the spine, argument, tension, or recurring frame running through a set of documents, notes, research, or transcripts, OR across the ideas within a single rich piece — into a few concise paragraphs. Triggers: "synthesize", "what's the through-line/gist", "extract the insight", "pull these together". Not for faithful summary or condensation that covers what a source says, nor for comparisons or catalogs where enumeration is the deliverable.
development
Use when writing or reviewing tests in any language, or diagnosing a suite that is slow, brittle, or hard to read. Triggers: "write tests", "how should I test this", "what kind of test", "test is flaky/fragile", "should I mock this", "test is hard to read". For Python-specific guidance see `python-testing`.
development
Use when writing, debugging, or explaining Strudel live-coding music patterns — mini-notation syntax, pattern functions (fast/slow/every/off/stack), synth/sample selection, audio effects, scale/chord/voicing API, or EDM production recipes. Triggers: "write a Strudel pattern", "how do I make a bassline in Strudel", "what does .every() do", "strudel drum beat", "strudel chord voicing", any Strudel code question.