agentleFS
TanayK07TanayK07/pr-proof/skills/pr-comment-validation/SKILL.md

pr-comment-validation

Skill3 starsChanged 2 months agoApache-2.0View on GitHub

Use when receiving PR review comments and needing to evaluate each one before acting. Validates reviewer claims against SOLID principles, design patterns, official docs, and codebase reality. Produces an evidence-based verdict for each comment before any code changes. Use when asked to "validate PR comments", "check review comments", "analyze PR feedback", "are these comments valid", or "triage PR review".

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 11 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈11

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Research-first validation of PR review comments: Every reviewer claim gets investigated against SOLID principles, design patterns, language …

    line 15
  2. Distinctive:

    Core principle: No code changes until every comment has a verdict with evidence.

    line 19
  3. Distinctive:

    Before implementing any reviewer suggestion

    line 27
  4. Distinctive:

    Read the FULL file the comment references (not just the diff hunk)

    line 83
  5. Distinctive:

    Read 2-3 related files (callers, interfaces, sibling implementations)

    line 84
  6. Distinctive:

    Check types, null safety, error handling — is the concern real?

    line 94
  7. Distinctive:

    Check existing conventions with Grep/Glob

    line 102
  8. Distinctive:

    If 10 other files do it the same way, the reviewer may be wrong about convention

    line 103
  9. Distinctive:

    If the codebase has an established pattern, consistency may trump "correctness"

    line 104
  10. Distinctive:

    NO: No code change needed — explain why in the reply

    line 155
  11. Distinctive:

    Use these *definitions*, not blog-post approximations:

    line 249

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

PR Comment Validation

Overview

Research-first validation of PR review comments. Every reviewer claim gets investigated against SOLID principles, design patterns, language specs, official docs, and codebase reality before any action is taken.

Core principle: No code changes until every comment has a verdict with evidence.

When to Use

  • Received PR review comments and want to validate before acting
  • Reviewer flagged issues and you need to determine which are real
  • Want evidence-based triage of review feedback
  • Asked to "validate", "check", "analyze", or "triage" PR comments
  • Before implementing any reviewer suggestion

When NOT to use:

  • Writing your own PR review (use pr-review skill)
  • Simple typo/formatting fixes (just fix them)

Phase 0: Fetch PR and All Comments

  1. Identify the PR:
    gh pr view --json number,baseRefName,url,title,body,headRefName
  2. Fetch all review comments (inline):
    gh api repos/{owner}/{repo}/pulls/{pr_number}/comments \
      --paginate --jq '.[] | {id, path, line, body, user: .user.login, created_at}'
  3. Fetch top-level review comments:
    gh api repos/{owner}/{repo}/pulls/{pr_number}/reviews \
      --paginate --jq '.[] | select(.body != "") | {id, body, user: .user.login, state}'
  4. Get the full diff for context:
    git fetch origin <base> --quiet
    git diff origin/<base>...HEAD
  5. Build a numbered list of every distinct comment/suggestion. Group threaded replies with their parent.

Phase 1: Classify Each Comment

For each comment, assign a category:

CategoryDescriptionExamples
CORRECTNESSClaims code has a bug or logical error"This will NPE when X is null"
SOLIDInvokes a SOLID principle violation"This violates SRP", "breaks OCP"
PATTERNSuggests a design pattern change"Use strategy pattern here"
PERFORMANCEClaims a performance issue"This is O(n^2)", "unnecessary allocation"
SECURITYFlags a security concern"SQL injection risk", "XSS vector"
CONVENTIONCodebase convention or style"We use camelCase here", "wrong directory"
ARCHITECTUREStructural or layering concern"This belongs in the service layer"
BEST-PRACTICEGeneral engineering best practice"Add error handling", "use constants"
NITPICKMinor style preference, no impact"Rename this variable", "add blank line"
QUESTIONAsking for clarification, not suggesting change"Why did you choose X?"

Phase 2: Deep Investigation (Per Comment)

For EACH comment, run this investigation. Do NOT skip steps.

Step 1: Read the Code Context

  • Read the FULL file the comment references (not just the diff hunk)
  • Read 2-3 related files (callers, interfaces, sibling implementations)
  • Understand the actual runtime behavior, not just what the code looks like

Step 2: Evaluate the Reviewer's Claim

Ask these questions:

Is the claim factually accurate?

  • Does the code actually do what the reviewer says it does?
  • Trace the execution path — does the failure scenario actually happen?
  • Check types, null safety, error handling — is the concern real?

Does the principle apply here?

  • SOLID principles have contexts where they DON'T apply (e.g., SRP in a small script)
  • Design patterns have tradeoffs — is the suggested pattern actually better here?
  • Is this premature abstraction disguised as a principle?

What does the codebase already do?

  • Check existing conventions with Grep/Glob
  • If 10 other files do it the same way, the reviewer may be wrong about convention
  • If the codebase has an established pattern, consistency may trump "correctness"

Step 3: Research External Evidence

Use WebSearch to find authoritative sources:

  • Official language/framework documentation
  • The actual SOLID principle definition (not blog-post interpretations)
  • Design pattern applicability from Gang of Four or equivalent authority
  • Performance benchmarks or complexity analysis
  • Security advisories (CVE, OWASP) if security-related
  • Relevant RFCs, specs, or protocol documentation

Cite specific sources. "Best practice" without a source is opinion, not evidence.

Step 4: Check for False Positive Patterns

Common false positives reviewers produce:

False PositiveReality
"Violates SRP" on a cohesive classSRP means one reason to change, not one method
"Use dependency injection" everywhereDI adds complexity; only needed when you test or swap implementations
"Extract to a helper/utility"Three lines of code don't need abstraction
"Add error handling" for impossible errorsInternal code with type guarantees doesn't need defensive checks
"This is O(n^2)" on n < 100Algorithmic complexity irrelevant at small scale
"Use a design pattern" for simple logicPatterns solve recurring complex problems, not all problems
"Not thread-safe" when single-threadedCheck actual threading model before flagging
"Magic number" for self-evident valuestimeout: 30 is often clearer than timeout: DEFAULT_TIMEOUT_SECONDS
"Missing tests" for trivial codeTesting getters/setters or config isn't valuable
"Rename this" for domain termsReviewer may not know the domain vocabulary

Step 5: Render Verdict

For each comment, produce:

VERDICT: VALID | INVALID | PARTIALLY_VALID | STYLE_PREFERENCE | GOOD_QUESTION
ACTIONABLE: YES | NO | OPTIONAL
PRIORITY: CRITICAL | HIGH | MEDIUM | LOW | SKIP

Verdict criteria:

  • VALID: Claim is technically correct AND matters for this codebase
  • INVALID: Claim is factually wrong, doesn't apply here, or based on misunderstanding
  • PARTIALLY_VALID: Has a point but overstates the issue or suggests wrong fix
  • STYLE_PREFERENCE: Neither right nor wrong, just different taste
  • GOOD_QUESTION: Legitimate question that deserves an answer, not a code change

Actionable criteria:

  • YES: Code should change — the issue is real and impactful
  • NO: No code change needed — explain why in the reply
  • OPTIONAL: Marginal improvement, implement if easy, skip if costly

Phase 3: Build the Validation Report

Present this report to the user BEFORE touching any code.

# PR Comment Validation Report

**PR:** #<number> — <title>
**Reviewer(s):** <usernames>
**Comments analyzed:** <count>

## Summary
| Verdict | Count |
|---------|-------|
| VALID (actionable) | X |
| VALID (optional) | X |
| PARTIALLY_VALID | X |
| INVALID | X |
| STYLE_PREFERENCE | X |
| GOOD_QUESTION | X |

---

## Comment 1: "<first line of comment>"
**File:** `path/to/file.ext:line`
**Category:** CORRECTNESS
**Reviewer claims:** <one-line summary of what reviewer is saying>

### Investigation
<What you found when you read the code and researched>

### Evidence
- **FOR:** <evidence supporting the reviewer's claim with sources>
- **AGAINST:** <evidence contradicting the claim with sources>

### Verdict: VALID | Actionable: YES | Priority: HIGH
### Recommended Action
<Specific code change to make, or reply to post>

---

## Comment 2: ...
(repeat for each comment)

---

## Recommended Action Plan
1. [ ] <actionable items in priority order>
2. [ ] ...

## Comments to Reply To (no code change)
- Comment X: Reply with "<explanation of why no change needed>"
- Comment Y: Reply with "<answer to reviewer's question>"

Phase 4: Execute (Only After User Approval)

digraph execution {
  "Report presented" -> "User reviews";
  "User reviews" -> "User approves all" [label="approve"];
  "User reviews" -> "User modifies list" [label="adjust"];
  "User approves all" -> "Implement changes";
  "User modifies list" -> "Implement changes";
  "Implement changes" -> "Reply to non-actionable comments";
  "Reply to non-actionable comments" -> "Done";
}
  1. Implement approved actionable items in priority order
  2. Reply to non-actionable comments with evidence-based explanations
  3. Reply to questions with clear answers

When replying to comments on GitHub, use thread replies:

gh api repos/{owner}/{repo}/pulls/{pr_number}/comments/{comment_id}/replies \
  -f body="<reply>"

Red Flags — STOP and Re-investigate

  • You're about to mark all comments as VALID without pushback
  • You're marking things INVALID because they're inconvenient to fix
  • You can't find authoritative sources for your verdict
  • You're using "codebase convention" to dismiss a real bug
  • You're implementing changes before finishing the full report

If any of these apply: pause, re-read the comment, search deeper.

SOLID Principles Quick Reference (for validation)

Use these definitions, not blog-post approximations:

PrincipleActual MeaningCommon Misapplication
SRPOne reason to change (one actor/stakeholder)"One method per class" — wrong
OCPExtend behavior without modifying source"Never modify existing code" — too extreme
LSPSubtypes must be substitutable for base types"Just use interfaces" — misses the point
ISPNo client should depend on methods it doesn't use"One method per interface" — overkill
DIPHigh-level modules shouldn't depend on low-level details"Inject everything" — over-engineering

Key insight: SOLID principles are guidelines for managing complexity at scale. They have diminishing returns in small codebases, scripts, and prototypes. A reviewer citing SOLID on a 50-line file is likely over-engineering.

Common Mistakes

MistakeFix
Accepting all comments without researchEvery claim needs evidence
Rejecting comments because "it works"Working code can still have issues
Skipping web researchAuthoritative sources prevent opinion-based verdicts
Implementing before report is completeFinish ALL verdicts first
Not reading full files (only diff hunks)Context changes everything
Treating all SOLID citations as validCheck if the principle actually applies
Ignoring codebase conventionsConsistency often trumps theoretical correctness
Not checking false positive patternsReviewers have systematic biases too

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.