write-pr
Skill19 starsChanged 9 months agoMITView on GitHub
Draft a pull request title and body from the current branch's diff and commit history, following the project's PR template and title conventions. Use when the user is about to open a PR and wants ready-to-paste content, or asks to write, draft, or fill in a PR description. Read-only — never opens or pushes the PR.
- Commits and pushes
3 other projects use a version of this.
Adopted by
Most recently taken up by
- jalbarrang/skillstheir own version, first seen Aug 23, 2026
- brandtam/skillstheir own version, first seen Jul 29, 2026
- drewdrewthis/claude-skillstheir own version, first seen Apr 22, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- drewdrewthis/claude-skills★ 2same name
- jalbarrang/skills★ 2same name
- brandtam/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository14 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- code-historySkill
- code-review-reportSkill
- commit-fixupSkill
- commit-splitSkill
- create-qa-listSkill
- decision-boardSkill
- django-ticket-triageSkill
- docsSkill
- html-visualSkill
- instruction-evalSkill
- quick-prSkill
- ralph-loop-templateSkill
- worth-buildingSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. 0 are common, 10 are distinctive, and 9 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
10
Distinctive
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 33
If $ARGUMENTS is provided, use it as the base branch.
- Very specific: line 36
Run git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null — extract branch name (e.g., origin/main → main)
- Very specific: line 37
If that fails, check which of main, master, develop exists: git branch -r | grep -E 'origin/(main|master|develop)'
- Distinctive: line 38
Use the first match found
- Distinctive: line 42
Run these commands in order:
- Very specific: line 50
Use --shortstat output (e.g., 12 files changed, 340 insertions(+), 50 deletions(-)) to determine diff size:
- Very specific: line 51
If changed files ≤ 20 AND insertions+deletions ≤ 500: read the full diff with git diff <base>...<HEAD>
- Very specific: line 52
If changed files > 20 OR insertions+deletions > 500: do NOT read the full diff.
- Distinctive: line 66
Use the first path that successfully returns content.
- Distinctive: line 69
Use its structure exactly as-is for the PR body
- Distinctive: line 72
Do not reorder, merge, or omit any section
- Distinctive: line 74
If all paths fail (file not found): use this default structure:
- Very specific: line 94
If gh returns results, analyze the title patterns (e.g., feat: ..., [PROJ-123] ..., Fix: ...).
- Very specific: line 96
If gh fails for any reason (not installed, auth error, not a GitHub repo), fall back to:
- Very specific: line 103
If no clear pattern is found, use Conventional Commits format (type: description).
- Distinctive: line 108
If the style detected in Step 4 is clear and consistent: produce 1 title
- Distinctive: line 109
If the style is ambiguous or mixed: produce 2–3 title candidates, clearly labeled
- Distinctive: line 112
Use the template structure from Step 3
- Distinctive: line 119
Do not paste raw diff or file lists into the body
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Write PR
Turn the current branch's changes into a PR title and body that match the project's existing conventions. Analyze git history and diffs for intent, not just file names.
Use this skill when
- Writing or drafting a pull request description for the current branch
- Generating a PR title that matches the project's commit/PR style
- Filling in a PR template based on actual code changes
Do not use this skill when
- The request is to actually open or push a pull request
- There are no commits ahead of the base branch
- The user only wants a commit message, not a PR description
This skill is read-only. Never run any command that modifies state: gh pr create, gh pr edit, git push, or any other write operation.
Context
The user wants a ready-to-use PR title and body based on what changed in the current branch. Focus on intent and impact, not raw diff output. Respect the project's existing PR style.
Instructions
Step 1: Detect Base Branch
If $ARGUMENTS is provided, use it as the base branch.
Otherwise, auto-detect in this order:
- Run
git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null— extract branch name (e.g.,origin/main→main) - If that fails, check which of
main,master,developexists:git branch -r | grep -E 'origin/(main|master|develop)' - Use the first match found
Step 2: Collect Change Information
Run these commands in order:
git log <base>..<HEAD> --oneline
git diff <base>...<HEAD> --stat
git diff <base>...<HEAD> --shortstatUse --shortstat output (e.g., 12 files changed, 340 insertions(+), 50 deletions(-)) to determine diff size:
- If changed files ≤ 20 AND insertions+deletions ≤ 500: read the full diff with
git diff <base>...<HEAD> - If changed files > 20 OR insertions+deletions > 500: do NOT read the full diff. From the
--statoutput, identify the file with the most changes per directory/module and read only those representative files
Step 3: Find PR Template
This step is mandatory. Do not skip or assume the file does not exist.
Attempt to read all paths below in parallel using a file read tool:
.github/PULL_REQUEST_TEMPLATE.md.github/pull_request_template.mddocs/pull_request_template.mdPULL_REQUEST_TEMPLATE.md
Also check if .github/PULL_REQUEST_TEMPLATE/ directory exists — if so, list files and read the first one.
Use the first path that successfully returns content.
If a template file is successfully read:
- Use its structure exactly as-is for the PR body
- Preserve all sections, headings, and HTML comments (
<!-- ... -->) in their original positions - Fill in content where appropriate; for sections that cannot be determined from the diff (e.g., Screenshots, Related Issues), leave the original placeholder or HTML comment intact — do not delete or summarize them
- Do not reorder, merge, or omit any section
If all paths fail (file not found): use this default structure:
## Summary
<!-- What does this PR do and why? -->
## Changes
<!-- Key changes made -->
## Test Plan
<!-- How was this tested? -->Step 4: Identify PR Title Style
Run:
gh pr list --state merged --limit 10 --json title 2>/dev/nullIf gh returns results, analyze the title patterns (e.g., feat: ..., [PROJ-123] ..., Fix: ...).
If gh fails for any reason (not installed, auth error, not a GitHub repo), fall back to:
git log --oneline -20Extract the dominant pattern from commit messages.
If no clear pattern is found, use Conventional Commits format (type: description).
Step 5: Write PR Content
Title:
- If the style detected in Step 4 is clear and consistent: produce 1 title
- If the style is ambiguous or mixed: produce 2–3 title candidates, clearly labeled
PR Body:
- Use the template structure from Step 3
- Fill each section based on the change analysis from Step 2
- Focus on why the change was made, not just what files changed
- Flag these explicitly if present in the diff:
- Breaking changes (API/interface changes, removed fields)
- New dependencies added
- Architecture or structural changes
- Do not paste raw diff or file lists into the body
- For sections that cannot be filled (e.g., Screenshots, Demo, Related Issues): keep the original HTML comment or placeholder from the template — do not delete the section
Output Format
Present the output in this order:
Title
<single best title>(If ambiguous, list alternatives labeled Alt 1, Alt 2)
PR Body
<filled-in PR body — exact template structure preserved>Branch:
<base>←<current>· Commits: N · Files changed: N
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

