name: pr description: Create a pull request
Create a pull request
I'll create a pull request for the current branch by following these steps. If any steps fail, stop.
Arguments: pass reviewed to skip the internal code-reviewer pass (step 4) — use
this when the change has already been code-reviewed and converged (e.g. /deliver's
Phase 3 already ran /review-changes). The review is also skipped automatically when
the diff touches no *.swift.
Commit all outstanding work. Formatting is applied automatically by the PostToolUse hook as files are edited, so there is no separate format step. Run
git status; if the working tree has any uncommitted/unstaged changes, stage and commit them — the PR reflects committed history only, so anything left uncommitted is missing from the PR. First verify no secrets,.env, or build artifacts are included (.envmust stay gitignored; checkgit statusbeforegit add). Use a descriptive gitmoji message. If the tree is already clean (e.g. work was committed during/deliver), this is a no-op.Rebase onto the latest
main. Bring localmainup to date with remote, then rebase the feature branch onto it — do this before the gate so the gate (and the eventual PR) reflects the real merge result, not stale code:git fetch origin git checkout main && git merge --ff-only origin/main # local main == remote main git checkout - # back to the feature branch git rebase main- If
git merge --ff-onlyfails, localmainhas diverged fromorigin/main— stop and investigate; do not force it. - 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 needs
git push --force-with-leaseat the push step below. - Already on / branched off an up-to-date
mainwith nothing to replay → fast no-op.
- If
The gate — run in order, stop on any failure (the rebase above means this runs against the post-merge tree):
make lint— the clean-tree lint gate (swiftlint--strict+ swiftformat--lintover the whole repo; catches pre-existing violations the per-edit hook won't). Run it first (it depends onclean-spm, which clears build caches, so subsequent builds start cold — that's expected, not a hang). Delegate to a Haiku subagent.- New-file re-lint: for any file added in this branch (
git diff --diff-filter=A --name-only origin/main...HEAD -- '*.swift'), runswiftlint --no-cacheon it — the cache can false-green a brand-new file that CI's clean checkout would flag. /build-for-testing— build succeeds with no warnings (warnings are errors)./test— all unit tests pass./test-snapshots— all snapshot tests pass.
If the gate fails, stop and fix — commit the fixes — then re-run; never open a PR on a red gate.
Code review — skip this step entirely if
reviewedwas passed or the diff touches no*.swift. Otherwise spawn thecode-revieweragent to review all changes, following.github/CODE_REVIEW.md. Pass it:- The full diff:
git diff origin/main...HEAD - The list of changed files:
git diff --name-only origin/main...HEAD - Instruct it to read full files (not just diff hunks) and compare with sibling implementations for pattern consistency
- The full diff:
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
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 (review fixes from steps 4–6, or gate fixes) so the push includes everything. Then rungit diff origin/main...HEADto understand all changes.Analyze the commits and changes to generate an appropriate title and summary
Push the current branch to remote using
git push(notghCLI, which bypasses webhooks/workflows) — usegit push --force-with-leaseif you rebased in step 2.Create a PR using
gh pr createwith:- IMPORTANT: Title MUST start with a gitmoji prefix (e.g., "✨ Add new feature", "🐛 Fix bug", "📚 Improve documentation")
- Refer to https://gitmoji.dev to use the correct emoji
- Common: ✨ feature, 🐛 bugfix, ♻️ refactor, 🧪 tests, 📚 docs, 🔧 config, 🎨 style
- A comprehensive summary with bullet points
- Proper formatting with sections (Summary, Changes, Benefits, etc.)
- IMPORTANT: Title MUST start with a gitmoji prefix (e.g., "✨ Add new feature", "🐛 Fix bug", "📚 Improve documentation")
The PR will include the Claude Code attribution footer.
$ARGUMENTS