agentleFS
irahardiantoirahardianto/awesome-agv/.agents/skills/api-documentation/SKILL.md

api-documentation

Skill157 starsChanged 3 months agoMITView on GitHub

OpenAPI 3.1 specification writing, request/response examples, error documentation, versioning, and interactive API portal patterns.

11 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, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 10 edited versions we read keep these.

  • 1

    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:

    Document every error code with:

    line 76

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

Guidelines for creating comprehensive, developer-friendly API documentation.

When to Invoke

  • Writing or updating OpenAPI/Swagger specs
  • Documenting API endpoints, schemas, and errors
  • Creating SDK documentation and integration guides
  • API versioning and migration documentation

OpenAPI Specification

Structure

openapi: 3.1.0
info:
  title: Task API
  version: 1.0.0
paths:
  /api/v1/tasks:
    post:
      summary: Create a task
      operationId: createTask
      tags: [Tasks]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTaskRequest'
            example:
              title: "Deploy fix"
              priority: "high"
      responses:
        '201':
          description: Task created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'

Principles

  1. Every endpoint has operationId — used for SDK generation.
  2. Every endpoint has examples — request and response.
  3. Reusable components — $ref for schemas, responses, parameters.
  4. Error responses documented — every possible error code with description.

Error Documentation

Standard Error Format

{
  "error": {
    "code": "TASK_NOT_FOUND",
    "message": "Task 'abc123' not found",
    "details": [
      { "field": "id", "issue": "No task exists with this ID" }
    ]
  }
}

Error Code Catalog

Document every error code with:

  • Code — machine-readable identifier
  • HTTP Status — corresponding status code
  • Description — what caused the error
  • Resolution — how to fix it

Versioning Documentation

  1. Changelog — every API version change documented.
  2. Migration guides — step-by-step upgrade instructions.
  3. Deprecation notices — minimum 6 months warning.
  4. Breaking changes — clearly marked with migration path.

Documentation Checklist

  • All endpoints documented with summaries and descriptions
  • Request/response schemas with examples
  • Authentication documented (how to obtain and use credentials)
  • Error responses with codes and resolution steps
  • Rate limiting documented (limits, headers, retry strategy)
  • Pagination documented (cursor vs offset, parameters)
  • Versioning strategy documented

Related

  • API Design Principles @.agents/rules/api-design-principles.md
  • Documentation Principles .agents/rules/documentation-principles.md
  • Structured Spec TSD Profile @.agents/skills/structured-spec/profiles/tsd.md — use when API documentation requires formal requirement traceability (<!-- contract --> annotations wrapping OpenAPI blocks)

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.