agentleFS
SpaceFrontiersSpaceFrontiers/ai-overmind/skills/development-technical/api-documenter/SKILL.md

api-documenter

Skill4 starsChanged 12 months agoApache-2.0View on GitHub

Creates comprehensive API documentation from code, including endpoints, parameters, responses, and examples. Use when documenting REST APIs, GraphQL APIs, or generating OpenAPI/Swagger specifications.

6 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 18

    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:

    When creating API documentation:

    line 14
  2. Distinctive:

    Document Systematically: Follow a consistent structure for each endpoint

    line 17
  3. Distinctive:

    Explain Clearly: Use clear language, avoid jargon

    line 19
  4. Distinctive:

    Cover Edge Cases: Document error responses and special cases

    line 20
  5. Distinctive:

    Keep Updated: Ensure documentation matches current implementation

    line 21
  6. Distinctive:

    Use simple, direct language

    line 183
  7. Distinctive:

    Use same format for all endpoints

    line 189
  8. Distinctive:

    When generating OpenAPI 3.0 specification:

    line 202
  9. Distinctive:

    Test Your Examples: Ensure all code examples actually work

    line 268
  10. Distinctive:

    Version Changes: Document what changed between versions

    line 269
  11. Distinctive:

    Search Friendly: Use clear headings and keywords

    line 270
  12. Distinctive:

    Interactive: Consider tools like Swagger UI or Postman

    line 271
  13. Distinctive:

    Keep Updated: Document changes immediately

    line 272
  14. Distinctive:

    Get Feedback: Ask developers what's unclear

    line 273
  15. Distinctive:

    Show Errors: Don't just show happy path

    line 274
  16. Distinctive:

    Performance Notes: Document timeouts, limits, best practices

    line 275
  17. Distinctive:

    Consider hybrid approaches for existing systems

    line 296
  18. Distinctive:

    Documentation Recommendation: Always document query complexity, rate limits, and performance characteristics specific to your API design.

    line 313

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

Generate clear, comprehensive API documentation that developers will love to use.

Instructions

When creating API documentation:

  1. Analyze the API: Understand endpoints, methods, and data structures
  2. Document Systematically: Follow a consistent structure for each endpoint
  3. Include Examples: Provide request and response examples
  4. Explain Clearly: Use clear language, avoid jargon
  5. Cover Edge Cases: Document error responses and special cases
  6. Keep Updated: Ensure documentation matches current implementation

Documentation Structure

API Overview

  • Base URL
  • Authentication method
  • Rate limiting
  • Common headers
  • API versioning

Endpoint Documentation

For each endpoint, include:

Endpoint Header

METHOD /path/to/endpoint

Description

Brief explanation of what the endpoint does.

Authentication

Required authentication level or method.

Request Parameters

Path Parameters

NameTypeRequiredDescription
idintegerYesUser ID

Query Parameters

NameTypeRequiredDescriptionDefault
limitintegerNoResults per page10
offsetintegerNoResults offset0

Request Body (for POST/PUT/PATCH)

{
  "field": "type - description",
  "required_field": "string - required description"
}

Response

Success Response (200 OK)

{
  "status": "success",
  "data": {
    "id": 1,
    "name": "John Doe"
  }
}

Error Responses

  • 400 Bad Request - Invalid input
  • 401 Unauthorized - Authentication required
  • 404 Not Found - Resource not found
  • 500 Internal Server Error - Server error

Example Request

curl -X GET "https://api.example.com/v1/users/123" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json"
// JavaScript
fetch('https://api.example.com/v1/users/123', {
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN'
  }
})
# Python
import requests
response = requests.get(
    'https://api.example.com/v1/users/123',
    headers={'Authorization': 'Bearer YOUR_TOKEN'}
)

Example Response

{
  "status": "success",
  "data": {
    "id": 123,
    "name": "John Doe",
    "email": "john@example.com",
    "created_at": "2024-01-01T00:00:00Z"
  }
}

Example Documentation

Complete Endpoint Example

## Get User by ID

GET /v1/users/{id}

Retrieves a single user by their unique identifier.

### Authentication
Requires Bearer token authentication.

### Path Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| id   | integer | Yes | Unique user identifier |

### Response

**200 OK**
\`\`\`json
{
  "id": 123,
  "name": "John Doe",
  "email": "john@example.com",
  "role": "admin",
  "created_at": "2024-01-01T00:00:00Z"
}
\`\`\`

**404 Not Found**
\`\`\`json
{
  "error": "User not found",
  "code": "USER_NOT_FOUND"
}
\`\`\`

### Example Request
\`\`\`bash
curl -X GET "https://api.example.com/v1/users/123" \\
  -H "Authorization: Bearer YOUR_TOKEN"
\`\`\`

Guidelines

Be Comprehensive

  • Document all endpoints
  • Include all parameters
  • List all possible responses
  • Provide multiple examples

Be Clear

  • Use simple, direct language
  • Define technical terms
  • Include context and purpose
  • Explain business logic when relevant

Be Consistent

  • Use same format for all endpoints
  • Consistent naming conventions
  • Standard response structures
  • Uniform example style

Be Practical

  • Real-world examples
  • Common use cases
  • Error handling patterns
  • Best practices

OpenAPI/Swagger Generation

When generating OpenAPI 3.0 specification:

openapi: 3.0.0
info:
  title: API Name
  version: 1.0.0
  description: API description
servers:
  - url: https://api.example.com/v1
paths:
  /users/{id}:
    get:
      summary: Get user by ID
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
components:
  schemas:
    User:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string

Common Sections to Include

Getting Started

  • Quick start guide
  • Authentication setup
  • First API call
  • Common patterns

Reference

  • All endpoints
  • Data models
  • Error codes
  • Rate limits

Guides

  • Authentication guide
  • Pagination guide
  • Filtering guide
  • Webhooks guide

Resources

  • SDKs and libraries
  • Postman collection
  • Code examples
  • Support information

Tips for Great API Docs

  • Test Your Examples: Ensure all code examples actually work
  • Version Changes: Document what changed between versions
  • Search Friendly: Use clear headings and keywords
  • Interactive: Consider tools like Swagger UI or Postman
  • Keep Updated: Document changes immediately
  • Get Feedback: Ask developers what's unclear
  • Show Errors: Don't just show happy path
  • Performance Notes: Document timeouts, limits, best practices

Research-Backed Best Practices

The Evolution from REST to GraphQL

Recent research (Addanki, 2025; Zanevych, 2024) reveals important trends in API design:

REST remains dominant for public APIs but faces challenges:

  • Over-fetching/under-fetching: Clients receive too much or too little data
  • Multiple round trips: Complex queries require multiple endpoint calls
  • Rigid structure: Predetermined endpoints limit flexibility

GraphQL addresses REST limitations:

  • Schema-driven approach: Clients specify exactly what data they need
  • Single request: Complex data requirements satisfied in one call
  • Improved developer experience: Self-documenting through introspection
  • Growing adoption: Becoming market leader for dynamic, data-heavy applications

Practical implications:

  • REST for simple, cacheable, public-facing APIs
  • GraphQL for complex, dynamic applications with varied client needs
  • Consider hybrid approaches for existing systems

API Documentation and Developer Experience

Research on bioinformatics APIs (Ireland & Martin, 2021) demonstrates GraphQL benefits:

  • Self-documenting nature: GraphQL schemas make APIs explorable without external docs
  • Complex relationships: Graph structure naturally represents interconnected data
  • Single query flexibility: Any hierarchy or nesting level accessible in one request
  • Better than REST for complex domains: Reduces need for extensive documentation

Key Insight: Modern API documentation should embrace interactive exploration. GraphQL's introspection and tools like GraphQL Playground reduce documentation burden while improving developer experience.

Performance Considerations

Comparative studies (Seabra et al., 2019; Wittern et al., 2017) show:

  • REST advantage: Better caching, mature tooling, predictable performance
  • GraphQL advantage: Reduced network overhead for complex queries, flexible data fetching
  • Trade-off: GraphQL queries can be more expensive server-side but reduce round trips

Documentation Recommendation: Always document query complexity, rate limits, and performance characteristics specific to your API design.

References

  • Addanki, S. (2025). "Architectural Shifts in API Design: The Progression from SOAP to REST and GraphQL". International Journal on Science and Technology, 16(2).
  • Zanevych, O. (2024). "Advancing Web Development: A Comparative Analysis of Modern Frameworks for REST and GraphQL Back-End Services". Grail of Science, 37, 216-228.
  • Ireland, S.M., & Martin, A.C.R. (2021). "GraphQL for the delivery of bioinformatics web APIs and application to ZincBind". Bioinformatics Advances, 1(1).
  • Seabra, M., Nazário, M.F., & Pinto, G. (2019). "REST or GraphQL? A performance comparative study". Proceedings of the XIII Brazilian Symposium on Software Components, Architectures, and Reuse.

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.