Gh review requests
Contract
| Field | Bound contract |
|---|---|
| Trigger | User asks to find PRs to review, show review requests, or check the team review queue. |
| Authority | Read-only. No file, VCS, credential, paid, published, deployed, or remote mutation. |
| Side effect | Fetches unread GitHub review-request notifications and filters by team; emits chat output only. |
| Done | A table of open PRs needing review with URLs and reasons, or a no-results report, is returned. |
Not for
- Summarizing feedback on a specific PR: use resolve-pr-feedback.
- Resolving review feedback, use resolve-pr-feedback.
- Source or remote mutation: this skill is read-only.
Inputs
- GitHub authentication via the authenticated
ghCLI (verified withgh auth status) or aGITHUB_TOKENavailable togh. Required. - Optional team filter: a team slug or name. When supplied, keep only review requests targeting that team or its members.
- Optional repository scope: one or more
owner/repostrings. When supplied, restrict results to those repositories.
Procedure
- Verify
ghis authenticated by runninggh auth status. If it is not, stop and report the auth failure class; do not attempt to write credentials. Done when:ghis authenticated or the auth failure is reported. - Fetch unread notifications with reason
review_requested: rungh api --paginate /notificationsand keep entries wherereason == "review_requested"andunread == true. Done when: unread review-requested notifications are fetched. - For each retained notification, resolve the subject URL into the PR record with
gh pr view <number> --repo <owner/repo> --json number,title,author,url,reviewRequeststo obtain title, author, URL, and the review request teams. Done when: every retained notification is resolved into a PR record. - If a team filter is supplied, keep only PRs whose
reviewRequestsinclude that team slug or one of its members; resolve members withgh api /orgs/<org>/teams/<slug>/memberswhen the filter is a team slug. Done when: the team filter is applied or confirmed absent. - If a repository scope is supplied, drop any PR whose repository is not in the supplied set. Done when: the repository filter is applied or confirmed absent.
- Build a table with columns: Repository, PR (title and number), Author, URL, Reason (e.g., "review requested", "team: "). Done when: the table is built with all five columns.
- If the table is empty, return a no-results report stating that no unread review requests matched the filters. Done when: the table or no-results report is returned.
Failure and recovery
- Auth failure:
gh auth statusreports no authenticated account. Stop; report the failure and that no notifications were fetched. Do not write or modify credentials. - API rate limit:
gh apireturns a rate-limit error. Stop; report the limit and the partial result already collected, if any. Do not retry past the documented reset. - Partial results: if pagination is interrupted, return the rows collected so far labeled as partial, and report the interruption. Do not silently drop the partial set.
- Non-mutation: no step writes files, commits, comments, updates notifications, or changes repository state. Recovery is re-running the skill; there is nothing to roll back.
Output
A chat-output table of open PRs needing review, one row per PR, with Repository, PR, Author, URL, and Reason columns; or a no-results report when no unread review requests match the filters, partial results labeled as such.