Loading...
Loading...
Complete workflow for handling GitHub PR reviews using gh pr-review extension
npx skill4agent add uwe-schwarz/skills github-pr-review-workflowgh-pr-reviewgh extension install agynio/gh-pr-reviewgh pr-review --helpPR Review Request
├─ Get PR number/repo context
├─ List all review threads
├─ Analyze feedback and comments
├─ Validate whether each comment applies and explain decisions
├─ Implement fixes in code
├─ Run tests (unit + lint + typecheck)
├─ Reply to all open review threads with explanations
├─ Wait up to 5 minutes for follow-up
├─ Resolve review threads (or address follow-ups)
└─ Commit and push changes# Get PR number
gh pr view --json number
# Get PR title and status
gh pr view --json title,author,state,reviews
# Get repository info (for gh pr-review)
git remote get-url origin<PR_NUMBER><OWNER/REPO># From PR root directory
gh pr-review threads list --pr <PR_NUMBER> --repo <OWNER/REPO>
# Example:
gh pr-review threads list --pr <PR_NUMBER> --repo <OWNER/REPO>[
{
"threadId": "<THREAD_ID>",
"isResolved": false,
"updatedAt": "2026-01-17T22:48:36Z",
"path": "path/to/file.ts",
"line": 42,
"isOutdated": false
}
]threadIdisResolvedisOutdatedpathlinegh pr view <PR_NUMBER> --comments --json author,comments,reviews# Get all review comments for PR
gh api repos/<OWNER>/<REPO>/pulls/<PR_NUMBER>/comments
# With jq for cleaner output
gh api repos/<OWNER>/<REPO>/pulls/<PR_NUMBER>/comments \
--jq '.[] | {id,body,author,created_at,line,path}'# Read the file context to understand feedback
cat <path>
# or use Read tool# Use Edit tool or bash
edit <file_path> <oldString> <newString># Run project tests
bun run test
# Or specific test suites
bun run test:unit
bun run test:unit:watch
bun run test:e2ebun run typecheck
# or
tsc --noEmitbun run lint
# or
eslint# Check status
git status
# Stage modified files
git add <files>
# Commit with clear message
git commit -m "<type>(<scope>): <description>
# Example:
git commit -m "refactor(emails): centralize from name logic and improve sanitization
- Extract RESEND_FROM_NAME constant to lib/emails/from-address.ts
- Replace duplicated logic in lib/auth.ts and app/actions/contact.ts
- Improve formatFromAddress sanitization (RFC 5322 chars)
- Add test cases for additional sanitization patterns"git pushgit status
# Should show: "nothing to commit, working tree clean"gh pr-review comments reply \
--pr <PR_NUMBER> \
--repo <OWNER/REPO> \
--thread-id <THREAD_ID> \
--body "<your explanation>"gh pr-review comments reply \
--pr <PR_NUMBER> \
--repo <OWNER/REPO> \
--thread-id <THREAD_ID> \
--body "$(cat <<'EOF'
@reviewer Thanks for the feedback! I've addressed your suggestions:
1. Applied the requested refactor in the relevant module
2. Removed duplicated logic in the affected call sites
3. Improved sanitization to match the project’s expectations
4. Added/updated tests for the new behavior
Changes committed in abc1234, all tests pass.
EOF
)"@reviewer@gemini-code-assist ...@greptile …gh pr comment <PR_NUMBER> --body "$(cat <<'EOF'
@reviewer … <same as above>
EOF
)"# Wait for a minute for reviewer response
sleep 60
# Re-check for new replies or new threads
gh pr-review threads list --pr <PR_NUMBER> --repo <OWNER/REPO>gh pr-review threads resolve \
--pr <PR_NUMBER> \
--repo <OWNER/REPO> \
--thread-id <THREAD_ID>{
"thread_node_id": "PRRT_kwDOQkQlKs5p24lu",
"is_resolved": true
}# Resolve outdated threads first
gh pr-review threads resolve --pr <PR_NUMBER> --repo <OWNER/REPO> --thread-id <THREAD_ID_OUTDATED_1>
gh pr-review threads resolve --pr <PR_NUMBER> --repo <OWNER/REPO> --thread-id <THREAD_ID_OUTDATED_2>
# Then resolve active threads after replying
gh pr-review threads resolve --pr <PR_NUMBER> --repo <OWNER/REPO> --thread-id <THREAD_ID_ACTIVE>gh pr-review threads list --pr <PR_NUMBER> --repo <OWNER/REPO>isResolved: true# 1. Get PR context
gh pr view --json number
git remote get-url origin
# 2. List review threads
gh pr-review threads list --pr <PR_NUMBER> --repo <OWNER/REPO>
# 3. Read comments and files
gh api repos/<OWNER>/<REPO>/pulls/<PR_NUMBER>/comments --jq '.[] | {id,body,path,line}'
cat path/to/file.ts
# 4. Implement fixes
edit path/to/file.ts <oldString> <newString>
# 5. Run tests
bun run test:unit -- tests/path/to/file.test.ts
bun run typecheck
bun run lint
# 6. Commit and push
git add lib/emails/from-address.ts
git commit -m "fix: address PR review feedback"
git push
# 7. Reply to threads
gh pr-review comments reply --pr <PR_NUMBER> --repo <OWNER/REPO> \
--thread-id <THREAD_ID> --body "$(cat <<'EOF'
@reviewer Thanks for review! I've addressed all feedback:
1. Centralized logic
2. Improved sanitization
3. Added tests
Changes in abc1234.
EOF
)"
# 8. Wait then resolve threads
sleep 300
gh pr-review threads list --pr <PR_NUMBER> --repo <OWNER/REPO>
gh pr-review threads resolve --pr <PR_NUMBER> --repo <OWNER/REPO> \
--thread-id <THREAD_ID>
# 9. Verify
gh pr-review threads list --pr <PR_NUMBER> --repo <OWNER/REPO>
git status| Command | Purpose |
|---|---|
| List all review threads |
| Resolve a specific thread |
| Reopen a resolved thread |
| Reply to a review thread |
| Manage pending reviews |
--pr <number>-R, --repo <owner/repo>--thread-id <id>| Issue | Solution |
|---|---|
| Install extension: |
| Run from PR directory or add |
| Add |
Shell escaping issues with | Use heredoc: |
| Thread not found | Check threadId is exact GraphQL ID, not PR number |