ddd-layer-rules

Validate code placement and dependency directions across Domain, Use Case, Infrastructure, Entrypoint, and Shared layers.

Updated May 6, 2026
One-click install
npx skills add https://github.com/lucidfrontier45/my-opencode-settings --skill ddd-layer-rules
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ddd-layer-rules
Source: https://github.com/lucidfrontier45/my-opencode-settings/tree/main/skills/ddd-layer-rules
Command: npx skills add https://github.com/lucidfrontier45/my-opencode-settings --skill ddd-layer-rules

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill solves the problem of architectural drift and tangled dependencies in complex projects by providing a clear, enforceable set of rules for organizing code into Domain, Use Case, Infrastructure, Entrypoint, and Shared layers.

Core Features & Use Cases

  • Dependency Enforcement: Provides a clear mental model and checklist to ensure layers only depend on each other in the correct, acyclic direction.
  • Layer Classification: Helps developers determine exactly where to place new code, whether it is a business entity, a database implementation, or an API handler.
  • Use Case: Use this skill when you are unsure where to place a new service or repository, or when you need to refactor a monolithic file structure into a clean, testable layered architecture.

Quick Start

Apply the ddd-layer-rules skill to analyze the current project structure and identify any violations of the layered architecture dependency rules.

Frequently Asked Questions about ddd-layer-rules

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

FAQPage Schema
How do I enforce Domain-Driven Design layer dependencies in my project?

To enforce Domain-Driven Design layer dependencies, validate code placement across Domain, Use Case, Infrastructure, Entrypoint, and Shared layers to ensure acyclic dependency directions and strict separation of business logic from technical implementation.

How do I know where to place a new service or repository in a layered architecture?

You can determine where to place a new service or repository by classifying code based on its function, routing business entities to the Domain layer and database implementations to the Infrastructure layer for maintainable software design.

What is the best way to refactor a monolithic file structure into a clean layered architecture?

The best way to refactor a monolithic file structure is applying DDD layered architecture rules to validate code placement, enforce dependency inversion, and achieve a modular composition root pattern.

Can I use DDD layer rules for any software project requiring dependency injection?

Yes, you can use DDD layer rules for any software project requiring strict separation of business logic and dependency injection, ensuring testable and modular software design through the composition root pattern.

Why does architectural drift happen in complex projects and how do layered rules help?

Architectural drift happens in complex projects due to tangled dependencies, which DDD layered rules solve by providing a clear, enforceable checklist to ensure layers only depend on each other in the correct direction.