
create-pr
✓ Official★ 140,355by vercel · part of vercel/next.js
Create 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, --body formatting, NEXT_JS_LLM_PR, codex/ branch names, and Codex app git directives.
This is the playbook your agent receives when the skill activates — you don't need to read it to use the skill, but it's here to audit before installing.
Create PR
Use this skill when turning local work into a GitHub pull request.
Workflow
-
Inspect the current state before mutating Git:
git status --short git branch --show-current git diff -- <paths>Stage only files that belong to the requested change. Preserve unrelated user changes.
-
Create or confirm the branch:
git switch -c codex/<short-topic>Use the
codex/prefix unless the user asks for a different name. If a.git/*lockorOperation not permittederror appears, rerun the same Git command with sandbox escalation. Do not assume a branch namespace conflict until checking refs withgit branch --list,git show-ref, orgit for-each-ref. -
Validate and commit:
git add <paths> git diff --cached --check git commit -m "<concise message>"Keep commit messages concise and do not add generated-tool or co-author footers.
-
Push the branch:
git push -u origin <branch> -
Create the PR as a draft unless the user explicitly asks otherwise:
gh pr create --draft --base canary --head <branch> --title "<title>" --body '<body>'For this repo, prefer
canaryas the base branch. If GitHub network access fails in the sandbox, rerun with escalation.
PR Body
Use this PR body format:
## Summary
<what changed and why>
## Verification
- `<command that passed>`
- Not run: `<command>` (`<reason>`)
<!-- NEXT_JS_LLM_PR -->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 sparringly 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:
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.
npx skills add https://github.com/vercel/next.js --skill create-prRun this in your project — your agent picks the skill up automatically.
No common issues documented yet. If you hit a problem, the repository's GitHub Issues page is the best place to look.
Licensed under MIT— you can use, modify, and redistribute it under that license's terms.
View the full license file on GitHub →