tell-dont-ask

tell-dont-ask is a skill for Claude Code, Codex from j5ik2o/okite-ai. It costs 212 tokens per session (1,551 once invoked), scanned A, original, MIT.

A code-design approach that gives an object commands to perform its own work instead of reading its internal state and making decisions elsewhere.

In plain words
What is it for?
Use it during code review, new implementation, or refactoring when state checks, getter chains, or logic outside the relevant object need improvement.
Why use it?
It keeps behavior with the data it belongs to and reduces scattered logic, excessive getters, and weak encapsulation.

Skill for Claude CodeCodex

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

Good fit Use it during code review, new implementation, or refactoring when state checks, getter chains, or logic outside the relevant object need improvement.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/j5ik2o/okite-ai/tell-dont-ask"><img src="https://agentmods.dev/badge/skills/j5ik2o/okite-ai/tell-dont-ask.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 212 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,551 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.00212 $0.01551
Opus 5 $0.00106 $0.00776
Sonnet 5 $0.00042 $0.00310
Haiku 4.5 $0.00021 $0.00155

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

Security

Grade A, and why

tell-dont-ask 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

skills/tell-dont-ask/SKILL.md · 156 lines

How it starts

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

Tell, Don't Ask

オブジェクトに問い合わせるな、命じよ。

核心原則

オブジェクトの内部状態に基づく意思決定をし、その結果で該当オブジェクトを更新してはならない。 (『達人プログラマー 第2版』167ページ)

アプローチ 特徴 問題
Ask 状態を取得→外部で判断→操作 ロジックが散在、カプセル化破壊
Tell オブジェクトに直接命じる 責任集約、変更に強い

判断フロー

オブジェクトのメソッド呼び出し
    ↓
getterで状態を取得しているか?
    ├─ YES → その後ifで判定している?
    │         ├─ YES → Askパターン(問題あり)
    │         └─ NO → 表示/出力目的なら許容
    └─ NO → Tellパターン(推奨)

アンチパターン検出

以下のパターンを見つけたら変換を検討:

❌ if (obj.getX() > threshold) { obj.setY(...) }
❌ if (obj.getStatus() == ACTIVE) { doSomething(obj) }
❌ obj.getA().getB().doSomething()  // デメテルの法則違反
❌ for (item : list) { total += item.getPrice() }
❌ if (user.getRole() == ADMIN) { ... }

変換パターン

1. 状態判定の内部化

// ❌ Ask: 状態を取得して外部で判断
if (user.getAge() >= 18) {
    allowAccess(user);
}

// ✅ Tell: 判定ロジックをオブジェクトに持たせる
if (user.isAdult()) {
    allowAccess(user);
}

// ✅✅ さらに良い: 処理自体を委譲
user.ifAdult(() -> allowAccess());

2. 条件分岐のポリモーフィズム化

// ❌ Ask: 型で分岐
if (user.getType() == UserType.ADMIN) {
    sendAdminNotification(user);
} else {
    sendUserNotification(user);
}

// ✅ Tell: 各クラスに責任を持たせる
user.sendNotification();  // Admin/RegularUserで実装が異なる

3. コレクション操作の委譲

// ❌ Ask: 外部で集計
int total = 0;
for (Item item : order.getItems()) {
    total += item.getPrice();
}

// ✅ Tell: オブジェクトに集計を任せる
int total = order.calculateTotal();

4. Nullオブジェクトパターン

// ❌ Ask: null判定の分岐
Address addr = user.getAddress();
if (addr != null) {
    return addr.format();
} else {
    return "住所未登録";
}

// ✅ Tell: NullObjectでデフォルト動作を定義
return user.getAddress().format();  // NullAddressは"住所未登録"を返す

関連原則・スキル

原則 / スキル 関係
law-of-demeter 連鎖呼び出しを避ける(a.getB().getC()a.doC()
Feature Envy 他クラスのデータに執着 → 責任を移動
単一責任原則 データと処理を同じ場所に
カプセル化 内部状態を隠蔽し振る舞いを公開
breach-encapsulation-naming getter命名でカプセル化破壊を明示

適用指針

推奨

  • getter後にif文で判定しているコード
  • 同じ判定ロジックが複数箇所に散在
  • オブジェクトの状態を取得→更新するパターン
  • 型やステータスによる条件分岐

Read the full file on GitHub · 156 lines

Files

What ships with it

1 file 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. 7d ago First seen · 156 lines · 212 tokens per session scan A 78afcc27ff34

Subscribe to this mod's changes

tell-dont-ask is a skill published in the GitHub repository j5ik2o/okite-ai (81 stars, last pushed 4mo ago), licensed MIT. It adds 212 tokens to every session and 1,551 once invoked, about $0.0011 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.