code-comments
Code Comments
Write documentation that lives with the code it describes. Plain language. No jargon. Explain the why, not the what.
Core Philosophy
Co-location wins. Documentation in separate files drifts out of sync. Comments next to code stay accurate because they're updated together.
Write for three audiences:
- Future you, six months from now
- Teammates reading unfamiliar code
- AI assistants (Claude, Copilot) who see one file at a time
The "why" test: Before writing a comment, ask: "Does this explain why this code exists or why it works this way?" If it only restates what the code does, skip it.
Documentation Levels
File Headers
More from petekp/claude-code-setup
design-critique
Critique UI/UX designs for clarity, hierarchy, interaction, accessibility, and craft. Use for design reviews, PR feedback on UI changes, evaluating mockups, checking if a component is ship-ready, or when honest feedback is needed on whether something meets a high bar.
46personality-profiler
Generate rich personality profiles from social media data exports (Twitter/X, LinkedIn, Instagram). Use when a user wants to analyze their social media presence, create a personality profile for AI personalization, understand their communication patterns, or extract insights from their digital footprint. Triggers on requests like "analyze my Twitter data", "create a personality profile", "what can you learn about me from my posts", "personalize an AI for me", or when users provide social media export files.
40swiftui
Use when building SwiftUI interfaces for iOS, iPadOS, macOS, or visionOS. Triggers on Liquid Glass adoption, SwiftUI animation/transitions, layout patterns, state management, design tokens, performance optimization, accessibility in SwiftUI, or creating "Apple-level" UI quality.
39deep-research
|
36unix-macos-engineer
Expert Unix and macOS systems engineer for shell scripting, system administration, command-line tools, launchd, Homebrew, networking, and low-level system tasks. Use when the user asks about Unix commands, shell scripts, macOS system configuration, process management, or troubleshooting system issues.
36openclaw-customizer
>
36