Best for
- Use when the user requests code documentation or provides relevant inputs for this workflow.
seb1n/awesome-ai-agent-skills/code-and-development/code-documentation/SKILL.md
Automatically generate clear, comprehensive documentation for codebases — including API references, inline docstrings, README files, and usage guides. Use when the user requests code documentation or provides relevant inputs for this workflow.
Decision brief
This skill enables an AI agent to analyze source code and produce high-quality documentation in multiple formats. It covers everything from single-function docstrings to full project README files, ensuring that both human developers and downstream tooling (IDEs, doc generators)…
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/seb1n/awesome-ai-agent-skills --skill "code-and-development/code-documentation"Inspect the Agent Skill "code-documentation" from https://github.com/seb1n/awesome-ai-agent-skills/blob/75865a5d037a4cdaa7f409a4ec14ab9b0292920b/code-and-development/code-documentation/SKILL.md at commit 75865a5d037a4cdaa7f409a4ec14ab9b0292920b. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
1. Inventory the Codebase: Walk the project tree and catalog public modules, classes, functions, constants, and type definitions. Note which symbols already have documentation and which are missing or stale.
Point the agent at a file, directory, or specific symbol and describe what documentation you need. Examples of valid requests:
git clone https://github.com/acme/myapi.git cd myapi npm install
Python: Google-style docstrings, NumPy-style docstrings, Sphinx reStructuredText
User Request: "Add docstrings to this class and its methods."
Permission review
The documentation asks the agent to create, modify, or delete local files.
**Insert or Update In-Place**: For inline documentation (docstrings, JSDoc comments), insert the generated text directly above or inside the relevant symbol. For standalone files (README, API reference), create or update the Markdown file aThe documentation includes network, browsing, or remote request actions.
git clone https://github.com/acme/myapi.gitEvidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 93/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 161 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
This skill enables an AI agent to analyze source code and produce high-quality documentation in multiple formats. It covers everything from single-function docstrings to full project README files, ensuring that both human developers and downstream tooling (IDEs, doc generators) benefit from consistent, accurate descriptions.
Inventory the Codebase: Walk the project tree and catalog public modules, classes, functions, constants, and type definitions. Note which symbols already have documentation and which are missing or stale.
Determine Documentation Scope: Based on the user's request, decide whether to generate inline docstrings, a standalone API reference, a project-level README, or a combination. Match the output format to the project's existing conventions (JSDoc, Google-style Python docstrings, TypeDoc, RDoc, etc.).
Analyze Signatures and Behavior: For each symbol, inspect parameter types, return types, default values, raised exceptions, and side effects. Read surrounding test files when available to understand intended usage and edge cases.
Generate Documentation: Write documentation that includes a one-line summary, an extended description when the logic is non-trivial, parameter and return-value documentation with types, exception/error documentation, and at least one usage example for public API surfaces.
Insert or Update In-Place: For inline documentation (docstrings, JSDoc comments), insert the generated text directly above or inside the relevant symbol. For standalone files (README, API reference), create or update the Markdown file at the project root or a docs/ directory.
Validate and Cross-Reference: Verify that documented parameter names match the actual signature, that referenced types exist, and that examples are syntactically valid. Flag any inconsistencies for the user to review.
@param, @returns, @throws), TypeDoc annotations@param, @return, @throws)/// doc comments with Markdown, #[doc] attributes@param, @return, @example)Point the agent at a file, directory, or specific symbol and describe what documentation you need. Examples of valid requests:
src/services/."The agent will respect existing documentation style in the project. If no convention is detected, it will ask which format to use or default to the most common style for the language.
User Request: "Add docstrings to this class and its methods."
Before:
class TokenBucket:
def __init__(self, capacity, refill_rate):
self.capacity = capacity
self.tokens = capacity
self.refill_rate = refill_rate
self._last_refill = time.monotonic()
def consume(self, tokens=1):
self._refill()
if self.tokens >= tokens:
self.tokens -= tokens
return True
return False
def _refill(self):
now = time.monotonic()
elapsed = now - self._last_refill
self.tokens = min(self.capacity, self.tokens + elapsed * self.refill_rate)
self._last_refill = now
After:
class TokenBucket:
"""A token-bucket rate limiter.
Tokens are added at a constant rate and consumed by callers.
When the bucket is empty, requests are rejected until enough
tokens have accumulated.
Args:
capacity: Maximum number of tokens the bucket can hold.
refill_rate: Tokens added per second.
Example:
>>> bucket = TokenBucket(capacity=10, refill_rate=2)
>>> bucket.consume(3)
True
"""
def __init__(self, capacity: float, refill_rate: float) -> None:
self.capacity = capacity
self.tokens = capacity
self.refill_rate = refill_rate
self._last_refill = time.monotonic()
def consume(self, tokens: int = 1) -> bool:
"""Attempt to consume tokens from the bucket.
Triggers an internal refill based on elapsed time before
checking availability.
Args:
tokens: Number of tokens to consume. Defaults to 1.
Returns:
True if the tokens were available and consumed, False otherwise.
"""
self._refill()
if self.tokens >= tokens:
self.tokens -= tokens
return True
return False
def _refill(self) -> None:
"""Refill the bucket based on time elapsed since the last refill."""
now = time.monotonic()
elapsed = now - self._last_refill
self.tokens = min(self.capacity, self.tokens + elapsed * self.refill_rate)
self._last_refill = now
User Request: "Generate a README for this project."
Given a project with the following layout:
myapi/
├── package.json (name: @acme/myapi, scripts: dev, build, test)
├── src/
│ ├── index.ts (Express app entry point)
│ ├── routes/
│ │ ├── users.ts
│ │ └── orders.ts
│ └── middleware/
│ └── auth.ts
├── tests/
│ └── users.test.ts
└── Dockerfile
Generated README.md:
# @acme/myapi
A RESTful API service built with Express and TypeScript.
## Getting Started
### Prerequisites
- Node.js >= 18
- npm or yarn
### Installation
git clone https://github.com/acme/myapi.git
cd myapi
npm install
### Running Locally
npm run dev # Start the dev server with hot reload
npm run build # Compile TypeScript to dist/
npm test # Run the test suite
### Docker
docker build -t myapi .
docker run -p 3000:3000 myapi
## API Endpoints
| Method | Path | Description |
|--------|----------------|-----------------------|
| GET | /users | List all users |
| POST | /users | Create a new user |
| GET | /orders | List all orders |
| POST | /orders | Create a new order |
## Project Structure
- `src/index.ts` — Application entry point and server bootstrap.
- `src/routes/` — Route handlers grouped by resource.
- `src/middleware/auth.ts` — JWT authentication middleware.
- `tests/` — Jest test files.
## License
MIT
@overload, document each signature variant separately with its own parameter descriptions and examples.Frequently asked questions
This skill enables an AI agent to analyze source code and produce high-quality documentation in multiple formats. It covers everything from single-function docstrings to full project README files, ensuring that both human developers and downstream tooling (IDEs, doc generators)…
The source record exposes this install command: npx skills add https://github.com/seb1n/awesome-ai-agent-skills --skill "code-and-development/code-documentation". Inspect the command and pinned source before running it.
Static rules flagged write-files, network in the source; the page lists the matching lines and excerpts.
Alternatives
bytedance/deer-flow
Use this skill when the user requests to generate, create, or improve documentation for code, APIs, libraries, repositories, or software projects. Supports README generation, API reference documentation, inline code comments, architecture documentation, changelog generation, and developer guides. Trigger on requests like "document this code", "create a README", "generate API docs", "write developer guide", or when analyzing codebases for documentation purposes.
Jeffallan/claude-skills
Use when building high-performance async Python APIs with FastAPI and Pydantic V2. Invoke to create REST endpoints, define Pydantic models, implement authentication flows, set up async SQLAlchemy database operations, add JWT authentication, build WebSocket endpoints, or generate OpenAPI documentation. Trigger terms: FastAPI, Pydantic, async Python, Python API, REST API Python, SQLAlchemy async, JWT authentication, OpenAPI, Swagger Python.
almanak-co/sdk
Build, test, and deploy DeFi trading strategies using the Almanak SDK. ALWAYS use this skill when the user mentions almanak, DeFi strategy, trading strategy, yield farming, liquidity provision, token swap, borrowing, lending, perpetuals, staking, vault deposit, bridging tokens, backtesting, paper trading, or on-chain execution. Use for writing strategy.py files, composing intents (Swap, LP, Borrow, Supply, Perp, Bridge, Stake, Vault, Prediction), working with config.json strategy parameters, run
SpartanLabsXyz/simmer-sdk
Generate complete, installable OpenClaw trading skills from natural language strategy descriptions. Use when your human wants to create a new trading strategy, build a bot, generate a skill, automate a trade idea, turn a tweet into a strategy, or asks "build me a skill that...". Produces a full skill folder (SKILL.md + Python script + config) ready to install and run.