Dotnet-skills dotnet-netarchtest
Use the open-source free `NetArchTest.Rules` library for architecture rules in .NET unit tests. Use when a repo wants lightweight, fluent architecture assertions for namespaces, dependencies, or layering.
install
source · Clone the upstream repo
git clone https://github.com/managedcode/dotnet-skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/managedcode/dotnet-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/catalog/Libraries/NetArchTest/skills/dotnet-netarchtest" ~/.claude/skills/managedcode-dotnet-skills-dotnet-netarchtest && rm -rf "$T"
manifest:
catalog/Libraries/NetArchTest/skills/dotnet-netarchtest/SKILL.mdsource content
NetArchTest
Trigger On
- the repo uses or wants
NetArchTest.Rules - architecture rules should be enforced in automated tests
Value
- produce a concrete project delta: code, docs, config, tests, CI, or review artifact
- reduce ambiguity through explicit planning, verification, and final validation skills
- leave reusable project context so future tasks are faster and safer
Do Not Use For
- very rich architecture modeling that needs a heavier DSL
Inputs
- the nearest
AGENTS.md - architecture boundaries to enforce
- target assemblies
Quick Start
- Read the nearest
and confirm scope and constraints.AGENTS.md - Run this skill's
through theWorkflow
until outcomes are acceptable.Ralph Loop - Return the
with concrete artifacts and verification evidence.Required Result Format
Workflow
- Encode only durable architecture rules:
- forbidden dependencies
- namespace layering
- type shape conventions
- Keep rules readable and close to the boundary they protect.
- Fail tests on architecture drift, not on temporary style noise.
Bootstrap When Missing
If
NetArchTest.Rules is not configured yet:
- Detect existing setup:
rg -n "NetArchTest\\.Rules" -g '*.csproj' .
- Add the package to the architecture test project:
dotnet add TEST_PROJECT.csproj package NetArchTest.Rules
- Add at least one executable boundary rule test.
- Wire architecture tests into the standard
command intest
and CI.AGENTS.md - Run
and returndotnet test TEST_PROJECT.csproj
orstatus: configured
.status: improved - If richer modeling is required and
is chosen as the standard, returnArchUnitNET
.status: not_applicable
Deliver
- architecture tests that are understandable and stable
- boundary checks wired into the normal test path used by agents and CI
Validate
- the rules map to real boundaries the team cares about
- failures point to actionable dependency drift
Ralph Loop
Use the Ralph Loop for every task, including docs, architecture, testing, and tooling work.
- Plan first (mandatory):
- analyze current state
- define target outcome, constraints, and risks
- write a detailed execution plan
- list final validation skills to run at the end, with order and reason
- Execute one planned step and produce a concrete delta.
- Review the result and capture findings with actionable next fixes.
- Apply fixes in small batches and rerun the relevant checks or review steps.
- Update the plan after each iteration.
- Repeat until outcomes are acceptable or only explicit exceptions remain.
- If a dependency is missing, bootstrap it or return
with explicit reason and fallback path.status: not_applicable
Required Result Format
:status
|complete
|clean
|improved
|configured
|not_applicableblocked
: concise plan and current iteration stepplan
: concrete changes madeactions_taken
: final skills run, or skipped with reasonsvalidation_skills
: commands, checks, or review evidence summaryverification
: top unresolved items orremainingnone
For setup-only requests with no execution, return
status: configured and exact next commands.
Load References
references/patterns.mdreferences/examples.mdreferences/netarchtest.md
Example Requests
- "Add architecture tests with NetArchTest."
- "Block UI from referencing data directly."