Get the FREE Ultimate OpenClaw Setup Guide →

reply-comments

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

Reply to Review Comments

Reply to PR review comments after addressing the feedback. Use this after /review-comments to close the feedback loop.

Usage

/reply-comments
/reply-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,headRepositoryOwner,headRepository \
  --jq '{number, url, title, owner: .headRepositoryOwner.login, repo: .headRepository.name}'

2. Fetch Review Comments

Get all review comments with their thread/resolution status:

# Get inline code review comments
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments \
  --jq '.[] | {id, path, line, body, user: .user.login, in_reply_to_id, created_at}'

3. Get Recent Commits

Check what was recently committed to understand which comments were addressed:

# Get recent commit messages and changed files
git log --oneline -10
git diff HEAD~1 --name-only

4. Identify Addressed Comments

For each review comment, determine if it was addressed by:

  • Checking if the file/line was modified in recent commits
  • Matching commit messages to comment content (e.g., "address review feedback")
  • Looking for code changes that match suggested fixes

5. Compose Replies

Use different tones based on the reviewer:

AI Bots (amazon-q-developer[bot], copilot[bot], github-actions[bot], etc.):

  • Terse, factual responses
  • Just state what was done
  • Examples:
    • "Fixed."
    • "Done."
    • "Changed to use const."
    • "Added null check."
    • "Not applicable - already handled by X."

Human Reviewers (anyone without [bot] suffix):

  • Short but polite responses
  • Acknowledge their feedback
  • Examples:
    • "Good catch, fixed!"
    • "Thanks - updated."
    • "Done, good suggestion."
    • "Makes sense, changed it."
    • "Addressed in latest commit."

For comments NOT addressed (intentionally skipped):

  • "Keeping as-is because {brief reason}."
  • "Intentional - {brief explanation}."

6. Post Replies

Reply to each comment:

gh api repos/{owner}/{repo}/pulls/{pr_number}/comments/{comment_id}/replies \
  -f body="{reply_text}"

7. Resolve Threads (if addressed)

Use GraphQL to resolve review threads where changes were made:

# First, get the thread ID for the comment
gh api graphql -f query='
  query($owner: String!, $repo: String!, $pr: Int!) {
    repository(owner: $owner, name: $repo) {
      pullRequest(number: $pr) {
        reviewThreads(first: 100) {
          nodes {
            id
            isResolved
            comments(first: 1) {
              nodes {
                databaseId
                body
              }
            }
          }
        }
      }
    }
  }
' -f owner="{owner}" -f repo="{repo}" -F pr={pr_number}

# Then resolve each thread that was addressed
gh api graphql -f query='
  mutation($threadId: ID!) {
    resolveReviewThread(input: {threadId: $threadId}) {
      thread {
        isResolved
      }
    }
  }
' -f threadId="{thread_id}"

8. Summary

Report what was done:

Replied to 6 comments:
- amazon-q-developer[bot]: 3 (all resolved)
- @username: 2 (2 resolved, 1 kept as-is)
- copilot[bot]: 1 (resolved)

Source

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

Overview

Automates replying to PR review comments after addressing feedback. It closes conversations when changes have been made, using a polite tone for humans and a terse tone for AI bots to keep reviews clean and actionable.

How This Skill Works

The skill identifies the target PR, fetches review comments and their status, and checks recent commits to confirm which feedback was addressed. It then composes tailored replies based on the reviewer type (polite for humans, concise for bots) and posts them, optionally resolving threads for addressed conversations.

When to Use It

  • After making changes that address feedback on a PR
  • When replying to multiple inline comments left by reviewers
  • In automated workflows where bot reviewers require terse replies
  • To standardize tone across human and bot reviewers
  • When you need to document which comments were kept as-is and why

Quick Start

  1. Step 1: Identify the PR and fetch all review comments
  2. Step 2: Determine which comments were addressed by recent commits
  3. Step 3: Post tailored replies for each comment and resolve addressed threads

Best Practices

  • Confirm addressed comments by inspecting recent commits and diffs
  • Use polite, concise language for humans and terse statements for bots
  • Keep replies short, actionable, and specific to the comment
  • Post replies to each comment and resolve threads for addressed feedback
  • Summarize what was done in a final status or summary

Example Use Cases

  • amazon-q-developer[bot]: Fixed.
  • copilot[bot]: Changed to use `const`.
  • @jane: Thanks - updated. Addressed in latest commit.
  • github-actions[bot]: Not applicable - already handled by X.
  • alice: Good catch, updated the logic in the latest commit.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers