Writing a PR body/title
Write the final aggregate base-to-head outcome as the eventual squash record.
Use concise bullets for text, not an essay by default. Preserve the problem,
result, and chosen design reasoning that a future reader needs.
1. Establish the change
- Read repository instructions, contribution guidance, and the PR template.
Check recent PR titles and history for local prefixes and grammar.
- Identify the intended target branch and candidate head. Inspect all branch
commits as evidence, then the complete aggregate PR diff. Read affected code,
callers, and tests where needed to establish behavior. Keep uncommitted work
separate from the PR outcome.
- Read linked issues, specifications, and decisions when available. Recover the
prior problem, resulting behavior, and material constraints from evidence,
not from filenames, symbols, or titles alone. Links supplement a self-contained
explanation.
- For an existing PR, read its current title and full body with
gh, using the
github skill for GitHub operations. Existing prose is a claim to check
against the final diff, not proof of what shipped.
Proceed when the target, head, outcome, and supporting facts are known. Ask
about a material ambiguity rather than filling it with plausible text.
2. Choose useful depth
- Narrow, low-risk correction: a precise title and brief problem/outcome bullets.
- Bounded feature or non-obvious local change: add only the mechanism, chosen
tradeoff, or compatibility detail needed to understand the result.
- Truly difficult, high-risk, broad, or exceptional engineering work can justify
technical-blog depth: context, problem-to-decision story, concrete invariants,
and system consequences. Let the actual review burden justify this depth,
not enthusiasm or line count. Keep bullets where they remain clear.
Read classification when depth is unclear
or security, migration, concurrency, public-contract, or recovery risks matter.
Read shapes and examples when choosing a
structure or including code, diagrams, visual changes, or benchmarks. For the
user's writing style, read my pull requests.
3. Draft the title and body
- Title: name the specific outcome across the whole diff. Follow local prefix
conventions; otherwise use direct outcome wording. Avoid vague titles such
as "Improve things". Do not invent a fixed character limit.
- Body: lead with concise bullets explaining what changes and why. Add short
headings only when they help navigation or the compatible template needs them.
Keep prose around code, diagrams, and tables in bullets too. Omit empty sections.
- Describe only the final aggregate change. Exclude intermediate refactors,
dropped designs, PR line-count shrinkage, commit chronology, and tool or agent
activity. A substantive tradeoff explaining the chosen design is useful;
a development diary is not.
- Prefer actual internal or usage code snippets when they explain more clearly
than prose. Use relevant fenced
mermaid diagrams for relationships or flows
that need explanation, not as mandatory decoration for trivial changes.
For deep explanations, code permalinks and images can support the story.
- Keep validation, test, and CI reports out of the proposed body, including
"I ran tests" wording, testing headings, and command checklists. This wording
rule does not waive required checks in another workflow. Report missing checks
or readiness blockers outside the body; they can block publishing.
- If the template requires test reporting or otherwise conflicts with these
rules, state the conflict outside the proposed body and ask how to proceed.
Do not silently remove the required field or fill it with prohibited wording.
Visual changes
Direct or indirect visual changes require a before/after table with real uploaded
images or videos: baseline from the target branch, candidate from the PR. Match
the scenario and viewing conditions, and identify the corresponding refs/SHAs.
Use only verified uploaded asset URLs, never fabricated URLs or local paths.
If either side or its provenance is missing, ask for the material and any needed
upload authorization separately. Do not upload or mutate a remote in writing-only
mode. Mark the draft incomplete in separate notes until the real comparison is
available; do not insert pretend media or claim visual equivalence.
Benchmarks
Benchmarks always require a before/after comparison table: target-branch baseline
and PR candidate, actual measured values, refs/SHAs, units, and the same workload
and environment. Include relevant measurement context and uncertainty. Derived
deltas are optional and must follow from the supplied measurements.
If measurements are absent or not comparable, request the missing evidence
outside the body. Do not run benchmarks in this writing-only workflow, invent a
comparison, or turn a candidate-only result into an improvement claim. Benchmark
tables explain performance outcomes; they are not general check reports.
4. Recheck and return
Re-read the final diff before returning. If the target or head changed, inspect
the new aggregate diff and revise the draft. Check every factual claim, snippet,
diagram, media label, measurement, and link against the inspected evidence.
Remove claims about dropped code or unsupported motivation. Keep material risk,
compatibility, and recovery facts without inventing scope to justify more prose.
Return a ready-to-use Title and Body in Markdown. Keep material unknowns,
missing evidence, template conflicts, and other blockers in a separate Notes
section outside the proposed body; omit notes when none remain. A blocked draft
is not ready to publish. When only a title or only a body was requested, return
that requested part.
Drafting authorizes text only: do not commit, push, create or edit a remote PR,
upload media, or run checks. Publishing belongs to create-pr; commits belong
to github. A request to draft never authorizes those actions.
For the origin of these choices, read research basis.
1---2name: write-pr-body3description: Use when writing or editing a pull request title or body. Drafts concise, evidence-grounded text from the final branch diff, with proportional design context, code examples, visual comparisons, and benchmark tables. Does not publish PRs, run checks, or write commit messages.4---56# Writing a PR body/title78Write the final aggregate base-to-head outcome as the eventual squash record.9Use concise bullets for text, not an essay by default. Preserve the problem,10result, and chosen design reasoning that a future reader needs.1112## 1. Establish the change1314- Read repository instructions, contribution guidance, and the PR template.15 Check recent PR titles and history for local prefixes and grammar.16- Identify the intended target branch and candidate head. Inspect all branch17 commits as evidence, then the complete aggregate PR diff. Read affected code,18 callers, and tests where needed to establish behavior. Keep uncommitted work19 separate from the PR outcome.20- Read linked issues, specifications, and decisions when available. Recover the21 prior problem, resulting behavior, and material constraints from evidence,22 not from filenames, symbols, or titles alone. Links supplement a self-contained23 explanation.24- For an existing PR, read its current title and full body with `gh`, using the25 `github` skill for GitHub operations. Existing prose is a claim to check26 against the final diff, not proof of what shipped.2728Proceed when the target, head, outcome, and supporting facts are known. Ask29about a material ambiguity rather than filling it with plausible text.3031## 2. Choose useful depth3233- Narrow, low-risk correction: a precise title and brief problem/outcome bullets.34- Bounded feature or non-obvious local change: add only the mechanism, chosen35 tradeoff, or compatibility detail needed to understand the result.36- Truly difficult, high-risk, broad, or exceptional engineering work can justify37 technical-blog depth: context, problem-to-decision story, concrete invariants,38 and system consequences. Let the actual review burden justify this depth,39 not enthusiasm or line count. Keep bullets where they remain clear.4041Read [classification](references/classifying-changes.md) when depth is unclear42or security, migration, concurrency, public-contract, or recovery risks matter.43Read [shapes and examples](references/writing-pull-requests.md) when choosing a44structure or including code, diagrams, visual changes, or benchmarks. For the45user's writing style, read [my pull requests](references/my-pull-requests.md).4647## 3. Draft the title and body4849- Title: name the specific outcome across the whole diff. Follow local prefix50 conventions; otherwise use direct outcome wording. Avoid vague titles such51 as "Improve things". Do not invent a fixed character limit.52- Body: lead with concise bullets explaining what changes and why. Add short53 headings only when they help navigation or the compatible template needs them.54 Keep prose around code, diagrams, and tables in bullets too. Omit empty sections.55- Describe only the final aggregate change. Exclude intermediate refactors,56 dropped designs, PR line-count shrinkage, commit chronology, and tool or agent57 activity. A substantive tradeoff explaining the chosen design is useful;58 a development diary is not.59- Prefer actual internal or usage code snippets when they explain more clearly60 than prose. Use relevant fenced `mermaid` diagrams for relationships or flows61 that need explanation, not as mandatory decoration for trivial changes.62 For deep explanations, code permalinks and images can support the story.63- Keep validation, test, and CI reports out of the proposed body, including64 "I ran tests" wording, testing headings, and command checklists. This wording65 rule does not waive required checks in another workflow. Report missing checks66 or readiness blockers outside the body; they can block publishing.67- If the template requires test reporting or otherwise conflicts with these68 rules, state the conflict outside the proposed body and ask how to proceed.69 Do not silently remove the required field or fill it with prohibited wording.7071### Visual changes7273Direct or indirect visual changes require a before/after table with real uploaded74images or videos: baseline from the target branch, candidate from the PR. Match75the scenario and viewing conditions, and identify the corresponding refs/SHAs.76Use only verified uploaded asset URLs, never fabricated URLs or local paths.7778If either side or its provenance is missing, ask for the material and any needed79upload authorization separately. Do not upload or mutate a remote in writing-only80mode. Mark the draft incomplete in separate notes until the real comparison is81available; do not insert pretend media or claim visual equivalence.8283### Benchmarks8485Benchmarks always require a before/after comparison table: target-branch baseline86and PR candidate, actual measured values, refs/SHAs, units, and the same workload87and environment. Include relevant measurement context and uncertainty. Derived88deltas are optional and must follow from the supplied measurements.8990If measurements are absent or not comparable, request the missing evidence91outside the body. Do not run benchmarks in this writing-only workflow, invent a92comparison, or turn a candidate-only result into an improvement claim. Benchmark93tables explain performance outcomes; they are not general check reports.9495## 4. Recheck and return9697Re-read the final diff before returning. If the target or head changed, inspect98the new aggregate diff and revise the draft. Check every factual claim, snippet,99diagram, media label, measurement, and link against the inspected evidence.100Remove claims about dropped code or unsupported motivation. Keep material risk,101compatibility, and recovery facts without inventing scope to justify more prose.102103Return a ready-to-use **Title** and **Body** in Markdown. Keep material unknowns,104missing evidence, template conflicts, and other blockers in a separate **Notes**105section outside the proposed body; omit notes when none remain. A blocked draft106is not ready to publish. When only a title or only a body was requested, return107that requested part.108109Drafting authorizes text only: do not commit, push, create or edit a remote PR,110upload media, or run checks. Publishing belongs to `create-pr`; commits belong111to `github`. A request to draft never authorizes those actions.112113For the origin of these choices, read [research basis](references/research-basis.md).