Guide · Agent skill
How to use the Code Documenter agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
Code Documenter is an agent skill that turns a coding agent into a documentation specialist. It adds docstrings and JSDoc comments, writes OpenAPI/Swagger API specs, sets up documentation sites and drafts getting-started guides and tutorials. This guide explains what the skill does, how to install it, how to trigger it with plain requests, and what it needs and touches on your machine, so you can use it with your own code.
Quick start
- 1Download the ZIP. Get the code-documenter ZIP from the skill's page on this site.
- 2Unzip the skill. Unzip it into ~/.claude/skills/ for personal use or into .claude/skills/ in your project for project-only use.
- 3Or upload it in the Claude apps. In the Claude apps, go to Settings → Capabilities → Skills and upload the ZIP.
- 4Install the validation tools. Make sure Python with doctest and pytest, and Node.js with tsc and npx, are available on your machine.
- 5Ask for documentation in plain language. Describe the task, name the files, and mention docstrings, JSDoc, OpenAPI or a doc site.
- 6Answer the format question. Tell the agent which docstring or documentation style you prefer and which folders to exclude.
- 7Review the changes and report. Check the edited files and the coverage summary, and confirm the validation checks passed.
What the code-documenter skill makes the agent do
An agent skill is a folder of instructions that an AI agent loads when a task matches it. Once code-documenter is installed, the agent follows a documentation workflow: it asks which documentation format you prefer and which files to exclude, detects your language and framework, finds undocumented code, applies a consistent format, validates its examples and then reports coverage.
The skill covers code documentation, API documentation, documentation sites and developer guides. Its reference material includes Google, NumPy and Sphinx docstrings for Python, JSDoc for TypeScript and JavaScript, OpenAPI 3.0 and 3.1, and tools such as FastAPI, Django, NestJS, Express, Docusaurus, MkDocs, VitePress, Swagger UI, Redoc and Stoplight.
- Python docstrings in Google, NumPy or Sphinx style, including Args, Returns and Raises sections
- JSDoc annotations with @param, @returns, @throws and @example for TypeScript and JavaScript
- OpenAPI/Swagger specs and API documentation for FastAPI, Django, NestJS and Express
- Documentation site configuration and content structure
- Getting-started guides, tutorials, user guides and FAQs
- A documentation coverage report listing files changed and what is still undocumented
Install the code-documenter skill
Download the code-documenter ZIP from the skill's page on this site. Then choose one of the three install locations below. A skill is just a folder, so unzipping it into the right place is enough for the agent to find it.
For a personal install that works across your projects, unzip the skill into ~/.claude/skills/. For a single project, unzip it into that project's .claude/skills/ folder so it applies only there and can be shared with teammates through the repository. You can also upload the ZIP in the Claude apps under Settings → Capabilities → Skills.
- Personal: unzip into ~/.claude/skills/
- Project: unzip into .claude/skills/ inside your project folder
- Claude apps: Settings → Capabilities → Skills, then upload the ZIP
Install the tools the validation step needs
The skill checks its own work by running standard tools, so install these before you rely on validation. For Python, you need doctest (part of the standard library) and pytest for module-wide checks. For TypeScript and JavaScript, you need Node.js with tsc and npx. npx is used to run the Redocly CLI for linting OpenAPI specs.
If a tool is missing, validation cannot confirm your examples, so ask the agent to report which checks it could not run rather than assuming they passed.
- Python: doctest and pytest
- Node.js: tsc (TypeScript compiler) and npx
- OpenAPI linting: the Redocly CLI, run through npx
Trigger the skill with a natural request
You do not need a special command. Describe the documentation task in plain language and mention the thing you want, such as docstrings, JSDoc, OpenAPI, Swagger, API docs, tutorials, user guides or a doc site. The skill's triggers match these words.
Name the files or folders you want covered and say which style you prefer. The agent will still ask for a format preference before it starts, so answering that question up front saves a round trip.
- Add Google-style docstrings to the public functions in src/services/user.py.
- Add JSDoc comments to the exported functions in the src/api folder and skip the test files.
- Write an OpenAPI spec for the REST endpoints in this FastAPI app.
- Create API documentation for our NestJS users controller with Swagger decorators.
- Draft a getting-started guide and a short tutorial for this library.
- Set up a documentation site with MkDocs for this project and outline the content.
What to expect during a run
The agent works through a fixed sequence: discover, detect, analyze, document, validate and report. In the validation step it runs checks such as python -m doctest on a file, pytest --doctest-modules, tsc --noEmit for typed examples and npx @redocly/cli lint on an OpenAPI file. If a check fails, the agent should fix the example and re-run the check before it writes the report.
The final output is a coverage summary. Depending on the task it may include the files modified, the number of functions and classes documented, the API framework and strategy used, and the docstring or JSDoc style applied.
- python -m doctest file.py checks doctest blocks in a Python file
- pytest --doctest-modules checks doctest examples across a module
- tsc --noEmit confirms typed TypeScript examples compile
- npx @redocly/cli lint openapi.yaml validates an OpenAPI spec
python -m doctest file.py
pytest --doctest-modules
tsc --noEmit
pnpx @redocly/cli lint openapi.yamlSafety notes: scripts and network access
This skill runs scripts and uses the network. The validation step runs linters and documentation tools against your code, so the agent executes commands in your project. The source does not list the exact network calls, so treat the first run as something to review.
Work on a clean branch or in version control so you can review every change. Read the commands the agent proposes before approving them, and avoid using the skill on projects where the agent should not execute commands.
- Commit or stash your work first so changes are easy to review and revert
- Check the commands the agent runs during validation
- Do not use it on projects where running commands is not allowed
- Review generated docs for accuracy, since examples are only as good as the code they test
What people use it for
- Adding Google-style or NumPy-style docstrings to a Python package so functions show their arguments, returns and errors
- Adding JSDoc to a TypeScript codebase and checking typed examples with tsc
- Writing an OpenAPI spec for a FastAPI, Django, NestJS or Express API and linting it with Redocly
- Drafting a getting-started guide or user tutorial for a library or internal tool
- Producing a coverage summary that shows which files and functions are still undocumented
Frequently asked questions
How do I install the code-documenter agent skill?
Download the ZIP from the skill's page on this site. Unzip it into ~/.claude/skills/ for personal use or into .claude/skills/ inside a project. You can also upload the ZIP in the Claude apps under Settings → Capabilities → Skills.
What does the code-documenter skill require?
For Python validation it needs Python with doctest and pytest. For TypeScript validation and the Redocly CLI it needs Node.js with tsc and npx. The skill runs scripts and uses the network.
Is code-documenter free to use?
The skill is published under the MIT licence, as stated in its source. Check the licence file in the download for the full terms.
Which documentation formats does it support?
It covers Python docstrings in Google, NumPy and Sphinx styles, JSDoc for TypeScript and JavaScript, and OpenAPI 3.0 and 3.1 specs. It also helps with documentation sites and getting-started guides.
Which frameworks does it handle for API docs?
The skill's reference material covers FastAPI and Django, and NestJS and Express. It is meant to apply the right API documentation strategy for each framework it detects.
Why does the agent ask questions before writing docs?
The skill requires it to ask for a format preference and exclusions before starting, so it does not assume a docstring style. Answering up front avoids rework.
Are there related skills I could use instead?
The skill lists spec-miner, fullstack-guardian and code-reviewer as related skills. Pick one based on whether you need documentation, specification extraction, full-stack implementation or code review.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Code Documenter suits developers adding docstrings or JSDoc across an existing codebase, teams publishing REST API docs from FastAPI, Django, NestJS or Express, and maintainers who want a coverage summary. Skip it if you cannot let an agent run linters and doc tools on your code, or if you only need a quick text summary, since the skill is aimed at code and API documentation.
Download the skill