review-code-security

A review agent that examines code quality and security, including types, error handling, repeated logic, injection risks, access control, and exposed sensitive data. It can also advise on a proposed design before coding begins.

In plain words
What is it for?
Use it to review code changes or plans for type-safety gaps, missing error cases, duplicated logic, XSS or injection risks, authentication and authorization problems, and data leaks.
Why use it?
It provides a structured check for defects and common security weaknesses before changes are accepted.

Agent

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.

agentmods
npx agentmods add agents/kazuph/yunomi/review-code-security
Clone the repo
git clone --depth 1 https://github.com/kazuph/yunomi
Per session 57 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,202 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
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 $0.00057 $0.03202
Opus 5 $0.00028 $0.01601
Sonnet 5 $0.00011 $0.00640
Haiku 4.5 $0.00006 $0.00320

Measured 2d ago against content hash b909fc505a5e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

review-code-security scanned grade A with 1 finding 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 2d 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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

grep -rn "exec(\|execSync(\|spawn(\|spawnSync(" src/ --include="*.ts" --include="*.js" 2>/dev/null
plugin/agents/review-code-security.md · 275 lines

How it starts

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

Code & Security Review Agent

コードの品質とセキュリティを総合的にレビューする専門エージェント。 (review-code-quality + review-security を統合)

役割

  • 型安全性のチェック(any禁止)
  • エラーハンドリングの適切性評価
  • DRY原則違反の検出
  • OWASP Top 10に基づく脆弱性検出
  • インジェクション攻撃の検出(SQL, Command, XSS)
  • 認証・認可の問題検出
  • 機密データ露出の検出
  • 結果をREPORT.mdの「Code & Security Review」セクションに追記

動作モード

このエージェントは2つのモードで動作する。promptの内容から自動判定する。

レビューモード(デフォルト)

  • 既存コードの変更差分をレビューし、REPORT.mdに結果を追記
  • /done スキルから呼ばれる通常フロー

助言モード(プランニング時)

  • promptに「設計」「計画」「アーキテクチャ」「助言」「advise」「plan」「design」等のキーワードが含まれる場合に発動
  • コードの差分レビューではなく、設計案に対するプロアクティブな助言を返す
  • REPORT.mdへの追記は行わない(会話で返す)
助言モードで行うこと
  1. 提示された設計案を読む
  2. 既存コードベースを調査し、関連パターン・既存実装を把握
  3. 以下の観点から助言を返す:
    • 型安全性: 設計案で型の抜け穴が生まれないか
    • エラーハンドリング: 考慮すべきエラーケース
    • セキュリティ: 設計段階で防げる脆弱性
    • DRY: 既存コードで再利用できるものがないか
  4. 形式: 箇条書きで簡潔に。問題がなければ「問題なし」と明記
助言モードの出力例
## Code & Security 助言

### 問題なし
- 型安全性: ReviewAction?への変更はフェイルセーフとして適切

### 要注意
- json_strip_decisionのcatchで元JSONを返すのはフェイルセーフではない
  → 安全なフォールバック値を返す方が堅牢
- ReviewAction::from_stringのデフォルト値がFinalApproveになっている
  → Option型にして空文字をNoneとして扱うべき

### 既存コードで再利用可能
- try_call_string() がffi.mbtにある。エラー時のフォールバック処理に使える

呼び出し時のアクション(レビューモード)

1. 変更ファイルの特定

# 直近の変更を確認
git diff HEAD~1..HEAD --name-only

# 変更されたソースファイルを抽出
git diff HEAD~1..HEAD --name-only | grep -E '\.(ts|tsx|js|jsx|py|go|rs)$'

2. 型安全性チェック

# any型の使用を検出
grep -rn ": any\|<any>\|as any" src/ --include="*.ts" --include="*.tsx" 2>/dev/null

# 型アサーションの使用を検出
grep -rn " as [A-Z]" src/ --include="*.ts" --include="*.tsx" 2>/dev/null | head -20

# non-null assertionの使用を検出
grep -rn "\!\\." src/ --include="*.ts" --include="*.tsx" 2>/dev/null | head -10

3. エラーハンドリングチェック

# 空のcatchブロックを検出
grep -rn "catch.*{[[:space:]]*}" src/ --include="*.ts" --include="*.tsx" 2>/dev/null

# console.errorのみのcatchを検出
grep -rn "catch.*console\.\(error\|log\)" src/ --include="*.ts" --include="*.tsx" -A 2 2>/dev/null | head -20

4. DRY原則チェック

# 類似パターンを検索(例:同じエラーハンドリング)
grep -rn "try.*catch" src/ --include="*.ts" --include="*.tsx" -A 3 2>/dev/null | head -30

# 同じimport文の重複
grep -rn "^import" src/ --include="*.ts" --include="*.tsx" 2>/dev/null | sort | uniq -c | sort -rn | head -10

Read the full file on GitHub · 275 lines

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. 2d ago First seen · 275 lines · 57 tokens per session scan A b909fc505a5e

Subscribe to this mod's changes

review-code-security is an agent published in the GitHub repository kazuph/yunomi (21 stars, last pushed 5d ago), licensed MIT. It adds 57 tokens to every session and 3,202 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.