agentleFS
agentsdanceagentsdance/agentskills/skills/rest-api-designer/SKILL.md

rest-api-designer

Skill3 starsChanged 11 months agoApache-2.0View on GitHub

Design RESTful APIs with best practices. Use when the user needs to create API endpoints, design resource structures, or plan API architecture.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

REST API Designer

Design clean, consistent RESTful APIs following best practices.

REST Principles

PrincipleDescription
StatelessEach request contains all needed info
Resource-basedURLs represent resources, not actions
HTTP methodsGET, POST, PUT, PATCH, DELETE
Standard status codes200, 201, 400, 401, 404, 500

URL Patterns

GET    /users           # List users
GET    /users/:id       # Get user
POST   /users           # Create user
PUT    /users/:id       # Replace user
PATCH  /users/:id       # Update user
DELETE /users/:id       # Delete user

GET    /users/:id/orders    # User's orders (nested)
GET    /orders?user_id=123  # Filter orders (query param)

Response Format

{
  "data": {
    "id": "123",
    "type": "user",
    "attributes": {
      "name": "John Doe",
      "email": "john@example.com"
    }
  },
  "meta": {
    "requestId": "abc-123"
  }
}

Pagination

{
  "data": [...],
  "meta": {
    "page": 1,
    "perPage": 20,
    "total": 100,
    "totalPages": 5
  },
  "links": {
    "first": "/users?page=1",
    "prev": null,
    "next": "/users?page=2",
    "last": "/users?page=5"
  }
}

Error Responses

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request data",
    "details": [
      { "field": "email", "message": "Invalid email format" }
    ]
  }
}

HTTP Status Codes

CodeMeaningUse Case
200OKSuccessful GET/PUT/PATCH
201CreatedSuccessful POST
204No ContentSuccessful DELETE
400Bad RequestValidation error
401UnauthorizedAuth required
403ForbiddenNo permission
404Not FoundResource missing
500Server ErrorUnexpected error

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.