Global Commenting

Guide developers on adding or removing comments for self-documenting code.

Updated Oct 31, 2025
One-click install
npx skills add https://github.com/FlorianRiquelme/statamic-assets --skill global-commenting-florianriquelme
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Global Commenting
Source: https://github.com/FlorianRiquelme/statamic-assets/tree/main/.claude/skills/global-commenting
Command: npx skills add https://github.com/FlorianRiquelme/statamic-assets --skill global-commenting-florianriquelme

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides the creation of self-documenting code and minimal, high-value comments, preventing outdated or redundant comments that clutter the codebase and hinder maintainability.

Core Features & Use Cases

  • Self-Documenting Code: Emphasizes clear structure and naming over excessive comments, making code inherently understandable.
  • Strategic Comments: Adds concise, helpful comments only to explain complex logic or non-obvious decisions, focusing on the 'why' not the 'what'.
  • Use Case: When reviewing a complex algorithm, this skill ensures that the code itself is readable, and only the most intricate parts have concise comments explaining the intent or reasoning, not just a restatement of the code.

Quick Start

Review the attached code file and add comments only where the logic is complex or non-obvious, ensuring the code is primarily self-documenting.

Frequently Asked Questions about Global Commenting

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

FAQPage Schema
How do I write comments that don't become outdated or redundant in my code?

Strategic commenting focuses on explaining complex logic and non-obvious decisions rather than restating what the code does. Write comments that capture the 'why' and 'intent' behind code, then refactor unclear sections to be self-documenting through better naming and structure, keeping comments minimal and high-value.

When should I add comments versus improving code readability instead?

Add comments only where logic is genuinely complex or reasoning is non-obvious; otherwise, prioritize self-documenting code through clear naming, structure, and straightforward implementation. Comments should explain intent and constraints, not restate what readable code already shows.

How do I audit existing comments to remove clutter and keep only what matters?

Review comments for relevance and necessity: remove those restating obvious code, consolidate redundant explanations, and preserve only comments explaining complex algorithms, non-standard decisions, or critical reasoning. This audit reduces maintenance burden and improves code clarity.

Can I apply commenting best practices across different programming languages?

Yes, commenting principles apply universally across languages and file types including PHP, JavaScript, TypeScript, and Vue. Self-documenting code and strategic comments for complex logic remain effective regardless of syntax or framework.

What's the difference between comments that help and comments that create technical debt?

Helpful comments explain non-obvious intent, architectural decisions, and complex reasoning; unhelpful ones restate code behavior or become outdated as logic changes. Technical debt comments are maintenance liabilities; focus instead on clear naming and structure that reduce comment dependence.