| name | git-pr |
| description | Create clean PRs with safe pushes and a good summary. |
| compatibility | opencode |
| metadata | {"workflow":"git","audience":"engineers"} |
What I do
- Prepare a branch for review (clean commits, up-to-date base).
- Push safely to a remote (no force push unless explicitly confirmed).
- Create a PR with
gh when available.
When to use me
- You want to open a PR from your current branch.
- You want a consistent PR body (summary/testing/risk).
Guardrails
- Never push to
main/master directly.
- Never
push --force (or --force-with-lease) unless the user explicitly confirms.
- Never include secrets in diffs (warn if
.env, credentials*, *.pem, etc. are present).
Workflow
- Check branch and working tree:
git status
git branch --show-current
- Review changes to be included:
git diff <base>...HEAD (base defaults to main unless detected otherwise)
git log --oneline <base>..HEAD
- Ensure remote tracking:
git remote -v
git status -sb
- Push:
- If no upstream:
git push -u origin HEAD
- Else:
git push
- Create PR (GitHub):
- Use
gh pr create with a structured body:
gh pr create --title "..." --body "$(cat <<'EOF'
## Summary
- ...
## Testing
- ...
## Risk / Rollback
- ...
EOF
)"
- Verify:
gh pr view --web (or print PR URL)
If gh is not available
- Provide commands to push the branch and instruct the user to open a PR in the UI.
PR writing rules
- Title: short, action-oriented.
- Body: 3โ6 bullets max.
- Mention testing explicitly (even if โnot runโ).