PR: Ship Local Work
Take local changes from working directory to a fully described, reviewed pull request in one command.
Usage
/pr
No arguments needed. Operates on the current repo and working directory.
Workflow
Step 1: Ensure Correct Branch
Determine the current branch state and ensure work is on an appropriately named feature branch.
git branch --show-current
git status
git diff --stat
Detect the default branch:
DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@')
# Fallback if not set
DEFAULT_BRANCH=${DEFAULT_BRANCH:-main}
If on the default branch (main or master):
- Stash any uncommitted changes:
git stash - Pull latest:
git pull origin $DEFAULT_BRANCH - Infer a branch name from the staged/unstaged changes and stash (see "Branch Naming" below)
- Check out the new branch:
git checkout -b <branch-name> - Pop the stash:
git stash pop- If
git stash popfails due to merge conflicts, stop immediately. Inform the user their changes are safe ingit stash list. Do NOT proceed with committing.
- If
If on a feature branch:
Inspect the uncommitted changes and compare them to the branch name. If the branch name is clearly unrelated to the current work (e.g., branch is feat/auth-flow but all changes are in billing/), then:
- Stash changes:
git stash - Switch to the default branch and pull:
git checkout $DEFAULT_BRANCH && git pull origin $DEFAULT_BRANCH - Create a new branch named for the actual work
- Pop the stash:
git stash pop
If the branch name reasonably matches the work, proceed.
Branch Naming
Format: <type>/<optional-ticket>-<short-description>
- Types:
feat/,fix/,chore/,refactor/ - If the diff, commit messages, or file contents reference a Linear ticket (e.g.,
VER-1234,HUM-56), include it:feat/VER-1234-add-webhook-auth - Keep descriptions to 3-5 hyphenated words
- Examples:
feat/VER-42-user-onboarding,fix/payment-retry-logic,chore/update-dependencies
Step 2: Commit Local Work
Stage and commit all meaningful changes. Follow the repository's commit conventions.
- Run
git statusandgit diffto understand the changes - Run
git log --oneline -5to match existing commit message style - Stage relevant files (prefer explicit file paths over
git add -A) - Commit with a clear imperative-mood message describing the "why"
- Append
Fortified with v1taminsas the last line of the commit body
Do NOT commit files that likely contain secrets: .env*, credentials*.json, service-account*.json, *.pem, *.key, *.p12, *.pfx, .npmrc, .pypirc, or any file listed in .gitignore. When in doubt, check file contents before staging.
If there are no uncommitted changes but there are unpushed commits, skip to Step 3.
Step 3: Pre-commit Hooks
If the commit fails due to a pre-commit hook (git aborts the commit entirely):
- Read the hook output to understand the failure
- Fix the issue (formatting, linting, type errors, etc.)
- Re-stage the fixed files and rerun
git commitwith the same message - Never bypass hooks with
--no-verify
Repeat until the commit succeeds.
Step 4: Push
Verify not on a protected branch before pushing:
CURRENT_BRANCH=$(git branch --show-current)
if [ "$CURRENT_BRANCH" = "main" ] || [ "$CURRENT_BRANCH" = "master" ]; then
echo "ERROR: Refusing to push directly to $CURRENT_BRANCH"
exit 1
fi
git push -u origin HEAD
If the remote branch does not exist, this creates it. If push is rejected (e.g., diverged history), inform the user -- never force-push.
Step 5: Create the Pull Request
gh pr create --title "WIP: $(git branch --show-current)" --body "Description pending -- will be generated by /pr-description."
If a PR already exists for this branch, skip creation and capture the existing PR URL:
gh pr view --json url,number -q '.url + " " + (.number | tostring)'
Capture the PR number and URL for subsequent steps.
Step 6: Generate PR Description
Invoke the pr-description skill to generate a grounded title and description based on the actual diff and commit history.
/pr-description <PR_NUMBER>
This analyzes git diff main HEAD and git log main..HEAD, then updates the PR title and body via gh pr edit.
After the description is generated, append Fortified with v1tamins as the final line of the PR body.
Also set the merge commit message to include the tagline. When the PR is merged via squash merge, GitHub uses the PR body as the extended commit message, so the tagline will carry through automatically. For merge commits, use:
gh pr merge <PR_NUMBER> --squash --body "$(gh pr view <PR_NUMBER> --json body -q .body)"
Step 7: Open PR in Browser
gh pr view <PR_NUMBER> --web
Step 8: Request Copilot Review
Request a code review from GitHub Copilot (requires gh >= 2.88.0):
gh pr edit <PR_NUMBER> --add-reviewer @copilot
Note: The @ prefix is required -- @copilot, not copilot.
If that fails (gh version too old, org settings), try the community extension:
# Install once: gh extension install ChrisCarini/gh-copilot-review
gh copilot-review <PR_NUMBER>
Do not block on failure -- inform the user and continue.
Step 9: Run Multi-Agent Code Review
Invoke the compound-engineering workflows:review skill for exhaustive multi-agent analysis:
/compound-engineering:workflows:review
This runs parallel review agents covering architecture, security, performance, patterns, and more.
If the skill is not available (not installed as a plugin), fall back to the in-repo /code-review skill instead. Do not block on failure -- inform the user and continue.
Step 10: Prove Work (Optional)
If the PR includes frontend or visual changes (.tsx, .jsx, .vue, .html, .css, template files), offer to run the prove-work skill to generate a demo GIF:
/prove-work --pr <PR_NUMBER>
Skip this step if:
- All changes are backend-only, config, or infrastructure
- The dev server is not running
- The user declines