Skip to content
Back to skills

Api Patterns

ASecurity

API design decisions - REST vs GraphQL vs tRPC, responses, versioning, auth, rate limits. Use when designing an API.

  • 6 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 5, 2026
developmenttypescriptpythonnodenodejstestingapidatabasesecuritydocumentation

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 11 files and shows the line behind each finding

Scanned December 5, 2026

npx -y skills add Reprograme/redevkit --skill api-patterns --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Api Patterns?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Api Patterns
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/reprograme-api-patterns/badge)](https://www.skillsdirectory.com/skills/reprograme-api-patterns)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: api-patterns
description: API design decisions - REST vs GraphQL vs tRPC, responses, versioning, auth, rate limits. Use when designing an API.
---

# API Patterns

> API design principles and decision-making.
> **Learn to THINK, not copy fixed patterns.**

## Selective Reading Rule

Read ONLY the references relevant to the request. Check the content map and open what you need.

## Content Map

| Reference | Description | When to read |
| --- | --- | --- |
| [api-style](references/api-style.md) | REST vs GraphQL vs tRPC decision tree | Choosing the API type |
| [rest](references/rest.md) | Resource naming, HTTP methods, status codes | Designing a REST API |
| [response](references/response.md) | Envelope pattern, error format, pagination | Response structure |
| [graphql](references/graphql.md) | Schema design, when to use, security | Considering GraphQL |
| [trpc](references/trpc.md) | TypeScript monorepo, type safety | TS full-stack projects |
| [versioning](references/versioning.md) | URI/Header/Query versioning | Planning API evolution |
| [auth](references/auth.md) | JWT, OAuth, Passkey, API keys | Choosing an auth pattern |
| [rate-limiting](references/rate-limiting.md) | Token bucket, sliding window | API protection |
| [documentation](references/documentation.md) | OpenAPI/Swagger best practices | Documentation |
| [security-testing](references/security-testing.md) | OWASP API Top 10, auth/authz testing | Security reviews |

## Related Skills

| Need | Skill |
| --- | --- |
| API implementation | `{{SKILL:nodejs-best-practices}}`, `{{SKILL:python-patterns}}` |
| Data structure | `{{SKILL:database-design}}` |
| Security details | `{{SKILL:vulnerability-scanner}}` |

## Decision Checklist

Before designing an API:

- [ ] **Asked about the API consumers?**
- [ ] **Chosen the API style for THIS context?** (REST/GraphQL/tRPC)
- [ ] **Defined a consistent response format?**
- [ ] **Planned the versioning strategy?**
- [ ] **Considered authentication needs?**
- [ ] **Planned rate limiting?**
- [ ] **Defined the documentation approach?**

## 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 the API style based on context
- Ask about client requirements
- Document thoroughly
- Use appropriate status codes

## Audit

| Audit | Purpose |
| --- | --- |
| `api_validator.py` | API endpoint checks: OpenAPI specs, response formats, common issues |

In the verify command's audit step (not during implementation), when its orchestrator did not already run it, run `.redevkit/audits/api_validator.py <project_path>` with the Python interpreter detected
per `.redevkit/audits/README.md`. If no Python is available, the audit is
`SKIPPED (no Python)`: say so and fall back to the project's own commands (contract tests,
OpenAPI linting, the test suite). Never report a skipped audit as PASS.

Files in this skill

  • SKILL.md2.9 KB
  • references/api-style.md1.1 KB
  • references/auth.md580 B
  • references/documentation.md557 B
  • references/graphql.md989 B
  • references/rate-limiting.md734 B
  • references/response.md929 B
  • references/rest.md1.3 KB
  • references/security-testing.md2.8 KB
  • references/trpc.md813 B
  • references/versioning.md655 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.