comments

Reviews and rewrites code comments against a why-not-what decision framework.

Updated Jul 26, 2026
One-click install
npx skills add https://github.com/aymansalkhatib/medledger --skill comments-aymansalkhatib
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: comments
Source: https://github.com/aymansalkhatib/medledger/tree/main/.claude/skills/comments
Command: npx skills add https://github.com/aymansalkhatib/medledger --skill comments-aymansalkhatib

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Codebases accumulate noise comments that restate code, reference tickets, or narrate history, while genuinely needed explanations of hidden constraints go missing. This Skill applies a strict decision framework to decide when a comment is justified and deletes everything else. ## Core Features & Use Cases - Decision flow for comment justification: Routes every candidate comment through checks (obvious from names and types, better name possible, hidden constraint) before allowing it. - Six justified categories: Non-obvious invariants, choice rationale with rejected alternatives, subtle semantics with tiny examples, external business constraints, surprising behavior, and structured TODO/FIXME. - Delete-on-sight rules and review mode: Flags restatements, history notes, section banners, type restatements, and commented-out code; check <path> audits a file without editing, explain <symbol> proposes the minimal comment. - Use Case: While reviewing a NestJS pull request, run the check mode on a service file to list every comment violating a rule with a recommendation such as delete, shorten, or rewrite as WHY. ## Quick Start Ask the assistant to check the comments in a specific file and list which ones should be deleted or rewritten.

Frequently Asked Questions about comments

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

FAQPage Schema
How do I decide whether a code comment is worth keeping?▼

Run the comment through the decision flow: if the what is obvious from names and types, delete it; if a better name would fix the confusion, rename instead. Keep it only when it explains a hidden constraint, invariant, or rejected alternative.

How to audit a file for bad comments without changing code?▼

Use the check mode with a file path, for example check src/holdings.service.ts. It lists every comment violating a rule with the rule number and a recommendation such as delete, shorten, or rewrite as WHY, and makes no edits.

What kinds of code comments are actually justified?▼

Six categories: non-obvious invariants, choice rationale paired with the rejected alternative, subtle semantics with a tiny example, external business or regulatory constraints, surprising behavior readers will misread, and TODO or FIXME items with a concrete follow-up.

Which comments should always be deleted during review?▼

Delete comments that restate the code, name callers or tickets, record history that git already tracks, label closing braces, restate types, contain apologies or chatter, or consist of commented-out code. A typical review removes more comments than it adds.

When should I use a doc comment instead of an inline comment?▼

Use doc comments only on classes with non-obvious lifecycles, public service methods with preconditions or ordering requirements, and exported utilities with subtle input or output shapes. Never use them on DTOs, controllers, or trivial getters.