rest-api-endpoint-designer
Designs RESTful API endpoints following OpenAPI spec and industry best practices.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Designs RESTful API endpoints following OpenAPI spec and industry best practices.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
Runs a systematic checklist review on any code diff or file, covering correctness, security, performance, and readability.
Writes a high-quality CLAUDE.md, .cursorrules, or .windsurfrules file that gives a coding agent the right project context, conventions, and constraints to work effectively.
Designs an eval suite for an LLM agent or pipeline including success metrics, trajectory scoring, LLM-as-judge setup, and regression test cases.
Designs a hybrid retrieval pipeline combining dense vector search and BM25 sparse search with reciprocal rank fusion, and explains when to use each configuration.
Converts a workflow description into a LangGraph node/edge graph with typed state, conditional routing, and human-in-the-loop checkpoints.
Audits an AI application for unnecessary token spend and recommends prompt caching, model routing, and token reduction techniques to cut costs.
استنادا إلى تصنيف SOC المهني
| name | REST API Endpoint Designer |
| description | Designs RESTful API endpoints following OpenAPI spec and industry best practices. |
| category | coding |
| tags | ["api","rest","openapi","backend"] |
| author | simplyutils |
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.
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:
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.
When asked to design REST API endpoints, follow these rules:
/users, /orders, /blog-posts/blog-posts, not /blogPosts/users/{userId}/users/{userId}/ordersPOST /sessions not POST /loginGET /users?role=admin&sort=created_at&order=desc&page=2&limit=20| 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 |
Always return the most specific correct code:
200 — success with body201 — resource created (include Location header)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)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" }
]
}
}
Produce:
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
posts.status and posts.authorId for the list endpoint filterslimit <= 100 server-side, not just in the specPATCH /posts/{postId} should check authorId === currentUser.id before applying changes — return 403 if notGET /posts?authorId={userId} filter for profile pages