Writing Evergreen Comments

Generate comments that explain what code does and why it exists.

41|27|Updated Oct 6, 2025
One-click install
npx skills add https://github.com/obra/clank --skill writing-evergreen-comments-obra
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Writing Evergreen Comments
Source: https://github.com/obra/clank/tree/main/skills/coding/writing-evergreen-comments
Command: npx skills add https://github.com/obra/clank --skill writing-evergreen-comments-obra

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates stale, confusing comments that reference code history, changes, or implementation details, ensuring documentation always describes current behavior and purpose.

Core Features & Use Cases

  • Evergreen Documentation: Create comments that explain WHAT code does and WHY it exists, never temporal context.
  • ABOUTME Pattern: Implement consistent, greppable file headers for quick understanding.
  • Use Case: When refactoring code and tempted to document changes, use this Skill to write comments that describe current functionality instead of historical context.

Quick Start

Use this skill to review my code comments and identify any that violate evergreen principles by referencing changes, history, or improvements.

Frequently Asked Questions about Writing Evergreen Comments

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write code comments that don't become outdated?

Evergreen comments explain WHAT code does and WHY it exists, not how it changed. Focus on current behavior and purpose rather than implementation history, change logs, or comparative language. This prevents comments from becoming stale when code is refactored or modified.

What should I include in file headers for code documentation?

Use the ABOUTME pattern: a consistent, greppable two-line file header that describes the file's current purpose and responsibility. This enables quick understanding and maintains uniformity across your codebase without relying on temporal context.

How do I review code comments during refactoring?

Identify comments referencing changes, history, or improvements, then rewrite them to describe present functionality instead. Remove instructional or comparative language. This ensures documentation stays relevant and accurate as code evolves.

Why should comments avoid referencing code history?

Historical comments become misleading as code changes. Evergreen comments describe current state and rationale, ensuring they remain accurate through refactoring cycles and preventing confusion about why code exists now, not how it was built.

Can I use evergreen comments for complex logic explanation?

Yes. Evergreen comments are especially useful for documenting complex logic, function and class responsibilities, and intricate algorithms. Explain the reasoning and current behavior rather than how the logic evolved or changed over time.

What's the difference between evergreen and change-history comments?

Evergreen comments describe present code purpose and mechanics; change-history comments reference past modifications. Evergreen approach maintains clarity across refactoring; change-history comments decay and confuse developers unfamiliar with edit history.