Zphil.LoadBearing 0.1.0

dotnet add package Zphil.LoadBearing --version 0.1.0
                    
NuGet\Install-Package Zphil.LoadBearing -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Zphil.LoadBearing" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Zphil.LoadBearing" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Zphil.LoadBearing" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Zphil.LoadBearing --version 0.1.0
                    
#r "nuget: Zphil.LoadBearing, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Zphil.LoadBearing@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Zphil.LoadBearing&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Zphil.LoadBearing&version=0.1.0
                    
Install as a Cake Tool

Zphil.LoadBearing

Zphil.LoadBearing is the LoadBearing spec contract: the fluent builder and reified rule model an architecture spec is written against. It is the one package a spec project references.

LoadBearing is one C# architecture spec with two render targets: deterministic enforcement (CLI/CI/agent hooks) and generated AI-agent context (a managed AGENTS.md block, scoped rules, MCP tools). Every rule carries a posture: Enforce for the law, Migrate for ratcheted tech debt with a grandfathered baseline, Freeze for "here be dragons" code that must be contained rather than touched.

Writing a spec

A spec is a small class library with one class implementing IArchitectureSpec:

using Zphil.LoadBearing;

public sealed class ArchSpec : IArchitectureSpec
{
    public void Define(Arch arch)
    {
        Layer domain = arch.Layer("Domain", "MyApp.Domain.*");
        Layer web    = arch.Layer("Web",    "MyApp.Web.*");

        arch.Rule("layering/domain-independent")
            .Enforce(domain.MustNotReference(web))
            .Because("Domain is UI-agnostic; transaction boundaries live in services.")
            .Fix("Define an abstraction in Domain and implement it in Web.");
    }
}

Add the spec project to the target solution (dotnet sln add arch/MyApp.ArchSpec/MyApp.ArchSpec.csproj) and the tooling discovers it by convention: the unique solution project that references this package. The spec project itself is excluded from the checked universe.

Pick the spec project's target framework by one rule: it must be able to reference the product projects it will typeof(). This package is netstandard2.0 with zero dependencies, so a spec project can target anything from net48 up.

This package is the contract only

Nothing in it checks or renders anything. That is done by:

  • Zphil.LoadBearing.Cli, the loadbearing global tool: check, render, explain, status, graph, baseline, and the MCP server (loadbearing mcp).
  • Zphil.LoadBearing.Xunit, the adapter that runs every rule in the spec as an individually named xUnit test.

Documentation

License

MIT

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Zphil.LoadBearing:

Package Downloads
Zphil.LoadBearing.Xunit

The LoadBearing xUnit adapter: derive a test class from ArchRuleTests<TSpec> and every rule in the architecture spec becomes an individually named xUnit test, with failure text identical to the loadbearing CLI. Requires xunit.v3 3.2.2 or later and a .NET SDK on the test host (the checker loads the target solution through MSBuildWorkspace).

Zphil.LoadBearing.Roslyn

LoadBearing's Roslyn extraction and workspace infrastructure: MSBuildWorkspace loading, type-level dependency-edge extraction, and the baseline-file host layer. Not intended for direct reference — it ships as a dependency of the LoadBearing tool (Zphil.LoadBearing.Cli) and the xUnit adapter (Zphil.LoadBearing.Xunit); architecture spec projects should reference Zphil.LoadBearing instead.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 73 7/14/2026