Repository navigation
feat(code-review): flag unnecessary comments - #304
Conversation
Add an explicit 'Unnecessary comments' check under the Complexity / Good Taste scenario so the code-review skill suggests removing noisy or redundant comments that restate the code, narrate the diff, or describe non-local behavior. Reserve comments for genuinely unintuitive things. Refs OpenHands/software-agent-sdk#3498. Co-authored-by: openhands <openhands@all-hands.dev>
|
✅ Review complete. This review was performed through OpenHands Cloud Automation. You can log in and view the conversation here. |
all-hands-bot
left a comment
There was a problem hiding this comment.
Code Review
🟢 Good taste — Elegant, simple solution.
Analysis
This PR adds a new review criterion to the code-review skill: flagging unnecessary comments. The change is minimal (6 lines of bullet points), well-targeted, and addresses a genuine problem in code reviews.
What's good:
- Clear examples of what to flag (self-describing comments, diff summaries, non-local behavior descriptions, PR description paraphrases)
- Clear guidance on when comments ARE appropriate (non-obvious invariants, workarounds, ordering requirements, deliberate trade-offs)
- Aligns with the existing philosophy: "When in doubt, prefer restructuring or renaming over commenting"
- Fits naturally as an extension of section 2 (Complexity and Good Taste Assessment)
No issues found.
[RISK ASSESSMENT]
- [Overall PR]
⚠️ Risk Assessment: 🟢 LOW
This is a documentation-only change to a skill prompt file. No code changes, no dependencies, no breaking changes.
VERDICT:
✅ Worth merging — Well-reasoned, targeted addition that improves the reviewer persona without any downside.
KEY INSIGHT:
The guidance correctly identifies that comments which drift out of sync with code (non-local behavior descriptions) are worse than no comments at all.
This review was generated by an AI agent (OpenHands) on behalf of the user through OpenHands Automation. View conversation
|
✅ Review complete. This review was performed through OpenHands Cloud Automation. You can log in and view the conversation here. |
all-hands-bot
left a comment
There was a problem hiding this comment.
Code Review
🟢 Good taste — Elegant, targeted addition.
Analysis
This PR adds a new review criterion to flag unnecessary comments — a genuine pain point in code reviews. The change is well-executed:
What works:
- Clear, actionable examples: Self-describing comments, diff summaries, non-local behavior descriptions, and PR-description paraphrases are all concrete anti-patterns reviewers can spot.
- Positive framing: "Reserve comments for genuinely unintuitive things" provides the complementary signal — not just what to remove, but when to keep.
- Right placement: Fits naturally under section 2 (Complexity and Good Taste) alongside "Missing inline documentation for non-obvious logic" — together they cover when documentation helps vs. hurts.
- Consistent tone: Matches the existing framework's voice and indentation.
- Real-world reference: The "3-line change should not produce 19 lines of comments" callback makes it immediately relatable.
No issues found.
[RISK ASSESSMENT]
- [Overall PR]
⚠️ Risk Assessment: 🟢 LOW
Documentation-only change to a skill prompt. No code paths, no dependencies, no breaking changes. Directly addresses a reported problem in the SDK's review workflow.
VERDICT:
✅ Worth merging — Concise, well-grounded addition that improves the reviewer persona without downside.
KEY INSIGHT:
The guidance correctly identifies that comments describing non-local behavior (other modules, callers, downstream effects) with no mechanism to stay in sync are worse than no comments — they drift and mislead readers.
This review was generated by an AI agent (OpenHands) on behalf of the user through OpenHands Automation. View conversation
|
🚀 Released in v0.1.0. |
|
🚀 Released in v0.2.0. |
|
🚀 Released in v0.4.0. |
Why
Requested in this comment on OpenHands/software-agent-sdk#3498.
That issue calls out PRs where a 3-line code change ships with ~19 lines of narrative comments — restating the code, summarizing the diff, or describing non-local behavior. The reporter asked that the
code-reviewskill explicitly suggest removing those comments when it reviews a PR.Summary
In
skills/code-review/SKILL.md, extend scenario 2. Complexity and "Good Taste" Assessment with anUnnecessary commentssub-checklist that tells the reviewer to flag and suggest removal of:git blame.…and reserves comments for genuinely unintuitive things (invariants, workarounds, ordering/locking, deliberate trade-offs). Includes the "3-line change should not produce 19 lines of comments" callback from #3498.
Placed under scenario 2 (rather than a new scenario) to avoid renumbering the rest of the framework — it's a natural fit alongside the existing "Missing inline documentation for non-obvious logic" bullet, which it complements.
How to Test
Documentation-only change to a skill prompt. Verified by:
skills/code-review/SKILL.mdto confirm the new bullet is consistent in tone and indentation with the existing list under scenario 2.Related
AGENTS.md.This PR was created by an AI agent (OpenHands) on behalf of @juanmichelini in response to OpenHands/software-agent-sdk#3498 (comment).
@juanmichelini can click here to continue refining the PR