A

Address PR Review Comments Command

Fetches all pending review comments from a GitHub pull request and systematically addresses each one. Creates a structured todo list from reviewer feedback, implements fixes, and marks comments as resolved. Streamlines the PR review cycle.

CommandCommunitycode reviewv1.0.0MIT
0 views0 copies

Command

/address-pr-comments

Description

Fetches all pending review comments from the current branch's pull request using the GitHub CLI, then systematically addresses each comment. The command creates a prioritized task list from reviewer feedback, implements the necessary changes, and provides a summary of what was fixed.

Behavior

Arguments

  • $ARGUMENTS -- Optional PR number (e.g., 123). If omitted, uses the PR for the current branch.

Steps

  1. Identify the PR:

    # If PR number provided gh pr view $PR_NUMBER --json number,title,url # If no PR number, find PR for current branch gh pr list --head $(git rev-parse --abbrev-ref HEAD) --json number,title,url
  2. Fetch all review comments:

    gh api repos/{owner}/{repo}/pulls/{number}/comments \ --jq '.[] | {id, path, line, body, user: .user.login, created_at}'
  3. Categorize and prioritize:

    • Must fix: Comments requesting changes ("please change", "this should be", "bug")
    • Consider: Suggestions and alternatives ("consider", "alternatively", "nit")
    • Questions: Clarification requests ("why", "what", "could you explain")
  4. Address each comment:

    • Read the referenced file and line
    • Understand the reviewer's concern
    • Implement the fix or improvement
    • Note what was changed and why
  5. Generate summary:

    • List each comment and what was done
    • Flag any comments that need human judgment
    • Suggest reply text for each comment

Output Format

## PR Review Comments Addressed ### Fixed (3) | Comment | File | Change Made | |---------|------|-------------| | "Add null check" by @reviewer | src/api.ts:42 | Added guard clause | | "Use const instead of let" by @reviewer | src/utils.ts:15 | Changed to const | | "Missing error handling" by @reviewer | src/db.ts:88 | Added try-catch | ### Needs Discussion (1) | Comment | File | Reason | |---------|------|--------| | "Consider using Redis" by @reviewer | src/cache.ts:12 | Architecture decision - needs team input | ### Suggested Replies - @reviewer on src/api.ts:42 -- "Done - added null check with early return" - @reviewer on src/cache.ts:12 -- "Good point. Created a follow-up issue #456 to evaluate Redis"

Examples

# Address comments on current branch's PR /address-pr-comments # Address comments on a specific PR /address-pr-comments 142 # Address only comments from a specific reviewer /address-pr-comments 142 --reviewer=seniordev
Community

Reviews

Write a review

No reviews yet. Be the first to review this template!

Similar Templates