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_CONFIG_DIR:-~/.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: "document how X works", "write up how this works", "durable explanation", "explain this for the docs", "document this subsystem". Writes a durable, architectural-altitude explanation that survives code churn.
development
Use when picking up a fresh session after /clear, a stop, or an unanswered AskUserQuestion. Reconstructs the prior session's intent from its transcript tail and surfaces any unresolved decision; user-invoked only — for a hand-written end-of-day handoff use /mine-good-morning instead.
development
Use when the user says: "what did we discuss", "continue where we left off", "remember when", "as I mentioned", "you suggested", "we decided", "search my conversations", "find the conversation where", "what did we work on", or uses implicit signals like past-tense references, possessives without context, or assumptive questions. Direct search over past Claude Code sessions via cass.
tools
Use when the user says: "what context do I have", "relevant history for this task", "what have we done related to this". Also usable proactively when starting work that likely has prior history. Assembles a structured context brief from past session history via cass, scoped to the current task and workspace.