Code Comments Skill

Generate code comments and documentation following language-specific formats.

Updated Dec 24, 2025
One-click install
npx skills add https://github.com/yangqiong/claude-skills --skill code-comments-skill
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Code Comments Skill
Source: https://github.com/yangqiong/claude-skills/tree/main/documentation/code-comments
Command: npx skills add https://github.com/yangqiong/claude-skills --skill code-comments-skill

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the challenge of writing effective, maintainable code comments and documentation, ensuring that code is understandable and its purpose is clear to all developers.

Core Features & Use Cases

  • Comment Best Practices: Provides clear guidelines on when and how to write comments, distinguishing between necessary explanations and redundant information.
  • Documentation Formats: Demonstrates standard documentation formats for various programming languages (JSDoc, Python Docstrings, JavaDoc, Go).
  • Comment Types: Details on documenting functions, classes, inline explanations, and file headers.
  • Special Tags: Introduces useful tags like TODO, FIXME, HACK, NOTE, OPTIMIZE, and SECURITY for structured annotations.
  • Use Case: A developer can use this skill to understand how to properly document a complex algorithm, ensuring future maintainability and collaboration.

Quick Start

Use the Code Comments Skill to add documentation to the provided JavaScript function.

Frequently Asked Questions about Code Comments Skill

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

FAQPage Schema
How do I write effective code comments and documentation for different programming languages?

To write effective code comments, follow established best practices and standard documentation formats like JSDoc, Python Docstrings, JavaDoc, and Go. This ensures code clarity by explaining complex logic and documenting public APIs consistently across various programming languages.

What is the best way to document function parameters, return values, and exceptions in code?

The best way to document function parameters, return values, and exceptions is to use standard documentation formats such as JSDoc or Python Docstrings. These formats provide structured guidelines for maintaining consistent documentation standards and ensuring code clarity for developers.

When should I use special code annotation tags like TODO, FIXME, and SECURITY?

You should use special code annotation tags like TODO, FIXME, HACK, NOTE, OPTIMIZE, and SECURITY when you need to add structured annotations to your code. These tags help developers quickly identify areas requiring future maintenance, security reviews, or performance optimizations.

How do I distinguish between necessary code comments and redundant information?

To distinguish between necessary code comments and redundant information, apply comment best practices that focus on explaining complex logic and documenting public APIs. Effective comments clarify the code's purpose and maintainability without restating obvious implementation details.

Does this code documentation approach support documenting complex algorithms and file headers?

Yes, this code documentation approach supports documenting complex algorithms and file headers. It provides detailed guidelines for various comment types, including inline explanations, class documentation, and file headers, ensuring future maintainability and collaboration.