When to use
- Branch needs PR text.
- Commit history should drive summary.
- User wants a short review-ready description.
Goal
Create one concise PR paragraph from branch commits.
Use fixes when commits indicate a fix.
Use implements otherwise.
Rules
- Use commit messages as source of truth.
- Include user context only when it clarifies intent or scope.
- Keep output short.
- Do not invent changes not shown by commits or context.
- Stop if branch has no commits over base.
Commands
git rev-parse --git-dir
git branch --show-current
git log main..HEAD --pretty=format:"%s"
Flow
- Verify current directory is a git repository.
- Use
mainas comparison point. - Get commits between
mainandHEAD. - Stop if no branch commits exist.
- Scan commit messages for
fix,fixup, orbugfix. - Use
fixeswhen fix keywords are found. - Otherwise use
implements. - Write one paragraph starting with
This PR ${TYPE}....
Errors
- Not in git repo: report missing repository.
- No branch commits: report nothing to summarize.
- Base branch missing: ask for base branch or use known project default.
Output
This PR fixes/implements [short summary from commits].