No slash command · from divi5-toolkit
Optimizes Divi 5 site performance by improving Core Web Vitals (LCP, INP, CLS), configuring Critical CSS/Dynamic CSS/Inline Stylesheets, font loading, lazy-loading images and videos, and auditing cache-plugin interactions.
Ships in divi5-toolkit. 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.
Divi 5 Version: 5.13.1 (September 2026) Core Web Vitals targets: LCP < 2.5s, INP < 200ms, CLS < 0.1
Divi 5 was rebuilt for performance. The Dynamic Framework breaks the monolithic Divi stylesheet into hundreds of small per-module components and assembles a unique per-page stylesheet on demand — pages that use 5 modules only ship the CSS for those 5 modules. Combined with Critical CSS extraction (inlined above-the-fold styles) and Inline Stylesheets (eliminates an external CSS request), Divi 5 removes all render-blocking CSS by default.
What this skill covers: the configuration knobs, the CSS patterns that make Divi 5's pipeline work well, and the integration patterns with third-party performance plugins.
Three Theme Options work together. Enable in: Divi → Theme Options → Builder → Advanced → Performance.
| Option | What it does | When to disable |
|---|---|---|
| Dynamic CSS | Per-page stylesheet with only the CSS for modules used on that page. Replaces the monolithic style.css. | Only if a plugin specifically requires the full stylesheet — almost never |
| Critical CSS | Auto-extracts above-the-fold CSS, inlines it in <head>, defers the rest with <link rel="preload" ... onload>. | If a cache plugin's own Critical CSS is running (avoid double-work) |
| Inline Stylesheets | Inlines the small per-page CSS file in <head> instead of loading via <link>. Removes one render-blocking request. | If your stylesheet is unusually large (>50KB inlined hurts more than it helps) |
Verification: View source on a frontend page. You should see no <link rel="stylesheet"> blocking the parser — only inline <style> tags and deferred preloads. Run Lighthouse and confirm "Eliminate render-blocking resources" is not flagged.
Divi 5.10 added engine-level deferral, reducing the need for custom lazy-load work:
On 5.10+, verify the built-in deferral covers your case before adding the IntersectionObserver helper-class pattern below. Also note two cache-related fixes worth updating for: intermittent disappearing styles (fixed across 5.8/5.9) and LiteSpeed purging entire entry sets per edit (fixed in 5.8).
The LCP element is almost always a hero image, hero heading, or hero video poster. Top causes of slow LCP on Divi sites:
<link rel="preload" as="image" href="..."> for the hero image (Theme Builder header or a wp_head hook).loading="lazy" on the LCP image delays it past the LCP window. Fix: set loading="eager" and fetchpriority="high" on the hero image, or exclude it from lazy-load plugins.font-display: swap.background-image, either preload it manually or move it to an <img> element.Replaced FID in March 2024. Measures the slowest interaction on the page. Divi-specific causes:
Divi 5.5 added Aspect Ratio settings on all image elements specifically to prevent CLS. Use them.
width/height attributes.size-adjust, ascent-override, descent-override on @font-face to match fallback metrics. Or use font-display: optional.min-height or aspect-ratio.position: sticky headers that pop in. Fix: apply sticky CSS server-side, not via JS.Divi 5's auto-Critical CSS works for most pages. When to override:
@font-face, clip-path, or custom keyframes that the auto-extractor missesPut it in Theme Options → Custom CSS (loads in <head> early enough to be critical). Keep it lean: ≤14KB compressed is the magic number (one TCP roundtrip).
/* Critical CSS — render the hero before any external CSS loads */
.et_pb_section_0,
.et_pb_section.hero-section {
background: linear-gradient(180deg, #0a1929 0%, #1a3a5c 100%);
padding: 6rem 0 4rem !important;
}
.hero-section h1 {
font-size: clamp(2.5rem, 5vw + 1rem, 4.5rem);
color: #ffffff !important;
margin: 0 0 1rem;
}
.hero-section .et_pb_button {
background: #ff6b35 !important;
border-color: #ff6b35 !important;
padding: 1rem 2rem !important;
}
See ${CLAUDE_PLUGIN_ROOT}/skills/divi5-performance/examples/critical-css.css for full template.
Default Divi behavior loads Google Fonts via external request. This costs LCP and CLS. Always host fonts locally for production.
Variable fonts (5.9+): Divi supports the current Google Fonts collection including variable fonts. One variable WOFF2 replaces several static weight files — fewer requests, smaller total transfer when you use 3+ weights of a family. The same local-hosting steps below apply; download the variable axis file and declare font-weight: 100 900; in the @font-face rule.
@font-face {
font-family: 'Inter';
font-style: normal;
font-weight: 400;
font-display: swap; /* show fallback immediately */
src: url('/wp-content/fonts/inter-400.woff2') format('woff2');
/* Metric overrides to reduce CLS on swap */
size-adjust: 107%;
ascent-override: 90%;
descent-override: 22%;
}
<link rel="preload" href="/wp-content/fonts/inter-700.woff2" as="font" type="font/woff2" crossorigin>
Add via wp_head action or Theme Builder header HTML block.
See ${CLAUDE_PLUGIN_ROOT}/skills/divi5-performance/examples/font-loading.css for full pattern.
Divi modules with background-image styles don't lazy-load by default — browsers can't see CSS background images until parse. Use a helper class to defer them:
/* In Theme Options → Custom CSS */
.et_pb_section.lazy-bg {
background-image: none !important;
}
.et_pb_section.lazy-bg.is-visible {
background-image: var(--bg-image) !important;
}
/* Add a tiny IntersectionObserver to flip the class */
const lazyBgEls = document.querySelectorAll('.lazy-bg');
const io = new IntersectionObserver((entries) => {
entries.forEach((e) => {
if (e.isIntersecting) {
e.target.classList.add('is-visible');
io.unobserve(e.target);
}
});
}, { rootMargin: '200px' });
lazyBgEls.forEach((el) => io.observe(el));
Or use Perfmatters (lazy-load CSS backgrounds setting) or WP Rocket's LazyLoad if you don't want custom JS.
<!-- In Theme Builder header HTML or wp_head -->
<link rel="preload" as="image" href="/wp-content/uploads/hero.webp" fetchpriority="high">
In the Image Module's Advanced tab → Attributes, add fetchpriority="high" and loading="eager".
For every image module, set Sizing → Aspect Ratio. The browser reserves space before the image loads, no shift on paint.
| Use case | Aspect Ratio |
|---|---|
| Hero banner | 21:9 or 16:9 |
| Card thumbnail | 4:3 or 3:2 |
| Product photo | 1:1 |
| Portrait | 3:4 or 4:5 |
| Setting | Recommendation | Notes |
|---|---|---|
| File Optimization → Minify CSS | On | Compatible |
| File Optimization → Remove Unused CSS (RUCSS) | Off OR Safelist /et-cache/, .et_pb_* | RUCSS removes Divi's Dynamic CSS, breaks site |
| File Optimization → Load CSS Asynchronously | Off (Divi already handles this) | Avoid double-work |
| Media → LazyLoad images | On | Excludes already-eager images |
Before declaring a Divi site "fast":
fetchpriority="high" and not lazy-loadedwidth/height or Aspect RatioRun the divi5-performance agent on a project for an automated walkthrough.
| Pattern | Why it's slow | Fix |
|---|---|---|
* selectors with expensive properties | Repaints entire tree on layout | Scope to specific elements |
transform on transition: all | Triggers all property transitions | transition: transform 0.3s only |
box-shadow on hover via JS | Triggers paint | Pre-define the shadow, only transition opacity of a pseudo-element |
filter: blur() on large elements | GPU-heavy | Apply to small overlays, not full-section backgrounds |
position: fixed with frequent layout updates | Triggers compositor layers | Use will-change: transform and animate transform only |
Web font as font-family fallback chain miss | Layout shift on swap | Set size-adjust/ascent-override (see Font Loading section) |
Often blamed, rarely the cause in 5.x. Profile in DevTools Performance tab before blaming jQuery. Most "Divi is slow" issues are unoptimized images or external scripts (analytics, chat widgets, ad networks), not Divi itself.
Divi's Critical CSS sometimes misses elements that render just below the fold on tablet. Symptoms: flash of unstyled content (FOUC) on a specific module. Fix: add that module's selectors to Theme Options → Custom CSS so they're loaded in the critical bucket.
Theme Builder content is dynamically injected — Critical CSS may not include header styles. Add header CSS to Theme Options Custom CSS to make it critical.
${CLAUDE_PLUGIN_ROOT}/skills/divi5-performance/examples/critical-css.css — Hand-crafted critical CSS template${CLAUDE_PLUGIN_ROOT}/skills/divi5-performance/examples/font-loading.css — Local @font-face with CLS-prevention overrides${CLAUDE_PLUGIN_ROOT}/skills/divi5-performance/references/core-web-vitals.md — Full Core Web Vitals reference with Divi-specific causes and fixesWhat SKILL.md sets; muted values are Claude Code's defaults
3 skills in this plugin
/divi5-compatibilityDivi 5 CompatibilityUse this skill when validating CSS for Divi 5 / Divi 5.13 compatibility, checking unsupported features or units, troubleshooting Divi CSS that isn't applying, debugging plugin conflicts (WP Rocket, LiteSpeed, Wordfence, WooCommerce, Perfmatters), migrating from Divi 4 to Divi 5, understanding breakpoints, applying the 5.5 Aspect Ratio + Framing settings to prevent CLS, using the 5.3 pseudo-class editing modes (:checked / :focus / :active) instead of custom CSS, the 5.4 Sizing Variable Generator and Relative Colorscheme Generator, the 5.7 Gradient Variables and text effects, the 5.9 Variable Fonts and CSS Grid Editor, the 5.12 backdrop-blur / invert / sepia Filters and AI Agents, the 5.13 LayoutStyle unit coverage, preset-class and migrated Free-Form CSS fixes, the newer modules (Timeline, Breadcrumbs, SVG, Table of Contents, Instagram Feed, Tooltip, Post Filter, Charts, Gravity Forms, Payment Button, Imagely Gallery), Nested Option Presets, Critical CSS / Dynamic CSS / Inline Stylesheets, recovering missing or deleted Divi 5 page content (WordPress Revisions vs the builder History panel), or fixing "styles not working" / "button override not working" / "static CSS cache" issues. Provides compatibility rules, validation patterns, specificity fixes, composable settings alternatives, version-specific bug fix history, and a full error-message reference./divi5-css-patternsDivi 5 CSS PatternsUse this skill when writing CSS for Divi 5 / Divi 5.13, styling Divi modules (buttons, sections, rows, blurbs, toggles, forms including the 5.3 Contact Form 7 Styler and 5.11 Gravity Forms module), the newer modules (Timeline, Breadcrumbs, SVG, Table of Contents, Instagram Feed, Tooltip, Post Filter, Charts, Payment Button, Imagely Gallery), working with Free-Form CSS and the `selector` keyword, overriding `.et_pb_*` classes, setting up design tokens or dark mode, using the 5.4 Sizing Variable Generator or Relative Colorscheme Generator, the 5.7 Gradient Variables and text effects (text-stroke, gradient/image text fills), the 5.9 Variable Fonts and CSS Grid Editor, the 5.12 backdrop-blur / invert / sepia Filters, the 5.13 Contact Form Show Labels and Slider swipe controls, applying the 5.5 Aspect Ratio / Framing settings, adding animations with reduced-motion, styling WooCommerce with Divi, the 5.3 pseudo-class editing modes (:checked, :focus, :active), Nested Option Presets, building accessible layouts, or developing a Divi child theme. Provides CSS patterns, class naming conventions, selector specificity guidance, Composable Settings alternatives, Canvas and Loop Builder patterns (including 5.10 front-end Loop Filters), and full example files for buttons, design tokens, animations, dark mode, WooCommerce, accessibility, forms, Loop Builder, and the 5.6–5.11 new modules.npx claudepluginhub cjsimon2/divi5-toolkit --plugin divi5-toolkitOther plugins' skills for the same job