api-patterns
API design, versioning, testing, schema validation, and contract testing patterns for REST and GraphQL APIs.
npx skills add vibeeval/vibecosystem --skill api-patterns --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# API Patterns REST and GraphQL API design patterns for consistent, versioned, and well-tested interfaces. ## API Versioning ### URL-Based Versioning ```typescript // routes/v1/markets.ts // routes/v2/markets.ts // URL: /api/v1/markets, /api/v2/markets // Express router setup import { Router } from 'express' const v1Router = Router() const v2Router = Router() app.use('/api/v1', v1Router) app.use('/api/v2', v2Router) // Deprecation header middleware function deprecationWarning(version: string, sunsetDate: string) { return (_req: Request, res: Response, next: NextFunction) => { res.setHeader('Deprecation', 'true') res.setHeader('Sunset', sunsetDate) res.setHeader('Link', `</api/v${parseInt(version) + 1}>; rel="successor-version"`) next() } } v1Router.use(deprecationWarning('1', 'Sat, 01 Jan 2027 00:00:00 GMT')) ``` ### Header-Based Versioning ```typescript // Accept: application/vnd.api+json;version=2 function versionMiddleware(req: Request, res: Response, next: NextFunction) { const accept = req.headers['accept'] || '' const match = accept.match(/version=(\d+)/) req.apiVersion = match ? parseInt(match[1]) : 1 next() } ``` ## Schema Validation with Zod ### Request + Response Validati
- API Versioning
- URL-Based Versioning
- Header-Based Versioning
- Schema Validation with Zod
- Request + Response Validation
- Standardized Error Responses
- Pagination Patterns
- Cursor-Based Pagination (Recommended for large datasets)
- Offset Pagination (Simple use cases)
- Rate Limiting
- Token Bucket with Redis
- API Endpoint Testing
- Breaking Change Detection Checklist
- OpenAPI Spec Generation
What does the api-patterns skill do?
API design, versioning, testing, schema validation, and contract testing patterns for REST and GraphQL APIs.
How do I install it?
Run `npx skills add vibeeval/vibecosystem --skill api-patterns --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From vibeeval/vibecosystem, a repository with 521 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
