agentleFS
Kuan-AI-comKuan-AI-com/agent-skills/skills/api-docs/SKILL.md

api-docs

Skill0 starsChanged 6 days agoMITView on GitHub

Write reference documentation or an OpenAPI spec for a REST/HTTP API by reading its source code. Use when the user says "document the API", "write endpoint docs", "generate an OpenAPI/Swagger spec", "what endpoints do we have", or "document this route".

  • Sends data out

18 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use frontend-design.

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.
  • BlockSkill

    frontend-design

    Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 6 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 17 edited versions we read keep these.

  • 6

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

    Document what the code does, not what the endpoint name suggests.

    line 8
  2. Very specific:

    Look for openapi.*, swagger.*, FastAPI (serves /openapi.json), NestJS @nestjs/swagger, drf-spectacular, springdoc, tRPC/GraphQL schemas, or …

    line 12
  3. Distinctive:

    Use the framework's convention, then confirm by searching:

    line 16
  4. Distinctive:

    Auth: follow the middleware chain, decorators or guards.

    line 25
  5. Distinctive:

    Responses: every status the handler returns or throws, plus framework defaults (validation errors are often 400 or 422, unauthenticated …

    line 27
  6. Distinctive:

    If you can run the server locally, call a couple of endpoints with the curl examples and correct any mismatch.

    line 58
  7. Distinctive:

    Put real tokens, keys or customer data in examples.

    line 65

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

Document what the code does, not what the endpoint name suggests. Anything you could not confirm is marked as such.

1. Check for existing specs or generators

Look for openapi.*, swagger.*, FastAPI (serves /openapi.json), NestJS @nestjs/swagger, drf-spectacular, springdoc, tRPC/GraphQL schemas, or zod-to-openapi. If the framework can generate the spec, prefer configuring that over writing one by hand, and say so.

2. Find every route

Use the framework's convention, then confirm by searching:

  • Express/Fastify/Koa: app.get(, router.post(, mounted prefixes from app.use('/prefix', router).
  • Next.js: app/**/route.ts (exported GET, POST...) and pages/api/**.
  • FastAPI/Flask/Django: @app.get, @router.post, @bp.route, urls.py.
  • Rails config/routes.rb, Laravel routes/*.php, Go HandleFunc/router groups, Spring @GetMapping. Build the full path including prefixes and versioning. List the endpoints first and ask if internal or admin ones should be included.

3. For each endpoint, trace the handler

  • Auth: follow the middleware chain, decorators or guards. Note the mechanism (bearer token, session cookie, API key header) and any role or ownership check.
  • Input: path params, query params, headers and body from the validator (zod, joi, pydantic, class-validator, serializers). Copy exact types, required/optional, defaults, enums, min/max, formats.
  • Responses: every status the handler returns or throws, plus framework defaults (validation errors are often 400 or 422, unauthenticated 401, unhandled 500). Take the response shape from the code or the response model.
  • Side effects worth knowing: sends email, charges a card, is not idempotent, rate limited.

4. Write it

For Markdown docs, per endpoint:

### POST /api/v1/orders
Creates an order for the current user.

Auth: Bearer token, role "customer".

| Field | In | Type | Required | Notes |
|---|---|---|---|---|

Responses:
- 201: { example JSON with realistic values }
- 400: validation error, example body
- 401, 404 ...

Example:
curl -X POST http://localhost:3000/api/v1/orders -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d '{"sku":"A1","qty":2}'

Group endpoints by resource. Put shared things (base URL, auth, error format, pagination) once at the top.

For OpenAPI: version 3.1 YAML (3.0 if the user's tooling needs it), reusable components/schemas for shared shapes, securitySchemes for auth, an operationId per operation.

5. Verify

  • If you can run the server locally, call a couple of endpoints with the curl examples and correct any mismatch.
  • Validate an OpenAPI file with a linter if one is available (for example npx @redocly/cli lint openapi.yaml); otherwise at least check it parses as YAML.
  • Mark anything inferred with "(unverified)" and list those points in your reply.

Do not

  • Invent endpoints, fields, status codes or rate limits.
  • Put real tokens, keys or customer data in examples.

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.