api-design
Skill8 starsChanged 2 months 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
125 other projects use a version of this.
Adopted by
Most recently taken up by
- AllThingsSmitty/proven-skillstheir own version, first seen Oct 6, 2026
- Lukk17/agent-standardstheir own version, first seen Oct 5, 2026
- SkillMedev/api-integration-engineeringtheir own version, first seen Oct 5, 2026
- SkillMedev/full-stack-web-devtheir own version, first seen Oct 5, 2026
- cellrishi-code/claude-skills-atlastheir own version, first seen Oct 4, 2026
- vekzz-dev/opencode-skillstheir own version, first seen Oct 3, 2026
Used with
Projects with it also use data-modeling, ci-pipeline 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.
mmondoraSkilldata-modeling
Schema design, multi-tenant data isolation, and migration management. Firestore and PostgreSQL patterns, RLS, UUID v7 conventions. Use when designing database schemas, writing migrations, or implementing multi-tenant data access.
Also in 7 projects that use this
vndeeSkillci-pipeline
Use when creating or updating CI/CD pipelines with GitHub Actions or GitLab CI for Go, Python, or React projects
Also in 4 projects that use this
pluginagentmarketplaceSkillmicroservices
Microservices architecture patterns and best practices. Service decomposition, inter-service communication, and distributed data management.
Also in 4 projects that use this
kevinaimonsterSkilltypescript-strict
TypeScript strict mode and advanced type system assistant. Helps write strictly-typed TypeScript code with generics, type guards, utility types, conditional types, mapped types, and template literal types. Trigger when user says 'TypeScript types' 'type gymnastics' 'TypeScript generics' 'strict TypeScript' 'type guard' 'TS类型' 'TypeScript严格模式' '类型体操' '泛型怎么写' 'TS type help'. Keywords: TypeScript, strict mode, generics, type guard, utility types, conditional types, mapped types, template literal types, infer, extends, keyof, typeof, type narrowing, discriminated unions, type assertion, type predicate, type gymnastics, TS, 类型体操, 泛型, 类型守卫, 严格类型
Also in 4 projects that use this
InfopibeSkilldeployment-patterns
Deployment workflows, CI/CD pipeline patterns, Docker containerization, health checks, rollback strategies, and production readiness checklists for web applications.
Also in 10 projects that use this
DatabricksSkillload-testing
Load test a Databricks App to find its maximum QPS. Use when: (1) User says 'load test', 'benchmark', 'QPS', 'throughput', or 'performance test', (2) User wants to find how many queries per second their app can handle, (3) User wants to set up load testing scripts for their agent, (4) User wants to view load test results/dashboard, (5) User wants to validate results or observe latency/error rate with MLflow tracing.
Also in 4 projects that use this
Other versions125 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 125
- xu-xiang/everything-claude-code-zh★ 2ksame name
- Aaronontheweb/dotnet-skills★ 1.2ksame name
- nth5693/gemini-kit★ 373same name
- loulanyue/awesome-claude-notes★ 272same name
- KbWen/agentic-os★ 206same name
- margelo/react-native-skills★ 173same name
- tpavanipradeep/everything-claude-code★ 134same name
- templetongroup/radiant★ 113same name
- cohen-liel/hivemind★ 110same name
- microsoft/haste★ 106same name
115 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 104 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 104 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.

