Loading...
Loading...
Handles PR review comments and feedback resolution. Use when user wants to resolve PR comments, handle review feedback, fix review comments, address PR review, check review status, respond to reviewer, or verify PR readiness. Fetches comments via GitHub CLI, classifies by severity, applies fixes with user confirmation, commits with proper format, replies to threads.
npx skill4agent add fvadicamo/dev-agent-skills github-pr-review# 1. Check project-specific instructions
cat .claude/CLAUDE.md 2>/dev/null | head -50 # Review project conventions
# 2. Get PR and repo info
PR=$(gh pr view --json number -q '.number')
REPO=$(gh repo view --json nameWithOwner -q '.nameWithOwner')
# 3. Fetch and list comments by severity
gh api repos/$REPO/pulls/$PR/comments | python3 -c "
import json, sys
comments = [c for c in json.load(sys.stdin) if not c.get('in_reply_to_id')]
def sev(b): return 'CRITICAL' if 'critical' in b.lower() else 'HIGH' if 'high' in b.lower() else 'MEDIUM' if 'medium' in b.lower() else 'LOW'
for s in ['CRITICAL','HIGH','MEDIUM','LOW']:
cs = [c for c in comments if sev(c['body'])==s]
if cs: print(f'{s} ({len(cs)}): ' + ', '.join(f\"#{c['id]}\" for c in cs))
"
# 4. For each comment: read -> analyze -> fix -> verify -> commit -> reply
# 5. Run tests: make test (or project-specific command)
# 6. Push when all fixes verified.claude/CLAUDE.md.kiro/steering/git log --oneline -5make testpytestnpm testgit statusPR=$(gh pr view --json number -q '.number')
REPO=$(gh repo view --json nameWithOwner -q '.nameWithOwner')
gh api repos/$REPO/pulls/$PR/comments > /tmp/pr_comments.json| Severity | Indicators | Action |
|---|---|---|
| CRITICAL | | Must fix |
| HIGH | | Should fix |
| MEDIUM | | Recommended |
| LOW | | Optional |
Comment #123456789 (HIGH) - app/auth.py:45
"The validation logic should use constant-time comparison..."git add <files>
git commit -m "fix(scope): address review comment #ID
Brief explanation of what was wrong and how it's fixed.
Addresses review comment #123456789."type(scope): subjectfixrefactorsecurityteststyleperfCOMMIT=$(git rev-parse --short HEAD)
gh api repos/$REPO/pulls/$PR/comments \
--input - <<< '{"body": "Fixed in '"$COMMIT"'. Replaced set lookup with hmac.compare_digest.", "in_reply_to": 123456789}'| Situation | Template |
|---|---|
| Fixed | |
| Won't fix | |
| By design | |
| Deferred | |
| Acknowledged | |
make test # or project-specific commandgit push# Approve the PR (use after all comments resolved)
gh pr review $PR --approve --body "All review comments addressed. Ready to merge."
# Or request changes if issues remain
gh pr review $PR --request-changes --body "Addressed X comments, Y issues remain."
# Or just comment without approval decision
gh pr review $PR --comment --body "Partial progress: fixed A and B, working on C."--approve--request-changes--comment| Change Type | Strategy |
|---|---|
| Functional (CRITICAL/HIGH) | Separate commit per fix |
| Cosmetic (MEDIUM/LOW) | Single batch commit |
style:make testmake lintgh pr checksgithub-pr-merge--input -in_reply_to# Correct syntax
gh api repos/$REPO/pulls/$PR/comments \
--input - <<< '{"body": "Fixed in abc123. Brief explanation.", "in_reply_to": 123456789}'-f in_reply_to=...[skip ci][skip review]critical.svghigh-priority.svgmedium-priority.svglow-priority.svg<!-- **High Severity** --><!-- **Medium Severity** -->gh pr reviewstyle: