Creates a pull request for the current branch.
63
55%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Passed
No known issues
Optimize this skill with Tessl
npx tessl skill review --optimize ./.claude/skills/pr/SKILL.mdWhen asked to create a pull request, follow these steps:
Run git status. If any of the following conditions apply, stop and report the errors:
main)Check if this is a stacked PR:
git merge-base main HEAD to find the common ancestor with maingit log --oneline <merge-base>..HEAD to see commits since diverging from maingh pr list --head <parent-branch> to check if that branch has an open PRRun git log main..HEAD --oneline to see the commit history.
Get the diff for the review:
git diff <parent-branch>...HEAD to scope the diff to only this branch's changes.git diff main...HEAD.MANDATORY — DO NOT SKIP. This phase must run before any PR is created, regardless of how "simple", "mechanical", or "well-tested" the changes appear. Subtle bugs (e.g., semantic mismatches in API migrations) hide in exactly the changes that seem safe to skip. The only exception is docs-only changes as described below.
Before creating the PR, analyze the diff to decide which review subagents to launch. Not every PR needs every reviewer.
Categorize each changed file, then pick subagents based on which categories are present. A file belongs to exactly one category — evaluate in this order (first match wins):
.md, .txt, CHANGELOG, LICENSE, docs/, .claude/.github/workflows/, .github/actions/ — these often contain shell scripts with non-trivial logic.json (not package.json), .yml, .yaml, .eslintrc*, .prettierrc*, tsconfig*, Dockerfile, .editorconfig, .gitignore, .gitattributes, .nvmrc, .yarnrc**.test.ts, *.spec.ts, or under test/ directories.ts, .js, .mjs, .cjs, package.json, etc.)Then decide which subagents to launch:
eval/Function, capability passing, harden()/SES) → also launch Subagent 3 (Security)Prompt the agent to:
Prompt the agent to:
any, no enum, kebab-case files, @metamask/superstruct for runtime types, options bags for 3+ args, harden() usage, etc.)toStrictEqual for full objects, it.each for parameterized tests, concise verb-form titles)harden() callsPrompt the agent to:
Prompt the agent to:
If the review phase was skipped (docs-only), proceed directly to Phase 4.
Otherwise, after all launched subagents complete:
Run gh pr create to create a pull request. The PR body should include:
If this is a stacked PR, add --draft to create it as a draft PR.
Note the PR number from the created PR URL — it is needed for changelog entries. Proceed to Phase 5 before presenting results to the user.
MANDATORY — DO NOT SKIP. Analyze the diff and determine whether any changes are consumer-facing (i.e., affect the behavior or API of a published or private package).
no-changelog label to the PR via gh pr edit <number> --add-label no-changelog and skip the rest of this phase.Read the instructions in docs/contributing/updating-changelogs.md and follow them to the letter. In particular:
([#123](https://github.com/.../pull/123))).Commit the changelog updates to the current branch with the message "docs: Update changelogs" and push.
Present the PR URL and any relevant information to the user. If a review was performed, include the review summary.
d93dc41
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.