comments

Audit and rewrite source code comments using Ousterhout's design principles.

2|2|Updated Jun 28, 2015
One-click install
npx skills add https://github.com/camercu/dotfiles --skill comments-camercu
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: comments
Source: https://github.com/camercu/dotfiles/tree/main/common/.config/agents/skills/comments
Command: npx skills add https://github.com/camercu/dotfiles --skill comments-camercu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Source code often accumulates redundant, vague, or misleading comments that add maintenance burden without adding information. This Skill audits every comment in a codebase, classifies it as load-bearing or noise, and fixes files in place so comments capture intent and contracts rather than restating code. ## Core Features & Use Cases - Comment Classification: Evaluates each comment against decision rules to determine whether to remove, rewrite, or keep and strengthen it. - In-Place Editing: Edits files directly rather than only producing a report, then verifies changes with a build check such as cargo check. - Principles Framework: Applies Ousterhout's framework from A Philosophy of Software Design, with detailed guidance in references/principles.md covering module docs, interface contracts, field docs, and inline comments. - Use Case: After a refactor leaves stale doc comments across a Rust crate, run this Skill to strip redundant constructor docs, rewrite vague inline notes, and strengthen interface contract documentation. ## Quick Start Review and clean up the comments in my source files, removing redundant ones and rewriting vague ones.

Frequently Asked Questions about comments

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

FAQPage Schema
How do I clean up redundant comments in my code?▼

Read each file in full, then classify every comment as load-bearing or noise. Remove comments that restate identifier names or translate the next line into English, rewrite vague ones, and keep comments documenting non-obvious invariants or design rationale.

What makes a good code comment according to Ousterhout?▼

Good comments capture what code cannot express: design rationale, intent, constraints, and interface contracts. They sit at a higher abstraction level than the code, explain why rather than what, and survive implementation refactors without needing changes.

When should I refactor code instead of writing a comment?▼

Refactor when a comment is needed to explain what code does rather than why. Prefer better naming, extracting a named function, or restructuring so the intent is obvious, then delete the comment or reduce it to a one-liner explaining why.

Does this comment audit work with languages other than Rust?▼

The principles apply to any language, but the examples and conventions target Rust, including module docs, doc comments on structs and fields, and verification via cargo check. Equivalent build checks can substitute in other ecosystems.

Which comments should never be removed during an audit?▼

Keep comments documenting non-obvious invariants like ordering or saturation behavior, explanations of why a design decision was made, constraints not visible in types such as units or null semantics, and interface comments describing full behavior contracts.