Streamlines PR creation with automated formatting, rebasing on main, and safety checks for Swift projects.
Install
mkdir -p .claude/skills/pr-adamayoung && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/17328" && unzip -o skill.zip -d .claude/skills/pr-adamayoung && rm skill.zipInstalls to .claude/skills/pr-adamayoung
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Create a pull requestKey capabilities
- →Format code using `/format`
- →Commit all outstanding work before PR creation
- →Rebase the feature branch onto `origin/main`
- →Run pre-PR gate checks (e.g., `make ci`)
- →Spawn `code-reviewer` agent for code review
- →Generate PR title with gitmoji prefix and fill PR body skeleton
How it works
The skill automates PR creation by formatting code, committing changes, rebasing onto `origin/main`, running pre-PR gate checks, optionally performing a code review, and then pushing the branch to create a GitHub PR with a gitmoji-prefixed title and a structured body.
Inputs & outputs
When to use pr
- →Create a PR for Swift code
- →Rebase and format branch before PR
- →Automate commit and PR submission
About this skill
Create a pull request
I'll create a pull request for the current branch by following these steps. If any steps fail, stop.
Mode — check the arguments passed to this skill (shown at the end). If they
include reviewed (or skip-review), an upstream step already ran the
code-reviewer and fixed its findings (e.g. /deliver's code-review phase), so
skip steps 5–7 to avoid reviewing identical code twice. Otherwise (standalone
/pr), run the internal review as normal.
Also skip steps 5–7 when the branch changes no Swift — code review is for Swift, so a docs-only / config-only PR needs none:
git diff --name-only origin/main...HEAD | grep -qE '\.swift$' || echo "no-swift → skip review"
-
Run
/formatto format code -
Commit all outstanding work. Run
git status. If the working tree has any uncommitted or unstaged changes (the feature work, plus the formatting from step 1), stage and commit them — the PR reflects committed history only, so anything left uncommitted will be missing from the PR. First verify no secrets,.env, or build artifacts are included (per CLAUDE.md —.envmust stay gitignored; checkgit statusbeforegit add). Use a descriptive gitmoji message (or several logical commits if the work spans concerns); formatting-only changes can use "🎨 apply code formatting". If the tree is already clean (e.g. work was committed during/deliver), this is a no-op. -
Rebase onto the latest
origin/main. Fetch the remote and rebase the feature branch directly ontoorigin/main— do this beforemake ciso the gate (and the eventual PR) reflects the real merge result, not stale code:git fetch origin git rebase origin/main- Rebase onto
origin/main, not localmain— this is worktree-safe. A/deliverruns inside a git worktree, andgit checkout mainthere fails (fatal: 'main' is already used by worktree …) whenever the main checkout is onmain; rebasing ontoorigin/mainavoids checkingmainout at all and uses the true remote base directly. - If
git rebasereports conflicts, stop, resolve them, then continue. Never skip or force past a conflict you don't understand. - The rebase rewrites the branch tip, so a branch that was already pushed will need
git push --force-with-leaseat the push step below. - Already branched off an up-to-date
origin/mainwith nothing to replay → this is a fast no-op.
- Rebase onto
-
Run the pre-PR gate — MANDATORY; it must pass before going further. Run it directly (do not delegate). If it fails, stop and fix — commit the fixes — then re-run; never open a PR on a red gate. Scale the gate to the diff:
-
Default — full
make ci. The gate CLAUDE.md requires before any PR: lint, markdown lint, unit tests, integration tests, the release build, and the docs build. Use this whenever any code or build-affecting file changed. -
Docs/config-only fast gate. When the diff touches no build- or test-affecting files — i.e. no
*.swiftand none ofMakefile,Package.swift,Package.resolved,*.xctestplan, or.github/workflows/**— the test/release-build legs ofmake cihave nothing to exercise. Run only the meaningful checks instead:make lint && make lint-markdown && make build-docs(dropbuild-docsif no*.docc/**changed). Detect this with:git diff --name-only origin/main...HEAD \ | grep -qE '\.swift$|^Makefile$|^Package\.(swift|resolved)$|\.xctestplan$|^\.github/workflows/' \ && echo "code/build touched → full make ci" \ || echo "docs/config-only → fast gate"The PR's own CI still runs the full matrix regardless, so this only trims the local gate; it never lowers what actually guards
main. When in doubt, run fullmake ci. -
Re-lint new Swift files without the cache.
make ci's lint leg isswiftlint --strict .(Makefile), and SwiftLint caches results (~/Library/Caches/SwiftLint). On newly-added.swiftfiles this has been seen to report a false green locally — passingfile_length/type_body_lengththat the PR's CILintjob (a clean checkout, no cache) then fails on. So when the diff adds any new.swiftfile (git diff --name-only --diff-filter=A origin/main...HEAD | grep -q '\.swift$'), run a cache-bypassing lint before trusting the gate:swiftlint lint --strict --no-cache .Fix anything it flags (oversized files: split, or add a
// swiftlint:disabledirective matching theAccountService+Pagination.swiftprecedent) and re-run. This catches file-size violations locally instead of on a CI round-trip.
-
-
(skip in
reviewedmode or when no Swift changed) Spawn thecode-revieweragent to perform a code review of all changes (pass the git diff output as context) -
(skip in
reviewedmode or when no Swift changed) Summarize the code review findings:- List any critical or high-severity issues that should be addressed
- List any medium-severity suggestions for improvement
- Note any low-severity or stylistic recommendations
-
(skip in
reviewedmode or when no Swift changed) If there are critical/high-severity issues:- Recommend specific changes needed
- Ask user for confirmation before proceeding (fix issues or continue anyway)
- If user wants to fix issues, stop and let them address the feedback
-
Ensure a clean working tree before pushing. Re-run
git status; commit anything still outstanding (e.g. review fixes from steps 5–7, ormake cifixes) so the push includes everything. The tree must be clean before proceeding. Then rungit diff origin/main...HEADto understand all changes going into the PR. -
Analyze the commits and changes to generate an appropriate title and summary
-
Push the current branch to remote (
git push -u origin <branch>if not yet pushed; otherwisegit push— usegit push --force-with-leaseif you rebased in step 3) -
Create a PR with the GitHub MCP —
mcp__github__create_pull_request(owner/repo from theoriginremote,base: main,head: <branch>, plustitle/body). The branch must already be pushed (step 10). If the call fails with 401/403 (PAT expired or missing scope), fall back togh pr createwith the same title/body.Title — MUST start with a gitmoji prefix matching the change:
Emoji Code Use for ✨ :sparkles:New features 🐛 :bug:Bug fixes 📝 :memo:Documentation updates ♻️ :recycle:Refactoring ✅ :white_check_mark:Adding/updating tests 🔧 :wrench:Configuration changes ⚡️ :zap:Performance improvements 🎨 :art:Code style/formatting Example:
✨ Add createdBy property to TVSeries.Body — fill this skeleton, keeping only the sections that apply, and end with the attribution line exactly as shown:
## Summary [Brief description of what this PR does and why] ## Changes **New Model/Feature/Component:** - ✨ [Description] **Existing Files:** - 📝 [Description] **Tests:** - ✅ [Description of test coverage] **Documentation:** - 📚 [Description] ## Benefits - **[Benefit Category]**: [Description] 🤖 Generated with [Claude Code](https://claude.com/claude-code)
$ARGUMENTS
When not to use it
- →When the user does not want to rebase onto `origin/main`
- →When the project does not use Swift or `make ci` for pre-PR checks
- →When the user wants to manually manage commits and PR descriptions
Limitations
- →The code review phase (steps 5-7) is skipped if `reviewed` mode is active or no Swift files changed
- →The pre-PR gate (`make ci`) must pass before proceeding
- →The PR title MUST start with a gitmoji prefix
How it compares
This skill provides a highly automated and opinionated workflow for PR creation, including mandatory rebase and pre-PR checks, ensuring a clean and compliant commit history, which is more rigorous than a manual PR process.
Compared to similar skills
pr side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| pr (this skill) | 0 | 27d | Review | Advanced |
| pr | 0 | 4mo | Review | Intermediate |
| swift-concurrency-expert | 4 | 4mo | No flags | Advanced |
| ios-dev-guidelines | 3 | 6mo | No flags | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
pr
woocommerce
Create a pull request following WooCommerce iOS conventions
swift-concurrency-expert
Dimillian
Swift Concurrency review and remediation for Swift 6.2+. Use when asked to review Swift Concurrency usage, improve concurrency compliance, or fix Swift concurrency compiler errors in a feature or file.
ios-dev-guidelines
anyproto
Context-aware routing to Swift/iOS development patterns, architecture, and best practices. Use when working with .swift files, ViewModels, Coordinators, refactoring, or discussing Swift/SwiftUI patterns.
macos-spm-app-packaging
Dimillian
Scaffold, build, and package SwiftPM-based macOS apps without an Xcode project. Use when you need a from-scratch macOS app layout, SwiftPM targets/resources, a custom .app bundle assembly script, or signing/notarization/appcast steps outside Xcode.
swiftui-performance-developer
anyproto
Audit and improve SwiftUI runtime performance through code review and Instruments guidance. Use for diagnosing slow rendering, janky scrolling, excessive view updates, or layout thrash in SwiftUI apps.
tests-developer
anyproto
Smart router to testing patterns and practices. Use when writing unit tests, creating mocks, testing edge cases, or working with Swift Testing and XCTest frameworks.