performance-optimization
Skill1 starsChanged 6 months agoMITView on GitHub
アプリケーションの性能問題を計測ファーストで特定・改善するスキル。「遅い」「重い」「タイムアウトが多発する」など性能要件を満たせていないときや、リリース前の負荷試験を実施するときに使う。
83 other projects use a version of this.
Adopted by
Most recently taken up by
- Lukk17/agent-standardstheir own version, first seen Oct 5, 2026
- GuillemRoca/agent-skills-androidtheir own version, first seen Oct 3, 2026
- addyosmani/agent-skillstheir own version, first seen Oct 3, 2026
- weisser-dev/agentic-skillstheir own version, first seen Oct 3, 2026
- Rvey/agent-engineering-kittheir own version, first seen Oct 1, 2026
- JPeetz/agent-skillstheir own version, first seen Sep 29, 2026
Used with
Projects with it also use constraint-driven-development, using-agent-skills and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
vinvcnSkillconstraint-driven-development
把一个项目的质量线确立为书面契约,并阻止 agent 悄悄降低它。通过访谈确定用户在意哪些维度,当用户心里没有数字时提供合理的默认阈值,把一切记录进 CONSTRAINTS.md,并盯住 diff 中质量线被削弱的迹象——新增的 @ts-ignore 或 eslint-disable 抑制注释、被跳过或删除的测试、被剥掉的断言、未实现的 stub、被调低的阈值。当没有任何质量线被写下来时使用;当用户说 "set up constraints" 或 "define our standards" 时;当用户希望把他们在意的维度——无障碍性、Web 性能、覆盖率——设置成被强制执行的约束时;当 agent 为了变绿不断静默检查或跳过测试时;当你需要一个覆盖率或性能阈值却不知道该选什么数字时;或者当 agent 写下的代码超出任何人会读的体量时。
Also in 4 projects that use this
LLl0k0laDSkillusing-agent-skills
Use when starting a session or when you need to discover which skill applies to the current task. This is the meta-skill that governs how all other skills are discovered and invoked.
Also in 21 projects that use this
LLl0k0laDSkillgit-workflow-and-versioning
Use when making any code change. Use when committing, branching, resolving conflicts, or when you need to organize work across multiple parallel streams.
Also in 23 projects that use this
borhen68Skillobservability-and-instrumentation
Instruments code so production behavior is visible and diagnosable. Use when adding logging, metrics, tracing, or alerting. Use when shipping any feature that runs in production and you need evidence it works. Use when production issues are reported but you can't tell what happened from the available data.
Also in 12 projects that use this
az9713Skilldeprecation-and-migration
Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when deciding whether to maintain or sunset existing code.
Also in 21 projects that use this
az9713Skillcode-simplification
Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is harder to read, maintain, or extend than it should be. Use when reviewing code that has accumulated unnecessary complexity.
Also in 29 projects that use this
- +6 more from LLl0k0laD
Other versions83 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 83
- addyosmani/agent-skills★ 101ksame name
- rohitg00/awesome-claude-code-toolkit★ 2.7ksame name
- gamedev-skills/awesome-gamedev-agent-skills★ 1.3ksame name
- ukanwat/overtime★ 387same name
- Mindrally/skills★ 266same name
- shashankswe2020-ux/whoop-mcp★ 165same name
- magnus919/agent-skills★ 109same name
- thiientv/godmode★ 96same name
- dylantarre/animation-principles★ 94same name
- DevelopersGlobal/ai-agent-skills★ 69same name
73 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository42 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- accessibilitySkill
- analytics-kpiSkill
- api-designSkill
- architecture-designSkill
- cicd-deploymentSkill
- codebase-explorationSkill
- code-reviewSkill
- database-designSkill
- debuggingSkill
- decision-makingSkill
- detailed-designSkill
- documentationSkill
- estimationSkill
- git-workflowSkill
- growth-launchSkill
- i18n-localizationSkill
- idea-generationSkill
- implementationSkill
- legal-complianceSkill
- llm-integrationSkill
- market-researchSkill
- microservicesSkill
- mobile-app-releaseSkill
- monetizationSkill
- monitoring-operationsSkill
- mvp-developmentSkill
- non-functional-requirementsSkill
- orchestrationSkill
- project-managementSkill
- refactoringSkill
- requirements-definitionSkill
- screen-designSkill
- securitySkill
- session-handoffSkill
- skill-authoringSkill
- skill-navigatorSkill
- solo-developmentSkill
- task-breakdownSkill
- task-executionSkill
- testingSkill
- ux-researchSkill
The file
Files
パフォーマンス最適化
目的
計測に基づいて真のボトルネックを特定し、最小限の変更で性能目標を達成する。 推測による場当たり的な改修を排除し、施策の効果を定量的に検証する。
使うタイミング
- レスポンスタイム・スループット・エラーレートが[[non-functional-requirements]]で定めた目標値を下回るとき
- 本番でスロークエリ・タイムアウト・OOMが頻発しているとき
- リリース前に想定ピーク負荷への耐性を確認したいとき
- コードレビューや[[refactoring]]の際に性能リグレッションの懸念が生じたとき
鉄則
- 推測するな、計測せよ — 「たぶんここが遅い」で改修しない。必ずプロファイラ・APMのデータを根拠にする
- 目標なき最適化はしない — [[non-functional-requirements]]で合意した数値目標(例: p95 < 200ms)が起点。目標達成後は止める
- 早すぎる最適化は諸悪の根源 — まず動くものを作り、遅い場所だけ直す
- 1施策ずつ適用して前後比較 — 複数施策を同時に当てると効果の切り分けができなくなる
- 本番相当の環境・データ量で計測 — 開発環境の少量データでは性能問題は再現しない
- 平均でなくパーセンタイルで見る — p50だけでなくp95/p99を必ず確認する
進め方
- 目標の確認 — [[non-functional-requirements]]から計測対象のKPI(レイテンシ/スループット/エラーレート)と目標値を確認する
- 計測環境の整備 — 本番相当のデータ量・負荷を再現できる環境を用意する
- ベースライン計測 — プロファイラ・APM・負荷テストツールで現状を数値化する(p50/p95/p99を記録)
- ボトルネック特定 — フレームグラフ・スロークエリログ・EXPLAINの結果から最大のボトルネックを1つ特定する
- 施策の立案と優先順位付け — 改善インパクト・実装コスト・リスクで施策を並べる
- 1施策を実装 — 最優先の施策を実装する([[implementation]]参照)
- 再計測・前後比較 — 同条件で再計測し、ベースラインと比較する
- 目標達成の判定 — 達成なら終了。未達なら次のボトルネックへ戻る
- 負荷テスト(リリース前) — 想定ピークの2〜3倍で限界スループットと限界レイテンシを把握する
- 改善レポートの作成 — 下記テンプレートで成果を記録する
定番ボトルネックと定石
| ボトルネック | 計測手段 | 定石 |
| N+1クエリ | スロークエリログ・APMのクエリトレース | eager loading(JOIN / includes / prefetch) |
| インデックス不足 | EXPLAIN / EXPLAIN ANALYZE | 適切なインデックスを追加([[database-design]]参照) |
| 大きなペイロード | Network タブ・APM | ページネーション・フィールド絞り込み・gzip圧縮 |
| 画像の肥大化 | Lighthouse・Network タブ | WebP/AVIF変換・遅延読み込み・CDN配信 |
| フロントの不要な再レンダリング | React Profiler・ブラウザ Performance タブ | メモ化(memo/useMemo/useCallback)・仮想スクロール |
| 同期I/Oの直列実行 | プロファイラ・トレース | 並列化(Promise.all等)・非同期化 |
| 毎回同じ重い計算 | プロファイラ・APM | キャッシュ導入(階層・TTL・無効化戦略とセットで) |
| コネクションプール枯渇 | DBモニタリング・APM | プールサイズ調整・コネクション保持時間の見直し |
| メモリリーク | ヒープスナップショット | オブジェクト参照の解放・イベントリスナーの削除 |
キャッシュ設計の注意点
キャッシュは「最後の手段」ではなく「副作用が最大の手段」として扱う。
- 階層を整理してから導入: ブラウザ → CDN → アプリ(インメモリ/Redis) → DB(クエリキャッシュ)
- 無効化戦略を先に決める("キャッシュの無効化は計算機科学の二大難問")。更新時パージ・TTL・バージョニングのどれを使うか明示する
- TTLの根拠を記録する(「なんとなく5分」は不可)
- キャッシュヒット率・ミス率を[[monitoring-operations]]で観測する
成果物テンプレート
# 性能改善レポート
## 目標
- 対象: [エンドポイント / 機能名]
- KPI: p95 レスポンスタイム < Xms、スループット > Y rps、エラーレート < Z%
## 計測条件
- 環境: [本番 / ステージング / ローカル]
- データ量: [件数・サイズ]
- 負荷条件: [同時ユーザー数・RPS・テストツール(k6等)]
## ボトルネック一覧
| # | 内容 | 根拠 | 推定インパクト |
|---|------|------|----------------|
| 1 | N+1クエリ (UserController#index) | スロークエリログ: 1リクエストあたり51クエリ | 大 |
| 2 | ... | ... | ... |
## 実施した施策
| # | 施策 | 変更箇所 |
|---|------|---------|
| 1 | User.includes(:posts) に変更 | app/controllers/users_controller.rb |
## 前後比較
| 指標 | 改善前 | 改善後 | 変化率 |
|------|--------|--------|--------|
| p50 | 320ms | 45ms | -86% |
| p95 | 980ms | 120ms | -88% |
| p99 | 2100ms | 310ms | -85% |
| エラーレート | 2.1% | 0.0% | - |
## 目標達成判定
- [x] p95 < 200ms → 120ms で達成
## 残課題
- キャッシュ導入(優先度: 低、次スプリントで検討)チェックリスト
- 性能目標(p95/p99の数値)が[[non-functional-requirements]]に記載されている
- 本番相当のデータ量・環境でベースラインを計測した
- p50だけでなくp95・p99を記録した
- 最大のボトルネックを1つ特定し、根拠(ログ・プロファイル)を残した
- 施策は1つずつ適用し、前後の数値を比較した
- キャッシュを導入する場合、無効化戦略とTTLの根拠を記録した
- 想定ピーク負荷での負荷テストを実施した
- 目標達成後に最適化を停止した
- 改善レポートをレビュー可能な状態で残した
アンチパターン
- 推測ドリブンの改修: 計測せず「たぶんここが遅い」でコードを変更する
- 複数施策の同時適用: 効果の切り分けができなくなり、悪化した施策を特定できない
- 無効化戦略なしのキャッシュ: 古いデータが表示され続けるバグの温床になる
- 開発環境での計測: 少量データでは本番のN+1やフルスキャンが再現しない
- 平均値のみ監視: 外れ値に苦しむユーザーを見落とす
- 目標達成後も最適化を続ける: 可読性・保守性のコストが増大する
- ミクロ最適化への執着: ループ1つのマイクロ秒短縮より、N+1の解消やインデックス追加の方が桁違いに効く
モデル委譲ガイド
共通原則は [[orchestration]] を参照。
| 役割 | 担当 |
| 司令塔(メインモデル) | 性能目標の確認・ボトルネック候補の優先順位付け・施策採否の判断・レポートの取りまとめ |
| Opus相当 | 複雑なボトルネック分析(トレース解析・クエリ実行計画の解釈)・アーキテクチャレベルの改善設計(キャッシュ階層設計・非同期化戦略) |
| Sonnet相当 | 計測スクリプトの実装・個別施策の実装([[implementation]])・前後比較表の作成 |
| Haiku相当 | メトリクスの収集・スロークエリログの抽出・APMダッシュボードのスクリーンショット取得・定型レポートの整形 |
関連スキル
- [[non-functional-requirements]] — 性能目標の定義元。目標値なき最適化はしない
- [[database-design]] — インデックス設計・クエリ最適化の詳細
- [[monitoring-operations]] — 本番の継続的な性能監視・アラート設定
- [[refactoring]] — 可読性と性能のトレードオフを判断する際の参考
- [[testing]] — 負荷テストのシナリオ設計・CI組み込み
- [[architecture-design]] — キャッシュ階層・非同期化など構造的改善の設計
- [[code-review]] — 性能リグレッションの早期検出
- [[cicd-deployment]] — 性能テストのパイプライン組み込み
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

