Claude Skills
CollectionsCompareWorkflowsNominate
Sign inSign up
© 2026 Curated Agent Skills·Learn more about Agent Skills
Back to repository

pr-workflow

verified

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 GitHub

Marketplace

claude-plugin-pack

GzuPark/claude-plugin-pack

Plugin

hello-world

development

Repository

GzuPark/claude-plugin-pack
1stars

plugins/hello-world/skills/pr-workflow/SKILL.md

Last Verified

February 1, 2026

Install Skill

Select agents to install to:

Scope:
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-workflow

Installation paths:

Claude
.claude/skills/pr-workflow/
Powered by add-skill CLI

Instructions

# 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>.

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
6363 chars