Guide · Agent skill
How to use the API Patterns Guide agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The api-patterns skill is a set of design guidance files that an AI agent reads when you ask it to plan or review a web API. It is aimed at backend developers who are designing a new endpoint, choosing between REST, GraphQL and tRPC for known consumers, or reviewing pagination, error format or versioning decisions. After reading this guide you will know what the skill changes about the agent's behaviour, how to install it, how to phrase requests so it activates, and what its optional Python script can and cannot tell you.
Quick start
- 1Download the ZIP. Download the api-patterns skill ZIP from this page.
- 2Unzip into a skills folder. Unzip it into ~/.claude/skills/ for personal use, or into .claude/skills/ inside a project.
- 3Or upload in the Claude apps. In the Claude apps, open Settings → Capabilities → Skills and upload the skill.
- 4Describe your API task. Name the endpoint or API decision and who will consume it, in plain language.
- 5Answer the consumer questions. The agent will ask about consumers, payload size, access rules and compatibility needs. Answer them.
- 6Optionally run the scan. With Python 3 installed, run python3 skills/api-patterns/scripts/api_validator.py <project_path> for a heuristic triage hint.
What is an agent skill, and what does api-patterns make the agent do?
An agent skill is a folder of instructions and reference files that an AI agent can load when a task matches it. The skill's entry file, SKILL.md, tells the agent when to use it and which other files to read. The skill's own rule is to read only the files relevant to the request.
Once api-patterns is active, the agent works from a decision checklist before designing an API. It asks who the consumers are, chooses an API style for that context, and then follows consistent guidance on response formats, error handling, pagination, versioning, authentication and rate limiting. Guidance on REST, GraphQL, tRPC, OpenAPI documentation and OWASP API security testing is kept in separate files.
- api-style.md: decision tree for REST vs GraphQL vs tRPC
- rest.md: resource naming, HTTP methods, status codes
- response.md: envelope pattern, error format, pagination
- versioning.md: URI, header and query versioning
- auth.md: JWT, OAuth, Passkey and API keys
- rate-limiting.md: token bucket and sliding window
- documentation.md: OpenAPI/Swagger practices
- security-testing.md: OWASP API Top 10 and auth/authz testing
How do you install the api-patterns skill?
Download the skill ZIP from this page and unzip it. You can install it in one of two places. For a personal setup that works across projects, unzip it into ~/.claude/skills/. For a single project, unzip it into the .claude/skills/ folder inside that project.
If you use the Claude apps instead, open Settings, go to Capabilities, and upload the skill under Skills.
- Personal: unzip into ~/.claude/skills/
- Project only: unzip into .claude/skills/ in the project root
- Claude apps: Settings → Capabilities → Skills, then upload
How do you trigger the skill with a natural request?
You do not need a special command. Describe the API task in plain language and name the consumers and constraints if you know them. The skill's own procedure asks for consumers, deployed versions, expected payload size, access rules and compatibility obligations, so giving these up front saves a round of questions.
Requests that fit the skill's stated scope include defining a new endpoint contract, picking REST, GraphQL or tRPC for known clients, and changing pagination, errors, authentication or compatibility behaviour.
- Help me choose between REST and GraphQL for a mobile app and a public partner API.
- We have a TypeScript monorepo with a React frontend. Should we use tRPC?
- Review the pagination and error format of our order list endpoint.
- Plan URI versus header versioning for an API that third parties already call.
What does a worked example look like?
The skill includes a worked example for a public order list that changes while clients page through it. The suggested approach is a bounded page size and a cursor over a stable (created_at, id) order, with the next-cursor format, authorisation filter and behaviour for removed records or invalid cursors all defined. The example also calls for testing two equal timestamps and an insertion between pages, and documenting whether newly inserted rows can appear.
You can ask the agent to walk through the same reasoning for your own list endpoint, for example: Design cursor pagination for our invoices endpoint, where invoices can be added while clients page through them.
What does the optional Python script do?
The skill ships one script, scripts/api_validator.py. It runs a local heuristic scan of a project's API source files. It uses regular expressions and shallow checks on JSON and YAML, and it scans at most 15 matching files. The skill is explicit that this is a triage hint, not schema validation.
To run it, you need Python 3 and a project path. The command given in the skill is shown below.
- Requires Python 3 only if you run the script
- Scans local files; the skill states it uses no network
- Does not validate OpenAPI schemas, audit authorisation or approve deployments
python3 skills/api-patterns/scripts/api_validator.py <project_path>What are the safety notes?
The skill runs scripts and the script reads your source files, so review it before running it on a repository you care about. The source states that the skill does not use the network. The skill's limitations also say security checks should only be run against authorised local or test targets, with isolated accounts and a defined scope.
The skill says shared build-time types do not guarantee that independently deployed clients stay compatible, so keep compatibility testing as a separate step.
- Runs scripts: yes, scripts/api_validator.py
- Network use: none stated in the skill
- Run security checks only against authorised local or test targets
- Do not treat script output as an authorization audit or deployment approval
What tips make the output more useful?
Give the agent concrete operations rather than abstract questions. One real endpoint with a request and response example will produce better guidance than a general discussion of API style. Also name the constraints that drive the decision, such as public third-party access or a single TypeScript team.
Treat the anti-patterns list as a review checklist. It warns against defaulting to REST for everything, using verbs in REST paths such as /getUsers, returning inconsistent response formats, exposing internal errors and skipping rate limiting.
- Name the consumers and their deployed versions first
- Ask for request, response and rejection examples
- Check the anti-pattern list against your draft
- Record the compatibility promise you are making to clients
What people use it for
- Choosing REST, GraphQL or tRPC for a public API with several client platforms.
- Designing cursor pagination for a list that changes while clients page through it.
- Reviewing an existing error response format for consistency.
- Planning how to version an API that third parties already depend on.
- Getting a quick heuristic scan of API source files before a human review.
Frequently asked questions
How do I install the api-patterns skill?
Download the ZIP from this page and unzip it into ~/.claude/skills/ for personal use, or into .claude/skills/ in a project. In the Claude apps, you can instead upload it under Settings → Capabilities → Skills.
Is the api-patterns skill free?
The skill is published under the MIT licence, as stated on this page. Check the licence file in the source repository for the full terms.
What do I need to run the api-patterns skill?
The guidance files need only an agent that supports skills. Python 3 is needed only if you run scripts/api_validator.py. The skill states that it uses no network.
Does api-patterns validate my OpenAPI schema?
No. The skill states that its script is a local heuristic scan, not schema validation. Use OpenAPI validation and compatibility testing tools for that job.
Can the skill do a security audit or penetration test?
No. The skill gives design guidance and a heuristic script, not a formal security audit. Its security-testing guidance should only be applied to authorised local or test targets.
How does api-patterns compare with generating code directly?
The skill is design guidance rather than code generation. It helps the agent choose an API style and reason about responses, errors, pagination, versioning and auth, and it is not a finished deployable API.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use api-patterns if you are a backend developer or team who wants an AI agent to work through API design trade-offs with a consistent checklist before you write code. Pick something else if you need a formal security audit, OpenAPI schema validation, or a finished deployable API, since this skill only gives guidance and a heuristic script.
Download the skill