Skip to content

skills: add pr-digest — read-only PR landscape across the offline repos - #13

Open
oksuzian wants to merge 1 commit into
mainfrom
skill-pr-digest
Open

skills: add pr-digest — read-only PR landscape across the offline repos#13
oksuzian wants to merge 1 commit into
mainfrom
skill-pr-digest

Conversation

@oksuzian

@oksuzian oksuzian commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

reviewing-pull-requests answers "is this one PR any good?". Nothing answered "what is the state of the queue?" — which PRs are unreviewed, which have red CI, and which ones I reviewed before the author pushed again. This adds that.

Read-only, on purpose

Every call is a GET. It never posts a review, comments, triggers a build, edits or merges. That is the whole value proposition: a digest is cheap to trust precisely because it cannot change anything. Anything needing action gets handed to reviewing-pull-requests.

What it shows

Open non-draft PRs across the nine offline repos, with author, age, CI state at the current head, overall review decision, and whether your own review covers that head. Five flags surface in a NEEDS ATTENTION block:

flag why it matters
your review is STALE your findings describe code that no longer exists — the author pushed after you
CI RED at head names the failing contexts, so a real break is distinguishable from an infra blip
no CI at head the green you see may belong to an older commit
never reviewed by anyone the actual backlog
merge CONFLICT blocked regardless of review state

Sample against the live queue this morning:

Mu2e PR digest — 2026-08-08 11:07 — as oksuzian
9 repo(s), 12 open non-draft PR(s)

NEEDS ATTENTION
  Offline#1919  Calo mc rev
      - CI RED at head — mu2e/buildtest, mu2e/cosmicOffSpill

ALL OPEN
  PR                   author            age CI    review           you        title
  Offline#1919         bechenard          1d FAIL  CHANGES_REQ      @head      Calo mc rev
  Offline#1918         sdifalco           2d run   -                @head      Aug 26 geometry updates
  Production#552       PawelPlesniak     32d ok    CHANGES_REQ      @head      Pawel plesniak/absorber shif
  ...

Two things worth reviewing

"No CI at head" fires only for Offline and Production. FNALbuild watches neither of the other seven repos, so a blank CI column there is normal rather than a finding. If that is wrong — if some repo has GitHub Actions I did not find — the fix is one line in FNALBUILD_REPOS.

Failure is loud, not silent. An unknown repo is a hard error. A repo that fails to report is named in an INCOMPLETE section with totals labelled a lower bound, and the script exits 1 — never rendered as zero PRs, which would read as "nothing open".

Implementation notes

Two gh quirks are documented in the skill so nobody "optimizes" them away:

  • gh pr list --json latestReviews returns commit.oid as an empty string. The stale-review check depends entirely on comparing your review's commit against the live head, so the digest makes one gh api .../pulls/<N>/reviews call per PR. There is no way to get it from the list endpoint.
  • latestReviews also carries the full review body — ~15 KB of prose per PR for a field the digest never displays. It is deliberately excluded from the requested fields.

~15 s for all nine repos, ~20 API calls for 12 open PRs.

Validation

Run end to end against all nine repos, a single repo, and --json. The unknown-repo path was checked (hard error, exit 1). attention() was unit-tested across eight synthetic cases including the stale path and the suppression of "no CI" on non-FNALbuild repos — the stale flag has no live example right now because every open PR happens to be reviewed at its current head.

Not validated: the INCOMPLETE path has not been seen against a real gh failure, only by construction. No repo errored during testing.

🤖 Generated with Claude Code

…e repos

reviewing-pull-requests answers "is this one PR any good?". Nothing
answered "what is the state of the queue?" — which PRs are unreviewed,
which have red CI, and which ones I reviewed before the author pushed
again.

pr-digest is strictly read-only: every call is a GET. It never posts,
comments, triggers a build, edits or merges. That is what makes it cheap
to trust; anything needing action gets handed to reviewing-pull-requests.

Reports open non-draft PRs with author, age, CI state at the *current*
head, overall review decision, and whether your own review covers that
head. Flags five conditions: your review is stale (head moved after you
reviewed), CI red at head, no CI at head, never reviewed by anyone, and
merge conflict.

"No CI at head" is raised only for Offline and Production. FNALbuild
does not watch the other seven repos, so a blank CI column there is
normal rather than a finding.

Failure handling is loud: an unknown repo is a hard error, and a repo
that fails to report is named in an INCOMPLETE section with the totals
labelled a lower bound -- never silently rendered as zero PRs.

Two gh quirks are documented in the skill so they are not "optimized"
back: gh pr list --json latestReviews returns commit.oid as an empty
string (hence one reviews call per PR to get commit_id, which the whole
stale-review check depends on), and latestReviews also carries the full
review body, ~15 KB per PR of prose the digest never displays.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant