Create a GitHub pull request following project conventions. Use when the user asks to create a PR, submit changes for review, or open a pull request. Handles commit analysis, branch management, and PR creation using the gh CLI tool.
Install with Tessl CLI
npx tessl i github:warpdotdev/oz-skills --skill create-pull-request89
Does it follow best practices?
If you maintain this skill, you can automatically optimize it using the tessl CLI to improve its score:
npx tessl skill review --optimize ./path/to/skillValidation for skill structure
This skill guides you through creating a well-structured GitHub pull request that follows project conventions and best practices.
Before proceeding, verify the following:
gh CLI is installedgh --versionIf not installed, inform the user:
The GitHub CLI (
gh) is required but not installed. Please install it:
- macOS:
brew install gh- Other: https://cli.github.com/
gh auth statusIf not authenticated, guide the user to run gh auth login.
Before creating a PR, check if any skills are available that relate to code review, CI, or testing. These should be invoked first as prerequisites.
Look for skills with descriptions containing:
If such skills exist, invoke them before proceeding with PR creation. For example:
ci-fix skill exists and CI is failing, use it to diagnose and fix issuesweb-design-guidelines skill exists for UI changes, use it to review the changesOnly proceed with PR creation after these prerequisite skills have been satisfied.
git statusIf there are uncommitted changes, ask the user whether to:
Before gathering context, check if a PR already exists for the current branch:
gh pr list --head $(git branch --show-current) --json number,title,urlIf a PR already exists:
gh pr viewOnly proceed with creating a new PR if no PR exists for this branch.
git branch --show-currentEnsure you're not on main or master. If so, ask the user to create or switch to a feature branch.
git remote show origin | grep "HEAD branch"This is typically main or master.
git log origin/main..HEAD --oneline --no-decorateReview these commits to understand:
git diff origin/main..HEAD --statThis shows which files changed and helps identify the type of change.
Gather the following information from available context (commit messages, branch names, changed files):
Related Issue Number: Look for patterns like #123, fixes #123, or closes #123 in:
fix/issue-123, feature/123-new-login)Description: What problem does this solve? Why were these changes made?
Type of Change: Bug fix, new feature, breaking change, refactor, cosmetic, documentation, or workflow
Test Procedure: How was this tested? What could break?
The PR title should be descriptive and meaningful. Avoid generic titles like:
Instead, create a title that clearly summarizes the changes. Consider these approaches:
Check if the project uses conventional commits by analyzing:
feat:, fix:, docs:, refactor:, test:, chore:feat/, fix/, docs/If conventional commits are detected, use the appropriate prefix for the PR title:
feat: Add user authentication with OAuthfix: Resolve memory leak in data processingdocs: Update API documentation for v2 endpointsrefactor: Simplify error handling logictest: Add integration tests for payment flowchore: Update dependencies to latest versionsInclude issue number if found:
feat: Add user authentication with OAuth (#123)fix(auth): Resolve memory leak in data processing (fixes #456)If not using conventional commits, create a clear, action-oriented title:
Include issue number if found:
Before creating the PR, consider these best practices:
Rebase on latest main (if needed):
git fetch origin
git rebase origin/mainSquash if appropriate: If there are many small "WIP" commits, consider interactive rebase:
git rebase -i origin/mainOnly suggest this if commits appear messy and the user is comfortable with rebasing.
Ensure all commits are pushed:
git push origin HEADIf the branch was rebased, you may need:
git push origin HEAD --force-with-leaseIMPORTANT: Read and use the PR template at .github/pull_request_template.md if it exists. The PR body format should match the template structure.
When filling out the template:
Fixes #123, Closes #456) if found in contextDecide whether to create a draft PR or a regular PR based on the following:
Use --draft flag when:
Use regular PR (no --draft) when:
For a regular PR:
gh pr create --title "PR_TITLE" --body "PR_BODY" --base mainFor a draft PR:
gh pr create --title "PR_TITLE" --body "PR_BODY" --base main --draftAfter creating the PR:
Immediately open the PR in the browser to verify it was created correctly:
gh pr view --webThis allows you to:
Tests and linting will run automatically. Monitor the checks to ensure they pass.
gh pr edit --add-reviewer USERNAMEgh pr edit --add-label "bug"No commits ahead of main: The branch has no changes to submit
Branch not pushed: Remote doesn't have the branch
git push -u origin HEADPR already exists: A PR for this branch already exists
gh pr viewMerge conflicts: Branch conflicts with base
Before finalizing, ensure:
gh CLI is installed and authenticated2ca570e
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.