[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7A5B7540ZMWGT58YRFKSDB3":3,"skill-same:01M7A5B7540ZMWGT58YRFKSDB3":53},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":6,"ownerHtmlUrl":35,"ownerBlogUrl":36,"ownerDescription":37,"updatedAt":38,"install":39,"resources":52},"01M7A5B7540ZMWGT58YRFKSDB3","frontend-seo",null,"A portable, framework-agnostic SEO system for any React or React Native-for-web frontend. Centralizes site metadata in one constants module, derives canonical URLs from a single base, builds per-route metadata (title, description, canonical, Open Graph, Twitter\u002FX cards), generates...","MHassan0000\u002FSkills","MHassan0000","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F224296448?v=4","01M7A14DTC1EZCRN04582533RD","Muhammad Hassan Yousaf","01M7A14DV10KTW8NHQTJPD08X0",1,"MIT","https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fantigravity skills\u002Fagentic-awesome-skills\u002Fskills\u002Ffrontend-seo\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: frontend-seo\ndescription: A portable, framework-agnostic SEO system for any React or React Native-for-web frontend. Centralizes site metadata in one constants module, derives canonical URLs from a single base, builds per-route metadata (title, description, canonical, Open Graph, Twitter\u002FX cards), generates...\nrisk: critical\nsource: https:\u002F\u002Fgithub.com\u002Fstareezy-1\u002Ffrontend-architecture-skill\u002Ftree\u002Fmain\u002Fskills\u002Ffrontend-seo\nsource_repo: stareezy-1\u002Ffrontend-architecture-skill\nsource_type: community\ndate_added: 2026-07-01\nlicense: MIT\nlicense_source: https:\u002F\u002Fgithub.com\u002Fstareezy-1\u002Ffrontend-architecture-skill\u002Fblob\u002Fmain\u002FLICENSE\n---\n\n# Frontend SEO (portable, builder-based)\n## When to Use\n\nUse this skill when you need a portable, framework-agnostic SEO system for any React or React Native-for-web frontend. Centralizes site metadata in one constants module, derives canonical URLs from a single base, builds per-route metadata (title, description, canonical, Open Graph, Twitter\u002FX cards), generates...\n\n\n> Portable skill — readable by Claude Code, OpenCode, Codex, Cursor, Windsurf, and others.\n> This skill describes an **SEO system** — a set of pure builder functions plus a thin\n> framework adapter — not a component library or a visual style.\n> It pairs with the **frontend-architecture** skill: the SEO system lives in a single\n> service module (`services\u002Fseo\u002F`) and is consumed through one barrel.\n\nThe goal: every route ships **correct, consistent, machine-readable metadata** without\nanyone copy-pasting `\u003Cmeta>` tags. Site identity lives in **one** constants module, URLs are\n**always absolute and canonical**, and search engines get a **sitemap, robots rules, an RSS\nfeed, and typed JSON-LD** derived from the same content the app already renders.\n\n---\n\n## 0. The five core ideas\n\n1. **One source of truth for identity.** Site URL, name, description, keywords, author, social handles, OG image, and verification tokens live in a single `constants\u002Fseo` module. Nothing about the site's identity is hardcoded anywhere else.\n2. **URLs are always absolute and canonical.** A single `canonicalUrl(path)` function turns any path into an absolute, trailing-slash-normalized URL. Every sitemap entry, RSS link, OG URL, and JSON-LD `@id` flows through it.\n3. **Builders are pure; the adapter is thin.** Metadata, sitemap, robots, RSS, and JSON-LD are produced by pure functions that take data and return plain objects. Only one small function touches the framework's metadata type. Pure functions are trivially unit-testable.\n4. **Structured data is typed and reused.** JSON-LD objects share a `JsonLd` type and a small set of `schema.org` builders (`Person`, `WebSite`, `BlogPosting`, `CreativeWork`, `BreadcrumbList`, `FAQPage`). Entities cross-reference each other by stable `@id`.\n5. **Discovery surfaces are generated from content.** `sitemap.xml`, `robots.txt`, and the RSS feed are built from the same content collections the app renders — never maintained by hand, never drifting.\n\nEverything below is the mechanical application of these five ideas.\n\n---\n\n## 1. Directory layout\n\nThe SEO system is one service module plus its constants and types. It slots directly into the\n`frontend-architecture` shape (`shared\u002F` or `services\u002F`).\n\n```\nsrc\u002F\n├── constants\u002F\n│   └── seo.ts                  ← SINGLE source of truth for site identity\n├── types\u002F\n│   └── seo.ts                  ← SchemaType, RouteDescriptor, SitemapEntry,\n│                                  RobotsConfig, RssItem, Redirect, JsonLd\n├── services\u002Fseo\u002F\n│   ├── index.ts                ← barrel: canonicalUrl, buildMetadata,\n│   │                              sitemapEntries, robots, rssItems,\n│   │                              structuredData, redirects\n│   └── structured-data.ts      ← per-type JSON-LD builders (Person, WebSite, …)\n└── app\u002F (or routes\u002F)           ← THIN adapter: route files call the builders\n    ├── layout.tsx              ← global default metadata (from constants\u002Fseo)\n    ├── sitemap.ts              ← mounts sitemapEntries()\n    ├── robots.ts               ← mounts robots()\n    └── feed.xml\u002Froute.ts       ← mounts rssItems()\n```\n\nRule of thumb: **builders never import the framework** (except the one `buildMetadata` adapter);\n**route files never build SEO data inline** — they call a builder and mount the result.\n\n---\n\n## 2. One source of truth for identity (`constants\u002Fseo`)\n\nEverything about the site's identity is a named constant. No bare strings scattered across\nroute files, no second copy of the description, no hardcoded base URL.\n\n```ts\n\u002F\u002F constants\u002Fseo.ts\nexport const SITE_URL = \"https:\u002F\u002Fexample.com\"; \u002F\u002F no trailing slash\nexport const SITE_NAME = \"Jane Doe\";\nexport const SITE_HANDLE = \"@janedoe\";\nexport const SITE_LOCALE = \"en_US\";\n\nexport const SITE_TITLE_DEFAULT = \"Jane Doe — Senior Engineer\";\nexport const SITE_TITLE_TEMPLATE = \"%s | Jane Doe\"; \u002F\u002F child pages fill %s\n\nexport const SITE_DESCRIPTION =\n  \"Senior engineer building cross-platform products with React and TypeScript.\";\n\nexport const SITE_KEYWORDS = [\"Jane Doe\", \"React\", \"TypeScript\", \"Engineer\"];\n\nexport const AUTHOR_NAME = \"Jane Doe\";\nexport const AUTHOR_EMAIL = \"jane@example.com\";\nexport const AUTHOR_GITHUB = \"https:\u002F\u002Fgithub.com\u002Fjanedoe\";\nexport const AUTHOR_LINKEDIN = \"https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fjanedoe\u002F\";\n\nexport const OG_IMAGE_PATH = \"\u002Fog-image.png\"; \u002F\u002F relative; canonicalized at use\nexport const OG_IMAGE_WIDTH = 1200;\nexport const OG_IMAGE_HEIGHT = 630;\n\nexport const GOOGLE_SITE_VERIFICATION = \"your-search-console-token\";\n```\n\nWhy: changing the description or the OG image touches **one line**. Structured data, OG tags, and\nTwitter cards all read the same values, so they can never disagree.\n\n---\n\n## 3. Typed data models (`types\u002Fseo`)\n\nMinimal but typed. These are the contracts every builder honors.\n\n```ts\n\u002F\u002F types\u002Fseo.ts\nexport type SchemaType =\n  | \"Person\"\n  | \"WebSite\"\n  | \"BlogPosting\"\n  | \"CreativeWork\"\n  | \"BreadcrumbList\"\n  | \"FAQPage\";\n\n\u002F** Describes a route for metadata generation. *\u002F\nexport interface RouteDescriptor {\n  path: string; \u002F\u002F e.g. \"\u002Fblog\u002Fmy-post\"\n  title: string;\n  description: string;\n  ogImage?: string; \u002F\u002F falls back to OG_IMAGE_PATH\n  indexable?: boolean; \u002F\u002F whether it appears in the sitemap\n}\n\nexport interface SitemapEntry {\n  url: string; \u002F\u002F absolute\n  lastModified?: string;\n  changeFrequency?:\n    | \"always\"\n    | \"hourly\"\n    | \"daily\"\n    | \"weekly\"\n    | \"monthly\"\n    | \"yearly\"\n    | \"never\";\n  priority?: number;\n}\n\nexport interface RobotsConfig {\n  rules: Array\u003C{ userAgent: string; allow?: string[]; disallow?: string[] }>;\n  sitemap: string; \u002F\u002F absolute\n}\n\nexport interface RssItem {\n  title: string;\n  link: string; \u002F\u002F absolute\n  description: string;\n  pubDate: string; \u002F\u002F ISO-8601\n  guid: string;\n}\n\nexport interface Redirect {\n  source: string;\n  destination: string;\n  permanent: boolean; \u002F\u002F 301 when true\n}\n\n\u002F** A JSON-LD object: always a schema.org context + type, plus type-specific fields. *\u002F\nexport interface JsonLd {\n  \"@context\": \"https:\u002F\u002Fschema.org\";\n  \"@type\": SchemaType;\n  [key: string]: unknown;\n}\n```\n\nNote the `I`-prefix convention from `frontend-architecture` applies to **stateful UI interfaces**;\nthese SEO data models are plain DTOs and follow the source project's existing convention\n(here, unprefixed). Keep whichever convention the host project already uses — consistency wins.\n\n---\n\n## 4. Canonical URLs (the spine of the system)\n\nOne function, used everywhere. It guarantees absolute, normalized, double-slash-free URLs so\nsearch engines never see two URLs for the same page.\n\n```ts\n\u002F\u002F services\u002Fseo\u002Findex.ts\nimport { SITE_URL } from \"@\u002Fconstants\u002Fseo\";\n\nexport function canonicalUrl(path: string): string {\n  const normalized = path.startsWith(\"\u002F\") ? path : `\u002F${path}`;\n  if (normalized === \"\u002F\") return SITE_URL; \u002F\u002F root → base, no trailing slash\n  const withoutTrailing = normalized.endsWith(\"\u002F\")\n    ? normalized.slice(0, -1)\n    : normalized;\n  return `${SITE_URL}${withoutTrailing}`;\n}\n```\n\n**Hard rules:**\n\n- Never concatenate `SITE_URL + path` by hand — always `canonicalUrl(path)`.\n- Pick one trailing-slash policy (this skill: **no trailing slash**) and apply it everywhere.\n- Every OG `url`, sitemap `url`, RSS `link`, and JSON-LD `@id`\u002F`url` goes through `canonicalUrl`.\n\n---\n\n## 5. Per-route metadata\n\n### 5.1 The pure builder\n\n`buildMetadata` is the **only** function allowed to know about the framework's metadata type.\nEverything else is framework-free.\n\n```ts\n\u002F\u002F services\u002Fseo\u002Findex.ts  (Next.js example — swap the return type for other frameworks)\nimport type { Metadata } from \"next\";\nimport { OG_IMAGE_PATH } from \"@\u002Fconstants\u002Fseo\";\nimport type { RouteDescriptor } from \"@\u002Ftypes\u002Fseo\";\n\nexport function buildMetadata(route: RouteDescriptor): Metadata {\n  const canonical = canonicalUrl(route.path);\n  const ogImageUrl = canonicalUrl(route.ogImage ?? OG_IMAGE_PATH);\n\n  return {\n    title: route.title,\n    description: route.description,\n    alternates: { canonical },\n    openGraph: { images: [ogImageUrl] },\n  };\n}\n```\n\n### 5.2 Global defaults live in the root layout\n\nSet the title template, default OG\u002FTwitter cards, robots policy, icons, manifest, and\nverification **once** at the root. Child routes only override what differs.\n\n```tsx\n\u002F\u002F app\u002Flayout.tsx — global metadata, all values from constants\u002Fseo\nimport type { Metadata } from \"next\";\nimport {\n  SITE_URL,\n  SITE_NAME,\n  SITE_HANDLE,\n  SITE_LOCALE,\n  SITE_TITLE_DEFAULT,\n  SITE_TITLE_TEMPLATE,\n  SITE_DESCRIPTION,\n  SITE_KEYWORDS,\n  AUTHOR_NAME,\n  OG_IMAGE_PATH,\n  OG_IMAGE_WIDTH,\n  OG_IMAGE_HEIGHT,\n  GOOGLE_SITE_VERIFICATION,\n} from \"@\u002Fconstants\u002Fseo\";\n\nexport const metadata: Metadata = {\n  metadataBase: new URL(SITE_URL),\n  title: { default: SITE_TITLE_DEFAULT, template: SITE_TITLE_TEMPLATE },\n  description: SITE_DESCRIPTION,\n  keywords: SITE_KEYWORDS,\n  authors: [{ name: AUTHOR_NAME, url: SITE_URL }],\n  alternates: {\n    canonical: SITE_URL,\n    types: { \"application\u002Frss+xml\": `${SITE_URL}\u002Ffeed.xml` },\n  },\n  openGraph: {\n    type: \"website\",\n    locale: SITE_LOCALE,\n    url: SITE_URL,\n    siteName: SITE_NAME,\n    title: SITE_TITLE_DEFAULT,\n    description: SITE_DESCRIPTION,\n    images: [\n      { url: OG_IMAGE_PATH, width: OG_IMAGE_WIDTH, height: OG_IMAGE_HEIGHT },\n    ],\n  },\n  twitter: {\n    card: \"summary_large_image\",\n    site: SITE_HANDLE,\n    creator: SITE_HANDLE,\n    title: SITE_TITLE_DEFAULT,\n    description: SITE_DESCRIPTION,\n    images: [OG_IMAGE_PATH],\n  },\n  robots: {\n    index: true,\n    follow: true,\n    googleBot: {\n      index: true,\n      follow: true,\n      \"max-image-preview\": \"large\",\n      \"max-snippet\": -1,\n    },\n  },\n  verification: { google: GOOGLE_SITE_VERIFICATION },\n  manifest: \"\u002Fmanifest.webmanifest\",\n};\n```\n\n### 5.3 Per-route override (dynamic pages)\n\nA dynamic route reads its entity and returns route-specific metadata. The title template fills\n`%s` automatically, so just pass the page title.\n\n```tsx\n\u002F\u002F app\u002Fblog\u002F[slug]\u002Fpage.tsx\nimport { buildMetadata } from \"@\u002Fservices\u002Fseo\";\n\nexport async function generateMetadata({ params }) {\n  const post = await loadPost(params.slug);\n  return buildMetadata({\n    path: `\u002Fblog\u002F${post.slug}`,\n    title: post.title,\n    description: post.description,\n    ogImage: post.heroImage,\n  });\n}\n```\n\n**Hard rules:**\n\n- Set defaults once in the layout; override per route only where it differs.\n- Use a title **template** so child pages don't repeat the site name.\n- Every page resolves a single `canonical` — never emit duplicate or relative canonicals.\n\n---\n\n## 6. Discovery surfaces (generated from content)\n\n### 6.1 Sitemap\n\nBuild entries from the **same content collections** the app renders, deduped, all absolute.\n\n```ts\n\u002F\u002F services\u002Fseo\u002Findex.ts\nimport { ROUTES } from \"@\u002Fconstants\u002Froutes\";\nimport type { SitemapEntry } from \"@\u002Ftypes\u002Fseo\";\n\nconst PRIMARY_ROUTES: Array\u003C{\n  path: string;\n  changeFrequency: SitemapEntry[\"changeFrequency\"];\n  priority: number;\n}> = [\n  { path: ROUTES.HOME, changeFrequency: \"weekly\", priority: 1.0 },\n  { path: ROUTES.BLOG, changeFrequency: \"daily\", priority: 0.9 },\n  \u002F\u002F …other primary routes\n];\n\nexport function sitemapEntries(options: {\n  blogSlugs: string[];\n  projectSlugs: string[];\n}): SitemapEntry[] {\n  const seen = new Set\u003Cstring>();\n  const entries: SitemapEntry[] = [];\n  const add = (e: SitemapEntry) => {\n    if (!seen.has(e.url)) {\n      seen.add(e.url);\n      entries.push(e);\n    }\n  };\n  const today = new Date().toISOString().split(\"T\")[0];\n\n  for (const r of PRIMARY_ROUTES)\n    add({\n      url: canonicalUrl(r.path),\n      lastModified: today,\n      changeFrequency: r.changeFrequency,\n      priority: r.priority,\n    });\n  for (const slug of options.blogSlugs)\n    add({\n      url: canonicalUrl(`\u002Fblog\u002F${slug}`),\n      lastModified: today,\n      changeFrequency: \"monthly\",\n      priority: 0.7,\n    });\n  for (const slug of options.projectSlugs)\n    add({\n      url: canonicalUrl(`\u002Fprojects\u002F${slug}`),\n      lastModified: today,\n      changeFrequency: \"monthly\",\n      priority: 0.8,\n    });\n\n  return entries;\n}\n```\n\n```ts\n\u002F\u002F app\u002Fsitemap.ts — thin adapter\nimport type { MetadataRoute } from \"next\";\nimport { sitemapEntries } from \"@\u002Fservices\u002Fseo\";\n\nexport default function sitemap(): MetadataRoute.Sitemap {\n  const entries = sitemapEntries({\n    blogSlugs: loadPublishedBlogSlugs(),\n    projectSlugs: loadProjectSlugs(),\n  });\n  return entries.map((e) => ({\n    url: e.url,\n    lastModified: e.lastModified ? new Date(e.lastModified) : new Date(),\n    changeFrequency:\n      e.changeFrequency as MetadataRoute.Sitemap[0][\"changeFrequency\"],\n    priority: e.priority,\n  }));\n}\n```\n\n### 6.2 Robots\n\n```ts\n\u002F\u002F app\u002Frobots.ts\nimport type { MetadataRoute } from \"next\";\nimport { SITE_URL } from \"@\u002Fconstants\u002Fseo\";\n\nexport default function robots(): MetadataRoute.Robots {\n  return {\n    rules: [\n      { userAgent: \"*\", allow: \"\u002F\", disallow: [\"\u002Fapi\u002F\", \"\u002F_next\u002F\", \"\u002Fadmin\u002F\"] },\n      { userAgent: \"Googlebot\", allow: \"\u002F\" },\n    ],\n    sitemap: `${SITE_URL}\u002Fsitemap.xml`,\n    host: SITE_URL,\n  };\n}\n```\n\nAlways **disallow private surfaces** (`\u002Fapi\u002F`, `\u002Fadmin\u002F`, build internals) and **point at the sitemap**.\n\n### 6.3 RSS feed\n\n```ts\n\u002F\u002F services\u002Fseo\u002Findex.ts\nimport type { RssItem } from \"@\u002Ftypes\u002Fseo\";\n\nexport function rssItems(posts: BlogPost[]): RssItem[] {\n  return posts.map((post) => {\n    const link = canonicalUrl(`\u002Fblog\u002F${post.slug}`);\n    return {\n      title: post.title,\n      link,\n      description: post.description,\n      pubDate: post.publishDate,\n      guid: link,\n    };\n  });\n}\n```\n\n```ts\n\u002F\u002F app\u002Ffeed.xml\u002Froute.ts — sort newest-first, CDATA-wrap free text\nimport { rssItems } from \"@\u002Fservices\u002Fseo\";\nimport { SITE_NAME, SITE_URL, SITE_DESCRIPTION } from \"@\u002Fconstants\u002Fseo\";\n\nexport function GET(): Response {\n  const items = rssItems(loadPublishedPostsNewestFirst());\n  const xml = `\u003C?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\u003Crss version=\"2.0\">\u003Cchannel>\n  \u003Ctitle>${SITE_NAME}\u003C\u002Ftitle>\u003Clink>${SITE_URL}\u003C\u002Flink>\n  \u003Cdescription>${SITE_DESCRIPTION}\u003C\u002Fdescription>\n  ${items\n    .map(\n      (i) => `\u003Citem>\n    \u003Ctitle>\u003C![CDATA[${i.title}]]>\u003C\u002Ftitle>\u003Clink>${i.link}\u003C\u002Flink>\n    \u003Cdescription>\u003C![CDATA[${i.description}]]>\u003C\u002Fdescription>\n    \u003CpubDate>${i.pubDate}\u003C\u002FpubDate>\u003Cguid>${i.guid}\u003C\u002Fguid>\n  \u003C\u002Fitem>`,\n    )\n    .join(\"\")}\n\u003C\u002Fchannel>\u003C\u002Frss>`;\n  return new Response(xml, {\n    headers: { \"Content-Type\": \"application\u002Frss+xml; charset=utf-8\" },\n  });\n}\n```\n\nCDATA-wrap titles\u002Fdescriptions so apostrophes and markup never break the feed.\n\n---\n\n## 7. Structured data (typed JSON-LD)\n\n### 7.1 The generic builder\n\n```ts\n\u002F\u002F services\u002Fseo\u002Findex.ts\nimport type { JsonLd, SchemaType } from \"@\u002Ftypes\u002Fseo\";\n\nexport function structuredData(\n  type: SchemaType,\n  data: Record\u003Cstring, unknown>,\n): JsonLd {\n  return { \"@context\": \"https:\u002F\u002Fschema.org\", \"@type\": type, ...data };\n}\n```\n\n### 7.2 Per-type builders, cross-referenced by stable `@id`\n\n```ts\n\u002F\u002F services\u002Fseo\u002Fstructured-data.ts\nimport { structuredData } from \".\u002Findex\";\nimport { SITE_URL, AUTHOR_NAME, SITE_DESCRIPTION } from \"@\u002Fconstants\u002Fseo\";\nimport type { JsonLd } from \"@\u002Ftypes\u002Fseo\";\n\nexport function personJsonLd(): JsonLd {\n  return structuredData(\"Person\", {\n    \"@id\": `${SITE_URL}\u002F#person`, \u002F\u002F stable identity others reference\n    name: AUTHOR_NAME,\n    url: SITE_URL,\n    description: SITE_DESCRIPTION,\n    sameAs: [\n      \u002F* social profile URLs *\u002F\n    ],\n  });\n}\n\nexport function websiteJsonLd(): JsonLd {\n  return structuredData(\"WebSite\", {\n    \"@id\": `${SITE_URL}\u002F#website`,\n    url: SITE_URL,\n    name: AUTHOR_NAME,\n    author: { \"@id\": `${SITE_URL}\u002F#person` }, \u002F\u002F reference, not a copy\n    potentialAction: {\n      \"@type\": \"SearchAction\",\n      target: {\n        \"@type\": \"EntryPoint\",\n        urlTemplate: `${SITE_URL}\u002Fblog?q={search_term_string}`,\n      },\n      \"query-input\": \"required name=search_term_string\",\n    },\n  });\n}\n\nexport function blogPostingJsonLd(post: BlogPost, url: string): JsonLd {\n  return structuredData(\"BlogPosting\", {\n    \"@id\": url,\n    headline: post.title,\n    description: post.description,\n    datePublished: post.publishDate,\n    dateModified: post.publishDate,\n    author: {\n      \"@type\": \"Person\",\n      \"@id\": `${SITE_URL}\u002F#person`,\n      name: post.author,\n    },\n    publisher: {\n      \"@type\": \"Person\",\n      \"@id\": `${SITE_URL}\u002F#person`,\n      name: AUTHOR_NAME,\n    },\n    url,\n    mainEntityOfPage: { \"@type\": \"WebPage\", \"@id\": url },\n    image: {\n      \"@type\": \"ImageObject\",\n      url: post.heroImage,\n      width: 1200,\n      height: 630,\n    },\n    keywords: post.tags.join(\", \"),\n  });\n}\n\nexport function breadcrumbListJsonLd(\n  items: Array\u003C{ name: string; url: string }>,\n): JsonLd {\n  return structuredData(\"BreadcrumbList\", {\n    itemListElement: items.map((item, i) => ({\n      \"@type\": \"ListItem\",\n      position: i + 1,\n      name: item.name,\n      item: item.url,\n    })),\n  });\n}\n\nexport function faqPageJsonLd(\n  faqs: Array\u003C{ question: string; answer: string }>,\n): JsonLd {\n  return structuredData(\"FAQPage\", {\n    mainEntity: faqs.map((f) => ({\n      \"@type\": \"Question\",\n      name: f.question,\n      acceptedAnswer: { \"@type\": \"Answer\", text: f.answer },\n    })),\n  });\n}\n```\n\n`CreativeWork` follows the same shape for projects\u002Fportfolio items (name, description, author by\n`@id`, `keywords`, optional `codeRepository`\u002F`sameAs`\u002F`image`).\n\n### 7.3 Injecting JSON-LD into a page\n\nRender a `\u003Cscript type=\"application\u002Fld+json\">` with `JSON.stringify`. Match the breadcrumb trail\nto the page's real position.\n\n```tsx\n\u002F\u002F app\u002Fblog\u002F[slug]\u002Fpage.tsx\nimport { canonicalUrl } from \"@\u002Fservices\u002Fseo\";\nimport {\n  blogPostingJsonLd,\n  breadcrumbListJsonLd,\n} from \"@\u002Fservices\u002Fseo\u002Fstructured-data\";\n\nexport default async function Page({ params }) {\n  const post = await loadPost(params.slug);\n  const url = canonicalUrl(`\u002Fblog\u002F${post.slug}`);\n  const postLd = blogPostingJsonLd(post, url);\n  const crumbLd = breadcrumbListJsonLd([\n    { name: \"Home\", url: canonicalUrl(\"\u002F\") },\n    { name: \"Blog\", url: canonicalUrl(\"\u002Fblog\") },\n    { name: post.title, url },\n  ]);\n  return (\n    \u003C>\n      \u003Cscript\n        type=\"application\u002Fld+json\"\n        dangerouslySetInnerHTML={{ __html: JSON.stringify(postLd) }}\n        suppressHydrationWarning\n      \u002F>\n      \u003Cscript\n        type=\"application\u002Fld+json\"\n        dangerouslySetInnerHTML={{ __html: JSON.stringify(crumbLd) }}\n        suppressHydrationWarning\n      \u002F>\n      {\u002F* …page content *\u002F}\n    \u003C\u002F>\n  );\n}\n```\n\n**Hard rules:**\n\n- Give each entity a **stable `@id`** (e.g. `${SITE_URL}\u002F#person`) and **reference** it elsewhere instead of duplicating fields.\n- One `BlogPosting`\u002F`CreativeWork` per detail page; a `BreadcrumbList` on every nested page.\n- `Person` + `WebSite` belong on the home page; `FAQPage` only where real Q&A is shown.\n- Validate output with Google's Rich Results Test \u002F Schema Markup Validator before shipping.\n\n---\n\n## 8. Framework adapters\n\nThe builders are framework-free. Only the mounting layer changes.\n\n| Framework              | Per-route metadata                                                                              | sitemap \u002F robots \u002F feed                                                                    |\n| ---------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |\n| **Next.js App Router** | `export const metadata` (static) or `generateMetadata` (dynamic) returning `buildMetadata(...)` | `app\u002Fsitemap.ts`, `app\u002Frobots.ts`, `app\u002Ffeed.xml\u002Froute.ts`                                 |\n| **Remix**              | `meta` export per route, mapping `buildMetadata`'s fields to `\u003Cmeta>` descriptors               | resource routes (`routes\u002Fsitemap[.]xml.ts`, etc.) returning the builder output as XML\u002Ftext |\n| **Astro**              | `\u003Chead>` in a layout reading the same constants; per-page frontmatter overrides                 | `src\u002Fpages\u002Fsitemap.xml.ts`, `robots.txt.ts`, `rss.xml.ts` endpoints                        |\n| **React + Vite (SPA)** | `react-helmet-async` (or a head manager) fed by `buildMetadata`'s plain object                  | build-time script that writes `sitemap.xml`\u002F`robots.txt` from the same builders            |\n| **Expo Router (web)**  | static head config \u002F `expo-router` head; SEO matters only on the web target                     | a small web-only build step calling `sitemapEntries`\u002F`rssItems`                            |\n\nFor a `buildMetadata` that must stay framework-neutral, return a plain shape\n(`{ title, description, canonical, ogImage }`) and let each adapter translate it — keep the\nNext.js `Metadata` return type only in a Next.js project.\n\n---\n\n## 9. Conventions checklist (enforce in review)\n\n- [ ] All site identity (URL, name, description, keywords, author, handles, OG image, verification) lives in **one** `constants\u002Fseo` module — no duplicates, no hardcoded base URL.\n- [ ] Every absolute URL is produced by `canonicalUrl()` — no manual `SITE_URL + path`.\n- [ ] One trailing-slash policy, applied everywhere.\n- [ ] Global metadata (title template, default OG\u002FTwitter, robots, verification, manifest) is set **once** in the root layout.\n- [ ] Dynamic routes override metadata via `buildMetadata` (or the framework adapter), passing only what differs.\n- [ ] Every page resolves exactly one `canonical`; no relative or duplicate canonicals.\n- [ ] `sitemap.xml`, `robots.txt`, and the RSS feed are **generated from content collections**, deduped, all absolute. Private routes are disallowed in robots.\n- [ ] JSON-LD uses the shared `structuredData`\u002F`JsonLd` builders; entities cross-reference by stable `@id`.\n- [ ] Each detail page emits its primary schema (`BlogPosting`\u002F`CreativeWork`) + a `BreadcrumbList`; home emits `Person` + `WebSite`.\n- [ ] Builder functions are pure and unit-tested; framework code stays in the thin adapter (route files).\n- [ ] OG image, locale, and Twitter handle are present and consistent across OG + Twitter cards.\n- [ ] Structured data validated with Google's Rich Results Test before release.\n\n---\n\n## 10. How to apply this skill\n\n**Adding SEO to a site:** create `constants\u002Fseo`, `types\u002Fseo`, and `services\u002Fseo\u002F` (barrel +\n`structured-data.ts`). Wire global metadata in the root layout, then add `sitemap`, `robots`, and\n`feed.xml` adapters that mount the builders.\n\n**Adding a new content type (e.g. case studies):** add its slugs to `sitemapEntries`, add a\nJSON-LD builder if it needs its own schema, and give its detail page a `generateMetadata` + a\n`BreadcrumbList`.\n\n**Debugging duplicate-content \u002F indexing issues:** check that every page goes through\n`canonicalUrl`, that the trailing-slash policy is uniform, and that the sitemap contains only\nindexable, absolute URLs. Confirm robots isn't blocking what should be indexed.\n\n**Reviewing SEO coverage:** run the checklist in §9. The highest-value catches are hardcoded URLs\nthat bypass `canonicalUrl` (duplicate-content risk) and JSON-LD that duplicates entity fields\ninstead of referencing a stable `@id`.\n\n---\n\n## Publishing \u002F installing this skill\n\nThis skill follows the Anthropic `SKILL.md` format and is portable across agents.\n\n1. Keep it under `skills\u002Ffrontend-seo\u002FSKILL.md` in a public GitHub repo.\n2. Keep the frontmatter `name` and high-signal `description` — discovery indexes match against it.\n3. Install with: `npx skills add \u003Corg>\u002F\u003Crepo> --skill \"frontend-seo\"`.\n4. Non-`SKILL.md` agents can be pointed here from `AGENTS.md` \u002F `CLAUDE.md`; Kiro can mirror it as a steering file.\n\n## Limitations\n\n- Use this skill only when the task clearly matches its upstream source and local project context.\n- Verify commands, generated code, dependencies, credentials, and external service behavior before applying changes.\n- Do not treat examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.\n","# Frontend SEO (portable, builder-based)\n## When to Use\n\nUse this skill when you need a portable, framework-agnostic SEO system for any React or React Native-for-web frontend. Centralizes site metadata in one constants module, derives canonical URLs from a single base, builds per-route metadata (title, description, canonical, Open Graph, Twitter\u002FX cards), generates...\n\n\n> Portable skill — readable by Claude Code, OpenCode, Codex, Cursor, Windsurf, and others.\n> This skill describes an **SEO system** — a set of pure builder functions plus a thin\n> framework adapter — not a component library or a visual style.\n> It pairs with the **frontend-architecture** skill: the SEO system lives in a single\n> service module (`services\u002Fseo\u002F`) and is consumed through one barrel.\n\nThe goal: every route ships **correct, consistent, machine-readable metadata** without\nanyone copy-pasting `\u003Cmeta>` tags. Site identity lives in **one** constants module, URLs are\n**always absolute and canonical**, and search engines get a **sitemap, robots rules, an RSS\nfeed, and typed JSON-LD** derived from the same content the app already renders.\n\n---\n\n## 0. The five core ideas\n\n1. **One source of truth for identity.** Site URL, name, description, keywords, author, social handles, OG image, and verification tokens live in a single `constants\u002Fseo` module. Nothing about the site's identity is hardcoded anywhere else.\n2. **URLs are always absolute and canonical.** A single `canonicalUrl(path)` function turns any path into an absolute, trailing-slash-normalized URL. Every sitemap entry, RSS link, OG URL, and JSON-LD `@id` flows through it.\n3. **Builders are pure; the adapter is thin.** Metadata, sitemap, robots, RSS, and JSON-LD are produced by pure functions that take data and return plain objects. Only one small function touches the framework's metadata type. Pure functions are trivially unit-testable.\n4. **Structured data is typed and reused.** JSON-LD objects share a `JsonLd` type and a small set of `schema.org` builders (`Person`, `WebSite`, `BlogPosting`, `CreativeWork`, `BreadcrumbList`, `FAQPage`). Entities cross-reference each other by stable `@id`.\n5. **Discovery surfaces are generated from content.** `sitemap.xml`, `robots.txt`, and the RSS feed are built from the same content collections the app renders — never maintained by hand, never drifting.\n\nEverything below is the mechanical application of these five ideas.\n\n---\n\n## 1. Directory layout\n\nThe SEO system is one service module plus its constants and types. It slots directly into the\n`frontend-architecture` shape (`shared\u002F` or `services\u002F`).\n\n```\nsrc\u002F\n├── constants\u002F\n│   └── seo.ts                  ← SINGLE source of truth for site identity\n├── types\u002F\n│   └── seo.ts                  ← SchemaType, RouteDescriptor, SitemapEntry,\n│                                  RobotsConfig, RssItem, Redirect, JsonLd\n├── services\u002Fseo\u002F\n│   ├── index.ts                ← barrel: canonicalUrl, buildMetadata,\n│   │                              sitemapEntries, robots, rssItems,\n│   │                              structuredData, redirects\n│   └── structured-data.ts      ← per-type JSON-LD builders (Person, WebSite, …)\n└── app\u002F (or routes\u002F)           ← THIN adapter: route files call the builders\n    ├── layout.tsx              ← global default metadata (from constants\u002Fseo)\n    ├── sitemap.ts              ← mounts sitemapEntries()\n    ├── robots.ts               ← mounts robots()\n    └── feed.xml\u002Froute.ts       ← mounts rssItems()\n```\n\nRule of thumb: **builders never import the framework** (except the one `buildMetadata` adapter);\n**route files never build SEO data inline** — they call a builder and mount the result.\n\n---\n\n## 2. One source of truth for identity (`constants\u002Fseo`)\n\nEverything about the site's identity is a named constant. No bare strings scattered across\nroute files, no second copy of the description, no hardcoded base URL.\n\n```ts\n\u002F\u002F constants\u002Fseo.ts\nexport const SITE_URL = \"https:\u002F\u002Fexample.com\"; \u002F\u002F no trailing slash\nexport const SITE_NAME = \"Jane Doe\";\nexport const SITE_HANDLE = \"@janedoe\";\nexport const SITE_LOCALE = \"en_US\";\n\nexport const SITE_TITLE_DEFAULT = \"Jane Doe — Senior Engineer\";\nexport const SITE_TITLE_TEMPLATE = \"%s | Jane Doe\"; \u002F\u002F child pages fill %s\n\nexport const SITE_DESCRIPTION =\n  \"Senior engineer building cross-platform products with React and TypeScript.\";\n\nexport const SITE_KEYWORDS = [\"Jane Doe\", \"React\", \"TypeScript\", \"Engineer\"];\n\nexport const AUTHOR_NAME = \"Jane Doe\";\nexport const AUTHOR_EMAIL = \"jane@example.com\";\nexport const AUTHOR_GITHUB = \"https:\u002F\u002Fgithub.com\u002Fjanedoe\";\nexport const AUTHOR_LINKEDIN = \"https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fjanedoe\u002F\";\n\nexport const OG_IMAGE_PATH = \"\u002Fog-image.png\"; \u002F\u002F relative; canonicalized at use\nexport const OG_IMAGE_WIDTH = 1200;\nexport const OG_IMAGE_HEIGHT = 630;\n\nexport const GOOGLE_SITE_VERIFICATION = \"your-search-console-token\";\n```\n\nWhy: changing the description or the OG image touches **one line**. Structured data, OG tags, and\nTwitter cards all read the same values, so they can never disagree.\n\n---\n\n## 3. Typed data models (`types\u002Fseo`)\n\nMinimal but typed. These are the contracts every builder honors.\n\n```ts\n\u002F\u002F types\u002Fseo.ts\nexport type SchemaType =\n  | \"Person\"\n  | \"WebSite\"\n  | \"BlogPosting\"\n  | \"CreativeWork\"\n  | \"BreadcrumbList\"\n  | \"FAQPage\";\n\n\u002F** Describes a route for metadata generation. *\u002F\nexport interface RouteDescriptor {\n  path: string; \u002F\u002F e.g. \"\u002Fblog\u002Fmy-post\"\n  title: string;\n  description: string;\n  ogImage?: string; \u002F\u002F falls back to OG_IMAGE_PATH\n  indexable?: boolean; \u002F\u002F whether it appears in the sitemap\n}\n\nexport interface SitemapEntry {\n  url: string; \u002F\u002F absolute\n  lastModified?: string;\n  changeFrequency?:\n    | \"always\"\n    | \"hourly\"\n    | \"daily\"\n    | \"weekly\"\n    | \"monthly\"\n    | \"yearly\"\n    | \"never\";\n  priority?: number;\n}\n\nexport interface RobotsConfig {\n  rules: Array\u003C{ userAgent: string; allow?: string[]; disallow?: string[] }>;\n  sitemap: string; \u002F\u002F absolute\n}\n\nexport interface RssItem {\n  title: string;\n  link: string; \u002F\u002F absolute\n  description: string;\n  pubDate: string; \u002F\u002F ISO-8601\n  guid: string;\n}\n\nexport interface Redirect {\n  source: string;\n  destination: string;\n  permanent: boolean; \u002F\u002F 301 when true\n}\n\n\u002F** A JSON-LD object: always a schema.org context + type, plus type-specific fields. *\u002F\nexport interface JsonLd {\n  \"@context\": \"https:\u002F\u002Fschema.org\";\n  \"@type\": SchemaType;\n  [key: string]: unknown;\n}\n```\n\nNote the `I`-prefix convention from `frontend-architecture` applies to **stateful UI interfaces**;\nthese SEO data models are plain DTOs and follow the source project's existing convention\n(here, unprefixed). Keep whichever convention the host project already uses — consistency wins.\n\n---\n\n## 4. Canonical URLs (the spine of the system)\n\nOne function, used everywhere. It guarantees absolute, normalized, double-slash-free URLs so\nsearch engines never see two URLs for the same page.\n\n```ts\n\u002F\u002F services\u002Fseo\u002Findex.ts\nimport { SITE_URL } from \"@\u002Fconstants\u002Fseo\";\n\nexport function canonicalUrl(path: string): string {\n  const normalized = path.startsWith(\"\u002F\") ? path : `\u002F${path}`;\n  if (normalized === \"\u002F\") return SITE_URL; \u002F\u002F root → base, no trailing slash\n  const withoutTrailing = normalized.endsWith(\"\u002F\")\n    ? normalized.slice(0, -1)\n    : normalized;\n  return `${SITE_URL}${withoutTrailing}`;\n}\n```\n\n**Hard rules:**\n\n- Never concatenate `SITE_URL + path` by hand — always `canonicalUrl(path)`.\n- Pick one trailing-slash policy (this skill: **no trailing slash**) and apply it everywhere.\n- Every OG `url`, sitemap `url`, RSS `link`, and JSON-LD `@id`\u002F`url` goes through `canonicalUrl`.\n\n---\n\n## 5. Per-route metadata\n\n### 5.1 The pure builder\n\n`buildMetadata` is the **only** function allowed to know about the framework's metadata type.\nEverything else is framework-free.\n\n```ts\n\u002F\u002F services\u002Fseo\u002Findex.ts  (Next.js example — swap the return type for other frameworks)\nimport type { Metadata } from \"next\";\nimport { OG_IMAGE_PATH } from \"@\u002Fconstants\u002Fseo\";\nimport type { RouteDescriptor } from \"@\u002Ftypes\u002Fseo\";\n\nexport function buildMetadata(route: RouteDescriptor): Metadata {\n  const canonical = canonicalUrl(route.path);\n  const ogImageUrl = canonicalUrl(route.ogImage ?? OG_IMAGE_PATH);\n\n  return {\n    title: route.title,\n    description: route.description,\n    alternates: { canonical },\n    openGraph: { images: [ogImageUrl] },\n  };\n}\n```\n\n### 5.2 Global defaults live in the root layout\n\nSet the title template, default OG\u002FTwitter cards, robots policy, icons, manifest, and\nverification **once** at the root. Child routes only override what differs.\n\n```tsx\n\u002F\u002F app\u002Flayout.tsx — global metadata, all values from constants\u002Fseo\nimport type { Metadata } from \"next\";\nimport {\n  SITE_URL,\n  SITE_NAME,\n  SITE_HANDLE,\n  SITE_LOCALE,\n  SITE_TITLE_DEFAULT,\n  SITE_TITLE_TEMPLATE,\n  SITE_DESCRIPTION,\n  SITE_KEYWORDS,\n  AUTHOR_NAME,\n  OG_IMAGE_PATH,\n  OG_IMAGE_WIDTH,\n  OG_IMAGE_HEIGHT,\n  GOOGLE_SITE_VERIFICATION,\n} from \"@\u002Fconstants\u002Fseo\";\n\nexport const metadata: Metadata = {\n  metadataBase: new URL(SITE_URL),\n  title: { default: SITE_TITLE_DEFAULT, template: SITE_TITLE_TEMPLATE },\n  description: SITE_DESCRIPTION,\n  keywords: SITE_KEYWORDS,\n  authors: [{ name: AUTHOR_NAME, url: SITE_URL }],\n  alternates: {\n    canonical: SITE_URL,\n    types: { \"application\u002Frss+xml\": `${SITE_URL}\u002Ffeed.xml` },\n  },\n  openGraph: {\n    type: \"website\",\n    locale: SITE_LOCALE,\n    url: SITE_URL,\n    siteName: SITE_NAME,\n    title: SITE_TITLE_DEFAULT,\n    description: SITE_DESCRIPTION,\n    images: [\n      { url: OG_IMAGE_PATH, width: OG_IMAGE_WIDTH, height: OG_IMAGE_HEIGHT },\n    ],\n  },\n  twitter: {\n    card: \"summary_large_image\",\n    site: SITE_HANDLE,\n    creator: SITE_HANDLE,\n    title: SITE_TITLE_DEFAULT,\n    description: SITE_DESCRIPTION,\n    images: [OG_IMAGE_PATH],\n  },\n  robots: {\n    index: true,\n    follow: true,\n    googleBot: {\n      index: true,\n      follow: true,\n      \"max-image-preview\": \"large\",\n      \"max-snippet\": -1,\n    },\n  },\n  verification: { google: GOOGLE_SITE_VERIFICATION },\n  manifest: \"\u002Fmanifest.webmanifest\",\n};\n```\n\n### 5.3 Per-route override (dynamic pages)\n\nA dynamic route reads its entity and returns route-specific metadata. The title template fills\n`%s` automatically, so just pass the page title.\n\n```tsx\n\u002F\u002F app\u002Fblog\u002F[slug]\u002Fpage.tsx\nimport { buildMetadata } from \"@\u002Fservices\u002Fseo\";\n\nexport async function generateMetadata({ params }) {\n  const post = await loadPost(params.slug);\n  return buildMetadata({\n    path: `\u002Fblog\u002F${post.slug}`,\n    title: post.title,\n    description: post.description,\n    ogImage: post.heroImage,\n  });\n}\n```\n\n**Hard rules:**\n\n- Set defaults once in the layout; override per route only where it differs.\n- Use a title **template** so child pages don't repeat the site name.\n- Every page resolves a single `canonical` — never emit duplicate or relative canonicals.\n\n---\n\n## 6. Discovery surfaces (generated from content)\n\n### 6.1 Sitemap\n\nBuild entries from the **same content collections** the app renders, deduped, all absolute.\n\n```ts\n\u002F\u002F services\u002Fseo\u002Findex.ts\nimport { ROUTES } from \"@\u002Fconstants\u002Froutes\";\nimport type { SitemapEntry } from \"@\u002Ftypes\u002Fseo\";\n\nconst PRIMARY_ROUTES: Array\u003C{\n  path: string;\n  changeFrequency: SitemapEntry[\"changeFrequency\"];\n  priority: number;\n}> = [\n  { path: ROUTES.HOME, changeFrequency: \"weekly\", priority: 1.0 },\n  { path: ROUTES.BLOG, changeFrequency: \"daily\", priority: 0.9 },\n  \u002F\u002F …other primary routes\n];\n\nexport function sitemapEntries(options: {\n  blogSlugs: string[];\n  projectSlugs: string[];\n}): SitemapEntry[] {\n  const seen = new Set\u003Cstring>();\n  const entries: SitemapEntry[] = [];\n  const add = (e: SitemapEntry) => {\n    if (!seen.has(e.url)) {\n      seen.add(e.url);\n      entries.push(e);\n    }\n  };\n  const today = new Date().toISOString().split(\"T\")[0];\n\n  for (const r of PRIMARY_ROUTES)\n    add({\n      url: canonicalUrl(r.path),\n      lastModified: today,\n      changeFrequency: r.changeFrequency,\n      priority: r.priority,\n    });\n  for (const slug of options.blogSlugs)\n    add({\n      url: canonicalUrl(`\u002Fblog\u002F${slug}`),\n      lastModified: today,\n      changeFrequency: \"monthly\",\n      priority: 0.7,\n    });\n  for (const slug of options.projectSlugs)\n    add({\n      url: canonicalUrl(`\u002Fprojects\u002F${slug}`),\n      lastModified: today,\n      changeFrequency: \"monthly\",\n      priority: 0.8,\n    });\n\n  return entries;\n}\n```\n\n```ts\n\u002F\u002F app\u002Fsitemap.ts — thin adapter\nimport type { MetadataRoute } from \"next\";\nimport { sitemapEntries } from \"@\u002Fservices\u002Fseo\";\n\nexport default function sitemap(): MetadataRoute.Sitemap {\n  const entries = sitemapEntries({\n    blogSlugs: loadPublishedBlogSlugs(),\n    projectSlugs: loadProjectSlugs(),\n  });\n  return entries.map((e) => ({\n    url: e.url,\n    lastModified: e.lastModified ? new Date(e.lastModified) : new Date(),\n    changeFrequency:\n      e.changeFrequency as MetadataRoute.Sitemap[0][\"changeFrequency\"],\n    priority: e.priority,\n  }));\n}\n```\n\n### 6.2 Robots\n\n```ts\n\u002F\u002F app\u002Frobots.ts\nimport type { MetadataRoute } from \"next\";\nimport { SITE_URL } from \"@\u002Fconstants\u002Fseo\";\n\nexport default function robots(): MetadataRoute.Robots {\n  return {\n    rules: [\n      { userAgent: \"*\", allow: \"\u002F\", disallow: [\"\u002Fapi\u002F\", \"\u002F_next\u002F\", \"\u002Fadmin\u002F\"] },\n      { userAgent: \"Googlebot\", allow: \"\u002F\" },\n    ],\n    sitemap: `${SITE_URL}\u002Fsitemap.xml`,\n    host: SITE_URL,\n  };\n}\n```\n\nAlways **disallow private surfaces** (`\u002Fapi\u002F`, `\u002Fadmin\u002F`, build internals) and **point at the sitemap**.\n\n### 6.3 RSS feed\n\n```ts\n\u002F\u002F services\u002Fseo\u002Findex.ts\nimport type { RssItem } from \"@\u002Ftypes\u002Fseo\";\n\nexport function rssItems(posts: BlogPost[]): RssItem[] {\n  return posts.map((post) => {\n    const link = canonicalUrl(`\u002Fblog\u002F${post.slug}`);\n    return {\n      title: post.title,\n      link,\n      description: post.description,\n      pubDate: post.publishDate,\n      guid: link,\n    };\n  });\n}\n```\n\n```ts\n\u002F\u002F app\u002Ffeed.xml\u002Froute.ts — sort newest-first, CDATA-wrap free text\nimport { rssItems } from \"@\u002Fservices\u002Fseo\";\nimport { SITE_NAME, SITE_URL, SITE_DESCRIPTION } from \"@\u002Fconstants\u002Fseo\";\n\nexport function GET(): Response {\n  const items = rssItems(loadPublishedPostsNewestFirst());\n  const xml = `\u003C?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\u003Crss version=\"2.0\">\u003Cchannel>\n  \u003Ctitle>${SITE_NAME}\u003C\u002Ftitle>\u003Clink>${SITE_URL}\u003C\u002Flink>\n  \u003Cdescription>${SITE_DESCRIPTION}\u003C\u002Fdescription>\n  ${items\n    .map(\n      (i) => `\u003Citem>\n    \u003Ctitle>\u003C![CDATA[${i.title}]]>\u003C\u002Ftitle>\u003Clink>${i.link}\u003C\u002Flink>\n    \u003Cdescription>\u003C![CDATA[${i.description}]]>\u003C\u002Fdescription>\n    \u003CpubDate>${i.pubDate}\u003C\u002FpubDate>\u003Cguid>${i.guid}\u003C\u002Fguid>\n  \u003C\u002Fitem>`,\n    )\n    .join(\"\")}\n\u003C\u002Fchannel>\u003C\u002Frss>`;\n  return new Response(xml, {\n    headers: { \"Content-Type\": \"application\u002Frss+xml; charset=utf-8\" },\n  });\n}\n```\n\nCDATA-wrap titles\u002Fdescriptions so apostrophes and markup never break the feed.\n\n---\n\n## 7. Structured data (typed JSON-LD)\n\n### 7.1 The generic builder\n\n```ts\n\u002F\u002F services\u002Fseo\u002Findex.ts\nimport type { JsonLd, SchemaType } from \"@\u002Ftypes\u002Fseo\";\n\nexport function structuredData(\n  type: SchemaType,\n  data: Record\u003Cstring, unknown>,\n): JsonLd {\n  return { \"@context\": \"https:\u002F\u002Fschema.org\", \"@type\": type, ...data };\n}\n```\n\n### 7.2 Per-type builders, cross-referenced by stable `@id`\n\n```ts\n\u002F\u002F services\u002Fseo\u002Fstructured-data.ts\nimport { structuredData } from \".\u002Findex\";\nimport { SITE_URL, AUTHOR_NAME, SITE_DESCRIPTION } from \"@\u002Fconstants\u002Fseo\";\nimport type { JsonLd } from \"@\u002Ftypes\u002Fseo\";\n\nexport function personJsonLd(): JsonLd {\n  return structuredData(\"Person\", {\n    \"@id\": `${SITE_URL}\u002F#person`, \u002F\u002F stable identity others reference\n    name: AUTHOR_NAME,\n    url: SITE_URL,\n    description: SITE_DESCRIPTION,\n    sameAs: [\n      \u002F* social profile URLs *\u002F\n    ],\n  });\n}\n\nexport function websiteJsonLd(): JsonLd {\n  return structuredData(\"WebSite\", {\n    \"@id\": `${SITE_URL}\u002F#website`,\n    url: SITE_URL,\n    name: AUTHOR_NAME,\n    author: { \"@id\": `${SITE_URL}\u002F#person` }, \u002F\u002F reference, not a copy\n    potentialAction: {\n      \"@type\": \"SearchAction\",\n      target: {\n        \"@type\": \"EntryPoint\",\n        urlTemplate: `${SITE_URL}\u002Fblog?q={search_term_string}`,\n      },\n      \"query-input\": \"required name=search_term_string\",\n    },\n  });\n}\n\nexport function blogPostingJsonLd(post: BlogPost, url: string): JsonLd {\n  return structuredData(\"BlogPosting\", {\n    \"@id\": url,\n    headline: post.title,\n    description: post.description,\n    datePublished: post.publishDate,\n    dateModified: post.publishDate,\n    author: {\n      \"@type\": \"Person\",\n      \"@id\": `${SITE_URL}\u002F#person`,\n      name: post.author,\n    },\n    publisher: {\n      \"@type\": \"Person\",\n      \"@id\": `${SITE_URL}\u002F#person`,\n      name: AUTHOR_NAME,\n    },\n    url,\n    mainEntityOfPage: { \"@type\": \"WebPage\", \"@id\": url },\n    image: {\n      \"@type\": \"ImageObject\",\n      url: post.heroImage,\n      width: 1200,\n      height: 630,\n    },\n    keywords: post.tags.join(\", \"),\n  });\n}\n\nexport function breadcrumbListJsonLd(\n  items: Array\u003C{ name: string; url: string }>,\n): JsonLd {\n  return structuredData(\"BreadcrumbList\", {\n    itemListElement: items.map((item, i) => ({\n      \"@type\": \"ListItem\",\n      position: i + 1,\n      name: item.name,\n      item: item.url,\n    })),\n  });\n}\n\nexport function faqPageJsonLd(\n  faqs: Array\u003C{ question: string; answer: string }>,\n): JsonLd {\n  return structuredData(\"FAQPage\", {\n    mainEntity: faqs.map((f) => ({\n      \"@type\": \"Question\",\n      name: f.question,\n      acceptedAnswer: { \"@type\": \"Answer\", text: f.answer },\n    })),\n  });\n}\n```\n\n`CreativeWork` follows the same shape for projects\u002Fportfolio items (name, description, author by\n`@id`, `keywords`, optional `codeRepository`\u002F`sameAs`\u002F`image`).\n\n### 7.3 Injecting JSON-LD into a page\n\nRender a `\u003Cscript type=\"application\u002Fld+json\">` with `JSON.stringify`. Match the breadcrumb trail\nto the page's real position.\n\n```tsx\n\u002F\u002F app\u002Fblog\u002F[slug]\u002Fpage.tsx\nimport { canonicalUrl } from \"@\u002Fservices\u002Fseo\";\nimport {\n  blogPostingJsonLd,\n  breadcrumbListJsonLd,\n} from \"@\u002Fservices\u002Fseo\u002Fstructured-data\";\n\nexport default async function Page({ params }) {\n  const post = await loadPost(params.slug);\n  const url = canonicalUrl(`\u002Fblog\u002F${post.slug}`);\n  const postLd = blogPostingJsonLd(post, url);\n  const crumbLd = breadcrumbListJsonLd([\n    { name: \"Home\", url: canonicalUrl(\"\u002F\") },\n    { name: \"Blog\", url: canonicalUrl(\"\u002Fblog\") },\n    { name: post.title, url },\n  ]);\n  return (\n    \u003C>\n      \u003Cscript\n        type=\"application\u002Fld+json\"\n        dangerouslySetInnerHTML={{ __html: JSON.stringify(postLd) }}\n        suppressHydrationWarning\n      \u002F>\n      \u003Cscript\n        type=\"application\u002Fld+json\"\n        dangerouslySetInnerHTML={{ __html: JSON.stringify(crumbLd) }}\n        suppressHydrationWarning\n      \u002F>\n      {\u002F* …page content *\u002F}\n    \u003C\u002F>\n  );\n}\n```\n\n**Hard rules:**\n\n- Give each entity a **stable `@id`** (e.g. `${SITE_URL}\u002F#person`) and **reference** it elsewhere instead of duplicating fields.\n- One `BlogPosting`\u002F`CreativeWork` per detail page; a `BreadcrumbList` on every nested page.\n- `Person` + `WebSite` belong on the home page; `FAQPage` only where real Q&A is shown.\n- Validate output with Google's Rich Results Test \u002F Schema Markup Validator before shipping.\n\n---\n\n## 8. Framework adapters\n\nThe builders are framework-free. Only the mounting layer changes.\n\n| Framework              | Per-route metadata                                                                              | sitemap \u002F robots \u002F feed                                                                    |\n| ---------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |\n| **Next.js App Router** | `export const metadata` (static) or `generateMetadata` (dynamic) returning `buildMetadata(...)` | `app\u002Fsitemap.ts`, `app\u002Frobots.ts`, `app\u002Ffeed.xml\u002Froute.ts`                                 |\n| **Remix**              | `meta` export per route, mapping `buildMetadata`'s fields to `\u003Cmeta>` descriptors               | resource routes (`routes\u002Fsitemap[.]xml.ts`, etc.) returning the builder output as XML\u002Ftext |\n| **Astro**              | `\u003Chead>` in a layout reading the same constants; per-page frontmatter overrides                 | `src\u002Fpages\u002Fsitemap.xml.ts`, `robots.txt.ts`, `rss.xml.ts` endpoints                        |\n| **React + Vite (SPA)** | `react-helmet-async` (or a head manager) fed by `buildMetadata`'s plain object                  | build-time script that writes `sitemap.xml`\u002F`robots.txt` from the same builders            |\n| **Expo Router (web)**  | static head config \u002F `expo-router` head; SEO matters only on the web target                     | a small web-only build step calling `sitemapEntries`\u002F`rssItems`                            |\n\nFor a `buildMetadata` that must stay framework-neutral, return a plain shape\n(`{ title, description, canonical, ogImage }`) and let each adapter translate it — keep the\nNext.js `Metadata` return type only in a Next.js project.\n\n---\n\n## 9. Conventions checklist (enforce in review)\n\n- [ ] All site identity (URL, name, description, keywords, author, handles, OG image, verification) lives in **one** `constants\u002Fseo` module — no duplicates, no hardcoded base URL.\n- [ ] Every absolute URL is produced by `canonicalUrl()` — no manual `SITE_URL + path`.\n- [ ] One trailing-slash policy, applied everywhere.\n- [ ] Global metadata (title template, default OG\u002FTwitter, robots, verification, manifest) is set **once** in the root layout.\n- [ ] Dynamic routes override metadata via `buildMetadata` (or the framework adapter), passing only what differs.\n- [ ] Every page resolves exactly one `canonical`; no relative or duplicate canonicals.\n- [ ] `sitemap.xml`, `robots.txt`, and the RSS feed are **generated from content collections**, deduped, all absolute. Private routes are disallowed in robots.\n- [ ] JSON-LD uses the shared `structuredData`\u002F`JsonLd` builders; entities cross-reference by stable `@id`.\n- [ ] Each detail page emits its primary schema (`BlogPosting`\u002F`CreativeWork`) + a `BreadcrumbList`; home emits `Person` + `WebSite`.\n- [ ] Builder functions are pure and unit-tested; framework code stays in the thin adapter (route files).\n- [ ] OG image, locale, and Twitter handle are present and consistent across OG + Twitter cards.\n- [ ] Structured data validated with Google's Rich Results Test before release.\n\n---\n\n## 10. How to apply this skill\n\n**Adding SEO to a site:** create `constants\u002Fseo`, `types\u002Fseo`, and `services\u002Fseo\u002F` (barrel +\n`structured-data.ts`). Wire global metadata in the root layout, then add `sitemap`, `robots`, and\n`feed.xml` adapters that mount the builders.\n\n**Adding a new content type (e.g. case studies):** add its slugs to `sitemapEntries`, add a\nJSON-LD builder if it needs its own schema, and give its detail page a `generateMetadata` + a\n`BreadcrumbList`.\n\n**Debugging duplicate-content \u002F indexing issues:** check that every page goes through\n`canonicalUrl`, that the trailing-slash policy is uniform, and that the sitemap contains only\nindexable, absolute URLs. Confirm robots isn't blocking what should be indexed.\n\n**Reviewing SEO coverage:** run the checklist in §9. The highest-value catches are hardcoded URLs\nthat bypass `canonicalUrl` (duplicate-content risk) and JSON-LD that duplicates entity fields\ninstead of referencing a stable `@id`.\n\n---\n\n## Publishing \u002F installing this skill\n\nThis skill follows the Anthropic `SKILL.md` format and is portable across agents.\n\n1. Keep it under `skills\u002Ffrontend-seo\u002FSKILL.md` in a public GitHub repo.\n2. Keep the frontmatter `name` and high-signal `description` — discovery indexes match against it.\n3. Install with: `npx skills add \u003Corg>\u002F\u003Crepo> --skill \"frontend-seo\"`.\n4. Non-`SKILL.md` agents can be pointed here from `AGENTS.md` \u002F `CLAUDE.md`; Kiro can mirror it as a steering file.\n\n## Limitations\n\n- Use this skill only when the task clearly matches its upstream source and local project context.\n- Verify commands, generated code, dependencies, credentials, and external service behavior before applying changes.\n- Do not treat examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.\n",{"name":5,"risk":24,"source":25,"license":15,"date_added":26,"description":7,"source_repo":27,"source_type":28,"license_source":29},"critical","https:\u002F\u002Fgithub.com\u002Fstareezy-1\u002Ffrontend-architecture-skill\u002Ftree\u002Fmain\u002Fskills\u002Ffrontend-seo",1782864000000,"stareezy-1\u002Ffrontend-architecture-skill","community","https:\u002F\u002Fgithub.com\u002Fstareezy-1\u002Ffrontend-architecture-skill\u002Fblob\u002Fmain\u002FLICENSE","main","a4404a75dc81d6b7e58c5906b6aaffbcb5e84747","Claude\u002Fantigravity skills\u002Fagentic-awesome-skills\u002Fskills\u002Ffrontend-seo",0,"https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills","https:\u002F\u002Fgithub.com\u002FMHassan0000","https:\u002F\u002Fhassanyousaf.vercel.app","Full Stack Developer building web apps, SaaS, AI systems, and automations. Passionate about clean code, UI\u002FUX, backend systems, and turning ideas into products.","2026-08-07 20:42:05",{"source":8,"skillName":5,"commands":40,"prompt":50,"zipAvailable":51},[41,44,47],{"tool":42,"command":43},"npx","npx skills add MHassan0000\u002FSkills --skill frontend-seo",{"tool":45,"command":46},"bunx","bunx skills add MHassan0000\u002FSkills --skill frontend-seo",{"tool":48,"command":49},"pnpm","pnpm dlx skills add MHassan0000\u002FSkills --skill frontend-seo","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fantigravity skills\u002Fagentic-awesome-skills\u002Fskills\u002Ffrontend-seo\u002FSKILL.md",true,[],[54,61,68,75,84,92],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M7AGBX58S04DX8DKKME8N311","vercel-react-best-practices","React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React\u002FNext.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.","https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fskills boraztunc github\u002Fvercel-react-best-practices\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M7AGBREE890608Z7YDMAKH27","stop-slop","Remove AI writing patterns from prose. Use when drafting, editing, or reviewing text to eliminate predictable AI tells and produce more human-like writing.","https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fskills boraztunc github\u002Fstop-slop\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M7AGAS972A2AN7Q5EW8HEAXK","ogilvy-copywriting","Apply David Ogilvy's advertising principles when writing or reviewing copy, headlines, product descriptions, landing pages, ads, emails, or any persuasive text. Use when the goal is copy that sells, not copy that wins awards. Covers positioning, headlines, promises, brand voice, long-form copy, and visual logic. Source: How to Create Advertising That Sells (1972) + Ogilvy on Advertising.","https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fskills boraztunc github\u002Fogilvy\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":79,"licenseFileUrl":80,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7AGAF12803G5JPVMK79AYJB","frontend-design","Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML\u002FCSS layouts, or when styling\u002Fbeautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fskills boraztunc github\u002Ffrontend-design\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fskills boraztunc github\u002Ffrontend-design\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":79,"licenseFileUrl":88,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M7AG88WWVWCGJY9WA9CH7EY4","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fobra superpower skills\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fobra superpower skills\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":79,"licenseFileUrl":96,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M7AG7ZTNV7XQCWDQ9674FBYB","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fobra superpower skills\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fobra superpower skills\u002Fweb-artifacts-builder\u002FSKILL.md",[],[]]