detecting-existing-threads

Detect existing GitHub PR review threads before posting inline comments.

129|15|Updated Oct 21, 2025
One-click install
npx skills add https://github.com/bitwarden/ai-plugins --skill detecting-existing-threads
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: detecting-existing-threads
Source: https://github.com/bitwarden/ai-plugins/tree/main/plugins/bitwarden-code-review/skills/detecting-existing-threads
Command: npx skills add https://github.com/bitwarden/ai-plugins --skill detecting-existing-threads

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Prevents duplicate comments by detecting existing review threads before posting.

Core Features & Use Cases

  • PR context resolution: Determines PR number from environment, URL, or local input.
  • Thread data retrieval: Fetches general PR comments and inline resolved threads via a script wrapper.
  • Thread matching: Compares new findings to existing threads and reuses or updates as appropriate.
  • Handling matches: Associates unresolved issues with existing threads or creates new ones when needed.

Quick Start

Run this skill before posting any inline findings. It will fetch and parse existing threads and provide a structured view of potential matches for the new findings. It requires gh CLI and the scripts/get-review-threads.sh script.

Frequently Asked Questions about detecting-existing-threads

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent duplicate comments on GitHub pull requests?

Duplicate comments on pull requests occur when reviewers post inline findings without checking existing threads. Detecting existing threads before posting allows you to reuse matching discussions or update them instead of creating redundant comments, keeping PR feedback organized and reducing notification noise.

How do I detect existing review threads in a GitHub PR?

Detecting review threads involves fetching open and resolved inline comments from a PR, parsing them into a structured format, and comparing new findings against existing threads by location, content, and severity. This skill retrieves threads via gh CLI and a wrapper script, then applies exact, nearby, and content-based matching rules.

Can I automate duplicate comment detection in my GitHub workflow?

Yes. Automate detection by running this skill before posting inline findings. It fetches and parses existing PR threads, identifies matches based on line location and content similarity, and provides structured output showing which findings match existing threads and which require new comments.

What do I need to use GitHub PR thread detection?

You need the GitHub CLI (gh) installed and authenticated, access to the target pull request, and the get-review-threads.sh script to retrieve thread data. The skill resolves the PR number from environment variables, GitHub URLs, or local input, then queries existing comments and resolved threads.

How does thread matching work for inline PR comments?

Thread matching compares new findings against existing threads using exact location matching (same line), nearby matching (adjacent lines), and content-based matching (similar findings). Each match is mapped to severity levels and post-action rules, determining whether to reuse, update, or create new threads.

What types of PR threads can this skill detect?

This skill detects both open (unresolved) and resolved inline review threads from PR comments. It fetches general PR-level comments and line-specific inline comments, unifying them into a single JSON structure for comparison against planned findings before posting new reviews.