Design

Convention over configuration

pr-brief decides what a good PR description looks like. You decide five things. Everything else is fixed on purpose, and this page says what is fixed, why, and what you get for it.

The idea

A tool with many knobs gives you a different description in every repo. Reviewers have to relearn the format each time, the checks have to allow for every combination, and every team spends a meeting on node limits.

pr-brief takes the other road. It fixes the shape of the description and the size of a diagram, then offers only the choices that do not change what a reviewer sees: how the prose is edited, what happens to the earlier description, how the diagrams look, and whether they are Mermaid or plain text.

A rule changes in a plugin release, not in a config file. That keeps every PR that follows the convention comparable to every other one.

What is fixed

RuleWhat is fixed
The PR titleNever changed. Only the description changes.
The parts## Brief, ## Change map, ## Review guide, in that order.
The BriefOne paragraph of at most 5 sentences. Conceptual. No file names.
DiagramsAt most 3 diagrams per PR, one for each flow.
NodesAt most 9 nodes in a diagram, context nodes included.
EdgesAt most 14 edges in a diagram. The invisible layout links do not count.
LabelsAt most 28 characters.
Context nodesAt most 2 context nodes in a diagram, one hop from changed code.
Read these first1 to 7 rows, ranked by risk. A row you cannot justify is dropped.
Small PRsA PR with 3 code files or fewer gets no diagram, and says why.
LengthAt most 65,536 characters on GitHub, and at most 4,000 characters on Azure DevOps. The check counts characters, and takes the limit from the host the PR lives on.
ProseZero hard ASD-STE100 violations when the style is ste or ste+iceberg. Before the prose is edited, a cold-reader check (greenhorn) finds where a newcomer would get lost in the Brief and the What-changed bullets. The gate does not check this step, and it does not prove that the text is clear.
Plain-text diagramsA plain-text diagram is at most 78 characters wide. The gate checks that its boxes are the flow's boxes. It does not check the lines.
Diagram styleProduced by the tool from the theme. The gate recomputes it and compares it exactly.
QuietOptional, and only when you ask: /pr-brief quiet. The Brief stays visible. The Change map and the Review guide go in one collapsed block, inside the markers, right after the Brief. The block closes on the last line before the end marker, and a blank line follows its summary line. The gate reads the same sections and the same limits.
The gateAlways on, and it always blocks.
Writing to a PRAlways asks first, and always shows a before and after.

The source of truth is the convention file and the constants in internal/convention. A test fails if this page disagrees with them.

What you can set

SettingValuesDefault
styleste+iceberg, ste, iceberg: how the prose is editedste+iceberg
improve.previousfold keeps an earlier description that pr-brief did not write in a collapsed section; comment keeps it as a hidden comment; drop replaces itfold
diagram.themegithub-dark, github-light, dracula, alucard, or a path to a theme JSON filegithub-dark
diagram.formatauto (the host decides: ascii on Azure DevOps, mermaid on GitHub and GitLab), mermaid or asciiauto
tickets.patternA regular expression for a ticket key, such as (PAY|OPS)-[0-9]+ or AB#[0-9]+. It decides which tickets improve keeps and which the gate warns about. Jira and Linear links are always read.A guess at ABC-123 style keys

Anywhere a setting can be written, the same order applies: a command-line flag, then the repo file, then your user file, then the default. CI reads only the repo file and the defaults. An unknown key is an error, so nothing else can creep in.

What you get in return

  • Every PR reads the same. A reviewer learns the layout once, in any repo that uses it.
  • The gate can be exact. With nothing to tune, it checks the structure, the limits and the whole diagram style, and a failure always says what to fix.
  • Nothing to argue about. Nobody debates whether a diagram may have twelve nodes. It may have nine, and the tool collapses the rest.
  • Diagrams that render. The limits and the layout fix come from testing on GitHub. A knob that breaks the layout would not be offered.
  • A short README. Five settings fit in one table.

What it costs

  • You cannot raise a limit. A PR that really needs ten nodes in one flow is shown at nine, with the rest folded into a +N more node. The Review guide lists what was folded.
  • You cannot rename a section or soften the gate to a warning.
  • A rule you disagree with waits for a release. You can open an issue, or fork the plugin.
  • Small PRs get less. Three code files or fewer get a brief and a review guide, but no diagram.

Ways out

  • Skip one PR. Put a visible line in the description: > pr-brief skipped: <reason>. The reason is required and stays readable to reviewers.
  • Fold the long part. Add quiet to a write command (/pr-brief quiet or /pr-brief improve 12 quiet). The Brief stays visible, and the Change map and the Review guide sit under it in a collapsed block. It is a word on the command, not a setting, and it is off by default. A gate older than 0.8.1 rejects a quiet description. Azure DevOps may not collapse the block, so look at the PR there.
  • Make it your own look. A custom theme file changes every colour.
  • Choose the prose. style picks the ASD-STE100 rewrite, iceberg, or both. The cold-reader check (greenhorn) runs with every style.
  • Keep the old text. By default improve.previous: fold keeps an earlier description that pr-brief did not write in a collapsed section under the new one. comment hides it, drop removes it. A description pr-brief wrote is never kept. A copy is always saved on your machine.

Standardizing a team

One file at the repo root makes everybody in the repo use the same settings: .pr-brief.json. It is committed, so a teammate gets it with the repo, and it wins over their personal settings.

pr-brief init --pr-template --workflow

# wrote  .pr-brief.json
# wrote  .github/pull_request_template.md
# wrote  .github/workflows/pr-brief.yml
  • .pr-brief.json holds the five settings. It never overwrites an existing file.
  • .github/pull_request_template.md shows contributors the structure, including people who do not use Claude Code.
  • .github/workflows/pr-brief.yml runs the check in CI. It reads the config from the base commit, so a PR cannot edit the rules that check it.

The repo’s style and theme are what the hook and CI enforce. The marker in a description cannot weaken them. If you want to set the theme for the whole team, run pr-brief config set diagram.theme dracula --scope repo and commit the file.

Changing a rule

Open an issue that says which rule and what it blocks you from doing. A change to a limit or a section is a new release with a note on what breaks. A new theme can be added without breaking anything.