architecture-guardian

d-oit 的头像作者 d-oit

Enforce clean architecture principles, proper layering rules, dependency flow, module boundaries, and interface design. Use when designing new features, refactoring code, or reviewing architecture.

📖 中文导读:Enforce clean architecture principles, proper layering rules, dependency flow, module boundaries, and interface design. Use when designing new features, refactoring code, or reviewing architecture. 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。

name: architecture-guardian description: Enforce clean architecture principles, proper layering rules, dependency flow, module boundaries, and interface design. Use when designing new features, refactoring code, or reviewing architecture.

Architecture Guardian

Enforce clean architecture principles, proper layer separation, and well-defined boundaries between architectural layers.

Quick Reference

When to Use

  • Designing new feature modules
  • Refactoring existing architecture
  • Creating new interfaces between layers
  • Reviewing code for architectural compliance
  • Setting up dependency injection
  • Decoupling modules

Core Methodology

Enforce clean architecture through systematic layering, dependency flow control, and boundary management.

Key Principles:

  1. Layer separation (Presentation, Application, Domain, Infrastructure)
  2. Upward dependency flow (depends on abstractions, not implementations)
  3. Clear module boundaries (bounded contexts)
  4. Interface-based design (depend on contracts, not concretions)
  5. SOLID principles adherence

Quality Gates:

  • No circular dependencies
  • No layering violations
  • Clear public APIs
  • Proper dependency directions
  • Single responsibility per module

Integration

  • domain-expert: Ensures proper domain modeling
  • typescript-guardian: Type safety in interfaces
  • feature-module-architect: Structures features correctly
  • tech-stack-specialist: Framework and tool configuration

Best Practices

✓ Keep layers strictly separated ✓ Depend on abstractions, not concretions ✓ Define clear public APIs ✓ Use repository interfaces in domain layer ✓ Implement dependency inversion ✓ Enforce bounded contexts ✓ Design interfaces with segregation principle ✗ Mix responsibilities across layers ✗ Leak infrastructure into domain ✗ Create tight coupling between features ✗ Allow circular dependencies ✗ Make interfaces too large (segregate) ✗ Skip dependency flow validation


Content Modules

See detailed modules: