GitHub PR creation workflow with automated code review. Use when user wants to create a PR, requests `/pr`, or needs to push changes to GitHub with quality checks.
View on GitHubFebruary 1, 2026
Select agents to install to:
npx add-skill https://github.com/GzuPark/claude-plugin-pack/blob/main/plugins/hello-world/skills/pr-workflow/SKILL.md -a claude-code --skill pr-workflowInstallation paths:
.claude/skills/pr-workflow/# PR Workflow
Create GitHub Pull Requests with automated change analysis and code review.
## Triggers
- User runs `/pr` or `/pr [base-branch]`
- User asks to create a PR or pull request
- User wants to push changes and create a PR
- User requests code review before PR creation
## Workflow Overview
```text
Step 1: Pre-checks -> Step 2: Detect Base Branch -> Step 3: Verify Changes
-> Step 4: Check Existing PR -> Step 5: Gather Context
-> Step 6: Code Review -> Step 7: Push Confirmation
-> Step 8: Generate PR -> Step 9: Complete
```
## Step 1: Pre-checks
Stop immediately if any check fails.
### 1.1 Verify Git Repository
```bash
git rev-parse --is-inside-work-tree
```
Fail: "Not a git repository."
### 1.2 Check Current Branch
```bash
git branch --show-current
```
Fail (empty): "Cannot determine current branch. You are in detached HEAD state."
### 1.3 Check Uncommitted Changes
```bash
git status --porcelain
```
Fail (any output): "There are uncommitted changes. Run /commit first."
### 1.4 Verify gh CLI
```bash
gh --version
```
Fail: "gh CLI is not installed. Install it from `https://cli.github.com`"
### 1.5 Verify gh Authentication
```bash
gh auth status
```
Fail: "GitHub authentication required. Run `gh auth login` first."
## Step 2: Detect Base Branch
If no base branch provided:
1. Try: `git remote show origin | grep 'HEAD branch' | cut -d: -f2 | tr -d ' '`
2. Fallback to `main` if exists
3. Fallback to `master` if exists
4. Fail: "Cannot find default branch. Please specify base branch explicitly."
## Step 3: Verify Changes Exist
```bash
git diff <base-branch>...HEAD --stat
```
Fail (no output): "No difference from base-branch."
## Step 4: Check Existing PR
```bash
gh pr list --head $(git branch --show-current) --json url --jq '.[0].url'
```
If URL returned: "A PR already exists for this branch: [URL]"
## Step 5: Gather Context
Collect information for review and PR generation:
```bash
# Commit history
git log <base-branch>.