agentleFS
andrew-blakeandrew-blake/melcloudhome/.claude/skills/pr-body/SKILL.md

pr-body

Skill143 starsChanged 38 days agoMITView on GitHub

A PR body tells a reviewer what changed, what to check, and what risk they are accepting by merging. It is written from the diff and the linked decision record. Inputs: git diff <base>..HEAD, git diff --shortstat <base>..HEAD, the linked ADR/plan/issue, the author's problem statement when no issue exists, and .github/pull_request_template.md. Resolve the base from the branch; a caller need not supply it. gh stack view --json names the branch below this one in a stack; that is the base.…

3 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions3 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 3

    1. orrrrli/ai-engineering-stack★ 2same name
    2. orrrrli/clawd-harness★ 2same name
    3. qyndex/claude-init★ 2same 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 repository2 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If that file already exists, ask before writing and wait for the answer.

    line 44
  2. Distinctive:

    Write every paragraph, bullet and checkbox as one unwrapped line.

    line 58
  3. Very specific:

    If <base> is not the trunk, the PR sits in a stack.

    line 167

“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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

PR Body

Overview

A PR body tells a reviewer what changed, what to check, and what risk they are accepting by merging. It is written from the diff and the linked decision record.

Source contract

Inputs: git diff <base>..HEAD, git diff --shortstat <base>..HEAD, the linked ADR/plan/issue, the author's problem statement when no issue exists, and .github/pull_request_template.md.

Resolve the base from the branch; a caller need not supply it. gh stack view --json names the branch below this one in a stack; that is the base. With no stack, the base is the trunk. Sanity-check either answer against git log --oneline <base>..HEAD: the commits shown must be this branch's own work, and a parent's commits appearing there means the base is wrong.

The session transcript is not an input. A sentence that exists because of something that happened while the work was done (an investigation, a wrong turn, a precedent you discovered, an objection raised earlier) belongs in the ADR or nowhere.

Handoff

Three rules that bind even if you read nothing else. Detail and reasoning: REQUIRED: follow handoff.md.

  • A subagent writes the body. The author names the branch and passes the issue (or, with none, a problem statement), the ADR paths and a list of verified facts, no narrative. The writer resolves the base itself.
  • With neither an issue nor a problem statement in the brief, the writer writes no body and hands back asking the author for the problem statement.
  • The body goes in a file, never pasted into chat as the deliverable.
  • If that file already exists, ask before writing and wait for the answer.

The shape

Three sections are required, from .github/pull_request_template.md. Three more are conditional, each on something you can check rather than judge. Nothing else: a named-but-optional section is how a template rots, and Motivation, Background, Implementation notes and Screenshots all invite the narrative the source contract removes.

The file opens with the title as an H1, so the one line a reviewer reads first is reviewed and versioned with the body rather than improvised at the command line.

Write every paragraph, bullet and checkbox as one unwrapped line. GitHub renders a newline inside a paragraph as a line break, so hard-wrapped prose ships its wrapping to the reviewer; the prettier step in handoff.md repairs it, but composing unwrapped is what keeps the diff of a later edit readable.

Write the title last, from the finished body. Composing the body is what establishes what the change is; a title written first frames the body instead, and you cannot tell whether a title merely repeats the Summary's opening sentence until that sentence exists.

Rules, all drawn from this repo's merged titles:

  • Conventional-commit form, type(scope): summary. Lowercase after the colon, no trailing period.
  • Types in use here: fix, feat, refactor, perf, docs, ci, chore, test. Scope is the area touched: atw, ata, sensor, coordinator, i18n, mock, diagnostics, dev.
  • Type by the effect on a user, not by the shape of the diff. Something broken now working is a fix even when the diff adds a lot; #257, #258 and #266 are all endpoint or parsing changes typed that way.
  • 50 to 75 characters. The merged corpus runs 53 to 82 and clusters there; GitHub truncates beyond about 70 in some views.
  • Name what changed. The why belongs to the Summary, and the title should not restate its first sentence.
  • Try the positive form before reaching for a contrast. Merged titles do use X, not Y (#255, #257, #264), but reframing around what is being removed came out shorter than the original in every one of those cases, and it names the actionable half: stop trusting live context for outdoor temperature beats source outdoor temperature from comfort-graph, not live context by 13 characters and says the same thing. Keep the contrast only when the positive form loses a fact.
# fix(atw): source water temperatures from the internaltemperatures report

Then, in order:

  1. ## Summary: required. Opens with the problem the change solves, as it stands without the change, from the linked issue or the brief's problem statement. Then what changed, from the diff, citing the related #number inline. One pointer to the ADR, plan or issue that holds the evidence.
  2. ## Key changes: when the diff touches more than five files. One bullet per behaviour a reviewer can verify in the diff. Below that, fold it into the Summary.
  3. ## What changes for users: when a user will notice something, such as a state that reads differently, a discontinuity in recorded history, an automation that has to adapt. One section, one bullet each, with the remedy. Internal changes nobody outside the repo can observe do not belong here. Each bullet carries a fact the Summary does not state. When the Summary's opening sentence is the whole user-visible change, the section is absent.
  4. ## Risks accepted: when merging accepts a known risk, such as an assumption shipped without evidence, a downside taken deliberately. Each bullet says what the risk is, what it costs if it lands, and how it would show up. A way back is named only when it exists today: reverting this PR, or a follow-up that is tracked, written as "tracked" with the issue linked when there is one. A code change nobody has designed or tracked is a follow-up that does not exist yet, so it stays out of the body. This is what a maintainer hunts for months later when the risk lands.
  5. ## AI Disclosure: required. Reproduce the template's two boxes and leave both unchecked. The second reads "I reviewed and ran the change myself", a claim about the human author that nobody else can make for them. They tick one before opening the PR.
  6. ## Testing: required. What ran and what it showed, as three kinds of box in this order:

    • One box for the routine gates: lint, type-check, pre-commit and every suite that passed, named together on one line with the HA version, e.g. - [x] \make pre-commit`, `make test-api`, `make test-integration` (HA 2026.2.3) and `make test-e2e`: passed at the head.`
    • One box per check that exercises this change: a regression test proven by deletion, a run on the HA floor, a devserver or production observation. Variations of one check share its box, so every deletion check is one box.
    • One unchecked box per check a reviewer of this diff would expect and did not get, followed by what that check would show for this diff that the ticked boxes do not. Evidence the tests only simulate keeps its box: a real capture of a response the tests fake, a device or account the change was not run against. A check with nothing to show gets no box: a suite the diff cannot reach, a devserver whose mock cannot show the change, a second route to a check already ticked (a Docker target whose suite ran in a venv), and a /security-review on a diff with no auth, API-client or workflow change.

    Each box is one claim on one line. A suite's result is "passed" and the environment it ran in (the HA version); CI shows the counts at the head. The evidence behind a claim (each mutation tried, timings, value comparisons, what a scrub left) lives in the record. Refer to the head as "the head", without a commit hash: the branch's hashes disappear when the PR is squash-merged.

Every ticked box holds at the head. A check that ran before later commits is re-run at the head when it is cheap (lint, type-check, the suites, the security review). Evidence too costly to repeat, such as a devserver or production run, is ticked with its scope in the claim: "on code that differs from the head only in comments", which a diff can confirm. A later code change makes that claim false, which is the signal to earn the box again.

Word every box as the claim it asserts, never as a negation. Ticking is what makes the claim true, so - [ ] No prod soak inverts its own meaning the moment someone ticks it. Write the claim, - [ ] Prod deployment and soak, and put why it is unticked after it. Only a box that will not be earned in this PR carries such a note; a box waiting on a re-run gets the re-run.

An unticked box says what you did not verify. It does not assert that nobody did: other sessions, other machines and runs that left no artefact in the repo are all invisible from here. "Not run here" is warranted; "has not happened" is not.

When the base is another branch

If <base> is not the trunk, the PR sits in a stack. Four things follow:

  • Diff against the parent: git diff <parent>..HEAD. Diffing against the trunk shows the parent's changes as if they were yours.
  • The Summary's first line names what this builds on and what it needs from it. One line. The parent PR describes itself, so restating any of its content belongs nowhere. Cite the parent's PR number if it has one; before that, name the branch and expect a number to replace it.
  • Write a stack bottom-up. The lower layer needs nothing from the layer above, so it is drafted, opened and numbered first, which is what gives the layer above both a number to cite and a body to measure against.
  • Compare this body's wc -w against the parent's before handing it over. A layer smaller than its parent gets a shorter body.

Name the category

State why a fact matters. Never restate the fact.

write thisnot this
for real devices the prefix is the building nameone of them is a street address
the cassette carries account identifiersthe account is <address>
the log names a shared devicethe device is <name>
measured on a real accounta real account with 8 units

A body is public the moment the PR opens. Applies to device names, building names, addresses, account identifiers, UUIDs, and counts of a person's units or accounts.

Evidence lives in the record

Measurements, probe counts, failure rates, rejected alternatives and provenance go in the ADR or plan. The body carries the conclusion and a link. A number repeated in both places dates the body the moment it is re-measured.

Design rationale for a tool lives in that tool's docstring.

Proportion

Measure the prose sections. The Testing list and the disclosure boxes sit outside the count: their length tracks how much was verified, and trimming them to hit a number is the one cut that loses a reviewer something.

Weigh it against review surface rather than raw lines. Deleted fixtures, cassettes and generated files inflate --shortstat without adding anything to read, so count the files someone must actually review.

Compare like with like. The merged corpus predates What changes for users and Risks accepted, so its numbers describe Summary plus Key changes and nothing else: about 40 to 100 words when one or two files need review (#255, a two-line i18n fix, is 40), 200 for a 20-file endpoint change (#257), 390 for an 11-file feature (#268), 550 for a 33-file refactor (#269). Hold those two sections against that range.

The other two sections are justified by whether their content is real, not by a word budget: a user-visible change nobody would otherwise notice, and a risk somebody inherits by merging, are both worth their length. Cutting them to hit a number removes the part of the body a reviewer most needs.

So when a body reads long, the question is whether Summary and Key changes have drifted past the corpus for a comparable review surface. File count predicts length poorly, and padding to reach a number is always wrong.

The writer applies this before handing back. Count Summary plus Key changes, find the corpus range for the review surface, and when the count is above it, cut to it. The hand-back reports the count before and after.

Across a stack, compare against the parent's body. With no parent body written yet, use the calibration above and say in your handover that the comparison was unavailable.

Common mistakes

Observed in baseline testing, every one of these from an author who had the diff in front of them.

mistakefix
Restating a sensitive value the reason merely refers toName the category
Opening with how the problem was discoveredOpen with the problem as it stands, then what changed
A Summary that restates the diff in proseLead with the problem; the diff carries the wording of the change
Framing: a sentence that announces, counts or signposts ("The skill sizes a body to its change.")Delete it; if no fact goes with it, it was framing
Over-compression: a dangling participle or a verb with no clear subject ("…, keeping evidence the tests simulate")Give every verb a subject, or split the sentence
Reproducing the ADR's measurement tableOne clause plus the link
"moved from X to Y", "previously", "used to"State current behaviour only
Any negation carrying the emphasis: X, not Y, X rather than Y, isn't an option, is not the argumentSay what is true, positively. Contrast two real options by naming both
Rebutting a position the PR never raisesDelete the paragraph
Explaining why a card, flag or graph existsPut it in the docstring
Arguing for the method instead of reporting what ranSay what ran and what it showed. A Testing preamble that defends the approach is commentary
An em dashA colon where it introduces an elaboration, commas or brackets where it wraps an aside. A body full of them reads as generated
A sentence that defers to a source ("docs/entities.md says so")State the fact, or link the source; a source cited this way vouches for more than it says
since meaning "because"because, or two sentences
A trailing reassurance after a cost ("it shows only as log noise")End the bullet at the cost
A cause, cost or remedy that neither the brief nor the diff holdsLeave it out of the body and list it in the hand-back
Hard-wrapping paragraphs or bulletsOne line each; GitHub renders the wrap as line breaks
Every box checked when verification is partialLeave the box unchecked and say why
Overwriting a body that was handed over for editingRead it first, keep the author's wording, report the change

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.