github-create-pr
GitHub Create PR
Create a GitHub Pull Request using the gh CLI.
When to Use
- Ready to submit changes for review
- Need to create a pull request
- Any request to "open PR", "create PR", or "submit for review"
Prerequisites
Ensure gh CLI is installed and authenticated:
gh --version
gh auth status
If not authenticated:
gh auth login
Workflow
1. Check Branch Status
git status
git branch --show-current
git log --oneline -5
2. Push Branch (if needed)
git push -u origin HEAD
3. Create the PR
Quick creation with defaults:
gh pr create
With custom title:
gh pr create --title "feat: add user authentication"
With title and body:
gh pr create --title "feat: add user authentication" --body "Implements OAuth2 login flow with support for Google and GitHub providers."
Fill from commit messages:
gh pr create --fill
Target specific base branch:
gh pr create --base main
4. Copy PR URL
After creation, the PR URL is printed. You can also get it with:
gh pr view --json url --jq '.url'
Common Options
| Flag | Description |
|---|---|
--title |
PR title |
--body |
PR description |
--fill |
Use commit message as title/body |
--base |
Target branch (default: repo default) |
--head |
Source branch (default: current) |
--draft |
Create as draft PR |
--label |
Add labels |
--assignee |
Assign to user(s) |
--reviewer |
Request reviewer(s) |
Examples
Create draft PR:
gh pr create --draft --title "WIP: refactor API"
Add labels and reviewer:
gh pr create --title "fix: resolve memory leak" --label "bug" --reviewer "@username"
Use template:
gh pr create --template="feature.md"
Best Practices
- Push branch before creating PR
- Write clear, descriptive titles
- Include context in body (what changed, why)
- Reference related issues:
Closes #123 - Add appropriate labels
- Request reviewers
- Use draft PRs for work-in-progress
More from pc-style/pc-skills
blog-post
Create pcstyle.dev developer blog posts in the dual-author (ME MYSELF + MY AI AGENT) format, including MDX structure, custom components, and API/CLI publishing steps.
4code-review
Run automated code review using cubic review with amp review fallback. Use when the user wants to review code changes, check PR quality, analyze code for issues, or run automated code review tools.
4load-handoff
Load a handoff file and proceed with the specified tasks. Use when starting a new session with a HANDOFF.md file present, or when the user asks to continue from a handoff. Reads the handoff context and immediately begins executing the next steps.
3explore-codebase
Fast codebase exploration using Opencode's Explore agent for quick recognition of project structure, file patterns, and code organization. Use when you need to understand a codebase quickly, map out architecture, find files by patterns, or answer questions about code structure. Triggers on requests like "explore this codebase", "understand the project structure", "map out the architecture", or when quick file discovery is needed.
3git-push-origin
Push local branch to origin (GitHub) to initialize it remotely. Use when the user has created a local branch and wants to push it to GitHub for the first time, or when setting up a new branch on the remote repository.
3create-handoff
Create a handoff message to continue work in a new AI session. Use when the user wants to save context for later, create a handoff document, or prepare work for continuation in a fresh session. Captures relevant files, context, and goals so the next session can start immediately without rediscovering the codebase.
3