# Create PR

Create high-quality pull requests via gh pr create.

- Repository: https://github.com/ReflexioAI/claude-smart (790 stars)
- Category: Git and review
- License: Apache-2.0
- Last updated: 2026-10-30
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add ReflexioAI/claude-smart --skill create-pr -g -a claude-code -y`
Codex: `npx skills add ReflexioAI/claude-smart --skill create-pr -g -a codex -y`
Cursor: `npx skills add ReflexioAI/claude-smart --skill create-pr -g -a cursor -y`
Gemini CLI: `npx skills add ReflexioAI/claude-smart --skill create-pr -g -a gemini-cli -y`

## Description

Create high-quality pull requests via gh pr create. Use when the user wants to create a PR, submit a PR, open a pull request, submit for review, or push changes for review. Triggers on: create a pr, create-pr, submit a pr, open a pull request, submit for review, make a pr, gh pr create.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# PR Creator

Create well-structured, reviewer-friendly pull requests following best practices.

**CRITICAL: This skill MUST always result in a PR being created. Do NOT stop early, do NOT ask the user to run another command first. Handle all prerequisites (committing, branching, pushing) inline and proceed to `gh pr create`.**

---

## Workflow

### Step 1: Pre-flight Checks

Run these checks before anything else:

1. **Verify GitHub CLI authentication**, run `gh api user --jq '.login'` to confirm the CLI is authenticated. If this fails, tell the user to run `gh auth login` first and stop.
2. **Determine the base branch**, default to `main`. If the user specifies a different base, use that. Capture as `$BASE_BRANCH`.

### Step 2: Commit Uncommitted Changes

Run `git status` to check for uncommitted changes. If there are uncommitted changes, commit them **directly**, do NOT delegate to another skill or tell the user to commit first.

1. **Stage changes**, run `git add <files>` for relevant modified/untracked files. Do not stage `.env` or gitignored files.
2. **Lint and format**, if Python files are staged, run:
   ```bash
   ruff check --fix <files> && ruff format <files>
   ```
   Re-stage any modified files.
3. **Commit**, write a conventional commit message based on the staged diff:
   ```bash
   git commit -m "<type>: <description>"
   ```
   If precommit hooks modify files, re-stage with `git add -u` and retry (up to 3 times).

### Step 3: Ensure Feature Branch

The rest: https://github.com/ReflexioAI/claude-smart/blob/HEAD/.agents/skills/create-pr/SKILL.md
