Generate PR text (title, description, test plan) for the current branch. Do not open a PR or push anything — only output markdown text.
Steps:
- Determine the base branch: use
$1if provided. Otherwise trymain; ifmaindoes not exist as a branch, usemaster. - Run
git merge-base <base> HEADto get the merge-base commit. - Run
git log <merge-base>..HEAD --no-merges --pretty=format:%sto get commit subjects since the merge-base. - Run
git diff <merge-base>..HEAD --statto get the changed files and diff stat. - From these, generate:
- Title: a single-line, conventional-commit-style summary of the overall change (e.g.
feat: add X,fix: correct Y). Base it on the overall theme of the commits, not just the first commit. - Description: short bullet points synthesized from the commit subjects. Group related/overlapping commits into single bullets instead of listing every commit verbatim. Keep it factual — only describe what the commits and diff actually say.
- Test Plan: a checklist inferred mechanically from the file types/areas touched in the diff stat. Examples of the mapping to apply:
- Test files changed (
*test*,*spec*) -> "Run the test suite" - Config/dependency files changed (
package.json,*.lock,requirements.txt,Cargo.toml,go.mod, Dockerfile, CI config) -> "Verify build/install still works" - UI/frontend files changed (
.tsx,.jsx,.vue,.css,.html) -> "Manually verify affected screens" - Docs changed (
.md,docs/) -> "Proofread rendered docs" - Otherwise/generally -> "Review the diff for correctness" Keep items generic and mechanical — do not invent specific test scenarios that require domain knowledge of the change.
- Test files changed (
- Title: a single-line, conventional-commit-style summary of the overall change (e.g.
- Output the final result as markdown ready to paste directly into a PR, in this shape:
## Title
<title>
## Description
- <bullet>
- <bullet>
## Test Plan
- [ ] <item>
- [ ] <item>
Do not include any other commentary before or after the markdown output.