This is about one working habit of mine: I put an architecture diagram in a pull request. The picture is small on purpose: the part of the system a change touches, drawn so a reviewer can see what is new before reading the diff.
This post covers where that habit came from, what the picture shows, how I make it, and when I leave it out. ByteDiagram is our product, and I built it, so treat the tool section as a disclosed founder's view rather than a neutral review.
What a diff alone does not show
The problem is easy to describe. A code review tool shows a diff, file by file and line by line. That is exactly right for checking logic, naming and tests. It is much weaker at answering a different question: once this merges, what talks to what, and in which direction?
Google's published code review guide puts that question first. Of everything a reviewer checks, it ranks the overall design of the change highest: whether the interactions between pieces of code make sense and whether the change fits well with the rest of the system. A reviewer can answer that from the diff alone, but only by rebuilding the architecture in their head from scattered files.
When you review a pull request with a diagram beside it, that rebuilding is already done on the page. The reviewer can check the picture against the code instead of inventing the picture from the code.
What I attach, and what it leaves out
A picture that works in a pull request shows the following:
- The services or components the change touches, outlined so they stand apart from the rest.
- The neighbours they talk to, so a reviewer can see which boundaries the change crosses.
- New or removed connections, marked differently from the ones that stay.
My opinion on scope is simple: one change, one picture. A diagram in PR description space is not the place for the whole platform. It only needs the boundary the change crosses and enough of the neighbourhood around it that a reviewer can see what is new. Everything else is noise that the reviewer has to read past.
That idea fits the same guide's advice on small changes, which notes that a smaller change makes it easier for author and reviewer to reason about its impact. If the honest diagram for a pull request needs half the system on it, that is often a hint that the pull request is doing too many things at once.
Some changes are not really about boxes at all. If what changed is the order of calls between services that already exist, a sequence view usually tells the story better, and there is a comparison of tools for when the change is about call order, not boxes.
The picture above is a generic stand-in, not a real system of mine. It shows the same small system twice. In the panel on the left nothing has changed yet. In the panel on the right, a dashed link tagged "new" runs from the orders service to the queue, the queue and its worker sit inside a dashed area marked as changed in this PR, and a short legend separates unchanged parts from the changed one.
How I make it without slowing the PR down
The format matters less than the habit. A still PNG or SVG in the pull request description is easy for every reviewer to open; an Animated GIF only earns its place when the order of calls is what the change is about.
On the tool side, these are the ByteDiagram pieces that fit this kind of picture. The Icons panel includes AWS Services icons along with other built-in icons for common parts of a stack. Among the shapes there is a "Section", labelled "Dashed zone for grouping steps", and a dashed outline like that is a natural way to fence off the part a pull request touches. The Templates panel offers starting layouts, and the "Auto-arrange" button tidies the boxes after you add or move things.
For the attachment itself, its Export menu includes PNG, SVG and Animated GIF (checked 26 Oct 2026). GitHub's documentation lists PNG, GIF and SVG among the image types you can attach to issues and pull requests. You can drag a file into the description box, and in many browsers you can paste an image straight into it.
A still image is the default I would suggest. An Animated GIF earns its place only when the order of events is the point of the change, because a reviewer reading a description wants to take in the picture at a glance.
An image is not the only option. GitHub also renders Mermaid diagrams written in Markdown inside pull requests, and plenty of teams prefer tools that keep the diagram next to the code, as text in the repository that changes alongside it. That is a fair choice with real advantages, and if it suits your team, start with writing the same picture as Mermaid text.
Why I keep doing it
In my view, a reviewer who can see the shape of a change can ask about the boundary it crosses, instead of rebuilding the system in their head from file names.
There is also a reason that has nothing to do with the review itself. Google's guide on change descriptions makes the point that a description is a lasting public record: future engineers will search for a change and read its description to learn why it was made, because the code shows what the software does but not always why. An architecture diagram for code review keeps working after the merge in the same way. Months later, someone reading the history sees the shape of the change, not only its lines.
One practical caution comes from GitHub's own documentation. Files attached to a public repository can be viewed without signing in, while in a private or internal repository only people with access can see them. Keep that in mind before you draw internal details into a picture.
When I skip the diagram
As general guidance, a diagram does not earn its place on every change, whatever the title of this post suggests. A typo fix, a rename, a copy change or a small bug fix inside one component does not move any boundary, and a picture would only repeat what the diff already says plainly.
A simple test is whether the change adds a dependency, removes one, moves data somewhere new or changes which part owns a job. If none of those is true, the description text is enough. If the team wants the habit to be easy to remember, GitHub lets a repository add a PR template whose contents appear in the body of every new pull request, and a short "Diagram, if a boundary moved" heading there is a gentle prompt.
If your next pull request moves a boundary, sketch the before and after in the guest canvas; editing needs no account.
FAQ
Should every pull request include an architecture diagram?
In my view, no. A diagram is worth adding when the change moves a boundary: it adds or removes a dependency, sends data somewhere new or shifts which part owns a job. For typo fixes, renames and small changes inside one component, the diff and a clear description already tell the reviewer everything.
What file format works best for a diagram in a pull request?
GitHub's documentation lists PNG, GIF and SVG among the image types you can attach to a pull request. In ByteDiagram, its Export menu includes PNG, SVG and Animated GIF (checked 26 Oct 2026). I would use PNG or SVG for a still picture, and an Animated GIF only when the order of events matters.
Is a diagram image better than diagram code in a PR?
They do different jobs. Diagram code lives in the repository and diffs line by line, so you can see exactly what changed in the picture. An image shows the layout at a glance, with no rendering step for the reader. Plenty of teams use both, and I think either beats a pull request with no picture.
Sources
Checked on 26 October 2026.
- About ByteDiagram: what our product is for.
- ByteDiagram team: Rahish, Founder & CEO.
- ByteDiagram guest canvas: the Icons panel, Section shape, Templates panel, "Auto-arrange" button and Export menu.
- GitHub Docs, attaching files: image types for pull requests, drag and paste, and who can view attached files.
- GitHub Docs, creating diagrams: Mermaid rendering in pull requests.
- GitHub Docs, pull request templates: template contents shown in the pull request body.
- Google engineering practices, writing good CL descriptions: the description as a lasting record of what changed and why.
- Google engineering practices, what to look for in a code review: overall design first.
- Google engineering practices, small CLs: smaller changes are easier to reason about.
Try it on your next pull request
Pick the next change you open that moves a boundary. Draw only the part it touches, mark what is new, and put the picture at the top of the description. Then see what your reviewers ask about, and keep the habit only if it helps them.
Give your reviewers the picture
ByteDiagram is our own tool. Draw the part your change touches, outline it with a dashed section, and export a still image for the description.
Visit ByteDiagram