code-commenting
Installation
SKILL.md
Code Commenting
Workflow
- Improve code clarity first (naming, structure, refactors) before adding comments.
- Decide whether a comment is needed using the "Comment Decision Rules" below.
- Add comments that explain intent, constraints, and non-obvious trade-offs (the "why").
- Use standard doc-comment formats for public APIs and important interfaces.
- Review for staleness, redundancy, and risk (commented-out code, secrets, misleading claims).
- Keep comments maintained: update or remove when code changes.
Principles
- Prefer self-documenting code: comments are not a substitute for clarity.
- Comment the "why" (intent, constraints, context), not the "what".
- Treat comments as code: they need review, tests (when applicable), and maintenance.