arch-guard

Validate code placement against Clean Architecture, DDD, and CQRS dependency rules.

2|Updated Dec 24, 2025
One-click install
npx skills add https://github.com/knowlet/skills --skill arch-guard
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: arch-guard
Source: https://github.com/knowlet/skills/tree/main/skills/arch-guard
Command: npx skills add https://github.com/knowlet/skills --skill arch-guard

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enforces architectural boundaries to prevent drift from Clean Architecture, DDD, and CQRS, providing checks and guidelines for dependencies and module placement.

Core Features & Use Cases

  • Dependency rules: enforce inward-only dependencies.
  • Layer separation: ensure Proper boundaries among presentation, application, domain, and infrastructure.
  • Conformance checks: static analysis style checks and review prompts.

Quick Start

Run an architecture review whenever introducing new modules; apply the arch-guard checks to ensure no leakage from domain to infrastructure.

Frequently Asked Questions about arch-guard

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

FAQPage Schema
How do I enforce Clean Architecture and DDD principles in my codebase?

Enforce Clean Architecture and DDD by validating layer boundaries and dependency direction rules. arch-guard checks that dependencies flow inward only—presentation to application to domain—and prevents domain code from referencing infrastructure, presentation, or application layers, catching architecture violations during refactors and new module creation.

What's the best way to prevent architecture drift in large codebases?

Prevent architecture drift by running static analysis checks on code changes and new modules to ensure they comply with Clean Architecture and CQRS patterns. arch-guard applies conformance checks during refactors, module additions, and dependency changes to maintain consistent layer separation over time.

How do I validate that my domain layer has no infrastructure dependencies?

Validate domain layer isolation using architecture conformance checks that enforce inward-only dependencies and flag any domain references to infrastructure, presentation, or application code. This ensures domain logic remains independent and testable, a core DDD principle.

Can I use architecture validation during code reviews?

Yes. arch-guard provides review prompts and static analysis checks that apply during code refactors and new module creation, enabling you to catch dependency violations and layer boundary breaches before merging, integrating into your review workflow.

What happens when I add a new module—how do I ensure it follows the architecture?

When adding new modules or classes, run arch-guard checks to validate correct placement within presentation, application, domain, or infrastructure layers and verify dependencies follow the inward-only rule, preventing immediate architecture violations.