Use proactively whenever writing code comments, or when user requests code documentation. Enforces effective commenting principles (explain "why" over "what", document non-obvious behavior, avoid redundancy, keep comments fresh) and provides systematic workflow for documenting existing code.
/plugin marketplace add mthalman/superpowers/plugin install superpowers@claude-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Enforce effective code commenting principles and provide a systematic workflow for documenting code. This skill ensures comments explain reasoning and non-obvious behavior while avoiding redundancy and outdated documentation.
Use this skill:
Apply these principles to every comment written:
Explain reasoning, decisions, trade-offs, and context. The code already shows what it does.
Examples:
// Bad: Loop through users
for (const user of users) { ... }
// Good: Process users sequentially to avoid overwhelming the email API rate limit
for (const user of users) { ... }
Document edge cases, gotchas, performance implications, and side effects. Explain surprising behavior that isn't immediately clear from the code.
Examples:
# Bad: Calculate total
total = sum(items)
# Good: Sum excludes canceled items - they're already refunded
total = sum(item.price for item in items if item.status != 'canceled')
// Returns null when market is closed (weekends, holidays)
// Callers must handle null or risk NullPointerException
function getCurrentPrice(): number | null { ... }
Never write comments that just restate the code in English. If the code is self-explanatory, no comment is needed.
Examples:
// Bad: Increment counter by 1
counter++;
// Good: No comment needed - code is self-explanatory
counter++;
Comments must stay synchronized with code. Outdated comments are worse than no comments. When editing code, update or remove affected comments immediately.
Follow this process for any commenting task:
Read and analyze what needs documentation.
Find areas where principles apply:
Apply principles to each area:
Check each comment against principles before moving on.
Don't add comments when:
// Bad: Get user by ID
function getUserById(id) { ... }
// Good: No comment needed - function name is clear
function getUserById(id) { ... }
// Bad: Loop counter
for (let i = 0; i < x.length; i++) { ... }
// Good: No comment, better variable name
for (let userIndex = 0; userIndex < users.length; userIndex++) { ... }
// Bad: The user's email address
email: string;
// Good: No comment needed - type and name are clear
email: string;
Prefer: Clear code over comments. Only add comments when code alone cannot express the intent, reasoning, or non-obvious behavior.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.