Skip to content

Architecture Guardian documentation

Define architectural boundaries in YAML and enforce them in your .NET codebase. These guides explain how to install the product, model your architecture, interpret findings, and share a policy across your editor, CI pipeline and coding agents.

I want to…Start here
Run my first architecture checkInstall the CLI, then follow the quick start
Understand the model before writing YAMLArchitecture as code, then modules, layers and contracts
Learn the configuration languageWrite a YAML policy, then use the complete reference
Get IDE/build feedbackInstall the Roslyn analyzer
Check pull requests in CIAdd an independent quality gate
Give an AI agent architecture contextConfigure MCP, then use the agent workflow
Evaluate cost and coverageBenchmarks, engine differences and known limitations
  1. Install and verify the tool. CLI/MCP need .NET 10 and the SDK required by the repository you analyze. Use the released NuGet packages.
  2. Choose a complete scope. Map every loaded project, including references, to exactly one module and layer in a first policy.
  3. Restore, inspect and scan. Use the same configuration/framework for preparation and analysis.
  4. Repair a real violation. Try the downloadable examples, inspect evidence, correct the dependency and rerun the gate.
  5. Keep the check in your workflow. Share YAML with the analyzer and add a solution scan to CI. Use MCP when an agent should inspect and validate architecture.

The quick start takes you through these steps. The installed tools and downloadable samples do not require an Architecture Guardian source checkout.

Use caseGuidance
Keep Clean Architecture dependencies pointing inwardLayer boundaries, AG002 and explicit Domain restrictions
Isolate a modular monolithContracts and cycles, AG001/AG003/AG004
Keep frameworks out of business logicTechnology restrictions, AG005/AG006 and exceptions
Adopt enforcement with existing debtBaseline adoption and Git analysis
Make agents respect boundariesInspect, implement, validate and correct

Use the CLI, MCP, analyzer and CI guides for integration. Exact contracts are in the YAML reference, AG001–AG006 catalog, JSON/SARIF reports, baselines, Git comparison, and compatibility policy. Operational guidance covers workspace loading, performance and telemetry and troubleshooting.

CLI exitMeaningNext action
0Analysis completed and the selected gate passedContinue with normal build, tests and review
1Analysis completed and the gate failedCorrect or explicitly review the architecture finding, then rescan
2Invalid input, incomplete analysis, failure or cancellationResolve the operational issue and rerun before drawing a compliance conclusion

For MCP, check both status and gateOutcome. Compiler feedback covers its host compilation; retain solution scans for broader context and AG003 cycles. A new-finding gate may pass while existing errors remain. An empty incomplete result never establishes a successful gate.

See release notes and the roadmap for changes and plans. Report reproducible problems through GitHub issues, including tool version, build context, relevant policy and redacted diagnostics.