Guide · Agent skill
How to use the DOM Performance Review agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The dom-performance skill is a set of instructions that teaches an AI agent to review front-end JavaScript, React components and bundles for code that forces the browser to recalculate layout repeatedly. It is written for front-end developers who are debugging janky scrolling or slow animations, and for teams who want a checklist-style review of a specific script. After reading this guide you will know what the skill does, how to install it, how to ask for a review in plain language, and what to check before trusting its suggestions.
Quick start
- 1Download the ZIP. Get the dom-performance ZIP from the page you are reading.
- 2Unzip the folder. Extract it so that the dom-performance folder contains SKILL.md and references/rule.md.
- 3Place the skill. Move the folder to ~/.claude/skills/ for personal use, or to .claude/skills/ in your project.
- 4Or upload it in the Claude apps. Go to Settings → Capabilities → Skills and upload the skill.
- 5Ask for a review. Describe the file or component and the symptom, such as janky scrolling.
- 6Check the output. Read the flagged reads, writes and listeners, and confirm the reasoning.
- 7Verify in the browser. Measure the page before and after the change to confirm the fix worked.
What is an agent skill and what does this one do?
An agent skill is a folder containing a SKILL.md file and optional reference files. When installed, the agent reads the skill when a request matches its description, then follows its instructions. This skill has two files: SKILL.md and references/rule.md.
The skill targets layout thrashing. Every time code reads a layout property such as offsetHeight or getBoundingClientRect after changing the DOM, the browser must synchronously recalculate layout before returning the value. Repeating this in a loop can make the page stutter. The skill tells the agent to look for these interleaved reads and writes, suggest batching all reads before all writes, recommend requestAnimationFrame for visual updates, and flag scroll, touch and wheel listeners that should be passive.
- Finds places where reads and writes alternate inside loops
- Suggests batching reads first, then writes
- Recommends requestAnimationFrame for visual updates and DocumentFragment or innerHTML for bulk insertion
- Flags scroll, touch and wheel listeners that do not call preventDefault
- In React, flags repeated requestAnimationFrame-driven state updates across many mounted components when visible in the source
How do you install the dom-performance skill?
Download the ZIP for the skill from the page you are reading. Unzip it so that the dom-performance folder, containing SKILL.md and references/rule.md, sits in one of the skills locations below.
For a personal install that applies to all your projects, place the folder in ~/.claude/skills/. For a single project, place it in that project's .claude/skills/ folder so it travels with the repository.
If you use the Claude apps instead of a local folder, upload the skill under Settings → Capabilities → Skills.
- Personal: ~/.claude/skills/dom-performance/
- Project: .claude/skills/dom-performance/ inside your repository
- Claude apps: Settings → Capabilities → Skills, then upload
How do you trigger the skill with a natural request?
You do not need a special command. The agent matches your request against the skill description, which covers reviewing scripts, client components, bundles and runtime behaviour related to costly DOM read and write operations. Name the file or component and describe the symptom so the match is clear.
Good requests mention the code and the problem, for example asking the agent to check a scroll handler for layout thrashing, or asking whether a React component updating state on every animation frame is a performance problem.
- Review src/components/Carousel.jsx for layout thrashing and passive listener issues
- Check this scroll handler for interleaved DOM reads and writes
- This React component updates state on every requestAnimationFrame. Is that a performance smell across these mounted components?
- Explain why this animation loop is janky and suggest a batched fix
What does a review look like?
The skill defines four modes of work: Check, Fix, Explain and Code Review. A Check identifies interleaved reads and writes and non-passive listeners. A Fix refactors the code to batch reads before writes and marks listeners passive where they do not need to cancel scrolling. An Explain covers layout thrashing and why batching prevents it. A Code Review flags exact imports, event handlers, side effects or blocking operations and states how to verify the change in a browser.
The reference file includes a before-and-after example. The bad version reads offsetHeight and then writes a style inside a forEach loop, so each iteration forces a reflow. The good version performs all reads first and all writes afterwards.
items.forEach(item => { const height = item.offsetHeight; item.style.height = height * 2 + 'px' })What do you need before you start?
The skill lists no required tools, does not run scripts, and does not use the network. It works on source files you give it and on browser behaviour you describe or can check. Without code to review, it cannot give useful output, so have the script, component or bundle file ready.
Verification is part of the workflow. The skill asks the agent to state how a change should be checked in the browser, so have browser developer tools available to confirm that a fix actually changed the behaviour.
- Access to the source files you want reviewed
- A browser with developer tools to verify the change
- No scripts, network access or extra software required by the skill itself
What are the safety notes?
According to the skill metadata, it runs no scripts and uses no network access. Its contents are instructions and reference text. Review any skill before installing it, as you would any code you add to your agent setup, and check the files that the agent edits before accepting changes.
Tips for getting useful results
Give the agent the exact file and the symptom. The skill is generic, so concrete code produces concrete findings. Treat its suggestions as hypotheses. Profile the page before and after the change to confirm that the edit addressed the real bottleneck, because the guidance may suggest changes that do not fix it. Remember the rule only covers DOM read and write patterns. If the slowness comes from the server or network, this skill will not find it.
- Name the file, component or handler you want reviewed
- Describe what you see, such as jank while scrolling
- Verify each change in the browser before and after
- Do not use the skill as a replacement for profiling
What people use it for
- Reviewing a scroll handler that reads element heights and then changes styles in a loop
- Checking touch and wheel listeners for passive flags on a mobile page
- Reviewing a React component that sets state on every requestAnimationFrame across many mounted items
- Getting a checklist-style performance review of one front-end script before a release
Frequently asked questions
How do I install the dom-performance agent skill?
Download the ZIP from the page, unzip it, and place the dom-performance folder in ~/.claude/skills/ for personal use or in a project's .claude/skills/ folder. In the Claude apps you can instead upload it under Settings → Capabilities → Skills.
Does the dom-performance skill require anything else?
The source lists no required tools. It does not run scripts and does not use the network, so it works on the source files you provide and browser behaviour you can check.
Is the dom-performance skill free?
The skill is published under the MIT licence. The source does not mention pricing, so check the directory page for any other terms.
What is layout thrashing?
Layout thrashing happens when code reads a layout property after changing the DOM, forcing the browser to recalculate layout each time. Repeating this in a loop can freeze the page for hundreds of milliseconds.
Can the skill fix performance problems on its own?
It can suggest batching reads and writes, using requestAnimationFrame and marking listeners passive. Its guidance is generic, so it may suggest changes that do not fix the real bottleneck, and you should confirm results with profiling in the browser.
Does this skill help with server or network slowness?
No. The rule only covers DOM read and write patterns. If the bottleneck is server-side or network speed, you need a different approach.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use this skill if you are a front-end developer or team debugging janky scrolling, slow animations, or React components that update state every frame, and you can share the code. Pick something else if your problem is server or network speed, or if you need a full profiling workflow rather than a generic code checklist.
Download the skill