API design principles and decision-making. REST vs GraphQL vs tRPC selection, response formats, versioning, pagination.
Add this skill
npx mdskills install sickn33/api-patternsWell-organized decision framework with content map and checklist but lacks step-by-step guidance
1---2name: api-patterns3description: API design principles and decision-making. REST vs GraphQL vs tRPC selection, response formats, versioning, pagination.4allowed-tools: Read, Write, Edit, Glob, Grep5---67# API Patterns89> API design principles and decision-making for 2025.10> **Learn to THINK, not copy fixed patterns.**1112## 🎯 Selective Reading Rule1314**Read ONLY files relevant to the request!** Check the content map, find what you need.1516---1718## 📑 Content Map1920| File | Description | When to Read |21|------|-------------|--------------|22| `api-style.md` | REST vs GraphQL vs tRPC decision tree | Choosing API type |23| `rest.md` | Resource naming, HTTP methods, status codes | Designing REST API |24| `response.md` | Envelope pattern, error format, pagination | Response structure |25| `graphql.md` | Schema design, when to use, security | Considering GraphQL |26| `trpc.md` | TypeScript monorepo, type safety | TS fullstack projects |27| `versioning.md` | URI/Header/Query versioning | API evolution planning |28| `auth.md` | JWT, OAuth, Passkey, API Keys | Auth pattern selection |29| `rate-limiting.md` | Token bucket, sliding window | API protection |30| `documentation.md` | OpenAPI/Swagger best practices | Documentation |31| `security-testing.md` | OWASP API Top 10, auth/authz testing | Security audits |3233---3435## 🔗 Related Skills3637| Need | Skill |38|------|-------|39| API implementation | `@[skills/backend-development]` |40| Data structure | `@[skills/database-design]` |41| Security details | `@[skills/security-hardening]` |4243---4445## ✅ Decision Checklist4647Before designing an API:4849- [ ] **Asked user about API consumers?**50- [ ] **Chosen API style for THIS context?** (REST/GraphQL/tRPC)51- [ ] **Defined consistent response format?**52- [ ] **Planned versioning strategy?**53- [ ] **Considered authentication needs?**54- [ ] **Planned rate limiting?**55- [ ] **Documentation approach defined?**5657---5859## ❌ Anti-Patterns6061**DON'T:**62- Default to REST for everything63- Use verbs in REST endpoints (/getUsers)64- Return inconsistent response formats65- Expose internal errors to clients66- Skip rate limiting6768**DO:**69- Choose API style based on context70- Ask about client requirements71- Document thoroughly72- Use appropriate status codes7374---7576## Script7778| Script | Purpose | Command |79|--------|---------|---------|80| `scripts/api_validator.py` | API endpoint validation | `python scripts/api_validator.py <project_path>` |8182
Full transparency — inspect the skill content before installing.