Agent skill

Code Documenter

by Jeffallan in Jeffallan/claude-skills

Generates and validates docstrings, OpenAPI specs, JSDoc annotations and user guides, running every code example through a real compiler or linter before reporting coverage.

MITAuto-check passedDevelopment

Install Code Documenter

skills CLI
$ npx skills add Jeffallan/claude-skills --skill code-documenter -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Jeffallan/claude-skills code-documenter --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Jeffallan/claude-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/code-documenter .claude/skills/code-documenter && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
code-documenter
GitHub stars
12k
Token cost
~1.5k tokens
SKILL.md length
350 words
Files
9 (incl. references)
Skills in repo
58
Repo updated
First seen
Licence
MIT

At a glance

Generates and validates docstrings, OpenAPI specs, JSDoc annotations and user guides, running every code example through a real compiler or linter before reporting coverage.

  • Works in 6 steps: Discover - Ask for format preference and… → Detect - Identify language and framework → Analyze - Find undocumented code → …
  • Adding docstrings or JSDoc comments to undocumented functions and classes
  • SKILL.md covers When to Use This Skill, Core Workflow, Quick-Reference Examples and Reference Guide, plus 3 more sections
  • Calls python, pytest and tsc

What it does

The workflow runs in six steps: ask for a format preference and any exclusions, detect the language and framework, find undocumented code, apply a consistent format, validate every example, and report a coverage summary. Validation is concrete rather than visual: Python doctest blocks run through python -m doctest or pytest --doctest-modules, typed TypeScript or JavaScript examples are checked with tsc --noEmit, and an OpenAPI spec is linted with npx @redocly/cli lint. A failed validation sends the example back for a fix before the report step runs.

Quick-reference examples cover a Google-style Python docstring, a NumPy-style Python docstring and a JSDoc comment for a TypeScript function, giving a concrete shape to match rather than a description of style rules alone. Deeper guidance is split across reference files loaded only when relevant, covering Python docstrings, TypeScript JSDoc, FastAPI or Django API docs, NestJS or Express API docs, coverage reports, documentation systems and interactive API docs for OpenAPI, GraphQL, WebSocket and gRPC.

When your agent uses it

  • Adding docstrings or JSDoc comments to undocumented functions and classes
  • Writing or validating an OpenAPI or Swagger spec for a REST API
  • Building a documentation site or a getting-started guide for a project

Example prompts

  • “Add Google-style docstrings to every public function in this module.”
  • “Write an OpenAPI spec for these three endpoints and validate it.”
  • “Generate JSDoc comments for this TypeScript service class.”

Requirements

  • Python, for doctest validation
  • tsc, for TypeScript or JavaScript example validation
  • npx @redocly/cli, for OpenAPI linting

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Discover - Ask for format preference and exclusions
  2. Detect - Identify language and framework
  3. Analyze - Find undocumented code
  4. Document - Apply consistent format
  5. Validate - Test all code examples compile/run
  6. Report - Generate coverage summary

What it can do on your machine

Read from SKILL.md and the folder at commit 1be15d8. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python
    • pytest
    • tsc
    • npx

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com
    • synergetic.solutions
    • jeffallan.github.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Code Documenter loads about 1.5k tokens when it runs, and up to ~13k if it reads all its reference files. Until then it costs about 99 tokens; SKILL.md has 350 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~99
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~13k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Jeffallan/claude-skills at commit 1be15d8, republished under its MIT licence (© Jeffallan). 350 words, ~1,452 tokens.

Download SKILL.mdSave it as .claude/skills/code-documenter/SKILL.md (or your agent's skills folder). This skill also uses 8 other files; get the full folder from GitHub.
name
code-documenter
description
Generates, formats, and validates technical documentation — including docstrings, OpenAPI/Swagger specs, JSDoc annotations, doc portals, and user guides. Use when adding docstrings to functions or classes, creating API documentation, building documentation sites, or writing tutorials and user guides. Invoke for OpenAPI/Swagger specs, JSDoc, doc portals, getting started guides.
license
MIT
metadata.author
https://github.com/Jeffallan
metadata.company
https://synergetic.solutions
metadata.version
1.1.0
metadata.domain
quality
metadata.triggers
documentation, docstrings, OpenAPI, Swagger, JSDoc, comments, API docs, tutorials, user guides, doc site
metadata.role
specialist
metadata.scope
implementation
metadata.output-format
code
metadata.related-skills
spec-miner, fullstack-guardian, code-reviewer

Code Documenter

Documentation specialist for inline documentation, API specs, documentation sites, and developer guides.

When to Use This Skill

  • Adding docstrings to functions, classes, and modules
  • Writing OpenAPI/Swagger specs or JSDoc annotations
  • Creating API documentation for REST or GraphQL endpoints
  • Building documentation sites or developer portals
  • Writing getting-started guides, tutorials, and user guides

Core Workflow

  1. Discover - Ask for format preference and exclusions
  2. Detect - Identify language and framework
  3. Analyze - Find undocumented code
  4. Document - Apply consistent format
  5. Validate - Test all code examples compile/run:
    • Python: python -m doctest file.py for doctest blocks; pytest --doctest-modules for module-wide checks
    • TypeScript/JavaScript: tsc --noEmit to confirm typed examples compile
    • OpenAPI: validate spec with npx @redocly/cli lint openapi.yaml
    • If validation fails: fix examples and re-validate before proceeding to the Report step
  6. Report - Generate coverage summary

Quick-Reference Examples

Google-style Docstring (Python)
python
def fetch_user(user_id: int, active_only: bool = True) -> dict:
    """Fetch a single user record by ID.

    Args:
        user_id: Unique identifier for the user.
        active_only: When True, raise an error for inactive users.

    Returns:
        A dict containing user fields (id, name, email, created_at).

    Raises:
        ValueError: If user_id is not a positive integer.
        UserNotFoundError: If no matching user exists.
    """
NumPy-style Docstring (Python)
python
def compute_similarity(vec_a: np.ndarray, vec_b: np.ndarray) -> float:
    """Compute cosine similarity between two vectors.

    Parameters
    ----------
    vec_a : np.ndarray
        First input vector, shape (n,).
    vec_b : np.ndarray
        Second input vector, shape (n,).

    Returns
    -------
    float
        Cosine similarity in the range [-1, 1].

    Raises
    ------
    ValueError
        If vectors have different lengths.
    """
JSDoc (TypeScript)
typescript
/**
 * Fetches a paginated list of products from the catalog.
 *
 * @param {string} categoryId - The category to filter by.
 * @param {number} [page=1] - Page number (1-indexed).
 * @param {number} [limit=20] - Maximum items per page.
 * @returns {Promise<ProductPage>} Resolves to a page of product records.
 * @throws {NotFoundError} If the category does not exist.
 *
 * @example
 * const page = await fetchProducts('electronics', 2, 10);
 * console.log(page.items);
 */
async function fetchProducts(
  categoryId: string,
  page = 1,
  limit = 20
): Promise<ProductPage> { ... }

Reference Guide

Load detailed guidance based on context:

TopicReferenceLoad When
Python Docstringsreferences/python-docstrings.mdGoogle, NumPy, Sphinx styles
TypeScript JSDocreferences/typescript-jsdoc.mdJSDoc patterns, TypeScript
FastAPI/Django APIreferences/api-docs-fastapi-django.mdPython API documentation
NestJS/Express APIreferences/api-docs-nestjs-express.mdNode.js API documentation
Coverage Reportsreferences/coverage-reports.mdGenerating documentation reports
Documentation Systemsreferences/documentation-systems.mdDoc sites, static generators, search, testing
Interactive API Docsreferences/interactive-api-docs.mdOpenAPI 3.1, portals, GraphQL, WebSocket, gRPC, SDKs
User Guides & Tutorialsreferences/user-guides-tutorials.mdGetting started, tutorials, troubleshooting, FAQs
Show full SKILL.md (135 more words)Show less

Constraints

MUST DO
  • Ask for format preference before starting
  • Detect framework for correct API doc strategy
  • Document all public functions/classes
  • Include parameter types and descriptions
  • Document exceptions/errors
  • Test code examples in documentation
  • Generate coverage report
MUST NOT DO
  • Assume docstring format without asking
  • Apply wrong API doc strategy for framework
  • Write inaccurate or untested documentation
  • Skip error documentation
  • Document obvious getters/setters verbosely
  • Create documentation that's hard to maintain

Output Formats

Depending on the task, provide:

  1. Code Documentation: Documented files + coverage report
  2. API Docs: OpenAPI specs + portal configuration
  3. Doc Sites: Site configuration + content structure + build instructions
  4. Guides/Tutorials: Structured markdown with examples + diagrams

Knowledge Reference

Google/NumPy/Sphinx docstrings, JSDoc, OpenAPI 3.0/3.1, AsyncAPI, gRPC/protobuf, FastAPI, Django, NestJS, Express, GraphQL, Docusaurus, MkDocs, VitePress, Swagger UI, Redoc, Stoplight

Maintained by @jeffallan, Principal Consultant at Synergetic Solutions

Documentation

© Jeffallan, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 8 other files (references) in skills/code-documenter of Jeffallan/claude-skills.

  • SKILL.md
  • references/api-docs-fastapi-django.md
  • references/api-docs-nestjs-express.md
  • references/coverage-reports.md
  • references/documentation-systems.md
  • references/interactive-api-docs.md
  • references/python-docstrings.md
  • references/typescript-jsdoc.md
  • references/user-guides-tutorials.md

Open the folder on GitHubat commit 1be15d8

Compare with similar skills

Code Documenter next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Code Documenter compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Code Documenter this skillJeffallan/claude-skills12k—~1.5kAutomated safety check: PassMIT
Code Documenterzebbern/claude-code-guide4.6k—~1kAutomated safety check: PassMIT
Generating Documentationancoleman/ai-design-components526—~3kAutomated safety check: PassMIT
Agentic Workflows API Documentation Lungoagntcy/coffeeAgntcy112—~2.6kAutomated safety check: PassApache-2.0
Api2clialexknowshtml/api2cli455—~2.9kAutomated safety check: PassMIT
API Documenteralirezarezvani/claude-code-tresor777—~1.5kAutomated safety check: PassMIT

Similar skills

  • Code Documenter

    zebbern/claude-code-guide

    A skill your agent uses when adding docstrings, creating API documentation, or building documentation sites.

    4.6k GitHub stars~1k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Generating Documentation

    ancoleman/ai-design-components

    Generate comprehensive technical documentation including API docs (OpenAPI/Swagger), code documentation (TypeDoc/Sphinx), documentation sites (Docusaurus/MkDocs), Architecture Decision Records…

    526 GitHub stars~3k tokensUpdated 10 mo ago
    DevelopmentAuto-check passed
  • Authors and maintains the human-facing Agentic Workflows API documentation for the lungo subproject at coffeeAGNTCY/coffeeagents/lungo/docs/workflow-instanceapi.md.

    112 GitHub stars~2.6k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Api2cli

    alexknowshtml/api2cli

    Generate a working CLI from any API, then wrap it in a Claude Code skill.

    455 GitHub stars~2.9k tokensUpdated 7 mo ago
    Backend & APIsAuto-check passed
  • API Documenter

    alirezarezvani/claude-code-tresor

    Auto-generate API documentation from code and comments. An agent skill from alirezarezvani/claude-code-tresor.

    777 GitHub stars~1.5k tokensUpdated 3 mo ago
    Backend & APIsAuto-check passed
  • Route To Openapi

    zebbern/claude-code-guide

    Generates RESTful API documentation (OpenAPI 3.0 / Swagger spec) by scanning route definitions in code for Flask, FastAPI, Express, Gin, and other frameworks.

    4.6k GitHub stars~1.1k tokensUpdated yesterday
    Backend & APIsAuto-check passed

More from Jeffallan/claude-skills

All 58 skills in this repo
  • API Designer

    Jeffallan/claude-skills

    Designs REST and GraphQL APIs from resource modeling to an OpenAPI 3.1 contract, with versioning, pagination and RFC 7807 error handling.

    12k GitHub starsUsed in 2 repos~2k tokens
    Auto-check passed
  • CLI Developer

    Jeffallan/claude-skills

    Walks through designing, building and polishing a command-line tool: user workflow and command hierarchy, implementation in commander, click, typer or cobra, completions and cross-platform testing.

    12k GitHub starsUsed in 1 repo~1.2k tokens
    Auto-check passed
  • Fine-Tuning Expert

    Jeffallan/claude-skills

    Guides LLM fine-tuning with LoRA and QLoRA through Hugging Face PEFT, from dataset validation and training checks to adapter merging, quantization and deployment.

    12k GitHub starsUsed in 1 repo~1.7k tokens
    Auto-check passed
  • GraphQL Architect

    Jeffallan/claude-skills

    Designs GraphQL schemas and Apollo Federation graphs, with DataLoader resolvers, subscriptions, query complexity limits and caching.

    12k GitHub starsUsed in 1 repo~1.3k tokens
    Auto-check passed
  • Kubernetes Specialist

    Jeffallan/claude-skills

    Creates and checks Kubernetes manifests, Helm charts, RBAC and network policies, and helps debug pod problems, with kubectl checks and rollback steps.

    12k GitHub starsUsed in 1 repo~2.1k tokens
    Auto-check passed
  • Laravel Specialist

    Jeffallan/claude-skills

    Builds Laravel 10+ applications with Eloquent models, Sanctum authentication, Horizon queues, API resources and Livewire components, tested with Pest or PHPUnit.

    12k GitHub starsUsed in 1 repo~2.1k tokens
    Auto-check passed

Questions about Code Documenter

What does Code Documenter do?

Generates and validates docstrings, OpenAPI specs, JSDoc annotations and user guides, running every code example through a real compiler or linter before reporting coverage. The workflow runs in six steps: ask for a format preference and any exclusions, detect the language and framework, find undocumented code, apply a consistent format, validate every example, and report a coverage summary. Validation is concrete rather than visual: Python doctest blocks run through python -m doctest or pytest --doctest-modules, typed TypeScript or JavaScript examples are checked with tsc --noEmit, and an OpenAPI spec is linted with npx @redocly/cli lint.

When should I use Code Documenter?

Code Documenter fits situations like: adding docstrings or JSDoc comments to undocumented functions and classes; writing or validating an OpenAPI or Swagger spec for a REST API; building a documentation site or a getting-started guide for a project.

How do I install Code Documenter in Claude Code?

Run `npx skills add Jeffallan/claude-skills --skill code-documenter -a claude-code`. Or copy the skill folder (skills/code-documenter in Jeffallan/claude-skills) into .claude/skills/code-documenter in your project. Claude Code loads it when a task matches its description.

How do I install Code Documenter in Codex?

Run `npx skills add Jeffallan/claude-skills --skill code-documenter -a codex`. Or copy the skill folder (skills/code-documenter in Jeffallan/claude-skills) into .agents/skills/code-documenter in your project. Codex loads it when a task matches its description.

Can I use Code Documenter in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Jeffallan/claude-skills --skill code-documenter -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/code-documenter, .gemini/skills/code-documenter, .github/skills/code-documenter and .opencode/skills/code-documenter in your project.

What does Code Documenter need to run?

Going by SKILL.md and its folder, Code Documenter needs the command-line tools its instructions call (python, pytest, tsc and npx). Our summary lists: Python, for doctest validation; tsc, for TypeScript or JavaScript example validation; npx @redocly/cli, for OpenAPI linting.

Does Code Documenter access the network?

SKILL.md names 3 domains. As links in the text: github.com, synergetic.solutions and jeffallan.github.io. This is read from the text; nothing was executed.

Is Code Documenter safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Code Documenter use?

Code Documenter is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Code Documenter use?

About 1.5k tokens (SKILL.md is roughly 5.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 11k tokens, read only when the agent opens those files.

What are the alternatives to Code Documenter?

Skills that share tags, products or a category with Code Documenter: Code Documenter (zebbern/claude-code-guide, 4.6k stars), Generating Documentation (ancoleman/ai-design-components, 526 stars), Agentic Workflows API Documentation Lungo (agntcy/coffeeAgntcy, 112 stars) and Api2cli (alexknowshtml/api2cli, 455 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Code Documenter?

Jeffallan (a GitHub user) maintains it in Jeffallan/claude-skills, which has 11,754 GitHub stars. The repository holds 58 skills in this directory. The repository was last updated on October 3, 2026.

Source: Jeffallan/claude-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.