Global Commenting

Generate concise comments explaining complex logic in code files.

Updated Mar 13, 2023
One-click install
npx skills add https://github.com/pdovhomilja/dovhomilja-cz --skill global-commenting-pdovhomilja
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Global Commenting
Source: https://github.com/pdovhomilja/dovhomilja-cz/tree/main/.claude/skills/global-commenting
Command: npx skills add https://github.com/pdovhomilja/dovhomilja-cz --skill global-commenting-pdovhomilja

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents code clutter and ensures comments are minimal, helpful, and evergreen, focusing on explaining why code exists rather than what it does, promoting self-documenting code and improving maintainability.

Core Features & Use Cases

  • Value-Driven Comments: Add comments only for complex logic, non-obvious sections, or business rules that require explanation.
  • Self-Documenting Code: Prioritize clear naming, logical structure, and small, focused functions to make code inherently understandable.
  • Evergreen Documentation: Ensure comments remain relevant over time, avoiding temporary or change-related notes.
  • Use Case: When reviewing a complex algorithm, this skill guides the AI to add a concise comment explaining the high-level purpose or a specific mathematical derivation, rather than commenting on every line of code, ensuring the code itself is the primary source of truth.

Quick Start

Review the 'processOrder' function and add a comment only if a section of the logic is particularly complex or non-obvious, otherwise ensure the code is self-explanatory through clear naming and structure.

Frequently Asked Questions about Global Commenting

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

FAQPage Schema
How do I write code comments that actually add value instead of cluttering the code?

Value-adding comments explain *why* code exists and clarify complex logic or non-obvious sections, not what the code does. Prioritize self-documenting code through clear naming and focused functions; add comments only for business rules, mathematical derivations, or sections that aren't immediately understandable from the code itself.

When should I add a comment versus refactoring code for clarity?

Refactor first: use clear naming, smaller functions, and logical structure to make code self-explanatory. Add comments only when the logic remains genuinely complex after refactoring—for non-obvious algorithms, domain-specific rules, or performance trade-offs that naming alone cannot convey.

What makes a comment evergreen and maintainable?

Evergreen comments explain intent and design decisions that remain true as code evolves, avoiding temporary notes, change-related markers, or line-by-line explanations. Focus on the *why* so comments stay relevant through refactors and remain a reliable source of truth alongside the code.

How do I document complex logic without over-commenting?

Provide concise, high-level comments at the start of complex sections—summarize the algorithm's purpose or mathematical principle in 1–2 sentences. Let variable names, function signatures, and code structure handle the details; reserve comments for non-obvious reasoning or business context.

Can self-documenting code replace comments entirely?

Self-documenting code through clear naming and structure handles most explanation, but not all. Comments remain essential for complex algorithms, non-obvious decisions, and business rules that code syntax alone cannot express. The goal is minimal, high-value comments, not zero comments.

How do I review comments to ensure they meet coding standards?

During review, check that comments explain *why*, not *what*; avoid noise, temporary markers, and outdated information; ensure alignment with naming and structure; and verify complexity warrants explanation. Remove redundant comments and suggest refactoring if logic is too opaque after naming improvements.