performance-optimization
Measure-first approach for Core Web Vitals targets, profiling workflows, bundle analysis, and anti-pattern detection. Use when performance requirements exist or you suspect regressions.
What this skill does
# Performance Optimization ## Overview Optimize performance with a measure-first approach. Never optimize without data. Establish baselines, identify bottlenecks, apply targeted fixes, and verify improvements. ## When to Use - Performance requirements are stated or implied - You suspect a regression after recent changes - Page load or interaction speed is noticeably slow - Bundle size has grown beyond acceptable thresholds - Database queries are slow under load ## Core Web Vitals Targets | Metric | Good | Needs Improvement | Poor | |--------|------|-------------------|------| | LCP (Largest Contentful Paint) | < 2.5s | 2.5s - 4s | > 4s | | FID (First Input Delay) | < 100ms | 100ms - 300ms | > 300ms | | CLS (Cumulative Layout Shift) | < 0.1 | 0.1 - 0.25 | > 0.25 | | INP (Interaction to Next Paint) | < 200ms | 200ms - 500ms | > 500ms | ## Process ### Step 1: Establish Baseline Measure current performance before making any changes: - Run Lighthouse audit - Record Core Web Vitals - Profile the specific operation in question - Document the baseline numbers ### Step 2: Identify Bottlenecks Analyze measurements to find the actual bottleneck: - Is it network (slow API calls, large assets)? - Is it rendering (layout thrash, excessive repaints)? - Is it JavaScript (long tasks, excessive computation)? - Is it data (N+1 queries, missing indexes, large payloads)? ### Step 3: Apply Targeted Fix Fix the identified bottleneck: - One change at a time - Prefer the simplest fix that addresses the root cause - Document what was changed and why ### Step 4: Verify Improvement Measure again after the fix: - Compare against baseline - Confirm the bottleneck is resolved - Check for regressions in other areas ## Common Anti-Patterns ### Frontend - Unnecessary re-renders in component frameworks - Large unoptimized images or assets - Render-blocking JavaScript or CSS - Missing lazy loading for below-fold content - Excessive DOM manipulation ### Backend - N+1 database queries - Missing database indexes for common query patterns - Synchronous processing of independent operations - Unbounded result sets without pagination - Missing caching for frequently accessed data ### Bundle - Importing entire libraries when only parts are needed - Duplicate dependencies in the bundle - Missing code splitting for route-based chunks - Unminified or uncompressed assets in production ## Common Rationalizations | Rationalization | Reality | |---|---| | "Premature optimization is the root of all evil" | That quote is about guessing, not about measuring and fixing known bottlenecks. | | "It is fast enough on my machine" | Your machine is not your users' machines. | | "We can optimize later" | Performance debt compounds like technical debt. | ## Verification - [ ] Baseline measurements recorded before changes - [ ] Bottleneck identified with evidence - [ ] Targeted fix applied - [ ] Post-fix measurements show improvement - [ ] No regressions in other performance metrics ## Anti-Rationalization Table | Excuse | Counter | |--------|---------| | "Premature optimization is the root of all evil" | That quote is about guessing, not about measuring and fixing known bottlenecks. | | "It's fast enough on my machine" | Your machine is not your users' machines. | | "We can optimize later" | Performance debt compounds like technical debt. | | "The Lighthouse score is good enough" | Lighthouse is a lab metric. Real user metrics tell the actual story. | | "One optimization should fix everything" | Performance issues are often multi-factor. Measure after each fix to find remaining bottlenecks. |
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.