See it as a diagram
Everything below, as a diagram you can edit. Describe yours and see it in seconds.
No account needed · Editable canvas, not a picture
Workflow one: the onboarding sweep
The event is a repository nobody has documented. One session, one pass: the agent reads the repository, calls the design guide, builds the diagram on a canvas, validates it, and writes the overview around it. The output is explicitly a draft.
The value is not that the agent is right. It is that arguing with a wrong diagram is enormously faster than starting from nothing, and it surfaces disagreement between people who thought they agreed. Ask for the list of things it could not determine; that list is the agenda for the correction session.
Finish by putting the corrected version where people already look, as a live embed in the README rather than an image in a wiki.
Workflow two: the change-triggered edit
The event is a merge with structural impact. The agent applies the delta to the existing diagram and to the one paragraph the change makes wrong, then stops. The instruction has to say edit, not recreate, and has to define structural narrowly, or the workflow generates noise for every merge and everyone stops reading it.
There is a usable definition of structural to borrow rather than invent. Repository sync answers the same question by hashing the parsed structure that feeds the diagram, the Terraform draw plan or the assembled corpus, and doing nothing at all when the hash is unchanged. Written into an instruction file that becomes: a service, datastore, queue, or external dependency added, removed, or rerouted counts; a rename in a comment, a test, a version bump, or a variable default does not.
This is the workflow most worth writing into the repository instruction file, because it needs to be applied by whichever session happens to be running rather than remembered by a person.
## Documentation rules Architecture diagram: Datadef project ARCH-PLATFORM. - New or removed service, datastore, queue, or external dependency -> edit_diagram on ARCH-PLATFORM with that delta. - Never create a second diagram for an update. - Before a design review -> repo_status, and repo_refresh if the diagram is behind the branch. - No structural change -> do nothing.
Workflow three: the review-time check
The event is a meeting. Before a design review, an incident review, or an architecture discussion, the agent checks whether the diagram still reflects the branch and refreshes it if not. repo_status reports the repository, the branch or tag, the commit reflected, the time of the last sync, and whether daily sync is on. repo_refresh regenerates it, which takes one to three minutes.
It works because it is attached to something that already has a time and a person. Policies that exist independently of a meeting tend not to survive the quarter.
The one that does not work: the unattended agent
The tempting design is an agent that watches the repository and updates documentation when things change. It cannot exist over MCP: tools run only when a model calls them inside a live session, and nothing runs between sessions. An agent given that instruction will agree enthusiastically and then do nothing, which is worse than refusing, because the team believes the loop is running.
The unattended half has to come from something that is a service rather than a session. A connected repository regenerates its diagram and architecture document daily from the branch or tag you chose, skipping commits with no structural change and keeping hand-moved node positions. Combine the two and each half does what it is capable of: repository sync for the structure, agent sessions for the judgement and the prose.
The test for any agent workflow
FAQ
What is a realistic agent workflow for keeping architecture docs current?
Can an agent maintain documentation without anyone asking?
Where do the workflow rules belong?
How do I stop an agent from rewriting documentation that was fine?
What should the agent do before a design review?