Report Approved PRs Skill

1. Determine the search scope

Pick the scope based on the caller’s request and the current working directory — ask only if ambiguous:

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.

2. Query GitHub

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:

3. Enrich each PR (optional, only if < 25 results)

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:

4. Format the report

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:

If there are zero results, say so plainly. Do not pad the report.

5. Offer a next action

After the report, offer concrete follow-ups based on what was found — do not take any of these actions without explicit confirmation:

6. Guardrails