gh-pr
Use this skill when creating a GitHub pull request. Defines PR body format with Why/What/Notes sections and ensures proper assignment.
When & Why to Use This Skill
The gh-pr skill streamlines the software development lifecycle by automating the creation of GitHub Pull Requests through the GitHub CLI. It enforces a standardized documentation structure—specifically 'Why', 'What', and 'Notes'—to ensure every code change is accompanied by clear, actionable context. This tool enhances team collaboration by automating repetitive formatting tasks and ensuring best practices in version control management.
Use Cases
- Standardizing Team Workflows: Enforce a consistent Pull Request template across the engineering team to improve readability and simplify the code review process.
- Automated PR Generation: Use the Claude agent to instantly draft and submit PRs with properly formatted titles and bodies, reducing manual overhead for developers.
- Project Management Integration: Ensure every code contribution is linked to its motivation and specific changes, making it easier to track project progress and historical decisions.
- Best Practice Compliance: Automatically apply rules such as imperative mood in titles and mandatory self-assignment to maintain a high-quality repository history.
| name | gh-pr |
|---|---|
| description | Use this skill when creating a GitHub pull request. Defines PR body format with Why/What/Notes sections and ensures proper assignment. |
GitHub Pull Request Creation
When creating a pull request, use the gh CLI with the following format and
conventions.
PR Body Format
## Why?
[Explain the motivation for this change. What problem does it solve?]
## What?
[Describe what was changed. List the key modifications.]
## Notes
[Optional. Additional context, testing notes, or follow-up items.]
Command Template
gh pr create --assignee @me --title "<title>" --body "$(cat <<'EOF'
## Why?
<motivation>
## What?
<changes>
## Notes
<optional notes>
EOF
)"
Rules
- Always assign PR to
@meusing--assignee @me ## Why?- Required. Explain motivation and problem being solved## What?- Required. Describe the changes made## Notes- Optional. Include only if there are additional notes- Omit
## Notessection entirely if no notes are needed - Use imperative mood in title (e.g., "Add feature" not "Added feature")
- Keep title concise and descriptive
Example
gh pr create --assignee @me --title "Add user authentication" --body "$(cat <<'EOF'
## Why?
Users need secure access to their accounts. Currently there is no
authentication mechanism in place.
## What?
- Add login/logout endpoints
- Implement JWT token generation
- Add password hashing with bcrypt
- Create auth middleware for protected routes
## Notes
Requires `JWT_SECRET` env variable to be set in production.
EOF
)"