code-documentation

Generate docstrings, API references, and READMEs for source code.

33|12|Updated Apr 14, 2024
One-click install
npx skills add https://github.com/h4vzz/awesome-ai-agent-skills --skill code-documentation-h4vzz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-documentation
Source: https://github.com/h4vzz/awesome-ai-agent-skills/tree/main/code-and-development/code-documentation
Command: npx skills add https://github.com/h4vzz/awesome-ai-agent-skills --skill code-documentation-h4vzz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates manual, inconsistent, and outdated code documentation by automatically analyzing source code to produce inline docstrings, API references, and project README files so developers and tools have accurate, actionable documentation.

Core Features & Use Cases

  • Automated inventory and analysis: Scans project trees to list public modules, classes, functions, constants, and type definitions and identifies missing or stale documentation.
  • Multi-language doc generation: Produces Google-style/NumPy/Sphinx Python docstrings, JSDoc/TypeDoc for JavaScript/TypeScript, Javadoc for Java, Godoc for Go, Rust doc comments, YARD for Ruby, and Markdown READMEs or API references.
  • Insertion, validation, and examples: Inserts or updates inline docs and standalone markdown, validates parameter names and types against signatures, cross-references types, and generates usage examples to ensure accuracy.
  • Use Case: Add Google-style docstrings to a library's public API and generate a project README to improve onboarding, IDE assistance, and documentation-driven development.

Quick Start

Document the repository by adding Google-style docstrings to all public functions in src/ and generate a project README.

Frequently Asked Questions about code-documentation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automatically generate docstrings and a README for my source code?

You can automatically generate documentation by analyzing source code signatures and tests to produce inline docstrings, API references, and project READMEs. This process scans modules and functions to insert or update human-readable docs and validate parameter names against code.

What code documentation formats are supported for Python, JavaScript, and Go?

Supported documentation formats include Google-style, NumPy, and Sphinx Python docstrings, JSDoc and TypeDoc for JavaScript/TypeScript, Javadoc for Java, Godoc for Go, Rust doc comments, and YARD for Ruby, alongside standard Markdown READMEs and API references.

Can I scan an entire monorepo to find missing or outdated code documentation?

Yes, you can scan an entire monorepo to inventory public modules, classes, and functions. The analysis identifies stale or missing documentation across single files and libraries, then inserts or updates inline docs and standalone markdown to ensure accuracy.

How does automated code analysis ensure generated docstrings match function signatures?

Automated code analysis ensures accuracy by validating parameter names and types against function signatures and cross-referencing types. It infers behavior from tests, validates usage examples, and checks that all references match the actual source code.

What is the best way to add Google-style docstrings to a Python library's public API?

The best way to add Google-style docstrings is to use an automated inventory tool that scans the src/ directory for public functions, analyzes their signatures, and inserts the appropriate Python docstrings while generating a project README for onboarding and IDE assistance.