All skills
antfu avatar

/antfu-create-pr

@1ef4114 official
by Anthony Fuantfu/skills5.9k stars
335

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.

Use this Skill: https://skilld.dev/gh/antfu/skills/antfu-create-pr

This session only. Nothing lands on disk.

referencesvisual-evidence.md

≈948 tokens on demand. Your agent reads this file only when SKILL.md points to it.

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

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

  2. Give each state a stable id and readable title, for example settings-connection / Settings / Connection.

  3. 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"
  4. 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.

  5. Use identical viewport, theme, locale, fixture data, and readiness condition for both revisions. Write outputs to an ignored directory such as .pr-shots/base/<id>.png and .pr-shots/head/<id>.png.

  6. Look at every image. 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.

  7. Record before: absent for a newly added state and after: removed for a deleted one.

Remove the temporary worktree after the PR is created: git worktree remove /tmp/pr-base.

Attach

GitHub CLI 2.99+ uploads local images and videos with --attach 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 before](.pr-shots/base/settings-connection.png) | ![Settings / Connection after](.pr-shots/head/settings-connection.png) |
| 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.png
  • Paths in --attach must match the paths in the body exactly; unmatched files are appended to the end of the body.
  • gh pr edit --attach and gh pr comment --attach work the same way for follow-ups.
  • A video reference (![](path.mp4)) 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 an older gh, upload each file to https://uploads.github.com/user-attachments/assets with the gh auth token bearer token and paste the returned https://github.com/user-attachments/assets/... URL into the body. The airi upload-github-attachment script wraps this flow. If neither route works, 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 -->

Source: SKILL.md on GitHub

1 warning1d3 checks · Risk SAFE
  • Gen Agent Trust Hub1d

    The skill provides a structured workflow for creating GitHub pull requests using git and the GitHub CLI. It includes safety rules to prevent secret leakage and follows PR best practices. No malicious patterns were detected.

  • Socket1d

    No alerts

  • Snyk1d

    Risk: MEDIUM · 1 issue

Signed by skilld at 1ef4114. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 days ago.

Activeupdated 2 days ago
metadata
{
  "author": "Anthony Fu",
  "version": "2026.09.30"
}

README badge

README badge for antfu/skills/antfu-create-pr