Automate creating pull requests - fork repos, create branches, commit changes, and submit PRs. Works in current directory or creates new clone. Idempotent and safe to re-run. Keywords - PR, pull request, fork, contribute, upstream.
View on GitHubSelect agents to install to:
npx add-skill https://github.com/yanmxa/cc-plugins/blob/main/plugins/git/skills/pr/SKILL.md -a claude-code --skill prInstallation paths:
.claude/skills/pr/# PR - Pull Request Automation Automate creating pull requests from start to finish. ## What This Does 1. Fork the repository (if needed) 2. Clone or use existing local repo 3. Create feature branch from upstream 4. Auto-commit your changes 5. Push and create PR ## Quick Start **Basic workflow:** ```bash # 1. Fork, clone, and create branch bash ~/.claude/skills/pr/scripts/01-fork-and-setup.sh \ owner/repo \ ~/code \ 1 \ main \ my-feature # 2. Make your changes (use Edit tool)... # 3. Auto-commit and create PR bash ~/.claude/skills/pr/scripts/03-create-pr.sh \ main \ "PR title" \ "PR description" ``` **Current directory mode:** ```bash cd /path/to/your/repo bash ~/.claude/skills/pr/scripts/01-fork-and-setup.sh owner/repo . "" main my-feature # Make changes... bash ~/.claude/skills/pr/scripts/03-create-pr.sh main "Fix bug" ``` ## Scripts ### `01-fork-and-setup.sh` - Setup repo and branch ```bash 01-fork-and-setup.sh <repo> [work_dir] [depth] [base_branch] [feature_branch] ``` **Parameters:** - `repo` - Repository to fork (e.g., `owner/repo`) - `work_dir` - Where to clone (default: `~/tmp/contribute`, use `.` for current dir) - `depth` - Clone depth (default: full, use `1` for 10x faster shallow clone) - `base_branch` - Branch to base work on (e.g., `main`) - `feature_branch` - Your new branch name (e.g., `fix/bug-123`) **What it does:** - Creates fork if needed (detects existing forks, even with different names) - Clones repo or uses existing local copy - Sets up `upstream` (original) and `origin` (fork) remotes - Creates feature branch from latest upstream - **Idempotent** - Safe to re-run multiple times ### `03-create-pr.sh` - Commit and create PR ```bash 03-create-pr.sh <base_branch> <pr_title> [pr_body] [commit_message] ``` **Parameters:** - `base_branch` - Target branch for PR (e.g., `main`) - `pr_title` - PR title - `pr_body` - PR description (optional) - `commit_message` - Commit message (optional, defaults to PR title) **What i