github-pr-agent-workflows
Original:🇺🇸 English
Translated
3 scripts
Manage GitHub pull request workflows for coding agents. Use when Codex needs to open, update, monitor, or hand off a PR; wait for CI checks or reviewer feedback; inspect unresolved review threads; address requested changes; summarize PR status; or decide whether to continue, wait, report a timeout, or ask for human input.
2installs
Sourceandreacovelli/my-skills
Added on
NPX Install
npx skill4agent add andreacovelli/my-skills github-pr-agent-workflowsTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →GitHub PR Agent Workflows
Overview
Use this skill for agent-oriented pull request loops: prepare the PR, wait for checks, wait for review activity, inspect feedback, make follow-up changes, and report the final state. Prefer the bundled scripts for repeatable review polling and review-thread summaries.
Quick Commands
Watch checks, then review activity:
bash
scripts/pr-agent-watch.sh 123 -R OWNER/REPO --checks-timeout 30m --review-timeout 2hWait for review activity:
bash
scripts/wait-pr-review.sh 123 -R OWNER/REPO --timeout 30m --interval 60sSummarize current review state:
bash
scripts/pr-review-summary.sh 123 -R OWNER/REPOPrint parseable review state:
bash
scripts/pr-review-summary.sh 123 -R OWNER/REPO --jsonWait for CI checks with :
ghbash
gh pr checks 123 -R OWNER/REPO --watch --interval 10Use the system command when a bounded check wait is required:
timeoutbash
timeout 30m gh pr checks 123 -R OWNER/REPO --watch --interval 10Agent Loop
- Identify the PR and repository.
Use or accept an explicit PR number and
gh pr view --json number,url,headRefName,baseRefName,reviewDecision,mergeStateStatus,statusCheckRollup.-R OWNER/REPO - Snapshot the PR before waiting.
Run when review feedback may matter.
scripts/pr-review-summary.sh - Wait for CI when validation gates the next action.
Use when the agent should wait for checks and review feedback in one loop. Use
scripts/pr-agent-watch.shfor checks-only waits.gh pr checks --watch - Wait for reviewer activity when the next action depends on feedback.
Use ; prefer
scripts/wait-pr-review.shafter the agent has already handled current feedback.--ignore-existing - Inspect comments before editing.
Use the review summary script, preferably with when automation needs to parse unresolved threads. Use
--jsonorgh pr view --commentswhen bodies or locations need deeper inspection.gh api repos/{owner}/{repo}/pulls/{pull_number}/comments --paginate - Address feedback in a small patch. Do not rewrite unrelated files. Preserve user changes in the worktree.
- Run the relevant checks locally. Keep validation proportional to the changed area.
- Push or report. Push only when that is part of the task. Merge only when the user explicitly asked for merge behavior.
Decision Rules
- If checks fail, inspect the failing check logs before changing code.
- If exits
wait-pr-review.sh, inspect review threads and review decisions before editing.0 - If exits
wait-pr-review.sh, report that no matching review activity arrived before the timeout.124 - If exits because checks are still pending or the wrapper timeout fires, report the pending state instead of guessing.
gh pr checks --watch - If the PR is approved and checks pass, stop unless the user asked for merge or follow-up automation.
- If review feedback conflicts with the user request, summarize the conflict and ask before making a risky change.
Bundled Scripts
scripts/pr-agent-watch.sh
scripts/pr-agent-watch.shWait for PR checks, then wait for review activity and print a review summary when feedback arrives.
Common options:
--checks-timeout 30m--checks-interval 10s--review-timeout 2h--review-interval 60s--review-mode any|comments|review|approval|changes-requested--ignore-existing-review--skip-checks--skip-review
Exit codes:
- : ready; checks passed and review wait was skipped
0 - : review activity found and summarized
10 - : checks failed or were cancelled
20 - : checks timed out
21 - : review wait timed out
22 - : usage, PR resolution, or GitHub API error
2
scripts/wait-pr-review.sh
scripts/wait-pr-review.shPoll a pull request until matching review activity appears or the timeout expires.
Common options:
--timeout 30m--interval 60s--mode any|comments|review|approval|changes-requested--ignore-existing
Exit codes:
- : matching review activity found
0 - : timeout
124 - : usage, PR resolution, or GitHub API error
2
scripts/pr-review-summary.sh
scripts/pr-review-summary.shPrint PR state, latest reviews, pending review requests, and unresolved review threads with file locations and comment URLs. Use for parseable output that includes unresolved thread counts, comment URLs, authors, timestamps, and bodies.
--json