modernize — Claude Code skill: update old PRs
This Claude Code skill assesses an aging PR and recommends whether to refresh its branch, rework the implementation, or close it. It activates when asked to rebase or modernize a PR.
MIT 1,300 installs ★ 4,278 updated 2026-11-11
npx skills add t3dotgg/tstack --skill modernize -a claude-codeWhat modernize does
The skill checks whether an old PR still serves its original goal. It reads the full diff, commits, review threads, linked issues, and changes on the target branch, then classifies the next step as MODERNIZE, REWORK, or CLOSE. A PR's age alone is not grounds for closing it.
For MODERNIZE, the skill rebases from a safe branch or disposable worktree, compares commit series with git range-diff, inspects the resulting diff, and runs focused project checks. It updates the remote branch with --force-with-lease tied to the previously recorded head SHA. If that lease fails, it fetches again and reassesses rather than overwriting new work. The skill does not merge or close PRs, and posts comments only when requested.
What it helps with
- decide whether an old PR still solves a current problem
- spot target-branch changes that affect the PR
- rebase relevant commits and inspect the resulting diff
- choose whether to refresh, rework, or close a PR
Example prompts for the agent
- Assess this old PR and rebase its branch if its goal still matters.
- Review this PR and recommend whether to rework or close it.
- Rebase the PR onto its current target branch and run focused checks.
How to install modernize
1Skills CLI (Vercel)
npx skills add t3dotgg/tstack --skill modernize -a claude-code2Manually: put the files in place
~/.claude/skills/modernize/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/modernize/
1Skills CLI (Vercel)
npx skills add t3dotgg/tstack --skill modernize -a codex2Manually: put the files in place
.agents/skills/modernize/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add t3dotgg/tstack --skill modernize -a cursor2Manually: put the files in place
.cursor/skills/modernize/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install t3dotgg/tstack skills/modernize2Manually: put the files in place
.github/skills/modernize/SKILL.md1Skills CLI (Vercel)
npx skills add t3dotgg/tstack --skill modernize -a gemini-cli2Platform CLI
gemini skills install https://github.com/t3dotgg/tstack --path skills/modernizeManually: put the files in place
.devin/skills/modernize/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add t3dotgg/tstack --skill modernize -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about modernize
How do I install modernize in Claude Code?
Run npx skills add t3dotgg/tstack --skill modernize -a claude-code. The skill file is at ~/.claude/skills/modernize/SKILL.md.
What does modernize do?
It checks whether an old PR's goal still holds, then recommends refreshing the branch, reworking the implementation, or closing the PR. For a refresh, it rebases commits, compares the diff, and runs focused checks.
Can modernize close an outdated PR?
It can recommend CLOSE when a PR is obsolete or superseded, but it does not close the PR itself. Closing requires explicit permission.
Source text
SKILL.md · MIT
--- name: modernize description: >- For getting old prs up to date. Use when asked to rebase a pr or "modernize". --- # Modernize Modernize the idea, not just the branch. A clean rebase does not prove that the PR still belongs in the product. ## Guardrails - Always check to make sure you have pulled latest origin for your branch, main branch, and any other branch related to your work before starting. - Treat existing worktree changes as user-owned. Use a disposable worktree when the active worktree is dirty or is being used for other work. - Modernizing authorizes rebasing and updating the PR branch. It does not authorize merging, closing, changing the base branch, or expanding scope. - Never use an unqualified force push. Update a rebased branch with `--force-with-lease` against the head SHA observed before the rebase. - Do not post a PR comment unless the user asked for one. Use the `leaving-pr-comments` skill for every comment posted on the user's behalf. ## Establish the PR's intent Resolve the PR and record its URL, state, base, head repository and branch, current head SHA, author, checks, and review state. Read the title, body, linked issues, commits, review threads, and complete diff. State the smallest coherent goal the PR was trying to accomplish before judging its implementation. Fetch the latest remote base and PR head. Use the PR's actual base branch, usually `main`, rather than assuming the local branch is current. Record the merge base so the original PR and subsequent base-branch changes can be compared separately. ## Check what changed around it Inspect commits and diffs added to the base branch since the PR diverged. Search merged and open PRs when titles, code paths, or behavior suggest a replacement or competing implementation. Look beyond overlapping lines: - Has the same user-facing problem already been solved? - Did APIs, types, schemas, dependencies, or architectural boundaries change? - Do both sides now claim ownership of the same behavior or invariant? - Was the code being changed deleted, moved, or intentionally simplified? - Would landing the PR restore an old behavior or create two ways to do the same thing? - Is the original benefit still large enough to justify the maintenance cost? Do not describe a PR as current merely because Git reports no conflicts. ## Choose a disposition before pushing Use one of these recommendations: - **MODERNIZE**: the goal is still useful and the implementation remains the right shape. Rebase, resolve conflicts, test, and update the branch. - **REWORK**: the goal is still useful, but a mechanical rebase would preserve the wrong implementation. Explain the smallest credible rewrite and stop before pushing unless the user also asked for that rework. - **CLOSE**: the PR is superseded, obsolete, directionally wrong, or no longer worth its cost. Cite concrete evidence and stop. Do not spend time rebasing an obsolete branch, and do not close it without explicit permission. Be willing to recommend `CLOSE`. Age alone is not evidence, and sunk effort is not a reason to keep a PR alive. ## Rebase without losing intent For a `MODERNIZE` disposition: 1. Create a safe local branch or disposable worktree at the recorded PR head. 2. Rebase its commits onto the freshly fetched base branch. 3. Resolve each conflict according to the PR's current intent and the base branch's newer invariants. If a conflict reveals a product or architecture disagreement, stop and reconsider the disposition instead of guessing. 4. Compare the pre-rebase and post-rebase commit series with `git range-diff` and inspect the final diff. Confirm that no intentional behavior disappeared and no already-landed behavior was reintroduced. 5. Run the repository's focused checks for the touched area. Distinguish real failures from pre-existing or infrastructure failures. 6. Push with `--force-with-lease` tied to the previously observed remote head. If the lease fails, fetch and reassess rather than overwriting new work. Do not merge the PR. ## Report Lead with `MODERNIZE`, `REWORK`, or `CLOSE` and the reason. Then summarize: - meaningful changes on the base branch; - conceptual conflicts or confirmation that none were found; - the rebase and push result, if performed; - checks run and their results; - the remaining decision or work, with a link to the PR. Separate observed facts from judgment. Say what could not be verified instead of manufacturing confidence.
© t3dotgg · MIT · t3dotgg/tstack