Branch and PR
Create a new branch, commit current changes, and open a pull request in one workflow.
Workflow
- •Analyze changes: Run
git statusandgit diffto understand what changed - •Generate branch name: Format
{username}/{type}-{short-description}- •Get username from
git config user.name(lowercase, no spaces) - •Type: feat, fix, refactor, docs, test, chore, perf, style
- •Description: 2-4 words, kebab-case, derived from changes
- •Get username from
- •Create branch:
git checkout -b {branch-name} - •Stage and commit:
- •Stage all changes:
git add -A - •Commit with conventional message:
{type}: {description}(max 72 chars)
- •Stage all changes:
- •Pause for confirmation: Show the user what will be pushed
- •On confirmation: Push and create PR via
gh pr create
Commit Message Style
- •Conventional format:
type: lowercase description - •No period at end
- •Imperative mood ("add" not "adds" or "added")
- •Max 72 characters
- •Examples:
- •
fix: handle null user in auth middleware - •
feat: add dark mode toggle to settings - •
refactor: extract validation logic to helper
- •
PR Description Style
Write like a human developer, not an AI:
- •Title: Same as commit message or slightly expanded
- •Body structure:
code
Brief 1-2 sentence summary of what this does. - Bullet points for specific changes if needed - Keep it scannable Tested by [how you verified it works]
Avoid:
- •"This PR introduces..." / "This commit adds..."
- •Overly formal language
- •Excessive bullet points
- •Explaining obvious things
- •Words like "comprehensive", "robust", "enhance"
Good examples:
- •"Fixes the crash when user logs out during sync"
- •"Adds retry logic for flaky API calls - was causing random failures in prod"
- •"Cleans up the auth module, no behavior changes"
Confirmation Prompt
Before pushing, show:
code
Branch: {branch-name}
Commit: {commit-message}
Changes to be pushed:
{file list}
Ready to push and create PR? (y/n)
Wait for explicit user confirmation before proceeding.