$npx -y skills add vercel/next.js --skill create-prCreate Git branches, commits, pushes, and GitHub pull requests for Next.js. Use when the user asks to create a branch, commit current changes, open a PR or draft PR, publish a pull request, or recover from gh pr create / PR template issues. Covers .github/pull_request_template.md
| 1 | # Create PR |
| 2 | |
| 3 | Use this skill when turning local work into a GitHub pull request. |
| 4 | |
| 5 | ## Fork PRs vs Branch PRs |
| 6 | |
| 7 | Before writing a PR description, check whether this is a branch PR (the |
| 8 | branch lives in `vercel/next.js`) or a fork PR (an external contribution from |
| 9 | a fork). You may write full descriptions for branch PRs, but not for fork |
| 10 | PRs — inform the user, offer to review their description or provide technical |
| 11 | details, and give them the GitHub URL to create the PR themselves. See |
| 12 | "GitHub Pull Requests and Issues" in `AGENTS.md` for the full policy. |
| 13 | |
| 14 | ## Workflow |
| 15 | |
| 16 | 1. Inspect the current state before mutating Git: |
| 17 | |
| 18 | ```bash |
| 19 | git status --short |
| 20 | git branch --show-current |
| 21 | git diff -- <paths> |
| 22 | ``` |
| 23 | |
| 24 | Stage only files that belong to the requested change. Preserve unrelated |
| 25 | user changes. |
| 26 | |
| 27 | 2. Create or confirm the branch: |
| 28 | |
| 29 | ```bash |
| 30 | git switch -c codex/<short-topic> |
| 31 | ``` |
| 32 | |
| 33 | Use the `codex/` prefix unless the user asks for a different name. If a |
| 34 | `.git/*lock` or `Operation not permitted` error appears, rerun the same Git |
| 35 | command with sandbox escalation. Do not assume a branch namespace conflict |
| 36 | until checking refs with `git branch --list`, `git show-ref`, or |
| 37 | `git for-each-ref`. |
| 38 | |
| 39 | 3. Validate and commit: |
| 40 | |
| 41 | ```bash |
| 42 | git add <paths> |
| 43 | git diff --cached --check |
| 44 | git commit -m "<concise message>" |
| 45 | ``` |
| 46 | |
| 47 | Keep commit messages concise and do not add generated-tool or co-author |
| 48 | footers. |
| 49 | |
| 50 | 4. Push the branch: |
| 51 | |
| 52 | ```bash |
| 53 | git push -u origin <branch> |
| 54 | ``` |
| 55 | |
| 56 | 5. Create the PR as a draft unless the user explicitly asks otherwise: |
| 57 | |
| 58 | ```bash |
| 59 | gh pr create --draft --base canary --head <branch> --title "<title>" --body '<body>' |
| 60 | ``` |
| 61 | |
| 62 | For this repo, prefer `canary` as the base branch. If GitHub network access |
| 63 | fails in the sandbox, rerun with escalation. |
| 64 | |
| 65 | ## PR Body |
| 66 | |
| 67 | Use this PR body format: |
| 68 | |
| 69 | ```markdown |
| 70 | ## Summary |
| 71 | |
| 72 | <what changed and why> |
| 73 | |
| 74 | ## Verification |
| 75 | |
| 76 | - `<command that passed>` |
| 77 | - Not run: `<command>` (`<reason>`) |
| 78 | |
| 79 | <!-- NEXT_JS_LLM --> |
| 80 | ``` |
| 81 | |
| 82 | 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. |
| 83 | |
| 84 | A "why" should be included if the change isn't self-explanatory, or if the motivation is not clear from the diff. |
| 85 | Omitting the "why" should be used sparingly and only for small changes. |
| 86 | |
| 87 | 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. |
| 88 | |
| 89 | Use `--body` with this filled content. |
| 90 | |
| 91 | ## Recovery |
| 92 | |
| 93 | - If a PR may already exist, check before creating a duplicate: |
| 94 | |
| 95 | ```bash |
| 96 | gh pr view --head <branch> --json url,isDraft,title |
| 97 | ``` |
| 98 | |
| 99 | - If approval is denied for `gh pr create`, report that the branch is pushed |
| 100 | but the PR was not created, and provide the exact corrected command. |
| 101 | - After successful Codex app Git actions, include the appropriate final-response |
| 102 | directives for branch creation, staging, committing, pushing, and PR creation. |
| 103 | |
| 104 | ## Related Skills |
| 105 | |
| 106 | - `$pr-status-triage` - Analyze CI failures and PR review feedback after the PR exists. |
| 107 | - `$gh-stack` - Manage stacked branches and dependent pull requests. |