---
title: "Fix Layout Shift"
slug: "fix-layout-shift"
type: "skill"
description: "Loads every page of your app on a slow connection, records every layout shift, and fixes the cause of each one. You also get a before and after video of every fix to verify."
url: "https://aiforui.dev/skills/fix-layout-shift"
updatedAt: "2026-12-01"
---

# Fix Layout Shift

Loads every page of your app on a slow connection, records every layout shift, and fixes the cause of each one. You also get a before and after video of every fix to verify.

```sh
npx skills@latest add emilkowalski/skills --skill fix-layout-shift
```

Invoke with `/fix-layout-shift`. Updated December 1, 2026.

## What it does

- Loads every page on a slow connection with the cache disabled, at mobile and desktop widths
- Records every shift with the elements that moved
- Clicks through your main flows, so it catches shifts after interaction too, not just on load
- Fixes the cause: reserved space, set dimensions, matched font fallbacks, `tabular-nums`, skeletons the size of the content
- Records a before and after video of every fix, so you can verify it

## When to use it

I hate layout shift, so I run this every now and then on the whole app. Your machine has a warm cache and a fast connection, so you rarely experience layout shift. It’s easy to overlook these issues.

## What the skill changed

Three shifts, one per tab: a post that jumps twice on refresh as the image and font arrive, tabs that slide as their counts load right before you click, and a page range that pushes the next button out from under the cursor. The skill makes each final size known before the content arrives, so nothing moves.

```
/fix-layout-shift the blog post jumps around every time I refresh the page
```

## Example prompts

```
/fix-layout-shift I click All and land on Closed while the page loads
```

## Pairs with

- [Break UI](https://aiforui.dev/skills/break-ui.md): Worst-case data, after the load
- [Mobile Native](https://aiforui.dev/skills/mobile-native.md): Phone-only jumps like the 100vh bug
