← スキル一覧に戻る

net-domain-model
by mitkox
net-domain-modelは、other分野における実用的なスキルです。複雑な課題への対応力を強化し、業務効率と成果の質を改善します。
⭐ 121🍴 50📅 2026年1月23日
SKILL.md
name: net-domain-model description: Create domain models following Domain-Driven Design principles license: MIT compatibility: opencode metadata: audience: .net-developers framework: entityframeworkcore patterns: ddd
What I Do
I help you create domain models following DDD principles:
- Entities with identity
- Value objects (immutable)
- Aggregates and aggregate roots
- Domain events
- Repositories interfaces
- Domain services
When to Use Me
Use this skill when:
- Modeling business domain
- Creating entity classes
- Implementing value objects
- Defining aggregate boundaries
- Creating domain services
Domain Model Structure
src/{ProjectName}.Domain/
├── Entities/
│ ├── Product.cs
│ ├── Order.cs
│ └── Customer.cs
├── ValueObjects/
│ ├── Money.cs
│ ├── Email.cs
│ └── Address.cs
├── Aggregates/
│ └── OrderAggregate/
│ ├── Order.cs
│ └── OrderItem.cs
├── Interfaces/
│ ├── IProductRepository.cs
│ ├── IOrderRepository.cs
│ └── IUnitOfWork.cs
├── Events/
│ ├── OrderCreatedEvent.cs
│ └── OrderPaidEvent.cs
└── Services/
└── DomainService.cs
Patterns I Implement
Entity
public abstract class Entity
{
public Guid Id { get; protected set; }
public DateTime CreatedAt { get; protected set; }
public DateTime? UpdatedAt { get; protected set; }
public List<IDomainEvent> DomainEvents { get; } = new();
protected Entity(Guid id) => Id = id;
protected Entity() { }
}
Value Object
public abstract class ValueObject : IEquatable<ValueObject>
{
protected abstract IEnumerable<object> GetEqualityComponents();
public bool Equals(ValueObject? other)
{
if (other is null) return false;
if (ReferenceEquals(this, other)) return true;
return GetEqualityComponents()
.SequenceEqual(other.GetEqualityComponents());
}
}
Aggregate Root
public abstract class AggregateRoot : Entity
{
public override void RaiseDomainEvent(IDomainEvent domainEvent)
{
DomainEvents.Add(domainEvent);
}
public void ClearDomainEvents() => DomainEvents.Clear();
}
Best Practices
- Entities protect invariants
- Value objects are immutable
- Aggregates define consistency boundaries
- Domain events capture business events
- Repositories are in Domain layer
- Domain services contain business logic
Example Usage
Create a domain model for an e-commerce system with:
- Product entity
- Order aggregate root
- Money value object
- OrderCreated domain event
- Repository interfaces
I will generate complete domain model following DDD patterns.
スコア
総合スコア
70/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
✓人気
GitHub Stars 100以上
+5
○最近の活動
3ヶ月以内に更新がある
0/10
✓フォーク
10回以上フォークされている
+5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です