API Patterns
SkillMediaapi-patterns is a skill that gives an AI agent reference guides for API design decisions. It covers choosing between REST, GraphQL and tRPC, plus resource naming, response formats, versioning, authentication, rate limiting, documentation and security testing. The agent reads only the guide relevant to the task, follows a pre-design checklist, and can run a validator script against a project.
Available today. Use it from your connected AI after setup.
No other account needed.
Have an agent setup that supports skills and the tools the skill uses: Read, Write, Edit, Glob and Grep.
Then ask your AI: use the API Patterns skill
What your AI can do with it
- Decides between REST, GraphQL and tRPC using a decision tree in api-style.md
- Guides REST design: resource naming, HTTP methods and status codes
- Covers response structure: envelope pattern, error format and pagination
- Explains versioning options: URI, Header and Query versioning
- Reviews auth patterns including JWT, OAuth, Passkey and API keys
- Runs scripts/api_validator.py to validate API endpoints in a project
Getting started
- Have an agent setup that supports skills and the tools the skill uses: Read, Write, Edit, Glob and Grep.
- Add the api-patterns skill to your agent's skills.
- Ask the agent about an API design task, such as choosing an API style or planning versioning.
- The agent reads only the relevant guide file, applies the decision checklist, and can optionally run the validator script against your project path.
What this skill tells your AI
The instructions your AI receives, as published by davila7/claude-code-templates in cli-tool/components/skills/development/api-patterns/SKILL.md and read by ahel’s review.
API design principles and decision-making for 2025. Learn to THINK, not copy fixed patterns.
🎯 Selective Reading Rule
Read ONLY files relevant to the request! Check the content map, find what you need.
📑 Content Map
| File | Description | When to Read |
|---|---|---|
api-style.md | REST vs GraphQL vs tRPC decision tree | Choosing API type |
rest.md | Resource naming, HTTP methods, status codes | Designing REST API |
response.md | Envelope pattern, error format, pagination | Response structure |
graphql.md | Schema design, when to use, security | Considering GraphQL |
trpc.md | TypeScript monorepo, type safety | TS fullstack projects |
versioning.md | URI/Header/Query versioning | API evolution planning |
auth.md | JWT, OAuth, Passkey, API Keys | Auth pattern selection |
rate-limiting.md | Token bucket, sliding window | API protection |
documentation.md | OpenAPI/Swagger best practices | Documentation |
security-testing.md | OWASP API Top 10, auth/authz testing | Security audits |
🔗 Related Skills
| Need | Skill |
|---|---|
| API implementation | @[skills/backend-development] |
| Data structure | @[skills/database-design] |
| Security details | @[skills/security-hardening] |
✅ Decision Checklist
Before designing an API:
- Asked user about API consumers?
- Chosen API style for THIS context? (REST/GraphQL/tRPC)
- Defined consistent response format?
- Planned versioning strategy?
- Considered authentication needs?
- Planned rate limiting?
- Documentation approach defined?
❌ Anti-Patterns
DON'T:
- Default to REST for everything
- Use verbs in REST endpoints (/getUsers)
- Return inconsistent response formats
- Expose internal errors to clients
- Skip rate limiting
DO:
- Choose API style based on context
- Ask about client requirements
- Document thoroughly
- Use appropriate status codes
Script
| Script | Purpose | Command |
|---|---|---|
scripts/api_validator.py | API endpoint validation | python scripts/api_validator.py <project_path> |
Signals
- GitHub stars
- 32k
- Forks
- 4k
- Last commit
- Sep 2026
Others that do the same job
Questions
- Does it help choose between REST, GraphQL and tRPC?
- Yes. The api-style.md guide provides a decision tree for selecting the API style that fits the context, and the skill instructs the agent to ask about API consumers before choosing.
- Does it cover authentication?
- Yes. The auth.md guide covers JWT, OAuth, Passkey and API Keys for auth pattern selection.
- Can it check an existing project?
- Yes. The skill includes scripts/api_validator.py, which the agent can run with a project path to validate API endpoints.
Advanced
- Item type
- skill
- Key
api-patterns-davila7- Source
- github.com/davila7/claude-code-templates