/sitecore-content-sdk-nextjs-app-router:content-sdk-app-router-multisite-managementfrom Sitecore Content SDK - Next.js App Router
Manages multisite resolution in Content SDK App Router apps: site resolution from hostname/cookie, .sitecore/sites.json config, and the src/proxy.ts chain with AppRouterMultisiteProxy.
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.
Site resolution from the request (hostname or cookie); AppRouterMultisiteProxy rewrites to /[site]/[locale]/...path. LocaleProxy runs before multisite so next-intl and the site resolver see the correct locale.
.sitecore/sites.json, multisite config, or the proxy (src/proxy.ts).Source of truth: [email protected] → dist/templates/nextjs-app-router/src/proxy.ts (lines 16-28, 105; the cache-components template's file is byte-identical).
export default function proxy(req: NextRequest, event: NextFetchEvent) {
const preview = new PreviewProxy({ client, ...scConfig.api.edge });
const botTracking = new BotTrackingProxy({ ...scConfig.api.edge, sites, fetchEvent: event });
const locale = new LocaleProxy({ sites, locales: routing.locales.slice(), defaultLanguage: scConfig.defaultLanguage, skip: () => false });
const multisite = new AppRouterMultisiteProxy({ sites, ...scConfig.multisite, skip: () => false });
const redirects = new RedirectsProxy({ sites, ...scConfig.api.edge, ...scConfig.api.local, ...scConfig.redirects, skip: () => false });
const personalize = new PersonalizeProxy({ sites, ...scConfig.api.edge, ...scConfig.personalize, skip: () => false });
return defineProxy(preview, botTracking, locale, multisite, redirects, personalize).exec(req);
}
| # | Proxy | Why it sits here |
|---|---|---|
| 1 | PreviewProxy | Authorizes preview / editing requests on the editing host; no-op elsewhere |
| 2 | BotTrackingProxy | Detects bots (isbot), sets the sc_bot cookie and sends a botPageView via fetchEvent.waitUntil. Must precede PersonalizeProxy: skipForBot (default true) reads sc_bot to skip the personalize lookup for bots ("Lightweight Tracking") |
| 3 | LocaleProxy | Sets the locale before anything resolves a site |
| 4 | AppRouterMultisiteProxy | Resolves the site, rewrites to /[site]/[locale]/[...path] |
| 5 | RedirectsProxy | Applies authored redirects for the resolved site |
| 6 | PersonalizeProxy | Last: rewrites to the _variantId_ path; owned by content-sdk-personalization |
BotTrackingProxy needs that request's NextFetchEvent. Do not hoist them to module scope.BotTrackingProxy "must be the first proxy", but the scaffold puts PreviewProxy first. Follow the scaffold: preview requests must be authorized before anything else, and the invariant that matters is bot tracking before personalize.xmcloud-starter-js main lags the template: 5 proxies, no BotTrackingProxy, module-scope instances, although its package.json is on 2.4.0. Do not copy its proxy.ts as the reference; the create-content-sdk-app template is.src/proxy.ts alone is enough on Next 16. next build lists Proxy (Middleware) with no middleware.ts. The template's own .agents/docs/AGENTS-router-specifics.md still says to add a src/middleware.ts re-export; that line is stale. Do not add one..sitecore/sites.json, generated by the Sitecore CLI (generateSites, configured in sitecore.cli.config.ts). Avoid hand-editing unless the format is known. The default site is prepended only when defaultSite is set explicitly in the config; never add a placeholder site./api/revalidate excluded from the proxy matcher, like the other API routes.LocaleProxy ignores site.language (one global default). A site name containing _ breaks the ${site}_${locale} request key. A sites.json entry Edge does not know fails next build ([IV-007]). See content-sdk-app-router-dictionary-and-i18n._next/, sitemap, robots, healthz, sitecore/api/, -/ (media) and static assets so the proxy stays lightweight.sitecore.config.ts → multisite, redirects, personalize. Single SitecoreClient; pass the resolved site and locale from route params into getPage, getDictionary, etc.skip, scope, timeouts, enabled): content-sdk-personalization and content-sdk-site-setup-and-env. Consent gating (PersonalizeProxy.skip on a consent cookie): content-sdk-tracking-consent.sites.json format is unknown and the change could break resolution; suggest checking SDK docs or CLI output.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub chris1415/sitecore-skills-pocs --plugin sitecore-content-sdk-nextjs-app-router17 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-osrOther plugins' skills for the same job