ddd-context

Creates a DDD bounded context directory structure with domain, application, and infrastructure layers.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Setting up a new bounded context in a domain-driven design codebase requires manually creating many directories and barrel export files, which is repetitive and error-prone. This Skill scaffolds the entire standard structure in one step and records the new context in the domain model graph.

Core Features & Use Cases

  • Bounded Context Scaffolding: Creates the full src/<context-name>/ layout with domain (entities, value-objects, events, services, repositories), application, and infrastructure layers.
  • Barrel Export Generation: Writes index.ts files for every submodule, including a public API index that re-exports domain and application but not infrastructure.
  • Domain Model Tracking: Stores the new context in the hierarchical agentdb graph and memory store so other tools can query the domain structure.
  • Use Case: When splitting a monolith into bounded contexts, run the skill with a kebab-case name like billing to instantly generate the module skeleton and register it in the domain model.

Quick Start

Ask the assistant to create a new DDD bounded context named billing using the ddd-context skill.

Frequently Asked Questions about ddd-context

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

FAQPage Schema
How do I create a DDD bounded context directory structure?

Invoke the skill with a kebab-case context name as the argument. It creates src/<context-name>/ with domain, application, and infrastructure subdirectories plus barrel export index.ts files for each module.

What directory structure does a DDD bounded context use?

The generated structure separates domain (entities, value-objects, events, services, repositories), application, and infrastructure layers. The public index.ts re-exports domain and application only, keeping infrastructure internal.

What happens if I run the skill without a context name?

If the argument is empty, the skill lists existing contexts instead of creating a new one. It also validates that the name is kebab-case and does not already exist under src/ before creating anything.

Does the skill track created contexts anywhere?

Yes. It stores a parent-child relation in the agentdb hierarchical store linking the domain to the new context, and writes a memory entry under the tasks namespace recording the creation.

When should I not use bounded context scaffolding?

Avoid it for small scripts or single-module projects where layered DDD structure adds overhead without benefit. It is designed for codebases intentionally organized around domain-driven design boundaries.