aggregate-design

aggregate-design is a skill for Claude Code, Codex from j5ik2o/okite-ai. It costs 360 tokens per session (3,068 once invoked), scanned A, original, MIT.

A design guide for Domain-Driven Design (DDD) aggregates: groups of related objects managed through one main entry point and kept within consistency boundaries.

In plain words
What is it for?
Use it when designing, implementing, reviewing, or refactoring aggregates and entity classes, including their rules and boundaries.
Why use it?
It helps prevent aggregates from becoming too large or allowing invalid state. It also gives review and refactoring rules for boundaries, immutable data, references, and domain events.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when designing, implementing, reviewing, or refactoring aggregates and entity classes, including their rules and boundaries.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/j5ik2o/okite-ai/aggregate-design
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add j5ik2o/okite-ai --skill aggregate-design
Clone the repo
git clone --depth 1 https://github.com/j5ik2o/okite-ai

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for aggregate-design

README.md
[![agentmods](https://agentmods.dev/badge/skills/j5ik2o/okite-ai/aggregate-design/github.svg)](https://agentmods.dev/skills/j5ik2o/okite-ai/aggregate-design)
Your own site
<a href="https://agentmods.dev/skills/j5ik2o/okite-ai/aggregate-design"><img src="https://agentmods.dev/badge/skills/j5ik2o/okite-ai/aggregate-design/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for aggregate-design

Your own site · 80×15
<a href="https://agentmods.dev/skills/j5ik2o/okite-ai/aggregate-design"><img src="https://agentmods.dev/badge/skills/j5ik2o/okite-ai/aggregate-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 360 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,068 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00360 $0.03068
Opus 5 $0.00180 $0.01534
Sonnet 5 $0.00072 $0.00614
Haiku 4.5 $0.00036 $0.00307

Measured 8d ago against content hash a7360ad52711, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

aggregate-design scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/aggregate-design/SKILL.md · 259 lines

How it starts

The opening of the file, as written. The whole thing — 259 lines — stays where its author put it; the contents beside it link to each section on GitHub.

集約設計ガイド

DDDにおける集約(Aggregate)設計の原則。

集約とは

集約 = 整合性の境界

  • 集約はオブジェクトのグラフであり、そのグラフを一単位として扱う
  • 集約内で真の不変条件(常に満たすべき制約)が維持される
  • 集約ルート(ルートエンティティ)が集約全体の唯一のエントリーポイント

境界の例:Car集約

┌─────────────────────────────────────┐
│           Car集約                    │
│  ┌──────────────────────────────┐  │
│  │   Car (集約ルート)            │  │
│  │   - carId: CarId             │  │
│  │   - tires: List[Tire]        │  │
│  │   - engine: Engine           │  │
│  └──────────────────────────────┘  │
│         ↓ 所有               ↓ 所有  │
│  ┌──────────┐         ┌─────────┐ │
│  │  Tire    │ × 4     │ Engine  │ │
│  │ (VoかEnt)│         │ (VoかEnt)│ │
│  └──────────┘         └─────────┘ │
└─────────────────────────────────────┘
  • TireとEngineはCar集約の境界内にある
  • 外部からTireやEngineへ直接アクセスは不可
  • Carを経由してのみ操作可能

Design by Contract (DbC)

集約は契約に基づいて設計する。

契約 説明 責任
事前条件 (Precondition) メソッド呼び出し前に満たすべき条件 呼び出し側
事後条件 (Postcondition) メソッド実行後に満たされる条件 実装側
不変条件 (Invariant) 常に満たすべき条件 実装側

詳細な言語別実装パターンは references/typescript.mdreferences/scala.mdreferences/rust.mdreferences/python.md を参照。

基本原則

1. 不変性(Immutability)推奨

現代においては不変(Immutable)を推奨する。特に理由がなければ不変。 状態更新時は既存値を引き継ぎ、変更するフィールドだけを上書きする。 これにより、フィールド追加時の修正漏れを防ぎ、更新意図が明確になる。

言語 不変更新パターン
TypeScript Props型 + ...this.props スプレッド構文
Scala case class + copy()
Rust struct + ..self 構造体更新構文
Python dataclass(frozen=True) + replace()

2. 強い整合性境界

集約は一つの強い整合性境界。集約内部の状態はすべてその集約の管理下に置く。

3. 他集約への間接参照

集約内部に別の集約の参照を保持しない。他の集約と関連を持つ場合はIDで間接参照する。

4. 完全コンストラクタ

基本コンストラクタですべての状態を初期化する。オーバーロードする場合も必ず基本コンストラクタを利用する補助コンストラクタとして設計する。

5. 防御的コピー

可変オブジェクトを保持する場合、外部に返す際は必ずコピーを返すか不変オブジェクトに変換する。

6. 不変条件の維持

どのような操作をされても不正な状態に陥ってはならない。不変な集約では基本コンストラクタで保護する。

構造原則

7. 集約ルート経由のアクセス

集約内部のエンティティや値オブジェクトへの直接アクセスは、必ず集約ルートを経由する。

Read the full file on GitHub · 259 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 259 lines · 360 tokens per session scan A a7360ad52711

Subscribe to this mod's changes

aggregate-design is a skill published in the GitHub repository j5ik2o/okite-ai (81 stars, last pushed 4mo ago), licensed MIT. It adds 360 tokens to every session and 3,068 once invoked, about $0.0018 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-01.