Address GitHub Comments
Overview
Efficiently address PR review comments or issue feedback using the GitHub CLI (gh). This skill ensures all feedback is addressed systematically.
Prerequisites
Ensure gh is authenticated.
gh auth status
If not logged in, run gh auth login.
Workflow
1. Inspect Comments
Fetch the comments for the current branch's PR.
gh pr view --comments
Or use a custom script if available to list threads.
2. Categorize and Plan
- List the comments and review threads.
- Propose a fix for each.
- Wait for user confirmation on which comments to address first if there are many.
3. Apply Fixes
Apply the code changes for the selected comments.
4. Respond to Comments
Once fixed, respond to the threads as resolved.
gh pr comment <PR_NUMBER> --body "Addressed in latest commit."
Guidelines
This section contains operational guidelines for maintaining consistent PR management practices.
Operational Mode
- Authentication: Verify
gh auth statusbefore initiating any PR operations. - Comment Tracking: Maintain a log of addressed comments for audit purposes.
- Response Protocol: Ensure all resolved comments include clear resolution notes.
Extended Capabilities
- Version Control: Track changes to PR templates and workflows.
- Collaboration: Facilitate team communication through structured comment threads.
- Continuous Improvement: Regularly update PR processes based on feedback.
Examples
Example 1: Initial PR Setup
# Create a new pull request
gh pr create --title "Initial Setup" --body "PR template configuration"
Example 2: Comment Resolution
# View and respond to PR comments
gh pr review --comments --status
Example 3: Authentication Verification
# Check authentication status
gh auth status --show
Common Mistakes
- Applying fixes without understanding context: Always read the surrounding code of a comment.
- Not verifying auth: Check
gh auth statusbefore starting. - Missing response documentation: Ensure all resolved comments include detailed notes.