python-comment-expert
Installation
SKILL.md
Python Comment Expert
This skill guides logic code comments (not docstrings) in Python.
Core Rules (Must Follow)
- Explain "Why", Not "What": Provide context, reasons for decisions, or explain unintuitive behavior. Do not repeat what the code obviously does.
- Code Clarity First: If code is self-explanatory, NO comment is needed. Do not use comments to hide bad code; refactor instead.
- Keep Sync: If you modify code, you MUST update associated comments. Contradictory comments are worse than none.
- No Commented-out Code: Remove commented-out code unless expected to be restored soon (e.g., temporary workarounds).
Comment Types & Formats
- Block Comments: Indented to the same level as code. Start with
#(hash + space). Separate paragraphs with a single#line. - Inline Comments: Use sparingly. Mainly for linters/scanners or extremely obscure lines (e.g., complex math).
- Special Markers: Use
TODO:,FIXME:,NOTE:,XXX:,HACK:,FAQ:to communicate with the team.