ddd-validator

Validate DDD layer separation, dependency rules, and domain patterns in codebases.

5|1|Updated Oct 29, 2025
One-click install
npx skills add https://github.com/moasadi/ddd-bun-api-boilerplate --skill ddd-validator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ddd-validator
Source: https://github.com/moasadi/ddd-bun-api-boilerplate/tree/main/.claude/skills/ddd-validator
Command: npx skills add https://github.com/moasadi/ddd-bun-api-boilerplate --skill ddd-validator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps ensure Domain-Driven Design (DDD) principles are respected, including layer separation, dependency rules, and domain patterns, through non-destructive analysis and actionable recommendations.

Core Features & Use Cases

  • Dependency Rule Validation: Checks layer isolation and dependencies
  • Domain Layer Purity: Ensures zero framework dependencies
  • Pattern Compliance: Validates entities, value objects, repositories
  • Decorator Validation: Checks @injectable() usage
  • Import Analysis: Detects unauthorized dependencies
  • Non-destructive Analysis: Safe, non-invasive checks that don't alter code
  • Examples: Validate the User context for DDD compliance

Quick Start

  • Run the DDD validator against your codebase to identify layer violations and opportunities for improvement
  • Example: "Validate the User context for DDD compliance"

Frequently Asked Questions about ddd-validator

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

FAQPage Schema
How do I validate Domain-Driven Design layer separation in my codebase?

Layer separation validation checks that your Presentation, Application, Domain, and Infrastructure layers follow DDD rules—ensuring the Domain layer has zero external dependencies, Application layer uses @injectable() decorators correctly, and repositories use token-based injection. Run the validator against your codebase to identify violations and get actionable recommendations.

What DDD patterns does this validator check for?

The validator enforces domain pattern compliance including private constructors, create/reconstitute factory methods, and getter-only property access on entities and value objects. It also validates that @injectable() is used properly in the Application layer and that repositories are injected via tokens, not direct instantiation.

Can I use this validator in pre-commit checks and code reviews?

Yes. The validator performs non-destructive, non-invasive analysis that identifies DDD architecture violations without altering code. It reports critical issues, warnings, and suggestions, making it suitable for automated pre-commit hooks and integration into code review workflows.

What happens if my Domain layer imports framework dependencies?

The validator flags this as a violation. DDD requires the Domain layer to remain free of framework dependencies to ensure business logic stays decoupled and portable. The validator identifies these unauthorized imports and reports them as critical issues.

Does this work with existing codebases or only new projects?

This validator works with existing codebases implementing Domain-Driven Design across multiple layers. It analyzes your current architecture without modifying code, identifies where patterns diverge from DDD principles, and enables refactoring validation to progressively improve compliance.