PR description¶
The body tells the reviewer why the change exists and where to start. The diff already shows what changed. A PR with several goals gets a shallower review, so the body also says when to split.
1. Find the goals¶
Read the Linear ticket (BRI-xxx / PDP-xxx in the branch or commits, via the Linear MCP), the
conversation if you have it, then the diff: git fetch origin <base>, then
git diff --stat origin/<base>...<head> — a stale local base shows commits that are not yours. On
another PR, git fetch origin pull/<n>/head:pr-<n> first.
Diff under migration/flyway/: check each version against the max on origin/<base>
(Flyway rules). A conflict goes in
À vérifier.
The diff is the source of truth: on a branch stacked on a squash-merged PR, git log still lists the
parent's commits.
A goal ships alone and has its own one-sentence why. Back end, front end, tests and the fixes the new flow needs are one goal. A change to shared tooling (CI, Storybook, build config) is its own goal: it affects code outside the feature.
2. Check the scope¶
Take the first row that matches:
| Situation | Verdict |
|---|---|
| Two or more goals (e.g. a feature + an unrelated refactor, fix or rename) | Split: one PR per goal |
| An API GET field + the client validator that makes it required | Split — see generic rules |
| One goal whose layers (schema, API, front) need different reviewers and each merge alone | Stack, in merge order |
| Anything else | Keep |
A layer too thin to review alone joins the next one: a migration ships with its API.
On Split or Stack, tell the human in the conversation and let them choose. Without one, add the
Découpage suggéré section. Never split on your own.
3. Write the title and body¶
Language and draft status follow AGENTS.md.
Title: type(<projet>): <scope> - <goal> (<ticket>) — reviewers and the stack view read the
platform first. <projet>: Invest or PDP. <scope>: api, bo or front, joined with / when
one goal spans several. E.g. fix(Invest): front - compteur actionnaires dynamique en clôture.
Shared tooling (CI, skills, build config) keeps a technical scope: chore(skills): ….
Body:
## Objectif
<1-2 phrases : le problème métier résolu, pour qui. Lien Linear.>
## Captures
<Optionnel. Avant / après de chaque écran modifié, après seul pour un nouvel écran.>
## Contexte
<Optionnel, 4 lignes max. La contrainte non évidente ou l'option écartée. Le reste vit dans Linear.>
## Guide de revue
- À lire attentivement : <les points d'entrée qui portent la logique, et le risque à vérifier>
- À survoler : <écrans, tests, stories, i18n, code généré>
## À vérifier
<Optionnel. Ce que le reviewer / la QA doit encore valider, ou ce que l'agent n'a pas pu
vérifier (pas d'env, pas d'UI, flaky…). Pas de « tests passent » ni de liste de commandes
déjà implicites.>
## Tasks
<Optionnel. Action manuelle hors code, avec son moment (avant mise en prod, après deploy…).>
## Découpage suggéré
<Sur Split / Stack seulement. Une puce par PR, dans l'ordre de merge, préfixée comme son titre.>
- Omit an empty section. Add the ones other rules require, e.g.
## Changelog(pr-changelog). - No list of changed files, no bullet per edit, nothing the diff already shows.
- No
claude.ai/code/session_…link, bare or in markdown: Slack unfurls it into a session preview in the PR notification. Remove it when a tool appends it. À vérifierlists residual risk only — omit it when nothing remains to check by hand.- Front diff:
À vérifiernames each platform nobody ran (web mobile, web desktop, iOS, Android) and the screens to open there. A native gesture never shows in a web screenshot. Point to the preview link or QR code posted on the PR, if any. Captureswhen the change shows at a glance: a new screen or component, a changed layout. Not for a UI string, a lone class, logic, tests or stories: the diff shows them.- 4 captures max. Mobile first, desktop only when its layout differs.
Avantonly for an existing screen whose layout changes. A new screen, or an addition to an existing one, getsAprèsalone.- Story id: the title lowercased with
/as-, then--, then the export in kebab-case (WithConsent→--with-consent). On a wrong id the script lists the valid ones. -
Create the PR, then run from the repo root. The script renders the PR head in a throwaway worktree (~2 min), pushes to the orphan
pr-assets/<pr-number>branch, never merged and deleted when the PR closes, and prints the table to paste.--avantrestores those UI files from the base for theAvantcolumn: screen, story,fr.json. First run:pnpm exec playwright install chromium. -
Open each PNG in the folder it prints. A blank page or an error overlay: fix, run again.
- No story for the screen: no
Captures;À vérifiernames the screens. Tasksonly from a signal in the diff: a new env var read (Dopplerprd), an API field the installed mobile app versions consume made required or removed (compat), a feature flag created by Flyway (value to set in BO App Config).- uimmo or theme diff: also apply design-system-change.
projects/sandbricks/src/prototypes/diff: add## ProtoafterObjectif. It is the front's handoff: one PR carries it, no other channel.
## Proto
- Lien : <preview web posté sur la PR, avec `etape` / `etat` quand un écran le demande>
- Écarts : <composants `modified` / `new` de `src/prototypes/generated/displays.json`, et ce qui change>
- États couverts : <états déclarés dans `prototypeDisplays.ts`, sinon « aucun »>
- Hors proto : <ce que la prod ajoute : API, container, store, analytics, ou « rien »>
4. Update an existing PR¶
- Agent text (inside the
CURSOR_AGENT_PR_BODYmarkers): rewrite it to the template; keep screenshots that help the review, drop a formerVérifiélaundry list of commands. - Human text: keep it, edit only what new commits invalidate.
- A new goal in new commits: run step 2 again.
- Write the body with
gh api -X PATCH repos/<owner>/<repo>/pulls/<n> -F body=@body.md.gh pr editfails on the deprecated Projects (classic) API.