Create PR Skill
Create a GitHub Pull Request with a standardized description.
Instructions
- •
Get the current branch name and extract the ticket ID (e.g.,
MT-9082fromfix/MT-9082_action_buttons) - •
Detect the base branch (target for PR):
bash# Find the most recent release branch or fall back to master/main git branch -r | grep -E 'origin/release/[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -1 | xargs
If no release branch found, use
origin/masterororigin/main. - •
Get the commits on this branch vs the base branch:
bashgit log <BASE_BRANCH>..HEAD --oneline
- •
Get the changed files:
bashgit diff <BASE_BRANCH>..HEAD --stat
- •
Generate a PR description using this template:
markdown
## Summary [Brief description of what this PR does - infer from commits and changed files] ## Ticket [TICKET_ID if found, otherwise "N/A"] ## Changes [List main changes based on commits] 6. Ask the user to confirm or edit the generated description 7. Create the PR using GitHub CLI: ```bash gh pr create --base <BASE_BRANCH> --title "<TYPE>/<TICKET_ID> Brief title" --body "GENERATED_DESCRIPTION"
Title format: <TYPE>/<TICKET_ID> Brief title
Types (infer from commits and branch name):
- •
feat- New feature or functionality - •
fix- Bug fix - •
refactor- Code refactoring without changing behavior - •
docs- Documentation only changes - •
style- Formatting, missing semicolons, etc (no code change) - •
test- Adding or updating tests - •
chore- Maintenance tasks, dependencies, configs - •
perf- Performance improvements - •
ci- CI/CD changes
Examples:
- •
feat/MT-9082 Add user authentication - •
fix/MT-9082 Button disabled state styling on Android - •
refactor/MT-9082 Migrate to react-hook-form
Usage
Invoke with /create-pr when ready to create a pull request for the current branch.