create-pull-request
SKILL.md
Create Pull Request
This skill ensures pull requests are created correctly using the gh CLI, adhering to branch naming, commit formatting, and PR templates.
Before Creating a PR (Pre-flight Checklist)
Before running gh pr create, please verify the state of the repository. Explain to the user why these checks are important for a clean Git history and smooth review process:
- Check uncommitted changes: Are there uncommitted changes? (Run
git status). If yes, ask the user if they want them committed or stashed. - Review your own diff: Do the changes match the PR intent? (Run
git diff main...HEADor similar). Avoid creating a PR without reviewing the diff so you can catch accidental inclusions like secrets or debug statements. - Check the branch: Are you on the correct branch? Ensure you are opening a PR from a feature branch rather than directly from
mainormasterto prevent accidental merges of incomplete work. - Push the branch: Ensure the branch is pushed to the remote (
git push -u origin <branch-name>) before creating the PR, otherwise theghCLI will fail.
Expected Output
When a user asks to create a PR, clearly state the steps you are taking to verify the state of the repository and the branch. Once checks are complete, provide the exact gh pr create command that will be executed, and wait for the user to confirm before proceeding.