# Pr

> Create or update GitHub pull requests. Use when user says "pr", "/pr", "create pr", "open pr", "pull request", or asks to submit changes for review. Requires gh CLI. Use when this capability is needed.

- Skill: `tomevault-io/pr-5` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/pr-5`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/pr-5/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/pr-5

---


## Context
- Branch: !`git branch --show-current`
- Remote status: !`git status -sb`
- Commits: !`git log origin/HEAD..HEAD --oneline 2>/dev/null`
- Diff: !`git diff origin/HEAD...HEAD -- . ':!*.svg' ':!*lock.json' ':!*lock.yaml' ':!*.lockb' ':!*.lock' ':!.opencode' ':!.claude' ':!.cursor' ':!*.png' ':!*.jpg' ':!*.jpeg' ':!*.gif' ':!*.ico' ':!*.webp' ':!*.avif' ':!*.bmp' ':!*.tiff' ':!*.psd' ':!*.ai' ':!*.eps' ':!*.raw' ':!*.woff' ':!*.woff2' ':!*.ttf' ':!*.eot' ':!*.otf' ':!*.mp3' ':!*.mp4' ':!*.wav' ':!*.ogg' ':!*.webm' ':!*.mov' ':!*.pdf' ':!*.doc' ':!*.docx' ':!*.xls' ':!*.xlsx' ':!*.ppt' ':!*.pptx' ':!*.zip' ':!*.tar.gz' ':!*.gz' ':!*.rar' ':!*.7z' ':!*.bin' ':!*.exe' ':!*.dll' ':!*.so' ':!*.dylib' ':!*.db' ':!*.sqlite' ':!*.sqlite3' ':!*.map' ':!*.js.map' ':!*.css.map' ':!*.min.js' ':!*.min.css' ':!*.bundle.js' ':!*.class' ':!*.jar' ':!*.war' ':!*.pyc' ':!*.pyo' ':!*.whl' ':!*.pem' ':!*.key' ':!*.crt' ':!*.p12' ':!*.parquet' ':!*.pickle' ':!*.npy' ':!*.sketch' ':!*.fig' ':!*.xd' 2>/dev/null`

## Steps

1. **Check state**:
   - PR already exists? → Show URL and ask: update existing or create new?
   - On default branch (main/master)? → Warn and stop (PRs should be from feature branches)
   - Not pushed? → Will need to push first
   - Behind remote? → Will need to rebase first (warn: requires force-push after rebase)
2. **Analyze** - Review all commits and changes
3. **Generate** - PR title and description
   - Follow `.github/PULL_REQUEST_TEMPLATE.md` if exists
4. **Single confirmation** - Ask ALL relevant questions at once:
   - Need to push? → "Push branch to origin?"
   - Need to rebase? → "Rebase on [default branch] first?" (note: will require force-push)
   - Show PR title/description → "Approve?" / "Edit?"
   - "Create as draft?" → Yes/No
   - "Add reviewers/labels?" → Optional, list if requested
   - "Different base branch?" → Default is detected default branch
5. **Execute** - Push if needed, then `gh pr create` (add `--draft` if requested)
6. **Handle failures** - If push/PR creation fails:
   - `gh` not authenticated? → Run `gh auth login`
   - Push rejected? → Check permissions, branch protection rules
   - PR creation failed? → Report error, check for required fields

## Notes
- Follow PR template strictly if exists
- Complete all required sections
- Return the PR URL when done

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/luisurrutia) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-13 -->

