What this prompt does
This prompt turns an AI assistant into a Next.js SEO and performance engineer. It takes your [nextjs_version] and current [current_lcp] and [current_cls] scores, then walks through ten concrete deliverables: dynamic metadata via generateMetadata, JSON-LD structured data, a generated sitemap, robots.txt, next/image with blur placeholders, font and script optimization, OpenGraph tags, canonical handling, and a Lighthouse CI GitHub Action.
The structure works because it pins the AI to real, named Next.js APIs rather than vague advice. Feeding in your starting [current_lcp] and [current_cls] gives the model a baseline to optimize against the explicit targets (LCP < 2.5s, CLS < 0.1, FID < 100ms), so the output is corrective, not generic. The [page_types] and [schema_types] variables decide which routes get metadata and which Schema.org entities get emitted, while [url_patterns] shapes the canonical logic for paginated and localized pages.
When to use it
- You shipped a Next.js app and Lighthouse or Search Console flags weak Core Web Vitals
- You need
generateMetadataand JSON-LD wired up across several[page_types]consistently - You want a dynamic
sitemap.xmland correct canonical URLs for[url_patterns] - You keep regressing Core Web Vitals on deploys and want Lighthouse CI as a guardrail
- You're standardizing a reusable SEO component instead of copy-pasting meta tags
- You're migrating from the Pages Router and need App Router metadata patterns
Example output
Expect a structured implementation plan with code: a reusable SEO/metadata component, generateMetadata functions per route group, JSON-LD snippets for each of your [schema_types], a sitemap.ts using generateSitemaps, a next/font and next/script configuration, and a Lighthouse CI workflow YAML. It reads like a checklist you can implement file by file rather than a single paste-ready blob.
Pro tips
- Set
[current_lcp]and[current_cls]to your real measured numbers so the model prioritizes your actual bottleneck instead of guessing - Trim
[page_types]to the routes that actually matter for search; metadata on low-value pages is noise - Match
[schema_types]to your real content; emittingProductschema on a blog invites rich-result errors - Be specific with
[url_patterns]— paginated lists and localized routes are where canonical bugs hide - I cap the scope to a few
[page_types]first, verify the wins in Lighthouse, then expand, rather than refactoring everything at once - Always keep the Lighthouse CI step; a good score regresses quietly the moment it isn't enforced on every deploy