convex-performance-audit
Convexアプリケーションの動作速度やコストを分析し、データの読み書き、通信量、実行制限などの問題点を特定・改善することで、アプリの性能を最適化するSkill。
📜 元の英語説明(参考)
Audits and optimizes Convex application performance across hot-path reads, write contention, subscription cost, and function limits. Use this skill when a Convex feature is slow or expensive, npx convex insights shows high bytes or documents read, OCC conflict errors or mutation retries appear, subscriptions or UI updates are costly, functions hit execution or transaction limits, or the user mentions performance, latency, read amplification, or invalidation problems in a Convex app.
🇯🇵 日本人クリエイター向け解説
Convexアプリケーションの動作速度やコストを分析し、データの読み書き、通信量、実行制限などの問題点を特定・改善することで、アプリの性能を最適化するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o convex-performance-audit.zip https://jpskill.com/download/19143.zip && unzip -o convex-performance-audit.zip && rm convex-performance-audit.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/19143.zip -OutFile "$d\convex-performance-audit.zip"; Expand-Archive "$d\convex-performance-audit.zip" -DestinationPath $d -Force; ri "$d\convex-performance-audit.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
convex-performance-audit.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
convex-performance-auditフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 6
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
[Skill 名] convex-performance-audit
Convex パフォーマンス監査
Convex アプリケーションのパフォーマンス問題を、問題クラスごとに診断し、修正します。
使用するタイミング
- Convex のページや機能が遅い、またはコストが高いと感じる場合
npx convex insights --detailsが高いバイト読み取り数、ドキュメント読み取り数、または OCC 競合を報告する場合- 鮮度の低い読み取りパスが、ポイントインタイム読み取りで十分な場所でリアクティビティを使用している場合
- OCC 競合エラーまたは過剰なミューテーションリトライが発生する場合
- サブスクリプション数が多い、または UI の更新が遅い場合
- 関数が実行またはトランザクションの制限に近づいている場合
- 同じパフォーマンスパターンを兄弟関数全体で修正する必要がある場合
使用しないタイミング
- 初期の Convex セットアップ、認証セットアップ、またはコンポーネントの抽出
- パフォーマンス目標のない純粋なスキーマ移行
- ユーザーまたはデプロイメントで目に見える問題がない、一度限りのマイクロ最適化
ガードレール
- スケールが小さい、トラフィックが控えめ、または利用可能なシグナルが弱い場合は、よりシンプルなコードを優先してください。
- 測定されたシグナル、明確に無制限なパス、または既知のホットな読み取り/書き込みパスがない限り、ダイジェストテーブル、ドキュメント分割、フェッチ戦略の変更、または移行を伴うロールアウトを推奨しないでください。
- Convex では、小さなテーブルでの単純なスキャンは許容されることがよくあります。大規模なパターンが理想的ではないという理由だけで、構造的な作業を考案しないでください。
最初の手順: シグナルを収集する
利用可能な最も強力なシグナルから始めます。
- ユーザーまたは現在のコンテキストからデプロイメントの Health insights がすでに利用可能な場合は、それらをパフォーマンスシグナルの第一級の情報源として扱います。
- CLI insights が利用可能な場合は、
npx convex insights --detailsを実行します。必要に応じて--prod、--preview-name、または--deployment-nameを使用します。- ローカルリポジトリの Convex CLI が
insightsをサポートするには古すぎる場合は、諦める前にnpx -y convex@latest insights --detailsを試してください。
- ローカルリポジトリの Convex CLI が
- リポジトリがすでに
convex-doctorを使用している場合は、その結果をヒントとして扱っても構いません。それを必須とせず、真実の情報源として扱わないでください。 - ランタイムシグナルが利用できない場合でも、コードから監査しますが、上記のガードレールを念頭に置いてください。インサイトの欠如は健全性の証明ではありませんが、大規模なリファクタリングが正当化される証明でもありません。
シグナルルーティング
シグナルを収集した後、問題クラスを特定し、対応する参照ファイルを読み取ります。
| シグナル | 参照 |
|---|---|
| 高いバイト数またはドキュメント読み取り数、JS フィルタリング、不要な結合 | references/hot-path-rules.md |
| OCC 競合エラー、書き込み競合、ミューテーションリトライ | references/occ-conflicts.md |
| 高いサブスクリプション数、遅い UI 更新、過剰な再レンダリング | references/subscription-cost.md |
| 関数タイムアウト、トランザクションサイズエラー、大きなペイロード | references/function-budget.md |
| 特定のシグナルがない一般的な「遅い」 | references/hot-path-rules.md から始める |
複数の問題クラスが重複する可能性があります。最も関連性の高い参照を最初に読み、症状が残る場合は他の参照を確認してください。
大規模な修正のエスカレーション
考えられる修正が侵襲的、横断的、または移行を伴うものである場合は、編集する前に停止してオプションを提示してください。
例:
- 複数のフローにわたるダイジェストテーブルまたはサマリーテーブルの導入
- 頻繁に更新されるフィールドを分離するためのドキュメントの分割
- 複数の画面にわたるページネーションまたはフェッチ戦略の再構築
- 移行安全なロールアウトが必要な新しいインデックスまたは非正規化フィールドへの切り替え
ロールアウト中に古い状態と新しい状態の処理に正確性が依存する場合は、移行ワークフローについて skills/convex-migration-helper/SKILL.md を参照してください。
ワークフロー
1. 問題の範囲を特定する
実際のプロジェクトから具体的なユーザーフローを1つ選択します。コードベース、クライアントページ、API サーフェスを見て、症状に一致するフローを見つけます。
以下を書き留めます。
- エントリポイント関数
useQuery、usePaginatedQuery、またはuseMutationを使用するクライアントの呼び出しサイト- 読み取られるテーブル
- 書き込まれるテーブル
- パスが高読み取り、高書き込み、またはその両方であるかどうか
2. 完全な読み取りセットと書き込みセットをトレースする
パス内の各関数について:
- すべての
ctx.db.get()とctx.db.query()をトレースします。 - すべての
ctx.db.patch()、ctx.db.replace()、およびctx.db.insert()をトレースします。 - 外部キーのルックアップ、JS 側のフィルタリング、および完全なドキュメントの読み取りに注意します。
- 同じテーブルに触れるすべての兄弟関数を特定します。
- 同じページにレンダリングされるリアクティブな統計、集計、またはウィジェットを特定します。
Convex では、余分な読み取りはすべてトランザクション作業を増加させ、すべての書き込みはリアクティブなサブスクライバーを無効にする可能性があります。読み取り増幅と無効化増幅を第一級の問題として扱います。
3. 関連する参照から修正を適用する
問題クラスに一致する参照ファイルを読みます。各参照には、特定のパターン、コード例、および推奨される修正順序が含まれています。
インサイトによって指定された単一の関数で止まらないでください。同じテーブルに触れる兄弟の読み取り元と書き込み元をトレースします。
4. 兄弟関数をまとめて修正する
テーブルに触れる1つの関数にパフォーマンスバグがある場合、同じパターンについて兄弟関数を監査します。
1つの問題を発見した後、同じテーブルファミリーの兄弟の読み取り元と兄弟の書き込み元を検査します。これには、付随するダイジェストテーブルやサマリーテーブルも含まれます。
例:
- あるリストクエリが完全なドキュメントからダイジェストテーブルに切り替わる場合、そのテーブルの他のリストクエリを検査します。
- あるミューテーションに no-op 書き込み保護が必要な場合、同じテーブルへの他の書き込み元を検査します。
- ある読み取りパスに、バックフィルされていないフィールドの移行安全なロールアウトが必要な場合、同じロールアウトリスクについて兄弟の読み取り元を検査します。
明確な製品上の理由がない限り、一方のパスを修正し、もう一方のパスを古いパターンのままにしないでください。
5. 完了する前に検証する
これらすべてを確認します。
- 結果は以前と同じであり、レコードの欠落はありません。
- 削除された読み取りまたは書き込みは、期待されるパスに存在しなくなっています。
- 非正規化されたフィールドまたはインデックス付きフィールドが欠落している場合、フォールバック動作が機能します。
- データが変更されていない場合、新しい書き込みは不要な無効化を回避します。
- 元の関数だけでなく、関連するすべての兄弟の読み取り元と書き込み元が検査されました。
参照ファイル
references/hot-path-rules.md- 読み取り増幅、無効化、非正規化、インデックス、ダイジェストテーブル- `referenc
(原文がここで切り詰められています)
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Convex Performance Audit
Diagnose and fix performance problems in Convex applications, one problem class at a time.
When to Use
- A Convex page or feature feels slow or expensive
npx convex insights --detailsreports high bytes read, documents read, or OCC conflicts- Low-freshness read paths are using reactivity where point-in-time reads would do
- OCC conflict errors or excessive mutation retries
- High subscription count or slow UI updates
- Functions approaching execution or transaction limits
- The same performance pattern needs fixing across sibling functions
When Not to Use
- Initial Convex setup, auth setup, or component extraction
- Pure schema migrations with no performance goal
- One-off micro-optimizations without a user-visible or deployment-visible problem
Guardrails
- Prefer simpler code when scale is small, traffic is modest, or the available signals are weak
- Do not recommend digest tables, document splitting, fetch-strategy changes, or migration-heavy rollouts unless there is a measured signal, a clearly unbounded path, or a known hot read/write path
- In Convex, a simple scan on a small table is often acceptable. Do not invent structural work just because a pattern is not ideal at large scale
First Step: Gather Signals
Start with the strongest signal available:
- If deployment Health insights are already available from the user or the current context, treat them as a first-class source of performance signals.
- If CLI insights are available, run
npx convex insights --details. Use--prod,--preview-name, or--deployment-namewhen needed.- If the local repo's Convex CLI is too old to support
insights, trynpx -y convex@latest insights --detailsbefore giving up.
- If the local repo's Convex CLI is too old to support
- If the repo already uses
convex-doctor, you may treat its findings as hints. Do not require it, and do not treat it as the source of truth. - If runtime signals are unavailable, audit from code anyway, but keep the guardrails above in mind. Lack of insights is not proof of health, but it is also not proof that a large refactor is warranted.
Signal Routing
After gathering signals, identify the problem class and read the matching reference file.
| Signal | Reference |
|---|---|
| High bytes or documents read, JS filtering, unnecessary joins | references/hot-path-rules.md |
| OCC conflict errors, write contention, mutation retries | references/occ-conflicts.md |
| High subscription count, slow UI updates, excessive re-renders | references/subscription-cost.md |
| Function timeouts, transaction size errors, large payloads | references/function-budget.md |
| General "it's slow" with no specific signal | Start with references/hot-path-rules.md |
Multiple problem classes can overlap. Read the most relevant reference first, then check the others if symptoms remain.
Escalate Larger Fixes
If the likely fix is invasive, cross-cutting, or migration-heavy, stop and present options before editing.
Examples:
- introducing digest or summary tables across multiple flows
- splitting documents to isolate frequently-updated fields
- reworking pagination or fetch strategy across several screens
- switching to a new index or denormalized field that needs migration-safe rollout
When correctness depends on handling old and new states during a rollout, consult skills/convex-migration-helper/SKILL.md for the migration workflow.
Workflow
1. Scope the problem
Pick one concrete user flow from the actual project. Look at the codebase, client pages, and API surface to find the flow that matches the symptom.
Write down:
- entrypoint functions
- client callsites using
useQuery,usePaginatedQuery, oruseMutation - tables read
- tables written
- whether the path is high-read, high-write, or both
2. Trace the full read and write set
For each function in the path:
- Trace every
ctx.db.get()andctx.db.query() - Trace every
ctx.db.patch(),ctx.db.replace(), andctx.db.insert() - Note foreign-key lookups, JS-side filtering, and full-document reads
- Identify all sibling functions touching the same tables
- Identify reactive stats, aggregates, or widgets rendered on the same page
In Convex, every extra read increases transaction work, and every write can invalidate reactive subscribers. Treat read amplification and invalidation amplification as first-class problems.
3. Apply fixes from the relevant reference
Read the reference file matching your problem class. Each reference includes specific patterns, code examples, and a recommended fix order.
Do not stop at the single function named by an insight. Trace sibling readers and writers touching the same tables.
4. Fix sibling functions together
When one function touching a table has a performance bug, audit sibling functions for the same pattern.
After finding one problem, inspect both sibling readers and sibling writers for the same table family, including companion digest or summary tables.
Examples:
- If one list query switches from full docs to a digest table, inspect the other list queries for that table
- If one mutation needs no-op write protection, inspect the other writers to the same table
- If one read path needs a migration-safe rollout for an unbackfilled field, inspect sibling reads for the same rollout risk
Do not leave one path fixed and another path on the old pattern unless there is a clear product reason.
5. Verify before finishing
Confirm all of these:
- Results are the same as before, no dropped records
- Eliminated reads or writes are no longer in the path where expected
- Fallback behavior works when denormalized or indexed fields are missing
- New writes avoid unnecessary invalidation when data is unchanged
- Every relevant sibling reader and writer was inspected, not just the original function
Reference Files
references/hot-path-rules.md- Read amplification, invalidation, denormalization, indexes, digest tablesreferences/occ-conflicts.md- Write contention, OCC resolution, hot document splittingreferences/subscription-cost.md- Reactive query cost, subscription granularity, point-in-time readsreferences/function-budget.md- Execution limits, transaction size, large documents, payload size
Also check the official Convex Best Practices page for additional patterns covering argument validation, access control, and code organization that may surface during the audit.
Checklist
- [ ] Gathered signals from insights, dashboard, or code audit
- [ ] Identified the problem class and read the matching reference
- [ ] Scoped one concrete user flow or function path
- [ ] Traced every read and write in that path
- [ ] Identified sibling functions touching the same tables
- [ ] Applied fixes from the reference, following the recommended fix order
- [ ] Fixed sibling functions consistently
- [ ] Verified behavior and confirmed no regressions
同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (7,541 bytes)
- 📎 assets/icon.svg (490 bytes)
- 📎 references/function-budget.md (7,416 bytes)
- 📎 references/hot-path-rules.md (10,910 bytes)
- 📎 references/occ-conflicts.md (4,906 bytes)
- 📎 references/subscription-cost.md (9,830 bytes)