本文へ移動
cccskills
無料GitHub で公開

ddd

Domain-Driven Design system for software development. Use when designing new systems with DDD principles, refactoring existing codebases toward DDD, generating code scaffolding (entities, aggregates, repositories, domain events), facilitating Event Storming sessions, creating bounded context maps, or performing code reviews with a DDD lens. Covers both strategic design (bounded contexts, subdomains, context maps, ubiquitous language) and tactical design (entities, value objects, aggregates, domain services, repositories). Supports all major architecture patterns (Hexagonal/Ports & Adapters, CQRS, Event Sourcing, Clean Architecture) with language-agnostic guidance and concrete examples in Python and TypeScript.

インストール方法を見る

含まれるファイル(13)

  • SKILL.md6.2 KB
  • eval.yaml1.2 KB
  • graders/check.py14.5 KB
  • instructions/checkout-domain-model.md3.4 KB
  • references/architecture-patterns.md21.0 KB
  • references/code-review.md9.6 KB
  • references/event-storming.md13.2 KB
  • references/python-patterns.md19.6 KB
  • references/strategic-design.md7.9 KB
  • references/tactical-design.md11.3 KB
  • references/typescript-patterns.md23.1 KB
  • rubrics/quality.md3.0 KB
  • solutions/reference-checkout-domain7.1 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Domain-Driven Design Skill

Apply DDD to build software that reflects deep understanding of the business domain.

Quick Reference

TaskReference
Bounded contexts, subdomains, context mapsstrategic-design.md
Entities, value objects, aggregates, repositoriestactical-design.md
Hexagonal, CQRS, Event Sourcing, Clean Architecturearchitecture-patterns.md
Event Storming facilitation & documentationevent-storming.md
Python implementations (Pydantic, SQLAlchemy, FastAPI)python-patterns.md
TypeScript implementations (NestJS, TypeORM, Prisma)typescript-patterns.md
DDD code review criteriacode-review.md

Core Workflow

1. Identify the Task Type

Designing new system? → Start with strategic design, then tactical Refactoring existing code? → Assess current state, identify bounded contexts, refactor incrementally Generating scaffolding? → Determine patterns needed, generate code Event Storming? → Follow facilitation guide Code review? → Apply DDD checklist

2. Strategic Before Tactical

Always establish strategic design first:

  1. Identify subdomains (Core, Supporting, Generic)
  2. Define bounded contexts and their boundaries
  3. Map context relationships (upstream/downstream, conformist, ACL, etc.)
  4. Establish ubiquitous language per context

3. Select Architecture Pattern

Choose based on domain complexity and requirements:

PatternWhen to Use
LayeredSimple CRUD, low complexity
HexagonalNeed to isolate domain from infrastructure
Clean ArchitectureComplex business rules, multiple delivery mechanisms
CQRSDifferent read/write models, complex queries
Event SourcingAudit trail required, temporal queries, event-driven

Patterns can be combined (e.g., Hexagonal + CQRS + Event Sourcing).

4. Apply Tactical Patterns

Select tactical building blocks based on needs:

Building BlockPurpose
EntityIdentity matters, mutable, lifecycle
Value ObjectDefined by attributes, immutable, no identity
AggregateConsistency boundary, transactional unit
Domain ServiceStateless operations spanning multiple aggregates
RepositoryCollection-like interface for aggregate persistence
Domain EventRecord of something significant that happened
FactoryComplex object creation logic
SpecificationEncapsulated business rules for querying/validation

5. Implementation Guidelines

General principles:

  • Domain layer has ZERO infrastructure dependencies
  • Depend on abstractions (interfaces/protocols), not concretions
  • One aggregate = one repository = one transaction
  • Aggregates reference other aggregates by ID only
  • Validate invariants within aggregate boundaries
  • Use domain events for cross-aggregate communication

Language selection:

Project Structure Template

src/
├── domain/                    # Pure domain logic (no dependencies)
│   ├── model/                 # Entities, Value Objects, Aggregates
│   ├── service/               # Domain Services
│   ├── event/                 # Domain Events
│   ├── repository/            # Repository interfaces (ports)
│   └── specification/         # Business rule specifications
├── application/               # Use cases, orchestration
│   ├── command/               # Command handlers (write)
│   ├── query/                 # Query handlers (read)
│   ├── dto/                   # Data transfer objects
│   └── service/               # Application services
├── infrastructure/            # External concerns
│   ├── persistence/           # Repository implementations
│   ├── messaging/             # Event bus, message queue
│   └── external/              # Third-party integrations
└── interface/                 # Delivery mechanisms
    ├── api/                   # REST/GraphQL controllers
    ├── cli/                   # Command-line interface
    └── event/                 # Event consumers

Anti-Patterns to Avoid

  • Anemic Domain Model: Entities with only getters/setters, logic in services
  • God Aggregate: Too many entities in one aggregate
  • Shared Kernel Abuse: Overusing shared code between contexts
  • Infrastructure Leak: Database concerns in domain layer
  • Missing Ubiquitous Language: Technical terms instead of domain terms
  • Aggregate Reference by Object: Should reference by ID only
  • Transaction Across Aggregates: Violates consistency boundaries

When NOT to Use DDD

DDD adds complexity. Avoid for:

  • Simple CRUD applications
  • Technical/infrastructure projects without complex business logic
  • Prototypes or throwaway code
  • Teams unfamiliar with the domain (learn domain first)

Use DDD when:

  • Complex, evolving business logic
  • Long-lived systems requiring maintainability
  • Multiple teams working on related domains
  • Domain experts available for collaboration

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Adaption AI SDK for synthetic data augmentation and dataset adaptation. Use when building data pipelines with the Adaption Python SDK, uploading datasets (local files, Hugging Face, Kaggle), running augmentation/adaptation jobs, configuring brand controls (hallucination mitigation, safety categories, length), recipe specifications (reasoning traces, deduplication, preference pairs, prompt rephrase), evaluating dataset quality, downloading results, or any workflow involving `pip install adaption`, `from adaption import Adaption`, Adaptive Data, or the adaptionlabs.ai API. Also trigger when the user mentions synthetic data generation for fine-tuning, dataset augmentation pipelines, DPO preference pair generation, or grounding-based hallucination reduction on training data.

日本語の概要は準備中です。原文の説明を表示しています。

svngoku/coding-agents-skills122026年8月14日 更新

Design and review intuitive, scalable, maintainable HTTP APIs. Use this skill whenever the user wants to design a new REST API, review an existing API or spec, write OpenAPI 3.x definitions, or work with HTTP semantics (GET/POST/PUT/PATCH/DELETE), status codes, idempotency (Idempotency-Key), error envelopes (RFC 7807 problem+json), pagination, filtering, versioning, or API auth (API keys, OAuth2 client credentials, rate limits). Also trigger for "API design", "RESTful", "endpoints", "OpenAPI", "Swagger", "ReDoc", "contract testing", or GraphQL and gRPC design questions.

日本語の概要は準備中です。原文の説明を表示しています。

svngoku/coding-agents-skills122026年8月14日 更新

Design relational database schemas (and choose when to go NoSQL) that stay maintainable and fast. Use this skill whenever the user mentions tables, DDL, entities and relationships, normalization (1NF/2NF/3NF), primary and foreign keys, UUID vs bigint IDs, indexes (B-tree, composite, covering, partial), EXPLAIN, constraints (CHECK, UNIQUE, exclusion), transactions and isolation levels, migrations (Alembic, Prisma, Flyway, expand-contract, backfilling), or SQL vs NoSQL (MongoDB, DynamoDB, Cassandra, graph databases). Also trigger for "design the database", "model this domain", "which database should I use", or writing ORM models and migration files for PostgreSQL, MySQL, SQLite, or SQL Server.

日本語の概要は準備中です。原文の説明を表示しています。

svngoku/coding-agents-skills122026年8月14日 更新

genai-tk

無料

Build GenAI and agentic applications with the genai-tk toolkit (https://github.com/tclatos/genai-tk) — a YAML-driven wrapper over LangChain, LangGraph, and 100+ LLM providers. Use this skill whenever the user mentions genai-tk, genai_tk, the GenAI Toolkit, `cli init`, `LangchainAgent`, `get_llm`/`get_embeddings`, `RetrieverFactory`/`ManagedRetriever`, the four bundled agent frameworks (ReAct, Deep, Deer-flow, SmolAgents), the OpenSandbox Docker integration, the `model_id@provider` identifier format, the `global_config()`/`OmegaConfig` system with `app_conf.yaml` and `:merge`, BAML structured extraction, SkillsMiddleware, writing or editing the toolkit's YAML profiles (langchain.yaml, deerflow.yaml, llm.yaml, retrievers.yaml), composing retrievers (vector/bm25/ensemble/reranked/pg_hybrid/zero_entropy), or extending the CLI with `CliTopCommand`. Trigger even when the user only says "the toolkit" in context.

日本語の概要は準備中です。原文の説明を表示しています。

svngoku/coding-agents-skills122026年8月14日 更新

langchain

無料

Build AI agents with LangChain framework. Use when building agents, tools, memory, MCP integrations, RAG pipelines, multi-agent systems, or any LLM-powered applications using LangChain or LangGraph in Python or TypeScript.

日本語の概要は準備中です。原文の説明を表示しています。

svngoku/coding-agents-skills122026年8月14日 更新

Decompose systems into microservices and apply canonical distributed-systems patterns. Use this skill whenever the user wants to split a monolith into services, design service boundaries, choose between microservices and a modular monolith, implement sagas or the outbox pattern, set up CQRS or event sourcing, configure an API gateway or BFF, add resilience (circuit breakers, retries, timeouts), or implement distributed tracing with OpenTelemetry. Also trigger for distributed transactions, service discovery, event-driven architecture, contract testing with Pact, canary releases, and idempotent consumers.

日本語の概要は準備中です。原文の説明を表示しています。

svngoku/coding-agents-skills122026年8月14日 更新

svngoku のスキルをすべて見る

このスキルの問題を報告する