본문으로 건너뛰기
Skillpedia
문서화40k · #7268

lean-comments

하는 일

이 도구는 프로그램의 코드를 깔끔하고 이해하기 쉽게 유지하도록 돕습니다. 코드 속 주석이 정말 필요한지, 그리고 코드가 이미 말하는 내용을 되풀이하는 대신 '왜'를 설명하는지 확인합니다.

사용하는 경우

  • ✓코드에 새 주석을 추가할 때.
  • ✓기존 주석이 유용한지 검토할 때.
  • ✓코드가 혼란스러워 명확한 설명이 필요할 때.

스킬 링크

https://github.com/github/awesome-copilot/blob/main/skills/lean-comments/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/github/awesome-copilot/blob/main/skills/lean-comments/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 코드 조각의 주석을 검토해 꼭 필요하고 '왜'를 설명하는지 확인해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

도구는 경험 많은 프로그래머가 그 주석이 없다면 중요한 정보를 잃을지 고려하는 방식으로 작동합니다. 코드를 그대로 반복하거나 당연한 내용을 담은 주석을 제거하는 것을 우선합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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:

  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 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

…

자주 묻는 질문

'소스 코드'란 무엇인가요?

컴퓨터에 무엇을 할지 알려 주는 프로그래머가 쓴 텍스트입니다. 케이크를 만드는 조리법과 같습니다.

코드의 '주석'이란 무엇인가요?

프로그래머가 어려운 부분이나 결정의 이유를 설명하려고 코드 안에 남기는 메모입니다. 컴퓨터는 이를 무시합니다.

좋은 주석이 왜 중요한가요?

좋은 주석은 다른 프로그래머(또는 미래의 자신)가 코드를 빨리 이해하도록 도와, 유지보수하고 오류를 고치기 쉽게 만듭니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
40k
순위
#7268
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬