testdouble/han/update-pr-description
Claude Code and agent skill by testdouble/han
- community
Checking that the SKILL.md file is still in the repository.
Generate a PR description from the current branch's changes against a GitHub PR, using the gh CLI. Use when writing, drafting, or updating pull request descriptions, PR summaries, or PR bodies. Does not review code or post review comments — use code-review for local review or post-code-review-to-pr for posting a review to GitHub.
Install
npx vskill@latest install testdouble/han/update-pr-descriptionSKILL.md
The same SKILL.md was published earlier as testdouble/han/update-pr-description.
Pre-requisites
- gh CLI: !
which gh 2>/dev/null || echo "not installed"
If the gh CLI is not found:
- Inform the user that it needs to be installed and configured before this skill can be used
- Immediately stop execution of this skill, as it cannot be executed
Project Context
- current branch: !
git branch --show-current 2>/dev/null || echo unknown - default branch: !
git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null || echo unknown - branch summary: !
git log origin/HEAD..HEAD --oneline 2>/dev/null || echo unknown - branch stats: !
git diff origin/HEAD...HEAD --stat 2>/dev/null || echo unknown - branch changes: !
git diff origin/HEAD...HEAD 2>/dev/null || echo unknown - personal config directory: !
bash "${CLAUDE_PLUGIN_ROOT}/scripts/han-config-dir.sh" 2>/dev/null || echo "$HOME/.claude" - project .han/config.md: !
cat .han/config.md 2>/dev/null || echo ""
As your first action, use the Read tool on .han/config.md inside the personal config directory path above. A read that returns no file is no personal configuration: continue silently. When that file or the project .han/config.md probe supplies content, apply it per config-rule.md, which governs precedence between the two files, relative-path resolution, and what to do with a file that reads but cannot be used.
Step 1: Validate Branch State
Before generating a PR description, verify the branch has content to describe:
- If `default branch` is empty or `unknown` —
origin/HEADis not set. UseAskUserQuestionto ask the user for
the default branch name (e.g., main, master, develop). Use that branch as the base for all git commands in subsequent steps, and recompute branch summary, branch stats, and branch changes against it — their Project Context values may read unknown because they were derived from the unset origin/HEAD.
- If `branch summary` is empty — there are no commits on this branch relative to the default branch. Inform the
user and stop.
- If `branch stats` is empty — there are no file changes despite having commits (e.g., empty commits or fully
reverted changes). Inform the user and stop.
Step 2: Discover the Repository PR Template
Determine whether the repository defines its own GitHub pull-request template. If it does, the generated description must conform to that template's structure (Step 4). Do not assume any particular template shape — discover it, read it, and let its structure drive the output.
Use the Glob tool to look in GitHub's supported template locations. GitHub matches the filename case-insensitively; check both common casings since the working filesystem may be case-sensitive. Search these paths (most templates are .md; .txt is also valid):
- Root of the repo:
pull_request_template.md,PULL_REQUEST_TEMPLATE.md(and the.txtvariants). - The
.github/directory:.github/pull_request_template.md,.github/PULL_REQUEST_TEMPLATE.md(and.txt). - The
docs/directory:docs/pull_request_template.md,docs/PULL_REQUEST_TEMPLATE.md(and.txt). - A multiple-template subdirectory:
.github/PULL_REQUEST_TEMPLATE/*.md,docs/PULL_REQUEST_TEMPLATE/*.md,
PULL_REQUEST_TEMPLATE/*.md.
Then resolve to a single template (or none):
- No template file found — the repository has no PR template. Record "no repository template" and continue. Step 4
uses the default structure.
- Exactly one single-file template found —
Readit in full, including HTML comments. Record its path and full
contents.
- A `PULL_REQUEST_TEMPLATE/` directory with multiple templates — GitHub selects one per PR and the skill cannot
know which applies. Use AskUserQuestion to ask which template to conform to, listing the filenames plus a "None — use the default structure" option. Read the chosen file in full and record its path and contents. If the user picks "None," record "no repository template."
Carry the recorded result (the template path and full contents, or "no repository template") into Step 4. Preserve the template's HTML comments verbatim in what you carry forward — they often state how the template is meant to be used.
Step 3: Analyze Changes
Review the branch diff, commits, and relevant source code to understand the PR. Identify the central mechanism — the primary purpose of the PR. If the PR is about feature flags, migrations, or behavioral changes, those ARE the point, not a side detail. Classify the change type (new feature, bug fix, refactoring, docs update, config change, etc.) and read related source files as needed to understand the full scope.
Find the headline behavioral effect — what changes for a user or caller and why — and the central mechanism's key facts (a flag and its default, a migration's direction, the new vs. old behavior). Do not catalog every config value, phase, or mode; the diff carries the specifics. The goal is a short description, not an exhaustive one.
While analyzing, count the significant changed files from branch stats, since that count gates the "What to look at first" section in Step 4. "Significant" means code files. Documentation and configuration files do not count as significant by default; one counts only when there is explicit justification for how it changes the behavior of the code changes in the PR.
Step 4: Generate the PR Description
Launch a single han-core:junior-developer agent to write the PR description directly. Junior-developer's fresh-reviewer perspective is the asset here: by authoring the description with the eyes of a teammate who lacks full project context, the result already anticipates what a reviewer needs to see, removing the need for a separate reviewer-context edit pass.
This skill sources the standard by invoking han-communication:readability-guidance and applies it as it writes the PR description, holding a named audience above the default: the reviewer evaluating the pull request, who will read the code. Scope that frame per section so the technical specifics a reviewer needs — a flag and its default, a migration's direction, the new vs. old behavior — are preserved rather than simplified away.
First, compose the structure directive based on the Step 2 result. The structure directive is the only part of the prompt that differs between the two cases; everything else is shared.
- Option A — no repository template (Step 2 recorded "no repository template"). The structure directive is:
> Structure (required): Produce the description using this fixed structure and section order: Summary (the bolded > TL;DR sentence only) → Behavior changes (its own ## section, present only when runtime behavior changes; omit for > pure refactors and docs-only PRs) → What to look at first (only when the PR has more than ~8-10 files with > significant changes; see the threshold rule below). The first line under ## Summary MUST be the bolded TL;DR > sentence, and the Summary section contains nothing else — no bullet list, no file mentions. Include the > ## Behavior changes section only when runtime behavior changes (flag flips, migrations, state-machine edits, > config changes, API contract changes); omit it for pure refactors and docs-only PRs. > > Length (required): The whole description is at most 2-5 short paragraphs (the Summary sentence is one of them), > and Behavior changes is 1-3 short paragraphs. A small table is fine only when several flags or modes genuinely > interact; prefer prose otherwise. > > "What to look at first" inclusion rule: Include "What to look at first" only when the PR has more than ~8-10 > files with _significant_ changes. "Significant" means code files. Documentation and configuration files do not > count as significant by default. A docs or config file counts as significant only when there is explicit > justification for how that change affects the _behavior_ of the code changes in the PR — and even when a docs/config > file is deemed significant, it most likely should not be listed in "What to look at first" itself. When the > count of significant (code) files is at or below ~8-10, omit "What to look at first" entirely, heading included. > Only include it when a large code change genuinely needs a reading-order guide. > > Default template to follow: {paste the contents of template.md}
- Option B — a repository template was found (Step 2 recorded a template path and contents). The structure directive
is: > Structure (required): Conform to the repository's pull-request template, reproduced below, following the > conformance rules exactly. The template's headings and their order are authoritative. > > Conformance rules: {paste the contents of template-conformance.md} > > Repository PR template ({template path from Step 2}): {paste the full contents of the discovered template, including > its HTML comments}
Then construct the agent prompt to include all of the following inline (the skill already has this context loaded — pass the actual values, not references):
- Branch context — the values of
current branch,default branch,branch summary,branch stats, and
branch changes from the Project Context section.
- Structure directive — Option A or Option B as composed above.
Use this prompt body (with the context above interpolated):
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckinghan-github/skills/update-pr-description/SKILL.md
Popularity
- Repository stars
- 206
- Repository forks
- 19
- 7-day trend score
- 27
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/testdouble/han/update-pr-description)