Help us improve
Share bugs, ideas, or general feedback.
From chrisbanes-skills
Polls open GitHub PRs or GitLab MRs, triages review comments, detects and fixes trivial CI failures, and keeps PRs moving without manual intervention.
npx claudepluginhub chrisbanes/skills --plugin chrisbanes-skillsHow this skill is triggered — by the user, by Claude, or both
Slash command
/chrisbanes-skills:shepherdThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Poll open PRs (GitHub) and MRs (GitLab) in a loop, triage events by type, act on what you can fix, and report what you can't. Never sit idle when a PR has unaddressed feedback or a failing CI check.
Drives existing GitHub/GitLab PRs/MRs to merge: monitors CI/CD status, fixes issues in PR scope via sub-skills, handles multi-round code reviews, resolves comments until all requirements met.
Automates PR monitoring from creation to merge — handles CI failures, review comments, and thread resolution autonomously.
Executes GitHub operations (PRs, issues, milestones, labels, comments, merges) using Python scripts with structured output and error handling. Use for pull requests, issues, review comments, CI checks, milestones instead of raw gh.
Share bugs, ideas, or general feedback.
Poll open PRs (GitHub) and MRs (GitLab) in a loop, triage events by type, act on what you can fix, and report what you can't. Never sit idle when a PR has unaddressed feedback or a failing CI check.
Use git remote get-url origin to determine the platform:
| Remote URL pattern | Platform | CLI tool | ID prefix |
|---|---|---|---|
github.com | GitHub | gh | # |
gitlab.* | GitLab | glab | ! |
Use the detected CLI tool (gh or glab) for all commands below. The skill uses PR generically for both pull requests and merge requests.
| Operation | GitHub (gh) | GitLab (glab) |
|---|---|---|
| List open PRs | gh pr list --state open --json number,title,headRepository,baseRefName,statusCheckRollup | glab mr list --source-branch $(git branch --show-current) --output json |
| View PR details | gh pr view <#> --comments --json comments | glab mr view <!> --comments |
| Check CI status | gh pr checks <#> | glab mr view <!> (check pipeline or head_pipeline fields) |
| View CI logs | gh run view <run-id> --log-failed | glab ci trace <job-id> |
| List CI pipelines | — | glab ci list --mr <!> |
| Add comment | gh pr comment <#> --body "..." | glab mr note <!> --message "..." |
| Merge | gh pr merge <#> --squash --delete-branch | glab mr merge <!> --squash |
| Approve | gh pr review <#> --approve | glab mr approve <!> |
Do NOT use when:
Detect platform: git remote get-url origin
While the user wants monitoring:
1. List open PRs (see command reference)
2. For each PR:
a. Check for new comments
b. Triage comments (see Comment Triage below)
c. Check CI (see CI Fix Workflow below)
d. If CI failing, follow CI Fix Workflow
e. If changes pushed and CI green, comment "ready for re-review" if requested
3. Wait an appropriate interval before polling again
Track which comments you've already seen to avoid re-processing. Compare against your last poll's comment set (timestamps/IDs).
| Comment type | Signal | Action |
|---|---|---|
| Approval / LGTM | "LGTM", "ship it", APPROVED review / GitLab approval | Check CI is green, then offer to merge or merge if instructed |
| Change request | "please change", "request changes", REQUEST_CHANGES | Read the specific feedback, implement changes, push, comment "addressed" |
| Nit / suggestion | "nit", "optional", "consider" | Apply if trivial (rename, formatting). Skip if debatable — ask user |
| Question | "why", "what about", "did you consider" | Answer the question. If unsure, relay to user |
| CI reminder | "tests failing", "CI is red", "pipeline failed" | Follow CI Fix Workflow below |
| Merge conflict | "needs rebase", "conflicts" | Rebase on base branch, push. If conflicts are complex, report to user |
Commenting rules:
[autofix] prefix so humans can spot automated pushes1. Check CI status (see command reference)
2. Identify failing check(s) or job(s)
3. If pipeline is still running, wait for completion
4. For each failure:
a. Get logs (see command reference)
b. Diagnose root cause:
- Lint failure? Run the linter locally, fix formatting, push
- Compilation error? Can you see the error clearly? Fix and push
- Test failure? Read the test output. Only fix if the fix is obvious
- Flaky test? Re-run once. If it fails again, report to user
c. If fix is straightforward (≤ 3 lines, obvious intent):
- Make the fix
- Push with message "ci: fix [what was fixed]"
- Re-check CI
d. If fix is not obvious:
- DO NOT guess
- Report to user with the failure log snippet and your assessment
5. If no failures remain, mark CI as resolved
GitLab pipelines are structured as stages → jobs. Use:
glab ci list --mr <!> # list pipeline jobs
glab ci trace <job-id> # view job logs
glab ci retry <job-id> # retry a failed job
GitLab CI may have manual stages (environments, deployments). Only act on automatic stages; skip manual ones unless instructed.
Only merge when:
| Platform | Merge command |
|---|---|
| GitHub | gh pr merge <#> --squash --delete-branch |
| GitLab | glab mr merge <!> --squash |
For GitLab, if "Delete source branch" is not a project default, add --remove-source-branch.
| Complex PRs (many files, large diff) | Simple PRs (small change, clear intent) |
|---|---|
| Look for split opportunities (can this be 2-3 smaller PRs?) | Merge quickly after approval + green CI |
| Pay extra attention to review feedback — harder to re-review | Fix CI failures aggressively |
| Log what you checked so user can scan | Default: merge yourself |
Stop polling and report to user when:
| Mistake | Fix |
|---|---|
| Polling once and stopping | The core of this skill is the LOOP. Keep going unless a stop condition fires. |
| Commenting "I checked, everything looks good" every cycle | Only comment when you took action or when asked for status. |
| Merging after approval without checking CI | Approval ≠ ready to merge. Always check CI first. |
| Fixing a test you don't understand | "Obvious fix" means you can explain WHY. If you can't, don't fix. |
| Re-pushing without addressing all feedback | Triage ALL unaddressed comments before pushing. |
| Using the wrong CLI tool | Detect platform first (see Platform detection). |
| Not tracking which comments are new | Compare against your last poll's comment timestamps/IDs. Don't re-answer old comments. |
| Treating GitLab manual jobs as failures | Skip manual stages (deploy, review apps). Only act on automatic CI failures. |