Antfu Create Pr
Anthony FuCommunityCreated by Anthony Fu
- Skill
- Workflow
- Software development
- MIT
- Low risk
- Has scripts
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured workflow for generating pull requests that prioritize reviewer clarity. It emphasizes evidence-based descriptions, atomic commits, and visual verification for UI changes. By following this process, developers can ensure that PRs are self-contained, well-documented, and easy to evaluate without requiring external context.
What it does
- Analyzes repository state and PR rules to prepare documentation.
- Generates Conventional Commits titles and structures atomic commit histories.
- Captures before/after visual evidence for UI-related changes.
- Automates the creation of pull requests via the GitHub CLI.
- Provides templates for summarizing changes, verification steps, and architectural diagrams.
- Ensures PR bodies include necessary context like linked issues and verification commands.
When to use it
- When you need to open, create, or publish a pull request.
- When a change requires clear evidence of its impact or behavior.
- When working on UI changes that benefit from visual before/after comparisons.
- When you want to ensure your PR history is clean and easy for reviewers to follow.
Advantages
- Reduces reviewer friction by providing clear, evidence-backed explanations.
- Standardizes PR structure and commit messaging across the repository.
- Ensures visual changes are documented without cluttering the repository with image files.
- Promotes atomic, logical commit histories that tell the story of the change.
Usage examples
- “Open a pull request for my current branch.”
- The agent inspects the repository, runs necessary checks, captures visual evidence if applicable, and creates a draft PR with a structured, evidence-based description.
- “Prepare a PR for the new feature I just finished.”
- The agent formats the commit history into atomic Conventional Commits and generates a PR body containing a summary, verification steps, and relevant diagrams.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/antfu/antfu-create-pr/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip antfu-create-pr.zip -d .agents/skills
Documentation by Anthony Fu
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
Inspect the repo:
git status, current branch, remotes, default branch,.github/PULL_REQUEST_TEMPLATE*, andAGENTS.md/CONTRIBUTING.mdfor PR rules.Compute the merge base against the target branch and record the exact
base...headrange the PR publishes. If the branch is stacked on another unmerged branch, target that branch and describe only this PR's own changes.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.
Classify the PR (feature, fix, refactor, chore, docs) and decide which optional body sections earn their place. See pr-body.
Run the checks that match the changed surfaces (focused tests, typecheck, lint). Record the exact commands and results.
If the diff changes user-visible UI, capture before/after evidence. See visual-evidence.
Review the commit history and reshape it into atomic Conventional Commits. See Commits.
Write the body to a temporary file. Push the branch. Create the PR with
gh pr create --title ... --body-file ...(add--attachfor each screenshot; newerghcan upload local images and videos from the CLI, see Attaching files with GitHub CLI). Use--draftwhen checks are still running or the work is not review-ready.Open the created PR and verify title, base, head, rendered tables, diagrams, and images.
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:
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 setupLowercase, 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.
# 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 utilsKeep 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 #123so GitHub links and auto-closes.## Verification: exact commands run and their results, plus anything left unverified. Show proof matched to the change type (bug: same input before and after; perf: same workload measured both sides; CLI: real output). See Evidence by change type.
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 aBeforeandAfterdiagram 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(supported by newergh, no manual upload needed).A description conveys belief, not proof. Show the change working instead of only saying it works.
"Before" is what is live (base branch or production), never a faked revert. Check every capture; agents can screenshot the wrong page. Use demo or sanitized data only.
Security fixes: keep the description short and delay exploit details until release.
If the PR was written with the help of an agent, say so in one line at the end of the body: what the human contributed (gave the task, wrote the spec, shaped the solution) and whether they have reviewed the diff yet. If not, the reviewer is the first human to look.
Credits
Evidence-by-type, honesty rules, and review-status disclosure are adapted from Hugo Richard's What my pull requests look like now.
Files
- ATTRIBUTION.mdAdded by AutoGineer922 B
- LICENSELicence file added by AutoGineer1.1 KiB
- README.md1.4 KiB
- SKILL.md6.6 KiB
- references/pr-body.md5.6 KiB
- references/visual-evidence.md4.7 KiB
- scripts/upload-github-attachment.shScript2.6 KiB
references/visual-evidence.md
name: visual-evidence description: Capture before/after screenshots of user-visible UI changes from the merge base and the PR head, then attach them to the PR with gh --attach without committing images to the repo.
Visual Evidence
Every PR that changes what a user sees ships a before/after pair per affected state. Screenshots live in GitHub's user-attachments storage, never in the repository.
Capture
List every affected surface: page, route, dialog, component, responsive breakpoint, theme, locale. A shared primitive or global style change needs several consumers, not one representative page.
Give each state a stable id and readable title, for example
settings-connection/Settings / Connection.Check out the merge base in a detached temporary worktree so the working branch is untouched:
base=$(git merge-base origin/main HEAD) git worktree add --detach /tmp/pr-base "$base"Capture the same states from both revisions with whatever the repo already has: Playwright, Storybook / Histoire stories, Vishot,
agent-browser screenshot, or the app's own dev server plus a browser. Prefer an existing story or e2e scenario over an ad hoc route.Use identical viewport, theme, locale, fixture data, and readiness condition for both revisions. Use demo or sanitized data only, never real user content. Write outputs to an ignored directory such as
.pr-shots/base/<id>.pngand.pr-shots/head/<id>.png.Look at every image. Agents can confidently capture the wrong page. Reject blank, loading, error, or unstable captures unless that state is the subject of the change. A failed capture blocks the PR; record the reason instead of dropping the state.
Record
before: absentfor a newly added state andafter: removedfor a deleted one.Run the exact same capture command for both revisions. When the setup is not obvious from the images, add the command and a short manifest (
id,title,viewport,before/afterrevisions) under the## Visual changestable so a reviewer can reproduce it.
Remove the temporary worktree after the PR is created: git worktree remove /tmp/pr-base.
Attach
Newer GitHub CLI (2.99+) can attach files directly from the command line: it uploads local images and videos with --attach (docs) and rewrites matching local paths in the body to the uploaded URL. Write the body with ordinary local paths, then pass each file:
## Visual changes
| Before | After |
| --- | --- |
|  |  |
| Settings / Connection, 1440x900, dark | Settings / Connection, 1440x900, dark |gh pr create \
--title "fix(settings): keep connection form visible on narrow widths" \
--body-file /tmp/pr-body.md \
--attach .pr-shots/base/settings-connection.png \
--attach .pr-shots/head/settings-connection.pngPaths in
--attachmust match the paths in the body exactly; unmatched files are appended to the end of the body.gh pr edit --attachandgh pr comment --attachwork the same way for follow-ups.A video reference (
) alone in its paragraph renders as a player.Attaching requires push access to the repo. Only image and media types are accepted.
After creating the PR, open it and confirm every image renders and matches its label. Do not probe the asset URLs with GET/HEAD; anonymous requests can return 404 while the image still renders inside GitHub.
Fallback
On a gh without --attach, upload each file with the bundled script and paste the returned URL into the body:
url=$(scripts/upload-github-attachment.sh .pr-shots/head/settings-connection.png)
# -> https://github.com/user-attachments/assets/...Pass
--repo OWNER/REPOwhen the current directory does not resolve to the target repository.Auth comes from
gh auth token, orGH_TOKEN/GITHUB_TOKENwhen no interactive session exists. The script never prints the token.The upload endpoint is undocumented. Treat a rejected upload as blocking: stop and report the local paths instead of committing images.
<!-- Source references: - https://docs.github.com/en/github-cli/github-cli/attaching-files-with-github-cli - https://github.com/moeru-ai/airi/blob/main/.agents/skills/create-pr/SKILL.md - https://github.com/moeru-ai/airi/blob/main/.agents/skills/upload-github-attachment/SKILL.md - https://github.com/antfu/pulls.review/pull/76 - https://island94.org/2026/08/programmatically-upload-attachments-to-github-issues-pull-requests-comments - https://hugorcd.com/writing/what-my-pull-requests-look-like-now (Hugo Richard) -->
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Security
What our scanner noticed· Low risk
- Scripts that your agent may run
This skill includes scripts that your agent may run. Read them before you use it.
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- Anthony Fu
- Publisher
- Anthony Fu (Community)
- Source
- antfu/skills · skills/antfu-create-pr · commit f63e9ec
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE.md)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Anthony Fu.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download antfu-create-pr.zip