24 skills · 112 min
Skills
Skill 2 of 24
Backport a merged Next.js pull request from canary to a previous release branch such as next-16-2.
1 minute · 309 words · 4 sections
Install
npx skills add vercel/next.js --skill backport-prnpx skills add vercel/next.js/plugin marketplace add vercel/next.jsThe first command installs just this skill, by the name in its SKILL.md; the second installs the whole repository.
Use this skill when a user asks to backport a merged Next.js PR to a release branch.
next-16-2.next-16-2 except when
the user explicitly asks for it.Inspect the current worktree before changing branches:
git status --short
git branch --show-currentPreserve unrelated user changes. Do not overwrite, reset, or stash them without the user’s consent.
Sync the source and target branches:
git fetch origin canary:refs/remotes/origin/canary <target-branch>:refs/remotes/origin/<target-branch>Identify the commit that landed the PR on canary:
gh pr view <pr-number
Use a title like:
[backport] <original PR title>Use a concise PR body:
Backports <original PR title/link> to `<target-branch>`.
<!-- NEXT_JS_LLM -->$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.Backport a merged Next.js pull request from canary to a previous release branch such as next-16-2. 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.
The verbatim description from this skill’s front matter — the string an agent matches on to decide whether to load it.
canary, last pushed 28 August 2026.SKILL.md, not by matching a directory convention. 2 distinct layouts observed: .agents/skills/*/SKILL.md, skills/*/SKILL.md.h1 and no skipped levels:.claude-plugin/marketplace.json by Vercel, declaring 1 plugin. It is read for editorial metadata only — never as the skill index, which is always the repository tree.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.
Create the backport branch from the release branch:
git switch -c backport-<pr-number>-to-<target-branch> origin/<target-branch>After switching branches in this repo, run pnpm build-all before Next.js
integration tests unless the user explicitly limits the task to preparing the
cherry-pick or PR.
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.
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.
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.
/vercel/next.js.md, and each skill at its own .md URL.