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.
npx skills add j5ik2o/okite-ai --skill when-to-wrap-primitivesgit clone --depth 1 https://github.com/j5ik2o/okite-aiWrote 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.
[](https://agentmods.dev/skills/j5ik2o/okite-ai/when-to-wrap-primitives)<a href="https://agentmods.dev/skills/j5ik2o/okite-ai/when-to-wrap-primitives"><img src="https://agentmods.dev/badge/skills/j5ik2o/okite-ai/when-to-wrap-primitives/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.
<a href="https://agentmods.dev/skills/j5ik2o/okite-ai/when-to-wrap-primitives"><img src="https://agentmods.dev/badge/skills/j5ik2o/okite-ai/when-to-wrap-primitives.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00275 | $0.04181 |
| Opus 5 | $0.00138 | $0.02090 |
| Sonnet 5 | $0.00055 | $0.00836 |
| Haiku 4.5 | $0.00028 | $0.00418 |
Grade A, and why
when-to-wrap-primitives 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 7d 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.
How it starts
The opening of the file, as written. The whole thing — 325 lines — stays where its author put it; the contents beside it link to each section on GitHub.
プリミティブ型ラップ判断ガイド
プリミティブ型をラップすべきか否かは、コスト対効果で判断する。盲目的にラップするのも、 一切ラップしないのも、どちらも設計の失敗である。
前提: Value Objectの定義は1つではない
「Value Object」という用語は文脈によって意味が異なる。議論やレビューで混乱が生じる主因である。
| 定義 | 出典 | スコープ | 核心 |
|---|---|---|---|
| 一般的定義 | Wikipedia等 | 最も広い | 同等性がIDではなく値に基づくオブジェクト |
| PofEAA定義 | Martin Fowler | 実装パターン | IDに基づかず値で等価判定される小型オブジェクト。別名参照問題を避けるため不変が推奨 |
| DDD定義 | Eric Evans | ドメインモデリング | PofEAA版の特性をすべて備えた上で、ドメインの概念を計測・定量化・説明し、不変条件と副作用のない振る舞いを持つドメインオブジェクト |
DDD版はPofEAA版のextends
DDD版VOとPofEAA版VOは独立した概念ではなく、特化(specialization)の関係にある。
| 特性 | PofEAA VO | DDD VO |
|---|---|---|
| 値による等価判定 | 必須 | 必須(継承) |
| 不変性 | 推奨 | 必須(強化) |
| ドメイン不変条件 | ー | 必須(追加) |
| ドメイン振る舞い | ー | 必須(追加) |
つまり:
- DDD VO IS-A PofEAA VO → すべてのDDD VOはPofEAA VOでもある
- PofEAA VO IS-A DDD VO → 成立しない(Ruby HashはPofEAA VOだがDDD VOではない)
DDD版は「値で等価判定される」「不変である」というPofEAA版の特性を前提として含んだ上で、 ドメイン固有の要件を追加したものである。2つの定義を並列に見ると、DDD版が PofEAA版の特性も持っていることを見落としやすいので注意。
チーム内では「PofEAAのVO」「DDDのVO」のように文脈を明示して使い分けるべき。
本スキルの立場
本スキルでは、「プリミティブ型をドメイン固有型でラップすべきか」という実践的判断に焦点を当てる。 VOの定義論争には立ち入らず、ラップすることで得られる具体的な利益がコストに見合うかで判断する。
2つのアンチパターン
Primitive Obsession(プリミティブ型への固執)
すべてをString/int/floatで表現し、ドメインの制約がコードに表れない。
fn transfer(from: String, to: String, amount: f64)
// fromとtoを取り違えてもコンパイルが通る
// amountが負でもコンパイルが通る
// 通貨の概念がない
症状:
- 同じプリミティブ型の引数が2つ以上並ぶ
- バリデーションロジックが呼び出し側に散在
- 「この文字列はメールアドレスのはず」という暗黙の前提
- 単位の取り違え(メートルとフィート、円とドル)
Value Object Obsession(過剰なラップ)
すべてのプリミティブ型を機械的にクラスで包み、複雑性だけが増す。
class CustomerFirstName(value: String)
class CustomerLastName(value: String)
class ShippingFirstName(value: String) // CustomerFirstNameと何が違う?
class ShippingLastName(value: String) // 同上
症状:
- 不変条件やドメインロジックを持たない「ただのラッパー」が大量に存在
- 文脈ごとに別の型を作るが、中身のバリデーションは同一
- 型変換のボイラープレートがドメインロジックより多い
- 新規メンバーが型の森で迷子になる
判断フレームワーク
5つの判断基準
プリミティブ型をラップすべきかを以下の基準で評価する。 1つでも強くYesならラップを検討。複数Yesなら強く推奨。すべてNoならラップ不要。
基準1: ドメイン不変条件があるか
その値に「常に満たすべき制約」があるか?
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.
- 7d ago First seen · 325 lines · 275 tokens per session scan A 560d0f5c481b
when-to-wrap-primitives is a skill published in the GitHub repository j5ik2o/okite-ai (81 stars, last pushed 4mo ago), licensed MIT. It adds 275 tokens to every session and 4,181 once invoked, about $0.0014 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-03.
Other skills, from other repositories
no-bare-casts
Writing as in TypeScript or TSX production code, modifying a file that contains a bare as cast, silencing a type error with a cast, encountering as unknown as, or reviewing a cast site.
code-review-csharp
Perform structured code reviews of C# source code covering naming conventions, performance, security, readability, and .NET best practices. Trigger phrases include "review this C# code", "check my C# for best practices", "analyze this C# class", "find issues in my C# code".
solid-principles
SOLID principles checklist with Java examples. Use when a class has too many responsibilities, an abstraction leaks, or a dependency points the wrong way, and when the user asks about Single Responsibility, Open/Closed, Liskov, Interface Segregation or Dependency Inversion. For naming, duplication and method length…
splitting-oversized-modules
Split an oversized Python module (a thousand-plus-line logic.py, models.py, api.py, or its test file) into a package of one module per concern, mechanically and provably without changing behavior. Use on a request to split / break up / decompose a god module or move functions out of one, once a human has agreed to…
go-concurrency-safety
L1 supplement - audits Go-specific concurrency hazards in node client code: map iteration non-determinism, goroutine leaks, mutex ordering, panic boundaries, context cancellation.
splitting-oversized-modules
Split an oversized Python module (a thousand-plus-line logic.py, models.py, api.py, or its test file) into a package of one module per concern, mechanically and provably without changing behavior. Use on a request to split / break up / decompose a god module or move functions out of one, once a human has agreed to…