Draft a PR title and description from the branch's real commits and diff, fill the repo's PR template, and leave unverified checklist items unticked.
--- name: git-pr-description description: Drafts a pull request title and description from the branch's actual commits and diff - summary, changes, how to test, risks and linked issues - and fills the repository's PR template if one exists. Leaves checklist items unticked unless they were verified and never invents test results. Use when asked to write a PR description, summarize a branch for review, or prepare a pull request body. compatibility: Needs git in the repository. Opening the PR is optional and needs the gh CLI or a GitHub connector the user already configured. metadata: version: "1.1.0" --- # Pull Request Description Generator Writes a description a reviewer can trust: everything in it comes from the commits, the diff, the linked issue, or something the agent ran in this session. ## Inputs to collect - Base branch (default: the repository's default branch, e.g. `main`; confirm if unsure). - Linked issue numbers, if not already in commit messages. - Anything the diff cannot show: motivation, screenshots, rollout notes. ## Workflow 1. **Read the branch (read-only).** ```bash git fetch origin main # only if the user is fine with a fetch git log --no-merges --format='%h %s%n%b' origin/main..HEAD git diff --stat origin/main...HEAD git diff origin/main...HEAD # read the actual changes ``` Use `main` instead of `origin/main` if there is no remote. Three dots in `diff` compare against the merge base, so changes already on main are excluded. 2. **Find the template.** Look for `.github/pull_request_template.md`, `.github/PULL_REQUEST_TEMPLATE.md`, `pull_request_template.md` in the root or `docs/`, or `.github/PULL_REQUEST_TEMPLATE/*.md`. If found, fill its headings in order; otherwise use the default below. 3. **Write each section from evidence.** - **Title**: one line, imperative, under ~72 characters. Reuse the main commit's subject if it fits. - **Summary**: what changes for users or developers and why (from commit bodies, issue, or the user). - **Changes**: grouped by area, citing files from `git diff --stat`. Call out migrations, config/env changes, dependency changes and breaking changes explicitly. - **How to test**: concrete steps for a reviewer. Include the project's test command from its scripts/Makefile. Report test results only if you ran them in this session; otherwise write "Not run by the author of this description." - **Risks / rollout**: what could break, feature flags, backward compatibility. - **Related issues**: `Closes #123` only if the user or a commit says it closes that issue; otherwise `Refs #123`. 4. **Checklist**: keep template checkboxes, tick (`[x]`) only items you verified (for example tests were added in this diff). Leave the rest `[ ]` for the author. 5. **Return the draft.** Opening or editing the PR is a write: only on request, after the user approves the text, e.g. `gh pr create --base main --title "..." --body-file pr.md`, then report the URL gh prints. ## Default template ```markdown ## Summary ## Changes ## How to test ## Risks and rollout ## Related issues ## Checklist - [ ] Tests added or updated - [ ] Documentation updated - [ ] No breaking changes (or described above) ``` ## Example Branch `feature/rate-limit` against `main`: commits `feat(api): cap requests at 100 per minute` and `test(api): cover rate cap`; diff stat `src/rate.js | 2 +-`, `test/rate.test.js | 1 +`. Draft title "Cap API requests at 100 per minute". Changes cite both files. How to test lists the project's test command and "Not run by the author of this description." Checklist: "Tests added or updated" ticked (the diff adds `test/rate.test.js`), the others left unticked. Related issues empty because none was given. ## Limitations - Large branches: summarize per area and list the files you did not read closely. - Does not invent screenshots, performance numbers or reviewer names.
Write a Conventional Commits message from staged git changes, with a read-only helper script that gathers the staged diff and recent commit style.
Turn an issue title or ticket ID into a consistent, git-valid branch name like fix/JIRA-123-login-button-not-working, with explicit type, case and length rules.
Work on multiple branches simultaneously
Illustrative input and expected result. This example is a verification guide, not a recorded model run.
Content reviewed .
A developer has two commits on feature/rate-limit and wants a reviewer-ready PR body that matches the repository's template.
Write the PR description for my current branch feature/rate-limit against main. No linked issue. Don't open the PR yet.
A draft built from `git log --no-merges main..HEAD` (feat(api): cap requests at 100 per minute; test(api): cover rate cap) and `git diff --stat main...HEAD` (src/rate.js, test/rate.test.js), using the headings of .github/pull_request_template.md if present. Title: 'Cap API requests at 100 per minute'. How to test gives the test command and says tests were not run by the description's author. Only 'Tests added or updated' is ticked; no 'Closes #' line; nothing is posted.
AI Agent Skills are reusable workflow packages that extend your AI coding assistant with multi-step capabilities. Install git-pr-description by following these steps.
SKILL.md inside, in the location documented by your client. Do not assume every AI application reads the same directory.Requires an Agent Skills-compatible client; supported locations and activation vary by version. Read the SKILL.md setup guide. MCP connects tools and data and does not, by itself, install a skill.
Write a Conventional Commits message from staged git changes, with a read-only helper script that gathers the staged diff and recent commit style.
Turn an issue title or ticket ID into a consistent, git-valid branch name like fix/JIRA-123-login-button-not-working, with explicit type, case and length rules.
Work on multiple branches simultaneously