# Backport Pr > Lleva un pull request fusionado de Next.js desde canary a una rama de release anterior como next-16-2: localiza el commit, crea la rama, hace cherry-pick, valida y abre el PR. Fuente: https://skillsagentes.com/skills/vercel/next.js/backport-pr Markdown: https://skillsagentes.com/skills/vercel/next.js/backport-pr.md Repositorio: https://github.com/vercel/next.js Autor: vercel Licencia: MIT Actualizado: el mes pasado Coste de contexto: 102 tok instalada, 832 tok al activarse, 832 tok con todos los archivos del bundle Bundle: 1 archivo, 3 KB Permisos que pide: ninguno declarado ## Instalación Un skill son archivos markdown: los mismos archivos valen para cualquier agente y lo único que cambia es el directorio de destino, es decir la bandera `--agent`. Añade `-g` para instalarlo en todos los proyectos de la máquina. ```bash # Claude Code npx -y skills add vercel/next.js --skill backport-pr --agent claude-code # Cursor npx -y skills add vercel/next.js --skill backport-pr --agent cursor # Codex npx -y skills add vercel/next.js --skill backport-pr --agent codex # Gemini CLI npx -y skills add vercel/next.js --skill backport-pr --agent gemini # Windsurf npx -y skills add vercel/next.js --skill backport-pr --agent windsurf # Cline npx -y skills add vercel/next.js --skill backport-pr --agent cline ``` ## Qué hace - Lleva un pull request ya fusionado de Next.js desde canary a una rama de release anterior, como `next-16-2` - Localiza el commit del PR fusionado y crea la rama de backport desde la rama de destino - Hace el cherry-pick desde canary y valida el resultado - Abre el PR con la rama de release como base ## Cuándo usarla - Se pide hacer backport o cherry-pick de un número de PR a una versión anterior de Next.js ## Qué la activa - "Haz backport del PR 12345 a next-16-2" - "Cherry-pickea este PR a la rama de release anterior" ## Antes de instalar - Es un skill interno del repositorio de Next.js. ## Archivos - SKILL.md — 3 KB ## SKILL.md Reproducido tal cual desde vercel/next.js bajo MIT. Esta sección es el documento original y está en inglés. # 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: ```bash 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: ```bash git fetch origin canary:refs/remotes/origin/canary :refs/remotes/origin/ ``` 3. Identify the commit that landed the PR on `canary`: ```bash gh pr view --repo vercel/next.js --json number,title,state,url,mergeCommit,baseRefName,headRefName git log origin/canary --oneline --fixed-strings --grep="(#)" ``` 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: ```bash git switch -c backport--to- origin/ ``` 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: ```bash git cherry-pick -x ``` 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 `, not `canary`. Keep the PR as a draft unless the user explicitly asks otherwise. ## PR Shape Use a title like: ```text [backport] ``` Use a concise PR body: ```markdown Backports to ``. ``` ## 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. ## Dónde encaja - Categoría: [Herramientas para desarrolladores](https://skillsagentes.com/categorias/herramientas-desarrollo.md) — Skills que cambian cómo tu agente escribe, revisa y despliega código. - Creador: [vercel](https://skillsagentes.com/creators/vercel.md) — 36 skills en el directorio - [Todas las skills](https://skillsagentes.com/skills.md) - [Ranking de instalaciones](https://skillsagentes.com/ranking.md) ## Otras skills del mismo repositorio - [Next Cache Components Adoption](https://skillsagentes.com/skills/vercel/next.js/next-cache-components-adoption.md): Activa Cache Components en una app de Next.js y resuelve las rutas bloqueantes que aparecen. Úsalo para adoptar o migrar, activar el flag cacheComponents o decidir entre excluir rutas y arreglarlas. - [Next Cache Components Optimizer](https://skillsagentes.com/skills/vercel/next.js/next-cache-components-optimizer.md): Lleva una ruta de Next.js a navegación instantánea bajo Cache Components o PPR mediante un bucle agéntico: codifica el objetivo como un e2e instant() en rojo y lo trabaja hasta verde, ruta a ruta. - [Next Partial Prefetching Adoption](https://skillsagentes.com/skills/vercel/next.js/next-partial-prefetching-adoption.md): Activa Partial Prefetching en una app de Next.js y resuelve las insights que surgen: audita los Link con prefetch, activa partialPrefetching y opta por rutas con prefetch = 'partial'. - [Next Dev Loop](https://skillsagentes.com/skills/vercel/next.js/next-dev-loop.md): Verifica el comportamiento en runtime de Next.js tras editar código de la aplicación. Combina /_next/mcp, la visión de Next.js, con agent-browser, la del navegador. Requiere un next dev en marcha. - [Gh Stack](https://skillsagentes.com/skills/vercel/next.js/gh-stack.md): Gestiona PRs apilados y parte el trabajo en ramas revisables con gh-stack: creación, visualización, edición, push, envío, sincronización, rebase, merge y checkout. ## Skills relacionadas - [Authoring Skills](https://skillsagentes.com/skills/vercel/next.js/authoring-skills.md): Cómo crear y mantener skills de agente en .agents/skills/. Úsalo al crear un SKILL.md, escribir descripciones, elegir campos de frontmatter o decidir qué va en un skill y qué en AGENTS.md. - [Create Pr](https://skillsagentes.com/skills/vercel/next.js/create-pr.md): Crea ramas, commits, pushes y pull requests de GitHub para Next.js. Cubre la plantilla de PR, el formato de --body, las ramas codex/ y las directivas de git de la app Codex. - [Dce Edge](https://skillsagentes.com/skills/vercel/next.js/dce-edge.md): Patrones de require() seguros para eliminación de código muerto y restricciones del runtime edge. Úsalo al escribir require condicionales, proteger imports de Node o editar define-env-plugin.ts. - [Flags](https://skillsagentes.com/skills/vercel/next.js/flags.md): Cómo añadir o modificar flags experimentales de Next.js de principio a fin: tipo, esquema zod, inyección en build, paso de variables en runtime y elección entre ramificar o generar variantes. - [Gh Stack](https://skillsagentes.com/skills/vercel/next.js/gh-stack.md): Gestiona PRs apilados y parte el trabajo en ramas revisables con gh-stack: creación, visualización, edición, push, envío, sincronización, rebase, merge y checkout. --- Skills Agentes · [Índice de páginas en markdown](https://skillsagentes.com/sitemap.md) · [Inicio](https://skillsagentes.com/index.md)