Detects existing PR review threads to prevent duplicate comments. Use BEFORE posting any inline comments. Fetches resolved and open threads, then matches against planned findings.
This skill inherits all available tools. When active, it can use any tool Claude has access to.
Prevent duplicate comments by detecting existing review threads before posting new findings.
Bash(gh pr view:*) - Get general PR commentsBash(gh api graphql*reviewThreads*-f owner=*-f repo=*-F pr=*:*) - Get resolved threadsBash(./scripts/get-review-threads.sh:*) - Script wrapperUse this priority order:
GitHub Actions environment:
GITHUB_EVENT_PATH environment variable.pull_request.numberGITHUB_REPOSITORY ("owner/repo" format)Conversation context:
https://github.com/org/repo/pull/456Local review mode:
Capture BOTH comment sources:
# General PR comments
gh pr view <PR_NUMBER> --json comments
# Inline resolved review threads (REQUIRED - gh pr view misses these)
./scripts/get-review-threads.sh <PR_NUMBER> <OWNER> <REPO>
Build this JSON structure from merged results:
{
"total_threads": 5,
"threads": [
{
"location": "src/auth.ts:45",
"severity": "CRITICAL",
"issue_summary": "SQL injection risk in query builder",
"resolved": false,
"author": "claude",
"path": "src/auth.ts",
"line": 45
}
]
}
Severity detection from emoji prefix:
CRITICALIMPORTANTDEBTSUGGESTEDQUESTIONBefore creating any new comment, check for matches:
| Match Type | Criteria | Action |
|---|---|---|
| Exact | Same file + same line | Use existing thread |
| Nearby | Same file + line within ±5 | Use existing thread |
| Content | Body similarity >70% | Use existing thread |
| No match | None of above | Create new comment |