/sitecore-content-sdk-nextjs-app-router:content-sdk-app-router-sitemap-robotsfrom Sitecore Content SDK - Next.js App Router
Configures sitemap, robots.txt, and llms.txt route handlers in a Next.js App Router app using the Content SDK. Documents the critical behavior where an empty RobotsContent field causes 'Disallow: /'.
Ships in Sitecore Content SDK - Next.js App Router. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Sitemap, robots.txt and llms.txt are served via route handlers and rewrites. Use the SDK route handler helpers and sites from .sitecore/sites.json.
src/app/api/sitemap/route.ts with createSitemapRouteHandler({ client, sites }); robots: src/app/api/robots/route.ts with createRobotsRouteHandler({ client, sites }). Use sites from .sitecore/sites.json. Add rewrites in next.config.ts for /sitemap*.xml and /robots.txt with locale: false. Set dynamic = 'force-dynamic' if needed.The route handler serves nothing of its own — the body is CMS content. createRobotsRouteHandler resolves the site from the request host, then calls client.getRobots(siteName), which issues one Edge query:
query RobotsQuery($siteName: String!) {
site { siteInfo(site: $siteName) { robots } }
}
siteInfo.robots is the RobotsContent shared field on the site's Settings item — /sitecore/content/<Collection>/<Site>/Settings, field {64971FA7-F8AC-4C88-9BB2-2949F2A28670}, shown in Pages under Robots → Robots content. Changing robots.txt is a content edit, not a code change.
An empty RobotsContent field does NOT mean "no robots.txt" — it means Disallow: /. Sitecore composes the document server-side when the field is empty and returns a literal User-agent: *\nDisallow: /, which the handler serves as a clean HTTP 200. Every crawler honours it, so a site with an untouched Settings item launches excluded from search while every other check is green. Verified against a live SitecoreAI CM 2026-08-12 across six sites: the five with an empty field all served the blocking document; the one with an authored value served it back verbatim.
Two consequences worth internalising:
The SDK's if (!robotsContent) branch is unreachable in practice. It exists to return a 404 when Edge yields nothing, but Edge never yields nothing — it always composes a document. The field is the only control surface, so "we didn't configure it" and "we blocked all crawlers" are the same state.
A publish is required. Preview and live return the same siteInfo.robots only while the field is empty, because both serve the same composed default; that equality says nothing about an authored value. Measured 2026-08-14 right after writing the field: preview returned Allow: / while live still returned Disallow: /. The write lands on master, preview Edge follows within seconds, and live Edge does not change until the Settings item is published. This field is subject to the usual preview/live divergence.
So verify against the live Edge context, never preview: a preview-side check passes while the public site stays blocked.
The default you almost always want:
User-Agent: *
Allow: /
Do not "fix" a blocking robots.txt with a static public/robots.txt. The rewrite would shadow the CMS-managed value and take robots.txt out of the author's reach permanently. Fix RobotsContent on the Settings item.
⚠️ Sitecore auto-appends a Sitemap: line to whatever the field contains, pointing at the CM host (https://xmc-….sitecorecloud.io/sitemap.xml) rather than the site's public domain — observed on every site measured, including correctly-configured ones. Verify it before treating the served robots.txt as production-correct.
src/app/api/sitemap/route.ts — use createSitemapRouteHandler({ client, sites }). Export { GET }. Use sites from .sitecore/sites.json. Set export const dynamic = 'force-dynamic' if the handler relies on request (plain template; not needed with cacheComponents).src/app/api/llms-txt/route.ts — use createLlmsTxtRouteHandler({ client, sites }) from @sitecore-content-sdk/nextjs/route-handler, with a rewrite from /llms.txt; the plain template sets export const dynamic = 'force-dynamic' because it reads request headers. The content is managed in SitecoreAI; the SDK only serves it (no authoring UI, no generation).src/app/api/robots/route.ts — use createRobotsRouteHandler({ client, sites }). Same pattern.next.config.ts, add rewrites for /sitemap*.xml, /robots.txt and /llms.txt to these route handlers. Use locale: false so they are not localized.xhtml:link although xmlns:xhtml is declared, and <loc> uses the CM host when the site has no target hostname (measured 2026-10-02). hreflang in the sitemap depends on the site's alternate-links setting (open). Multi-language SEO: content-sdk-app-router-dictionary-and-i18n.public/robots.txt — it shadows the CMS-managed RobotsContent field and removes robots.txt from authoring control./robots.txt and read the body. Assert 200 and that it does not say Disallow: /. A 200 is not sufficient — the blocking default is served at 200.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
sitemap, robots.txt, llms.txt, seo, route-handlers, sitecore
17 skills in this plugin
/content-sdk-app-router-atom-createWrites a Content SDK atom (beta.atoms): atom vs component, field schemas and enum tokens, renderer, catalog and registry keys, container slots, lock lifecycle, mock-MMS proof. Use when adding or changing an atom. Not wiring atoms into an app./content-sdk-app-router-atomsContent SDK Atoms (beta.atoms only): catalog, atomsConfig, ComponentRef rendering, lock CI gate, runtime CSS, Content Kit install, null-render traps. Use when wiring atoms or a low-code component renders nothing. Not code components or stable apps./content-sdk-app-router-cache-components-and-osrnpx claudepluginhub chris1415/sitecore-skills-pocs --plugin sitecore-content-sdk-nextjs-app-routerOther plugins' skills for the same job