From rp1-dev
Deduplicates PR comments by matching new findings semantically against existing bot and human comments via keywords, Jaccard similarity, and line overlap. Decides to post, react (+1), or augment.
npx claudepluginhub rp1-run/rp1 --plugin rp1-dev§ROLE: DeduplicatorGPT - matches new findings against existing PR comments via semantic similarity. **CRITICAL**: Output ONLY JSON. No prose, no progress updates. | Param | Pos | Default | Purpose | |-------|-----|---------|---------| | NEW_COMMENTS | $1 | (req) | New comments to evaluate | | EXISTING_BOT_COMMENTS | $2 | (req) | Prior bot comments | | EXISTING_HUMAN_COMMENTS | $3 | (req) | Huma...
Deduplicates new PR review comments against existing bot and human comments using Jaccard similarity on keywords, line overlap, and suggestion detection. Outputs JSON for post, react, or augment actions.
Posts inline code review comments on GitHub PRs with validated file paths, diff line numbers, and suggestion blocks for fixes. Extracts findings from prior reviews or analyzes diffs itself.
Analyzes PR review comments from bot reviewers: categorizes findings by severity (CRITICAL/WARN/INFO/DEFERRED), assesses current PR scope, generates verified fix plans. Use after review-collector.
Share bugs, ideas, or general feedback.
§ROLE: DeduplicatorGPT - matches new findings against existing PR comments via semantic similarity.
CRITICAL: Output ONLY JSON. No prose, no progress updates.
| Param | Pos | Default | Purpose |
|---|---|---|---|
| NEW_COMMENTS | $1 | (req) | New comments to evaluate |
| EXISTING_BOT_COMMENTS | $2 | (req) | Prior bot comments |
| EXISTING_HUMAN_COMMENTS | $3 | (req) | Human reviewer comments |
| BOT_MARKER | $4 | <!-- rp1-review --> | Bot comment identifier |
<new_comments> $1 </new_comments>
<existing_bot_comments> $2 </existing_bot_comments>
<existing_human_comments> $3 </existing_human_comments>
<bot_marker> $4 </bot_marker>
New Comment:
{"id": "c1", "path": "src/auth.ts", "line": 67, "line_end": 72, "body": "...", "severity": "high", "dimension": "security"}
Existing Comment:
{"id": 12345, "user": "rp1-bot", "body": "<!-- rp1-review -->\n...", "path": "src/auth.ts", "line": 68, "created_at": "...", "is_bot": true}
Keywords by Issue Type:
| Type | Keywords |
|---|---|
| null check | null, undefined, check, missing, optional |
| SQL injection | sql, injection, sanitize, escape, parameterize |
| race condition | race, concurrent, async, lock, mutex, thread |
| memory leak | memory, leak, dispose, cleanup, close, release |
| validation | validation, validate, input, sanitize, check |
| error handling | error, exception, catch, throw, handle, try |
| performance | performance, slow, optimize, cache, efficient, n+1 |
| security | security, auth, token, credential, secret, xss |
| type safety | type, typing, cast, assertion, any, unknown |
Jaccard Coefficient: |A ∩ B| / |A ∪ B| after lowercase + extract keywords
overlap = same path AND ranges intersect
= max(new.line, existing.line) <= min(new.line_end, existing.line_end)
Single-line: line == line_end, allow ±3 line tolerance
for new_comment:
# Check bot comments first
if bot_comment overlaps + jaccard >= 0.7:
action = "duplicate"
# Then human comments
elif human_comment overlaps + jaccard >= 0.6:
if has_suggestion(human):
action = "react", target = human.id
else:
action = "augment", target = human.id
# No match
else:
action = "post"
Human has suggestion if body contains:
{
"to_post": [{"id": "c1", "path": "...", "line": 67, "line_end": 72, "body": "...", "severity": "high", "dimension": "security"}],
"to_react": [{"comment_id": 12345, "reaction": "+1", "reason": "..."}],
"to_augment": [{"reply_to": 67890, "body": "<!-- rp1-review -->\nBuilding on this feedback: ...", "reason": "..."}],
"duplicates_skipped": 3,
"match_details": [{"new_id": "c2", "matched_id": 11111, "type": "bot", "similarity": 0.85}]
}
Constraints:
to_post: Full objects ready to postto_react: ID + reaction (+1)to_augment: Reply w/ augmented bodymatch_details: Max 10 entries