code-comment-generator

Solid

Generates meaningful comments and documentation for code to improve maintenance and readability. Use when adding documentation to Python or Java code, including function/method docstrings, class documentation, inline explanations for complex logic, and code annotations (TODO, FIXME). Analyzes existing comment style in the codebase to match conventions. Produces clear, concise comments that explain the "why" not just the "what", following best practices for each language.

Data & Documents 160 stars 17 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 87/100

Stars 20%
73
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Code Comment Generator Generate meaningful, maintainable comments and documentation for your code. ## Core Capabilities This skill helps you create effective code documentation by: 1. **Analyzing code context** - Understanding what the code does and why 2. **Matching existing style** - Following comment conventions in your codebase 3. **Writing clear documentation** - Creating function/method/class documentation 4. **Adding inline explanations** - Explaining complex logic and algorithms 5. **Inserting code annotations** - Adding TODO, FIXME, and optimization notes ## Comment Generation Workflow ### Step 1: Analyze Existing Comment Style Before generating comments, examine the codebase to match style: **Look for:** - Documentation format (docstrings, Javadoc, etc.) - Comment verbosity level (detailed vs. concise) - Naming conventions and terminology - Use of examples in documentation - Type annotation style **Python Example - Analyze Existing Style:** ```python # If existing code uses this pattern: def get_user(user_id: int) -> User: """ Retrieve user by ID. Args: user_id: Unique identifier for the user Returns: User object if found Raises: UserNotFoundError: If user doesn't exist """ return db.query(User).get(user_id) ``` **Style Identified:** - Google-style docstrings - Type hints in signature - Concise summary line - Args/Returns/Raises sections - No examples included **Java Example - Analyze Existing Styl...

Details

Author
ArabelaTso
Repository
ArabelaTso/Skills-4-SE
Created
6 months ago
Last Updated
today
Language
Python
License
Apache-2.0

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Listed

commenting-code

Writes and reviews code comments that preserve non-obvious intent, contracts, invariants, and failure semantics without narrating the code. Uses clear layer placement (interface, implementation, cross-module) and lightweight review checks to keep comments accurate over time. Use when adding or reviewing inline comments, docstrings, API docs, or design notes for behavior that could be misunderstood.

0 Updated 1 weeks ago
msewell
Data & Documents Listed

comment-conventions

Language-agnostic code commenting and docblock conventions. Trigger on every source-code Edit/Write in any language (JS/TS, Python, PHP, Ruby, Go, Rust, Java, Kotlin, Swift, C/C++, C#, Elixir, Lua, Shell, etc.) — even when the user has not mentioned comments, docblocks, JSDoc/TSDoc/PHPDoc, docstrings, or documentation. Governs every comment authored or modified, every new function/method/class/component (which must get a compliant docblock), every inline comment (which must stay terse — no prose walls, no business-logic essays, no "step 1 / step 2" narration in the code path), and any non-compliant docblock encountered in the file being edited (which must be fixed in place — no need to ask first, except when the existing docblock is unusually long and clearly intentional, in which case leave it alone). Apply to all code authoring across all languages, every time source code is touched. When in doubt whether this skill applies to a code edit, invoke it. Skip only for non-code files (JSON/YAML/TOML configs, mar

0 Updated 2 weeks ago
rvanbaalen
AI & Automation Solid

code-documentation

Automatically generate clear, comprehensive documentation for codebases — including API references, inline docstrings, README files, and usage guides. Use when the user requests code documentation or provides relevant inputs for this workflow.

161 Updated 1 weeks ago
seb1n