Create GitHub pull requests using a custom template with auto-generated content. Use when the user asks to create a PR, open a pull request, or submit changes for review...
Create GitHub pull requests using a custom template with auto-generated content based on commit analysis.
gh) must be installed and authenticatedWhen the user asks to create a PR, follow this workflow:
Verify branch status
Analyze commits
git log <base-branch>..<current-branch> to see all commitsgit diff --stat <base-branch>...<current-branch> for change summarygit diff <base-branch>...HEAD for detailed changesGenerate PR content
Create PR with template
assets/pr-template.md{{TYPE_CHECKBOXES}} - Checkboxes with auto-detected types marked{{DESCRIPTION}} - Concise functional description{{BEHAVIOR}} - User-facing behavior changes (bullet points){{TEST_STEPS}} - Testing checklist itemsgh pr create with the filled templateGenerate markdown checkboxes based on commit analysis:
- [x] Feature
- [ ] Bug Fix
- [ ] Refactor
- [ ] Optimization
- [ ] Documentation Update
Detection rules:
Concise functional description (2-3 sentences). Focus on WHAT changed, not HOW:
User-facing behavior changes as bullet points:
Testing checklist using GitHub checkboxes (- [ ]):
- [ ] Verify task creation with all fields
- [ ] Test priority filtering on task list
- [ ] Check validation error messages
Include functional tests relevant to the changes.
gh pr create \
--title "Add task priority filtering" \
--base main \
--body "$(cat filled-template.md)"
gh pr create \
--title "Add task priority filtering" \
--base main \
--body "$(cat filled-template.md)" \
--label "feature,frontend" \
--milestone "v2.0"
gh pr create --title "PR Title" --base main --body "$(cat <<'EOF'
## ✅ Type of PR
- [x] Feature
...
EOF
)"
gh not installed: Instruct to install GitHub CLIgh auth logingit push -u origin <branch>assets/pr-template.md existsBefore creating PR:
# Check if branch exists on remote
if ! git ls-remote --heads origin "$BRANCH" | grep -q "$BRANCH"; then
git push -u origin "$BRANCH"
fi
# Check if local is ahead
if [ "$(git rev-parse @)" != "$(git rev-parse @{u})" ]; then
git push
fi
User asks: "Create a PR for my task filtering feature"
Verify setup:
git branch --show-current
git status
Analyze commits:
git log main..current-branch --oneline
git diff --stat main...current-branch
git diff main...HEAD
Generate content:
Fill template and create PR:
gh pr create \
--title "Add task priority filtering" \
--base main \
--body "<filled template content>" \
--label "feature,frontend"
assets/pr-template.md{{PLACEHOLDER_NAME}}