lean-comments
Was er macht
Dieses Tool hilft dabei, den Code eines Programms sauber und leicht verständlich zu halten. Es prüft, ob Kommentare im Code wirklich nötig sind und ob sie das „Warum“ hinter einer Entscheidung erklären, statt nur zu wiederholen, was der Code ohnehin zeigt.
Wann du ihn nutzt
- ✓Wenn du neue Kommentare in den Code schreibst.
- ✓Wenn du vorhandene Kommentare prüfst, ob sie hilfreich sind.
- ✓Wenn Code unübersichtlich ist und eine klare Erklärung braucht.
Link zum Skill
https://github.com/github/awesome-copilot/blob/main/skills/lean-comments/SKILL.mdKopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.
So nutzt du ihn
Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.
Fertige Nachricht zum Einfügen
Für Claude Code, Codex oder Cursor: Führe den Befehl in deinem Projektordner aus, dann wird der Skill installiert.
Lade die SKILL.md herunter und lege sie in den Skills-Ordner deines Agenten.
Beispielanfrage an deine KI
“Prüfe die Kommentare in diesem Code-Schnipsel und stelle sicher, dass sie notwendig sind und das „Warum“ erklären.”
5 neue Skills pro Woche. 1 Minute Lesezeit.
So funktioniert es
Das Tool überlegt, ob ein erfahrener Programmierer wichtige Informationen verlieren würde, wenn der Kommentar fehlt. Es entfernt vor allem Kommentare, die nur den Code wiederholen oder offensichtlich sind.
Technischer Inhalt (originale SKILL.md)
Originaltext des Autors, auf Englisch, direkt von GitHub.
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:
- Delete or omit if the information is already clear without it
- Express through code if a tiny behavior-preserving readability improvement removes the need for it
- Shorten if it is necessary but contains unnecessary information or words
- Rewrite if it is necessary but unclear, inaccurate, stale, awkward, or inconsistent
- Use declaration documentation if the information belongs to the declaration's contract, semantics, or intended usage
- 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 removed.
Remove low-value commentary
Remove comments that merely:
- Restate or translate the code into prose
- Narrate the next statement or obvious control flow
- Explain an obvious guard clause, return, assignment, or branch
- Describe an obvious fetch, validation, transformation, mapping, filtering, creation, update, or deletion
- Repeat a declaration name, property name, type, signature, parameter, or return type
- Label or summarize a declaration
…
Häufige Fragen
Was ist „Quellcode“?
Quellcode ist der Text, den Programmierer schreiben und der dem Computer sagt, was er tun soll. Man kann ihn sich wie ein Rezept für einen Kuchen vorstellen.
Was sind „Kommentare“ im Code?
Kommentare sind Notizen im Code, mit denen Programmierer schwierige Stellen oder den Grund für eine Entscheidung erklären. Der Computer ignoriert sie.
Warum sind gute Kommentare wichtig?
Gute Kommentare helfen anderen Programmierern (oder dir selbst in der Zukunft), den Code schnell zu verstehen. So lässt er sich leichter pflegen und Fehler lassen sich leichter beheben.
Details
Originalbeschreibung des Autors
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, doc comments, docstrings, TODO, FIXME, NOTE, suppressions, or other source commentary, including while modifying code and deciding whether a comment is warranted at all. Defaults to no comment unless it
repo: github/awesome-copilot
Beliebtheit
- GitHub-Sterne
- 40k
- Platz im Ranking
- #7268
- Lizenz
- MIT
- Aktualisiert
- 15.10.2026
Kommentare
- …
Weitere Skills aus diesem Repository
acquire-codebase-knowledge
40kHilft deinem Agenten, ein bestehendes Code-Projekt zu verstehen und zu dokumentieren. Nützlich, um neue Teammitglieder einzuarbeiten oder die Architektur zu überblicken.
acreadiness-assess
40kErmöglicht deinem Agenten, die KI-Tauglichkeit eines Projekts zu prüfen und einen Bericht zu erstellen. So siehst du, wie gut das Projekt auf KI-Tools vorbereitet ist.
acreadiness-generate-instructions
40kHilft deinem Agenten, auf Basis einer Prüfung Anweisungen für KI-Tools zu erstellen. So arbeitet die KI besser mit dem Code und erkannte Lücken werden geschlossen.
acreadiness-policy
40kErmöglicht deinem Agenten, Richtlinien für die Bewertung von KI-Projekten festzulegen oder anzuwenden. So werden Projekte einheitlich geprüft und Vorgaben eingehalten.
Ähnliche Skills
technical-documentation
394kHilft deinem Agenten, klare technische Dokumentation und Agenten-Anleitungen zu schreiben und zu prüfen, damit Menschen und KI-Tools leicht folgen können.
architecture-decision-records
280kLässt deinen Agenten wichtige Entscheidungen zur Projektstruktur festhalten. So bleibt nachvollziehbar, warum etwas so gewählt wurde, und die Änderungen sind klar dokumentiert.
code-tour
280kLässt deinen Agenten Schritt-für-Schritt-Erklärungen des Codes mit genauen Datei- und Zeilenangaben erstellen. Nützlich für Einführungen, Erklärungen und Reviews.