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 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/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/s977043/river-review/nullability-contract"><img src="https://agentmods.dev/badge/skills/s977043/river-review/nullability-contract.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.00024 | $0.01667 |
| Opus 5.5 | $0.00010 | $0.00667 |
| Sonnet 5.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 1mo 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 — 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.
- 1mo ago 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 (7 stars, last pushed yesterday), licensed MIT. It adds 24 tokens to every session and 1,667 once invoked, about $0.0001 per session on Opus 5.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
review-all
Multi-agent code review for diffs (project-agnostic). Covers standards, bugs, security, DRY, smells, perf, tests, API contracts, a11y/i18n. Verifies each finding to eliminate false positives. Use for /review-all, pre-PR/pre-commit review, or auditing uncommitted/staged changes.
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…
logic-fix-all
Autonomous repository-wide audit-and-fix pipeline: health → review → locate/explain → fix → diff-verify → iterate until clean. Starts with a mandatory consent prompt (token-intensive); after consent runs hands-free. Trigger when the user wants ALL logic issues found and fixed — "fix everything", "fix all logic…
logic-health
Sweep a directory, module, or full codebase for logic correctness and produce a scored health dashboard with systemic patterns. Trigger when the user requests a health view — "audit the whole codebase", "health check", "health overview", "logic health overview", "audit src/", "audit auth and payments modules", "where…
logic-locate
Locate the root cause of a CONFIRMED failure via backward-then-forward semi-formal tracing. Trigger when the user provides a stack trace, failing assertion, error message, or specific wrong-value observation — "find the bug", "this test is failing", "track down this crash", "why is this test failing", "KeyError at…
logic-explain
Explain what a specific piece of code actually does for a given input by producing a step-by-step execution trace (interprocedural, with name resolution and type transitions). Trigger when the user is confused about behavior or asks why code produces X instead of Y — "walk me through this", "trace through X with input…