APIprompt onlyEasy

Generate Missing API Docs

Automatically identifies and documents all undocumented API endpoints in the project. The agent iteratively generates OpenAPI/Swagger documentation until all endpoints meet the required documentation standards.

← all loops
APIdocumentationautomationlintingopenapiswagger

Goal

Document all API endpoints

How to Run

Run this loop in Cursor/Claude Code/Codex/OpenCode/Gemini CLI to automatically generate missing API documentation

  1. 01

    Start Loop Execution

    Execute the loop in your preferred coding agent environment

  2. 02

    Agent Generates Documentation

    The agent will analyze the codebase and create docs for undocumented endpoints

  3. 03

    Run Lint Check

    Execute 'npm run docs:lint' to verify documentation completeness

  4. 04

    Review & Iterate

    If undocumented endpoints remain, the agent will continue until all are documented or max iterations reached

Workflow Steps

  1. 01

    Identify undocumented API endpoints using project analysis tools

    Tool: Codebase scanning utilities

  2. 02

    Generate structured documentation (OpenAPI/Swagger) for each missing endpoint

    Tool: Documentation generation templates

  3. 03

    Execute 'npm run docs:lint' to validate documentation coverage

    Tool: npm scripts

  4. 04

    If undocumented endpoints exist, return to step 1

    Until exit condition met or max iterations reached

Kickoff Prompt

Start the "Generate Missing API Docs" loop.

Goal: Document all API endpoints
Max iterations: 10
Between iterations run: npm run docs:lint
Exit when: No undocumented endpoints remain


Find and document all undocumented API endpoints in this project. Generate OpenAPI specifications for each endpoint that currently lacks documentation. Run 'npm run docs:lint' after each iteration to verify progress.

Self-pace this loop. After each iteration, run `npm run docs:lint` and evaluate the output, and only continue if the exit condition is not met (No undocumented endpoints remain). Stop when the exit condition passes or 10 iterations are reached. Give a short status update each pass.

Guardrails

hardcoded
  • ·Only generate documentation for endpoints that lack existing docs
  • ·Preserve existing documentation without modification
  • ·Validate API endpoint structure before documenting
  • ·Handle edge cases like dynamic routes or middleware
  • ·Do not modify source code files, only documentation artifacts

Flow Diagram

rendering…

Related loops — API