Submit Pull Request
Create a pull request for the current branch.
Context
Current branch:
code
`! git branch --show-current`
Diff against main:
code
`! git diff main...HEAD`
Commit log:
code
`! git log --oneline main..HEAD`
Steps
- •
Check prerequisites:
- •Verify there are commits ahead of
main - •Verify the working tree is clean (no uncommitted changes). If dirty, ask user whether to commit first.
- •Verify lint and typecheck pass. If not, ask user whether to fix or proceed anyway.
- •Verify there are commits ahead of
- •
Push the branch to origin if not already pushed:
bashgit push -u origin HEAD
- •
Draft the PR description using the template in
.docs/pr-template.md. Fill in:- •Summary from the commit log and diff
- •What changed (files and components)
- •How to test (based on what was modified)
- •
Create the PR targeting
main:bashgh pr create --title "<title>" --body "<body>"
- •
Attach screenshots if
.screenshots/*.pngfiles exist:- •After creating the PR, build a markdown comment with the screenshot images
- •Upload and comment using:
bash
gh pr comment <PR_NUMBER> --body "$(cat <<'EOF' ## Screenshots <markdown table with image references> EOF )"
- •Clean up:
rm -rf .screenshots/
- •
Output the PR URL so the user can share it with reviewers.
Important
- •PR title: under 72 chars, use conventional commit prefix (feat:, fix:, etc.)
- •Keep the description concise but complete
- •Always target
mainunless told otherwise