archunit-rules

Enforce Java architectural constraints with ArchUnit rule sets.

50|7|Updated Apr 18, 2026
One-click install
npx skills add https://github.com/loiane/specs-driven-development-spring-angular --skill archunit-rules
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: archunit-rules
Source: https://github.com/loiane/specs-driven-development-spring-angular/tree/main/.windsurf/skills/archunit-rules
Command: npx skills add https://github.com/loiane/specs-driven-development-spring-angular --skill archunit-rules

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Encode and enforce architectural constraints in Java projects by codifying ArchUnit rules to guard layer boundaries, module dependencies, and access rules.

Core Features & Use Cases

  • Default rule set: Provides reusable ArchUnit tests to ensure features respect published APIs and private internals.
  • Brownfield support: Captures existing violations and freezes them to prevent regressions while new code adheres to rules.
  • Governance during review and test phases: Integrates with the test suite to gate changes against the architectural contract.

Quick Start

Create ArchUnit tests under src/test/java that define and validate your project's architectural constraints.

Frequently Asked Questions about archunit-rules

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce architecture boundaries and prevent cross-layer dependencies in a Java project?

You can enforce architecture boundaries by codifying ArchUnit rules as tests under src/test/java to validate that features respect published APIs, private internals, and prevent improper cross-layer dependencies during the test phase.

Can I enforce architectural constraints in an existing brownfield Java codebase without breaking current functionality?

Yes, for brownfield codebases this approach captures existing architectural violations and freezes them to prevent regressions, allowing new code to adhere to the rules while legacy issues are addressed incrementally.

What is the best way to prevent cyclic dependencies and unauthorized module access during architecture review?

The best way to prevent cycles and internal access is applying a default ArchUnit rule set that validates feature boundaries and cross-layer dependencies, integrating governance directly into your review and test phases.

How do I set up tests to gate code changes against a project's architectural contract?

To gate changes against the architectural contract, create ArchUnit tests in src/test/java that define and validate your structural constraints, ensuring the test suite fails when new code violates layer or module boundaries.

Does enforcing dependency management rules with ArchUnit work for both greenfield and brownfield projects?

Yes, enforcing dependency management rules with ArchUnit works for both greenfield and brownfield projects, providing a default rule set for new boundaries while freezing existing violations to prevent regression in legacy code.