Profile, audit, and optimize frontend page performance with emphasis on animation work, memory-leak risks, long-session slowdowns, CSS animations, canvas/WebGL requestAnimationFrame loops, marquees, skeletons, GSAP/Three/Matter effects, timers, listeners, and observers. Use when the user asks to make animations performant, pause offscreen animations, look for memory leaks, profile pages that slow the computer over time, fix janky scrolling, reduce CPU/GPU use, or repeat the "only play in view" optimization on React/Vite/Next/frontend pages using Codex Browser.
72
88%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Low
Low-risk findings worth noting
Measure the real page before editing. The goal is not to remove motion; it is to make offscreen work stop, visible motion resume correctly, and route/unmount cleanup release long-lived resources.
Use Codex Browser when available, especially for localhost pages. Do not use Chrome unless the user explicitly asks for it.
Inspect repo context.
AGENTS.md or local instructions.git status --short early.requestAnimationFrame, setInterval, setTimeout, canvas/WebGL/physics components, media elements, GSAP timelines/tweens, and existing visibility utilities.Capture a baseline in the browser.
animationName, animationPlayState, and visibility. Include ::before and ::after.null or the Browser sandbox blocks monkey-patching, say so and rely on stable observable counts plus source audit.references/browser-profiling.md for a reusable Codex Browser evaluator.Patch the smallest owner that controls the motion.
IntersectionObserver that toggles a stable class such as is-offscreen on sections and animated child elements.main > section.is-offscreen .expensive-animation,
.expensive-animation.is-offscreen {
animation-play-state: paused !important;
}::before and ::after pause selectors where needed.requestAnimationFrame when offscreen.data-animation-active when it helps browser verification.prefers-reduced-motion if the component already does, and avoid introducing React render loops for scroll/animation state.IntersectionObserver, ResizeObserver, MutationObserver, and custom subscriptions.isDisposed flag and dispose loaded resources if they resolve after unmount.ref.current values inside the effect before returning cleanup if lint warns the ref may change.Verify behavior, not just builds.
offscreenRunningCount: 0 for the page sections under test.Run local checks.
git diff --check
npm run lint
npm run buildrm -f /tmp/<task>-index
GIT_INDEX_FILE=/tmp/<task>-index git read-tree HEAD
# Apply only the intended hunks to the temporary index.
GIT_INDEX_FILE=/tmp/<task>-index git diff --cached --check
GIT_INDEX_FILE=/tmp/<task>-index git commit -m "Pause offscreen <page> animations"
git restore --staged <files> 2>/dev/null || trueis-offscreen plus element-level is-offscreen for long sections where below-the-fold child animations can still run.COURSES_PAGE_ANIMATION_VISIBILITY_SELECTOR.IntersectionObserver thresholds around 0.01 for animation gating.animation-play-state cannot pause JavaScript render loops.isDisposed guards for image/video/texture/data loaders that may resolve after unmount.animation-play-state covers pseudo-elements or JavaScript RAF loops.46abf78
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.