performance-optimization
Skill0 starsChanged 4 months agoMITView on GitHub
Measurement-first performance optimization: profile before changing, verify with numbers, Core Web Vitals targets and remediation steps. Use when the user reports slowness, asks to optimize or speed up code or pages, or says 遅い, パフォーマンス, 高速化, 重い. Never optimize without measuring first. Not for architecture-level scaling decisions (use scalability-design).
125 other projects use a version of this.
Adopted by
Most recently taken up by
- valentinesamuel/claude-skillstheir own version, first seen Nov 8, 2026
- ishandutta2007/Awesome-Claude-Skillstheir own version, first seen Nov 8, 2026
- ishandutta2007/Awesome-Agent-Skillstheir own version, first seen Nov 8, 2026
- paramcodes/skillstheir own version, first seen Nov 8, 2026
- nisarth/claude-skills-storetheir own version, first seen Nov 8, 2026
- DnsQueen/orcinus-skillstheir own version, first seen Nov 8, 2026
Used with
Projects with it also use constraint-driven-development, git-workflow-and-versioning 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.
MrCipherSmithSkillconstraint-driven-development
Use when a project needs a persistent, measurable quality bar — starting a project without documented standards, 'set up constraints', or when coverage/perf/a11y thresholds get re-debated per-PR. Produces CONSTRAINTS.md with enforceable numbers, ratchets, and a guard against silent weakening. NOT for throwaway prototypes or a one-off CI setup.
Also in 15 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 42 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 33 projects that use this
HK-hubSkilldeprecation-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 39 projects that use this
ukanwatSkillinput-systems
Architect game input — action mapping (abstracting keys into named actions), rebinding with conflict detection and persistence, multi-device support (keyboard, gamepad, touch), analog deadzones, and feel features like input buffering and coyote time, plus accessibility. Engine-neutral. Use when the user mentions input mapping, rebind controls, gamepad support, deadzone, input buffering, coyote time, or accessible controls.
Also in 4 projects that use this
HK-hubSkillobservability-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 31 projects that use this
- +6 more from LLl0k0laD
Other versions125 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 125
- addyosmani/agent-skills★ 114ksame name
- sanity-io/sanity★ 6.4ksame name
- gamedev-skills/awesome-gamedev-agent-skills★ 6.4ksame name
- compozy/compozy★ 2.9ksame name
- ollaya-dev/ollaya★ 1.4ksame name
- buddy-compiler/buddy-mlir★ 773same name
- ThibautBaissac/rails_ai_agents★ 665same name
- derHaken/SuperAntigravity★ 439same name
- ukanwat/aaabench★ 399same name
- ukanwat/overtime★ 399same name
115 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 repository14 other files it gives its agents.
- ai-code-verificationSkill
- ci-cd-hardeningSkill
- error-handling-robustnessSkill
- legacy-code-navigationSkill
- logging-observabilitySkill
- naming-readabilitySkill
- plan-then-codeSkill
- project-conventionsSkill
- refactoring-disciplineSkill
- safe-release-practicesSkill
- scalability-designSkill
- secure-input-handlingSkill
- test-suite-designSkill
- web-api-designSkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 110 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 43
Before/Afterの数値を並べて提示する(「速くなったはず」ではなく「◯msから◯msに改善」と報告する)。
“Common” is measured: kept by at least 6 in 10 of the 110 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Performance Optimization
「推測で最適化しない」ことを鉄則とする。Donald Knuthの"premature optimization is the root of all evil"に基づき、計測→仮説→修正→再計測のループを必ず踏む。
鉄則(Iron Law)
計測せずに最適化コードを書いてはいけない。 「ここが遅そう」という直感は高確率で外れる。修正前後の数値がない「最適化しました」は報告として認めない。
適用手順
1. 何を測定するか明確にする
- パフォーマンス改善を依頼されたら、最初に「何を測定するか」を確定する:実行時間か、メモリ割り当てか、I/O待ちか、レンダリング時間か。
- 「遅い」という報告を受けたら、具体的な再現手順(どの操作が、どの条件で、どれくらい遅いか)を言語化してから着手する。
2. 修正前に現状を計測する
- プロファイラ・ベンチマーク・パフォーマンス計測ツールで現状の数値を取得する。コードを目で読んでボトルネックを決めつけない。
- サーバーサイド/バッチ処理:CPUプロファイラ、実行時間計測、DBクエリのEXPLAIN/実行計画を確認する。
- フロントエンド:Chrome DevTools Performanceパネル・Lighthouse・PageSpeed Insightsでフィールドデータとラボデータの両方を確認する。
- 計測結果から、実際のボトルネック箇所を1つ以上特定してから次に進む。特定できない場合は計測方法を見直す(推測で次のステップに進まない)。
3. Core Web Vitalsの目標値(フロントエンド)
- LCP(Largest Contentful Paint、最大コンテンツ描画):2.5秒以内
- INP(Interaction to Next Paint、応答性):200ミリ秒以内
- CLS(Cumulative Layout Shift、累積レイアウトシフト):0.1以下
改善手順:
- LCPが悪い場合:最大コンテンツ要素(画像・見出し等)の読み込みを優先度高に設定し、レンダリングをブロックするリソース(同期JS/CSS)を減らす。
- INPが悪い場合:メインスレッドを長時間占有する処理を分割する(長いタスクの分割、重い同期処理の非同期化)。DOMの読み書きを分離し、強制リフロー(レイアウトスラッシング)を避ける。
- CLSが悪い場合:画像・広告枠にサイズ(width/height)を明示し、動的に挿入されるコンテンツが既存レイアウトを押し出さないようにする。
- DOMサイズを小さく保ち、画面外要素はCSS containment等で遅延レンダリングする。
4. ボトルネックにのみ手を入れる
- 計測で判明した箇所にのみ最適化を適用する。計測されていない箇所を「ついでに」最適化しない。
- 可読性を犠牲にする最適化(ループ展開、キャッシュの手動管理等)は、効果が数値で確認できた場合のみ適用する。効果が誤差程度なら元の可読なコードに戻す。
- アルゴリズム・データ構造の選択(O(n²)をO(n log n)にする等)を、細かいマイクロ最適化より優先して検討する。
5. 修正後に再計測して報告する
- 修正前と同じ条件・同じ計測方法で再計測する。
- Before/Afterの数値を並べて提示する(「速くなったはず」ではなく「◯msから◯msに改善」と報告する)。
- 改善が誤差範囲内だった場合は、その修正を採用するかどうかを可読性とのトレードオフで再検討する。
チェックリスト
- 何を測定するか(実行時間/メモリ/I/O/レンダリング)を明確にしてから着手した
- 修正前に実測でボトルネックを特定した(推測で決めていない)
- ボトルネック箇所にのみ手を入れた
- 可読性を落とす最適化は効果を数値で確認してから適用した
- 修正後に同条件で再計測し、Before/Afterを数値で報告した
- フロントエンドの場合、LCP/INP/CLSの目標値に対して現状を確認した
アンチパターン集
| アンチパターン | なぜ問題か | 代わりにすること |
| コードを読んで「ここが遅そう」と決めつけて修正する | 直感は実際のボトルネックと一致しないことが多い | プロファイラ・計測ツールで実測してから対象を決める |
| 計測せずに「最適化しました」と報告する | 効果があったか誰も検証できず、再発時に切り分けられない | Before/Afterの数値を必ず併記する |
| ボトルネックでない箇所まで「ついでに」最適化する | 可読性が落ちる割に効果がなく、変更差分も無駄に大きくなる | 計測で特定した箇所だけに絞る |
| マイクロ最適化(ループ展開等)から着手する | アルゴリズム自体が非効率だと焼け石に水 | まずアルゴリズム・データ構造・クエリ設計を見直す |
| 画像・フォントを無条件に同期読み込みのままにする | LCP/INPが悪化し、体感速度が落ちる | 遅延読み込み・優先度指定・サイズ事前指定を行う |
| 効果が誤差程度の最適化を可読性を犠牲にして残す | 将来のメンテナンスコストが増えるだけで実利がない | 効果が誤差なら可読なコードに戻す判断をする |
出典
- Donald Knuth, "premature optimization is the root of all evil" の原則(一般的引用)
- Shopify Engineering, "How to Fix Slow Code in Ruby" (https://shopify.engineering/how-fix-slow-code-ruby)
- web.dev, "The most effective ways to improve Core Web Vitals" (https://web.dev/articles/top-cwv)(Google公式、CC BY 4.0)
- 上記は要約・手順化したものであり、原文の丸写しはしていない。
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.

