ddd-validate

Detect cross-context import violations and aggregate invariant issues in DDD codebases.

70.1k|8.4k|Updated Jun 2, 2025
One-click install
npx skills add https://github.com/ruvnet/claude-flow --skill ddd-validate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ddd-validate
Source: https://github.com/ruvnet/claude-flow/tree/main/plugins/ruflo-ddd/skills/ddd-validate
Command: npx skills add https://github.com/ruvnet/claude-flow --skill ddd-validate

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Domain-driven design codebases gradually erode as developers accidentally import across bounded contexts or bypass aggregate invariants, and these boundary leaks are hard to spot in manual code review.

Core Features & Use Cases

  • Boundary Violation Detection: Scans TypeScript files to flag imports that reach directly into another bounded context's domain layer instead of its public application interface.
  • Invariant and Event Auditing: Checks aggregate roots for public setters that bypass validation, verifies domain events are past-tense named and immutable, and confirms repository interfaces live in the domain layer.
  • Use Case: Before merging a cross-cutting pull request, run the validation to produce a categorized report of BOUNDARY, INVARIANT, EVENT, and REPOSITORY violations with file paths, line numbers, and suggested fixes, then store the summary as a CI gate record.

Quick Start

Audit my DDD codebase for cross-context import violations and aggregate invariant issues, then report all boundary violations by category.

Frequently Asked Questions about ddd-validate

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

FAQPage Schema
How do I detect bounded context violations in a DDD codebase?

Scan each bounded context's TypeScript files for import statements that reach into another context's domain directory directly. Imports through another context's public application-layer index are allowed, while direct domain entity imports are flagged as violations.

How to check aggregate invariant enforcement in TypeScript?

Inspect aggregate root entities for public setters or mutable public properties that bypass validation logic. Child entities should only be accessible through the aggregate root, never directly from outside the aggregate boundary.

What naming convention should domain events follow?

Domain events should use past-tense names like OrderCreated rather than imperative names like CreateOrder. They should also be immutable with no public setters and carry the originating aggregate's identifier.

Where should repository interfaces live in DDD architecture?

Repository interfaces belong in the domain layer under domain/repositories, while their concrete implementations belong in the infrastructure layer. Each aggregate root should have exactly one repository.

Can DDD validation run as a CI gate?

Yes, the validation produces a categorized violation summary covering BOUNDARY, INVARIANT, EVENT, and REPOSITORY issues, which can be stored and used to fail builds when boundary erosion is detected before merging.