Workflow
- Preflight
- Confirm git repo, branch, and commits exist
- Ensure current branch is NOT
mainormaster— abort if so - Check for unpushed commits
- Analyze
- Use
git diff <target-branch>...HEADto analyze changes since diverging from the target branch - Check for PR template: try to read
.github/pull_request_template.mdorpull_request_template.md
- Use
- Draft
- If existing PR:
- Fetch context (reviews, comments) using
tool__gh--retrieve-pull-request-info - If a template was found, validate the existing body against it and draft updates conforming to the template
- Draft content updates based on reviews/comments
- Fetch context (reviews, comments) using
- If new PR:
- If template found: fill it out with the summary of changes (do not change template structure or headers)
- If no template: draft a standard title and body
- Use
tool__gh--retrieve-repository-collaboratorsto list available reviewers - Ask the user: "Who should be the reviewer?"
- Present the draft (title, body) and wait for approval
- If existing PR:
- Publish (only after explicit approval)
- Push commits if needed: use
tool__git--push - Use
tool__gh--create-pull-request(new) ortool__gh--edit-pull-request(existing) - Use user-provided reviewers
- Report the final PR URL
- Push commits if needed: use
PR Title Format
Follow Conventional Commits for the PR title:
| Prefix | When to Use |
| ----------- | ------------------------ |
| feat: | New feature |
| fix: | Bug fix |
| refactor: | Code refactoring |
| docs: | Documentation only |
| chore: | Maintenance, deps, CI |
| test: | Adding or updating tests |
PR Body Guidelines
- If a PR template exists, conform to its structure and headers exactly
- Summarize changes clearly — explain why, not just what or how
- Use markdown formatting for readability
Example Output
For a branch with 3 commits adding a new caching layer:
Title: feat: add Redis caching for user session lookups
Body:
## Summary
- Add Redis-based caching for user session lookups to reduce DB load
- Cache TTL is 15 minutes with automatic invalidation on session update
- Add `RedisCacheService` with connection pooling and retry logic
Constraints
- NEVER create or update a PR without explicit user approval
- NEVER auto-select or recommend reviewers — list collaborators and let the user choose
- NEVER push without explicit approval
- NEVER force-push to main/master