writing-pull-requests
Use when drafting a pull request title or description, opening a PR with `gh pr create`, or filling out PR body content
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Use when drafting a pull request title or description, opening a PR with `gh pr create`, or filling out PR body content
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | writing-pull-requests |
| description | Use when drafting a pull request title or description, opening a PR with `gh pr create`, or filling out PR body content |
A pull request's title and description must convey the intent of a change, the risks on both sides of merging it, how to undo it, and what to watch after deploy. Do not include mechanical "what changed" details — they belong to the diff.
Match length to the change. A null-pointer fix does not need two paragraphs; a one-line risk does not need four sentences. Reviewers skip walls of text — state the fact, name the mitigation, move on. Default to the shortest form that satisfies each tenet, then expand only when complexity demands it.
If you find yourself writing a second paragraph, ask whether the second paragraph carries information the reviewer cannot get from the diff or the linked ticket. If not, cut it.
PULL_REQUEST_TEMPLATECLAUDE.md / AGENTS.md PR conventionsWhen a PR template exists:
N/A — neither alone nor with a reason. Write a definitive sentence stating what is true. Example: write "No new risks; this is a test-only change with no production code paths touched", not "N/A — test only".my-service: migrate v1 endpoint to v2.[ENG-1234].These map onto the typical template sections (Description, Risks, Rollback, Observability). Apply each tenet to the section that fits, even when the template uses different headings.
Convey the spirit and intention of the change. The description must answer the question the diff cannot: why does this PR exist, and what outcome is it producing?
Required elements:
Length discipline: A single-bug fix is 1-3 sentences: name the failure mode and the fix. Save 3-6 sentences for migrations, new features, or changes touching multiple services. Do not pad a simple fix with paragraphs of context the reviewer can read in the linked ticket. Do not add bullets to this section by default. Do not write a bulleted list of behavioral changes — that list is the diff.
Do not:
FooActivity is now gone, BarActivity lost a constructor parameter, BazType dropped its async field" is mechanics dressed up as behavior. Cut it.MyClass.java and OtherClass.java" — the diff shows that.Refactor test: A description statement must remain true after a behavior-preserving refactor that renames or restructures the touched classes. Cut any statement that fails this test — it is mechanics.
Cover risk on both sides of the merge. Do not cover only one side.
Do not leave either side blank. When a side has no risk, write a definitive sentence stating why — e.g. "No new failure modes introduced: the new SDK method is purely additive and has no callers yet."
Length discipline: 1-2 sentences per side for simple changes. Do not pad. "Additive change at the input boundary — previously-null reference is now a non-null empty default. Not merging leaves the RPC unusable for callers that don't set the field." is complete; do not expand it into a paragraph re-explaining the original bug.
Answer two questions explicitly. Do not skip either.
git revert is sufficient. Call out any roll-forward-only content — DB migrations (especially destructive ones like column drops or data backfills), proto field number reuse, irreversible schema changes, published-event format changes consumers have already deserialized — and describe the actual rollback procedure for those parts.Keep the answer terse when nothing is complicated (Revert the PR. / Disable the MY_FEATURE_FLAG flag — no redeploy required.). Do not skip the question.
For changes with production behavior, cover up to three things — only the ones that apply:
my_service_request_latency_p99 to drop on enabled tenants as the new path bypasses the legacy validator."Skip categories that don't apply. A bug fix that adds no metrics and changes no expected directions can be 1-2 sentences naming the signal that would confirm the fix worked (e.g. "The integrationTest task should return to passing for the affected module.").
Do not write N/A. For changes with no production-runtime impact (proto-only, test-only, doc changes), state that fact directly and name what would signal a problem if the assumption is wrong — e.g. "No runtime behavior changes; CI build and proto-consumer compilation are the relevant signals." There is always something to watch.
Lead with the problem, then the change. Start the first sentence with what was broken, missing, or needed. Do not start with what the PR does.
Wrap every code identifier in backticks — class names, method names, feature-flag constants, RPC names, file paths, env vars. Do not write plain-text identifiers.
Strip filler. Do not write "this PR aims to", "in order to", "we should", "going forward". State facts directly.
Default to prose. Do not reach for bullets. Write the description as 3-6 sentences with no bullets. Use a bullet only when it conveys something a reviewer cannot get from the diff (intent, motivation, an explicit non-change). Do not use bullets to itemize per-class changes — that is a worse diff.
Name what was actually run in Verification. List test class names, scenarios covered, and commands executed. Use checkboxes (- [x]) for build/lint/test steps. Do not write "tests pass" without specifics.