From api-docs
Generates markdown API documentation from FastAPI routes, Pydantic models, DRF viewsets, and serializers — also detects drift between code and existing docs. Use when asked to "generate api docs", "document api", "api documentation", "openapi", "swagger docs", "update api docs", "check api drift", or "document endpoints".
npx claudepluginhub shouenlee/ghcp-dev-plugin --plugin api-docsThis skill uses the workspace's default tool permissions.
Generates comprehensive markdown API documentation by scanning FastAPI routes, Pydantic models, DRF viewsets, and serializers. Also detects drift between existing documentation and current code.
Audits and enhances FastAPI/REST API endpoint documentation: generates docstrings, parameter descriptions, response codes, Pydantic examples, and OpenAPI improvements.
Generates OpenAPI specs and interactive API docs with Swagger/Redoc. Handles spec-first contracts and code-first auto-generation from Express, FastAPI, NestJS, Spring Boot.
Generates and validates OpenAPI specs from codebase: inventories endpoints, defines schemas, generates docs, and verifies accuracy. For API design and maintenance.
Share bugs, ideas, or general feedback.
Generates comprehensive markdown API documentation by scanning FastAPI routes, Pydantic models, DRF viewsets, and serializers. Also detects drift between existing documentation and current code.
/api-docs generate — Generate API documentationDetect API framework:
# FastAPI detection
grep -r "APIRouter\|FastAPI()" --include="*.py" .
# Django REST Framework detection
grep -r "ViewSet\|APIView\|@api_view" --include="*.py" .
For FastAPI projects:
grep -r "class.*BaseModel" --include="*.py" -l .
For DRF projects:
grep -r "class.*Serializer" --include="*.py" -l .
Generate markdown documentation:
# API Documentation
## Authentication
{Detected auth mechanism}
## Endpoints
### {Group/Router Name}
#### `{METHOD} {path}`
{Description from docstring}
**Request Body:**
| Field | Type | Required | Description |
|-------|------|----------|-------------|
**Response:**
| Field | Type | Description |
|-------|------|-------------|
**Status Codes:**
| Code | Description |
|------|-------------|
Write to docs/api.md or user-specified location.
Offer to add a table of contents with links to each endpoint group.
/api-docs diff — Detect documentation driftdocs/api.md or user-specified location).API Documentation Drift Report
==============================
Added (not documented):
- POST /api/v1/users/bulk-invite
Removed (still documented):
- DELETE /api/v1/users/{id}/avatar
Changed:
- PUT /api/v1/users/{id}
- Added field: `phone_number` (string, optional)
- Removed field: `legacy_id`
| Problem | Cause | Solution |
|---|---|---|
| Framework not detected | No FastAPI or DRF imports found | Verify the project uses a supported framework; check for non-standard import patterns |
| Routes spread across many files | Large project with modular routing | The tool scans recursively; ensure all route files use standard decorators and patterns |
| Dynamic route generation | Routes created programmatically at runtime | Document dynamic routes manually or point the tool to the route registration code |
| Pydantic v1 vs v2 differences | Model syntax varies between versions | The tool handles both BaseModel styles; flag any issues for manual review |
| Existing docs in non-standard format | Docs don't follow expected markdown structure | Use generate to create fresh docs, then manually merge custom sections |