English
☰ 분류

코드 주석 달 곳 고르는 프롬프트

무엇을 하는지 반복하는 주석을 걷어내고, 왜 이렇게 했는지가 필요한 곳을 찾습니다.

분류개발 › 기술 문서
태그검토코드개발자
프롬프트 (영어 본문 · 답은 한국어로 옵니다)
Review where this code needs comments.

Three lists:

**A. Delete** — comments restating what the code says. `// increment counter` above an increment. These make readers stop trusting the comments that matter.

**B. Add** — places where a reader will ask why. Specifically:
- A choice that looks wrong but is deliberate — *the single highest-value comment there is, because the next person will otherwise "fix" it*
- A workaround for an external bug or limitation, with what it is working around
- A constant whose value came from somewhere — a measurement, a spec, a limit
- Ordering that matters and is not obvious
- A branch whose condition encodes a business rule
- Something intentionally not handled, and why

**C. Fix** — comments that no longer match the code. These are worse than no comment.

For each in B, write the comment. One or two lines, stating the reason, not the mechanism.

Rules:
- *Prefer making code self-explanatory over commenting it.* Where a better name or an extracted function removes the need, say that instead of writing a comment.
- Do not propose a comment on every function. Most do not need one.
- Where the reason is genuinely unknown to me, write the comment as a question for the team rather than inventing a rationale.
붙여 넣으면 맨 아래에 채울 칸(코드 · 배경·제약)이 나옵니다

어떤 프롬프트인가

코드가 무엇을 하는지는 코드가 말한다. 주석이 필요한 건 왜 그렇게 했는지다. 이 프롬프트는 중복 주석을 지우고, 나중에 누가 "이거 왜 이래?"라고 물을 자리를 찾는다.

같은 분류의 프롬프트

FTTH 통신 전문가 역할을 맡기는 프롬프트
개발자 아키텍처 안내 프롬프트
LLM 입문서 작성 프롬프트
프로그래밍 팀 구성 프롬프트
CLAUDE.md 조립 프롬프트