The GitHub commands behind the pull-request skill's readiness checklist. The checklist owns every gate, rule and threshold; this file holds the commands it runs.
<owner>/<repo> is the repository
bash "<skill-dir>/scripts/target-repo.sh" --dir "<checkout>" prints, <checkout> being the
checkout of the PR's repository the session works on, as
ready-for-review 2.5.3
defines it. Every command below names it, so none depends on the shell's directory. On a
triangular flow (the branch pushed to a fork, the PR opened on its upstream base), the script
resolves the checkout to the fork, so the base repository takes its place, named explicitly, as in
create's triangular flow: the PR's
target, not the push destination.
The checks list shows every check run and commit status. It is a one-off read: poll with the REST read in monitor.md.
gh pr checks <pr_number> -R <owner>/<repo> --json name,state,bucketThe conversation (issue-level) comments, where comment-only actors post:
gh api --paginate "repos/<owner>/<repo>/issues/<pr_number>/comments?per_page=100"gh api --paginate "repos/<owner>/<repo>/commits/<sha>/check-runs?per_page=100" \
| jq -s -r '"total_count=\(.[0].total_count) returned=\([.[].check_runs[]] | length)"'gh pr checks <pr_number> -R <owner>/<repo> --json name,state,bucketgh pr checks aggregates both workflow check-runs and external commit-statuses, which is why one
name can show two rows.
List every check run on the head (<sha> is the 40-hex head SHA) and find the duplicated name's
row in the output:
gh api --paginate "repos/<owner>/<repo>/commits/<sha>/check-runs?per_page=100" \
--jq '.check_runs[] | [.name, .status, .conclusion] | @tsv'gh pr checks <pr_number> -R <owner>/<repo> --json name,state,bucket --jq '.[] | select(.bucket == "fail")'The last-resort log eyeball is gh run view <run-id> -R <owner>/<repo> --log-failed, which
truncates at the CLI display layer; see monitor.md.
# PR reviews (review body — a reviewer that posts no issue comment lands here)
gh api --paginate "repos/<owner>/<repo>/pulls/<pr_number>/reviews?per_page=100" \
| jq -r '.[] | "\(.user.login): \(.state) — \(.body[:100])"'
# Inline review comments (diff-level)
gh api --paginate "repos/<owner>/<repo>/pulls/<pr_number>/comments?per_page=100" \
| jq -r '.[] | "\(.user.login): \(.body[:100])"'
# General PR comments (conversation tab)
gh api --paginate "repos/<owner>/<repo>/issues/<pr_number>/comments?per_page=100" \
| jq -r '.[] | "\(.user.login): \(.body[:100])"'One reviewer per run, with its discovered login in the --arg login value:
HEAD_SHA=$(git -C "<checkout>" rev-parse HEAD)
gh api --paginate "repos/<owner>/<repo>/pulls/<pr>/comments?per_page=100" \
| jq -s --arg sha "$HEAD_SHA" --arg login "<discovered reviewer login>" \
'[.[][] | select(.user.login == $login and .original_commit_id == $sha)] | length'