# Create Pr > 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. Fuente: https://skillsagentes.com/skills/vercel/next.js/create-pr Markdown: https://skillsagentes.com/skills/vercel/next.js/create-pr.md Repositorio: https://github.com/vercel/next.js Autor: vercel Licencia: MIT Actualizado: el mes pasado Coste de contexto: 88 tok instalada, 944 tok al activarse, 944 tok con todos los archivos del bundle Bundle: 1 archivo, 4 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 create-pr --agent claude-code # Cursor npx -y skills add vercel/next.js --skill create-pr --agent cursor # Codex npx -y skills add vercel/next.js --skill create-pr --agent codex # Gemini CLI npx -y skills add vercel/next.js --skill create-pr --agent gemini # Windsurf npx -y skills add vercel/next.js --skill create-pr --agent windsurf # Cline npx -y skills add vercel/next.js --skill create-pr --agent cline ``` ## Qué hace - Crea ramas, commits, pushes y pull requests de GitHub para Next.js - Distingue entre PR desde fork y PR desde rama del propio repositorio - Cubre la plantilla `.github/pull_request_template.md` y el formato del `--body` - Incluye la convención de ramas `codex/` y las directivas de git de la app Codex - Trae pasos de verificación y de recuperación cuando `gh pr create` falla ## Cuándo usarla - Crear una rama, hacer commit de los cambios actuales o abrir un PR o un borrador de PR - Recuperarse de problemas con `gh pr create` o con la plantilla de PR ## Qué la activa - "Abre un PR con estos cambios" - "Crea una rama y haz commit" - "Me falla gh pr create, ¿qué hago?" ## Antes de instalar - Es un skill interno del repositorio de Next.js y necesita el CLI `gh`. ## Archivos - SKILL.md — 4 KB ## SKILL.md Reproducido tal cual desde vercel/next.js bajo MIT. Esta sección es el documento original y está en inglés. # Create PR Use this skill when turning local work into a GitHub pull request. ## Fork PRs vs Branch PRs Before writing a PR description, check whether this is a branch PR (the branch lives in `vercel/next.js`) or a fork PR (an external contribution from a fork). You may write full descriptions for branch PRs, but not for fork PRs — inform the user, offer to review their description or provide technical details, and give them the GitHub URL to create the PR themselves. See "GitHub Pull Requests and Issues" in `AGENTS.md` for the full policy. ## Workflow 1. Inspect the current state before mutating Git: ```bash git status --short git branch --show-current git diff -- ``` Stage only files that belong to the requested change. Preserve unrelated user changes. 2. Create or confirm the branch: ```bash git switch -c codex/ ``` Use the `codex/` prefix unless the user asks for a different name. If a `.git/*lock` or `Operation not permitted` error appears, rerun the same Git command with sandbox escalation. Do not assume a branch namespace conflict until checking refs with `git branch --list`, `git show-ref`, or `git for-each-ref`. 3. Validate and commit: ```bash git add git diff --cached --check git commit -m "" ``` Keep commit messages concise and do not add generated-tool or co-author footers. 4. Push the branch: ```bash git push -u origin ``` 5. Create the PR as a draft unless the user explicitly asks otherwise: ```bash gh pr create --draft --base canary --head --title "" --body '<body>' ``` For this repo, prefer `canary` as the base branch. If GitHub network access fails in the sandbox, rerun with escalation. ## PR Body Use this PR body format: ```markdown ## Summary <what changed and why> ## Verification - `<command that passed>` - Not run: `<command>` (`<reason>`) <!-- NEXT_JS_LLM --> ``` The "what" should be explained from the end-user perspective or developer perspective. Only include implementation changes if they're not obvious from the diff. A "why" should be included if the change isn't self-explanatory, or if the motivation is not clear from the diff. Omitting the "why" should be used sparingly and only for small changes. Do not include trivial verification commands that CI already covers (e.g. `pnpm run build`), but do include any manual verification steps. If the PR changes a test, you don't need to repeat the command to run that test. But if you used an existing test to validate some behavior didn't change, include that test. Use `--body` with this filled content. ## Recovery - If a PR may already exist, check before creating a duplicate: ```bash gh pr view --head <branch> --json url,isDraft,title ``` - If approval is denied for `gh pr create`, report that the branch is pushed but the PR was not created, and provide the exact corrected command. - After successful Codex app Git actions, include the appropriate final-response directives for branch creation, staging, committing, pushing, and PR creation. ## Related Skills - `$pr-status-triage` - Analyze CI failures and PR review feedback after the PR exists. - `$gh-stack` - Manage stacked branches and dependent pull requests. ## 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. - [Backport Pr](https://skillsagentes.com/skills/vercel/next.js/backport-pr.md): 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. - [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)