pr

Create a pull request with intelligent base branch detection. Use when: (1) User says 'create pr', 'make pr', or 'open pr', (2) User wants to create a PR from the current branch, (3) User has finished work on a feature branch and needs a PR. Auto-detects base branch from conversation, git history, or repo default.

6 stars

Best use case

pr is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Create a pull request with intelligent base branch detection. Use when: (1) User says 'create pr', 'make pr', or 'open pr', (2) User wants to create a PR from the current branch, (3) User has finished work on a feature branch and needs a PR. Auto-detects base branch from conversation, git history, or repo default.

Teams using pr should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/pr/SKILL.md --create-dirs "https://raw.githubusercontent.com/Takazudo/claude-resources/main/skills/pr/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/pr/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How pr Compares

Feature / AgentprStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Create a pull request with intelligent base branch detection. Use when: (1) User says 'create pr', 'make pr', or 'open pr', (2) User wants to create a PR from the current branch, (3) User has finished work on a feature branch and needs a PR. Auto-detects base branch from conversation, git history, or repo default.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# PR Command

Create a pull request with automatic base branch detection from conversation history, git log, or repository default.

## Usage

- `/pr` - Create PR with auto-detected base branch
- `/pr <target-branch>` - Create PR targeting the specified branch

## Steps

### 1. Verify Current State

```bash
git status
git branch --show-current
```

Ensure you're on a feature branch (not main/master/develop).

### 2. Determine Base Branch

**Priority order for base branch detection:**

1. **Explicit argument**: If `<target-branch>` is provided, use it directly
2. **Conversation context**: Search conversation history for mentions of:
- "based on", "branch from", "create branch from"
- PR context or issue references that mention a target branch
- Recent git commands showing branch creation
3. **Git history**: Auto-detect from git log and merge-base
4. **Repository default**: Use the default branch as fallback

#### Conversation History Check

Search the current conversation for clues about the base branch:

- Look for phrases like "create branch from develop", "based on feature-x"
- Check if user mentioned which branch they started from
- Look for issue/PR context that indicates the target

#### Git History Detection

```bash
# Fetch latest remote refs
git fetch origin

# Find merge-base with candidate branches
for branch in main master develop staging; do
  git merge-base HEAD origin/$branch 2>/dev/null && echo "Found: $branch"
done

# Check which branch has the closest merge-base
# The branch with most recent common ancestor is likely the parent
```

#### Repository Default Fallback

```bash
# Get the default branch
gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name'
```

### 3. Check for Existing PR

```bash
gh pr list --head $(git branch --show-current)
```

If PR exists, ask user if they want to view or update it.

### 4. Analyze Changes

```bash
# Get commits
git log origin/<base-branch>..HEAD --oneline

# Get file changes
git diff origin/<base-branch>..HEAD --stat
```

### 5. Confirm with User

Before creating, confirm:

- **Current branch**: `<branch-name>`
- **Target base branch**: `<base-branch>` (with detection method: "specified", "from conversation", "auto-detected", or "default")
- **Commits**: Number of commits to include
- **Suggested PR title**: Based on commits/branch name

### 6. Push and Create PR

**Optional: Copilot-assisted body draft**

Before drafting the body manually, attempt to get a Copilot-drafted body:

```bash
DRAFT=$($HOME/.claude/skills/gco/scripts/gco-pr-body.sh "<base-branch>" 2>/dev/null || true)
```

If `$DRAFT` is non-empty, use it as the starting point for the body. Claude must still review and adjust it — fill any gaps, fix inaccuracies, and ensure tone/completeness. If the script fails or returns empty, draft the body directly.

```bash
# Push if needed
git push -u origin $(git branch --show-current)

# Create PR
gh pr create \
  --base <base-branch> \
  --title "<title>" \
  --body "$(cat <<'EOF'
## Summary
<description>

## Changes
- <change 1>
- <change 2>

## Test Plan
<testing instructions>
EOF
)"
```

Copilot output is NEVER applied verbatim — always review and adjust before creating the PR.

### 7. Report Result

Display:

- PR URL
- PR number
- Base branch (and how it was determined)
- Head branch

## Detection Logic

The command uses this logic to find the base branch:

1. **User-specified**: Highest priority - use the argument directly
2. **Conversation analysis**: Check conversation for branch context
3. **Git merge-base**: Find closest common ancestor with candidate branches
4. **Default branch**: Ultimate fallback using `gh repo view`

If detection is ambiguous, ask the user to clarify before creating the PR.

## Important Notes

- Never assume main/master without verification
- Always inform user how the base branch was determined
- Verify branch is pushed before creating PR
- Include meaningful PR title and description

Related Skills

zudoesa-articlify

6
from Takazudo/claude-resources

Convert conversation context into an esa article via the zudoesa-writer subagent. ONLY invoke when the user explicitly asks — NEVER proactively propose. Triggers: 'write esa article', 'esa記事', 'esaに書いて', 'articlify for esa', or /zudoesa-articlify. Gathers context, creates a writing brief, delegates to the writer subagent.

zudoesa-apply-voice

6
from Takazudo/claude-resources

Apply Takazudo's esa writing voice and vocabulary rules to text. Use when: (1) User wants to write/rewrite text in Takazudo's esa style, (2) User says 'apply voice', 'esa voice', 'esa文体で', 'esa風に書いて', '文体を適用', (3) User provides text to transform to esa style. Reads writing-style.md and vocabulary-rule.md from takazudo-esa-writing repo and applies the rules.

zudocg-articlify

6
from Takazudo/claude-resources

Convert conversation context into a CodeGrid article via the zudocg-writer subagent. ONLY invoke when the user explicitly asks — NEVER proactively propose. Triggers: 'write codegrid article', 'CodeGrid記事', 'codegridに書いて', 'articlify for codegrid', or /zudocg-articlify. Gathers context, creates a writing brief, delegates to the writer subagent.

zudocg-apply-voice

6
from Takazudo/claude-resources

Apply Takazudo's CodeGrid writing voice and vocabulary rules to text. Use when: (1) User wants to write/rewrite text in Takazudo's CodeGrid style, (2) User says 'apply voice', 'codegrid voice', 'codegrid文体で', 'codegrid風に書いて', '文体を適用', (3) User provides text to transform to CodeGrid style. Reads writing-style.md and vocabulary-rule.md from takazudo-codegrid-writing repo and applies the rules.

zpaper-articlify

6
from Takazudo/claude-resources

Convert conversation context into a zpaper blog article via the zpaper-writer subagent. ONLY invoke when the user explicitly asks — NEVER proactively propose. Triggers: 'write zpaper article', 'zpaper記事', 'zpaperに書いて', 'articlify for zpaper', or /zpaper-articlify. Gathers context, creates a writing brief, delegates to the writer subagent.

zpaper-apply-voice

6
from Takazudo/claude-resources

Apply Takazudo's zpaper blog writing voice and vocabulary rules to text. Use when: (1) User wants to write/rewrite text in Takazudo's zpaper style, (2) User says 'apply voice', 'zpaper voice', 'zpaper文体で', 'zpaper風に書いて', 'ブログ文体を適用', (3) User provides text to transform to zpaper style. Reads writing-style.md and vocabulary-rule.md from the zpaper repo and applies the rules.

xlsx

6
from Takazudo/claude-resources

Spreadsheet creation, editing, and analysis. Use when working with .xlsx, .xlsm, .csv, .tsv files for: (1) Creating spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modifying existing spreadsheets while preserving formulas, (4) Data analysis and visualization, (5) Recalculating formulas.

x

6
from Takazudo/claude-resources

Facade for development workflows. Routes on two axes: plan-first vs implement-now (escalates to /big-plan -a when the request needs research / decomposition / has unclear scope — the appended -a makes the plan chain into implementation in-session), then single vs multi on the ready-to-build fast paths (/x-as-pr single-topic, /x-wt-teams multi-topic parallel). Use when: (1) User says '/x' followed by dev instructions, (2) User wants to start development without choosing the workflow skill, (3) User says 'dev', 'implement', or 'build' with a task. Default option: -v (verify-ui). Review-loop (-l) is opt-in — without -l the downstream skill runs a single /deep-review pass. Forwards -a (autonomy/auto-chain) and -m (merge at the end + cleanup + CI watch) through every route; auto-fix of raised findings (-f) and issue-raising (-ri) are downstream defaults, with -nf/--no-fix and -nori/--no-raise-issues as the forwarded opt-outs. -a and -m are orthogonal — full hands-off end-to-end is -a -m.

x-wt-teams

6
from Takazudo/claude-resources

Parallel multi-topic development using git worktrees, base branches, and Claude Code agent teams. Use when: (1) User wants to work on multiple related features in parallel, (2) User mentions 'worktree', 'base branch', 'parallel development', 'split into topics', or 'multi-topic'. FULLY AUTONOMOUS — creates worktrees, spawns teams, coordinates everything. Also supports Super-Epic child mode for [Epic] issues from /big-plan with '**Super-epic:** #N' markers (targets the super-epic base branch instead of main).

x-as-pr

6
from Takazudo/claude-resources

Start a development workflow as a draft PR. Creates a NEW branch from the current branch, empty start commit, draft PR targeting the current branch, then implements. ALWAYS creates a new branch by default — produces a nested PR-on-PR when the current branch already has one. Use when: (1) User says 'dev as pr', (2) User wants a PR-first workflow before coding, (3) User passes -s/--stay to reuse the current branch instead of nesting, (4) User passes a GitHub issue URL to implement, (5) User passes --make-issue/--issue to create an issue first. Logs progress via issue comments when an issue is linked.

watch-ci

6
from Takazudo/claude-resources

Watch GitHub PR CI checks in the background and notify on completion. Use when: (1) User wants to monitor CI/CD status, (2) User says 'watch CI', 'check CI', 'monitor checks', or 'wait for CI', (3) User wants to know when checks pass or fail. Runs a background gh polling shell loop (NOT a subagent — near-zero token cost), sends macOS notification on completion. Also handles merged PRs by watching the target branch CI.

w-update-wording-rule

6
from Takazudo/claude-resources

Add or update wording rules (表記ルール) in the w repo's vocabulary-rule.md files. Use when: (1) User says 'add wording rule', 'update wording rule', '表記ルール追加', (2) User wants to add a kanji/hiragana usage rule, (3) User provides a rule like 'X should be Y' with examples.