doc-comments-ai is an LLM-powered tool designed to automate code documentation generation, enhancing clarity and consistency in codebases. It supports various documentation formats, making it versatile for developers across multiple programming languages.
claude install fynnfluegge/doc-comments-aidoc-comments-ai generates documentation comment blocks for methods in your code using OpenAI, Azure OpenAI, or 100% local LLMs without data leaks. It supports 11 programming languages including Python, JavaScript, Java, Rust, Go, and C++, integrating Tree-sitter for accurate code parsing. The tool generates both method-level documentation (Javadoc, JSDoc, Docstring, Rustdoc) and inline comments within method bodies. It runs via simple CLI commands with options for guided confirmation, different model selections, and local hardware-accelerated inference, letting developers focus on writing code while LLMs handle documentation.
["Identify the code snippet you want to document and note its language (e.g., Python, JavaScript, Java).","Specify the documentation style guide you want to follow (e.g., Google, NumPy, JSDoc, Javadoc). If unsure, use the default style for the language.","Paste the code snippet into your AI tool and append the prompt template with the language, style guide, and code. Example: 'Generate JavaScript JSDoc comments for the following function.'","Review the generated docstring for accuracy and completeness. Adjust placeholders like [LANGUAGE] or [STYLE_GUIDE] as needed.","Integrate the docstring into your codebase. For multi-file projects, use this tool to maintain consistency across documentation."]
Generate docstrings for Python functions
Create Javadoc for Java projects
Automate documentation for Rust codebases
Enhance existing documentation with AI suggestions
claude install fynnfluegge/doc-comments-aigit clone https://github.com/fynnfluegge/doc-comments-aiCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Generate comprehensive and well-formatted documentation comments for the following [CODE_SNIPPET] in [LANGUAGE]. Ensure the comments follow [STYLE_GUIDE] conventions and include: purpose, parameters, return values, exceptions, and example usage. Format the output as a valid docstring for the target language. Example: 'Generate Python docstrings for the following function using Google style.'
```python
def calculate_discount(price: float, discount_rate: float) -> float:
"""
Calculate the final price after applying a discount rate to the original price.
Args:
price (float): The original price of the item before discount. Must be a positive number.
discount_rate (float): The discount rate to apply (e.g., 0.20 for 20%). Must be between 0 and 1.
Returns:
float: The final price after applying the discount. Returns 0 if inputs are invalid.
Raises:
ValueError: If `price` is negative or `discount_rate` is outside the range [0, 1].
Examples:
>>> calculate_discount(100.0, 0.20)
80.0
>>> calculate_discount(50.0, 0.50)
25.0
>>> calculate_discount(-10.0, 0.10)
Traceback (most recent call last):
...
ValueError: Price cannot be negative.
"""
if price < 0:
raise ValueError("Price cannot be negative.")
if not (0 <= discount_rate <= 1):
raise ValueError("Discount rate must be between 0 and 1.")
return price * (1 - discount_rate)
```Automate your browser workflows effortlessly
Orchestrate workloads with multi-cloud support, job scheduling, and integrated service discovery features.
Serverless MySQL database platform
Design, document, and generate code for APIs with interactive tools for developers.
CI/CD automation with build configuration as code
Enhance performance monitoring and root cause analysis with real-time distributed tracing.
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan