Arch Governance
Testing & Qualityarch-governanceArch Governance is an Agent Skill for testing & quality published in the majiayu000/claude-skill-registry repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Use ArchUnit for checking the architecture of your Java code.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/majiayu000/claude-skill-registry/blob/HEAD/skills/development/arch-governance/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/arch-governance, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Introduction
ArchUnit is a free, simple and extensible library for checking the architecture of your Java code. That is, ArchUnit can check dependencies between packages and classes, layers and slices, check for cyclic dependencies and more. It does so by analyzing given Java bytecode, importing all classes into a Java code structure. ArchUnit’s main focus is to automatically test architecture and coding rules, using any plain Java unit testing framework.
When to Use This Skill
- Use ArchUnit when you want to ensure that your Java code adheres to a specific architecture and coding rules. It is particularly useful for large projects with complex dependencies and for enforcing architectural principles across the codebase.
- When you need to verify that your codebase follows certain architectural guidelines, such as separation of concerns, clean architecture, or domain-driven design principles.
- When you require automated testing of architecture and coding rules to maintain code quality and consistency.
- When you are creating a whole new project or refactoring an existing codebase to enforce architectural principles.
Installation
Working with JUnit 4
<dependency>
<groupId>com.tngtech.archunit</groupId>
<artifactId>archunit-junit4</artifactId>
<version>1.4.1</version>
<scope>test</scope>
</dependency>
Working with JUnit 5
<dependency>
<groupId>com.tngtech.archunit</groupId>
<artifactId>archunit-junit5</artifactId>
<version>1.4.1</version>
<scope>test</scope>
</dependency>
Working with Other Test Frameworks
<dependency>
<groupId>com.tngtech.archunit</groupId>
<artifactId>archunit</artifactId>
<version>1.4.1</version>
<scope>test</scope>
</dependency>
Maven Plugin
There exists a Maven plugin to run ArchUnit rules straight from Maven. For more information see references/arch-unit-maven-plugin.md
Resources
Do not expand the references directory all at once, but rather expand it layer by layer, as needed.