agentleFS
YauhenBichelYauhenBichel/engineering-skills/skills/design-api/SKILL.md

design-api

Skill0 starsChanged 53 days agoApache-2.0View on GitHub

Designs an HTTP or library API: endpoints or functions, inputs, outputs, errors, versioning. Use before implementing a public interface.

7 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Add pagination, idempotency, and versioning.

    line 10

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

Steps

  1. Define resource paths and HTTP methods. Use plural nouns (/tasks, /users). Map GET for retrieval, POST for creation, PUT for full updates, PATCH for partial updates, DELETE for removal.
  2. Draft request and response examples. Use JSON. Example: POST /v1/tasks body {"title": "fix auth"}. Response 201 Created with {"id": "t_123", "status": "open"}.
  3. Specify the error model. Return standard HTTP codes. 400 for malformed input, 401 for missing auth, 403 for insufficient permissions, 404 for missing resources, 422 for validation failures, 429 for rate limits. Include {"error": "code", "message": "string"}.
  4. Add pagination, idempotency, and versioning. Use ?page=1&limit=20 with Link headers. Accept an Idempotency-Key header on POST (PUT and DELETE are idempotent by definition). Prefix all paths with /v1/.
  5. Define boundary validation. Reject unknown fields. Enforce types, formats, and ranges. Return 422 with field-level error arrays.
  6. Generate the contract. Write OpenAPI 3.1 YAML or TypeScript interfaces. Validate with swagger-cli validate or tsc.

Checklist

  • Paths use plural nouns and standard HTTP methods
  • Request/response examples match the contract
  • Error codes follow the specified model
  • Pagination, idempotency keys, and /v1/ prefix are defined
  • Validation rules cover all required fields and types
  • OpenAPI spec or type signatures are complete
  • No business logic leaks into the interface

Output

  • Path definitions and method mappings
  • JSON request/response examples
  • OpenAPI YAML or TypeScript interfaces
  • Validation and error handling rules

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.