comment-guidelines

Enforce WHY-over-WHAT comment guidelines during code edits and reviews.

62|2|Updated Feb 21, 2017
One-click install
npx skills add https://github.com/ahonn/dotfiles --skill comment-guidelines
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: comment-guidelines
Source: https://github.com/ahonn/dotfiles/tree/main/.claude/skills/comment-guidelines
Command: npx skills add https://github.com/ahonn/dotfiles --skill comment-guidelines

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This policy makes code maintenance easier by removing redundant comments and ensuring remaining comments explain the reasoning behind decisions, not the obvious implementation.

Core Features & Use Cases

  • Removes comments that restate what the code does, keeping only rationale and design decisions.
  • Encourages explicit WHY explanations for non-obvious behavior, edge cases, and interfaces.
  • Automatically applies guidelines during edits to improve readability and maintainability.

Quick Start

Apply the WHY over WHAT principle to all new and existing comments during code edits.

Frequently Asked Questions about comment-guidelines

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

FAQPage Schema
How do I enforce code comment guidelines to explain why and not what?

To enforce code comment guidelines, apply the WHY over WHAT principle during code edits and reviews. This removes redundant comments that restate implementation details while preserving rationale, design decisions, and explanations for non-obvious behavior.

What is the best way to remove redundant comments that restate code logic?

The best way to remove redundant comments is to enforce a WHY-not-WHAT policy during editing. Automatically strip comments that restate obvious implementation details, keeping only rationale and design decisions to improve readability and maintainability.

How do I write comments that explain the reasoning behind non-obvious code behavior?

To write comments explaining reasoning, focus on the WHY by documenting edge cases, design decisions, and interface intent. Ensure these rationale explanations are retained during edits while removing comments that merely describe what the code does.

Does this code comment policy work across multiple programming languages?

Yes, this code comment policy applies across programming languages. It enforces readability and intent guidelines universally during editing and review, ensuring WHY-not-WHAT explanations are retained and redundant comments are removed regardless of the language.

When should I not use the WHY over WHAT principle for code comments?

You should not apply the WHY over WHAT principle when a comment explicitly clarifies interface intent, edge cases, or non-obvious behavior. The policy preserves these rationale explanations and only removes comments that restate obvious implementation details.