Create PR
Run only when the user asks to create a PR. Do not stage or commit. Write the title and body in English (Japanese only if the user explicitly asks).
Procedure
- Inspect changes in parallel (base = default branch; if
mainis missing, resolve withgit symbolic-ref refs/remotes/origin/HEAD):git log $(git merge-base HEAD <base>)..HEAD --onelinegit diff $(git merge-base HEAD <base>)..HEAD --stat
- Draft title and body. Follow
.github/pull_request_template.mdif present. Otherwise:
## Summary
<brief description>
## Changes
- <change>
## Related Issues / Links
- Fixes #<issue-number>
git push -u origin <branch_name>- Create (pass
--draftonly when the user explicitly asks for a draft):
gh pr create [--draft] --title "<title>" --body "$(cat <<'EOF'
<body>
EOF
)"
- Report the PR URL
Gotchas
- If
ghis missing or unauthenticated, stop and ask the user to set it up - If the push is rejected, stop and ask the user to resolve conflicts