[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DKFZH53B4JC0JPHA035TFZ":3,"skill-same:01M7DKFZH53B4JC0JPHA035TFZ":51},{"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":6,"ownerDescription":6,"updatedAt":36,"install":37,"resources":50},"01M7DKFZH53B4JC0JPHA035TFZ","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...","Hazek-dc\u002FPresensiGuru_FaceNet_EMAR","Hazek-dc","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F75208960?v=4","01M7DEQV5B4YGS86A81DYH81DR","Hazek","01M7DEQV5XP4TM0C6NTHXCXCHR",1,"MIT","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002F.agents\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: unknown\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},"unknown","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","b1e4ffadb4f933bbbcaa03a83f8b9929171ac28b",".agents\u002Fskills\u002Ffrontend-seo",0,"https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR","https:\u002F\u002Fgithub.com\u002FHazek-dc","2026-10-22 08:36:44",{"source":8,"skillName":5,"commands":38,"prompt":48,"zipAvailable":49},[39,42,45],{"tool":40,"command":41},"npx","npx skills add Hazek-dc\u002FPresensiGuru_FaceNet_EMAR --skill frontend-seo",{"tool":43,"command":44},"bunx","bunx skills add Hazek-dc\u002FPresensiGuru_FaceNet_EMAR --skill frontend-seo",{"tool":46,"command":47},"pnpm","pnpm dlx skills add Hazek-dc\u002FPresensiGuru_FaceNet_EMAR --skill frontend-seo","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ffrontend-seo\u002FSKILL.md",true,[],[52,59,66,73,80,87],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M7DS6GGYRZAYD33PFPS8Z2T3","testing-best-practices","Laravel test design and review. Use when selecting coverage, naming or structuring tests, choosing assertions or test data, isolating dependencies, testing HTTP or security boundaries, improving suite performance, or reviewing test value. Use framework guidance or search-docs for Pest and PHPUnit syntax.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Ftesting-best-practices\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M7DS6BC3AW7HTPRHE2TTVKWM","tailwindcss-development","Always invoke when the user's message includes 'tailwind' in any form. Also invoke for: building responsive grid layouts (multi-column card grids, product grids), flex\u002Fgrid page structures (dashboards with sidebars, fixed topbars, mobile-toggle navs), styling UI components (cards, tables, navbars, pricing sections, forms, inputs, badges), adding dark mode variants, fixing spacing or typography, and Tailwind v3\u002Fv4 work. The core use case: writing or fixing Tailwind utility classes in HTML templates (Blade, JSX, Vue). Skip for backend PHP logic, database queries, API routes, JavaScript with no HTML\u002FCSS component, CSS file audits, build tool configuration, and vanilla CSS.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Ftailwindcss-development\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M7DS66GE6B11MYJDVC74HXM4","laravel-best-practices","Apply this skill whenever writing, reviewing, or refactoring Laravel PHP code. This includes creating or modifying controllers, models, migrations, form requests, policies, jobs, scheduled commands, service classes, and Eloquent queries. Triggers for N+1 and query performance issues, caching strategies, authorization and security patterns, validation, error handling, queue and job configuration, route definitions, and architectural decisions. Also use for Laravel code reviews and refactoring existing Laravel code to follow best practices. Covers any task involving Laravel backend PHP code patterns.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Flaravel-best-practices\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M7DS5ZW717DMS6P1E90AQCKV","infer-conventions","Use this skill to analyze how a Laravel application is actually written and record its conventions as shared rules. Trigger when the user wants to detect, infer, document, or standardize project conventions or coding style, set up or grow `.ai\u002Frules`, resolve mixed or conflicting patterns (e.g. \"are we using Form Requests or inline validation?\"), or onboard agents and teammates to \"how we do things here\". Covers: a systematic sweep of ~49 Laravel convention dimensions (validation, models, architecture, testing, frontend, database, console), open-ended house-pattern discovery, conflict reporting, and recording rules scoped to the right paths via the Boost `record-rule` MCP tool. Only run this skill when the user explicitly asks for it; never start a sweep as part of another task. Do not use for one-off code review, enforcing formatting a linter already handles, or editing `.ai\u002Frules` files by hand.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Finfer-conventions\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M7DS5W12RGCVJTFQJ1N0GB8E","inertia-react-development","Develops Inertia.js v2 React client-side applications. Activates when creating React pages, forms, or navigation; using \u003CLink>, \u003CForm>, useForm, or router; working with deferred props, prefetching, or polling; or when user mentions React with Inertia, React pages, React forms, or React navigation.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Finertia-react-development\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M7DS5PVDPMPCWSK2RXPDC9BB","deploying-to-cloud","Deploys and manages Laravel applications on Laravel Cloud using the `cloud` CLI. Use when the user wants to deploy an app, ship to Cloud, create or manage applications, environments, databases, caches, object storage, queues, domains, instances, background processes, secrets, compute, scheduled tasks, or Laravel Cloud infrastructure; or check billing, usage, or spend. Triggers on deployment, shipping, Cloud management, environment setup, database provisioning, billing or usage queries, the `cloud` CLI, and Laravel Cloud deployment troubleshooting.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Fdeploying-to-cloud\u002FSKILL.md",[],[]]