Create a DDD Bounded Context

VerifiedSafe

Scaffolds a standard DDD bounded context directory structure, including domain, application, and infrastructure layers, and generates barrel index files.

Sby Skills Guide Bot
DevelopmentBeginner
8/29/2026
Claude Code
#ddd#bounded-context#scaffolding#architecture#typescript

Recommended for

Automated summary

Scaffolds the standard DDD bounded-context directory layout (domain, application, infrastructure) with TypeScript barrel files and records the context in the domain model graph.

Strengths

  • Enforces a consistent, predictable DDD layout for every new context
  • Validates the name as kebab-case and checks that it does not already exist under src/
  • Creates every index.ts barrel, including a public API that deliberately excludes infrastructure
  • Registers the new context in ruflo's memory so the domain model stays tracked

Limitations

  • Only produces empty directories and barrels — no actual entities, value objects, or events
  • Assumes a TypeScript project with a src/ directory at the repository root
  • Relies on ruflo MCP tools (agentdb_hierarchical-store, memory_store) for the registration step
When to use it

Use it when starting a new subdomain or splitting a monolith into bounded contexts.

When not to use it

Skip it on non-TypeScript projects or when you do not want the imposed domain/application/infrastructure convention.

Security analysis

Safe
Quality score85/100

The skill only scaffolds a directory structure and creates barrel export files for a DDD bounded context. It uses file-system tools and MCP memory storage for legitimate organization, with no destructive commands, network exfiltration, obfuscation, or credential handling.

No concerns found

How this analysis is made

Examples

New billing context
/ddd-context billing
Split monolith module
Create a bounded context called inventory-management for our new subdomain
List contexts
/ddd-context

name: ddd-context description: Create and manage a DDD bounded context with standard directory structure. Use when starting a new subdomain, splitting a monolith into bounded contexts, or scaffolding the domain/application/infrastructure layout for a fresh module. argument-hint: "<context-name>" allowed-tools: Bash Read Write Edit Grep Glob mcp__plugin_ruflo-core_ruflo__memory_store mcp__plugin_ruflo-core_ruflo__memory_search mcp__plugin_ruflo-core_ruflo__agentdb_hierarchical-store

Create a bounded context directory structure for the given context name.

Parse $ARGUMENTS as the context name (kebab-case). If empty, list existing contexts.

Steps

  1. Validate name: Ensure the context name is kebab-case and does not already exist under src/.

  2. Create directory structure:

    src/<context-name>/
      domain/
        entities/
        value-objects/
        events/
        services/
        repositories/
      application/
      infrastructure/
    
  3. Generate index files:

    • src/<context-name>/domain/entities/index.ts -- barrel export for entities
    • src/<context-name>/domain/value-objects/index.ts -- barrel export for value objects
    • src/<context-name>/domain/events/index.ts -- barrel export for domain events
    • src/<context-name>/domain/services/index.ts -- barrel export for domain services
    • src/<context-name>/domain/repositories/index.ts -- barrel export for repository interfaces
    • src/<context-name>/domain/index.ts -- re-export all domain submodules
    • src/<context-name>/application/index.ts -- barrel export for application services
    • src/<context-name>/infrastructure/index.ts -- barrel export for infrastructure implementations
    • src/<context-name>/index.ts -- public API of the bounded context (re-exports domain and application only, NOT infrastructure)
  4. Store in domain model graph:

    mcp__plugin_ruflo-core_ruflo__agentdb_hierarchical-store --parent "domain" --child "context:<context-name>" --relation "contains"
    mcp__plugin_ruflo-core_ruflo__memory_store --key "ddd-context-<context-name>" --value "Created bounded context" --namespace tasks
    
  5. Report: Confirm the context was created and list the generated files.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/create-a-ddd-bounded-context-mte1lhi4/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/create-a-ddd-bounded-context-mte1lhi4' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/create-a-ddd-bounded-context-mte1lhi4/download' --output '.skill-downloads/create-a-ddd-bounded-context-mte1lhi4/SKILL.md.part' && mv '.skill-downloads/create-a-ddd-bounded-context-mte1lhi4/SKILL.md.part' '.skill-downloads/create-a-ddd-bounded-context-mte1lhi4/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Tools declared by the author (check availability in your agent): Bash Read Write Edit Grep Glob mcp__plugin_ruflo-core_ruflo__memory_store mcp__plugin_ruflo-core_ruflo__memory_search mcp__plugin_ruflo-core_ruflo__agentdb_hierarchical-store

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/create-a-ddd-bounded-context-mte1lhi4/SKILL.md' && test -s '.skill-downloads/create-a-ddd-bounded-context-mte1lhi4/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/ddd-context' && cp -R '.skill-downloads/create-a-ddd-bounded-context-mte1lhi4' '.claude/skills/ddd-context'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/create-a-ddd-bounded-context-mte1lhi4'

openskills read 'create-a-ddd-bounded-context-mte1lhi4'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/create-a-ddd-bounded-context-mte1lhi4/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills