Agent skill

Create Pull Request

by antfu in antfu/skills

Publishes a GitHub PR for the checked-out branch with a Conventional Commits style title, a description backed by commands run, and screenshots when the UI changed.

MITAuto-check passedDevelopment

Install Create Pull Request

skills CLI
$ npx skills add antfu/skills --skill antfu-create-pr -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install antfu/skills antfu-create-pr --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/antfu/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/antfu-create-pr .claude/skills/antfu-create-pr && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
antfu-create-pr
GitHub stars
6k
Token cost
~1.4k tokens
SKILL.md length
728 words
Files
5 (incl. scripts, references)
Skills in repo
2
Repo updated
First seen
Licence
MIT

At a glance

Publishes a GitHub PR for the checked-out branch with a Conventional Commits style title, a description backed by commands run, and screenshots when the UI changed.

  • Works in 10 steps: Inspect the repo: git status, current… → Compute the merge base against the… → Read the full diff. Separate runtime… → …
  • Opening a pull request from the current branch
  • SKILL.md covers Workflow, Title, Commits and Body, plus 1 more section
  • Runs Shell scripts from its folder; calls git and gh

What it does

The agent inspects the repo (status, branch, remotes, default branch, PR templates and any `AGENTS.md` or `CONTRIBUTING.md` rules), computes the merge base against the target branch, and reads the full diff, separating runtime code from generated files, lockfiles and snapshots. It classifies the PR as a feature, fix, refactor, chore or docs change, runs the checks that match what changed and records the exact commands and results. For stacked branches it targets the unmerged parent and describes only this PR's own changes.

The body is written for a reviewer who has only the description: the changed behavior and why, not a file list, kept in proportion to the change, with a required Summary section and optional extras such as tables and diagrams. The title uses Conventional Commits in lowercase imperative form under about 70 characters. UI changes get before and after evidence, the body goes into a temporary file, and `gh pr create` runs with `--draft` when checks are still running. The agent then verifies the created PR and handles review comments by fixing, replying with evidence and resolving threads. The excerpt is truncated.

When your agent uses it

  • Opening a pull request from the current branch
  • Writing a PR description a reviewer can follow without reading the whole diff
  • Adding before and after screenshots to a UI change PR
  • Preparing a draft PR while checks are still running

Example prompts

  • “Open a PR for this branch with a Conventional Commits title.”
  • “Create a draft PR for the new retry logic and include the test commands I ran.”
  • “Publish this UI fix as a PR with before and after screenshots.”

Requirements

  • GitHub CLI (`gh`) authenticated for the repository
  • A branch that can be pushed to a remote

Workflow steps

10 steps, taken from the first numbered list in SKILL.md.

  1. Inspect the repo: git status, current branch, remotes, default branch, .github/PULL_REQUEST_TEMPLATE*, and AGENTS.md / CONTRIBUTING.md for…
  2. Compute the merge base against the target branch and record the exact base...head range the PR publishes. If the branch is stacked on…
  3. Read the full diff. Separate runtime code from generated files, lockfiles, and snapshots. Trace changed code to its entry points, callers…
  4. Classify the PR (feature, fix, refactor, chore, docs) and decide which optional body sections earn their place. See pr-body.
  5. Run the checks that match the changed surfaces (focused tests, typecheck, lint). Record the exact commands and results.
  6. If the diff changes user-visible UI, capture before/after evidence. See visual-evidence.
  7. Review the commit history and reshape it into atomic Conventional Commits. See Commits.
  8. Write the body to a temporary file. Push the branch. Create the PR with gh pr create --title ... --body-file ... (add --attach for each…
  9. Open the created PR and verify title, base, head, rendered tables, diagrams, and images.
  10. Address review comments: fix each confirmed issue, run focused checks, push, reply with evidence, and resolve the thread.

What it can do on your machine

Read from SKILL.md and the folder at commit feb0f3a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • git
    • gh

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git and gh, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Create Pull Request loads about 1.4k tokens when it runs, and up to ~3.6k if it reads all its reference files. Until then it costs about 62 tokens; SKILL.md has 728 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~62
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from antfu/skills at commit feb0f3a, republished under its MIT licence (© antfu). 728 words, ~1,406 tokens.

Download SKILL.mdSave it as .claude/skills/antfu-create-pr/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
antfu-create-pr
description
Create a reviewable GitHub pull request from the current branch with a Conventional Commits title, a concise evidence-based body, and before/after screenshots for UI changes. Use when asked to open, create, publish, or prepare a PR.
metadata.author
Anthony Fu
metadata.version
2026.10.09

Create Pull Request

Open a PR that a reviewer can understand from the body alone. Explain the changed behavior and why, not the list of changed files. Keep the body proportional to the change: a one-line fix gets a few sentences, a cross-module feature gets tables and diagrams.

Workflow

  1. Inspect the repo: git status, current branch, remotes, default branch, .github/PULL_REQUEST_TEMPLATE*, and AGENTS.md / CONTRIBUTING.md for PR rules.
  2. Compute the merge base against the target branch and record the exact base...head range the PR publishes. If the branch is stacked on another unmerged branch, target that branch and describe only this PR's own changes.
  3. Read the full diff. Separate runtime code from generated files, lockfiles, and snapshots. Trace changed code to its entry points, callers, and external boundaries so architecture claims are backed by file paths or symbols.
  4. Classify the PR (feature, fix, refactor, chore, docs) and decide which optional body sections earn their place. See pr-body.
  5. Run the checks that match the changed surfaces (focused tests, typecheck, lint). Record the exact commands and results.
  6. If the diff changes user-visible UI, capture before/after evidence. See visual-evidence.
  7. Review the commit history and reshape it into atomic Conventional Commits. See Commits.
  8. Write the body to a temporary file. Push the branch. Create the PR with gh pr create --title ... --body-file ... (add --attach for each screenshot). Use --draft when checks are still running or the work is not review-ready.
  9. Open the created PR and verify title, base, head, rendered tables, diagrams, and images.
  10. Address review comments: fix each confirmed issue, run focused checks, push, reply with evidence, and resolve the thread.

Title

Use Conventional Commits, matching how the repo already writes commit messages:

text
feat(scope): add retry to upload client
fix(scope): avoid double submit on enter
refactor: extract diff parsing from cli
chore(deps): update vite to v8
docs: clarify worktree setup
  • Lowercase, imperative, no trailing period, under ~70 characters.
  • Scope is the package, module, or feature name the repo already uses. Omit it when the change is repo-wide.
  • Squash-merge repos turn the title into the commit message; write it as the commit you want in history.

Commits

Each commit does one logical thing and uses a Conventional Commits message. A reviewer should be able to read git log --oneline as the story of the change and review commit by commit.

text
# Good: each commit is self-contained
feat(api): add task creation endpoint with validation
feat(ui): add task creation form component
feat(ui): connect form to api and add loading state
test(tasks): cover task creation (unit + integration)

# Bad: everything mixed together
feat: add task feature, fix sidebar, update deps, refactor utils
  • Keep unrelated fixes, dependency bumps, and drive-by refactors out of the branch; open separate PRs for them.
  • Before pushing, review the history and split or squash local commits (git rebase -i <base>) until each one stands alone and builds.
  • Do not rewrite commits that are already pushed and under review; add new commits instead.
Show full SKILL.md (307 more words)Show less

Body

Required in every PR:

  • ## Summary: the problem or capability first, then what changed and why this approach. Mention if the PR is stacked and on what.
  • Linked issues: closes #123 / fixes #123 / refs #123 so GitHub links and auto-closes.
  • ## Verification: exact commands run and their results, plus anything left unverified.

Optional, only when it helps the reviewer:

  • ## Change map: table of module, before, after, reason. Use for changes across several modules or ownership boundaries. Never a raw file list.
  • ## Architecture and behavior: a Mermaid flow, sequence, or state diagram when ordering, async work, or state transitions changed. For a fix, pair a Before and After diagram at the same abstraction level.
  • ## Boundaries and risks: table of invariant, failure mode, protection, evidence. Use when there are real failure modes, migrations, or external effects.
  • ## Visual changes: before/after image table for UI changes.
  • ## Rollout and follow-up: migrations, feature flags, known gaps. State whether a gap blocks merge.

If the repo has a PR template, keep its headings and fill them; add sections above only where the template leaves room.

Rules

  • Say what is verified, what is assumed, and what is not verified. Do not write "safe", "fixed", or "backward compatible" without pointing at the evidence.
  • Green CI proves only the checks CI runs. Focused tests prove only the behavior they cover.
  • Do not describe inherited changes from a parent branch as this PR's changes.
  • Use plain hyphens; never em dashes (U+2014) or en dashes (U+2013).
  • No filler ("This PR aims to...", "comprehensive", "robust"). Start sentences with the fact.
  • Do not paste tokens, secrets, user records, or full payloads into the body.
  • Do not commit screenshots or other PR-only artifacts to the repo; attach them with gh --attach.
  • If the PR was written with the help of an agent, say so in one line at the end of the body.

© antfu, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (scripts, references) in skills/antfu-create-pr of antfu/skills.

  • SKILL.md
  • README.md
  • references/pr-body.md
  • references/visual-evidence.md
  • scripts/upload-github-attachment.sh

Open the folder on GitHubat commit feb0f3a

Compare with similar skills

Create Pull Request next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Create Pull Request compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Create Pull Request this skillantfu/skills6k—~1.4kAutomated safety check: PassMIT
React Router Pull Request Creatorremix-run/react-router57k—~2.5kAutomated safety check: PassMIT
Verdaccio Pull Request Workflowverdaccio/verdaccio18k—~1.9kAutomated safety check: PassMIT
Draft Pull Request Creatorwordpress-mobile/WordPress-Android3.2k—~881Automated safety check: NotesGPL-2.0
Submit PRtisfeng/Easydict15k—~595Automated safety check: PassGPL-3.0
Create PREmiyaaaaa/HiveMind1.1k—~1.7kAutomated safety check: PassCustom licence

Similar skills

  • React Router Pull Request Creator

    remix-run/react-router

    Packages finished React Router work into a draft pull request: branch, commit, push, a written PR body and the right GitHub labels.

    57k GitHub stars~2.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Takes a change through a verdaccio pull request: branch, local checks, changeset, title and body, labels, CI and review rounds, and ports to other release lines.

    18k GitHub stars~1.9k tokensUpdated today
    DevelopmentAuto-check passed
  • Draft Pull Request Creator

    wordpress-mobile/WordPress-Android

    Commits and pushes current changes, writes a pull request title and body from the branch history and template, and opens a draft PR on GitHub after you approve it.

    3.2k GitHub stars~881 tokensUpdated today
    DevelopmentAuto-check: notes
  • Submit PR

    tisfeng/Easydict

    创建或复用当前 checkout 已提交变更的 GitHub PR,必要时推送任务分支。PR 审查使用 review-pr;仅本地提交使用 git-commit。

    15k GitHub stars~595 tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Create PR

    Emiyaaaaa/HiveMind

    Create a GitHub pull request with gh pr create. An agent skill from Emiyaaaaa/HiveMind.

    1.1k GitHub stars~1.7k tokensUpdated 3 days ago
    DevelopmentAuto-check passed
  • Commit And PR

    389ds/389-ds-base

    Commit and open a PR the 389-ds-base way — "Issue NNNN - summary" subject, Bug Description/Fix Description body, Fixes:/Relates: trailer, AI-attribution trailer, and squash-merge etiquette.

    294 GitHub stars~1k tokensUpdated today
    DevelopmentAuto-check passed

More from antfu/skills

  • Reference for Nitro v3, the server toolkit behind Nuxt: file routing, route rules, caching, storage, tasks, websockets and deployment presets.

    6k GitHub stars~948 tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Create Pull Request

What does Create Pull Request do?

Publishes a GitHub PR for the checked-out branch with a Conventional Commits style title, a description backed by commands run, and screenshots when the UI changed. md` rules), computes the merge base against the target branch, and reads the full diff, separating runtime code from generated files, lockfiles and snapshots. It classifies the PR as a feature, fix, refactor, chore or docs change, runs the checks that match what changed and records the exact commands and results.

When should I use Create Pull Request?

Create Pull Request fits situations like: opening a pull request from the current branch; writing a PR description a reviewer can follow without reading the whole diff; adding before and after screenshots to a UI change PR; preparing a draft PR while checks are still running.

How do I install Create Pull Request in Claude Code?

Run `npx skills add antfu/skills --skill antfu-create-pr -a claude-code`. Or copy the skill folder (skills/antfu-create-pr in antfu/skills) into .claude/skills/antfu-create-pr in your project. Claude Code loads it when a task matches its description.

How do I install Create Pull Request in Codex?

Run `npx skills add antfu/skills --skill antfu-create-pr -a codex`. Or copy the skill folder (skills/antfu-create-pr in antfu/skills) into .agents/skills/antfu-create-pr in your project. Codex loads it when a task matches its description.

Can I use Create Pull Request in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add antfu/skills --skill antfu-create-pr -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/antfu-create-pr, .gemini/skills/antfu-create-pr, .github/skills/antfu-create-pr and .opencode/skills/antfu-create-pr in your project.

What does Create Pull Request need to run?

Going by SKILL.md and its folder, Create Pull Request needs a shell for the scripts in its folder and the command-line tools its instructions call (git and gh). Our summary lists: GitHub CLI (`gh`) authenticated for the repository; A branch that can be pushed to a remote.

Does Create Pull Request access the network?

SKILL.md contains no URLs. Its commands use git and gh, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Create Pull Request safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Create Pull Request use?

Create Pull Request is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Create Pull Request use?

About 1.4k tokens (SKILL.md is roughly 5.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.2k tokens, read only when the agent opens those files.

What are the alternatives to Create Pull Request?

Skills that share tags, products or a category with Create Pull Request: React Router Pull Request Creator (remix-run/react-router, 57k stars), Verdaccio Pull Request Workflow (verdaccio/verdaccio, 18k stars), Draft Pull Request Creator (wordpress-mobile/WordPress-Android, 3.2k stars) and Submit PR (tisfeng/Easydict, 15k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Create Pull Request?

antfu (a GitHub user) maintains it in antfu/skills, which has 5,950 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 9, 2026.

Source: antfu/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.