ddd-context — скилл для Claude Code: что делает и как установить
Разворачивает структуру ограниченного контекста DDD с разделением на домен, приложение и инфраструктуру. Пригодится при распиле монолита.
npx skills add ruvnet/ruflo --skill ddd-context -a claude-codeЧто делает ddd-context
Скилл принимает имя контекста в формате kebab-case и проверяет, нет ли уже такой папки в src/. Если аргумент не передан, он выводит список существующих контекстов. Затем агент генерирует структуру папок domain, application и infrastructure. Внутри domain создаются директории для сущностей, объектов-значений, доменных событий, сервисов и репозиториев.
Для каждого слоя создаются файлы index.ts. Главный входной файл src/<context-name>/index.ts экспортирует только domain и application, скрывая детали infrastructure. Такая изоляция защищает архитектуру от случайных внешних зависимостей на конкретную реализацию.
Скилл также сохраняет метаданные контекста в графе моделей через инструменты Ruflo AgentDB и память ruflo-core. Без настроенных MCP-плагинов Ruflo запись связей в граф не сработает. В конце агент выводит отчёт со списком созданных файлов.
Какие задачи решает
- развернуть структуру ограниченного контекста по канонам DDD
- изолировать детали инфраструктуры от публичного API модуля
- разбить монолит на изолированные доменные модули
- зафиксировать связи нового контекста в графе предметной модели
Примеры запросов агенту
- Создай ограниченный контекст `billing`
- Покажи список существующих контекстов в проекте
- Сгенерируй структуру нового модуля `order-management`
Как установить ddd-context
1Через Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill ddd-context -a claude-code2Вручную: положить файлы
~/.claude/skills/ddd-context/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/ddd-context/
1Через Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill ddd-context -a codex2Вручную: положить файлы
.agents/skills/ddd-context/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill ddd-context -a cursor2Вручную: положить файлы
.cursor/skills/ddd-context/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install ruvnet/ruflo ddd-context2Вручную: положить файлы
.github/skills/ddd-context/SKILL.md1Через Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill ddd-context -a gemini-cli2Командой платформы
gemini skills install https://github.com/ruvnet/ruflo --path plugins/ruflo-ddd/skills/ddd-contextВручную: положить файлы
.devin/skills/ddd-context/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill ddd-context -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
Из того же набора104
Весь набор →Похожие
Вопросы о ddd-context
Как установить ddd-context в Claude Code?
Выполните команду npx skills add ruvnet/ruflo --skill ddd-context -a claude-code. Конфигурация скилла будет сохранена по пути ~/.claude/skills/ddd-context/SKILL.md.
Что делает скилл ddd-context?
Он создаёт каталоги domain, application и infrastructure для нового субдомена, настраивает barrel-экспорты и регистрирует контекст в графе через Ruflo AgentDB.
Почему из корня контекста не экспортируется infrastructure?
Файл src/<context-name>/index.ts реэкспортирует только домен и уровень приложения. Это проектное ограничение, чтобы внешний код не связывался с деталями реализации адаптеров и баз данных.
Исходный текст
SKILL.md · MIT
---
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 mcp__plugin_ruflo-core_ruflo__agentdb_causal-edge
---
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({ key: "domain/context-<context-name>", value: "Bounded context <context-name> (parent: domain)", tier: "semantic" })
mcp__plugin_ruflo-core_ruflo__agentdb_causal-edge({ sourceId: "entity:domain", targetId: "entity: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.
© ruvnet · MIT · ruvnet/ruflo