comment

Insert descriptive comments and docstrings into code without modifying any logic.

Updated Jun 4, 2026
One-click install
npx skills add https://github.com/PeteRichardson/skills --skill comment-peterichardson
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: comment
Source: https://github.com/PeteRichardson/skills/tree/main/comment
Command: npx skills add https://github.com/PeteRichardson/skills --skill comment-peterichardson

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing and maintaining meaningful code comments is tedious, and automated tools often rewrite or reformat code in the process. This Skill adds high-quality comments and docstrings while guaranteeing that all non-comment code remains byte-for-byte identical. ## Core Features & Use Cases - Comment-only insertion: Adds inline comments and doc-comments without modifying, reordering, or reformatting any existing code. - Scoped targeting: Comment an entire file or narrow the scope to a specific function, class, or logical section via a hint like "/comment the sorting logic". - Language-aware docstrings: Generates doc-comments in the native format for Python, JavaScript/TypeScript, Java, Swift, Rust, and C/C++, matching the file's existing style. - Existing comment preservation: Evaluates current comments and only updates them when they are wrong, outdated, or materially incomplete. - Use Case: You inherit an undocumented legacy module. Run the skill on the file to get docstrings for every public function and explanations for non-obvious logic, with zero risk of code changes. ## Quick Start Ask the AI to add comments to the current file, or target a specific section with a command like "/comment the sorting function".

Frequently Asked Questions about comment

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

FAQPage Schema
How do I add comments to code without changing the logic?▼

Invoke the skill on a file or a named section, and it inserts only comments and docstrings. The constraint guarantees that stripping all comments from the result leaves code byte-for-byte identical to the original.

How to generate docstrings for Python or JavaScript functions?▼

The skill adds structured doc-comments in each language's native format, such as Google-style docstrings for Python and JSDoc for JavaScript. It covers summaries, parameters, return values, and exceptions while matching the file's existing conventions.

Can I comment only a specific function instead of the whole file?▼

Yes, pass a hint such as "/comment the sorting logic" to scope the work to a function, class, or section. Type targets include all related extensions and implementations, and ambiguous hints trigger a clarification request.

Does it modify or reformat my existing comments?▼

Existing comments are preserved unchanged unless they are factually wrong, outdated by code changes, or missing critical information. When updates are needed, only the minimal correction is made rather than a full rewrite.

What are the limitations of automated code commenting?▼

The skill will not refactor, fix bugs, delete dead code, or add TODO markers. If a section is too unclear to explain without changing it, the skill stops and asks the user how to proceed instead of rewriting the code.