Existing-Pattern Conformance 既存パターン準拠の確認

Existing-Pattern Conformance 既存パターン準拠の確認 is a skill for Claude Code from s977043/river-review. It costs 105 tokens per session (2,627 once invoked), scanned A, original, MIT.

A review check that compares new code with an existing implementation serving the same purpose. It looks for missing or conflicting validation, protection, error handling, shared rules, and definitions that the earlier code already established.

In plain words
What is it for?
Use it when adding or changing code in an area with a comparable existing implementation. It helps identify the earlier pattern and compare the new code against it.
Why use it?
It helps prevent duplicated code from drifting apart or omitting safeguards that already exist elsewhere. It also reduces inconsistent behavior across similar parts of a project.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the river-review plugin — 139 skills, 18 commands, 5 agents, 3 hooks shipped together

Good fit Use it when adding or changing code in an area with a comparable existing implementation. It helps identify the earlier pattern and compare the new code against it.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/s977043/river-review/existing-pattern-conformance
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 s977043/river-review --skill existing-pattern-conformance
Clone the repo
git clone --depth 1 https://github.com/s977043/river-review

Made for: Claude Code.

Or install river-review, the plugin that ships this one along with the rest of its 139 skills, 18 commands, 5 agents, 3 hooks.

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 Existing-Pattern Conformance 既存パターン準拠の確認

README.md
[![agentmods](https://agentmods.dev/badge/skills/s977043/river-review/existing-pattern-conformance/github.svg)](https://agentmods.dev/skills/s977043/river-review/existing-pattern-conformance)
Your own site
<a href="https://agentmods.dev/skills/s977043/river-review/existing-pattern-conformance"><img src="https://agentmods.dev/badge/skills/s977043/river-review/existing-pattern-conformance/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 Existing-Pattern Conformance 既存パターン準拠の確認

Your own site · 80×15
<a href="https://agentmods.dev/skills/s977043/river-review/existing-pattern-conformance"><img src="https://agentmods.dev/badge/skills/s977043/river-review/existing-pattern-conformance.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 105 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,627 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.00105 $0.02627
Opus 5.5 $0.00042 $0.01051
Sonnet 5.5 $0.00021 $0.00525
Haiku 4.5 $0.00011 $0.00263

Measured 1mo ago against content hash ee8efff6d6b5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

Existing-Pattern Conformance 既存パターン準拠の確認 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.

skills/midstream/existing-pattern-conformance/SKILL.md · 103 lines

How it starts

The opening of the file, as written. The whole thing — 103 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: 先行実装との突合は grep による決定論的特定が主だが、同種の先行実装が存在しない新規領域では実行を止めるゲートが必要。

Goal / 目的

  • 新しい追加 / 変更が、同種の先行実装をまず grep で特定し、そこに在る防御・バリデーション・エラー処理・定数 / 規約・共通化ロジック・概念定義を欠落・重複・食い違いなく継承しているかを確認する。
  • 「既存に同じことをする実装があるのに、それを参照せず独自に書いて防御やバリデーションが抜けた / 重複した / 規約から外れた」パターンを検出する。

外部実証: 「CodeGraph(AI向け効率化ツール)は「間接呼び出しの見落とし」を防ぐ。でも、自分たちのレビューが長引いた原因はそれじゃなかった」(TheGateBreaker, 2026-07-30)は、重複ロジック 4 箇所に対するコールグラフツールの適用結果を報告します。検出できたのは中心関数を直接呼び出していた 2 箇所のみでした。残る 2 箇所は同じ判定条件をそれぞれの場所で独立に再実装しており、呼び出し関係が無いためコールグラフ上では中心関数とつながっていませんでした。著者は間接呼び出しの見落としと独立した重複を別の障害モードと位置づけ、重複が疑われる場合はまず grep で確認する従来手順を維持しています。この実測は、先行実装を grep で特定してから突合するという本スキルの検出ロジックを裏付ける一次データとして参照できます。

Non-goals / 扱わないこと

  • 設計の良し悪しそのもの(既存が間違っていれば従う必要はない。意図的差分は根拠の明文で許容)。
  • リファクタ後の caller 残骸(cross-file-leakage の領域)。
  • 宣言と実装の自己矛盾(self-contradiction の領域)。

Pre-execution Gate / 実行前ゲート

このスキルは以下の条件がすべて満たされない限り NO_REVIEW を返す。

  • 差分に、リポジトリ内で同レイヤ・同責務・同概念の先行実装が grep で実在確認できる追加 / 変更を含む(防御・バリデーション・エラー処理・規約・共通化ロジック・概念定義を持つ同種コード / 設計 / migration)。「存在しうる」という推測では発火させず、先行実装を grep で1件以上特定できたときのみレビューに進む
  • inputContext に diff が含まれ、code_search(grep)が利用可能である

ゲート不成立時の出力: NO_REVIEW: existing-pattern-conformance — 先行実装と突合すべき変更が検出されない

False-positive guards / 抑制条件

  • grep で同種の先行実装が見つからない(真に新規領域)の場合は指摘しない。
  • grep ヒットが同名でも、別スコープ・別責務・別概念であれば「先行実装」ではない。同名の関数 / 定数 / 型でも、別レイヤ・別ドメイン・別用途なら突合対象から除外する。同レイヤ・同責務・同概念であることを確認できた先行実装のみを参照とする(同名・文字列一致だけを根拠に「先行はこうしている」と断定してはならない)。
  • 既存パターンから外れることが差分内で根拠とともに明記されている場合は抑制(意図的な逸脱)。
  • 既存実装側が deprecated / 移行中で、新実装が新方針に従っている場合は抑制。
  • 整形 SSoT(フォーマッタ)管理下の空白・列整列・末尾スペースは指摘しない(#1451)。表の列幅ズレ・末尾スペース調整・インデント整列など prettier / フォーマッタが決める体裁は、npx prettier --check <file> が通る限り正典であり、手動整形の提案はかえって整形結果を壊す。整形の指摘前に prettier --check の結果を確認する(整形は lint の領域で、本スキルはロジック・規約の継承に集中する)。
  • 型検査対象外の scripts/ 配下で、JSDoc の unknown を any へ緩める提案はしない(#1476)。scripts/ 配下は runners/node-api/tsconfig.json の include(src/ 以下のみ)に含まれず tsc の型検査対象外であり、JSDoc の型注釈はエディタ表示補助のための文書目的に留まる。unknown は呼び出し側にプロパティアクセス前の絞り込みを強制する意図的で保守的な選択である。同レイヤの先行実装(scripts/validate-agent-skills.mjs の @param {unknown} value / @returns の applyTo: unknown 等)も同じ規約に従っている。「any にすれば静的解析エラーを避けられ DX が上がる」という理由での変更提案は、型安全性を後退させたうえ既存パターンからも逸脱するため指摘しない。

Read the full file on GitHub · 103 lines

Files

What ships with it

2 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.

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. 1mo ago First seen · 103 lines · 105 tokens per session scan A ee8efff6d6b5

Subscribe to this mod's changes

Existing-Pattern Conformance 既存パターン準拠の確認 is a skill published in the GitHub repository s977043/river-review (7 stars, last pushed today), licensed MIT. It adds 105 tokens to every session and 2,627 once invoked, about $0.0004 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.

Related

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.

ncoevoet/claude-review-all · 74 tokens

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…

hyhmrright/logic-lens · 161 tokens

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…

hyhmrright/logic-lens · 211 tokens

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…

hyhmrright/logic-lens · 180 tokens

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…

hyhmrright/logic-lens · 177 tokens

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…

hyhmrright/logic-lens · 171 tokens