mcpbeat Sign in

Review Pr Comments Agent Skill

Review and triage PR review comments on the current branch — groups threads by file, separates bots from humans, walks through unresolved comments interactively

1k tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
3695
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/DataDog/datadog-agent --skill review-pr-comments

What it tells the agent to use

found in the instruction text
Write writes files

The instruction itself

11 sections, as written by the author

Review PR Comments

Fetch, summarize, and interactively triage review comments on the PR for the current git branch.

Prerequisites

  • gh CLI authenticated with access to the repository
  • Current branch must have an open PR (not main or a release branch like N.N.x)

Workflow

Step 1: Identify the PR

BRANCH=$(git branch --show-current)

Guard: skip if branch is main, master, or matches release pattern ^\d+\.\d+\.x$.

Find the PR:

gh pr list --head "$BRANCH" --json number,title,url,state --limit 5

If no PR found, inform the user and stop.

Step 2: Fetch all review data

Run these three gh api calls in parallel:

# Review comments (inline code comments)
gh api repos/{owner}/{repo}/pulls/{PR_NUMBER}/comments --paginate \
  --jq '.[] | {id, path, line, body, user: .user.login, created_at, in_reply_to_id, diff_hunk}'

# Top-level reviews (approval/request-changes status + body)
gh api repos/{owner}/{repo}/pulls/{PR_NUMBER}/reviews --paginate \
  --jq '.[] | {id, user: .user.login, state, body}'

# Issue-level comments (general PR discussion, CI bot reports)
gh api repos/{owner}/{repo}/issues/{PR_NUMBER}/comments --paginate \
  --jq '.[] | {id, user: .user.login, body, created_at}'

Extract {owner} and {repo} from gh repo view --json owner,name.

Step 3: Organize into threads

Group review comments into conversation threads using in_reply_to_id:

  • A comment with in_reply_to_id: null starts a new thread
  • Replies link to their parent thread

For each thread, track:

  • File & line from the root comment
  • Author of the root comment
  • All replies in chronological order
  • Resolution status: resolved if the PR author replied last

Step 4: Classify comments

Separate into two groups:

Bot comments (user login ends with [bot] or is a known CI bot):

  • Summarize briefly (e.g., "CI quality gates passed", "Regression detector: no regressions")
  • Only highlight actionable items (failures, warnings)

Human reviewer comments:

  • These get full treatment in Step 5

Step 5: Present and triage each human comment

For each unresolved human reviewer comment thread:

  • Show context: file, line, diff hunk, the comment body
  • Read the current file at the referenced location to understand current state
  • Summarize the reviewer's concern in one sentence
  • Propose a concrete action: code fix, reply text, or explanation
  • Ask the user what to do using AskQuestion:
Options:
- "Fix" → Apply the proposed code change
- "Reply" → Post a reply comment on the PR via gh api
- "Reply with custom message" → Ask user for reply text, then post
- "Add TODO" → Add a TODO item to track for later
- "Skip" → Move to next comment

For already-resolved threads (PR author replied last), present them as a summary group:

  • Show the comment + your reply, note it's resolved
  • Ask if user wants to revisit any

Step 6: Execute chosen actions

Fix: Edit the file, show the diff to the user. Do NOT commit automatically.

Reply: Post via gh API:

gh api repos/{owner}/{repo}/pulls/{PR_NUMBER}/comments \
  -f body="$REPLY_TEXT" -f in_reply_to=$COMMENT_ID

TODO: Use the TodoWrite tool to track it.

Step 7: Summary

After processing all comments, output a summary table:

| # | File | Reviewer | Action Taken |
|---|------|----------|--------------|
| 1 | path/to/file.go:42 | reviewer1 | Fixed |
| 2 | path/to/other.py:10 | reviewer2 | Replied |
| 3 | path/to/build.bzl:5 | reviewer3 | Skipped (already resolved) |

Edge Cases

  • No unresolved comments: Report "All review comments are resolved" with approval status summary
  • PR not found: Suggest the user push the branch or create a PR first
  • Outdated diff hunks: Note that the comment may reference old code; read the current file to verify
  • Multiple PRs for branch: Use the most recent open one

Other skills for the same job

different authors, same section of the catalogue
Receiving Code Review
by ZhanlinCui
×7

Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation

2k tokens
Requesting Code Review
by ZhanlinCui
×6

Use when completing tasks, implementing major features, or before merging to verify work meets requirements

2k tokens
Git Commit
by github
vendor ×3

Execute git commit with conventional commit message analysis, intelligent staging, and message generation. Use when user asks to commit changes, create a git commit, or mentions "/commit". Supports: (1) Auto-detecting type and scope from changes, (2) Generating conventional commit messages from diff, (3) Interactive commit with optional type/scope/description overrides, (4) Intelligent file staging for logical grouping

799 tokens
Github Code Review
by ComeOnOliver
×3

Comprehensive GitHub code review with AI-powered swarm coordination

13k tokens
Karpathy Guidelines
by hyyhf
×3

Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid overcomplication, make surgical changes, surface assumptions, and define verifiable success criteria.

629 tokens
Code Reviewer
by google-gemini
vendor ×2

Use this skill to review code. It supports both local changes (staged or working tree) and remote Pull Requests (by ID or URL). It focuses on correctness, maintainability, and adherence to project standards.

795 tokens
Agent MD Refactor
by softaworks
×2

Refactor bloated AGENTS.md, CLAUDE.md, or similar agent instruction files to follow progressive disclosure principles. Splits monolithic files into organized, linked documentation.

4k tokens
Commit Work
by softaworks
×2

Create high-quality git commits: review/stage intended changes, split into logical commits, and write clear commit messages (including Conventional Commits). Use when the user asks to commit, craft a commit message, stage changes, or split work into multiple commits.

2k tokens

How to use it

Copy the folder

Take datadog/review-pr-comments from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.