[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AVFT9WKWNDNFXTVB5J9EDQ":3,"skill-same:01M7AVFT9WKWNDNFXTVB5J9EDQ":54},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":34,"commitSha":35,"skillDirectory":36,"forksCount":14,"repositoryHtmlUrl":37,"repositoryHomepageUrl":6,"ownerHtmlUrl":38,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":39,"install":40,"resources":53},"01M7AVFT9WKWNDNFXTVB5J9EDQ","performance-optimization",null,"Use when profiling, optimizing, or adding performance budgets to applications — covers measure-first workflow, Core Web Vitals, common anti-patterns, and performance regression prevention","MinhDuyDEV\u002Fmd-pikit","MinhDuyDEV","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F94704296?v=4","01M7AVDRJB5JM5VG5B6K49X0EZ","Nguyễn Viết Minh Duy","01M7AVDRKDB3JPGHFE4HGK1Z5M",0,"MIT","https:\u002F\u002Fgithub.com\u002FMinhDuyDEV\u002Fmd-pikit\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fperformance-optimization\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: performance-optimization\ndescription: Use when profiling, optimizing, or adding performance budgets to applications — covers measure-first workflow, Core Web Vitals, common anti-patterns, and performance regression prevention\nversion: 1.0.0\ntags: [performance, code-quality]\ndependencies: []\nagent_types: [planner, worker, reviewer]\ntools: []\n---\n\n# Performance Optimization\n\n## Iron Laws\n\n\u003CEXTREMELY-IMPORTANT>\n- **Measure first.** Intuition is wrong more often than not.\n- **One change at a time.** 5% + 10% ≠ 15% if you didn't isolate.\n- **The slowest thing is usually not where you think.** Profile.\n- **Algorithmic > micro-opt.** O(n²) → O(n log n) beats any cache line.\n- **Don't break correctness for speed.** Fast bug is still a bug.\n\u003C\u002FEXTREMELY-IMPORTANT>\n\n## When to Use\n\nReal-world slowness; Core Web Vitals failing; high p99; user \"feels slow\"; capacity planning; before a perf task without a number.\n\n## When NOT to Use\n\nPremature optimization; \"I think this is slow\"; \"make it faster\" without target; rewriting to dodge profiling.\n\n## Workflow\n\n1. **Define the target.** p99 \u003C 200ms. LCP \u003C 2.5s. Number, not \"feels faster.\"\n2. **Measure baseline.** Profile, capture traces. Record the number.\n3. **Identify the bottleneck.** The slow part is usually obvious once you see it.\n4. **Hypothesize.** \"X is slow because Y.\" Testable.\n5. **One change.** Smallest change targeting the bottleneck.\n6. **Re-measure.** Compare to baseline. Keep or revert.\n7. **Repeat.** Until target met.\n\n## Core Web Vitals\n\n| Metric | Target | What |\n|---|---|---|\n| LCP | \u003C 2.5s | Main content renders |\n| INP | \u003C 200ms | Interaction response |\n| CLS | \u003C 0.1 | Visual stability |\n| TTFB | \u003C 800ms | Server response |\n| FCP | \u003C 1.8s | First render |\n\nLCP + INP + CLS are the \"Core\" (Google ranks on these).\n\n## Common Bottlenecks (Web)\n\nJS bundle size (1MB = 1s+ parse+exec → code-split, tree-shake); render-blocking resources (inline critical, defer the rest); images (80% of weight → WebP\u002FAVIF, responsive, lazy); network waterfalls (parallelize); re-renders (memo where it matters); layout thrashing (batch).\n\n## Common Bottlenecks (Backend)\n\nN+1 queries (use joins or batch); sync I\u002FO in async path; no caching; pool too small; logger in hot path.\n\n## Profiling Tools\n\n| Domain | Tool |\n|---|---|\n| Web | DevTools Performance, Lighthouse, WebPageTest |\n| React | React DevTools Profiler, why-did-you-render |\n| Node | `node --prof`, clinic.js, 0x |\n| DB | `EXPLAIN ANALYZE`, pg_stat_statements |\n| General | flame graphs, OpenTelemetry |\n\n## Anti-Patterns\n\nPremature optimization (no measurement); micro-optimization (0.1% gain); wrong layer (3 days on CSS, real issue is 3MB JS); cache everything (cache has cost); speculative complexity (\"1M users?\"); perf without correctness; big-bang rewrite (\"we'll rewrite in Rust\" rarely ships).\n\n## Common Mistakes\n\nNo measurement; \"I think this is slow\" (no); no baseline; multiple changes at once; cache invalidation bugs; rewriting to dodge profiling; ignoring algorithmic; breaking correctness; no regression test.\n\n## Red Flags\n\n\"I think X is slow\" (measure first); no baseline; change without re-measuring; perf that breaks tests; micro-opt while N² is there; \"rewrite in Rust\"; perf claim without number; \"I added caching\" without key + invalidation; no regression test.\n\n## Self-Quiz\n\nDid I define a number? Measure baseline? Make ONE change then re-measure? Target the trace's bottleneck? Preserve correctness? Regression test?\n","# Performance Optimization\n\n## Iron Laws\n\n\u003CEXTREMELY-IMPORTANT>\n- **Measure first.** Intuition is wrong more often than not.\n- **One change at a time.** 5% + 10% ≠ 15% if you didn't isolate.\n- **The slowest thing is usually not where you think.** Profile.\n- **Algorithmic > micro-opt.** O(n²) → O(n log n) beats any cache line.\n- **Don't break correctness for speed.** Fast bug is still a bug.\n\u003C\u002FEXTREMELY-IMPORTANT>\n\n## When to Use\n\nReal-world slowness; Core Web Vitals failing; high p99; user \"feels slow\"; capacity planning; before a perf task without a number.\n\n## When NOT to Use\n\nPremature optimization; \"I think this is slow\"; \"make it faster\" without target; rewriting to dodge profiling.\n\n## Workflow\n\n1. **Define the target.** p99 \u003C 200ms. LCP \u003C 2.5s. Number, not \"feels faster.\"\n2. **Measure baseline.** Profile, capture traces. Record the number.\n3. **Identify the bottleneck.** The slow part is usually obvious once you see it.\n4. **Hypothesize.** \"X is slow because Y.\" Testable.\n5. **One change.** Smallest change targeting the bottleneck.\n6. **Re-measure.** Compare to baseline. Keep or revert.\n7. **Repeat.** Until target met.\n\n## Core Web Vitals\n\n| Metric | Target | What |\n|---|---|---|\n| LCP | \u003C 2.5s | Main content renders |\n| INP | \u003C 200ms | Interaction response |\n| CLS | \u003C 0.1 | Visual stability |\n| TTFB | \u003C 800ms | Server response |\n| FCP | \u003C 1.8s | First render |\n\nLCP + INP + CLS are the \"Core\" (Google ranks on these).\n\n## Common Bottlenecks (Web)\n\nJS bundle size (1MB = 1s+ parse+exec → code-split, tree-shake); render-blocking resources (inline critical, defer the rest); images (80% of weight → WebP\u002FAVIF, responsive, lazy); network waterfalls (parallelize); re-renders (memo where it matters); layout thrashing (batch).\n\n## Common Bottlenecks (Backend)\n\nN+1 queries (use joins or batch); sync I\u002FO in async path; no caching; pool too small; logger in hot path.\n\n## Profiling Tools\n\n| Domain | Tool |\n|---|---|\n| Web | DevTools Performance, Lighthouse, WebPageTest |\n| React | React DevTools Profiler, why-did-you-render |\n| Node | `node --prof`, clinic.js, 0x |\n| DB | `EXPLAIN ANALYZE`, pg_stat_statements |\n| General | flame graphs, OpenTelemetry |\n\n## Anti-Patterns\n\nPremature optimization (no measurement); micro-optimization (0.1% gain); wrong layer (3 days on CSS, real issue is 3MB JS); cache everything (cache has cost); speculative complexity (\"1M users?\"); perf without correctness; big-bang rewrite (\"we'll rewrite in Rust\" rarely ships).\n\n## Common Mistakes\n\nNo measurement; \"I think this is slow\" (no); no baseline; multiple changes at once; cache invalidation bugs; rewriting to dodge profiling; ignoring algorithmic; breaking correctness; no regression test.\n\n## Red Flags\n\n\"I think X is slow\" (measure first); no baseline; change without re-measuring; perf that breaks tests; micro-opt while N² is there; \"rewrite in Rust\"; perf claim without number; \"I added caching\" without key + invalidation; no regression test.\n\n## Self-Quiz\n\nDid I define a number? Measure baseline? Make ONE change then re-measure? Target the trace's bottleneck? Preserve correctness? Regression test?\n",{"name":5,"tags":24,"tools":27,"version":28,"agent_types":29,"description":7,"dependencies":33},[25,26],"performance","code-quality",[],"1.0.0",[30,31,32],"planner","worker","reviewer",[],"main","01207a96514af9f9c4d7d6cb594b936c6a9ddb10",".pi\u002Fskills\u002Fperformance-optimization","https:\u002F\u002Fgithub.com\u002FMinhDuyDEV\u002Fmd-pikit","https:\u002F\u002Fgithub.com\u002FMinhDuyDEV","2026-08-20 02:00:33",{"source":8,"skillName":5,"commands":41,"prompt":51,"zipAvailable":52},[42,45,48],{"tool":43,"command":44},"npx","npx skills add MinhDuyDEV\u002Fmd-pikit --skill performance-optimization",{"tool":46,"command":47},"bunx","bunx skills add MinhDuyDEV\u002Fmd-pikit --skill performance-optimization",{"tool":49,"command":50},"pnpm","pnpm dlx skills add MinhDuyDEV\u002Fmd-pikit --skill performance-optimization","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMinhDuyDEV\u002Fmd-pikit\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fperformance-optimization\u002FSKILL.md",true,[],[55,62,69,76,83,90],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M7AVGJR1RSRVA3VJT8ZW4Y27","writing-skills","Use when creating new skills, editing existing skills, or verifying skills work before deployment - applies TDD to process documentation by testing with subagents before writing, iterating until bulletproof against rationalization. Includes complete pressure testing methodology.","https:\u002F\u002Fgithub.com\u002FMinhDuyDEV\u002Fmd-pikit\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fwriting-skills\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M7AVGE076BNB3J7JDBGAKD2T","verification-before-completion","Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always","https:\u002F\u002Fgithub.com\u002FMinhDuyDEV\u002Fmd-pikit\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fverification-before-completion\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7AVGAYJ6APXRB9QWBG7482S","typescript-coding-standards","Use when writing, refactoring, or reviewing TypeScript code that needs strong domain modeling, typed errors, schema parsing, safe adapters, test seams, or maintainable module boundaries.","https:\u002F\u002Fgithub.com\u002FMinhDuyDEV\u002Fmd-pikit\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Ftypescript-coding-standards\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M7AVG8CE5BTR2CRFPHHVJCJZ","test-driven-development","Use when implementing a feature, bugfix, or behavior-changing refactor — require a failing behavior test before production code, then make the smallest change that passes.","https:\u002F\u002Fgithub.com\u002FMinhDuyDEV\u002Fmd-pikit\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7AVG5FJH3WTG9XR2G0608ND","source-driven-development","Use when unfamiliar libraries, dependency internals, external APIs, framework behavior, migrations, or current ecosystem guidance require official documentation, version-matched source, read the tests, and cited evidence.","https:\u002F\u002Fgithub.com\u002FMinhDuyDEV\u002Fmd-pikit\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fsource-driven-development\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M7AVG37PZ77CF35KAR6E93ZJ","security-and-hardening","Use when auditing security, implementing authentication or authorization, handling secrets, or validating data across external trust boundaries.","https:\u002F\u002Fgithub.com\u002FMinhDuyDEV\u002Fmd-pikit\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fsecurity-and-hardening\u002FSKILL.md",[],[]]