REST API Endpoint Designer
Designs RESTful API endpoints following OpenAPI spec and industry best practices.
Best use case
REST API Endpoint Designer is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Designs RESTful API endpoints following OpenAPI spec and industry best practices.
Teams using REST API Endpoint Designer should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/api-endpoint-designer/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How REST API Endpoint Designer Compares
| Feature / Agent | REST API Endpoint Designer | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Designs RESTful API endpoints following OpenAPI spec and industry best practices.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# 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-members` resource. 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 /sessions` not `POST /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 body
- `201` — resource created (include `Location` header)
- `204` — success with no body (DELETE, some PATCH)
- `400` — bad request / validation error (include which field failed)
- `401` — not authenticated
- `403` — authenticated but not authorized
- `404` — resource not found
- `409` — 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:
```json
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Human-readable description",
"details": [
{ "field": "email", "message": "must be a valid email address" }
]
}
}
```
### 5. Output format
Produce:
1. A table listing each endpoint with method, path, description, and auth requirement
2. An OpenAPI 3.1 YAML snippet for each endpoint
3. Implementation notes (e.g., pagination defaults, required indexes, rate limiting recommendations)
## Example
**Input to Agent:**
> "Design CRUD endpoints for a `posts` resource. 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**
```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.status` and `posts.authorId` for the list endpoint filters
- Enforce `limit <= 100` server-side, not just in the spec
- `PATCH /posts/{postId}` should check `authorId === currentUser.id` before applying changes — return `403` if 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.Related Skills
LangGraph State Machine Designer
Converts a workflow description into a LangGraph node/edge graph with typed state, conditional routing, and human-in-the-loop checkpoints.
Unit Test Writer
Generates comprehensive unit tests for any function or module with edge cases.
Unit Test Improver
Reviews existing unit tests for gaps, weak assertions, and missing edge cases, then rewrites them to be more robust.
Troubleshooting Guide Builder
Builds a structured troubleshooting guide with symptom → cause → fix format for any tool or system.
Tech Debt Auditor
Identifies and prioritizes technical debt in a codebase with an effort/impact matrix.
Technical Blog Post Writer
Writes engaging, accurate technical blog posts targeted at developer audiences.
Stack Trace Analyzer
Interprets error stack traces to pinpoint root cause, explain what went wrong, and suggest fixes.
SQL Query Optimizer
Reviews SQL queries for performance issues and rewrites them with optimized execution plans.
Sprint Summary Generator
Converts a list of completed tickets or commits into a clear sprint summary for stakeholders.
Social Post Thread Writer
Converts a blog post, idea, or document into an engaging Twitter/X or LinkedIn thread with hooks and CTAs.
SEO Metadata Generator
Generates optimized title tags, meta descriptions, Open Graph tags, and structured data for any web page.
SEO Content Optimizer
Analyzes and rewrites content to maximize search engine visibility without sounding robotic.