| name | pr-workflow |
| description | Create, update, and manage pull requests using GitHub CLI. Includes branch protection, auto-assignment, and commit formats. For stacked PRs, see the stacked-prs skill.
|
| compatibility | All repositories with GitHub |
| metadata | {"version":"1.0.0","category":"workflow","tags":["pull-requests","git","github-cli","branch-protection"],"triggers":["on-demand"],"uses":["coderabbit-workflow","jira-integration"]} |
PR Workflow Management
Workflows for managing pull requests using GitHub CLI (gh), including CI checks, branch protection, and commit formatting.
Core Principles
- Never Work on Main - All work must happen on feature/fix/chore branches
- Always Create Draft PRs - PRs must be created as drafts using the
--draft flag
- Auto-Assignment - Always assign PRs to the current user after creation
- Prevent Terminal Buffering - Use echo wrappers for
gh commands
- Conventional Commits - Follow conventional commit format for all commits
When to use this skill
- Creating and managing single pull requests
- Setting up branch protection workflows
- Understanding commit message formats
- Managing CI checks on PRs
For stacked (dependent) PRs, see the stacked-prs skill.
Skill Contents
Sections
Available Resources
📚 references/ - Detailed documentation
Workflow Overview
| Phase | Description | Reference |
|---|
| Branch Setup | Create feature branches, never commit to main | references/branch-protection.md |
| PR Creation | Create draft PRs with proper formatting | references/pr-creation.md |
| CI & Reviews | Monitor CI, respond to CodeRabbit | references/coderabbit-integration.md |
| Commits | Use conventional commit format | references/commit-formats.md |
Quick Reference
Branch Naming Convention
{type}/{JIRA-KEY}-{description}
feat/ - New features
fix/ - Bug fixes
chore/ - Maintenance
docs/ - Documentation
refactor/ - Code restructuring
Prevent Terminal Buffering
echo "Checking..." ; gh pr checks 123 --repo owner/repo ; echo "Done"
Create and Assign PR
CURRENT_USER=$(gh api user --jq '.login')
PR_URL=$(gh pr create --draft \
--title "[JIRA-KEY] fix(security): description" \
--body "## Summary..." \
--repo owner/repo 2>&1)
PR_NUMBER=$(echo "$PR_URL" | grep -oE '[0-9]+$')
gh pr edit $PR_NUMBER --repo owner/repo --add-assignee "$CURRENT_USER"
Check PR Status
gh pr checks <PR_NUMBER> --repo owner/repo
gh pr view <PR_NUMBER> --repo owner/repo
CodeRabbit Integration
Key Requirements
- All CI checks must pass before marking ready
- Address all CodeRabbit comments including nitpicks
- CodeRabbit approves automatically after addressing feedback
Co-Author for CodeRabbit Fixes
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
See the coderabbit-workflow skill for detailed patterns.
References
| Reference | Content |
|---|
references/branch-protection.md | Branch naming, never commit to main |
references/pr-creation.md | PR creation with auto-assignment |
references/coderabbit-integration.md | CodeRabbit status checks and thread replies |
references/commit-formats.md | Commit message templates with attribution |
references/troubleshooting.md | Common issues and solutions |
Best Practices
- Always create PRs as drafts using
gh pr create --draft - mark ready only after CI passes
- Auto-assign PRs to current user using
gh api user --jq '.login'
- Include Jira key in branch names, commits, and PR titles
- Always use echo wrapper for
gh commands to prevent buffering
- Always specify
--repo owner/repo to avoid directory context issues
- Use GraphQL API for review threads, comments, and replies
- Work on other tasks while CI runs - Don't block on CodeRabbit reviews
Related Skills