Generate PR title and description following Conventional Commits
Generates PR title and description from branch commits following Conventional Commits format.
/plugin marketplace add pproenca/dot-claude-old/plugin install commit@dot-claude[base-branch]Create a PR title and description from branch commits following Conventional Commits format.
Determine base branch (default: origin/main or origin/master):
# Get default branch
DEFAULT_BRANCH=$(git remote show origin 2>/dev/null | grep 'HEAD branch' | cut -d' ' -f5)
BASE_BRANCH="${1:-$DEFAULT_BRANCH}"
# Get branch point
BRANCH_POINT=$(git merge-base HEAD origin/$BASE_BRANCH 2>/dev/null || git merge-base HEAD $BASE_BRANCH)
# Get current branch
CURRENT_BRANCH=$(git branch --show-current)
echo "Current branch: $CURRENT_BRANCH"
echo "Base branch: $BASE_BRANCH"
echo "Branch point: $BRANCH_POINT"
Get all commits on this branch:
git log --oneline $BRANCH_POINT..HEAD
Get combined diff stats:
git diff --stat $BRANCH_POINT..HEAD
Read each commit message to understand the full scope of changes:
git log --format='%B---' $BRANCH_POINT..HEAD
Analyze the commits to determine the primary type for the PR title.
Type priority (use the most significant):
feat - Any new feature makes this a feature PRfix - Bug fixes if no featuresrefactor - Restructuring if no features/fixesperf - Performance improvementsdocs - Documentation changestest - Test additionsbuild/ci - Build/CI changeschore - MaintenanceBreaking change: If ANY commit has ! or BREAKING CHANGE:, the PR title should include !.
Single commit: Use that commit's type and subject directly.
Multiple commits with same type: Use that type, summarize the changes.
Multiple commits with different types: Use the highest priority type, describe the overall change.
The PR title should follow Conventional Commits format:
<type>: <summary of changes>
Add ! before the colon for breaking changes (e.g., feat!: remove API).
Rules:
Examples:
| Commits | PR Title |
|---|---|
Single feat: add user preferences | feat: add user preferences |
feat: add auth, feat: add sessions | feat: add authentication system |
feat: add API, fix: handle errors | feat: add API with error handling |
refactor: extract service, test: add tests | refactor: extract service with tests |
feat!: remove v1 API | feat!: remove v1 API |
Structure the description following this template:
## Summary
[1-3 sentences explaining WHAT this PR does and WHY]
## Changes
[Bullet list of commits/changes, grouped logically by type]
### Features
- [feat commits]
### Bug Fixes
- [fix commits]
### Other Changes
- [refactor/chore/etc commits]
## Context
[Background that helps reviewers understand the change]
- Problem being solved
- Why this approach was chosen
- Any tradeoffs or limitations
## Breaking Changes
[If any commits have breaking changes, list them here]
- [Description of breaking change and migration path]
## Test Plan
[How to verify this works]
- [ ] Unit tests pass
- [ ] Integration tests pass
- [ ] Manual testing: [steps if applicable]
Note: Omit empty sections (e.g., if no breaking changes, omit that section).
Present the generated title and description, then validate with AskUserQuestion:
Output the final PR content formatted for copy-paste:
## PR Title
[title]
## PR Description
[full description]
gh pr create --title "..." --body "..." to create the PR/commit:reset first