Skip to content
Source
Sign inSign up

Keep it up to date

Software factory / Architecture

Keep the architecture up to date

The Architecture tab helps people only while it matches the code. You want it to update after merges, to make a view now, or to know why a run failed.

4 min read

The Architecture agent is off by default. When an admin turns it on, the tab stays current after the merges that change the architecture. See Turn on the agents.

You need write access to the repository for steps 1 and 2. To turn the agent off, you need admin access.

1. Make it now

A repository has no view until its next merge to the default branch. You do not have to wait.

  1. Open the Architecture tab.
  2. Click Generate now. When a view exists, the button is Regenerate.

When the run ends, the tab shows the new view by itself. You do not reload the page.

Generate now skips the code rules and the decision model of When it updates. When no run starts, the page says why: the agent is off, a run is queued or running already, or the default branch has no commit.

In a terminal, run src repo architecture --generate.

2. Watch the run, or see why it failed

While a run is queued or going, the tab says A run is going. People with write access see Watch it live. It opens the run page, which shows the log as the model writes: its reasoning, its text and the record it saves. You do not reload the page.

When a run fails or is skipped, the tab says why. For example:

  • The last run failed: The agent ran past its time limit of 15 minutes.
  • The last run was skipped: Monthly model spend cap reached

People with write access see See its log. Every run of every agent is also in the list of runs on the Agents tab. See Watch the factory work.

Done

The tab shows a current view of the default branch, and you know where to look when a run fails.

When it updates

The agent runs when a push or a merge moves the default branch. Code looks at the changed paths first:

  • No view yet: the agent makes one.
  • Only docs, tests, generated files or assets changed: the agent skips the push.
  • A package manifest changed, for example package.json, go.mod or Cargo.toml, or a file moved to another top-level folder: the agent makes a new view.
  • Any other change: Cloudflare's decision model clef-flash says if the push changes the architecture. The agent runs only for a yes. If the model does not answer, the agent runs.

The agent pushes nothing and posts no comment. The old view stays on the tab until the new one is ready.

How it works

Code reads the new commit first: its folders, its README, the manifest of each package, and the entry file of each package (for example src/index.ts). Then one model call writes the view from that. The model reads no files itself, so a run costs about the same each time.

The skills of each package are not in the view that the model writes. Code finds them in the commit of the view, each time the page loads.

The header names the model that made the view. People with write access also see The run that made it. It opens the run page, with the log of the agent.

Turn it off

  1. Open the repository, then Agents. In the sidebar, click Agents under Software factory. You need admin access.
  2. Turn off the switch of Architecture. It saves at once.

An organization owner can turn it off for every repository of the organization, on the organization's Software factory tab.

To turn off only the Ask about the architecture panel, see The architecture chat settings.

What it costs

The forge pays for the model. When the forge has an AI Gateway set up (the deploy setting FACTORY_AI_GATEWAY), the agent uses Anthropic's Claude Haiku 5.5 (anthropic/claude-haiku-5.5) with medium reasoning through it. Without one, it uses Workers AI's own DeepSeek V4.1 Flash model.

  • The cost of its runs counts toward the monthly spend cap of the user or organization.
  • One run makes one model call, and stops after 15 minutes.

To change the model, see Pick a model.