dom-size
What it does
This skill checks how many HTML elements a page contains and how deeply they are nested. It is for developers whose pages feel slow or heavy.
When to use it
- ✓When a page with long lists becomes slow to scroll.
- ✓When a browser audit reports a very large page structure.
- ✓When your page has many wrapper elements that do nothing useful.
Skill link
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/dom-size/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Can you check if my page has too many HTML elements?”
5 new skills a week. 1 minute to read.
How it works
The agent measures the total element count and nesting depth with browser tools. It then suggests removing unnecessary wrappers and showing long lists in smaller parts.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Reduce DOM size and complexity
An excessive DOM size increases memory usage, slows down style calculations, and makes layout reflows more expensive, leading to poor interaction performance.
Quick Reference
- Keep total DOM nodes below 1,500
- Avoid deep nesting (maximum depth < 32)
- Use virtualization for long lists of elements
Check
Check the total number of DOM nodes and the maximum DOM depth using Lighthouse or Chrome DevTools.
Fix
Simplify the HTML structure, remove unnecessary wrapper elements, and implement virtualization for large lists.
Explain
Explain the performance impact of a large DOM tree on memory and rendering speed.
Code Review
Review the routes, assets, and loading behavior that affect Reduce DOM size and complexity. Flag exact files, requests, or rendering steps that add unnecessary network, CPU, or layout cost, and describe the measurement method used to confirm the issue.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/performance/dom-size
FAQ
How many elements is too many?
The skill suggests keeping the total below about 1,500 elements, with nesting under about 32 levels.
What is virtualization?
It means showing only the list items visible on screen, which keeps the page light.
How is the problem measured?
The skill suggests Lighthouse or Chrome DevTools.
Details
Original description by the author
Use when auditing slow page loads, heavy assets, or rendering delays related to Reduce DOM size and complexity. Verify the actual bottleneck in DevTools, Lighthouse, or field data before recommending changes.
Popularity
- GitHub stars
- 75k
- Ranking position
- #2821
- License
- MIT
- Updated
- 10/31/2026
Comments
- …
More skills from this repository
frontendchecklist
75kChecks frontend code and live pages against 380+ rules for accessibility, speed, SEO and security, using a command-line tool.
frontend-checklist-global
75kAudits a frontend project against all 386 Front-End Checklist rules, and gives a specific fix for each issue found.
404-page
75kChecks that your missing-page screen offers helpful links and returns a real 404 status, to help lost visitors find their way.
about-page
75kReviews whether your site has a clear About page that explains who runs it, to build trust with visitors and search engines.
Similar skills
angular-developer
280kHelps your agent create Angular code and give project structure advice. Useful for starting new projects, creating code parts, or improving performance and accessibility.
frontend-a11y
280kHelps your agent make web interfaces accessible to everyone. It ensures websites and apps work well with screen readers and keyboard navigation.
frontend-patterns
280kHas your agent apply modern patterns in frontend development. It optimizes performance, manages state, and follows best practices in React and Next.js.