AGENT SKILL

j5ik2o-ddd-when-to-wrap-primitives

Use when deciding whether a primitive value should become a domain-specific type or value object. Balances primitive obsession against value-object obsession using risk, invariants, behavior, and cost. Trigger for wrapping strings/ints/UUIDs, value object decisions, too many tiny types, or whether a primitive is good enough.

License 许可
Apache-2.0
所属仓库
j5ik2o/ai-tools
最近更新
2026-11-12
Stars
★ 28
Forks
0

01 前言 Front Matter

name
j5ik2o-ddd-when-to-wrap-primitives
description
Use when deciding whether a primitive value should become a domain-specific type or value object. Balances primitive obsession against value-object obsession using risk, invariants, behavior, and cost. Trigger for wrapping strings/ints/UUIDs, value object decisions, too many tiny types, or whether a primitive is good enough.

02 资源文件 1

03 SKILL.md 正文

When To Wrap Primitives

Wrap primitives when the wrapper changes correctness, not when it only signals virtue.

Wrap When

  • The value has a domain name and invariant.

  • Two values of the same primitive type can be confused.

  • Validation is repeated or easy to forget.

  • Behavior naturally belongs with the value.

  • Invalid states cause meaningful business risk.

Do Not Wrap Yet When

  • The value has no behavior or invariant.

  • The wrapper would only forward primitive operations.

  • The type is local, temporary, or purely technical.

  • The team would pay high ceremony for little safety.

Workflow

  1. List candidate primitives and their risks.

  2. Score invariant strength, misuse risk, behavior, reuse, and migration cost.

  3. Wrap the highest-value candidates first.

  4. Keep construction explicit and error reporting useful.

Detailed Reference

For non-trivial implementation, review, or refactoring work, read references/details.md before giving final guidance. It contains the detailed rules, examples, smells, and migration notes that do not belong in the short invocation body.

Output

Return a wrap/keep table with rationale and example APIs for the chosen wrappers.

04 同仓库更多 Skills

j5ik2o
j5ik2o/ai-tools

takt

TAKT ワークフローエンジン。Agent Team を使ったマルチエージェントオーケストレーション。ワークフロー YAML(steps / initial_step)に従ってマルチエージェントを実行する。

★ 28
j5ik2o
j5ik2o/ai-tools

takt

TAKT ワークフローエンジン。codex exec でサブエージェントを起動し、ワークフロー YAML(steps / initial_step)に従って マルチエージェントオーケストレーションを実行する。

★ 28
j5ik2o
j5ik2o/ai-tools

j5ik2o-takt-workflow-builder

TAKTワークフロー(ワークフローYAML)の作成・カスタマイズスキル。Faceted Prompting (Persona/Policy/Instruction/Knowledge/Output Contract)に基づくファセット群の 生成を含む。references/taktにあるtaktのソースコード・ドキュメント・ビルトインワークフロー群を 参照資料として活用する。ユーザーの要件をヒアリングし、step構成、ルール設計、 ファセットファイル生成を一括で行う。 トリガー:「ワークフローを作りたい」「ワークフローを定義」「taktのワークフローを作成」 「新しいtaktワークフローを作って」「takt workflow」「ワークフローYAML」

★ 28
j5ik2o
j5ik2o/ai-tools

j5ik2o-takt-task-builder

TAKTのtasks.yaml(タスクメタデータ)とタスクディレクトリ(.takt/tasks/{slug}/order.md)の 作成・編集を支援するスキル。TaskRecordスキーマに準拠したYAMLエントリの生成、 order.mdタスク仕様書の作成、ステータス遷移ルールの検証を行う。 references/taktにあるtaskスキーマ定義・ドキュメントを参照資料として活用する。 トリガー:「タスクを追加」「tasks.yamlを編集」「taktタスクを作成」 「タスク仕様書を書く」「order.mdを作成」「takt task」「タスクを定義」 「pendingタスクを追加」「GitHub Issueからタスク作成」

★ 28
j5ik2o
j5ik2o/ai-tools

j5ik2o-takt-skill-updater

nrslib/takt の新バージョンリリース時に、takt-*スキル群(j5ik2o-takt-task-builder, j5ik2o-takt-workflow-builder, j5ik2o-takt-facet-builder, j5ik2o-takt-analyzer, j5ik2o-takt-optimizer)を最新のtaktバージョンに追従させるスキル。 TypeScriptスキーマ(taskRecordSchemas.ts / taskExecutionSchemas.ts)、ワークフローYAML、ファセットMarkdownの差分を検出し、 SKILL.md・参照ドキュメント(task-schema.md等)を体系的に更新する。 トリガー:「taktスキルを更新」「takt-*スキルの鮮度チェック」「taktバージョンアップ対応」 「スキルが古くないか確認」「takt skill updater」

★ 28
j5ik2o
j5ik2o/ai-tools

takt

TAKT ワークフローエンジン。Agent Team を使ったマルチエージェントオーケストレーション。ワークフロー YAML(steps / initial_step)に従ってマルチエージェントを実行する。

★ 28