mcpbeat Sign in

Backport Pr Agent Skill

> 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.

832 tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
141327
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/vercel/next.js --skill backport-pr

The instruction itself

5 sections, as written by the author

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, for example next-16-2.
  • If the target branch is not provided and cannot be inferred confidently from

the user's request, ask before mutating git state.

  • Treat the target branch as variable; do not hard-code next-16-2 except when

the user explicitly asks for it.

Workflow

  • 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.

  • 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> --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.

  • 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.

PR Shape

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.

Other skills for the same job

different authors, same section of the catalogue
MCP Builder
by anthropics
vendor ×13

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

30k tokens scripts
Changelog Generator
by frostant
×9

Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.

774 tokens
Finishing A Development Branch
by ZhanlinCui
×7

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup

1k tokens
MCP Builder
by JayZeeDesign
×7

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

37k tokens scripts
Vercel React Native Skills
by vercel-labs
vendor ×6

React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.

39k tokens
Vercel React Best Practices
by ratacat
×5

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

34k tokens
Next Best Practices
by vercel-labs
vendor ×4

Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling

20k tokens
Using Git Worktrees
by ZhanlinCui
×4

Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification

1k tokens

How to use it

Copy the folder

Take vercel/backport-pr from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.