river-review-performance
パフォーマンス観点のレビューエージェント。 N+1クエリ、メモリ効率、キャッシュ戦略、可観測性の観点でコード変更を評価する。
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 1.6k
- Forks
- 491
01 前言 Front Matter
- id
- river-review-performance
- name
- river-review-performance
- tags
- [ "performance", "optimization", "entry", "routing" ]
- phase
- [ "midstream" ]
- applyTo
- [ "src/**/*.{ts,tsx,js,jsx,mjs,cjs,html,css}", "app/**/*.{ts,tsx,js,jsx,mjs,cjs,html,css}", "components/**/*.{ts,tsx,js,jsx,html,css}", "pages/**/*.{ts,tsx,js,jsx,html,css}", "lib/**/*.{ts,tsx,js,jsx,mjs,cjs}", "packages/**/*.{ts,tsx,js,jsx,mjs,cjs}", "styles/**/*.css", "public/**/*.html", "**/*.sql" ]
- license
- MIT
- version
- 0.1.0
- category
- midstream
- severity
- major
- outputKind
- [ "findings", "actions" ]
- description
- パフォーマンス観点のレビューエージェント。 N+1クエリ、メモリ効率、キャッシュ戦略、可観測性の観点でコード変更を評価する。
- inputContext
- [ "diff", "fullFile" ]
- applyToExemptions
- [ { "skill": "cache-strategy-consistency", "reason": "参照のみ。cache-strategy-consistency は docs 向け設計文書レビュー(phase upstream、applyTo が docs/**/*.md 等のみ)で、code/sql 実行観点の本エントリ(phase midstream)とはドメインが異なる。実行は river-review-architecture に据置く(本 SKILL.md「cache-strategy-consistency の帰属について」)。本エントリの applyTo には含めない。" }, { "skill": "operability-slo", "reason": "参照のみ。実行は river-review-architecture に据置く(ドメイン不一致。operability-slo は upstream/docs 系、本エントリは midstream/code 系。architecture 経由で完全到達済み)。cache-strategy-consistency exemption(#1522)の様式を踏襲。" } ]
02 资源文件 1
- 参考文档references/ROUTING.md1.7 KB
03 SKILL.md 正文
Performance Review(パフォーマンスレビュー)
パフォーマンスに影響する変更を検出し、適切な個別スキルで検証する。
When to Use / いつ使うか
- データベースクエリの追加・変更時
- ループ処理やバッチ処理の変更時
- キャッシュ戦略の変更時
- 大量データの処理ロジック変更時
Routing / ルーティング
| キーワード | スキルID | 説明 |
|---|---|---|
| キャッシュ, TTL | cache-strategy-consistency |
参照のみ。実行は river-review-architecture(理由) |
| 障害, 監視, メトリクス | failure-modes-observability |
障害モードと可観測性 |
| ログ, トレース | logging-observability |
ロギング・可観測性 |
| SLO, レイテンシ | operability-slo |
運用性・SLO |
cache-strategy-consistency の帰属について
cache-strategy-consistency はキャッシュ戦略という語感から performance の懸念に見えるが、実体は設計ドキュメント(docs/spec/RFC 等)のキャッシュ戦略記述をレビューする upstream スキル(applyTo が docs/**/*.md 等の docs 系のみ、Pre-execution Gate も「差分に設計ドキュメントの変更がある」ことを要求)である。本エントリ(phase midstream、applyTo が code/sql)とはドメインが異なるため、ドメイン一貫性を優先し実行は river-review-architecture(phase upstream、docs 系 applyTo を保有)に据え置く。本表には到達性のための参照行として掲載するのみで、performance 側に重複するアクティブなキーワードルートは追加しない。
デフォルト動作
- キーワード指定なし → 以下のヒューリスティクスで判定:
- ループ内I/O → N+1クエリ検出
- 大量データ処理 → メモリ効率チェック
- 外部API呼び出し → タイムアウト・リトライ検証
Execution Flow / 実行フロー
1. 変更内容の分析
├─ ループ内I/O → N+1クエリ検出を優先
├─ 大量データ処理 → メモリ効率チェックを優先
├─ 外部API呼び出し → タイムアウト・リトライ検証を優先
└─ キーワード指定あり → 該当スキルを直接選択
2. スキルの実行
├─ cache-strategy-consistency: キャッシュ戦略の一貫性
├─ failure-modes-observability: 障害モードと可観測性
├─ logging-observability: ロギング・可観測性
└─ operability-slo: 運用性・SLO
3. 統合
├─ 重複する指摘の除去
└─ Checklistに基づくパフォーマンスチェックの補完
Checklist / チェックリスト
パフォーマンスレビューでは以下を確認する:
クエリ効率
- N+1クエリが発生していないか
- 必要なeager loadingが設定されているか
- 不要なカラムを取得していないか(SELECT *)
メモリ効率
- ループ内での不要なオブジェクト生成がないか
- 大量データのストリーム処理が適切か
- メモリリークのパターンがないか
I/O効率
- 外部API呼び出しのタイムアウト設定
- リトライ戦略の妥当性
- 並列化可能なI/Oの逐次実行
キャッシュ
- キャッシュキーの設計が適切か
- TTLが妥当か
- キャッシュの無効化戦略
Output Format / 出力形式
<file>:<line>: <message>
- Finding: 何が問題か(1文)
- Impact: 推定される影響(レイテンシ増加、メモリ消費等)
- Fix: 次の一手(最小の修正案)
他スキルとの関係
| スキル | 関係 | 棲み分け |
|---|---|---|
river-review-architecture |
補完 | performance は「実行時効率」、architecture は「構造的スケーラビリティ」 |
river-review-code |
補完 | performance は「速度・効率」、code は「可読性・保守性」 |
References
- ROUTING.md: 詳細なルーティングルール
04 同仓库更多 Skills
worktable-review-with-annotations
Create, inspect, reply to, update, or resolve situated Worktable annotations. Use when feedback belongs to a Doc section, block, text range, or HTML Doc, or when the user asks to address existing review feedback and coordinate a requested artifact edit.
worktable-find-and-synthesize-context
Find, assess, and synthesize context from Worktable Docs and Records. Use when the user asks what a workspace contains, wants workspace-backed research, needs current facts reconciled across artifacts, or requests a cited synthesis without changing workspace state.
worktable-create-or-update-docs
Create, edit, rename, or maintain narrative Worktable Docs. Use for plans, decisions, briefs, notes, research syntheses, and other durable prose when the user requests a new artifact or a safe update to an existing one.
worktable-create-or-manage-records
Organize repeated structured information as durable Worktable Records. Use for research datasets, inventories, directories, pipelines, trackers, and other collections whose items need identity, fields, filtering, links, validation, or individual updates.
worktable-create-or-manage-interactive-html
Create or improve durable visual and interactive artifacts in Worktable. Use for dashboards, trackers, calculators, mini apps, slide presentations, and other requests that benefit from a polished HTML Doc.
worktable-collaborate-threads
Read, answer, and hand off messages through durable Worktable threads with users or other authenticated participants. Use when the user asks to check addressed messages, reply to a participant, continue a thread, request another agent's help, wait briefly for a response, or watch for comments and messages sent to the agent.