agentleFS
mvstepanekmvstepanek/nextjs-ecommerce-seo-skills/.github/copilot-instructions.md

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 repositoryOne other file it gives its agents.

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
  1. Very specific:

    Use the Next.js Metadata API (generateMetadata / metadata export in App Router, next/head in Pages Router) — never hardcode in JSX

    line 9
  2. Very specific:

    Title: Keep concise (truncated ~50-60 chars on desktop), format {Content} | {Brand}, include model number on product pages

    line 10
  3. Distinctive:

    Description: Keep concise and unique per page, include CTA for e-commerce ("Buy online", "Order now")

    line 11
  4. Very specific:

    Always use <script type="application/ld+json"> — never Microdata

    line 18
  5. Very specific:

    Use @graph array to combine multiple schemas on one page

    line 20
  6. Very specific:

    Every page needs <link rel="alternate" hreflang="xx-YY"> for ALL locale variants + x-default

    line 33
  7. Distinctive:

    Never use generic alt: "image", "photo", "banner", "product image"

    line 42
  8. Very specific:

    Always specify width/height or use fill — prevents CLS

    line 44
  9. Very specific:

    Use priority on the main above-fold image (LCP element) — 1-2 per page max

    line 45
  10. Very specific:

    Every URL must have locale prefix: /{lang}-{COUNTRY}/

    line 49
  11. Distinctive:

    Never hardcode locale — derive from route params

    line 51
  12. Very specific:

    Search pages (/*/search/) are blocked by robots.txt — always add noindex too

    line 52
  13. Very specific:

    Use next/font with display: 'swap' — never load fonts via <link>

    line 67
  14. Distinctive:

    No redirect chains (A→B→C) — always redirect to final URL

    line 74
  15. Very specific:

    Use raw <img> tags — use next/image

    line 79
  16. Very specific:

    Use raw <a> for internal links — use next/link

    line 80
  17. Very specific:

    Add nofollow to internal links

    line 82
  18. Very specific:

    Put critical content behind useEffect — server-render it

    line 83
  19. Very specific:

    Use beforeInteractive for analytics scripts

    line 84
  20. Distinctive:

    Add FAQ schema on e-commerce sites — since 2023 Google restricts FAQ rich results to government/health sites, making FAQ schema essentially …

    line 87
  21. Distinctive:

    Use generic alt text on product images

    line 88

≈ “Common” is an estimate: at least 1 in 5 of the 3,950 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

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 / metadata export in App Router, next/head in 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 @graph array 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 — both 39.99 and "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> from next/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/height or use fill — prevents CLS
  • Use priority on 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 add noindex too
  • Page 1 canonical: no ?page=1, just the clean URL

Links

  • Always use <Link> from next/link for 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-add rel="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" — never beforeInteractive
  • Use next/font with display: '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 nofollow to internal links
  • Put critical content behind useEffect — server-render it
  • Use beforeInteractive for 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

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.