What problem does it solve? Deciding where to place repository interfaces in a DDD or clean architecture codebase is a recurring design debate, and placing them in the domain layer often leads to unwanted coupling between domain models and persistence concerns. This Skill explains why repository interfaces belong in the use case layer and how structure enforces that design intent. ## Core Features & Use Cases - Placement Rationale: Explains why repository interfaces should live in the use case layer (as output ports) rather than the domain layer, preventing domain models from depending on persistence. - Detection Patterns: Shows directory-structure symptoms of misplaced repositories, such as OrderRepository.java sitting in the domain or interface-adapter layers, and the correct layout. - Review Checklist: Provides concrete checks for placement, domain-to-repository imports, and aggregate ID-based referencing. - Use Case: While reviewing a Java clean architecture project, you notice domain services accumulating injected repositories. Use this Skill to justify moving the interfaces to the use case layer and to enforce aggregate ID references. ## Quick Start Ask the AI where repository interfaces should be placed in a clean architecture project and have it review your package structure for misplaced repositories.