Pr ready

From OutThisLife/brooklyn-skills · View interactive version

Pr ready is an AI agent skill from the GitHub repository OutThisLife/brooklyn-skills. Clear everything blocking an existing PR/MR from merging — rebase onto the default branch, get CI green, and resolve review threads (Copilot and human). Use for "rebase on main", "make CI green", "fix CI/CD", "address the reviews", "address Copilot", "review-loop", or "get this mergeable".

How to use this skill

Skill file

PR Ready

An open PR/MR isn't mergeable. Two things block it — a stale base or red CI,

and open review threads. Same loop for both: fix, push, re-query the forge,

repeat. Handle whichever is blocking; usually that's both.

No feature work. No drive-bys.

Rebase + CI

  1. Find the worktree for this PR (or create one per repo convention). Prefer an

existing worktree the user already has.

  1. git fetch origin <default> (usually main).
  2. Honor repository history rules before choosing an update strategy. Where force pushes are forbidden or the user requires a merge, merge origin/<default> into the existing branch without rewriting commits. Otherwise rebase onto origin/<default>. Resolve conflicts by reading both sides' intent and regression tests; shared callback code must preserve newer callback-once behavior as well as the PR's guards.
  3. Push (--force-with-lease if the rebase rewrote history).
  4. Watch CI. Fix **failures caused by the rebase or existing breakage on this

branch** — nothing else.

  1. Flaky upstream on the default branch → say so. Don't paper over it with

unrelated test deletes.

  1. Verify process.execPath in the same execution mode as MR tests, using the repository's package manager. Background login shells can replace an earlier PATH export, so select the project's declared Node version inside the launched command. A newer runtime can shadow happy-dom localStorage or remove util.isDate; rerun unchanged failing tests under the supported runtime before editing application code.
  2. For merge commits, old lint-staged hooks can autoformat every upstream file in the index. Run lint on the PR delta and the repository precommit checks explicitly, preserve upstream files, and document any one-command hook bypass used solely to prevent unrelated formatting. Never call that bypass a substitute for verification. Do not assume HUSKY_SKIP_HOOKS=1 is honored: inspect the hook output. Legacy hook git add can also include unstaged edits to already-staged files. Reconcile the resulting commit against the pre-merge PR file set plus intended fixes, and restore unrelated suppression-file pruning rather than publishing incidental changes.

CI-only failures

Interrupted repairs

Review threads

  1. Commit/push any unpushed work first (ask if the message is unclear).
  2. List open/unresolved inline comments + review bodies.
  3. Want a bot pass? Request the repo's review bot, then wait for it — don't spin

forever; if it's stuck ~10–15m, say so. A Claude comment explaining how to request a manual review is not a completed review. When actual AI review is requested, trigger it for each PR/base and verify the submitted review matches that PR's current head. Inspect the check's title/body: a neutral clean review with an explicit no-issues result differs from a neutral worker result with zero turns and no review. Keep those outcomes separate.

A managed Claude review and the legacy Claude GitHub Action can both react to one mention. If the legacy action fails but the managed review completes, reply with both exact run/review links; do not call the failed action successful or blindly rerun both services.

  1. Per comment: valid → fix and resolve. Wrong or outdated → short reply and

resolve. Nit out of scope → ask once. Never resolve a #1 maintainer comment

without fixing it or an explicit override (pr-triage).

  1. Push (pr-update if they want the commits split).
  2. Repeat until unresolved threads are gone, or only ones they OK'd deferring.

Large visual assets in a review

Done when

Re-query the forge — don't trust that a push turned CI green or that a reply

resolved a thread. Fail closed: any red check or open thread means you're

not done.

Report the branch tip, checks status, and a short fixed-vs-replied summary.

Urgent preview handoff

Scope lock

pr-triage. Don't silently rewrite it.

Forge cheatsheet

# GitHub — CI
gh pr view <N> --json url,headRefName,baseRefName,statusCheckRollup
gh pr checks <N>

# GitHub — threads
gh api repos/{owner}/{repo}/pulls/<N>/comments --jq '.[] | {user:.user.login,path,line,body:(.body[:200])}'
gh api repos/{owner}/{repo}/pulls/<N>/reviews  --jq '.[] | {user:.user.login,state,body:(.body[:200])}'
gh api repos/{owner}/{repo}/pulls/<N>/comments -f body='…' -F in_reply_to=<comment_id>
gh pr edit <N> --add-reviewer copilot   # if that's what the repo uses

# GitLab
glab mr view <N>
glab ci status
glab mr note <N>        # + the discussions API for resolve
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.