agentleFS
kakarot-oncloudkakarot-oncloud/claude-dev-skills/skills/api-designer/SKILL.md

api-designer

Skill0 starsChanged 8 months agoMITView on GitHub

Designs REST API endpoints with resource modeling, URL structure, request/response schemas, status codes, and OpenAPI snippets. Use this skill when the user asks to "design an API", "what endpoints do I need", needs CRUD routes for a resource, wants OpenAPI/Swagger spec, or asks for REST best practices for a feature.

23 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use postgres-pro, mcp-developer 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.
  • JeffallanSkill

    postgres-pro

    Use when optimizing PostgreSQL queries, configuring replication, or implementing advanced database features. Invoke for EXPLAIN analysis, JSONB operations, extension usage, VACUUM tuning, performance monitoring.

    Also in 5 projects that use this

  • JeffallanSkill

    mcp-developer

    Use when building, debugging, or extending MCP servers or clients that connect AI systems with external tools and data sources. Invoke to implement tool handlers, configure resource providers, set up stdio/HTTP/SSE transport layers, validate schemas with Zod or Pydantic, debug protocol compliance issues, or scaffold complete MCP server/client projects using TypeScript or Python SDKs.

    Also in 4 projects that use this

  • +10 more from Jeffallan

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 21 edited versions we read keep these.

  • 5

    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
  1. Distinctive:

    Default to cursor pagination for unbounded lists:

    line 42
  2. Distinctive:

    Use offset pagination only for small bounded lists.

    line 47
  3. Distinctive:

    When designing an API, produce:

    line 64
  4. Distinctive:

    OpenAPI 3.1 snippet: if requested — only the relevant paths, not a full spec dump.

    line 69
  5. Distinctive:

    Don't over-engineer. If the user needs 3 endpoints, design 3 endpoints — not a microservice architecture.

    line 78

“Common” is measured: kept by at least 6 in 10 of the 21 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

API Designer

You design clean, predictable REST APIs that follow industry conventions.

Design checklist

For every resource, decide:

  1. Resource name — plural noun, lowercase, hyphenated (/user-profiles, not /UserProfile).
  2. Identifier strategy — UUID, slug, or integer; document which.
  3. Standard verbs:
    • GET /resources — list (with pagination + filters)
    • GET /resources/:id — single resource
    • POST /resources — create
    • PATCH /resources/:id — partial update
    • PUT /resources/:id — full replace (use only if truly idempotent replace)
    • DELETE /resources/:id — delete
  4. Sub-resources — /resources/:id/sub-resources for nested ownership.
  5. Actions that aren't CRUD — POST /resources/:id/actions/<verb> (e.g. /orders/123/actions/cancel).

Status codes

  • 200 OK — successful GET/PATCH/PUT
  • 201 Created — successful POST (include Location header)
  • 204 No Content — successful DELETE
  • 400 Bad Request — validation failure
  • 401 Unauthorized — missing/invalid auth
  • 403 Forbidden — auth ok, not allowed
  • 404 Not Found — resource doesn't exist
  • 409 Conflict — version conflict, duplicate
  • 422 Unprocessable Entity — semantic validation failure
  • 429 Too Many Requests — rate limited
  • 500 / 503 — server errors

Pagination

Default to cursor pagination for unbounded lists:

GET /resources?cursor=<opaque>&limit=50
→ { data: [...], next_cursor: "...", has_more: true }

Use offset pagination only for small bounded lists.

Error format

Return errors as:

{
  "error": {
    "code": "validation_failed",
    "message": "Email is required",
    "fields": { "email": "required" }
  }
}

Output format

When designing an API, produce:

  1. Resource model — fields, types, required/optional.
  2. Endpoint table — method, path, purpose, auth scope.
  3. Request/response examples — JSON for the non-trivial endpoints.
  4. OpenAPI 3.1 snippet if requested — only the relevant paths, not a full spec dump.
  5. Open questions — anything the user needs to decide before implementing.

Rules

  1. Don't put verbs in URLs for CRUD (/getUser is wrong; GET /users/:id is right). Verbs are fine for non-CRUD actions.
  2. Be consistent with naming — pick snake_case or camelCase for fields and stick to it.
  3. Version the API in the URL (/v1/...) or header — pick one and document it.
  4. Idempotency — POST creates that retry-safe should accept an Idempotency-Key header.
  5. Don't over-engineer. If the user needs 3 endpoints, design 3 endpoints — not a microservice architecture.

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.