Agent skill
documenting-apis
Generate API specification documentation from codebase analysis. Detects REST endpoints, function signatures, type definitions, and schemas. Triggers: API specification, endpoints, REST API, type definitions, OpenAPI, Swagger, API documentation.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/documents/documenting-apis-thkt-claude-config
SKILL.md
docs:api - API Specification Generation
Auto-generate API documentation from codebase analysis.
Detection Items
| Category | Targets |
|---|---|
| REST Endpoints | Express, Fastify, Hono, Next.js, Flask, FastAPI, Django REST |
| Functions | tree-sitter extraction, TypeScript types, JSDoc, docstrings |
| Types | interface, type, Zod, Yup, dataclass, Pydantic |
| OpenAPI | openapi.yaml/json, swagger.yaml/json |
Framework Detection Patterns
| Framework | Pattern |
|---|---|
| Express/Fastify/Hono | app.get(), router.post() |
| Next.js | app/api/**/route.ts, pages/api/**/*.ts |
| Flask | @app.route() |
| FastAPI | @app.get(), @app.post() |
| Django REST | @api_view |
Analysis Scripts
| Script | Purpose |
|---|---|
scripts/detect-endpoints.sh |
HTTP method, path, handler, file location |
scripts/extract-types.sh |
Type name, fields, related types |
Generated Structure
# API Specification
## Endpoint List
### GET /api/users
**Request**: params table
**Response**: JSON example
## Type Definitions
### User
| Field | Type | Description |
Usage
/docs:api # Generate API docs
"Generate API specification" # Natural language
Markdown Validation
After generation, validate output with:
~/.claude/skills/scripts/validate-markdown.sh {output-file}
Non-blocking (warnings only) - style issues don't block document creation.
References
- Related:
documenting-architecture,setting-up-docs,documenting-domains
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?