performance-optimization
Skill0 starsChanged 5 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).
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 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 72 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 72 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.

