REST API Endpoint Designer
Skill9 starsChanged 8 months agoMITView on GitHub
Designs RESTful API endpoints following OpenAPI spec and industry best practices.
In this repository61 other files it gives its agents.
- Accessibility Audit HelperSkill
- Agent Context File WriterSkill
- Agent Evaluation Framework BuilderSkill
- AI Feature Spec WriterSkill
- API Documentation GeneratorSkill
- Architecture ExplainerSkill
- Article RepurposerSkill
- Auth Flow PlannerSkill
- Blog Outline GeneratorSkill
- Breaking Change DetectorSkill
- Bug Root Cause AnalyzerSkill
- Caching Strategy AdvisorSkill
- Changelog CuratorSkill
- Code Review ChecklistSkill
- Database Schema ReviewerSkill
- Docker Compose GeneratorSkill
- Documentation Gap FinderSkill
- Edge Case DiscoverySkill
- Error Log SummarizerSkill
- FAQ GeneratorSkill
- Flaky Test AnalyzerSkill
- Form UX OptimizerSkill
- Git Commit WriterSkill
- Hallucination Risk ReviewerSkill
- Hybrid Search ArchitectSkill
- Incident Postmortem WriterSkill
- Issue to PR PlannerSkill
- Landing Page Copy ImproverSkill
- LangGraph State Machine DesignerSkill
- LLM Cost OptimizerSkill
- LLM Tracing and Observability SetupSkill
- MCP Integration AssistantSkill
- MCP Server BuilderSkill
- Migration Guide WriterSkill
- Newsletter Summary WriterSkill
- Observability ChecklistSkill
- Playwright Test BuilderSkill
- PR Description WriterSkill
- Prompt Injection Defense AuditorSkill
- Prompt RefinerSkill
- Prompt Version Control WorkflowSkill
- RAG Chunking Strategy AdvisorSkill
- RAG Workflow PlannerSkill
- React Component ReviewerSkill
- README WriterSkill
- Refactor PlannerSkill
- Release Notes GeneratorSkill
- Responsive Layout ReviewerSkill
- SDK Quickstart WriterSkill
- SEO Content OptimizerSkill
- SEO Metadata GeneratorSkill
- Social Post Thread WriterSkill
- Sprint Summary GeneratorSkill
- SQL Query OptimizerSkill
- Stack Trace AnalyzerSkill
- Technical Blog Post WriterSkill
- Tech Debt AuditorSkill
- Troubleshooting Guide BuilderSkill
- Unit Test ImproverSkill
- Unit Test WriterSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 4 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
Use this when starting a new API resource, reviewing an existing endpoint design, or when you want a second opinion on naming conventions …
- Distinctive: line 35
When asked to design REST API endpoints, follow these rules:
- Very specific: line 39
Use plural nouns for resource collections: /users, /orders, /blog-posts
- Very specific: line 40
Use kebab-case for multi-word resources: /blog-posts, not /blogPosts
- Very specific: line 41
Use path parameters for specific resources: /users/{userId}
- Very specific: line 42
Use nested resources only when the relationship is truly hierarchical: /users/{userId}/orders
- Very specific: line 43
Avoid verbs in URLs — the HTTP method is the verb: POST /sessions not POST /login
- Very specific: line 44
Use query parameters for filtering, sorting, and pagination: GET /users?role=admin&sort=created_at&order=desc&page=2&limit=20
- Distinctive: line 59
Always return the most specific correct code:
- Distinctive: line 73
All error responses must follow this consistent shape:
- Very specific: line 241
Consider a GET /posts?authorId={userId} filter for profile pages
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
REST API Endpoint Designer
What this skill does
This skill directs the agent to design RESTful API endpoints for a given resource or feature — including URL structure, HTTP methods, request/response schemas, status codes, and error formats. It outputs a complete OpenAPI 3.1 YAML snippet that can be dropped directly into your API spec, along with implementation notes.
Use this when starting a new API resource, reviewing an existing endpoint design, or when you want a second opinion on naming conventions and status code choices.
How to use
Claude Code / Cursor / Codex
Copy this file to .agents/skills/api-endpoint-designer/SKILL.md in your project root (for Claude Code), or add the instructions to your .cursorrules (for Cursor).
Then ask:
- "Design the REST endpoints for a blog post resource using the REST API Endpoint Designer skill."
- "I need CRUD endpoints for a
team-membersresource. Use the REST API Endpoint Designer skill."
Provide the resource name, any existing conventions in your API (e.g., base path, auth method), and any fields the resource should have.
The Prompt / Instructions for the Agent
When asked to design REST API endpoints, follow these rules:
1. URL naming conventions
- Use plural nouns for resource collections:
/users,/orders,/blog-posts - Use kebab-case for multi-word resources:
/blog-posts, not/blogPosts - Use path parameters for specific resources:
/users/{userId} - Use nested resources only when the relationship is truly hierarchical:
/users/{userId}/orders - Avoid verbs in URLs — the HTTP method is the verb:
POST /sessionsnotPOST /login - Use query parameters for filtering, sorting, and pagination:
GET /users?role=admin&sort=created_at&order=desc&page=2&limit=20
2. HTTP method selection
| Action | Method | Notes |
| List resources | GET | Paginated, filterable |
| Get one resource | GET | By ID in path |
| Create | POST | Body contains new resource |
| Full replace | PUT | Idempotent — replaces entire resource |
| Partial update | PATCH | Only fields provided are updated |
| Delete | DELETE | Returns 204 No Content on success |
3. Status codes
Always return the most specific correct code:
200— success with body201— resource created (includeLocationheader)204— success with no body (DELETE, some PATCH)400— bad request / validation error (include which field failed)401— not authenticated403— authenticated but not authorized404— resource not found409— conflict (e.g., duplicate email)422— unprocessable entity (semantic validation failed)500— internal server error (never leak stack traces)
4. Error response format
All error responses must follow this consistent shape:
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Human-readable description",
"details": [
{ "field": "email", "message": "must be a valid email address" }
]
}
}5. Output format
Produce:
- A table listing each endpoint with method, path, description, and auth requirement
- An OpenAPI 3.1 YAML snippet for each endpoint
- Implementation notes (e.g., pagination defaults, required indexes, rate limiting recommendations)
Example
Input to Agent:
"Design CRUD endpoints for a
postsresource. Fields: title (string, required), body (string, required), authorId (string, required), status (draft | published, default: draft). Auth is required for create/update/delete. Use the REST API Endpoint Designer skill."
Output from Agent:
Endpoints
| Method | Path | Description | Auth Required |
| GET | /posts | List posts (paginated, filterable by status) | No |
| GET | /posts/{postId} | Get a single post | No |
| POST | /posts | Create a new post | Yes |
| PATCH | /posts/{postId} | Update post fields | Yes (author only) |
| DELETE | /posts/{postId} | Delete a post | Yes (author only) |
OpenAPI YAML
paths:
/posts:
get:
summary: List posts
operationId: listPosts
tags: [Posts]
parameters:
- name: status
in: query
schema:
type: string
enum: [draft, published]
- name: page
in: query
schema:
type: integer
default: 1
- name: limit
in: query
schema:
type: integer
default: 20
maximum: 100
responses:
'200':
description: Paginated list of posts
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Post'
meta:
$ref: '#/components/schemas/PaginationMeta'
post:
summary: Create a post
operationId: createPost
tags: [Posts]
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreatePostInput'
responses:
'201':
description: Post created
headers:
Location:
schema:
type: string
example: /posts/abc123
content:
application/json:
schema:
$ref: '#/components/schemas/Post'
'400':
$ref: '#/components/responses/ValidationError'
'401':
$ref: '#/components/responses/Unauthorized'
/posts/{postId}:
get:
summary: Get a post
operationId: getPost
tags: [Posts]
parameters:
- $ref: '#/components/parameters/PostId'
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Post'
'404':
$ref: '#/components/responses/NotFound'
patch:
summary: Update a post
operationId: updatePost
tags: [Posts]
security:
- bearerAuth: []
parameters:
- $ref: '#/components/parameters/PostId'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UpdatePostInput'
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Post'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
delete:
summary: Delete a post
operationId: deletePost
tags: [Posts]
security:
- bearerAuth: []
parameters:
- $ref: '#/components/parameters/PostId'
responses:
'204':
description: Post deleted
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'Implementation Notes
- Index
posts.statusandposts.authorIdfor the list endpoint filters - Enforce
limit <= 100server-side, not just in the spec PATCH /posts/{postId}should checkauthorId === currentUser.idbefore applying changes — return403if not- Consider a
GET /posts?authorId={userId}filter for profile pages
Notes
- By default this skill outputs OpenAPI 3.1 YAML. Ask for JSON or an earlier version (3.0, 2.0/Swagger) if needed.
- The skill does not generate implementation code — only the API contract. Use the Unit Test Writer or another skill for implementation.
- For GraphQL or gRPC APIs, this skill is not the right tool — it is designed for REST only.
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.

