Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(agents): limit pr description diagrams to architecture changes (#118030)

Georges-Antoine Assi0f68e3e8260b
diff --git a/.agents/skills/writing-pr-descriptions/SKILL.md b/.agents/skills/writing-pr-descriptions/SKILL.md
index a07bd29624de..63ba8fafb127 100644
--- a/.agents/skills/writing-pr-descriptions/SKILL.md
+++ b/.agents/skills/writing-pr-descriptions/SKILL.md
@@ -100,9 +100,9 @@ Prose is the slowest form on the page. Before writing a sentence, ask what carri
| The fact you have | The form that carries it |
| ------------------------------------------------------------------------------------ | --------------------------------------------------------- |
-| A visual change (any UI a person sees) | Screenshot, before and after. Mandatory, not optional |
+| A visual change (any UI a person sees, including a flow through screens) | Screenshot, before and after. Mandatory, not optional |
| A new action and its effect, which one screenshot cannot show | A feature reel in place of the "after" screenshot |
-| A change to a flow or topology (CI wiring, pipelines, state machines, request paths) | Two branded `flowchart` blocks, before first |
+| An architecture or topology change one sentence cannot carry (defined under Mermaid) | Two branded `flowchart` blocks, before first |
| Several values compared across the same dimensions | A markdown table |
| A config or setting change | A fenced `diff` block |
| Existing code a reviewer needs to see | A line-range permalink, which GitHub renders as a snippet |
@@ -134,6 +134,13 @@ Touching UI code without a visible change is common, and the mandate has to be d
### Mermaid
+Draw a diagram only for an architecture or topology change that one sentence cannot carry.
+Architecture and topology mean CI wiring, pipelines, services and the calls between them, or module and package boundaries.
+They also mean a state machine with several states, or a request path across systems.
+A UI flow or a linear sequence of screens is not a topology.
+It gets screenshots or a reel, not a diagram.
+When one sentence states the whole change, such as one step added to a straight chain, write the sentence instead.
+
Keep diagrams simple. A syntax error renders as an error block. Pick `TD` for tall pipelines, `LR` for wide paths. Mermaid cannot read CSS vars, so use the hex directly, and pair every `fill` with a text `color` so nodes stay legible in GitHub light and dark.
```text
@@ -287,7 +294,7 @@ A "no" anywhere means the body is ordered for the writer, not the reader. Go bac
11. Does any sentence take its author as the subject? Rewrite it around the change. "I", "me" and "my" appear nowhere.
12. Does the PR change anything a person sees? Include before-and-after screenshots, or say why nothing looks different.
13. Did you rewrite an existing body? Every image, video, link and ticked box a person put there still appears.
-14. Does the PR change a flow or topology? Include branded before-and-after diagrams.
+14. Does the PR change architecture or topology in a way one sentence cannot carry, as defined under Mermaid? Include branded before-and-after diagrams. Delete any diagram of a UI flow or of what one sentence says.
15. Does prose compare several values across the same dimensions? Replace it with a table.
16. Does every claim about what you ran, measured or saw link its evidence, or say it went unchecked? Descriptions of behavior need no link.
17. Did a `<!-- -->` template comment survive anywhere? That section is unfilled. Fill it or delete it.
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index d11c011d0a90..cd34a6715285 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -82,7 +82,7 @@
- Description: high-level rationale, not a step-by-step replay.
- Voice: the subject of every sentence is the change, never its author. No "I", "me" or "my" anywhere in the body. "I (actually Claude)" is worse than either half: it hands the assignee an account of work they did not do. Authorship is one stated fact in the Agent context section below.
- Body: pass it straight to the creation tool's `body` arg (GitHub MCP `create_pull_request` body, or `gh pr create --body-file -` via stdin) — don't write it to a temp file first; the arg preserves markdown and newlines verbatim.
-- Flow and topology changes: include separate before-and-after Mermaid `flowchart` blocks with PostHog colors. This includes CI wiring, pipelines, state machines, and request paths. Use `/writing-pr-descriptions` for the palette and role mapping.
+- Architecture and topology changes: when one sentence cannot carry the change, include separate before-and-after Mermaid `flowchart` blocks with PostHog colors. This covers CI wiring, pipelines, services and their calls, module or package boundaries, state machines with several states, and request paths across systems. A UI flow or a linear sequence of screens gets screenshots or a reel, not a diagram. Use `/writing-pr-descriptions` for the palette and role mapping.
- Public OSS repo: no internal customers, incidents, or operational metrics.
- Stack instead of stuffing: if the diff holds two or more separable steps (migration then behavior, rename then rewrite), open a stack rather than one big PR. See AGENTS.md, "Stacked PRs" and /stacking-prs.
- Simplify before opening: if your agent has a behavior-preserving cleanup pass (Claude Code: `/simplify`), run it on a non-trivial diff before final tests and preflight, since it edits the tree. Skip it for small mechanical changes.