prbuddy
Overview
prbuddy helps agents monitor PR health by checking CI status and triaging review comments. It fixes immediate issues and implements systematic prevention measures.
Philosophy: "Fix the acute issue AND prevent the class of error from recurring."
Sub-skills:
prbuddy:ci- CI/workflow monitoring, failure diagnosis, fix + preventprbuddy:reviews- Review comment triage, fix critical, create issues for nitpicks
Prerequisites
Required: gh CLI
Verify gh is installed and authenticated:
gh auth status
If not authenticated, run gh auth login.
Required token scopes:
repo- Full control of private repositories (for PR operations)read:org- Read org membership (for issue creation in org repos)workflow- Update GitHub Action workflows (for CI operations)
To check scopes: gh auth status shows granted scopes.
Required: gh-pr-review Extension
This extension is required for review comment handling:
gh extension install agynio/gh-pr-review
Verify installation:
gh pr-review --help
When This Skill Applies
- "check my PR" / "PR status"
- "make this PR green"
- "fix my PR"
- "ready to merge"
- "handle PR feedback"
- "what's blocking my PR"
Workflow
Step 1: Detect PR
gh pr view --json number,title,body,url,headRefName,closingIssuesReferences
If no PR found for current branch, ask user:
- Create a PR:
gh pr create - Specify PR number:
/prbuddy 123 - Specify PR URL
Step 2: Check CI Status
gh pr checks --json name,state,bucket,link
If any checks failed: Route to prbuddy:ci
If checks pending: Report status and suggest checkpoint timing:
- "CI is still running. Check again before requesting review or declaring done."
If all checks passed: Continue to reviews
Step 3: Check Review Comments
Route to prbuddy:reviews
Step 4: Report Summary
PR #42 Health Check Complete
CI: ✓ All checks passing
Reviews:
- 2 critical comments fixed (with prevention)
- 3 issues created from nitpicks
Ready for: [next action - request review / merge / etc.]
Routing Logic
Keywords → Sub-Skill
prbuddy:ci:
- "CI failing", "workflow failed", "checks red"
- "build broken", "tests failing"
- "check CI status", "rerun workflows"
prbuddy:reviews:
- "review comments", "address feedback"
- "reviewer asked", "changes requested"
- "handle comments", "triage reviews"
prbuddy (full orchestrator):
- "check my PR", "PR health", "make PR green"
- "fix PR", "ready to merge"
- Ambiguous requests
Routing Process
- Analyze request for keywords
- If clearly CI-related →
prbuddy:ci - If clearly reviews-related →
prbuddy:reviews - Otherwise → Run full orchestrator (CI then reviews)
Error Handling
No PR Found
No PR found for current branch 'feature-xyz'.
Options:
1. Create a PR: gh pr create
2. Specify PR number: /prbuddy 123
3. Specify PR URL: /prbuddy https://github.com/owner/repo/pull/123
gh-pr-review Extension Missing
The gh-pr-review extension is required for review comment handling.
Install it:
gh extension install agynio/gh-pr-review
Then retry: /prbuddy:reviews
gh Not Authenticated
GitHub CLI is not authenticated.
Run: gh auth login
Then retry: /prbuddy
Fork-Based PRs
This skill assumes write access to the PR branch. For fork-based PRs:
- You may not have push access to the source branch
- Protected branch rules may prevent direct pushes
- Consider creating a fix branch and opening a separate PR
Workaround: Ask the user to push changes manually or grant write access.
Dry-Run Mode
To preview changes without committing, tell the agent:
- "Show me what you would fix, but don't commit"
- "Dry-run mode" or "preview only"
The agent will analyze and report proposed fixes without making changes.
