nextjs-ecommerce-seo-skills
Copilot instructions1 starsChanged 8 months agoMITView on GitHub
Advisory only: These are suggestions. Do not auto-fix code based on these rules — only recommend changes when the developer asks. Compatible with Next.js 15.x/16.x, App Router and Pages Router. This is a Next.js e-commerce site with multi-locale support. It serves multiple locale variants using /{lang}-{COUNTRY}/ URL patterns (e.g. /en-GB/, /de-DE/, /fr-CH/). Product pages MUST include (required for rich results): - name, image (array of URLs) - offers.price (numeric value, no currency symbols — both 39.99 and "39.99" are valid),…
In this repository11 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- seo-crawlabilitySkill
- seo-ecommerceSkill
- seo-hreflangSkill
- seo-imagesSkill
- seo-internal-linkingSkill
- seo-metadataSkill
- seo-performanceSkill
- seo-redirectsSkill
- seo-structured-dataSkill
- seo-urls-routingSkill
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
21 rules. About 0 are common, 6 are distinctive, and 15 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
15
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 9
Use the Next.js Metadata API (generateMetadata / metadata export in App Router, next/head in Pages Router) — never hardcode in JSX
- Very specific: line 10
Title: Keep concise (truncated ~50-60 chars on desktop), format {Content} | {Brand}, include model number on product pages
- Distinctive: line 11
Description: Keep concise and unique per page, include CTA for e-commerce ("Buy online", "Order now")
- Very specific: line 18
Always use <script type="application/ld+json"> — never Microdata
- Very specific: line 20
Use @graph array to combine multiple schemas on one page
- Very specific: line 33
Every page needs <link rel="alternate" hreflang="xx-YY"> for ALL locale variants + x-default
- Distinctive: line 42
Never use generic alt: "image", "photo", "banner", "product image"
- Very specific: line 44
Always specify width/height or use fill — prevents CLS
- Very specific: line 45
Use priority on the main above-fold image (LCP element) — 1-2 per page max
- Very specific: line 49
Every URL must have locale prefix: /{lang}-{COUNTRY}/
- Distinctive: line 51
Never hardcode locale — derive from route params
- Very specific: line 52
Search pages (/*/search/) are blocked by robots.txt — always add noindex too
- Very specific: line 67
Use next/font with display: 'swap' — never load fonts via <link>
- Distinctive: line 74
No redirect chains (A→B→C) — always redirect to final URL
- Very specific: line 79
Use raw <img> tags — use next/image
- Very specific: line 80
Use raw <a> for internal links — use next/link
- Very specific: line 82
Add nofollow to internal links
- Very specific: line 83
Put critical content behind useEffect — server-render it
- Very specific: line 84
Use beforeInteractive for analytics scripts
- Distinctive: line 87
Add FAQ schema on e-commerce sites — since 2023 Google restricts FAQ rich results to government/health sites, making FAQ schema essentially …
- Distinctive: line 88
Use generic alt text on product images
≈ “Common” is an estimate: at least 1 in 5 of the 1,645 Copilot instructions 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
SEO Guidelines for Next.js E-Commerce
Advisory only: These are suggestions. Do not auto-fix code based on these rules — only recommend changes when the developer asks. Compatible with Next.js 15.x/16.x, App Router and Pages Router.
This is a Next.js e-commerce site with multi-locale support. It serves multiple locale variants using /{lang}-{COUNTRY}/ URL patterns (e.g. /en-GB/, /de-DE/, /fr-CH/).
Metadata — Every Page Needs This
- Use the Next.js Metadata API (
generateMetadata/metadataexport in App Router,next/headin Pages Router) — never hardcode in JSX - Title: Keep concise (truncated ~50-60 chars on desktop), format
{Content} | {Brand}, include model number on product pages - Description: Keep concise and unique per page, include CTA for e-commerce ("Buy online", "Order now")
- Canonical URL: Required on every page, absolute URL with locale prefix, self-referencing
- Open Graph: og:title, og:description, og:image (min 1200x630), og:url (matches canonical), og:type, og:locale
- Twitter: twitter:card (summary_large_image for products), twitter:title, twitter:description
Structured Data (JSON-LD)
- Always use
<script type="application/ld+json">— never Microdata - Render server-side for immediate crawler access
- Use
@grapharray to combine multiple schemas on one page
Product pages MUST include (required for rich results):
name,image(array of URLs)offers.price(numeric value, no currency symbols — both39.99and"39.99"are valid),offers.priceCurrency(locale-dependent)offers.availability(https://schema.org/InStock or OutOfStock)
Strongly recommended: sku, brand (from site config), description. Provide gtin if available; otherwise brand + mpn for product identification.
BreadcrumbList on every non-homepage page (if breadcrumbs are used) — must match visible breadcrumbs.
Hreflang (Multi-Locale)
- Every page needs
<link rel="alternate" hreflang="xx-YY">for ALL locale variants +x-default - Self-referencing required — page must include its own locale in hreflang set
- Implement hreflang via Metadata API (App Router) or
next/head(Pages Router) - Language switcher must link to the same page in other locales, not just the homepage
Images
- Always use
<Image>fromnext/image— never raw<img> - Alt text: Descriptive, include product name on product images
- Never use generic alt: "image", "photo", "banner", "product image"
- Empty
alt=""only for purely decorative images - Always specify
width/heightor usefill— prevents CLS - Use
priorityon the main above-fold image (LCP element) — 1-2 per page max
URLs & Routing
- Every URL must have locale prefix:
/{lang}-{COUNTRY}/ - Slugs: lowercase, hyphen-separated, no special characters
- Never hardcode locale — derive from route params
- Search pages (
/*/search/) are blocked by robots.txt — always addnoindextoo - Page 1 canonical: no
?page=1, just the clean URL
Links
- Always use
<Link>fromnext/linkfor internal navigation — never raw<a> - Descriptive anchor text — never "click here" or "read more"
- No
rel="nofollow"on internal links - External links with
target="_blank": modern browsers auto-addrel="noopener", but adding it explicitly is still harmless and ensures compatibility with older browsers
Performance (Core Web Vitals = Ranking Factor)
- Server-side rendering by default — only client-side JS for interactivity
- Critical content (product name, price, description) must be server-rendered
- Analytics/tag managers:
strategy="afterInteractive"— neverbeforeInteractive - Use
next/fontwithdisplay: 'swap'— never load fonts via<link> - Dynamic imports for below-fold components
Redirects
- 301 for permanent URL changes — never 302 for permanent moves
- 302 for locale detection redirects (temporary)
- No redirect chains (A→B→C) — always redirect to final URL
- Custom 404 page with navigation — never redirect 404s to homepage
DO NOT
- Use raw
<img>tags — use next/image - Use raw
<a>for internal links — use next/link - Hardcode locale strings (
/en-GB/) — use params - Add
nofollowto internal links - Put critical content behind
useEffect— server-render it - Use
beforeInteractivefor analytics scripts - Create redirect chains
- Set price to 0 when hidden — omit the field
- Add FAQ schema on e-commerce sites — since 2023 Google restricts FAQ rich results to government/health sites, making FAQ schema essentially worthless for e-commerce
- Use generic alt text on product images
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.

