Auto-generates API documentation from codebase analysis. Detects endpoints, schemas, authentication patterns, and produces OpenAPI specs or markdown docs. Runs post-sprint or pre-release. Use when: "generate API docs", "document endpoints", "create OpenAPI spec", "API documentation", "document this API", "swagger docs", or when the project has API endpoints that need documentation.
From cksnpx claudepluginhub cardinalconseils/claude-starter --plugin cksThis skill is limited to using the following tools:
references/openapi-template.mdDesigns and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Enables AI agents to execute x402 payments with per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents pay for APIs, services, or other agents.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Scans the codebase for API endpoints and generates structured documentation.
Automatically detect API routes from common patterns:
| Framework | Detection Pattern |
|---|---|
| Express | app.get/post/put/delete(), router.get/post/put/delete() |
| Next.js App Router | app/api/**/route.ts — export GET/POST/PUT/DELETE |
| Next.js Pages Router | pages/api/**/*.ts |
| FastAPI | @app.get/post/put/delete() decorators |
| Django REST | urlpatterns, ViewSet classes |
| Flask | @app.route() decorators |
| Hono | app.get/post/put/delete() |
| tRPC | router.query/mutation() |
For each endpoint, extract:
## POST /api/invoices
Create a new invoice.
**Authentication:** Bearer token required
**Request Body:**
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| clientId | string | Yes | Client UUID |
| items | InvoiceItem[] | Yes | Line items |
**Response (201):**
| Field | Type | Description |
|-------|------|-------------|
| id | string | Invoice UUID |
| total | number | Calculated total |
**Error Responses:**
| Status | Code | Description |
|--------|------|-------------|
| 400 | VALIDATION_ERROR | Missing required fields |
| 401 | UNAUTHORIZED | Invalid or missing token |
Generate docs/api/openapi.yaml — machine-readable spec for Swagger UI, Postman, etc.
Check if .kickstart/artifacts/API.md exists. If it does:
If API.md does not exist, proceed with codebase-only detection.
# Check for framework signals
ls package.json pyproject.toml requirements.txt go.mod Cargo.toml 2>/dev/null
Read package.json or equivalent to identify the API framework.
Use Glob + Grep to find all route definitions:
Glob: app/api/**/route.{ts,js} # Next.js App Router
Glob: pages/api/**/*.{ts,js} # Next.js Pages Router
Grep: "router\.(get|post|put|delete)" # Express
Grep: "@app\.(get|post|put|delete)" # FastAPI/Flask
For each endpoint file:
Write to docs/api/:
README.md — API overview with authentication guideendpoints/ — One file per resource groupopenapi.yaml — OpenAPI 3.0 spec (if requested)After Sprint Phase 3 completes, check if new API endpoints were added:
# Check if any api/ route files were modified
git diff --name-only HEAD~1 | grep -E "(api/|routes/|endpoints/)"
If yes → suggest running API docs generation.
In Release Phase 5, verify:
/cks:api-docs # Generate docs for all endpoints
/cks:api-docs --openapi # Generate OpenAPI 3.0 spec
/cks:api-docs --diff # Only document new/changed endpoints
docs/api/
├── README.md — API overview, auth guide, base URL
├── endpoints/
│ ├── auth.md — Authentication endpoints
│ ├── invoices.md — Invoice CRUD
│ └── users.md — User management
└── openapi.yaml — OpenAPI 3.0 spec (optional)
This skill ships with opinionated defaults. Review and adapt to your needs:
--openapi flagreferences/openapi-template.mdRead, Grep, Glob, Write, Bash. Add tools if needed.sonnet. Remove to use your default model.