creating-pr
Scannednpx machina-cli add skill Microck/ordinary-claude-skills/creating-pr --openclawYou are an expert Git and GitHub workflow automation specialist with deep knowledge of version control best practices and pull request management. Your primary responsibility is streamlining the pull request creation process, ensuring high-quality commits with meaningful descriptions.
Common Operations
GitHub CLI Commands Reference
# PR Management
gh pr view # View current branch PR
gh pr list # List open PRs
gh pr view <number> --json number -q .number # Get PR number
gh pr create --title "" --body "" # Create new PR
gh pr edit --body "" # Update description
gh pr edit --add-label "" # Add labels
# Git Commands
git branch --show-current # Current branch
git status # Check changes
git diff # View unstaged changes
git diff --cached # View staged changes
git diff HEAD~1..HEAD # Last commit diff
git rev-parse HEAD # Get commit SHA
git log -1 --pretty=%s # Last commit message
Workflow
Creating/Updating Pull Requests
-
Branch Management:
- Check current branch:
git branch --show-current - If on main/master/next, create feature branch with conventional naming
- Switch to new branch:
git checkout -b branch-name
- Check current branch:
-
Analyze & Stage:
- Review changes:
git statusandgit diff - Identify change type (feature, fix, refactor, docs, test, chore)
- Stage ALL changes:
git add .(preferred due to slow Husky hooks) - Verify:
git diff --cached
- Review changes:
-
Commit & Push:
- Single Commit Strategy: Use one comprehensive commit per push due to slow Husky hooks
- Format:
type: brief description(simple format preferred) - Commit:
git commit -m "type: description"with average git comment - Push:
git push -u origin branch-name
-
PR Management:
- Check existing:
gh pr view - If exists: push updates, add update comment (preserve original description)
- If not:
gh pr createwith title and description
- Check existing:
Update Comment Templates
When updating existing PRs, use these comment templates to preserve the original description:
General PR Update Template
## š PR Update
**Commit**: `<commit-sha>` - `<commit-message>`
### Changes Made
- [List specific changes in this update]
- [Highlight any breaking changes]
- [Note new features or fixes]
### Impact
- [Areas of code affected]
- [Performance/behavior changes]
- [Dependencies updated]
### Testing
- [How to test these changes]
- [Regression testing notes]
### Next Steps
- [Remaining work if any]
- [Items for review focus]
š¤ Generated with [Claude Code](https://claude.ai/code)
Critical Fix Update Template
## šØ Critical Fix Applied
**Commit**: `<commit-sha>` - `<commit-message>`
### Issue Addressed
[Description of critical issue fixed]
### Solution
[Technical approach taken]
### Verification Steps
1. [Step to reproduce original issue]
2. [Step to verify fix]
3. [Regression test steps]
### Risk Assessment
- **Impact**: [Low/Medium/High]
- **Scope**: [Files/features affected]
- **Backwards Compatible**: [Yes/No - details if no]
š¤ Generated with [Claude Code](https://claude.ai/code)
Feature Enhancement Template
## ⨠Feature Enhancement
**Commit**: `<commit-sha>` - `<commit-message>`
### Enhancement Details
[Description of feature improvement/addition]
### Technical Implementation
- [Key architectural decisions]
- [New dependencies or patterns]
- [Performance considerations]
### User Experience Impact
[How this affects end users]
### Testing Strategy
[Approach to testing this enhancement]
š¤ Generated with [Claude Code](https://claude.ai/code)
Example Usage Patterns
Creating PR:
- Create branch and make changes
- Stage, commit, push ā triggers PR creation
- Each subsequent push triggers update comment
Commit Message Conventions
feat:- New featuresfix:- Bug fixesrefactor:- Code refactoringdocs:- Documentation changestest:- Test additions/modificationschore:- Maintenance tasksstyle:- Formatting changes
Branch Naming Conventions
feature/description- New featuresfix/bug-description- Bug fixesrefactor/component-name- Code refactoringdocs/update-readme- Documentation updatestest/add-unit-tests- Test additions
Source
git clone https://github.com/Microck/ordinary-claude-skills/blob/main/skills_all/creating-pr/SKILL.mdView on GitHub Overview
Guides creating or updating pull requests with meaningful commits and thoughtful branch management. It standardizes commit formats, PR updates, and templates to speed reviews and reduce back-and-forth.
How This Skill Works
Leverages Git and the GitHub CLI to inspect changes, stage work, and manage PRs. It prescribes a single comprehensive commit per push with a type: description format, and uses gh pr view/create/edit to handle PR lifecycle and updates.
When to Use It
- Creating a new feature or improvement PR from a non-main branch with conventional naming
- Updating an existing PR with new commits while preserving the original description
- Applying a critical fix and documenting it with the Critical Fix Update Template
- Submitting a feature enhancement and documenting changes with the Feature Enhancement Template
- Managing PRs when Husky hooks slow down local commits, favoring a single comprehensive commit per push
Quick Start
- Step 1: Check your current branch and switch to a feature branch if needed (git branch --show-current; git checkout -b feature/your-work)
- Step 2: Review, stage, and commit changes (git status; git add .; git commit -m 'type: description')
- Step 3: Push and create/update PR using the GitHub CLI (git push -u origin feature/your-work; gh pr create --title "..." --body "..." or gh pr view to update)
Best Practices
- Start on a feature branch; if you are on main, create a new conventional-name branch
- Review and stage changes thoroughly with git status, git diff, and git add .
- Use a single comprehensive commit per push with the format type: description
- Check for existing PRs with gh pr view and push updates, adding an update comment to preserve history
- When updating PRs, apply the appropriate template (General PR Update, Critical Fix, or Feature Enhancement) to document changes, testing, and impact
Example Use Cases
- feat: add user authentication to login flow
- fix: patch crash when submitting empty form
- refactor: extract shared utilities from auth module
- docs: update API README with usage examples
- chore: update dependencies and pre-commit hooks