/emil:fix-layout-shiftfrom emil
Finds and fixes every layout shift in an app by loading pages on a slow connection with cache disabled at mobile and desktop widths, recording each shift with the elements that moved, and fixing the root cause.
Ships in emil. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
When this skill is first invoked without a specific question, respond only with:
I'm ready to load every page of your app on a slow connection, record every layout shift, and fix the cause of each one, my standards come from Emil Kowalski's design engineering philosophy.
Do not provide any other information until the user asks a question.
A hunting skill. It does ONE thing: find content that moves when the user didn't move it, trace each move to its cause, fix that cause, and prove the fix on video. It does not polish visuals (that's emil-design-eng), stress-test with long data (that's break-ui), or tune motion (that's review-animations).
Layout shift is the bug every developer misses, because they never see it. Their machine has a warm cache, a fast connection, the fonts installed locally, and data that comes back in 40ms. The user on a train sees the page assemble itself in four jumps and taps the wrong button on the third one.
So you are that user. Every page loads on a slow connection with the cache off, on a phone-width screen and a desktop one, and you watch it assemble. A layout that only holds still when it loads fast hasn't been fixed.
Two failure modes, and the first is worse:
min-height: 100vh to a wrapper, fading content in so the jump is "smoother", or delaying the render. The shift is still there; you made the page slower to hide it. A fade on content that moves is a slower jump.List every route and the main flows through them. Read the router (file-based routes, route config, sitemap) for the routes. For flows, find the things users actually do: sign in, create the main object, edit it, search, filter, paginate, submit forms, open dialogs, switch tabs.
Note which pages need auth or seed data, and how to get it: an existing storageState file, a seed script, a local auth bypass the project already has. If there's no way in, ask the user to run node shifts.cjs login shifts.config.cjs (Phase 2 sets up the script and config). It opens a browser at the app, they sign in themselves, and it saves the session to the config's storageState file, so no password passes through you (Hard Rule 7). Make sure that file is gitignored. A shift test of the logged-out page alone misses most of the app.
Completion criterion: every route is listed, every main flow is written as a sequence of steps, and you can reach every authenticated page.
Measure every route at both widths on the throttled connection. With a browser available, use scripts/shifts.cjs: copy it next to the project, run npm i -D playwright-core and npx playwright-core install ffmpeg (Playwright's own build, for recording video), write the config described at the top of the script, start the app, and run:
node shifts.cjs run shifts.config.cjs before
It loads each route on Slow 4G with the cache disabled, 4× CPU throttling on mobile, records every shift with its time, size, and the elements that moved (from where to where), outlines each moving element in red on the video, and writes out/layout-shift/before/report.md plus one video per route and width.
Without a browser, use the DevTools Performance panel (Layout Shifts track) and the "Layout Shift Regions" rendering option, or reason from the code using CATALOG.md, and say which findings you measured and which you inferred.
Completion criterion: every route has a report at both widths, and you've watched every video, not just read the numbers (Hard Rule 5).
Run every main flow from Phase 1 as a flow in the config. Shifts during a flow are flagged afterInput when they land within 500ms of an input; those are often expected (Hard Rule 3), so judge each one: did the user ask for this movement, right now?
Then check the cases the script can't drive for you. Each one is a shift users hit after the page has loaded:
Completion criterion: every flow has run, and every item above has been checked on every surface that has it.
For each shift, name the cause. The report says what moved; the cause is usually the thing above or beside it that changed size. Look up the cause in CATALOG.md. Load it now. It covers fonts, images and media, async data, skeletons, text and numbers, interaction states, overlays and scrollbars, viewport units, server rendering and hydration, scroll position, and third-party content, each with how it shows up, why, and the fix.
Group shifts by cause. Twelve shifted rows on six pages are often one <Avatar> without dimensions, and one fix.
Completion criterion: every shift has a cause from the catalog or a written explanation, and shifts with the same cause are grouped.
Fix each cause, at its source, in the project's conventions: in the shared component, not on each page that uses it. Each fix makes the final size known before the content arrives (Hard Rule 2).
Completion criterion: every cause has a fix applied, and none of the fixes hides, fades, or delays content.
Re-run the exact same config with a new label, then build the side-by-side videos:
node shifts.cjs run shifts.config.cjs after
node shifts.cjs compare before after
compare writes one out/layout-shift/compare/<route>-<width>.mp4 per page, before on the left and after on the right. Watch each one. If a red outline still flashes on the right, the fix didn't land: go back to Phase 4 for that shift.
Without the script, record both states with the same throttling in DevTools and say so.
Completion criterion: every fixed shift is gone in the after video, and no new shift appeared anywhere else.
One row per cause, worst first. Severity: Mis-tap (an interactive element moves while it's tappable, so the user can hit the wrong thing), Jump (visible content moves with nothing the user did to explain it), Jitter (small or repeated movement: text width changing as a number updates, a 1px border on hover).
| # | Severity | Where | What moved | Cause | Fix | Before / after |
|---|---|---|---|---|---|---|
| 1 | Mis-tap | /projects mobile | "New project" button, 64px down at 2.1s | Usage banner loads above it with no reserved space | Reserve the banner's height while it loads (Banner.tsx:22) | compare/projects-mobile.mp4 |
| 2 | Jump | every page | Whole page, 3px at 1.4s | Inter swaps in over a fallback with different metrics | Fallback @font-face with size-adjust + overrides (layout.tsx:8) | compare/home-desktop.mp4 |
| 3 | Jitter | /billing | Plan total and the button next to it | Proportional digits as the price updates | tabular-nums on the price (Price.tsx:14) | — |
Every row has a file:line for the fix.
One short paragraph per fix: what you changed, why it removes the cause, and any trade-off (a reserved space that's sometimes empty, a skeleton that now matches the content's size exactly).
Shifts whose cause sits outside the code: a third-party embed, an ad slot, a backend that returns an unpredictable number of items. Say what reduces each one (a reserved slot, a placeholder) and what it would take to fix it properly.
Close with the before/after CLS per page and where the videos are.
| Invocation | Behavior |
|---|---|
(no target) / my app | Full workflow over every route and main flow |
<route or component> | Same workflow, scoped to that page or every page that uses the component |
audit only | Phases 1–4 and the report, no fixes; the user picks what to fix |
fix all / fix 1, 3 | Apply the named fixes from the last report, then Phase 6 |
Plain and visual. A layout shift is easiest to understand on video, so point at the video. Name what moved, by how much, when, and why. Don't moralize about Core Web Vitals scores: the user cares that the button moved, not that a number went over 0.1.
What SKILL.md sets; muted values are Claude Code's defaults
2 plugins ship this exact skill · first indexed Dec 2, 2026
npx claudepluginhub emilkowalski/skills --plugin emil21 skills in this plugin
/animateBuild an animation from scratch, making the decisions in the order that determines whether it feels right — should it animate at all, what purpose, which tool, which properties, which curve and duration, how it interrupts, how it exits. Writes the implementation. Use when asked to animate something, add motion, make a component feel alive, or build a transition. For critiquing existing motion use review-animations; for auditing a whole codebase use improve-animations./animate-expoBuild animations in React Native and Expo, making the decisions in the order that determines whether they feel right — should it animate, which thread it runs on, which properties, spring or timing, how the gesture hands off, how it degrades. Writes the implementation with Reanimated, Gesture Handler, Expo Router and expo-haptics. Use when animating anything in an Expo app, adding gestures, sheets, screen transitions, press feedback or haptics, or fixing motion that stutters on device. For web animation use `animate`./animation-performanceKeep web animations inside the frame budget — animate composite-only properties, keep motion off the main thread when the page is busy, and find the cause when an animation drops frames. Use when an animation is janky, choppy, stutters, or drops frames; when choosing which property to animate; when deciding between CSS and JS animation on performance grounds; or when reaching for `will-change` or GPU layers. For choosing easing, duration, or whether to animate at all use animate; for reviewing motion as a whole use review-animations./animation-vocabularyReverse-lookup glossary that turns a vague description of a web animation or motion effect into its exact term ("the bouncy thing when a popover opens" → Pop in; "the iOS rubber-band scroll" → Rubber-banding). Use when the user asks "what's it called when…", or describes a motion effect without knowing its name and wants the right word to prompt an AI or designer with. For naming an effect, not designing or building one./apple-designApple's approach to interface design and fluid, physical motion, translated for the web. Use when building or reviewing gesture-driven UI, spring animations, drag/swipe/sheet interactions, momentum and interruptible transitions, translucent materials and depth, typography (optical sizing, tracking, leading), reduced-motion, or the design foundations (feedback, spatial consistency, restraint) behind Apple-style interfaces./ask-emilAsk which skill or flow fits your situation. A router over the skills in this repo.Other plugins' skills for the same job