本文へスキップ
Skillpedia
APIとサーバー(バックエンド)48k · #4348

ddd-tactical-patterns

できること

このツールは、「DDD戦術的パターン」と呼ばれる設計原則に従って、プログラムのコードを整理するのに役立ちます。特にビジネスルールが複雑な場合に、プログラムの中核部分を理解しやすく、保守しやすい構造にすることに重点を置いています。

使う場面

  • ✓ビジネスルールをコードに落とし込む必要があるとき。
  • ✓プログラムのさまざまな部分をどのようにまとめるか決めるとき。
  • ✓わかりにくい、または明確なロジックがないコードを改善したいとき。

スキルのリンク

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/ddd-tactical-patterns/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/ddd-tactical-patterns/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“次のビジネスルールをコードに変換してください:[ここにルール]”

毎週5つの新しいスキル。1分で読めます。

仕組み

このツールは、コードを「エンティティ」と「値オブジェクト」と呼ばれるブロックに整理し、重要なルール(不変条件)が常に守られるようにします。さらに、これらのブロック同士がどのようにやり取りするか、また重要な変更をどのように記録するかを定める手助けもします。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

DDD Tactical Patterns

Use this skill when

  • Translating domain rules into code structures.
  • Designing aggregate boundaries and invariants.
  • Refactoring an anemic model into behavior-rich domain objects.
  • Defining repository contracts and domain event boundaries.

Do not use this skill when

  • You are still defining strategic boundaries.
  • The task is only API documentation or UI layout.
  • Full DDD complexity is not justified.

Instructions

  1. Identify invariants first and design aggregates around them.
  2. Model immutable value objects for validated concepts.
  3. Keep domain behavior in domain objects, not controllers.
  4. Emit domain events for meaningful state transitions.
  5. Keep repositories at aggregate root boundaries.

If detailed checklists are needed, open references/tactical-checklist.md.

Example

class Order {
  private status: "draft" | "submitted" = "draft";

  submit(itemsCount: number): void {
    if (itemsCount === 0) throw new Error("Order cannot be submitted empty");
    if (this.status !== "draft") throw new Error("Order already submitted");
    this.status = "submitted";
  }
}

Limitations

  • This skill does not define deployment architecture.
  • It does not choose databases or transport protocols.
  • It should be paired with testing patterns for invariant coverage.
よくある質問

「不変条件」とは何ですか?

プログラムのある部分において、常に成り立っていなければならないビジネスルールのことです。たとえば、銀行口座の残高がマイナスになることはありません。

「エンティティ」と「値オブジェクト」とは何ですか?

エンティティは、時間とともに変化する独自の識別子を持つもの(例:「ユーザー」)です。値オブジェクトは、独自の識別子を持たず、属性によって定義されるもの(例:「住所」)です。

「集約」とは何ですか?

エンティティや値オブジェクトをまとめ、一つの単位として扱うものです。ビジネスルールの一貫性を保つのに役立ちます。

詳細

作者による元の説明

Apply DDD tactical patterns in code using entities, value objects, aggregates, repositories, and domain events with explicit invariants.

repo: sickn33/agentic-awesome-skills

人気

GitHubのスター
48k
ランキング
#4348
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル