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.
Automates creating pull requests from start to finish - forks repos, creates branches, commits changes, and submits PRs. Use when contributing to GitHub repos to handle the entire workflow automatically.
/plugin marketplace add yanmxa/cc-plugins/plugin install git@cc-pluginsThis skill is limited to using the following tools:
scripts/00-pr-workflow.shscripts/01-fork-and-setup.shscripts/02-check-guidelines.shscripts/03-create-pr.shAutomate creating pull requests from start to finish.
Basic workflow:
# 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:
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"
01-fork-and-setup.sh - Setup repo and branch01-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:
upstream (original) and origin (fork) remotes03-create-pr.sh - Commit and create PR03-create-pr.sh <base_branch> <pr_title> [pr_body] [commit_message]
Parameters:
base_branch - Target branch for PR (e.g., main)pr_title - PR titlepr_body - PR description (optional)commit_message - Commit message (optional, defaults to PR title)What it does:
# User request: "Fix version 2.9 to 2.15 in stolostron/multicluster-global-hub"
# Step 1: Setup
bash ~/.claude/skills/pr/scripts/01-fork-and-setup.sh \
stolostron/multicluster-global-hub \
~/tmp/contribute \
1 \
main \
docs/fix-version
# Step 2: Make changes (using Edit tool to modify files)
# ... Edit files to change 2.9 to 2.15 ...
# Step 3: Create PR
bash ~/.claude/skills/pr/scripts/03-create-pr.sh \
main \
"docs: update version from 2.9 to 2.15" \
"Update documentation links to point to 2.15 instead of 2.9"
# User is already in a git repo and wants to work there
cd /path/to/existing/repo
bash ~/.claude/skills/pr/scripts/01-fork-and-setup.sh \
owner/repo \
. \
"" \
main \
fix/issue-123
# Make changes...
bash ~/.claude/skills/pr/scripts/03-create-pr.sh \
main \
"Fix issue #123"
# Scenario: Your fork is named "hub-of-hubs" but upstream is "multicluster-global-hub"
# The script automatically detects this and handles it
bash ~/.claude/skills/pr/scripts/01-fork-and-setup.sh \
stolostron/multicluster-global-hub \
~/code \
1 \
main \
fix/bug
# Output: "Found existing fork with different name: yanmxa/hub-of-hubs"
# Script uses the correct fork name automatically
✅ Idempotent - Safe to re-run, won't duplicate work
✅ Smart fork detection - Finds forks even with different names
✅ Auto-fork - Creates fork if it doesn't exist
✅ Auto-commit - Commits changes with DCO sign-off
✅ No duplicates - Checks for existing PRs before creating
✅ Current dir mode - Can work in existing repos (use . as work_dir)
✅ Fast clone - Shallow clone by default (10x faster)
✅ Proper remotes - Sets up upstream (HTTPS) and origin (SSH)
Clone speed with depth=1:
| Repository | Full Clone | Shallow (depth=1) | Speedup |
|---|---|---|---|
| kubernetes | ~3GB | ~300MB | 10x |
| Linux kernel | ~4GB | ~400MB | 10x |
| Typical repo | ~500MB | ~50MB | 10x |
GitHub CLI (gh) - Must be installed and authenticated
brew install gh
gh auth login
Git - Configured with name and email
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
SSH Keys - Setup for GitHub (for cloning via SSH)
Fork already exists → Script handles automatically, uses existing fork
Repository already cloned → Script verifies and updates remotes
PR already exists → Script shows existing PR URL instead of creating duplicate
Fork has different name → Script detects via GitHub API and uses correct name
Current directory not a git repo
→ Don't use . as work_dir, or cd to a git repo first
-s flag)git add -u (only modified/deleted files, not new untracked files)username:branch formatThis skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.