Architecture diagrams from GitHub that update themselves
View agent prompt
Help me keep an architecture diagram of my GitHub repository up to date with Slatebox. Ask whether I want it in Slatebox (the Living architecture and Pull request impact recipes, which need the Slatebox GitHub App on my repositories) or only as a pull request comment (the free Slatebox/architecture-action GitHub Action, no account needed). For the recipe, walk me through Add a recipe in a project and keeping the first run. For the Action, write the workflow file from the guide into .github/workflows/. Never grant a recipe permission to comment or open pull requests for me: tell me where I grant it myself. Read https://docs.slatebox.com/Using-Slatebox/architecture-diagrams-from-github.md first. Ask for the inputs you need. Tell me what you verified and which steps I still need to do. If your client cannot fetch the documentation, read the same published file at https://raw.githubusercontent.com/Slatebox/slatebox-docs/retype/Using-Slatebox/architecture-diagrams-from-github.md.
Slatebox reads your repository and keeps its architecture diagram current: a service map, a module graph and an API surface, redrawn on every push to the default branch. Each pull request gets a slate of what it changes. The diagrams are real notes and lines your team marks up, and the recipes are free.
| You want | Use |
|---|---|
| A map that redraws on every merge | Living architecture recipe |
| A diagram of what each pull request changes | Pull request impact recipe, or the free GitHub Action |
| The map as Mermaid files in the repo too | Keep the diagrams in the repo too, a switch in Living architecture |
| Mermaid files in the repo, in step with slates you pick | Diagrams as code recipe |
Redraw the map on every push
- Open a project, then Recipes → Add a recipe → Living architecture.
- Choose Install Slatebox on GitHub and pick the repositories.
- Optional: turn off Name modules with the agent. Modules are then named by folder and the recipe asks the agent nothing.
- Optional: turn on Keep the diagrams in the repo too (below).
- Optional: under On a schedule, pick when it also runs, in your time zone. It starts at 03:00 and runs at most every 15 minutes.
- Choose Preview the first run, Turn on, then Keep all.
- The slate asks once: Apply future updates automatically? Yes lets later runs save on their own, each one undo. Not now keeps them as suggestions. Closing the question asks again later.
You get three slates per repository: Service map, Modules and API surface, plus a What changed board. Every push to the default branch redraws them after a two-minute quiet time, and again on the schedule. Change the schedule any time in the recipe's Settings.
On a self-hosted Slatebox
Your server needs its own GitHub App first. An admin sets it up once in Admin › AI control › Integration apps › GitHub App. Until then, the recipe's setup shows admins Set up the GitHub App, and tells everyone else: “Ask your admin to set up GitHub for Slatebox.”
It reads Docker Compose, Kubernetes, Helm, Terraform, serverless, JavaScript and TypeScript, Python, Go, Java, Rust, Ruby, OpenAPI, GraphQL, protobuf, routes and CODEOWNERS, and flags dependency cycles. A note a person renames or restyles is theirs: later runs leave it as it is.
Draw each pull request
Add Pull request impact the same way. Each pull request gets a slate in the Pull requests folder: what it adds, removes and touches. To keep one diagram comment on the pull request, edited in place on each push, grant Comment on pull requests under Changes outside Slatebox on the recipe.
Or use the GitHub Action, with no account
Slatebox/architecture-action is a free, MIT-licensed GitHub Action. On every pull request it posts one comment with a Mermaid diagram of what changes: services, data stores, queues, ingresses and their connections, plus modules, dependencies and endpoints. Save this as .github/workflows/architecture.yml:
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
permissions:
contents: read
pull-requests: write
jobs:
diff:
runs-on: ubuntu-latest
steps:
- uses: Slatebox/architecture-action@v1| Input | Does |
|---|---|
review-check: true |
Adds the status Slatebox architecture review, waiting until someone with write access who is not the author comments /architecture reviewed or /architecture no-change <why>. Needs statuses: write and the issue_comment and pull_request_review events |
slatebox-token |
Also draws the diagram on a private slate, kept up to date on later pushes. A token with slates:write from Profile → Developer access |
slatebox-url |
Your own Slatebox's address, for a self-hosted Slatebox |
Every input is in the Action's README.
Keep the map in the repo too
Turn on Keep the diagrams in the repo too in Living architecture's setup or Settings. For each repository, Slatebox adds a Diagrams as code · owner/repo recipe that keeps these files:
| Slate | File |
|---|---|
| Service map | docs/architecture/service-map.mmd |
| Modules | docs/architecture/modules.mmd |
| API surface | docs/architecture/api.mmd |
| Each module's own slate | docs/architecture/modules/<name>.mmd |
- How it lands: one open pull request from the
slatebox/architecturebranch. Slatebox updates it after each run. A person merges it. Nothing is written to your default branch. - The permission: turning the switch on yourself lets Slatebox open and update that pull request on its own, only on that branch and only in
docs/architecture/. Take it back in the Diagrams as code's Settings and each update waits as an approval card with the.mmdfiles to download. - When it starts: after you keep the first diagrams. A slate with no notes is never written.
- One way: the files are a copy of the slates. Change the code, not the files: an edit merged into one of them is replaced by the next update.
- Limits: at most 40 files per repository: the Service map, Modules and API surface first, then the busiest modules.
- Off: turning the switch off, or dropping a repository, removes its Diagrams as code. Its pull request stays on GitHub for a person to merge or close.
Keep Mermaid files for slates you pick
Diagrams as code keeps the slates you map as Mermaid files, by default in docs/architecture/:
- Add a recipe → Diagrams as code, pick the repository, and map each slate to a file.
- Under Changes outside Slatebox, grant Open pull requests on slatebox/ branches. Without it, each change waits as an approval card with the
.mmdfiles to download.
Ten minutes after the last edit to a mapped slate, or on Save to repo now, the slate is committed to one open pull request on its branch (slatebox/architecture unless you pick another). Two Diagrams as code never share a branch in one repository: pick another branch, such as slatebox/proposed, when Living architecture already keeps its files there. Slatebox never pushes to the default branch, never merges and never force-pushes. A merged edit to the file updates the slate in place. Flowcharts sync; moving notes changes nothing in the file.
Coding agents such as Claude Code and Cursor then read the map before a change: the committed .mmd files, or export_mermaid over the Slatebox MCP server. Connect Claude to a shared whiteboard
Questions
How do I keep an architecture diagram up to date automatically?
Turn on the Living architecture recipe in a Slatebox project and install Slatebox on your GitHub repositories. Every push to the default branch redraws the service map, module graph and API surface from your code.
Does it push to my repository?
Never to your default branch. A pull request comment, a check and a Mermaid pull request each need a permission you grant on the recipe; turning on Keep the diagrams in the repo too is that permission for the slatebox/architecture pull request and docs/architecture/. Mermaid files only ever go to a pull request on a slatebox/ branch, and a person merges it.
Can I change when it runs?
Yes. Pick another schedule in the recipe's setup or Settings, in your time zone, at most every 15 minutes. Pushes to the default branch still run it.
Is it free?
Yes. The recipes and the GitHub Action are free, on Slatebox Cloud and on a self-hosted Slatebox. Naming modules with the agent is optional and uses Slatebox Pro credits, a balance or your own key on Slatebox Cloud. See pricing
Is the extractor open source?
Yes. The code that reads a repository and compares two versions is in the MIT-licensed core of Slatebox/slatebox, and the GitHub Action uses the same code.
Which languages and files does it read?
Docker Compose, Kubernetes, Helm, Terraform, serverless, JavaScript and TypeScript, Python, Go, Java, Rust, Ruby, OpenAPI, GraphQL, protobuf, routes and CODEOWNERS.