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 agentmods add skills/s977043/river-review/nullability-contractnpx skills add s977043/river-review --skill nullability-contractgit clone --depth 1 https://github.com/s977043/river-reviewWrote 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/s977043/river-review/nullability-contract)<a href="https://agentmods.dev/skills/s977043/river-review/nullability-contract"><img src="https://agentmods.dev/badge/skills/s977043/river-review/nullability-contract.svg" alt="Measured on agentmods" 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 | $0.00024 | $0.01667 |
| Opus 5 | $0.00012 | $0.00834 |
| Sonnet 5 | $0.00005 | $0.00333 |
| Haiku 4.5 | $0.00002 | $0.00167 |
Grade A, and why
Nullability Contract Review 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 yesterday.
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 — 93 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Pattern declaration
Primary pattern: Reviewer Secondary patterns: Inversion Why: null/undefined/emptyの処理漏れはランタイムエラーの主要因。差分内の関数・API境界でnullability契約が明示・遵守されているかをレビューする。
Rule / ルール
- 関数の戻り値がnull/undefinedを返す可能性がある場合、型シグネチャに明示する(
T | null、T | undefined、T | null | undefined)。 - 呼び出し元でnull/undefinedチェックを省略しないこと。
- 配列・オブジェクトの空ケース(空配列
[]、空オブジェクト{})もnullと同様に考慮する。 - Optional chainingのみでは不十分な場合(次の処理でnullが伝播する場合)は明示的なearly returnを使用する。
Heuristics / 判定の手がかり
- 戻り値型に
null/undefinedを含む関数の呼び出しで、nullチェックなしにプロパティアクセスや関数呼び出しが行われている。 Array.find()/Array.at()などundefinedを返しうる配列メソッドの結果を直接使用している。Map.get()の結果をノーチェックで使用している。- オブジェクトのプロパティアクセスが深くネストされており、中間のnull可能性がケアされていない。
as string/!などで型システムをバイパスしてnull可能性を握りつぶしている。parseInt/parseFloat/Number()/ 暗黙の数値・文字列変換の結果をNaNチェックなしに使用しており、変換失敗が下流へ伝播する(型変換によるデータ損失)。
Good / Bad Examples
- Good:
const item = map.get(key); if (!item) return null; return item.value; - Bad:
return map.get(key)!.value; - Good:
const found = items.find(x => x.id === id); if (!found) throw new Error(\Item ${id} not found`);` - Bad:
return items.find(x => x.id === id).name; - Good:
function getUser(id: string): User | null { ... }と戻り値型で明示。 - Bad:
function getUser(id: string): User { ... }でnullを返す可能性を隠蔽。
Actions / 改善案
- null/undefinedを返しうる箇所の型シグネチャを修正し、呼び出し元でのチェックを徹底する。
Array.find()/Map.get()などの結果はunwrapするか早期returnする。- 非 null アサーション(
!)を除去し、型ガードまたはearly returnで代替する。 - nullableな値を扱うユーティリティ(
Optional<T>パターン等)の導入を検討する。
Non-goals / 扱わないこと
- TypeScriptの
strictモード設定変更提案(別スキルのスコープ)。 - null許容を意図的に使用しているライブラリAPI(外部依存)の型定義修正。
- コードベース全体の型定義一貫性の監査(差分外のコードは対象外)。
Pre-execution Gate / 実行前ゲート
このスキルは以下の条件がすべて満たされない限りNO_REVIEWを返す。
- 差分にTypeScriptファイル(
*.tsまたは*.tsx)が含まれている - 差分にnull/undefined/emptyを返しうる処理またはそれらを受け取る処理が含まれている
- inputContextにdiffが含まれている
ゲート不成立時の出力: NO_REVIEW: nullability-contract — null/undefined処理のTypeScript差分がない
False-positive guards / 抑制条件
What ships with it
6 files 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.
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.
- yesterday First seen · 93 lines · 24 tokens per session scan A 9f431abda97e
Nullability Contract Review is a skill published in the GitHub repository s977043/river-review (3 stars, last pushed today), licensed MIT. It adds 24 tokens to every session and 1,667 once invoked, about $0.0001 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
clean-code
Software quality review and design guidance for any code: naming, cohesion, coupling, duplication, function size, dependency direction, and testability. Use when someone asks to improve, review, refactor, or design code, or asks what good structure looks like here. Routes to the sub-skill matching the kind of work.
llm
AI features you ship to users: structured output, tool schemas, prompt injection, evals. Use when "the model returns bad JSON", "it hallucinates", "stop it calling the wrong tool", "add evals", or an LLM feature can trigger refunds, emails or writes. Covers schema-constrained output, idempotent tool calls…
logic-review
Find logic bugs in a single file or function via semi-formal execution tracing (Premises → Trace → Divergence → Trigger → Remedy). Trigger when a user shares code and suspects something is wrong without naming a concrete failure — phrases like "review this", "does this look right", "check this function", "audit this…
run-iteration-eval
Run the Logic-Lens content-eval pipeline for one iteration and produce a scored summary.json — use to measure a skill change. Wraps scripts/run-content-evals.sh (runner, costs tokens) and scripts/grade-iteration.py (grader, free, re-runnable). ALWAYS sync the plugin cache first. Use when the user wants to "run the…
sync-skill-cache
Sync the Logic-Lens working-copy skills/ into the installed plugin cache so content-evals test the EDITED skill, not the last published one. ALWAYS run this after editing any skills//SKILL.md or guide/shared file and BEFORE running content-evals — otherwise the eval silently grades stale content and every token is…
bump-version
Bump the Logic-Lens version across all six metadata locations at once (package.json, the four plugin manifests, and the README badge), then validate. Use when cutting a release or when npm run validate reports a version mismatch.