Lean-Comments
Lean-Comments is an code AI skill with a core value of Audits, writes, and refines maintained first-party source-code comments and declaration-level documentation across languages. It
helps developers solve real-world problems in the code domain, boosting
efficiency, automating repetitive tasks, and optimizing workflows.
Audits, writes, and refines maintained first-party source-code comments and declaration-level documentation across languages. Use when adding, editing, reviewing, cleaning up, or auditing comments, do
Quick Facts
mkdir -p ./skills/lean-comments && curl -sfL https://raw.githubusercontent.com/github/awesome-copilot/main/skills/lean-comments/SKILL.md -o ./skills/lean-comments/SKILL.md Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).
Skill Content
# Lean Comments
Goal
Keep the smallest amount of high-value commentary necessary to make a codebase easier and safer to understand and maintain.
The default is **no comment**.
A comment must preserve meaningful information that a competent maintainer cannot reasonably recover from the code, names, types, signatures, structure, tests, configuration, or nearby context.
Comments are not labels, narration, decoration, declaration summaries, change logs, or substitutes for clear code.
Reader model
Write for a competent maintainer reading the repository at HEAD months later, without access to the current conversation, prompt, diff, pull request, issue discussion, review discussion, or implementation process.
Document the durable state, contract, constraint, or rationale of the code as it exists. Do not assume the reader knows what changed, what came before, or what was discussed unless that context is deliberately preserved in a reliable project source.
Authority and evidence
Use this skill as the comment-policy authority when it is active.
Use language, framework, library, or infrastructure skills to determine whether a non-obvious constraint is real, not to override this skill's necessity test.
Honor explicit current repository requirements, public API documentation requirements, tooling contracts, and generated-source rules. Do not infer a documentation requirement merely from existing comment density or precedent.
Base retained or newly written rationale on evidence from the repository, tests, configuration, official API behavior, project documentation, issue tracker, ADRs, specifications, or another reliable source.
Never invent a security reason, performance reason, business rule, compatibility requirement, API constraint, historical reason, architectural rationale, or external limitation to justify commentary.
If no supported non-obvious reason exists, remove or omit it.
Core decision rule
Before retaining or adding ordinary commentary, mentally remove it and ask:
> Would a competent maintainer lose meaningful, non-obvious information if this comment did not exist?
If no, remove or omit it.
If uncertain, prefer no comment unless repository evidence demonstrates that the information matters.
If yes, retain only the minimum information necessary.
Never preserve a comment merely because it is correct, harmless, already present, grammatically polished, written as a warning, related to security or validation, related to internal or public state, or attached to an exported declaration.
The information itself must justify the comment.
Decision order
Evaluate existing and proposed commentary in this order:
1. **Delete or omit** if the information is already clear without it
2. **Express through code** if a tiny behavior-preserving readability improvement removes the need for it
3. **Shorten** if it is necessary but contains unnecessary information or words
4. **Rewrite** if it is necessary but unclear, inaccurate, stale, awkward, or inconsistent
5. **Use declaration documentation** if the information belongs to the declaration's contract, semantics, or intended usage
6. **Keep unchanged** only if it is already necessary, minimal, accurate, durable, and correctly styled
Always decide necessity before wording.
Do not polish an unnecessary comment or convert one into documentation.
What deserves an implementation comment
Use an implementation comment when it preserves non-obvious information such as:
- Why intentionally surprising code exists
- An external constraint or compatibility requirement
- An important invariant or subtle edge case
- A meaningful tradeoff or required workaround
- Non-obvious coupling
- An ordering, timing, lifecycle, concurrency, performance, or security constraint
- A reason an apparently simpler implementation would be incorrect
Prefer comments that explain **why** something matters.
Comments that merely explain **what** the code does should normally be remove
🎯 Best For
- Engineering teams doing code reviews
- Open source maintainers
- Technical writers
- API documentation teams
- Claude users
💡 Use Cases
- Reviewing pull requests for security vulnerabilities
- Checking code style consistency
- Generating JSDoc/TSDoc comments
- Writing README files for new projects
📖 How to Use This Skill
- 1
Install the Skill
Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.
- 2
Load into Your AI Assistant
Open Claude or GitHub Copilot and reference the skill. Paste the SKILL.md content or use the system prompt tab.
- 3
Apply Lean-Comments to Your Work
Open your project in the AI assistant and ask it to apply the skill. Start with a small module to verify the output quality.
- 4
Review and Refine
Review AI suggestions before committing. Run tests, check for regressions, and iterate on the skill output.
❓ Frequently Asked Questions
Does this skill check for OWASP Top 10?
Security-focused review skills often include OWASP checks. Check the skill content for specific vulnerability categories covered.
Does it follow my documentation style?
Most documentation skills respect existing style. Provide a style guide or example in your prompt.
Is Lean-Comments compatible with Cursor and VS Code?
Yes — this skill works with any AI coding assistant including Cursor, VS Code with Copilot, and JetBrains IDEs.
Do I need specific dependencies for Lean-Comments?
Check the install command and Works With section. Most code skills only require the AI assistant and your codebase.
How do I install Lean-Comments?
Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/lean-comments/SKILL.md, ready to use.
⚠️ Common Mistakes to Avoid
Blindly accepting AI suggestions
Always verify AI-generated review comments. Some suggestions may not apply to your specific codebase conventions.
Auto-generating without reviewing
AI documentation can contain inaccuracies. Always verify technical accuracy.
Skipping validation
Always test AI-generated code changes, even for simple refactors.
Missing dependency updates
Check if the skill requires updated dependencies or new packages.