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
--draftflag - Auto-Assignment - Always assign PRs to the current user after creation
- Prevent Terminal Buffering - Use echo wrappers for
ghcommands - 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
- Core Principles
- When to use this skill
- Workflow Overview
- Quick Reference
- CodeRabbit Integration
- References
- Best Practices
- Related Skills
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 featuresfix/- Bug fixeschore/- Maintenancedocs/- Documentationrefactor/- Code restructuring
Prevent Terminal Buffering
# Always use echo wrapper for gh commands
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
# Check CI status
gh pr checks <PR_NUMBER> --repo owner/repo
# View PR details
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
ghcommands to prevent buffering - Always specify
--repo owner/repoto 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
| Skill | Purpose | |-------|---------| | coderabbit-workflow | Thread replies, comment export, local CLI reviews | | jira-integration | Ticket creation and Jira key integration | | stacked-prs | Stacked PR management and merge workflows |
<!-- AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY --> <!-- Source: bitsoex/ai-code-instructions β global/skills/pr-workflow/SKILL.md --> <!-- To modify, edit the source file and run the distribution workflow -->