agentleFS
VercelKnown publishervercel/next.js/.agents/skills/backport-pr/SKILL.md

backport-pr

Skill144k starsChanged 7 months agoMITView on GitHub

Backport a merged Next.js pull request from canary to an LTS release branch (releases/lts/active or releases/lts/maintenance). Use when the user asks to backport, cherry-pick, or open a backport PR from a PR number to an older Next.js version. Covers finding the merged PR commit, creating a backport branch from the target release branch, cherry-picking from canary, validating, and opening the PR with the release branch as the base.

2 other projects use a version of this.

Trending

Less talk lately.about the whole repository

Jan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 3 mentionsApr 2026: 2 mentionsMay 2026: 4 mentionsJun 2026: 4 mentionsJul 2026: 3 mentionsAug 2026: 2 mentionsSep 2026: 3 mentionsOct 2026: 3 mentionsNov 2026: 1 mentionDec 2026: 0 mentions
Jan 2026Jul 2026Dec 2026
Mentions a month of the vercel/next.js repository that our weekly crawl found. There is no adoption data for this file yet.

Most recently taken up by

Who's talking about vercel/next.js

The biggest 5 of 92 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 92

Talked about on Bluesky, GitHub and Hacker News (92 times).

On Bluesky · 50

45 more on Bluesky

On GitHub · 26

21 more on GitHub

On Hacker News · 16

11 more on Hacker News

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 5 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use this skill when a user asks to backport a merged Next.js PR to a release branch.

    line 16
  2. Distinctive:

    If the target branch is not provided and cannot be inferred confidently from the user's request, ask before mutating git state — and …

    line 28
  3. Distinctive:

    Treat the target branch as variable.

    line 31
  4. Very specific:

    Prefer mergeCommit.oid when the PR is MERGED and the commit is contained in origin/canary.

    line 59
  5. Distinctive:

    Create the backport branch from the release branch:

    line 64
  6. Very specific:

    Verify with the narrowest commands that cover the touched files.

    line 88
  7. Distinctive:

    Use a title like:

    line 102
  8. Distinctive:

    Use a concise PR body:

    line 114

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Backport PR

Use this skill when a user asks to backport a merged Next.js PR to a release branch.

Inputs

  • Require a PR number and a target release branch. Almost always the target is one of the LTS branches: releases/lts/active (the current major's release line) or releases/lts/maintenance (the previous major's). Only in exceptionally rare circumstances — a fix for an older minor line that neither LTS branch supports anymore — is the target a non-LTS branch (next-<major>-<minor>, which any maintainer can create by pushing a branch from that line's last tag).
  • If the target branch is not provided and cannot be inferred confidently from the user's request, ask before mutating git state — and default to an LTS branch unless the user explicitly names an old minor line.
  • Treat the target branch as variable; do not hard-code a specific branch except when the user explicitly asks for it.

Workflow

  1. Inspect the current worktree before changing branches:

    git status --short
    git branch --show-current

    Preserve unrelated user changes. Do not overwrite, reset, or stash them without the user's consent.

  2. Sync the source and target branches:

    git fetch origin canary:refs/remotes/origin/canary <target-branch>:refs/remotes/origin/<target-branch>
  3. Identify the commit that landed the PR on canary:

    gh pr view <pr-number> --repo vercel/next.js --json number,title,state,url,mergeCommit,baseRefName,headRefName
    git log origin/canary --oneline --fixed-strings --grep="(#<pr-number>)"

    Prefer mergeCommit.oid when the PR is MERGED and the commit is contained in origin/canary. If GitHub does not return a usable merge commit, use the git log --grep result and verify the commit subject references the PR number.

  4. Create the backport branch from the release branch:

    git switch -c backport-<pr-number>-to-<target-branch> origin/<target-branch>

    Bootstrapping this checkout does not require pnpm build-all since pnpm install pulls in recent native bindings. Before running Next.js integration tests, build what the branch switch and cherry-pick changed: pnpm build for JS changes, pnpm build-all only for Rust/Turbopack changes. Skip builds entirely if the task is limited to preparing the cherry-pick or PR.

  5. Cherry-pick the landed commit with provenance:

    git cherry-pick -x <merged-commit-sha>

    Resolve conflicts in favor of preserving the release branch's compatibility constraints. If the cherry-pick is empty, verify whether the change is already present on the release branch and report that instead of opening a duplicate PR.

  6. Verify with the narrowest commands that cover the touched files. Prefer focused tests, pnpm types for TypeScript-only risk, and the relevant integration test mode for behavior changes.
  7. Open the backport PR using $create-pr.

    Override the normal $create-pr base branch: use --base <target-branch>, not canary. Keep the PR as a draft unless the user explicitly asks otherwise.

PR Shape

The PR title should indicate the target branch and the original PR title.

Use a title like:

[lts-active] <original PR title>

or

[lts-maintenance] <original PR title>

Use a concise PR body:

Backports <original PR title/link> to `<target-branch>`.

<!-- NEXT_JS_LLM -->

Related Skills

  • $create-pr - Create the branch commit, push it, and open the draft PR.
  • $pr-status-triage - Check CI failures or review feedback after the PR exists.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.