domain-model-first

domain-model-first is a skill for Claude Code, Codex from j5ik2o/okite-ai. It costs 133 tokens per session (2,499 once invoked), scanned A, original, MIT.

A development guide that designs and tests the business rules of a domain before connecting them to databases or other infrastructure. TDD means writing tests before the code they check, and a domain model represents the rules and concepts of the problem being solved.

In plain words
What is it for?
Use it to build value objects, entities, and aggregates from tests, then add an in-memory repository, use cases, and infrastructure in that order.
Why use it?
It keeps core logic independent from external systems and reveals unclear requirements and edge cases early.

Skill for Claude CodeCodex

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

Good fit Use it to build value objects, entities, and aggregates from tests, then add an in-memory repository, use cases, and infrastructure in that order.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/j5ik2o/okite-ai/domain-model-first"><img src="https://agentmods.dev/badge/skills/j5ik2o/okite-ai/domain-model-first.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 133 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,499 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.00133 $0.02499
Opus 5 $0.00067 $0.01249
Sonnet 5 $0.00027 $0.00500
Haiku 4.5 $0.00013 $0.00250

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

Security

Grade A, and why

domain-model-first 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/domain-model-first/SKILL.md · 240 lines

How it starts

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

ドメインモデル中心の開発手順

このガイドは特定のプログラミング言語に依存せず、どの言語でも適用可能な原則を説明しています。コード例はTypeScriptで示していますが、概念は他の言語にも応用できます。

テストファーストのドメインモデル設計・実装

目的

外部依存に左右されない純粋なドメインロジックを実装する。

具体的な手順

  1. ドメインモデルの振る舞いをテストとして定義
    • モデルが持つべき機能と制約を明確にする
    • エッジケースも含めて考慮する
  2. テストを満たすドメインモデルの実装
    • テストが示す仕様に従って実装
    • 値オブジェクト、エンティティ、集約の設計原則に従う
  3. リファクタリングによる設計の洗練
    • コードの重複排除
    • 責務の明確化と分離
    • 命名の改善

メリット

  • 仕様の明確化と要件の理解促進
  • 設計品質の向上(責務分離・凝集度向上)
  • リファクタリングの安全性確保
  • エッジケースの早期発見
  • ドキュメントとしての価値

テスト例

// Taskのテスト例
describe("Task", () => {
  it("タスクが完了しているかどうかを確認できる", () => {
    const taskId = TaskId.of("task-1");
    const title = TaskTitle.of("テストタスク");

    const task = Task.of({
      id: taskId,
      title: title,
      completed: false,
      createdAt: new Date("2023-03-01T10:00:00")
    });

    expect(task.isCompleted()).toBe(false);

    const completedTask = task.markAsCompleted();
    expect(completedTask.isCompleted()).toBe(true);
  });

  it("期限日が未来の日付であることを検証できる", () => {
    const pastDate = new Date();
    pastDate.setDate(pastDate.getDate() - 1); // 昨日の日付

    const result = Task.validateDueDate(pastDate);

    expect(result.isFailure()).toBe(true);
    expect(result.error.message).toContain("期限は未来の日付である必要があります");
  });
});

インメモリリポジトリの実装

目的

  • データベースに依存せず、ドメインモデルとユースケースのテスト実行を可能にする

具体的な手順

  1. リポジトリインタフェースの定義
    • ドメインモデルで必要な操作を定義
  2. インメモリ実装の作成
    • メモリ上のコレクションを使用
    • 実際のデータベースの振る舞いをシミュレート

ユースケース開発

目的

  • アプリケーション層のロジックをドメインモデルとリポジトリを使って実装

具体的な手順

  1. ユースケースのテストを定義
    • 実行条件と期待結果を明確に
    • 成功ケースと失敗ケースの両方をカバー
  2. テストを満たすユースケースを実装
    • 適切なドメインモデルとリポジトリの利用
    • ビジネスルールの適用
  3. リファクタリング
    • 責務の分離と明確化

テスト例

describe("CompleteTaskUseCase", () => {
  let taskRepository: TaskRepositoryInMemory;
  let completeTaskUseCase: CompleteTaskUseCase;

  beforeEach(() => {
    taskRepository = new TaskRepositoryInMemory();

    const task1 = Task.of({
      id: TaskId.of("task-1"),
      title: TaskTitle.of("未完了タスク"),
      completed: false,
      createdAt: new Date("2023-03-01T10:00:00"),
    });

    const task2 = Task.of({
      id: TaskId.of("task-2"),
      title: TaskTitle.of("既に完了しているタスク"),
      completed: true,
      createdAt: new Date("2023-03-01T13:00:00"),
    });

    taskRepository.save(task1);
    taskRepository.save(task2);

    completeTaskUseCase = new CompleteTaskUseCase(taskRepository);
  });

  it("タスクを完了できる", async () => {
    const result = await completeTaskUseCase.execute({
      taskId: "task-1",
    });

    expect(result.isSuccess()).toBe(true);

    const updatedTask = await taskRepository.findById(TaskId.of("task-1"));
    expect(updatedTask.isSuccess()).toBe(true);
    expect(updatedTask.value.isCompleted()).toBe(true);
  });

  it("存在しないタスクを処理できる", async () => {
    const result = await completeTaskUseCase.execute({
      taskId: "non-existent",
    });

    expect(result.isFailure()).toBe(true);
    expect(result.error.message).toContain("タスクが見つかりません");
  });
});

Read the full file on GitHub · 240 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 · 240 lines · 133 tokens per session scan A ab35e65a79fa

Subscribe to this mod's changes

domain-model-first is a skill published in the GitHub repository j5ik2o/okite-ai (81 stars, last pushed 4mo ago), licensed MIT. It adds 133 tokens to every session and 2,499 once invoked, about $0.0007 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.