$npx -y skills add managedcode/dotnet-skills --skill archunitnetUse the open-source free ArchUnitNET library for architecture rules in .NET tests. Use when a repo needs richer architecture assertions than lightweight fluent rule libraries usually provide. USE FOR: the repo uses or wants ArchUnitNET; architecture testing needs richer modelin
| 1 | # ArchUnitNET for .NET |
| 2 | |
| 3 | ## Trigger On |
| 4 | |
| 5 | - the repo uses or wants `ArchUnitNET` |
| 6 | - architecture testing needs richer modeling than simple dependency checks |
| 7 | |
| 8 | ## Value |
| 9 | |
| 10 | - produce a concrete project delta: code, docs, config, tests, CI, or review artifact |
| 11 | - reduce ambiguity through explicit planning, verification, and final validation skills |
| 12 | - leave reusable project context so future tasks are faster and safer |
| 13 | |
| 14 | ## Do Not Use For |
| 15 | |
| 16 | - the lightest possible architecture rule checks |
| 17 | |
| 18 | ## Inputs |
| 19 | |
| 20 | - the nearest `AGENTS.md` |
| 21 | - target assemblies |
| 22 | - architecture boundaries and naming conventions |
| 23 | |
| 24 | ## Quick Start |
| 25 | |
| 26 | 1. Read the nearest `AGENTS.md` and confirm scope and constraints. |
| 27 | 2. Run this skill's `Workflow` through the `Ralph Loop` until outcomes are acceptable. |
| 28 | 3. Return the `Required Result Format` with concrete artifacts and verification evidence. |
| 29 | |
| 30 | ## Workflow |
| 31 | |
| 32 | 1. Load the architecture once per test assembly where possible. |
| 33 | 2. Encode a small number of durable, high-value architecture rules first. |
| 34 | 3. Use the test-framework-specific integration package that matches the repo. |
| 35 | |
| 36 | ## Bootstrap When Missing |
| 37 | |
| 38 | If `ArchUnitNET` is not configured yet: |
| 39 | |
| 40 | 1. Detect existing setup: |
| 41 | - `rg -n "TngTech\\.ArchUnitNET" -g '*.csproj' .` |
| 42 | 2. Add packages to the architecture test project: |
| 43 | - `dotnet add TEST_PROJECT.csproj package TngTech.ArchUnitNET` |
| 44 | - add one framework bridge package: `TngTech.ArchUnitNET.xUnit`, `TngTech.ArchUnitNET.xUnitV3`, `TngTech.ArchUnitNET.MSTestV2`, or `TngTech.ArchUnitNET.TUnit` |
| 45 | 3. Add at least one durable boundary rule test. |
| 46 | 4. Wire architecture tests into the standard `test` command in `AGENTS.md` and CI. |
| 47 | 5. Run `dotnet test TEST_PROJECT.csproj` and return `status: configured` or `status: improved`. |
| 48 | 6. If `NetArchTest` already covers the same boundary policy and no gap exists, return `status: not_applicable`. |
| 49 | |
| 50 | |
| 51 | ## Deliver |
| 52 | |
| 53 | - architecture tests with richer domain and type modeling |
| 54 | - architecture-rule commands wired into repo test flow and CI expectations |
| 55 | |
| 56 | ## Validate |
| 57 | |
| 58 | - architecture load cost is reasonable for the suite |
| 59 | - rules are stable and tied to real boundaries |
| 60 | |
| 61 | ## Ralph Loop |
| 62 | |
| 63 | Use the Ralph Loop for every task, including docs, architecture, testing, and tooling work. |
| 64 | |
| 65 | 1. Plan first (mandatory): |
| 66 | - analyze current state |
| 67 | - define target outcome, constraints, and risks |
| 68 | - write a detailed execution plan |
| 69 | - list final validation skills to run at the end, with order and reason |
| 70 | 2. Execute one planned step and produce a concrete delta. |
| 71 | 3. Review the result and capture findings with actionable next fixes. |
| 72 | 4. Apply fixes in small batches and rerun the relevant checks or review steps. |
| 73 | 5. Update the plan after each iteration. |
| 74 | 6. Repeat until outcomes are acceptable or only explicit exceptions remain. |
| 75 | 7. If a dependency is missing, bootstrap it or return `status: not_applicable` with explicit reason and fallback path. |
| 76 | |
| 77 | ### Required Result Format |
| 78 | |
| 79 | - `status`: `complete` | `clean` | `improved` | `configured` | `not_applicable` | `blocked` |
| 80 | - `plan`: concise plan and current iteration step |
| 81 | - `actions_taken`: concrete changes made |
| 82 | - `validation_skills`: final skills run, or skipped with reasons |
| 83 | - `verification`: commands, checks, or review evidence summary |
| 84 | - `remaining`: top unresolved items or `none` |
| 85 | |
| 86 | For setup-only requests with no execution, return `status: configured` and exact next commands. |
| 87 | |
| 88 | ## Load References |
| 89 | |
| 90 | - [references/archunitnet.md](references/archunitnet.md) |
| 91 | - [references/patterns.md](references/patterns.md) |
| 92 | - [references/examples.md](references/examples.md) |
| 93 | |
| 94 | ## Example Requests |
| 95 | |
| 96 | - "Use ArchUnitNET for layered architecture tests." |
| 97 | - "Set up ArchUnitNET with xUnit or MSTest." |