cross-aggregate-constraints

cross-aggregate-constraints is a skill for Claude Code, Codex from j5ik2o/okite-ai. It costs 267 tokens per session (4,282 once invoked), scanned A, original, MIT.

Guidance for handling business rules that require checking the state of two separate domain groups. It helps decide whether to change the requirement, combine the groups, or accept temporary inconsistency.

In plain words
What is it for?
Use it when designing or reviewing rules such as preventing deletion while related records still exist, especially with CQRS or event sourcing.
Why use it?
Checking across domain boundaries can make transactions and event-based systems unnecessarily complex. This guidance helps identify simpler designs before implementation.

Skill for Claude CodeCodex

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

Good fit Use it when designing or reviewing rules such as preventing deletion while related records still exist, especially with CQRS or event sourcing.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/j5ik2o/okite-ai/cross-aggregate-constraints
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 cross-aggregate-constraints
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 cross-aggregate-constraints

README.md
[![agentmods](https://agentmods.dev/badge/skills/j5ik2o/okite-ai/cross-aggregate-constraints/github.svg)](https://agentmods.dev/skills/j5ik2o/okite-ai/cross-aggregate-constraints)
Your own site
<a href="https://agentmods.dev/skills/j5ik2o/okite-ai/cross-aggregate-constraints"><img src="https://agentmods.dev/badge/skills/j5ik2o/okite-ai/cross-aggregate-constraints/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 cross-aggregate-constraints

Your own site · 80×15
<a href="https://agentmods.dev/skills/j5ik2o/okite-ai/cross-aggregate-constraints"><img src="https://agentmods.dev/badge/skills/j5ik2o/okite-ai/cross-aggregate-constraints.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 267 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,282 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.00267 $0.04282
Opus 5 $0.00133 $0.02141
Sonnet 5 $0.00053 $0.00856
Haiku 4.5 $0.00027 $0.00428

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

Security

Grade A, and why

cross-aggregate-constraints 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 9d 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/cross-aggregate-constraints/SKILL.md · 352 lines

How it starts

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

集約間の制約チェック

集約間の制約に直面したら、まず要件を疑い、次に技術的制約を理解し、最後に覚悟を決める。

典型的な問題

「集約Aのユースケースで集約Bの状態を確認したい」という要求が発生する。

例: 「一つでも商品が紐づいているブランドは削除できない」

  Brand集約(削除したい)←── 制約チェック ──→ Product集約(紐づき確認)

この種の要求に対して、安易に技術的解決策に飛びつくべきではない。

ステップ1: 要件を疑う

技術の前に、ビジネス要件自体を問い直す。

問い直しのフレームワーク

その制約は本当に必要か?
    ↓
ライフサイクル全体で考えるとどうなるか?
    ↓
実運用では実質的にどういう制約になるか?
    ↓
複雑な実装に見合うビジネス価値があるか?

具体例: ブランド削除制約

「一つでも商品が紐づいているブランドは削除できない」を問い直す:

観点 分析
初期状態 ブランド登録時は商品ゼロ。削除可能
運用中 ほとんどのブランドに何かしらの商品が紐づく
実質的な制約 「ブランドは削除できない」と同義になる
結論 複雑な制約チェック機構を作る意味があるか再検討すべき

要件緩和の選択肢

緩和案 説明
論理削除 ブランドを「非アクティブ」にする。商品紐づきチェック不要
制約の廃止 ブランド削除自体を禁止し、制約チェックを不要にする
条件の変更 「N日以上商品が紐づいていないブランドのみ削除可」等
許容 紐づき先のないゴミデータの存在を受け入れる

ステップ2: そもそもモデリングの問題ではないか

集約間の制約が必要に見える場合、集約の境界が間違っている可能性がある。

トランザクションは複数のエンティティにまたがりますか? この質問の答えがイエスならば、間違った集約ルートを持っていると言えるでしょう。 --- Lightbend Academy

関係性に基づく判断フロー

2つの「集約」を常に一緒に操作する必要がある場合:

A : B の関係は?
    ├─ 1:1 → 同一集約に統合を検討
    │         例: Task(report: TaskReport)
    │         → 1トランザクションで不変条件を維持できる
    │
    ├─ 1:N(少量) → 要件調整で小規模化できないか検討
    │         → 可能なら同一集約に統合
    │
    ├─ 1:N(大量) → 別集約 + 結果整合性
    │         → ドメインイベントで連携
    │
    └─ Bは純粋なクエリ要件か?
          ├─ YES → CQRSのリードモデル(プロジェクション)で対応
          │         → Bは集約ではなくビューとして構築
          └─ NO → ドメイン知識を持つ → 独立集約 + 結果整合性

具体例: Task と TaskReport

「TaskReportの作成を忘れるとまずい」ならば、両者は独立できない可能性が高い。

// 1:1なら同一集約に統合
class Task private constructor(
    val id: TaskId,
    val name: TaskName,
    val report: TaskReport  // 集約内に含める
) {
    companion object {
        fun create(name: TaskName): Task {
            val id = TaskId.generate()
            return Task(id, name, TaskReport.create(id))
            // TaskReport作成忘れが構造的に不可能になる
        }
    }
}

TaskReportが純粋なクエリ要件なら、CQRSのリードモデルとして構築すべき。集約ではなくプロジェクションで対応することで、制約チェック自体が不要になる。

ステップ3: Sagaの誤用を避ける

集約間の制約チェックにSagaを使おうとするのは、よくある誤用パターンである。

Read the full file on GitHub · 352 lines

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. 9d ago First seen · 352 lines · 267 tokens per session scan A 9098e097c678

Subscribe to this mod's changes

cross-aggregate-constraints is a skill published in the GitHub repository j5ik2o/okite-ai (81 stars, last pushed 4mo ago), licensed MIT. It adds 267 tokens to every session and 4,282 once invoked, about $0.0013 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.

Related

Other skills, from other repositories

mem0-oss-to-platform

Plan and then execute a migration of a project from the mem0 open-source / self-hosted SDK (the local Memory class) to the mem0 Platform / hosted / managed SDK (the MemoryClient class). Use this whenever a developer wants to move, switch, or migrate their mem0 usage off OSS/self-hosted to the hosted API — e.g.…

mem0ai/mem0 · 273 tokens

agui-dotnet-protobuf

Use the protobuf wire transport (instead of the default Server-Sent Events) for an AG-UI connection with the AG-UI .NET SDK — a compact binary event stream negotiated via the Accept header. USE FOR: making an AGUIChatClient prefer protobuf by wiring an AGUIEventStreamHandler with ProtobufEventStreamFormatter (then…

ag-ui-protocol/ag-ui · 162 tokens

azure-mgmt-botservice-dotnet

Azure Resource Manager SDK for Bot Service in .NET. Management plane operations for creating and managing Azure Bot resources, channels (Teams, DirectLine, Slack), and connection settings. Triggers: "Bot Service", "BotResource", "Azure Bot", "DirectLine channel", "Teams channel", "bot management .NET", "create bot".

microsoft/skills · 78 tokens

fastapi-router-py

Create FastAPI routers with CRUD operations, authentication dependencies, and proper response models. Use when building REST API endpoints, creating new routes, implementing CRUD operations, or adding authenticated endpoints in FastAPI applications.

microsoft/skills · 46 tokens

migrate-segw-to-rap

Reverse-engineer a SEGW-built OData V2 service (MPC/DPC/MPCEXT/DPCEXT) into a modern RAP V4 service — tables, CDS views (interface + projection), behavior definitions, draft entities, service definition + binding. Use when asked to "migrate this SEGW service to RAP", "convert OData V2 to V4 RAP", "modernize this…

arc-mcp/arc-1 · 106 tokens

telnyx-messaging-hosted-curl

Set up hosted SMS numbers, toll-free verification, and RCS messaging. Use when migrating numbers or enabling rich messaging features. This skill provides REST API (curl) examples.

team-telnyx/ai · 45 tokens