skills-impeccable/i-optimize/SKILL.md
Use when the user says: "optimize frontend performance", "improve load time", "fix rendering". Improve frontend performance and rendering efficiency.
npx skillsauth add NodeJSmith/Claudefiles i-optimizeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Identify and fix performance issues to create faster, smoother user experiences.
Read ${CLAUDE_HOME:-~/.claude}/skills/i-frontend-design/SKILL.md for design principles, anti-patterns, and the Context Gathering Protocol. Follow the protocol before proceeding — if no design context exists yet, you MUST run /i-teach-impeccable first.
Understand current performance and identify problems:
Measure current state:
Identify bottlenecks:
CRITICAL: Measure before and after. Premature optimization wastes time. Optimize what actually matters.
After analyzing the current state, present your proposed changes to the user:
Then STOP and confirm before implementing:
AskUserQuestion:
question: "Here's what I propose. How would you like to proceed?"
header: "Confirm"
options:
- label: "Implement"
description: "Looks good — go ahead and make these changes."
- label: "Refine scope"
description: "I want to adjust what's included before you start."
- label: "Challenge this first"
description: "I'll run /mine.challenge against your proposal before we proceed."
- label: "Stop here"
description: "Don't implement anything. The proposal is in this conversation only."
If "Implement" → proceed to implementation below. If "Refine scope" → ask what to change, update proposal, re-confirm.
<!-- CHALLENGE-CALLER -->If "Challenge this first" → invoke /mine.challenge inline against the proposal, read findings, revise proposal, re-present this gate.
If "Stop here" → end the skill.
The standard techniques are familiar — apply the ones the trace points to:
srcset/loading="lazy" at display size; route/component code splitting and dynamic imports; critical CSS inline; font-display: swap with subsetting and preload.content-visibility: auto and virtual scrolling for long lists; CSS contain for independent regions.transform/opacity (GPU-composited), never layout properties; requestAnimationFrame for JS animation; will-change sparingly.memo/useMemo/useCallback on measured-expensive work only; virtualize long lists; no inline function creation in hot render paths; profile before sprinkling memos.aspect-ratio CSS property/* Reserve space for image */
.image-container {
aspect-ratio: 16 / 9;
}
Tools to use:
Key metrics:
IMPORTANT: Measure on real devices with real network conditions. Desktop Chrome with fast connection isn't representative.
NEVER:
will-change everywhere (creates new layers, uses memory)Test that optimizations worked:
Remember: Performance is a feature. Fast experiences feel more responsive, more polished, more professional. Optimize systematically, measure ruthlessly, and prioritize user-perceived performance.
After implementation, summarize in conversation:
development
Use when the user says: "humanize this", "unslop this", "de-slop this", "fix AI writing", "remove AI tells", "clean up AI prose". Edits prose to remove AI writing patterns and add human voice. Analyzes first, then asks how to fix. Prose complement to mine.clean-code.
development
Use when the user says: "why is this code like this", "why does this exist", "why was this built this way", "decision rationale", "what's the history behind". Decision archaeology — reconstructs historical rationale from evidence, not speculation.
development
Use when the user says: "how does X work", "walk me through", "explain this subsystem", "explain how", "trace the flow". Complexity-adaptive subsystem explanation — builds mental models conversationally, not documentation artifacts.
development
Use when the user says: 'create an issue', 'file an issue', 'open an issue', 'write an issue', 'new issue for this'. Codebase-aware issue creation — investigates the code to produce well-structured issues with acceptance criteria, affected areas, and enough detail for automated triage.