Pick the scope based on the caller’s request and the current working directory — ask only if ambiguous:
origin.Resolve the current user via gh api user --jq .login once and cache it for the rest of the run — do not assume a login from git config or memory.
Use gh search prs with the cached login. Always request machine-readable JSON — do not parse human output.
# Base query — adjust scope with --repo OWNER/REPO or --owner OWNER.
gh search prs \
--author="@me" \
--state=open \
--review=approved \
--json number,title,url,repository,author,createdAt,updatedAt,isDraft,labels \
--limit 100
Notes:
--review=approved surfaces PRs whose current review decision is APPROVED. It does not include PRs with CHANGES_REQUESTED still outstanding, which is the behavior we want.reviewDecision to the --json list above — gh search prs rejects it (“Unknown JSON field: reviewDecision”). The --review=approved filter already enforces the approval state, and the per-PR enrichment in step 3 pulls reviewer detail from gh pr view instead.isDraft: true entries from the default report; mention them only if the caller asked to include drafts.--repo {owner}/{name} resolved from git remote get-url origin.--owner {name}.gh is not authenticated (exit code 4 / “gh auth status” fails), stop and tell the caller to run gh auth login. Do not retry silently.For up to 25 PRs, fetch additional context that makes the report actionable. Skip this step if the result set is larger — the caller can re-scope.
For each PR, fetch:
gh pr view {number} --repo {owner}/{name} \
--json mergeable,mergeStateStatus,statusCheckRollup,reviews,reviewRequests
Derive these fields per PR:
reviews with state == "APPROVED" (keep the latest review per reviewer only — ignore earlier APPROVED reviews superseded by a later review from the same person).reviewRequests — these are reviewers who haven’t responded yet.statusCheckRollup to one of passing, failing, pending, none.mergeable + mergeStateStatus to ready, conflicts, blocked, or unknown.Render a compact table. Sort by updatedAt descending (most recently active first).
Approved PRs opened by @{login} — scope: {scope}
| PR | Title | Repo | Approvers | CI | Mergeable | Updated |
|----|-------|------|-----------|----|-----------| --------|
| #123 | Fix login redirect | embarkvet/foo | @alice, @bob | passing | ready | 2h ago |
| #118 | Add PostHog tracking | embarkvet/bar | @carol | failing | blocked | 1d ago |
Then append a short human-readable summary:
NMKIf there are zero results, say so plainly. Do not pad the report.
After the report, offer concrete follow-ups based on what was found — do not take any of these actions without explicit confirmation:
ready to merge: offer to merge them (gh pr merge --squash --auto or whatever the caller’s preferred strategy is — ask).blocked by CI: offer to invoke /resolve-ci-failures on that PR’s branch./address-pr-comments on that PR.post-on-slack / comment-jira / comment-confluence skill so the Farty Bobo identity disclosure is applied.