---
name: pr
description: Open a pull request whose description you write yourself, with a suggested title and a light proofread.
argument-hint: "[--auto [--screenshots <url>...]] [base branch, optional]"
---
# PR
The LLM wrote the commits. The user owns the feature, so the user writes the
description. The PR gets squash-merged, and its title and body become the one
commit that lands on main. So this is really writing a commit message, in the
user's words, that has to stand up in `git log` years from now.
Your job is everything around the words: title, proofreading, the mechanics of
opening it. The failure to avoid is drafting the description yourself. Even a
"starting point" anchors them to your version, and then it isn't theirs.
```
recon --> brief + title --> user writes --> proof --> sign-off --> open
^ |
+------ changes ---------+
```
Arguments start with `--auto`? Nobody will write or approve the description.
Read [Autonomous mode](#autonomous-mode) first; it replaces steps 2 through 6.
## 1. Recon
Base branch is `$ARGUMENTS` (minus `--auto` and `--screenshots`), or the repo default (`gh repo view --json
defaultBranchRef`, falling back to `main`).
Read, don't ask:
- `git status`. Uncommitted changes or sitting on the base branch: stop and say
so. Committing and branching are other jobs.
- `git log <base>..HEAD` and `git diff <base>...HEAD --stat`. What the branch
does, so you can title it and later check their description against it.
- House style: `gh pr list --state merged --limit 15 --json title,body`, plus
`git log <base> --oneline -20` for repos without `gh` history. Look at mood
("Add" vs "Added"), prefixes (`feat:`, `[JIRA-123]`), capitalization, how code
<!-- ‹guest · 2026-12-02› -->
names are marked (backticks?), length, and where bodies put issue links.
- PR template: `pull_request_template.md`, any case, in `.github/`, the repo
root, or `docs/`. A `.github/PULL_REQUEST_TEMPLATE/` folder holds several;
pick the one that fits the branch.
- The issue the branch works on: a number or issue URL in the branch name
(`42-shipping-emails`, `issue-42`), the commits, or a SPEC the branch adds
or names. Only what those say; don't search the tracker for a match.
If `gh` isn't available, say which checks you skipped and carry on with git.
## 2. Brief them
The user didn't write this code, and they're about to put their name on a
description of it. Before they write, give them a fast read of what they're
describing — a two-minute version of `/diff-explainer`, in chat, no artifact.
Start from the commits: subjects and bodies are the cheapest source, and the
LLM that wrote them often left its reasoning there. Then skim `git diff
<base>...HEAD` to check the commits against the code and find what they left
out. Skip generated files and lockfiles.
Three short groups, fragments not sentences, a handful of bullets total:
- **Changed** — behavior, not files. "Guests can check out without an
account; orders store an email instead of a user," not "edited
`orders_controller.rb`."
- **Risks** — what could break or bite later. A test that asserts nothing, a
callback that now fires on every save, a query that grows with the table, a
deploy-order problem (code that reads a column before the migration runs).
- **Tradeoffs** — the choices the code made, and the obvious alternative it
didn't take. Polling over webhooks, a JSON column over a join table.
Only what the code or commits show. Don't guess at why; a wrong reason is
worse than none, because the user may repeat it in the description. Leave a
group out if there's nothing real to put in it. A trivial branch (a copy
change, a version bump) gets one line.
Keep it as notes, not paragraphs. Prose here turns into their description.
## 3. Suggest a title, ask for the description
<!-- ‹guest · 2026-12-02› -->
Same message as the brief:
- A suggested title in the house style. Imperative, under ~65 characters,
since GitHub appends ` (#123)` and it becomes a commit subject. Name the
observable change, not the mechanism. Offer one alternate at most.
- Ask them to write the description. Mention the useful questions a squash
commit should answer, briefly: why this change, why this way, anything a
future reader would trip on.
- A PR template? Name its headings, so they write into it.
- An issue? Remind them to link it (`Closes #42`) so it closes on merge.
Then stop and wait. Don't draft a description, a template, or an example.
If they hand back notes or fragments and say "clean this up", that's their
content, so turning it into sentences is fine. If they ask you to write it from
scratch, remind them once that the skill exists so the description is theirs,
then do what they say.
## 4. Proof
Fix what's wrong, leave what's theirs. Wrong means typos, grammar, broken
markdown, unclear sentences, a code name that should be in backticks. Theirs
means word choice, tone, structure, length, opinions, humor. A proofread that
reads like you wrote it has failed, even if every sentence got "better".
Also:
- **Check claims against the diff.** "Emails the customer a receipt" with
no mailer in the diff is a problem. Flag it; don't fix it. They may know
something the diff doesn't show, or the branch may be missing a commit.
- **Wrap prose at 72 columns.** It becomes a commit body. Leave code blocks,
tables, and URLs alone.
- **Don't add sections, headers, summaries, or a closing line.**
- **Don't add attribution.** No co-author trailer, since GitHub copies the
branch commits' trailers into the squash commit already. No "Generated with"
line either; the description isn't generated.
If it's already clean, say so and change nothing. Churn on good prose is the
opposite of help.
<!-- ‹guest · 2026-12-02› -->
## 5. Sign-off
Show:
- What you changed, as a short list (`teh` → `the`, wrapped lines, backticked
`User#email`). Not a diff of every line.
- Anything you flagged and didn't change.
- The final title and body exactly as they'll be sent, in a fenced block.
Ask for a yes. Any edit they request, apply it and show the full final version
again. The yes has to be to the exact text that goes out; approving "the title
change" isn't approving the body you haven't re-shown.
## 6. Open
Only after a yes to the text you last showed.
Push if the branch has no upstream (`git push -u origin HEAD`). Write the body
to a temp file and pass it with `--body-file`, so backticks and newlines
survive the shell:
```
gh pr create --base <base> --title "<title>" --body-file <tmpfile>
```
Reply with the PR URL.
## Autonomous mode
Only when the arguments start with `--auto`. Nobody is there: a human finds
the draft PR later, writes their own opener above yours, and marks it ready.
Without `--auto`, ignore this section.
You write the description, since nobody else will. All of it goes in a
collapsed `<details>` block whose `<summary>` names the model, so a reader
can tell your words from a person's at a glance. Inside: one paragraph on
why, then a picture of the behavior before and after. The diff already
shows what changed; the paragraph says what the diff can't. Read
`/diff-explainer`'s steps 3 and 4 (`../diff-explainer/SKILL.md`) for what
<!-- ‹guest · 2026-12-02› -->
earns a note and the rule against inventing rationale.
- **Recon as in step 1.** Uncommitted changes or on the base branch: stop, and
make the reply say why.
- **Gather the why.** Commit bodies, then a SPEC the branch adds or names,
then the diff. A reason none of them state is "not recorded", never a guess.
- **One paragraph, the why.** Write it for someone who uses the product
but never reads the code, like the support lead. What prompted the
change, then what it changes for them in a sentence. No file paths,
commit SHAs, code names, or jargon; those belong in the notes.
- Bad: "Adds a PDF format to `InvoicesController#show` (a3e96d0)."
- Good: "Support resends old invoices by hand a few times a week, so
now customers can download them as PDFs."
- **Nothing about testing.** Don't say what was tested, checked, or
verified, or that tests pass. The reader assumes it.
- **Draw the before and after.** Read `../visualize/SKILL.md` and follow
its steps 2 to 4 for this branch: one technique, drawn twice, from
`git diff <base>...HEAD`. A plain `Before` line above the first, `After`
above the second, not headings. Draw what the code does, not the happy
path: a risk your notes flag that a person would see goes in the After
picture too. Skip its reply shape: no technique line,
"Worth asking about", or "In the code" in the body. A branch that changes
no behavior, like a copy fix or a version bump, gets no picture.
- **Write the body and notes in thoughtbot's voice.** See [Voice](#voice).
- **One line per paragraph.** Don't wrap the body or the notes at 72.
GitHub shows every line break in a PR description or comment, so
wrapped text comes out ragged.
- **Notes go on the lines.** Each risk, tradeoff, or open question becomes an
inline comment on the line it's about, starting `**Risk:**`,
`**Tradeoff:**`, or `**Open question:**`. Most branches get two to four;
a typo fix gets none.
- **Say each note once, plainly.** The engineer sees the code right above
the comment, so the note doesn't name it. Write for someone who's never
read code: what happens to a person, and why. No code names, no
programmer words like job or callback, and no analogy.
- **Draw it when it has a shape.** A note about when something happens,
like a charge that retries, a reminder that stops, or an order that
skips a step, gets one picture under it, the way `/visualize` draws:
step 3 of `../visualize/SKILL.md` picks the technique, then read only
that technique's reference. Read it, don't run it; this is one
<!-- ‹guest · 2026-12-02› -->
picture, not its whole reply. Keep it small, since GitHub's comment
column is narrow. The body's picture doesn't count; a note shows up
on its own. Real values from the branch only; no picture beats an
invented one. A missing test or a naming choice gets none.
- **Sign what you wrote.** The block's `<summary>` and every note name the
model that wrote them. See [Attribution](#attribution).
- **A PR template goes inside the block**, in place of the paragraph: keep
its headings in order, a sentence or two under each, and delete its
instruction comments (`<!-- -->`). Tick a box only when the branch backs
it. A section nothing on the branch speaks to gets "Not recorded." The
pictures go in the section about why or what changed, else the first.
- **Link the issue** recon found, on its own line below the block, so it
shows without expanding: `Closes #42` (`owner/repo#42` for another repo).
`Refs #42` instead when the commits or SPEC say the branch does only part
of it. None found: no line.
- **Screenshots only when passed in.** `--screenshots` takes image URLs the
caller already hosted. Embed each one above the block; a person took
them. Don't take, upload, or commit any yourself.
- **Have it checked.** One fresh subagent gets the body, the notes, and the
base branch, and reads the commits and diff itself. Ask for: claims the
diff doesn't back, a reason the commits, SPEC, and diff never give, a
risk you missed, any note that would still be true with the diff hidden,
a picture that disagrees with the code, anything about testing in the
body, and anything in the body or a note a non-technical reader would
trip on. Skip wording. Fix once. A picture that's wrong gets fixed, not
cut.
- **Title** as in step 3.
The default body. Keep the blank lines around the block's contents;
without them GitHub shows the Markdown raw.
```markdown
{each --screenshots URL as . Leave out when none were passed.}
<details>
<summary>Written by {model}</summary>
{one paragraph: what prompted the change, and what it changes for people}
Before
<!-- ‹guest · 2026-12-02› -->
{picture}
After
{picture}
</details>
{Closes #N. Leave out when recon found no issue.}
```
A note:
````markdown
**Risk:** We charge the card before we record the payment, so if recording it fails, the customer has paid and their invoice still says unpaid. We might want to record the payment first.
```mermaid
sequenceDiagram
Customer->>Shop: Pays $40 invoice
Shop->>Card processor: Charge $40
Card processor-->>Shop: Charged
Note over Shop: Recording the payment fails
Shop-->>Customer: Invoice still "unpaid"
```
_Claude Opus 5.5 (claude-opus-5-5)_
````
### Attribution
Name the model from your system prompt: its name and exact ID, like
`Claude Opus 5.5 (claude-opus-5-5)`. Don't know it? Write `Claude` alone.
Never guess a model.
- **Body**, the block's summary:
`<summary>Written by Claude Opus 5.5 (claude-opus-5-5)</summary>`. No
signature line on top of it.
- **Each note**, its own last line: `_Claude Opus 5.5 (claude-opus-5-5)_`.
Notes show up one at a time on GitHub, so each one needs it.
<!-- ‹guest · 2026-12-02› -->
This is the only attribution. No "Generated with Claude Code" line or
co-author trailer on top of it.
### Voice
The body and the notes should sound like thoughtbot, not one person.
This follows thoughtbot's [voice and tone][voice] guide.
Both:
- **"We" for the team**, at least once in the body and in each note:
"Now we ...", "We send ...". Never "I".
- **Conversational, not academic or enterprisey.** Contractions
("doesn't", "we're"), easy words, short sentences. If a sentence is
awkward to read aloud, simplify it. No sales words, and no stiff ones
like "Consider", "Ensure", or "potential issue".
- **Serious when it matters.** A light touch is fine in the body. A
risk stays plain: no jokes about lost data.
- **Mechanics.** Numerals ("3 retries", not "three retries"), unless
the number starts a sentence. Oxford comma. No emoji. One exclamation point per paragraph at most; most
need none.
The body:
- **Open with what prompted the change**, not what changed: "Now that
...", "Prior to this, ...", "Follow-up to #77.", or the problem in
one sentence. Pick what fits.
- **Then what changed for people**, in a sentence.
- **One paragraph, no more.** A caveat that matters gets one sentence at
the end: "For the time being, ...". No headings, bold, or bullets.
- **Links go below the paragraph**, reference-style:
`this [discussion][1]`, then `[1]: https://...`.
```markdown
Prior to this, support resent old invoices by hand a few times a week. Now customers can download any past invoice as a PDF, so we can stop resending them. For the time being, invoices from before 2020 aren't included.
```
The notes, like a teammate's review comment:
<!-- ‹guest · 2026-12-02› -->
- **Two sentences, no more.** What happens to a person and why, with
"since" or "because". Then a suggestion, not an order: "We might want
...", "This feels like a separate PR." An open question ends on its
question instead. Cut detail to fit.
"We charge a declined card again every hour, since we retry on any
error. We might want to stop once the bank says it's declined."
- **Ask with a case**, when a case makes the question: "What happens if
someone checks out with an empty cart?" Real values, no code.
- **Say when it can wait**, only when the branch backs it: "That's OK
for now, since nothing calls it yet."
Only the voice. Every claim still comes from the branch.
[voice]: https://thoughtbot.com/playbook/the-thoughtbot-way/brand/voice-and-tone
### Open it
Push (`git push -u origin HEAD`), whatever the host: the remote needs every
commit before anyone can open or review a PR from it. Then, on GitHub with
`gh`:
```bash
gh pr create --draft --base <base> --title "<title>" --body-file <tmpfile>
```
Inline notes go up as one review, so the PR gets one notification, not ten:
```bash
gh api repos/{owner}/{repo}/pulls/<n>/reviews --input review.json
# {"event": "COMMENT", "commit_id": "<head sha>", "comments": [
# {"path": "app/models/order.rb", "line": 4, "side": "RIGHT",
# "body": "**Risk:** ...\n\n{picture, if any}\n\n_Claude Opus 5.5 (claude-opus-5-5)_"}]}
```
`line` has to be a line in the diff, numbered in the new file.
Not GitHub, no CLI, or a call fails: don't look for a workaround. The reply
is the handoff.
The reply: the PR URL, or why it wasn't opened plus the title and body in a
<!-- ‹guest · 2026-12-02› -->
fenced block. Any notes that didn't get posted go there too, as `path:line`
bullets with their attribution line, ready to paste. Fence the body and
each note with `~~~`, so a picture's ``` doesn't close it early. Then what
the check changed, one line each.
این نسخه با نشانهگذاری اختصاصی حساب شما نمایش داده میشود. برای نصب سریع، به تب نصب و راهاندازی بروید.