backport-pr

bởi vercel

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…

npx skills add https://github.com/vercel/next.js --skill backport-pr

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

  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>
    

    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.

  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

Use a title like:

[backport] <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.

Thêm skills từ vercel

benchmark-sandbox
vercel
Chạy các kịch bản đánh giá vercel-plugin trong Vercel Sandboxes thay vì các bảng WezTerm cục bộ. Cung cấp các microVM tạm thời với Claude Code và plugin được cài đặt sẵn,…
official
emil-design-eng
vercel
Kỹ năng này mã hóa triết lý của Emil Kowalski về trau chuốt giao diện người dùng, thiết kế thành phần, quyết định hoạt ảnh và những chi tiết vô hình giúp phần mềm mang lại cảm giác tuyệt vời.
official
vercel-react-best-practices
vercel
Hướng dẫn tối ưu hiệu suất React và Next.js từ Vercel Engineering. Kỹ năng này nên được sử dụng khi viết, xem xét hoặc tái cấu trúc mã React/Next.js…
official
vercel-react-best-practices
vercel
Hướng dẫn tối ưu hiệu suất React và Next.js từ Vercel Engineering. Kỹ năng này nên được sử dụng khi viết, xem xét hoặc tái cấu trúc mã React/Next.js…
official
write-guide
vercel
Tạo một hướng dẫn kỹ thuật dạy một trường hợp sử dụng thực tế thông qua các ví dụ tiến dần. Các khái niệm chỉ được giới thiệu khi người đọc cần đến chúng.
official
release
vercel
Phát hành vercel-plugin — chạy các cổng, tăng phiên bản, tạo tạo phẩm, commit và push. Sử dụng khi được yêu cầu "phát hành", "ship", "tăng và push", hoặc "cắt một bản phát hành".
official
deepsec
vercel
Run DeepSec against a Vercel project checkout from dev3000. Use for one-click DeepSec setup, project context bootstrapping, bounded first-pass processing, and…
official
frontend-design
vercel
Tạo giao diện frontend chất lượng sản xuất, độc đáo với chất lượng thiết kế cao. Sử dụng kỹ năng này khi người dùng yêu cầu xây dựng các thành phần web, trang, tạo tác,…
official