TLDR overview
- Architecture as JSON means defining intended architecture in sonar-architecture.json, stored in your repository, under version control.
- Pull request analysis surfaces deviations a proposed architecture change would introduce before merge.
- Reverting the commit restores the previous intended architecture on the next analysis.
- Available in SonarQube Cloud for Java, C#, JavaScript, TypeScript, and Python.
Architecture decisions shape every system in software development. When those decisions live outside your repository, they become invisible to the workflow that governs everything else: no review, no history, no rollback. Drift accumulates not because teams stop caring about architecture, but because architectural intent has no place in the process where code actually changes.
Intended architecture is the high-level blueprint of your project's structure. SonarQube checks your code against it and reports deviations. SonarQube now lets you define a project's intended architecture in sonar-architecture.json, a file that lives in your repository, travels through your pull requests, and follows the same version control discipline as your code. Available now in SonarQube Cloud.
How do architecture decisions become reviewable?
When architecture lives in a file, every change to it goes through a pull request on platforms like GitHub
. Your team reviews structural decisions the same way they review code: with context, with discussion, and with a clear record of who changed what and why. Nothing lands silently.
Add sonar-architecture.json to the base directory of your project. It uses the same intended architecture definition as the public web API, the SonarQube CLI, and the SonarQube MCP Server, so developers, tech leads, and coding agents all work from one consistent format. No translation between tools. No separate definition to keep in sync.
How do you assess the impact of an architecture change before you merge it?
Committing an architectural change without knowing what it breaks is a blind spot most teams only discover in production. SonarQube closes it.
Change the architecture file in the same pull request as the code it describes. Pull request analysis checks that code against the updated file in the branch, surfacing every deviation the new architecture would introduce before you merge. Plus, the architectural change follows the branch that necessitated the change. Your main branch keeps its existing model until the pull request is approved and merged, so reviewers see the full structural impact of a change while there is still time to act on it.
How do you roll back an architecture change?
Architectural decisions that turn out to be wrong should be as easy to undo as a bad commit. With architecture managed in version control, they are. Reverting the commit that changed sonar-architecture.json restores the previous intended architecture immediately. No manual reconfiguration. No reaching into a separate UI to undo a decision made weeks ago. The history is in the repository. The rollback is a standard Git operation.
How do you manage architecture in the workflow your team already uses?
The gap between architectural intent and code reality widens when architecture is managed in a separate system with a separate process. SonarQube eliminates that gap.
Architecture changes are committed alongside the code they govern in your version control systems. They go through the same pull request review. They appear in the same diff, with the same approvers, under the same branching strategy your team already enforces. Coding agents can write and update the file directly, so agent-generated structural decisions are version-controlled and reviewable alongside the code the agent produces.
Architecture is part of the Guide pillar in Sonar's Agent Centric Development Cycle (AC/DC) framework: agents receive architecture constraints as they write code. A reviewed file in the repository gives coding agents and reviewers the same intended architecture.
Each project maintains one source of truth. By default, SonarQube uses the file when it exists and the model saved in SonarQube when it does not. If your team prefers the web interface, a project setting lets you disable file-based management entirely.
Permissions that fit your team
Users and groups with the Administer Issues permission can create, edit, and delete a project's intended architecture. Developers and tech leads typically already hold this permission, so most teams can start immediately. Organizations that need stricter separation of duties can require the dedicated Administer Architecture permission through the organization settings.
Get started
- Export your current intended architecture with
Sonar architecturein the SonarQube CLI, or ask your coding agent to write the file from your existing structure. - Commit
sonar-architecture.jsonto the base directory of your project and open a pull request. - Review the deviations SonarQube surfaces on the pull request, then merge.
Availability
Available now in SonarQube Cloud. SonarQube Server support arrives in the next version. Supported languages: Java, C#, JavaScript, TypeScript, and Python.
To learn more, see the documentation and the architecture resource center. For CLI setup, see the SonarQube CLI quickstart guide.

