seo-performance
Skill1 starsChanged 8 months agoMITView on GitHub
Core Web Vitals and performance SEO rules for Next.js. Use when optimizing page load speed, addressing LCP/CLS/INP issues, working with third-party scripts like Google Tag Manager, fonts, or bundle size.
- Reads credentials
2 other projects use a version of this.
Adopted by
Most recently taken up by
- oegeyilmaz9/seo-aeo-geo-ultimatetheir own version, first seen Aug 9, 2026
- 01clauding/claude-seo-skilltheir own version, first seen Mar 13, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- 01clauding/claude-seo-skill★ 4same name
- oegeyilmaz9/seo-aeo-geo-ultimate★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository11 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- seo-crawlabilitySkill
- seo-ecommerceSkill
- seo-hreflangSkill
- seo-imagesSkill
- seo-internal-linkingSkill
- seo-metadataSkill
- seo-redirectsSkill
- seo-structured-dataSkill
- seo-urls-routingSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 1 is distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
App Router: Default to Server Components — only add "use client" when the component truly needs interactivity (click handlers, state, …
- Very specific: line 23
Pages Router: Use getServerSideProps or getStaticProps to fetch data server-side
- Very specific: line 123
Always use strategy="afterInteractive" for GTM
- Very specific: line 124
Never use beforeInteractive for analytics/tracking scripts
- Very specific: line 126
Consider using strategy="lazyOnload" for non-critical third-party scripts (chat widgets, surveys)
- Distinctive: line 163
Use React Suspense to stream content progressively — the page shell renders immediately while slower data loads:
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Performance & Core Web Vitals SEO Guidelines
Core Web Vitals are a Google ranking factor. Follow these rules to maintain good performance on a Next.js e-commerce site.
Targets
| Metric | Target | What it measures |
| LCP (Largest Contentful Paint) | < 2.5s | How fast the main content loads |
| CLS (Cumulative Layout Shift) | < 0.1 | How much the page layout shifts during load |
| INP (Interaction to Next Paint) | < 200ms | How fast the page responds to user interaction |
Server-Side Rendering by Default
- Render critical content on the server — product data, pricing, descriptions, specs, breadcrumbs
- App Router: Default to Server Components — only add
"use client"when the component truly needs interactivity (click handlers, state, effects) - Pages Router: Use
getServerSidePropsorgetStaticPropsto fetch data server-side - Server-rendered content arrives as HTML — faster LCP, no JavaScript bundle cost for display-only content
- Client components are needed for: add-to-cart buttons, quantity selectors, language switcher, search input, filters
// GOOD — Server-rendered (no "use client" in App Router; use getServerSideProps in Pages Router)
export default async function ProductPage({ params }: Props) {
const product = await getProduct(params.id); // Server-side fetch
return <ProductDetails product={product} />;
}
// GOOD — Only the interactive part is a client component
// components/AddToCartButton.tsx
"use client";
export function AddToCartButton({ productId }: Props) {
const [quantity, setQuantity] = useState(1);
// ...
}Why it matters: Client-side rendering adds to the JavaScript bundle. On category pages with 50+ products, making each product card a client component can add hundreds of KB of JS, destroying LCP.
LCP Optimization
The LCP element on product pages is typically the main product image. On category pages, it's the first visible product image or the hero banner.
- Preload the LCP image — use
priorityprop on the<Image>component - Avoid client-side data fetching for above-fold content — fetch product data server-side
- Don't lazy-load the LCP image —
prioritydisables lazy loading automatically - Minimize server response time — use ISR (Incremental Static Regeneration) for product pages
// next.config.js — ISR for product pages
// In page.tsx:
export const revalidate = 300; // 5 minutes — fresh enough for buyersCLS Prevention
- Always size images — use
width/heightorfillwith a sized container (see seo-images skill) - Reserve space for dynamic content — prices, stock badges, add-to-cart buttons
- Font loading — use
next/fontwithdisplay: swapandsize-adjustto prevent layout shift - Avoid injecting content above existing content — banners, promo bars, cookie consents should not push content down
// GOOD — font with swap and size-adjust
import { Inter } from 'next/font/google';
const inter = Inter({ subsets: ['latin'], display: 'swap' });
// BAD — loading fonts via <link> causes FOUT and CLS
<link href="https://fonts.googleapis.com/css2?family=Inter" rel="stylesheet" />INP Optimization
- Minimize client-side JavaScript — less JS = faster interactions
- Use
useTransitionfor non-urgent UI updates (filter changes, sort changes on category pages) - Avoid blocking the main thread — don't run expensive computations in event handlers
- Debounce search input — don't fire a request on every keystroke
"use client";
import { useTransition } from 'react';
function CategoryFilters({ onFilterChange }: Props) {
const [isPending, startTransition] = useTransition();
function handleFilterChange(filter: string) {
startTransition(() => {
onFilterChange(filter); // Non-urgent, won't block interaction
});
}
}Google Tag Manager (GTM)
GTM is a significant performance cost if loaded incorrectly.
// GOOD — load GTM after page is interactive
import Script from 'next/script';
<Script
id="gtm"
strategy="afterInteractive"
dangerouslySetInnerHTML={{
__html: `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer', process.env.NEXT_PUBLIC_GTM_ID);`,
}}
/>
// BAD — blocks page rendering
<Script strategy="beforeInteractive" src={`https://www.googletagmanager.com/gtm.js?id=${process.env.NEXT_PUBLIC_GTM_ID}`} />Rules:
- Always use
strategy="afterInteractive"for GTM - Never use
beforeInteractivefor analytics/tracking scripts - Store the GTM container ID in an environment variable (
NEXT_PUBLIC_GTM_ID), never hardcode it - Consider using
strategy="lazyOnload"for non-critical third-party scripts (chat widgets, surveys)
Font Loading
- Always use
next/font— it self-hosts fonts, eliminating external requests - Set
display: 'swap'— shows fallback text immediately, swaps to custom font when loaded - Limit font weights — only load weights you actually use (e.g. 400 and 700, not all 9 weights)
import { Inter } from 'next/font/google';
const inter = Inter({
subsets: ['latin', 'latin-ext'], // Include latin-ext for European languages
display: 'swap',
weight: ['400', '500', '700'], // Only weights actually used
});Bundle Size
- Dynamic imports for below-fold components — product image gallery, reviews section, related products
- Avoid importing entire libraries —
import { format } from 'date-fns'notimport dayjs from 'dayjs'if only formatting - Analyze bundle — use
@next/bundle-analyzerto find oversized dependencies
// GOOD — dynamic import for below-fold content
import dynamic from 'next/dynamic';
const ProductReviews = dynamic(() => import('./ProductReviews'), {
loading: () => <ReviewsSkeleton />,
});
const RelatedProducts = dynamic(() => import('./RelatedProducts'));Streaming & Suspense
Use React Suspense to stream content progressively — the page shell renders immediately while slower data loads:
import { Suspense } from 'react';
export default function ProductPage({ params }: Props) {
return (
<>
<ProductHeader id={params.id} /> {/* Renders immediately */}
<Suspense fallback={<PriceSkeleton />}>
<ProductPrice id={params.id} /> {/* Streams when ready */}
</Suspense>
<Suspense fallback={<ReviewsSkeleton />}>
<ProductReviews id={params.id} /> {/* Streams when ready */}
</Suspense>
</>
);
}Common Technical Anti-Patterns
- "use client" on data-display components — product cards, breadcrumbs, specs tables don't need client-side JS
- GTM with beforeInteractive — blocks rendering, destroys LCP
- Loading fonts via
<link>— use next/font instead - Loading all font weights — only load what you use
- Synchronous data fetching in client components — fetch on the server, pass data as props
- Not using Suspense — causes the entire page to wait for the slowest data source
- Large dependencies for simple tasks — don't import moment.js for a date format
- Hardcoded GTM container IDs — use environment variables
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

