---
name: old-pr-verdict
description: Decide if an old open pull request is KEEP, REWORK or CLOSE before anyone rebases it. Use when asked to rebase, update, revive, clean up or triage an old or stale PR or branch, or when someone asks "is this PR still needed", "modernize this PR" or "old PR verdict".
metadata:
  license: AGPL-3.0-or-later
  copyright: "2026 DevTribe Labs"
  homepage: https://github.com/DevDadTribe/toolbox
  inspired_by: "t3dotgg/tstack modernize (MIT)"
---

# Old PR verdict: KEEP, REWORK or CLOSE

*Idea from the `modernize` skill in [t3dotgg/tstack](https://github.com/t3dotgg/tstack) (MIT). This text is our own rewrite.*

A clean rebase does not prove the PR still belongs in the product. Judge the idea first, the
branch second. Give the verdict before you push anything.

The examples use the GitHub CLI (`gh`) and `main` as the base branch. Use your own base
branch and forge tools if they differ.

## What this skill may do

- It may rebase and update that one PR's own branch, after a KEEP verdict.
- It may not merge, close, change the base, delete a branch or widen the scope. Each of those
  needs the user's explicit word. Deleting a branch can close every PR stacked on it.
- Work in the PR's own worktree, or a new one. Never in a checkout someone else is using. No
  `git stash`, no `git reset --hard` on shared work.
- Age is not evidence. "Commits behind" is not evidence. The number of the PR's own files
  that changed on the base is.

## 1. Say what the PR was for

Read the PR, its review threads and the whole diff:

```bash
gh pr view <N> --json title,body,state,isDraft,baseRefName,headRefName,headRefOid,commits,reviews,statusCheckRollup
gh pr diff <N>
```

Then write one sentence: the smallest goal this PR was trying to reach. If you cannot write
that sentence, the verdict is not KEEP.

## 2. Look at what moved around it

- Which of its own files changed on the base since it branched:

  ```bash
  git fetch origin main
  base=$(git merge-base origin/main <head>)
  git diff --name-only "$base" origin/main -- $(gh pr diff <N> --name-only)
  ```

- Who changed them and why: `git log --oneline "$base"..origin/main -- <its files>`.
- Search for a replacement: merged and open PRs with the same words or the same files
  (`gh pr list --state all --search "<words>"`), and your project's changelog or fixes log.
- Is part of it already live? Some teams deploy from a branch before it merges. Check what is
  actually deployed before you call anything dead.

Ask, in this order:

1. Is the same problem already solved on the base branch?
2. Did the code it changes move, get deleted or get made simpler on purpose?
3. Would landing it bring back an old behaviour, or make two ways to do one thing?
4. Did a table, a function signature, a route or a rule it depends on change?
5. Is the gain still worth the upkeep?

## 3. Pick one verdict

- **KEEP**: the goal is still wanted and the shape is still right. Go to step 4.
- **REWORK**: the goal is still wanted, the shape is now wrong. Say the smallest rewrite in
  3 lines and stop. Do not push a mechanical rebase of the wrong shape.
- **CLOSE**: replaced, out of date, or no longer worth it. Name the PR, commit or file that
  proves it and stop. Do not rebase it. Do not close it without the user's word.

Be willing to say CLOSE. Work already spent is not a reason to keep a PR open.

## 4. KEEP only: rebase without losing the point

1. Record the remote head sha you read in step 1.
2. Rebase the PR's commits onto a freshly fetched base. For a stack, rebase the whole chain in
   order. If the base PR was squash-merged, cherry-pick this PR's own commits onto the base
   instead.
3. Resolve each conflict by the PR's goal and the base branch's newer rules. A conflict that
   is really a product disagreement sends you back to step 3. For a file where every PR adds
   an entry at the top (a changelog, a migration list), do not hand-merge the hunks: take the
   base branch's file whole and add this PR's entry back as one block.
4. Compare the old and new commit series with `git range-diff`, and read the final diff.
   Nothing wanted went missing, and nothing the base already has came back.
5. Run the focused checks for the touched area. A failure that also fails on the base branch
   is not this PR's.
6. Push with `git push --force-with-lease=<branch>:<sha from step 1>`. If the lease fails,
   fetch and start the verdict again. Then watch the checks: `gh pr checks <N> --watch`.
7. A reviewed PR whose code changed needs its review again on the new head.

## 5. Report

Line 1 is the verdict and the reason in plain words. Then, short:

- what changed on the base around it;
- the conflict in ideas, or that there was none;
- the rebase and push result, if you did one;
- the checks you ran and what they said;
- the one decision left for the user, with the PR link.

Keep what you saw apart from what you judge. Say NOT VERIFIED for what you could not check.

---

*`old-pr-verdict` from [DevDad's Toolbox](https://github.com/DevDadTribe/toolbox). AGPL-3.0-or-later (c) 2026 DevTribe Labs. Inspired by [t3dotgg/tstack](https://github.com/t3dotgg/tstack) (MIT).*
