docstring-generator

Generate language-specific docstrings for Python, Java, TypeScript, and C# code.

4|4|Updated Jan 15, 2026
One-click install
npx skills add https://github.com/darellchua2/opencode-config-template --skill docstring-generator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docstring-generator
Source: https://github.com/darellchua2/opencode-config-template/tree/main/skills/docstring-generator
Command: npx skills add https://github.com/darellchua2/opencode-config-template --skill docstring-generator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automatically generates language-specific docstrings for Python, Java, TypeScript, and C# to ensure consistent, thorough documentation across codebases.

Core Features & Use Cases

  • Language-aware docstring generation for Python (Google/NumPy/Sphinx), Java (Javadoc), TypeScript (JSDoc/TSDoc), and C# (XML documentation)
  • Scope-aware coverage for functions, methods, classes, interfaces, properties, and exceptions
  • PR-ready documentation enforcement and integration with linting/workflow checks
  • Best-practices guidance for parameter, return, and exception documentation with usage examples

Quick Start

To generate docstrings for a target file, provide the file path and locate definitions, e.g., "generate_docstrings.py --path src/utils.py". The tool will insert appropriate docstrings directly after definitions following language conventions.

Frequently Asked Questions about docstring-generator

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

FAQPage Schema
How do I auto-generate docstrings for multiple programming languages in my codebase?

Auto-generating docstrings for multiple languages involves detecting the code language and applying the appropriate style. This tool generates Python (Google/NumPy/Sphinx), Java (Javadoc), TypeScript (JSDoc/TSDoc), and C# (XML) docstrings for functions, methods, classes, and interfaces.

Can I integrate docstring generation into my PR and linting workflows?

Yes, you can integrate docstring generation into PR and linting workflows. The tool enforces PR-ready documentation and integrates with workflow checks to maintain documentation quality across your codebase.

How do I generate Javadoc or XML documentation for my classes and methods?

To generate Javadoc or XML documentation, provide your file path to the tool. It locates class, method, and interface definitions, then automatically inserts appropriately styled docstrings directly after the definitions following language conventions.

What's the best way to ensure consistent docstring styles across Python and TypeScript projects?

The best way to ensure consistent docstring styles is using language-aware generation that applies specific conventions like Google, NumPy, Sphinx for Python, and JSDoc or TSDoc for TypeScript. This guarantees thorough, standardized documentation across the entire codebase.

Does this docstring generator require any external dependencies or runtime environments?

No, this docstring generator assumes no external runtime requirements beyond standard tooling and project files. It operates directly on your codebase without needing additional dependencies.

What code structures are supported for automatic docstring insertion?

Automatic docstring insertion supports scope-aware coverage for functions, methods, classes, interfaces, properties, and exceptions. It provides best-practices guidance for parameter, return, and exception documentation with usage examples.