Skip to main content
skill CX Codex

antfu-create-pr — Claude Code skill: reviewable PRs, Conventional

Turns the current branch into a reviewable GitHub pull request: Conventional Commits title, evidence-based body, before/after screenshots for UI changes.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add antfu/skills --skill antfu-create-pr -a claude-code
Open on GitHub

What antfu-create-pr does

The skill walks the agent through ten steps. It inspects the repo and any PR rules in AGENTS.md or CONTRIBUTING.md, computes the merge base and the exact base...head range, then reads the full diff and separates runtime code from generated files, lockfiles and snapshots. The change is classified as feature, fix, refactor, chore or docs, focused checks are run against the touched surfaces, and the commit history is reshaped into atomic Conventional Commits.

Every PR body gets ## Summary and ## Verification with the exact commands and their results. Everything else is optional and earns its place only when it helps a reviewer: a module-by-module change table, Mermaid diagrams for call order or state transitions, a risks table, before/after images. If the repo ships a PR template, its headings stay and the extra sections fill the gaps.

The skill bans words like "safe", "fixed" or "backward compatible" unless they point at evidence, and it asks the agent to mark what is verified, what is assumed and what is not. Screenshots never get committed; they are attached with gh --attach. You need gh with GitHub auth configured, or the create step fails.

What it helps with

  • write a PR body a reviewer can follow without reading the diff
  • bring the title and commits in line with Conventional Commits
  • keep lockfiles and generated files out of the described change
  • attach before/after screenshots for UI work
  • record which checks ran and what they returned

Example prompts for the agent

  • Prepare a PR from the current branch following the repo rules
  • Open a pull request with a Conventional Commits title and a body listing the checks
  • Create the PR for this branch and attach before/after screenshots for the UI change

How to install antfu-create-pr

1Skills CLI (Vercel)

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

2Manually: put the files in place

~/.claude/skills/antfu-create-pr/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/antfu-create-pr/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about antfu-create-pr

How do I install antfu-create-pr in Claude?

Run npx skills add antfu/skills --skill antfu-create-pr -a claude-code. The skill lands in ~/.claude/skills/antfu-create-pr/SKILL.md.

What does antfu-create-pr do?

It guides the agent through opening a pull request: repo inspection, diff reading, focused checks, commit reshaping and a body backed by evidence.

How is it different from plain gh pr create?

It enforces structure: required Summary and Verification sections, no unbacked safety claims, and screenshots attached with gh --attach instead of committed.

Source text

SKILL.md · MIT
---
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
  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](references/pr-body.md).
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](references/visual-evidence.md).
7. Review the commit history and reshape it into atomic Conventional Commits. See [Commits](#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.

## 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.

© Anthony Fu · MIT · antfu/skills

Similar skills

All skills for Git and GitHub →

From the same set11

The whole set →
vue This skill guides agents through Vue 3 Composition API, script setup, and reactivity. Use it when writing Vue SFCs or built-in component flows. CX Codex +1 35,800installs nuxt This skill equips your AI agent with Nuxt 5 knowledge: server-side rendering, file-based routing, auto-imports, and Nitro v3 deployment. Use it when building Nuxt apps, server routes, useFetch calls, middleware, or hybrid rendering. CX Codex +1 24,100installs pnpm Skill for working with pnpm, a Node.js package manager with strict dependency resolution. Use it when your project relies on workspaces, version catalogs, patches, or dependency overrides. CX Codex +1 22,400installs pinia Pinia skill adds reference documentation to Claude Code for the official Vue state management library. Use it when defining stores, managing state, getters, and actions in Vue apps. CX Codex +1 19,700installs antfu Hands your agent Anthony Fu's rules for JavaScript and TypeScript work: file layout, ESLint, Knip, package publishing. Useful when starting a project or wiring a monorepo. CX Codex +1 16,900installs unocss A skill that gives the agent reference material on UnoCSS configuration, rules, shortcuts and presets. Useful when setting up UnoCSS or reusing Tailwind knowledge in it. CX Codex +1 16,100installs vitepress A VitePress skill that helps an agent configure the site, extend the theme and write Markdown with Vue components. CX Codex +1 11,800installs nitro A skill with Nitro v3 references: file-based routing, route rules, caching, storage and deployment presets. Use it when the agent edits nitro.config or writes H3 handlers. CX Codex +1 2,600installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor