Skip to content

Add post-pr-review skill: gated publishing of staged PR reviews (v1.0.0) - #11

Merged
oksuzian merged 2 commits into
mainfrom
post-pr-review-skill
Aug 2, 2026
Merged

Add post-pr-review skill: gated publishing of staged PR reviews (v1.0.0)#11
oksuzian merged 2 commits into
mainfrom
post-pr-review-skill

Conversation

@oksuzian

@oksuzian oksuzian commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

New skill: post-pr-review — the publishing companion to reviewing-pull-requests. That skill stages a review as a markdown file (~/pr_reviews/pr<N>_review.md); this one posts it to the GitHub PR via gh pr review, fail-closed behind four gates:

  1. Review file exists — refuses to synthesize a review at post time; that's reviewing-pull-requests' job.
  2. Staleness — the head SHA recorded in the review ("Reviewed at head <sha>") must match the live PR head, else stop and recommend re-review (--force-stale to override, with the body edited to say which head was reviewed).
  3. Decision-to-event mapping — the review's own Decision line drives the gh event: 🔴 → --request-changes, 🟡 → --comment, 🟢 → --approve. The event is never upgraded implicitly; an explicit argument is required to deviate.
  4. Duplicate check — searches existing PR comments/reviews for the review's headline content and stops if it was already posted (--allow-duplicate to override).

The body is posted verbatim — edits happen in the staged file, never at post time. One post per invocation.

First shakedown was on Mu2e/Offline#1911, where the duplicate gate correctly halted: finding 1 had already been posted as a standalone comment the day before.

Independent of #10 (different path, no conflicts); the two can merge in either order.

🤖 Generated with Claude Code

Companion to reviewing-pull-requests: publishes a staged review
(~/pr_reviews/pr<N>_review.md) to the GitHub PR via gh, fail-closed
behind four gates -- review file exists, staleness (review head must
match live PR head), decision-to-event mapping (red=request-changes,
yellow=comment, green=approve; never upgraded implicitly), and a
duplicate check against existing PR comments/reviews. Body is posted
verbatim; overrides (--force-stale, --allow-duplicate) must be
explicit.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@oksuzian
oksuzian requested a review from rlcee August 1, 2026 18:13
…v1.0.1)

The review-draft directory is per-user scratch space, not shared
state: default ~/pr_reviews, overridable via PR_REVIEW_DIR. New 'Why a
local draft at all' section makes the design explicit -- everything
durable is GitHub-to-GitHub (the posted review is the canonical
record; re-reviews read from the PR); the local file exists only so a
human can edit the draft before anything becomes visible on the PR,
and is disposable after posting.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@oksuzian
oksuzian merged commit 693efe0 into main Aug 2, 2026
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.

2 participants