agentleFS
yeaight7yeaight7/agent-powerups/skills/api-doc-review/SKILL.md

api-doc-review

Skill6 starsChanged 4 months agoApache-2.0View on GitHub

Use when API documentation may have drifted from the implementation -- endpoints changed without a spec update, integration partners report mismatches, or a PR touches routes, params, or response shapes.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    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:

    Before publishing or versioning an OpenAPI/Swagger spec

    line 14
  2. Distinctive:

    Verify parameters: All required request parameters (body, query, params) must be documented with correct types.

    line 33
  3. Distinctive:

    Verify responses: All possible response status codes (200, 400, 404, 500) and their payloads must match the actual error handlers and …

    line 35
  4. Distinctive:

    Fix immediately: If there is a mismatch, update the OpenAPI spec or inline documentation now.

    line 43

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Purpose

Outdated API documentation causes integration failures. The code is the source of truth, and the docs must match. Review the docs against the actual route handlers and fix mismatches immediately — do not defer.

When to Use

  • A PR adds or modifies routes, request/response types, or error handling
  • Consumers report behavior that contradicts the documented API
  • Before publishing or versioning an OpenAPI/Swagger spec

Inputs

  • The API documentation (OpenAPI/Swagger spec, or inline route docs)
  • The route handler source, types/validation schemas, and API tests

Workflow

  1. Inventory both sides. List documented endpoints and implemented routes, then diff the two lists:

    rg -n "^  /" openapi.yaml                                   # documented paths
    rg -n "router\.(get|post|put|patch|delete)\(" src/          # implemented routes
    git diff --name-only origin/main...HEAD -- "src/routes/"    # what changed recently
  2. Verify each endpoint (e.g., POST /users) against its route definition: path, method, and auth requirements — route middleware vs the documented security scheme.
  3. Verify parameters. All required request parameters (body, query, params) must be documented with correct types. Compare against the handler's validation schema or type definitions, not against the old doc.
  4. Verify responses. All possible response status codes (200, 400, 404, 500) and their payloads must match the actual error handlers and return statements:

    rg -n "res\.status\(|throw new .*Error" src/routes/   # codes actually produced
  5. Cross-check examples against tests. Documented request/response examples should match what the API tests actually send and assert.
  6. Fix immediately. If there is a mismatch, update the OpenAPI spec or inline documentation now. Do not defer it.

Output

  • Per-endpoint verdict: documented vs actual (path, method, auth, params, status codes, examples)
  • Spec/doc fixes applied, or a mismatch list with file:line where fixing needs owner input

Verification

  • Every changed route compared against its documented endpoint
  • Parameter names, types, and required flags match the handler's validation
  • Documented status codes match the codes actually returned or thrown
  • Auth requirements per endpoint match the route middleware
  • No mismatch deferred — fixed or explicitly escalated

Failure Modes

  • Doc-first trust — assuming the spec is right; the code is the source of truth.
  • Happy-path-only review — checking 200 responses while error codes drift unchecked.
  • Silent auth drift — an endpoint gains an auth requirement the docs never mention.
  • Deferred fixes — "will update the spec later" is how the drift started.

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.