home / skills / d-oit / do-novelist-ai / architecture-guardian
This skill helps enforce clean architecture principles, layering rules, and boundary management to improve module decoupling and interface design.
npx playbooks add skill d-oit/do-novelist-ai --skill architecture-guardianReview the files below or copy the command above to add this skill to your agents.
---
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
- **[Core Guidance](core-guidance.md)** - Detailed methodology and
implementation
- **[Layering Rules](layering-rules.md)** - Layer separation principles
- **[Dependency Flow](dependency-flow.md)** - Allowed and prohibited
dependencies
- **[Interface Design](interface-design.md)** - API and interface design
- **[Module Boundaries](module-boundaries.md)** - Module coupling and cohesion
## 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:
- **[Core Guidance](core-guidance.md)** - Implementation details and patterns
- **[Layering Rules](layering-rules.md)** - Layer separation
- **[Dependency Flow](dependency-flow.md)** - Dependency management
- **[Interface Design](interface-design.md)** - API design patterns
- **[Module Boundaries](module-boundaries.md)** - Coupling and cohesion
This skill enforces clean architecture principles for TypeScript projects, focusing on proper layering, module boundaries, and interface design. It helps teams design new features, guide refactors, and validate architecture during reviews to keep dependencies and responsibilities clear.
The skill inspects project structure, TypeScript types, import graphs, and module APIs to detect layering violations, circular dependencies, and boundary leaks. It reports allowed and prohibited dependency flows, highlights oversized or mixed-responsibility interfaces, and suggests inversion or segregation where needed. Outputs include concrete remediation steps and examples for applying dependency inversion and clearer module contracts.
Can this skill enforce rules automatically?
It identifies violations and produces concrete fixes, but applying code changes typically stays with developers or CI tooling that integrates suggested changes.
Does it integrate with TypeScript tooling?
Yes. It analyzes TypeScript ASTs, import graphs, and type information to provide accurate guidance aligned with your tsconfig and module resolution.