Skip to content

docs: add Run PR shortcut for automated open-PR maintenance sweeps#980

Merged
BigSimmo merged 3 commits into
mainfrom
claude/automated-pr-maintenance-0ppgwq
Jul 20, 2026
Merged

docs: add Run PR shortcut for automated open-PR maintenance sweeps#980
BigSimmo merged 3 commits into
mainfrom
claude/automated-pr-maintenance-0ppgwq

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds a Run PR chat shortcut: when the user types exactly Run PR as the task message, the assistant runs a one-shot maintenance sweep over every open PR (drafts included) — fixing failing required CI checks, addressing unresolved review threads (fix, reply, resolve), and merging origin/main into behind/conflicting branches before pushing.
  • AGENTS.md: new ## Run PR shortcut policy section (trigger recognition, a scoped authorization carve-out from the "API and provider confirmation boundary", and hard guardrails — never merge/auto-merge/close/force-push/rebase, never provider-backed gates, skip-codex-review label as a full opt-out), plus one-line cross-references in the confirmation-boundary block and the pr-ci-fix routing bullet.
  • .claude/skills/run-pr/SKILL.md (new): the canonical procedure — sweep setup, per-PR algorithm (skip gates, drift-first git merge origin/main with conflict rules, CI diagnosis with a job→local-command reproduction map, thread fix/reply/resolve mechanics, per-PR iteration caps), branch-review-ledger row format, and the final report format.
  • .claude/agents/pr-ci-fixer.md: notes that an explicit Run PR sweep already carries the user's authorization, so the diagnose-only subagent doesn't stall the sweep asking for a confirmation the user has already given.

Verification

Docs/skill-only change — no product, config, or test code touched, so the standard gates don't apply. Verification run:

  • npm run check:skills — passes; the validated .agents/skills/ catalog is untouched (still 32 canonical skills, 8 aliases).
  • npx prettier --check AGENTS.md .claude/skills/run-pr/SKILL.md .claude/agents/pr-ci-fixer.md — passes (these paths are covered by CI's format gate).
  • Integrity greps: exactly one ## Run PR shortcut heading and one BEGIN:run-pr-shortcut/END:run-pr-shortcut delimiter pair in AGENTS.md.

Verification not run: verify:pr-local / verify:ui / verify:release — no runtime surface changed; the diff is agent-instruction Markdown only.

Risk and rollout

  • Risk: low — instruction files only. The main behavioral consequence is intentional: typing Run PR becomes standing authorization for a scoped set of GitHub actions (pushes to PR feature branches, thread replies/resolution, CI re-runs, branch updates from main). The guardrail list explicitly keeps merging, auto-merge, closing PRs, force-pushes, branch deletion, and provider-backed gates confirmation-required.
  • Rollback: revert this commit; no state, schema, or deployment impact.
  • Provider or production effects: None.

Clinical Governance Preflight

Not applicable — no ingestion, answer generation, search/ranking, source rendering, document access, privacy, production env, or clinical output touched.

Notes

  • The sweep never merges PRs and treats draft PRs the same as ready PRs (both confirmed with the repo owner during planning).
  • The sweep intentionally does not use the <!-- codex-thread-disposition:resolved --> marker (the autofix workflow only trusts it from the Codex bot); threads are resolved directly via the GitHub MCP tool after a reply.

Generated by Claude Code

Summary by CodeRabbit

  • New Features

    • Added a one-shot Run PR workflow for reviewing open pull requests.
    • Automatically checks CI status, identifies actionable review feedback, applies safe fixes, and reports results.
    • Includes safeguards for draft, forked, conflicting, or otherwise ineligible pull requests.
  • Documentation

    • Documented authorization requirements, supported actions, safety restrictions, retry limits, and result reporting.
    • Added guidance for tracking completed review and CI maintenance work.

Typing "Run PR" as the task message now triggers a one-shot sweep over
every open PR: fix failing required CI checks, address and resolve
review threads, and merge origin/main into drifted branches, then push.

- AGENTS.md: new "Run PR shortcut" policy section (trigger, scoped
  authorization carve-out from the API/provider confirmation boundary,
  hard guardrails: never merge/auto-merge/close/force-push/rebase,
  never provider-backed gates, skip-codex-review opt-out), plus
  cross-references in the confirmation-boundary and pr-ci-fix routing.
- .claude/skills/run-pr/SKILL.md: canonical procedure — sweep setup,
  per-PR algorithm (skip gates, drift-first merge with conflict rules,
  CI diagnosis with job-to-local-command map, thread fix/reply/resolve
  mechanics, iteration caps), ledger row format, and report format.
- .claude/agents/pr-ci-fixer.md: note that an explicit Run PR sweep
  already carries the user's authorization so the subagent does not
  stall the sweep on a confirmation request.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vc5z2HPfZSAbeg43Pu9CpY
@supabase

supabase Bot commented Jul 20, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 46d5fbf0-8171-4f36-b821-b22a61e4218b

📥 Commits

Reviewing files that changed from the base of the PR and between e727ed3 and 12fddaf.

📒 Files selected for processing (3)
  • .claude/agents/pr-ci-fixer.md
  • .claude/skills/run-pr/SKILL.md
  • AGENTS.md

📝 Walkthrough

Walkthrough

Adds a Run PR skill for one-shot maintenance of open pull requests, documents authorization and guardrails, defines CI and review-thread handling, records ledger outcomes, and aligns repository and agent confirmation guidance.

Changes

Run PR sweep

Layer / File(s) Summary
Authorization and guardrails
.claude/skills/run-pr/SKILL.md, .claude/agents/pr-ci-fixer.md, AGENTS.md
Defines the Run PR scope, authorized actions, prohibited operations, and confirmation exceptions.
Sweep setup and branch preparation
.claude/skills/run-pr/SKILL.md
Specifies identity and access checks, PR enumeration, worktree requirements, state snapshots, branch-drift handling, and conflict skips.
CI diagnosis and review handling
.claude/skills/run-pr/SKILL.md
Defines CI log inspection, bounded local reproduction, minimal fixes, verification limits, review-thread replies and resolution rules, and iteration caps.
Ledger, restoration, and final reporting
.claude/skills/run-pr/SKILL.md
Adds per-PR ledger recording, checkout restoration, cost controls, and consolidated sweep reporting.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant RunPR
  participant GitHub
  participant Worktree
  participant Ledger
  User->>RunPR: Type Run PR
  RunPR->>GitHub: Enumerate and snapshot open PRs
  RunPR->>Worktree: Diagnose and verify permitted fixes
  Worktree->>GitHub: Push allowed changes
  RunPR->>GitHub: Reply to and resolve eligible threads
  RunPR->>Ledger: Record per-PR results
  RunPR-->>User: Return consolidated report
Loading

Possibly related PRs

Suggested labels: codex

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/automated-pr-maintenance-0ppgwq

Comment @coderabbitai help to get the list of available commands.

@BigSimmo
BigSimmo marked this pull request as ready for review July 20, 2026 09:36
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@BigSimmo
BigSimmo enabled auto-merge (squash) July 20, 2026 09:37
@BigSimmo
BigSimmo merged commit 8c22c9d into main Jul 20, 2026
16 checks passed
@BigSimmo
BigSimmo deleted the claude/automated-pr-maintenance-0ppgwq branch July 20, 2026 10:19
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