Draft and create GitHub pull requests from conversation context with structured formatting and tag selection.
Reviews the current branch's changes, drafts a well-formatted pull request, and creates it after user confirmation.
# [tag][#issue-number] Brief description of what was accomplished
## Summary
Concise overview of the completed work and the value it delivers.
## Changes
- Modified `path/to/file:lines` — what changed and why
- Added `path/to/new_file` — purpose
- Deleted `path/to/old_file` — reason
## Testing
- Added `tests/test_feature.py` — verifies behaviour X
- Manually tested scenario Y
## Related Issue
Closes #issue-number
Check whether the project defines its own tag list (common locations: docs/git-msg-tags.md, CONTRIBUTING.md). If none is found, use these defaults:
| Tag | When to use |
|---|
[feat] | New functionality |
[fix] | Bug fix |
[docs] | Documentation-only change |
[refactor] | Restructuring without behaviour change |
[test] | Test-only change |
[chore] | Tooling, CI, or dependency updates |
Before drafting anything, inspect what the branch contains:
git status
git diff
git log origin/main..HEAD --oneline
Understand the full scope of changes — not just the latest commit, but everything that will land when the PR merges.
The PR title must reference an issue number in the format [tag][#N].
Where to look:
issue-42)gh issue list --limit 10If no related issue exists, ask the user to create one first.
Title: [tag][#N] Brief description — past tense, under 80 characters for the description portion.
Summary: What was achieved and why it matters.
Changes: List every file modified, added, or deleted with a brief note. Include line ranges where helpful. Do not paste code snippets.
Testing: What was tested and how — new test files, manual verification steps, etc.
Related Issue: Use Closes #N, Fixes #N, or Part of #N as appropriate.
Display the complete draft and wait for explicit approval.
Ensure the branch is on the remote:
git push -u origin $(git branch --show-current)
Then create the PR:
gh pr create --title "TITLE" --body-file - <<'EOF'
BODY
EOF
Display the PR URL to the user.
| Problem | Action |
|---|---|
| No issue number found | Ask user to provide one or create an issue first |
| No changes on the branch | Inform user there's nothing to open a PR for |
| GitHub CLI not authenticated | Ask user to run gh auth login |
| Not on a feature branch | Warn user and suggest creating one |
| Push fails | Show the error and suggest resolution |
The PR is created on behalf of the user. The AI agent must not add any authorship or co-authorship attribution.