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.
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
- 01
Start Loop Execution
Execute the loop in your preferred coding agent environment
- 02
Agent Generates Documentation
The agent will analyze the codebase and create docs for undocumented endpoints
- 03
Run Lint Check
Execute 'npm run docs:lint' to verify documentation completeness
- 04
Review & Iterate
If undocumented endpoints remain, the agent will continue until all are documented or max iterations reached
Workflow Steps
- 01
Identify undocumented API endpoints using project analysis tools
Tool: Codebase scanning utilities
- 02
Generate structured documentation (OpenAPI/Swagger) for each missing endpoint
Tool: Documentation generation templates
- 03
Execute 'npm run docs:lint' to validate documentation coverage
Tool: npm scripts
- 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
Related loops — API
API
Resolve API Error Responses
This loop standardizes API error responses across the application to improve client-side error handling and debugging. It ensures all error responses follow a consistent structure (e.g., RFC 7807 Problem Details format) with appropriate HTTP status codes and machine-readable error codes.
API
Fix Failing Integration Endpoints
Automatically detects and resolves issues in failing API integration endpoints through iterative testing and code modifications.
API
API Performance Budget
A coding loop focused on optimizing API performance to ensure P95 latency stays under a defined target threshold. This loop iteratively runs load tests, analyzes bottlenecks, and implements optimizations until the goal is achieved or maximum iterations are reached.