agentleFS
martincjarvismartincjarvis/development-skills/skills/architecture-testing/SKILL.md

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.

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
  1. Distinctive:

    Before creating architecture tests, check for existing patterns:

    line 25
  2. Distinctive:

    When existing architecture tests are detected:

    line 38
  3. Distinctive:

    Existing architecture doc: Update existing doc, do not create duplicate.

    line 41
  4. Distinctive:

    Partial coverage: Add tests for uncovered boundaries only.

    line 42
  5. Distinctive:

    Only create new architecture test project when detection finds nothing.

    line 44
  6. Very specific:

    Architecture ADR: Create docs/decisions/NNNN-architecture-pattern.md

    line 50
  7. Very specific:

    Architecture Overview: Update docs/architecture-overview.md

    line 51
  8. Distinctive:

    Test Project README: Document which boundaries are tested

    line 52
  9. Very specific:

    Document: Update docs/architecture-overview.md (human-readable)

    line 91
  10. Distinctive:

    Use pre-built templates to accelerate architecture test setup:

    line 98
  11. Distinctive:

    Add NetArchTest NuGet package

    line 109
  12. Distinctive:

    Run tests to verify boundaries

    line 111

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

PatternDetection CommandIf Found
.NET ArchTestsfind . -name "*.ArchitectureTests.csproj"Enhance existing
NetArchTest refsgrep -r "NetArchTest" *.csprojUse existing project
ArchUnit (Java)grep -r "archunit" pom.xml build.gradleUse existing tests
docs/architecturetest -f docs/architecture-overview.mdReference existing

Deference Rules

When existing architecture tests are detected:

  1. Existing test project: Enhance with additional rules, do not create new project.
  2. Existing architecture doc: Update existing doc, do not create duplicate.
  3. 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:

  1. Architecture ADR: Create docs/decisions/NNNN-architecture-pattern.md
  2. Architecture Overview: Update docs/architecture-overview.md
  3. 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 build

This ensures future developers understand the architectural constraints.

Core Workflow

  1. Opt-out check: New app without production quality request? Offer opt-out explicitly
  2. Pattern selection: Clean, Hexagonal, Onion, Layered, or Modular Monolith
  3. Define boundaries: Minimum 3 layers with explicit dependency rules
  4. Add enforcement: NetArchTest (.NET), ArchUnit (Java), or custom
  5. CI integration: Tests in pipeline, fail build on violations
  6. Document: Update docs/architecture-overview.md (human-readable)
  7. Brownfield: Permissive initial tests, tighten incrementally

See Pattern Details and NetArchTest Examples.

Reference Templates

Use pre-built templates to accelerate architecture test setup:

PatternTemplateUse Case
Clean Architecturetemplates/clean-architecture-tests.cs.templateDomain-centric apps
Layered Architecturetemplates/layered-architecture-tests.cs.templateTraditional N-tier

Using Templates

  1. Copy template to tests/{Project}.ArchitectureTests/
  2. Replace {NAMESPACE} with your root namespace
  3. Add NetArchTest NuGet package
  4. Adjust layer names to match your project structure
  5. Run tests to verify boundaries

Rationalizations Table

ExcuseReality
"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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.