From PR Generate Description Skill
Generate structured pull request descriptions from git diffs through an interactive questionnaire. Use this skill before opening, creating, or updating any GitHub pull request body, including when the user or agent will run gh pr create, gh pr edit --body, create/open/submit a PR, open a pull request, mark ready for review, ship this branch, compare branches for review, describe changes, write the PR body, refresh an existing PR description, or document changes for code review. Always ask the user for motivation first.
How this skill is triggered — by the user, by Claude, or both
Slash command
/pr-generate-description:pr-generate-descriptionThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate comprehensive pull request descriptions by analyzing code changes and
Generate comprehensive pull request descriptions by analyzing code changes and asking the user for the motivation. The diff can explain what changed; the user must provide why it matters.
Load and follow this skill before any of these unless the user explicitly opts out:
gh pr create.Do not draft PR descriptions from memory alone when this skill applies.
AskUserQuestion.references/template.md.Run:
git rev-parse --abbrev-ref HEAD
git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' || echo "main"
git log --oneline BASE_BRANCH..HEAD
git diff BASE_BRANCH...HEAD --stat
git diff BASE_BRANCH...HEAD
If no git repo is found or the diff is empty, inform the user and ask them to provide context manually.
Determine whether a PR already exists for the current branch before delivery:
gh pr view --json number,url,state 2>/dev/null
gh pr list --head "$(git rev-parse --abbrev-ref HEAD)" --state all --json number,url,state
gh is unavailable or fails, assume no PR exists unless the user says one
is already open.From the diff, extract:
references/categories.md.Keep this analysis internal. Use it to power the questionnaire and final output.
For very large diffs, focus on --stat and file-level summaries, warn the user,
and offer to focus on specific directories.
Ask the motivation first in prose and wait for the user:
What is the motivation or the why behind this PR? Briefly describe the problem it solves or the goal it achieves.
This is mandatory and must never be auto-generated.
After receiving motivation, ask these formatting decisions with AskUserQuestion:
[video_url], or user will provide URL.If the user chooses to provide a video URL, ask them to paste it.
Read references/template.md first, then consult:
references/categories.md for grouping guidance.references/mermaid-guide.md when generating a Mermaid diagram.examples/ when a nearby style example would help.Writing style:
Section rules:
graph TD and keep diagrams small.Formatting:
## for top-level sections.Choose delivery based on PR state:
pr-description.markdown.
Pass the description to gh pr create via --body-file.pr-description.markdown by default. Present
the full description in chat and update with gh pr edit --body only if the
user asks.pr-description.markdown in the repository root, then also show the
description in chat.Suggest 2 or 3 plain PR titles:
main, then master, then ask the user.gh unavailable: skip PR detection and use the no-PR draft path unless the
user states otherwise.Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub rafaeelricco/dotfiles --plugin pr-generate-description