Review PR comments - fix bad naming, preserve necessary context
Cleans PR comments by removing redundant ones and refactoring code to preserve essential context.
/plugin marketplace add bengous/claude-code-plugins/plugin install code-quality@bengous-pluginsPR_REFERENCEclaude-opus-4-5Review comments in a PR. Fix comments that compensate for bad naming. Preserve comments that provide context code cannot express.
| Comment compensates for... | Action |
|---|---|
| Bad variable/function name | Rename, remove comment |
| Missing abstraction | Extract to well-named function, remove comment |
| External knowledge | Keep |
| Inherent complexity | Keep |
Comments that explain WHAT code does—these are naming problems:
int d; // days elapsed → rename to elapsedDays// check if user can access premium before condition → extract to canAccessPremium()setTimeout(fn, 86400000); // 24 hours → const ONE_DAY_MS = 86400000Comments that explain what code CANNOT express:
// FCC requires 30-day retention minimum// Safari bug, see webkit#12345// Intentionally avoiding map() - 10x faster here// Tried recursion but hit stack limits// 0x1F frame delimiter per RFC 7230// Order matters - auth before session initi++ // increment iIdentify scope:
git diff --stat origin/main...HEAD
Select strategy based on PR size:
Read each file, identify all comments
Present findings before editing:
src/auth.js:
L45: "// convert to uppercase" → REMOVE (obvious from code)
L67: "// api timeout" → REFACTOR: rename `t` to `apiTimeoutMs`
L89: "// Safari workaround #234" → KEEP (external quirk)
Implement after user confirms
Verify tests pass
For PRs with >10 files, divide work across parallel agents:
Group files by directory or logical area
Spawn one subtask per group with this prompt:
Review comments in these files only: [FILE_LIST]
For each comment found, output ONE line:
PATH:LINE: "comment text" → REMOVE|REFACTOR|KEEP (reason)
For REFACTOR, include the rename: `oldName` → `newName`
Do not edit files. Report findings only.
Collect results from all agents
Present consolidated findings to user
Implement after confirmation