Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

ddd-validate — Claude Code skill: what it does, how to install

Checks bounded context integrity in TypeScript projects and flags domain boundary leaks. Useful for DDD architecture audits and pre-merge CI checks.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add ruvnet/ruflo --skill ddd-validate -a claude-code
Open on GitHub

What ddd-validate does

The skill checks architectural integrity across Domain-Driven Design codebases. It starts by scanning src/*/domain/ to discover all bounded contexts. Then it scans .ts files for leaks. Directly importing from another context's domain/entities/ is marked as a violation, while imports from a public index.ts remain permitted.

The check also inspects aggregate roots and storage layers. It flags mutable public properties, direct access to child entities, and domain event names that are not in the past tense. It also verifies that repository interfaces sit in domain/repositories/ while concrete implementations stay inside infrastructure/. Exactly one repository per aggregate root is allowed.

Results appear in a table with line numbers, violation categories, and remediation advice under BOUNDARY, INVARIANT, EVENT, and REPOSITORY. Summary data is then saved via npx @claude-flow/cli@latest memory store. If your repository does not keep domain modules under src/*/domain/, the context scanner will fail to discover your contexts.

What it helps with

  • Detect cross-boundary domain imports between bounded contexts
  • Spot bypasses of aggregate invariants and exposed child entities
  • Verify separation of repository interfaces and implementations
  • Validate past-tense naming conventions on domain events

Example prompts for the agent

  • Run ddd-validate to audit bounded context boundaries in src/
  • Check aggregate invariants and repository locations using ddd-validate
  • Use ddd-validate to find illegal cross-context imports before merging

How to install ddd-validate

1Skills CLI (Vercel)

npx skills add ruvnet/ruflo --skill ddd-validate -a claude-code

2Manually: put the files in place

~/.claude/skills/ddd-validate/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/ddd-validate/

From the same set104

The whole set →
ruflo ruvnet This skill adds multi-agent orchestration, memory, routing, and MCP tools to a project. Use it for swarm tasks and multi-step workflows. Claude Code CX Codex Cursor +1 4,000installs Swarm Orchestration ruvnet Skill for managing agent swarms with parallel execution, dynamic topology, and automatic load balancing. Use when a single agent is not enough and you need to orchestrate specialists of different types. Claude Code CX Codex Cursor +1 2,100installs github-project-management ruvnet Turns issue triage and board upkeep into gh and ruv-swarm calls: labels, subtasks, duplicate lookup. Useful when the tracker holds more tickets than order. Claude Code CX Codex Cursor +1 1,400installs github-workflow-automation ruvnet Automates GitHub Actions with AI agent coordination. Generates optimised pipelines, manages pull requests, analyzes failed runs, and deploys updates with risk assessment. Claude Code CX Codex Cursor +1 1,300installs github-code-review ruvnet Runs a swarm of specialized AI agents to inspect GitHub pull requests for security, performance, and architecture issues. Claude Code CX Codex Cursor +1 1,300installs stream-chain ruvnet Chains sequential agent steps together using streaming JSON flow and provides ready-to-run pipelines. Claude Code CX Codex Cursor +1 1,200installs flow-nexus-swarm ruvnet Deploy cloud-based AI agent swarms and define event-driven workflows with message queues. Use it to coordinate tasks, inspect runs, and scale a swarm. Claude Code CX Codex Cursor +1 1,200installs performance-analysis ruvnet Detects bottlenecks in Claude Flow swarms, profiles agent operations, and generates reports with actionable optimization recommendations. Claude Code CX Codex Cursor +1 1,200installs

Similar

mantis-summarize official google Builds a security-focused codebase map with mantis-summary.md files in each directory. Reduces token overhead during planning and research. Claude Code CX Codex Cursor +1 1,600installs trailmark trailofbits Builds and inspects multi-language code graphs to trace taint propagation, map attack surfaces, and prioritize security audits. Claude Code CX Codex Cursor +1 4,000installs verify Yeachan-Heo Turns "it should work" into evidence you can read: which check ran, what passed, and what stayed unverified. Claude Code CX Codex Cursor +1 642installs improve-codebase-architecture Matt Pocock This skill scans a codebase for architectural friction, then builds a visual HTML report with refactoring candidates. Use it before a deeper architecture review. Claude Code 1,163,035installs tdd Matt Pocock Guides the red-green TDD loop: ensures tests are written first, keep them at public interfaces, and avoid coupling to implementation details. Claude Code 1,141,062installs triage Matt Pocock This skill moves issues and external PRs through triage states, verification, and agent briefs. It fits maintainers managing an issue queue. Claude Code 990,453installs codebase-design Matt Pocock This skill helps design modules with small interfaces and hidden complexity. Use it when refactoring code, choosing a seam, or making tests easier to write. Claude Code 850,344installs code-review Matt Pocock Reviews changes from a chosen reference point against repository standards and the originating spec. Use it for a branch, PR, or work in progress. Claude Code 789,521installs

Questions about ddd-validate

How to install ddd-validate in Claude Code?

Run the command npx skills add ruvnet/ruflo --skill ddd-validate -a claude-code. You can also place the specification directly at ~/.claude/skills/ddd-validate/SKILL.md.

What does ddd-validate do?

The skill inspects TypeScript codebases for Domain-Driven Design violations, highlighting illegal cross-boundary imports, mutable aggregate properties, wrong event names, and misplaced repository classes.

What project layout does ddd-validate expect?

The skill looks for contexts located in src/*/domain/ containing TypeScript files. It allows importing from another context only via its application-layer index.ts, flagging direct imports into inner domain entity folders.

Source text

SKILL.md · MIT
---
name: ddd-validate
description: Validate domain boundaries -- detect cross-context import violations and aggregate invariant issues. Use when auditing a DDD codebase for leaks between bounded contexts, before merging cross-cutting changes, or as a CI gate to catch boundary erosion early.
argument-hint: ""
allowed-tools: Bash Read Grep Glob mcp__plugin_ruflo-core_ruflo__memory_store mcp__plugin_ruflo-core_ruflo__memory_search mcp__plugin_ruflo-core_ruflo__hooks_pre-task mcp__plugin_ruflo-core_ruflo__hooks_post-task
---
Validate domain boundary integrity across all bounded contexts.

## Steps

1. **Discover contexts**: Scan `src/*/domain/` to find all bounded contexts.

2. **Check cross-boundary violations**:
   - For each context, scan all `.ts` files for import statements
   - Flag any import that reaches into another context's `domain/` directory directly
   - Allowed: importing from another context's public `index.ts` (application layer)
   - Violation: importing from `src/<other-context>/domain/entities/...` directly

   ```bash
   # Find cross-boundary imports
   for ctx in $(find src -maxdepth 2 -name "domain" -type d | sed 's|src/||;s|/domain||'); do
     grep -rn "from ['\"].*src/" "src/$ctx/" --include="*.ts" | grep -v "src/$ctx/" || true
   done
   ```

3. **Check aggregate invariant enforcement**:
   - Scan aggregate root entities for public setters that bypass validation
   - Flag mutable public properties without invariant checks
   - Verify that child entities are not directly accessible (must go through aggregate root)

4. **Check event naming conventions**:
   - Domain events should be past-tense named (e.g., `OrderCreated`, not `CreateOrder`)
   - Events should be immutable (no public setters)
   - Events should carry the aggregate ID

5. **Check repository patterns**:
   - Repository interfaces should exist in `domain/repositories/`, not `infrastructure/`
   - Repository implementations should exist in `infrastructure/`, not `domain/`
   - Each aggregate root should have exactly one repository

6. **Report findings**:
   - Output a table of violations with file path, line number, violation type, and suggestion
   - Categorize as: `BOUNDARY`, `INVARIANT`, `EVENT`, `REPOSITORY`
   - Exit with summary: total violations, by category, severity

7. **Store results**:
   ```bash
   npx @claude-flow/cli@latest memory store --key "ddd-validation-TIMESTAMP" --value "RESULTS_SUMMARY" --namespace tasks
   npx @claude-flow/cli@latest hooks post-task --task-id "ddd-validate" --success true --store-results true
   ```

© ruvnet · MIT · ruvnet/ruflo

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor