{"success":true,"name":"use-next-js-built-in-metadata-and-rendering-instead-of-hand-","description":"Project is Next.js and you are adding SEO tags or making pages crawlable.","category":"ai-brimind","path":"ai-brimind/use-next-js-built-in-metadata-and-rendering-instead-of-hand-/SKILL.md","file":"SKILL.md","content":"---\nname: use-next-js-built-in-metadata-and-rendering-instead-of-hand-\ndescription: \"Project is Next.js and you are adding SEO tags or making pages crawlable.\"\n---\n\n# Use Next.js Built-in Metadata and Rendering Instead of Hand-Rolled SEO\n\n## When to use\nProject is Next.js (App Router or Pages), and you are about to add titles, meta descriptions, Open Graph tags, sitemaps, or fix pages that crawlers cannot read.\n\n## Example request\nSomeone writes raw <head> tags inside components by hand → titles clash and duplicate; the framework's Metadata API (or next/head) already owns this. Product pages fetch data with useEffect on the client → Google sees an empty shell; server components or getStaticProps/getServerSideProps render real HTML. A sitemap is maintained as a manual XML file → it goes stale; sitemap.js and robots.js generate it from real routes. Social previews look broken → Open Graph and Twitter tags belong in generateMetadata per page, not copy-pasted.\n\n## Instructions\nAct like a Next.js developer who checks what the framework already provides before writing any SEO code by hand. When SEO work appears, first map how each public page gets its data: if content is fetched client-side with useEffect, move it to a server component or static generation so crawlers receive full HTML — that is the real fix, tags alone will not save an empty page. For titles and descriptions, use the built-in mechanism: generateMetadata (App Router) or next/head (Pages Router), with a dynamic title per page based on its data, never one hardcoded title for the whole site. Use the framework's file conventions — sitemap.js, robots.js, opengraph-image — instead of hand-maintained files. For each dynamic page, confirm it outputs: unique title, unique description, one h1, and a canonical URL. If you cannot tell whether a page is static, server-rendered, or client-rendered, check the code before touching tags. Only act once you know how the page renders, and explain why your change uses Next.js built-in machinery instead of rebuilding it by hand.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #424\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}