Back to skills
SKILL.md
Ui Performance Engineer
ASecurityOptimizes frontend user interfaces for high-speed rendering, low-latency interaction, and Core Web Vitals compliance (LCP < 2.5s, CLS < 0.1, INP < 200ms). Eliminates forced synchronous layout thrashing, eradicates layout-triggering CSS properties, prevents font-swap reflows, and enforces image aspect ratio reservation.
- 7 stars
- 0 votes
- 0 copies
- 3 views
- Added November 9, 2026
Security analysis
100/100npx -y skills add Harmitx7/tribunal-kit --skill ui-performance-engineer --agent claude-codeAre you the author of Ui Performance Engineer?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/harmitx7-ui-performance-engineer)---
name: ui-performance-engineer
description: 'Optimizes frontend user interfaces for high-speed rendering, low-latency interaction, and Core Web Vitals compliance (LCP < 2.5s, CLS < 0.1, INP < 200ms). Eliminates forced synchronous layout thrashing, eradicates layout-triggering CSS properties, prevents font-swap reflows, and enforces image aspect ratio reservation.'
version: 1.0.0
last-updated: 2026-10-30
skills:
- performance-profiling
- vitals-reviewer
- 60fps-animation
tools: Read, Grep, Glob, Bash, Edit, Write
scripts-binding:
- .agent/scripts/lint_runner.js
- .agent/scripts/verify_all.js
inputs:
componentMarkup: 'string'
performanceBudget: 'object'
outputs:
performanceReport: 'object'
vitalsEstimates: 'object'
optimizationPatch: 'string'
trigger:
- 'ui-performance'
- 'layout-shift-prevention'
- 'inp-optimization'
- 'core-web-vitals'
---
# UI Performance Engineer — Core Web Vitals & Layout Shift Prevention
## Mandatory Pre-Flight Context Inspection
Before modifying or auditing component performance, inspect these 5 critical parameters:
1. **Cumulative Layout Shift (CLS) Floor**: Guarantee CLS < 0.1 by reserving layout space for all dynamic elements, banners, images, and skeletons (`aspect-ratio` or fixed `min-height`).
2. **Interaction to Next Paint (INP) Budget**: Keep event handler JavaScript work under 50ms, deferring non-urgent work with `startTransition` or `requestIdleCallback`.
3. **Largest Contentful Paint (LCP) Resource Strategy**: Preload hero images, apply `fetchpriority="high"`, and use modern formats (AVIF / WebP) with explicit `srcset`.
4. **CSS Reflow Elimination**: Forbid animating layout-triggering properties (`width`, `height`, `top`, `left`, `margin`, `padding`). Use `transform` and `opacity` exclusively.
5. **DOM Tree Depth & Complexity**: Keep DOM node depth under 32 levels and total page nodes under 1,500 to prevent expensive style calculation sweeps.
## Activation Boundaries
- **Activate when:** Profiling frontend performance, optimizing Core Web Vitals, eliminating visual jank, optimizing image/font loading, or resolving high INP / CLS scores.
- **DO NOT activate when:** Optimizing backend SQL queries, tuning database connection pools, or managing container orchestration.
## 🔁 Multi-Pass UI Performance Protocol
| Pass | Phase | Core Action | Observable Target |
| :--------- | :----------------------------- | :------------------------------------------------------------------------------------------- | :-------------------- |
| **Pass 1** | **CLS Hazard Scan** | Audit markup for missing `width`/`height` or `aspect-ratio` on media and dynamic containers. | Zero Unreserved Media |
| **Pass 2** | **Reflow Trigger Elimination** | Scan CSS for transitions on geometry properties; replace with hardware `transform`. | Reflow-Free CSS |
| **Pass 3** | **Font & Asset Optimization** | Apply `font-display: swap` and link `rel="preload"` for primary display fonts. | Zero FOIT/FOUT Jank |
| **Pass 4** | **Interaction Script Budget** | Profile interactive target event listeners for blocking CPU execution. | INP < 200ms |
| **Pass 5** | **Performance Certification** | Compile Core Web Vitals compliance report and verified optimization patch. | Performance Scorecard |
---
## 🛠️ Technical Architecture & Performance Recipes
### 1. Cumulative Layout Shift Prevention Recipe
```html
<!-- High-performance card with reserved aspect ratio and skeleton placeholder -->
<div className="flex flex-col gap-3 min-w-0">
<div
className="relative w-full aspect-video rounded-[12px] bg-[var(--surface-1)] overflow-hidden"
>
<img
src="/assets/preview.webp"
alt="Analytics overview"
width="{640}"
height="{360}"
loading="lazy"
decoding="async"
className="w-full h-full object-cover transition-opacity duration-300"
/>
</div>
<h4 className="text-sm font-medium text-[var(--text-primary)] truncate">Performance Dashboard</h4>
</div>
```
### 2. Zero-Reflow Accordion Transition
```css
/* Performant accordion collapse using grid-template-rows */
.ui-accordion-content {
display: grid;
grid-template-rows: 0fr;
transition: grid-template-rows 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.ui-accordion-content[data-state='open'] {
grid-template-rows: 1fr;
}
.ui-accordion-inner {
overflow: hidden;
}
```
---
## 🏛️ Tribunal Verification & Guardrails
### 🛑 Verification-Before-Completion (VBC) Protocol
1. Verify all `<img>` elements declare explicit `width`/`height` attributes or `aspect-ratio` CSS.
2. Ensure zero CSS transitions animate geometry properties (`width`, `height`, `margin`, `padding`, `top`, `left`).
3. Verify that projected CLS remains under 0.05 on benchmark tasks.
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.