comment-guidelines
Comment Guidelines
These guidelines should be automatically applied whenever writing or modifying code.
Core Principles
- Self-documenting code first - Use clear naming and structure; comments are last resort
- WHY over WHAT - Comments explain intent and reasoning, not mechanics
- Reduce cognitive load - Make non-obvious knowledge explicit
- Zero redundancy - Never duplicate what code already expresses
When to Add Comments
More from ahonn/dotfiles
seo-backlink-strategy
Backlink acquisition strategies. Use when: developing link building campaigns, analyzing competitor backlinks. Triggers on: 'backlinks', 'link building', 'domain authority'.
42react-best-practices
React best practices from react.dev and Vercel. Use when: (1) Reviewing React code, (2) Debugging performance issues, (3) Optimizing bundle size, (4) Writing effects or state logic. Triggers on: React performance, re-render, bundle size, waterfalls, code splitting, memo, useCallback, useMemo, useEffect, SSR flicker, initial load slow, React Compiler, state structure, immutable update, setState array object.
14rust-design-patterns
Rust idioms and design patterns for writing idiomatic code. Use when: (1) Writing new Rust code, (2) Reviewing Rust code, (3) Solving borrow checker issues, (4) Designing Rust APIs. Triggers on: Rust ownership problems, lifetime errors, API design questions, 'how to do X idiomatically in Rust'.
14comment-cleanup
Clean up code comments. Use when: improving comment quality, removing redundant comments. Triggers on: 'clean up comments', 'comment cleanup'.
12skill-creator
Guide for creating Claude skills. Use when: creating or updating skills. Triggers on: 'create skill', 'new skill', 'skill template'.
12agent-browser
Browser automation for web testing, screenshots, data extraction. Use when: navigating websites, filling forms, testing web apps. Triggers on: 'open browser', 'screenshot', 'click element'.
11