Agent skill
pr-threads-address
Review all unresolved PR review threads, address them by making necessary code changes, and commit the changes appropriately.
Install this agent skill to your Project
npx add-skill https://github.com/posit-dev/skills/tree/main/github/pr-threads-address
Metadata
Additional technical details for this skill
- author
- Barret Schloerke (@schloerke)
- version
- 1.0
SKILL.md
/pr-threads-address
Usage: /pr-threads-address [PR_NUMBER]
Description: Review all unresolved PR review threads, address them by making necessary code changes, and commit the changes appropriately.
Note: If PR_NUMBER is omitted, the command will automatically detect and use the PR associated with the current branch.
Workflow
- Fetch and display all unresolved PR review threads
- Analyze each thread to understand the requested changes
- For each thread:
- Make the necessary code modifications
- (When possible) Add unit tests to verify the change
- Commit the changes with descriptive commit messages using conventional commit specification
- Report back with a summary of addressed threads
- Ask if the user wants to resolve the threads. If so, reply to each thread indicating what was done and then resolve the thread.
When to use
Use this command when you have received PR review feedback and need to systematically address all unresolved threads before the PR can be merged.
Example
/pr-threads-address 42
This will:
- View unresolved threads on PR #42
- Make code changes to address each thread
- Create commits for the changes
- Reply to reviewers with explanations
- Provide a summary of all addressed items
- Ask if you want to resolve the threads
Prerequisites
Before using this command, check if the gh pr-review extension is installed:
gh extension list | grep -q pr-review || gh extension install agynio/gh-pr-review
CLI Reference
View PR Reviews and Comments
Display all reviews, inline comments, and replies for a pull request:
gh pr-review review view --pr <number> --repo <owner/repo>
Common filters:
--reviewer <login>— Filter by specific reviewer--states <list>— Filter by review state (APPROVED, CHANGES_REQUESTED, COMMENTED, DISMISSED)--unresolved— Show only unresolved threads--not_outdated— Exclude outdated threads--tail <n>— Show only the last n replies per thread--include-comment-node-id— Include GraphQL node IDs for replies
Examples:
# View all unresolved comments
gh pr-review review view --pr 42 --unresolved --repo owner/repo
# View comments from a specific reviewer
gh pr-review review view --pr 42 --reviewer username --repo owner/repo
# View only change requests, excluding outdated threads
gh pr-review review view --pr 42 --states CHANGES_REQUESTED --not_outdated --repo owner/repo
Reply to Review Threads
Respond to specific review comment threads:
gh pr-review comments reply --thread-id <PRRT_...> --body "<reply-text>" --repo <owner/repo> --pr <number>
Multi-line replies use heredoc syntax:
gh pr-review comments reply --thread-id PRRT_xyz789 --body "$(cat <<'EOF'
Fixed in commit abc123.
The changes include:
- Updated function signature
- Added error handling
- Updated tests
EOF
)" --repo owner/repo --pr 42
Resolve a Thread
gh pr-review threads resolve --thread-id <PRRT_...> --pr <number> --repo <owner/repo>
Start a Pending Review
Create a new pending review to add comments before submission:
gh pr-review review --start --pr <number> --repo <owner/repo>
This returns a review ID (format: PRR_...) needed for adding comments.
Add Review Comments
Add inline comments to a pending review:
gh pr-review review --add-comment --review-id <PRR_...> --path <file-path> --line <number> --body "<comment-text>" --repo <owner/repo>
Flags:
--review-id— Review ID from--startcommand (required)--path— File path in the repository (required)--line— Line number for the comment (required)--body— Comment text (required)
Submit a Review
Finalize and submit a pending review:
gh pr-review review --submit --review-id <PRR_...> --event <EVENT_TYPE> --body "<summary>" --repo <owner/repo>
Event types:
APPROVE— Approve the changesREQUEST_CHANGES— Request changes before mergingCOMMENT— Submit general feedback without explicit approval
Usage Notes
-
Repository Context: Always include
--repo owner/repoto ensure correct repository context, or run commands from within a local clone of the repository. -
Thread IDs: Thread IDs (format
PRRT_...) can be obtained fromreview view --include-comment-node-idorthreads listcommands. -
Review IDs: Review IDs (format
PRR_...) are returned by thereview --startcommand and must be used for adding comments to that review. -
State Filters: When using
--states, provide a comma-separated list:--states APPROVED,CHANGES_REQUESTED -
Unresolved Focus: Use
--unresolved --not_outdatedtogether to focus on actionable comments that need attention.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
create-release-checklist
Create a release checklist and GitHub issue for an R package. Use when the user asks to "create a release checklist" or "start a release" for an R package.
release-post
Create professional package release blog posts following Tidyverse or Shiny blog conventions. Use when the user needs to: (1) Write a release announcement blog post for an R or Python package for tidyverse.org or shiny.posit.co, (2) Transform NEWS/changelog content into blog format, (3) Generate acknowledgments sections with contributor lists, (4) Format posts following specific blog platform requirements. Supports both Tidyverse (hugodown) and Shiny (Quarto) blog formats with automated contributor fetching and comprehensive style guidance.
shiny-bslib-theming
Advanced theming for Shiny apps using bslib and Bootstrap 5. Use when customizing app appearance with bs_theme(), Bootswatch themes, custom colors, typography, brand.yml integration, Bootstrap Sass variables, custom Sass/CSS rules, dark mode and color modes, dynamic theme switching, real-time theming, theme inspection, or making R plots match the app theme with thematic.
shiny-bslib
Build modern Shiny dashboards and applications using bslib (Bootstrap 5). Use when creating new Shiny apps, modernizing legacy apps (fluidPage, fluidRow/column, tabsetPanel, wellPanel, shinythemes), or working with bslib page layouts, grid systems, cards, value boxes, navigation, sidebars, filling layouts, theming, accordions, tooltips, popovers, toasts, or bslib inputs. Assumes familiarity with basic Shiny.
quarto-alt-text
Generate accessible alt text for data visualizations in Quarto documents. Use when the user wants to add, improve, or review alt text for figures in .qmd files. Triggers for requests about accessibility, figure descriptions, fig-alt, screen reader support, or making Quarto documents more accessible.
quarto-authoring
Writing and authoring Quarto documents (.qmd), including code cell options, figure and table captions, cross-references, callout blocks (notes, warnings, tips), citations and bibliography, page layout and columns, Mermaid diagrams, YAML metadata configuration, and Quarto extensions. Also covers converting and migrating R Markdown (.Rmd), bookdown, blogdown, xaringan, and distill projects to Quarto, and creating Quarto websites, books, presentations, and reports.
Didn't find tool you were looking for?