api-design
Skill8 starsChanged 43 days agoMITView on GitHub
Design RESTful APIs with consistent conventions for resource URLs, response shapes, HTTP semantics, versioning, and security across every service in the project.
- Sends data out
191 other projects use a version of this.
Adopted by
Most recently taken up by
- RostislavDugin/postgresustheir own version, first seen Nov 8, 2026
- Markssuave/Markssuave-Agent-skillstheir own version, first seen Nov 8, 2026
- Rojios/everything-claude-codetheir own version, first seen Nov 8, 2026
- ishandutta2007/Awesome-Claude-Skillstheir own version, first seen Nov 8, 2026
- databasus/databasustheir own version, first seen Nov 8, 2026
- lhbsaa/apex-unifiedtheir own version, first seen Nov 8, 2026
Used with
Projects with it also use db-design, everything-claude-code and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
yuexueyuSkilldb-design
数据库工程师技能 - Schema设计、索引优化、并发安全、数据库审计。当你涉及数据库表/字段/索引/SQL/迁移/MCP数据库操作、建表改表、写查询时必须使用此技能。即使用户只是说"加个字段"或"查下数据",也应触发。
Also in 4 projects that use this
InfopibeSkilleverything-claude-code
Also in 9 projects that use this
mryeastcodeSkilleverything-claude-code-conventions
Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.
Also in 8 projects that use this
tpavanipradeepSkillnextjs-turbopack
Next.js 16+ and Turbopack — incremental bundling, FS caching, dev speed, and when to use Turbopack vs webpack.
Also in 15 projects that use this
Indium-AI-LabsSkilldata-pipeline-design
Design batch or incremental ETL and ELT pipelines and warehouse models: grain, partitioning, idempotent loads, late-arriving data, data quality tests, PII controls, and cost monitoring, before building them. Use when adding or changing a dbt model, warehouse table, scheduled transformation, or ingestion job. Not for transactional schema design (use the database-design skill) or event-sourced stores (use the event-sourcing-architecture skill).
Also in 3 projects that use this
thejordanleopoldSkillthird-party-integration
Use when integrating with external APIs, payment processors (Stripe), webhooks, or third-party services. Use when implementing API clients with authentication and rate limiting, handling webhooks with signature verification and idempotency, writing contract tests for external services, or isolating third-party dependencies behind adapters. Triggers: \"Stripe\", \"payment integration\", \"webhook\", \"third-party API\", \"external service\", \"API client\", \"integrate with\", \"signature verification\", \"idempotency key\".
Also in 3 projects that use this
Other versions191 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 191
- affaan-m/ECC★ 246ksame name
- databasus/databasus★ 9.3ksame name
- RostislavDugin/postgresus★ 9.3ksame name
- authgear/authgear-server★ 2.1ksame name
- xu-xiang/everything-claude-code-zh★ 1.9ksame name
- Aaronontheweb/dotnet-skills★ 1.2ksame name
- epam/ai-dial-chat★ 501same name
- loulanyue/awesome-claude-notes★ 272same name
- KbWen/agentic-os★ 229same name
- DevelopersGlobal/ai-agent-skills★ 216same name
181 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository21 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- context/CLAUDE.mdCLAUDE.md
- backendSkill
- cavemanSkill
- commitSkill
- evaluator-optimizerSkill
- frontend-design-systemSkill
- interactive-live-testingSkill
- module-planningSkill
- multi-agent-orchestrationSkill
- plan-featureSkill
- prSkill
- ralph-loopSkill
- review-boardSkill
- reviewSkill
- systematic-debuggingSkill
- tdd-workflowSkill
- verification-before-completionSkill
- verificationSkill
- work-recordingSkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 6 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 165 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 238
Document all error cases (including business-rule violations, not just HTTP errors)
- Distinctive: line 243
Check security implications (input surfaces, auth gaps, sensitive field exposure)
- Distinctive: line 244
Consider backward compatibility if the service is already deployed
- Distinctive: line 247
Create endpoint specs using the template above
- Distinctive: line 248
Add to the project's API documentation
- Distinctive: line 295
Use a schema library (Zod, Joi, Yup, Pydantic, etc.) for type safety
“Common” is measured: kept by at least 6 in 10 of the 165 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
API Design Skill
Skill Metadata
- Name: api-design
- Description: Design RESTful APIs with consistent conventions across all services
- User Invocable: Yes (via
/api-design)
Overview
This skill guides the design of RESTful APIs for any backend service, ensuring consistency, security, and usability across all endpoints. The discipline is stack-agnostic: the examples below use TypeScript and Zod for concreteness, but the conventions apply equally to Python, Go, Java, or any other language.
API Design Principles
1. Resource-Based URLs
Good
GET /api/v1/users
GET /api/v1/users/:id
POST /api/v1/users
PUT /api/v1/users/:id
DELETE /api/v1/users/:id
Avoid
GET /api/v1/getUsers
POST /api/v1/createUser
POST /api/v1/deleteUser2. Consistent Response Format
{
"success": true,
"data": {
// Resource data
},
"meta": {
"page": 1,
"limit": 20,
"total": 100
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Email is required",
"details": [
{ "field": "email", "message": "Email is required" }
]
}
}3. HTTP Status Codes
| Code | Meaning | Use Case |
| 200 | OK | Successful GET, PUT |
| 201 | Created | Successful POST (created resource) |
| 204 | No Content | Successful DELETE |
| 400 | Bad Request | Validation error |
| 401 | Unauthorized | Missing/invalid auth |
| 403 | Forbidden | Lacks permission |
| 404 | Not Found | Resource not found |
| 409 | Conflict | Duplicate resource |
| 422 | Unprocessable | Business rule violation |
| 500 | Internal Error | Server error |
4. Versioning
/api/v1/users
/api/v2/usersEmbed the version in the URL path. Never negotiate it via a header unless a downstream client framework forces you to.
5. Filtering, Sorting, Pagination
GET /api/v1/users?status=active&sort=-createdAt&page=1&limit=20
# Filter operators
?status=active # Equality
?amount_gte=100 # Greater than or equal
?amount_lte=1000 # Less than or equal
?name_like=john # Contains
# Sorting
?sort=name # Ascending
?sort=-createdAt # Descending (prefix with -)
?sort=status,-createdAt # Multiple fields
# Pagination
?page=1&limit=20 # Page-based
?cursor=abc123&limit=20 # Cursor-basedService Conventions
Authentication
Authorization: Bearer <jwt-token>Service Prefix Pattern
Each bounded context (service or module) owns a prefix. For example:
| Domain | Prefix example |
| Identity / auth | /api/v1/auth, /api/v1/users |
| [CUSTOMIZE: domain] | /api/v1/<resource> |
| Admin | /api/v1/admin/* |
Replace the rows above with your own domains.
Endpoint Patterns
# Collection
GET /api/v1/resources # List (with pagination)
POST /api/v1/resources # Create
# Single resource
GET /api/v1/resources/:id # Get one
PUT /api/v1/resources/:id # Full update
PATCH /api/v1/resources/:id # Partial update
DELETE /api/v1/resources/:id # Delete
# Nested resources
GET /api/v1/users/:id/orders
POST /api/v1/users/:id/profile
# Actions (when CRUD does not fit)
POST /api/v1/orders/:id/approve
POST /api/v1/proposals/:id/voteAPI Design Template
Endpoint Specification
## [Method] [Path]
**Description**: [What this endpoint does]
**Authentication**: Required/Optional/None
**Authorization**: [Role requirements]
### Request
**Headers**:
| Header | Required | Description |
|--------|----------|-------------|
| Authorization | Yes | Bearer token |
| Content-Type | Yes | application/json |
**Path Parameters**:
| Parameter | Type | Description |
|-----------|------|-------------|
| id | string | Resource UUID |
**Query Parameters**:
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| page | number | 1 | Page number |
| limit | number | 20 | Items per page |
**Body**:
```json
{
"field1": "string",
"field2": 123
}Response
Success (200):
{
"success": true,
"data": {
"id": "uuid",
"field1": "value"
}
}Errors:
| Code | Description |
| 400 | Validation failed |
| 404 | Resource not found |
Example
Request:
curl -X POST /api/v1/resources \
-H "Authorization: Bearer token" \
-H "Content-Type: application/json" \
-d '{"field1": "value"}'Response:
{
"success": true,
"data": { "id": "123", "field1": "value" }
}
---
## Workflow
### Phase 1: Requirements
1. Identify the resource or action
2. Define operations needed
3. Identify related resources and dependencies
### Phase 2: Design
1. Define URL structure following the resource-based convention
2. Specify request and response formats
3. Document all error cases (including business-rule violations, not just HTTP errors)
4. Define authentication and authorization requirements
### Phase 3: Validation
1. Review against the conventions in this skill
2. Check security implications (input surfaces, auth gaps, sensitive field exposure)
3. Consider backward compatibility if the service is already deployed
### Phase 4: Documentation
1. Create endpoint specs using the template above
2. Add to the project's API documentation
3. Generate or update the OpenAPI schema
---
## DTO Patterns
### Request DTO
```typescript
// dto.ts
import { z } from 'zod';
export const CreateUserSchema = z.object({
email: z.string().email(),
password: z.string().min(8),
name: z.string().min(1).max(100),
});
export type CreateUserDTO = z.infer<typeof CreateUserSchema>;Adapt the validation library to your stack. The principle is the same: parse inputs at the boundary, reject early, produce typed domain objects.
Response DTO
export interface UserResponseDTO {
id: string;
email: string;
name: string;
createdAt: string;
// Note: never include passwords or secrets in responses
}
export interface ApiResponse<T> {
success: boolean;
data?: T;
error?: ApiError;
meta?: PaginationMeta;
}Security Considerations
Input Validation
- Validate all inputs server-side, regardless of client-side validation
- Use a schema library (Zod, Joi, Yup, Pydantic, etc.) for type safety
- Sanitize strings to prevent XSS and injection
- Enforce string length limits at the schema layer
Rate Limiting
@Throttle({ default: { limit: 10, ttl: 60000 } }) // 10 req/min
@Post('login')
async login() {}Apply tighter limits to auth and sensitive write endpoints. Read endpoints can be more permissive.
Sensitive Operations
- Require re-authentication (or step-up auth) for actions with irreversible effects
- Log all administrative operations with actor identity, timestamp, and parameters
- Implement idempotency keys for any operation that should not run twice (payments, emails, state transitions)
Invocation
Manual
/api-design [resource-name]Example
/api-design ordersOutput Artifacts
- Endpoint Specifications: Detailed documentation using the template above
- DTO Definitions: Request and response type definitions
- Validation Schemas: Schema-library schemas for each input surface
- OpenAPI Spec: Machine-readable API definition for tooling and documentation generation
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

