Get the FREE Ultimate OpenClaw Setup Guide →

review-comments

npx machina-cli add skill flurdy/agent-skills/review-comments --openclaw
Files (1)
SKILL.md
2.0 KB

Address Review Comments

Fetch and address review comments on the current PR.

Usage

/review-comments
/review-comments 123    # Specific PR number

Instructions

1. Find the PR

If no PR number provided, get it from the current branch:

gh pr view --json number,url,title --jq '{number, url, title}'

2. Fetch Review Comments

Get all review comments on the PR:

# Get PR reviews and comments
gh pr view {pr_number} --json reviews,comments

# Get inline code review comments
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments

3. Categorize Comments

Group comments by:

  • Reviewer: amazon-q-developer[bot], copilot[bot], human reviewers
  • Status: Pending, Resolved, Outdated
  • Type: Code suggestion, question, blocking issue

4. Present Summary

Show a summary of comments:

PR #123: feat(offers-cms): add caching

Reviews:
- amazon-q-developer: 3 comments (2 suggestions, 1 security concern)
- copilot: 1 comment (style suggestion)
- @username: 2 comments (1 question, 1 blocking)

Unresolved comments: 6

5. Address Comments

For each unresolved comment:

  1. Read the comment and understand what's being asked
  2. Check the file and line being referenced
  3. Either:
    • Make the suggested change if appropriate, including an initially failing test if needed
    • Explain why the current code is correct
    • Ask the user for guidance on ambiguous feedback

6. After Making Changes

# Stage and commit fixes
git add {files_changed}
git commit -m "address review feedback"

# Push updates
git push

7. Respond to Comments (Optional)

If the user wants to reply to comments:

gh api repos/{owner}/{repo}/pulls/{pr_number}/comments/{comment_id}/replies \
  -f body="Done - fixed in latest commit"

Source

git clone https://github.com/flurdy/agent-skills/blob/main/skills/review-comments/SKILL.mdView on GitHub

Overview

This skill fetches review comments on the current pull request and presents a categorized summary. It helps you act on feedback by grouping by reviewer, status, and type, then guiding you through fixes, tests, and replies.

How This Skill Works

Locates the target PR either from the current branch or a provided number using gh pr view. Retrieves all reviews and inline comments with gh pr view and gh api, then categorizes them by reviewer, status, and type. Presents a concise summary and steps to address each unresolved item, commit fixes, and push updates.

When to Use It

  • When you want a consolidated view of all feedback on the current PR.
  • When you need to prioritize unresolved comments (blockers first).
  • When deciding whether to implement a suggestion or explain why it's unnecessary.
  • Before pushing fixes, to ensure all feedback is addressed.
  • To provide a clear path for replying to reviewers and closing the feedback loop.

Quick Start

  1. Step 1: Determine the PR using gh pr view --json number,url,title on the current branch.
  2. Step 2: Fetch comments with gh pr view {pr_number} --json reviews,comments and gh api repos/{owner}/{repo}/pulls/{pr_number}/comments.
  3. Step 3: For each unresolved comment, address the feedback, commit changes, push, and optionally reply to comments.

Best Practices

  • Fetch both PR reviews and inline comments to capture all feedback.
  • Group comments by Reviewer, Status, and Type for quick triage.
  • Start with blocking or high-risk issues before smaller suggestions.
  • Include a failing test or explicit justification if you skip a change.
  • Use clear, descriptive commit messages like 'address review feedback' and reply to comments when needed.

Example Use Cases

  • PR #123: feat offers-cms: summarize reviews from amazon-q-developer and copilot.
  • Address a blocking issue flagged by a human reviewer and push fixes.
  • Apply a code-style suggestion from copilot and explain the rationale if not applied.
  • Add a regression test to cover a feedback-driven change.
  • Push updates and optionally post replies to reviewer comments.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers