Libraries
Library usage
The CLI is the fastest front door, but the packages are composable when you need to embed metrics, filters, TCA estimates, or analyzer annotations into your own tooling. Keep the dependency direction clean: Metrics first, Filters on top, Tca on top of both, analyzers separately.
Package roles
Each package owns a different layer of the contract.
Metrics
Collect a SimplicitySnapshot from a solution. This is the foundation layer.
Filters
Evaluate the snapshot into pass/fail teaching verdicts for TwoAmTest, HalfRule, and PrimaryPathFirst.
Tca
Turn the same snapshot and verdicts into an annual cost estimate for architecture drag.
Compose the stack explicitly
Start with the snapshot, then add interpretation and cost. Do not jump straight to TCA if you still need to explain the underlying shape.
using SimplicityTools.Filters;
using SimplicityTools.Metrics;
using SimplicityTools.Tca;
var collector = new SimplicityCollector();
var snapshot = await collector.CollectAsync("path/to/Solution.sln");
var verdicts = new[]
{
TwoAmTestEvaluator.Evaluate(snapshot),
HalfRuleEvaluator.Evaluate(snapshot),
PrimaryPathFirstEvaluator.Evaluate(snapshot)
};
var estimate = TcaEstimate.Create(snapshot, verdicts);
Console.WriteLine(snapshot.ToSummary());
Console.WriteLine(estimate.ToExecutiveSummary()); Versioning guidance
Package boundaries only help if upgrades remain legible.
SimplicityTools.Metrics,SimplicityTools.Filters, andSimplicityTools.Tcaversion together.SimplicityTools.AnalyzersandSimplicityTools.Clirelease independently.- Use the same version across Metrics / Filters / Tca unless you are deliberately testing a breaking change boundary.
When to stay with the CLI instead
Just because the packages are composable does not mean every team needs to wire them manually.
- Use the CLI when you need a quick read, a baseline gate, or a shareable report with no custom plumbing.
- Use the libraries when you are embedding snapshots or verdicts into another tool, dashboard, or workflow you already own.
- Use analyzers separately when the main need is IDE/build feedback rather than a custom application integration.