Create a draft GitHub pull request following the project template
Create a draft pull request using gh CLI, following the project's pull_request_template.md format.
Run these commands in parallel to understand the current state:
git status to see all changes (never use -uall flag)git branch --show-current to get current branch namegit log origin/main..HEAD --oneline to see commits that will be in the PRgit diff origin/main...HEAD --stat to see changed files summaryRead the PR template from .github/pull_request_template.md
Check if the current branch tracks a remote:
-u flag: git push -u origin <branch-name>Analyze all commits and changes, then fill in the template sections:
[x] for applicable types based on commitsCreate the draft PR using HEREDOC format:
gh pr create --draft --title "type(scope): description" --body "$(cat <<'EOF'
<filled template content here>
EOF
)"
Use Conventional Commits format:
| Type | Description |
|---|---|
feat |
A new feature |
fix |
A bug fix |
docs |
Documentation only changes |
style |
Changes that do not affect the meaning of the code |
refactor |
A code change that neither fixes a bug nor adds a feature |
perf |
A code change that improves performance |
build |
Changes that affect the build system or external deps |
ci |
Changes to CI configuration files and scripts |
chore |
Other changes that don't modify src or test files |
When filling "Types of Changes" section:
feat → 🚀 New featurefix → 🕷 Bug fixperf → 👏 Performance optimizationrefactor → 🛠 Refactordocs → 📝 Documentationtest → ✅ Testbuild, chore with deps → 📗 Library updateIf $ARGUMENTS is provided:
main, develop), use it as base branch with --baseCommon gh pr create options:
--base <branch>: Target branch (default: main)--assignee @me: Assign to yourself--label <name>: Add labels--reviewer <handle>: Request reviewers.github/pull_request_template.md first to get the current template format--draft flagmain or master branch<!-- -->) from the filled template