architecture-testing
Skill4 starsChanged 10 months agoMITView on GitHub
Use when user mentions architectural boundaries, layering, dependency rules, project structure constraints, or asks to define/review/enforce architecture. For new apps, check if production quality/best practices/specific pattern requested.
In this repository67 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agents-onboardingSkill
- agent-workitem-automationSkill
- aspire-integration-testingSkill
- automated-standards-enforcementSkill
- best-practice-introductionSkill
- branching-strategy-and-conventionsSkill
- broken-windowSkill
- change-risk-rollbackSkill
- ci-cd-conformanceSkill
- component-boundary-ownershipSkill
- contract-consistency-validationSkill
- csharp-best-practicesSkill
- deployment-provenanceSkill
- documentation-as-codeSkill
- documentation-scaffoldSkill
- dotnet-bespoke-code-minimisationSkill
- dotnet-best-practicesSkill
- dotnet-domain-primitivesSkill
- dotnet-efcore-practicesSkill
- dotnet-healthchecksSkill
- dotnet-logging-serilogSkill
- dotnet-mapping-standardSkill
- dotnet-open-source-first-governanceSkill
- dotnet-source-generation-firstSkill
- dotnet-specification-patternSkill
- dotnet-testing-assertionsSkill
- environment-traceabilitySkill
- finishing-a-development-branch-iddSkill
- greenfield-baselineSkill
- impacted-scope-enforcementSkill
- incremental-change-impactSkill
- incremental-deploymentSkill
- innersource-governance-bootstrapSkill
- issue-driven-deliverySkill
- library-extraction-stabilisationSkill
- local-dev-experienceSkill
- markdown-authorSkill
- modern-csharp-coding-standardsSkill
- monorepo-orchestration-setupSkill
- observability-logging-baselineSkill
- pair-programmingSkill
- persona-switchingSkill
- process-skill-routerSkill
- quality-gate-enforcementSkill
- release-tagging-planSkill
- repo-best-practices-bootstrapSkill
- repository-foundation-bootstrapSkill
- requirements-gatheringSkill
- runtime-tooling-validationSkill
- safe-brownfield-refactorSkill
- scoped-colocationSkill
- security-processesSkill
- selective-build-testSkill
- semantic-version-impactSkill
- session-awareSkill
- skills-first-workflowSkill
- static-analysis-securitySkill
- structured-review-workflowSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 9 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 25
Before creating architecture tests, check for existing patterns:
- Distinctive: line 38
When existing architecture tests are detected:
- Distinctive: line 41
Existing architecture doc: Update existing doc, do not create duplicate.
- Distinctive: line 42
Partial coverage: Add tests for uncovered boundaries only.
- Distinctive: line 44
Only create new architecture test project when detection finds nothing.
- Very specific: line 50
Architecture ADR: Create docs/decisions/NNNN-architecture-pattern.md
- Very specific: line 51
Architecture Overview: Update docs/architecture-overview.md
- Distinctive: line 52
Test Project README: Document which boundaries are tested
- Very specific: line 91
Document: Update docs/architecture-overview.md (human-readable)
- Distinctive: line 98
Use pre-built templates to accelerate architecture test setup:
- Distinctive: line 109
Add NetArchTest NuGet package
- Distinctive: line 111
Run tests to verify boundaries
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Architecture Testing
Overview
Enforce architectural boundaries with automated tests. Prevents coupling that causes maintenance debt.
REQUIRED: superpowers:test-driven-development, superpowers:verification-before-completion
When to Use
- User mentions architecture, boundaries, layers, dependency rules
- Creating production-quality application
- Opt-out offered: New apps without production/best-practice/pattern request
Detection and Deference
Before creating architecture tests, check for existing patterns:
Existing Tests Detection
| Pattern | Detection Command | If Found |
| .NET ArchTests | find . -name "*.ArchitectureTests.csproj" | Enhance existing |
| NetArchTest refs | grep -r "NetArchTest" *.csproj | Use existing project |
| ArchUnit (Java) | grep -r "archunit" pom.xml build.gradle | Use existing tests |
| docs/architecture | test -f docs/architecture-overview.md | Reference existing |
Deference Rules
When existing architecture tests are detected:
- Existing test project: Enhance with additional rules, do not create new project.
- Existing architecture doc: Update existing doc, do not create duplicate.
- Partial coverage: Add tests for uncovered boundaries only.
Only create new architecture test project when detection finds nothing.
Decision Capture
Architecture decisions must be captured in the target repository:
- Architecture ADR: Create
docs/decisions/NNNN-architecture-pattern.md - Architecture Overview: Update
docs/architecture-overview.md - Test Project README: Document which boundaries are tested
Architecture ADR Template
# ADR-NNNN: Architecture Pattern Selection
## Status
Accepted
## Context
Project needs defined architectural boundaries.
## Decision
Use [Clean Architecture / Hexagonal / Layered] pattern.
## Rationale
- [Why this pattern fits the project]
- [Trade-offs considered]
## Consequences
- Architecture tests enforce: [list of rules]
- Violations fail the buildThis ensures future developers understand the architectural constraints.
Core Workflow
- Opt-out check: New app without production quality request? Offer opt-out explicitly
- Pattern selection: Clean, Hexagonal, Onion, Layered, or Modular Monolith
- Define boundaries: Minimum 3 layers with explicit dependency rules
- Add enforcement: NetArchTest (.NET), ArchUnit (Java), or custom
- CI integration: Tests in pipeline, fail build on violations
- Document: Update
docs/architecture-overview.md(human-readable) - Brownfield: Permissive initial tests, tighten incrementally
See Pattern Details and NetArchTest Examples.
Reference Templates
Use pre-built templates to accelerate architecture test setup:
| Pattern | Template | Use Case |
| Clean Architecture | templates/clean-architecture-tests.cs.template | Domain-centric apps |
| Layered Architecture | templates/layered-architecture-tests.cs.template | Traditional N-tier |
Using Templates
- Copy template to
tests/{Project}.ArchitectureTests/ - Replace
{NAMESPACE}with your root namespace - Add NetArchTest NuGet package
- Adjust layer names to match your project structure
- Run tests to verify boundaries
Rationalizations Table
| Excuse | Reality |
| "Can add architecture later" | Later never happens. 10 min now saves hours later. |
| "Speed over architecture" | Architecture prevents defects. Defects cost more time. |
| "Demo doesn't need it" | Demos become production. Start right or rewrite. |
| "Too disruptive to existing code" | Use brownfield approach: permissive tests, tighten gradually. |
| "Tech lead said skip it" | Clarify cost with tech lead. They may not realize impact. |
| "Working code ships" | Shipping debt accumulates interest. Pay now or pay more later. |
Red Flags - STOP
- "Can add architecture later"
- "Too simple for boundaries"
- "Would block the deploy" (without proposing brownfield)
- "Tech lead said skip it" (without clarifying cost)
All mean: Apply brownfield approach or document explicit opt-out in docs/exclusions.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

