/sitecore-content-sdk:content-sdk-website-build-flowfrom Sitecore Content SDK - Core
Guides building Content SDK websites with Sitecore CMS, covering two-track CMS/head-app sync, content-model direction for new vs existing sites, and preview gating.
Ships in Sitecore Content SDK - Core. 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.
Reusable Sitecore/CMS/head-app recipes for Content SDK websites. Not a pipeline playbook: stage order, slash-commands, and agent roles belong to the calling project.
Most failures come from desyncing two tracks. Keep them honest at every handoff.
| CMS track (live tenant) | Head-app track (repo) | |
|---|---|---|
| Artifacts | Renderings, parameters/datasource templates, Headless Variants, content items, site collection / site nodes, publish events | Components, queries, route handlers, theme, chrome, build output |
| Source of truth | Live tenant (*.sitecorecloud.io); authoring solution mirrored via ser pull | Head-app repo (editing host) |
| Sync | Author live (to preview); dotnet sitecore ser pull into the CM authoring solution — never push | Port / implement against live Edge payloads |
Items are authored live and pulled into the CM code base. Publishing to LIVE Edge is a separate, explicit step — during build/author work, rely on preview.
Ask once up front. It drives whether the content model is derived or read.
| Scenario | Content model | Static reference app (optional) | Provisioning shape |
|---|---|---|---|
| NEW site | Derived from design / static props / clickdummy; authored live during implementation | Built before the head app if used; props chosen freely | Full cascade: project → CM env → editing host → collection → site; create CM baseline when the CM is new |
| EXISTING site | Already exists — inventory first (templates, datasource field types, renderings, resolvers) | If used, props bounded by inventoried field shapes | Create only missing rungs (often editing host + head-app scaffold); reuse existing CM code path |
Incremental addition of one rendering to an already-built head app: skip any separate static app; use the per-component cycle directly.
The separate static app (plain Next.js, zero @sitecore-content-sdk/*) decouples UI from the tenant. It is not free: components are written twice (plain props, then ported to SDK fields).
| Situation | Approach |
|---|---|
| Tenant provisioned + visual design / clickdummy approved | Build directly in the head app (default). Clickdummy is the visual oracle; preview each component against the live tenant |
| No tenant yet / offline / design still fluid / want a tenant-independent UI artifact | Produce the separate static app, then port |
| Incremental addition to an already-built head app | Per-component cycle directly (no static app) |
When building directly, the "port loop" collapses to: implement with SDK field components in the head app, clickdummy as visual oracle — same checklist, minus copy-from-static.
Content SDK reaches Edge from getPage, getDictionary, getErrorPage, generateStaticParams, and the sitecore-tools:build prelude. Mocking "no tenant" metastasizes into sentinel guards across many files plus a fragile npm run dev. A real tenant keeps the head app stock; the port (or direct build) is where Sitecore expertise is applied against real payloads.
Mock data is an explicit OPT-IN, never the default. See Appendix.
cloud deployment create … --upload --working-dir <cm>/ --no-watch). The deployment creates the Edge resource for the env contextId early in the run.cloud editinghost deploy … --upload --working-dir <head-app>/ --no-watch).The EH next build SSG-prerenders against Edge at build time. Concurrent CM+EH deploy yields the sitecoreContextId does not contain a edge resource. Empty content is fine; the Edge resource must exist first.
Auth gotcha (XM Apps writes): mint a CM environment automation client (POST /api/clients/v1/cm) after CM deploy. Collection/site creates need that minted token — the org deploy-admin token 401s on those writes.
RenderingHost: after the editing host is up, set the Site Grouping item field RenderingHost (plain string) to the renderingHosts.<key> name from the head app's xmcloud.build.json (must match the editing-host name). Path: /sitecore/content/<COLLECTION>/<SITE>/Settings/Site Grouping/<SITE>.
{ item(where: { path: "/sitecore/content/<COLLECTION>/<SITE>/Settings/Site Grouping/<SITE>", language: "en" }) {
itemId(format: D)
field(name: "RenderingHost") { value }
} }
mutation SetRH($id: ID!, $name: String!) {
updateItem(input: { itemId: $id, language: "en", version: 1, fields: [{ name: "RenderingHost", value: $name }] }) {
item { field(name: "RenderingHost") { value } }
}
}
When SitecoreAI creates a site it provisions empty Presentation/Page Designs and Presentation/Partial Designs. Populate the minimum chrome skeleton once per site (idempotent).
Auth: CM environment client JWT. Endpoint: https://<tenant>.sitecorecloud.io/sitecore/api/authoring/graphql/v1
{FD2059FD-6043-4DFE-8C04-E2437CE87634}{1105B8F8-1E00-426B-BF1F-C840742D827B}createItem requires braced {GUID} for templateId.
{
headerPD: item(where: { path: "/sitecore/content/<COLLECTION>/<SITE>/Presentation/Partial Designs/Header", language: "en" }) { itemId(format: D) name }
footerPD: item(where: { path: "/sitecore/content/<COLLECTION>/<SITE>/Presentation/Partial Designs/Footer", language: "en" }) { itemId(format: D) name }
pageDesign: item(where: { path: "/sitecore/content/<COLLECTION>/<SITE>/Presentation/Page Designs/Page", language: "en" }) { itemId(format: D) name }
}
Non-null → skip that create. All three present → skip to wiring (or stop if chrome renderings not ready yet).
mutation {
headerPD: createItem(input: {
name: "Header"
templateId: "{FD2059FD-6043-4DFE-8C04-E2437CE87634}"
parent: "/sitecore/content/<COLLECTION>/<SITE>/Presentation/Partial Designs"
language: "en"
}) { item { itemId(format: D) path } }
footerPD: createItem(input: {
name: "Footer"
templateId: "{FD2059FD-6043-4DFE-8C04-E2437CE87634}"
parent: "/sitecore/content/<COLLECTION>/<SITE>/Presentation/Partial Designs"
language: "en"
}) { item { itemId(format: D) path } }
}
mutation {
createItem(input: {
name: "Page"
templateId: "{1105B8F8-1E00-426B-BF1F-C840742D827B}"
parent: "/sitecore/content/<COLLECTION>/<SITE>/Presentation/Page Designs"
language: "en"
}) { item { itemId(format: D) path } }
}
Then set PartialDesigns (no space in field name; pipe-separated braced GUIDs):
mutation {
updateItem(input: {
itemId: "{<PAGE-DESIGN-ID>}"
language: "en"
version: 1
fields: [{ name: "PartialDesigns", value: "{<HEADER-PD-ID>}|{<FOOTER-PD-ID>}" }]
}) { item { field(name: "PartialDesigns") { value } } }
}
Assert: PartialDesigns is non-empty before treating chrome structure as done.
Run only after Header and Footer React components are ported and their rendering items exist in the CM. Structure (steps 1–3) can complete earlier; placement is a one-shot close-out.
Resolve rendering IDs:
{
header: item(where: { path: "/sitecore/layout/Renderings/Project/<COLLECTION>/Header", language: "en" }) { itemId(format: D) }
footer: item(where: { path: "/sitecore/layout/Renderings/Project/<COLLECTION>/Footer", language: "en" }) { itemId(format: D) }
}
Update __Renderings on each Partial Design. Always pass the XML via GraphQL variables — inline strings containing / cause EXEC_SYNTAX_ERROR.
mutation UpdateRenderings($itemId: ID!, $xml: String!) {
updateItem(input: {
itemId: $itemId
language: "en"
version: 1
fields: [{ name: "__Renderings", value: $xml }]
}) { item { field(name: "__Renderings") { value } } }
}
Header PD variables (fresh GUID for uid):
{
"itemId": "{<HEADER-PD-ID>}",
"xml": "<r xmlns:p=\"p\" xmlns:s=\"s\" p:p=\"1\"><d id=\"{FE5D7FDF-89C0-4D99-9AA3-B5FBD009C9F3}\" l=\"{96E5F4BA-A2CF-4A4C-A4E7-64DA88226362}\"><r uid=\"{<NEW-GUID>}\" s:id=\"{<HEADER-RENDERING-ID>}\" s:ph=\"headless-header\" s:ds=\"\" s:par=\"\" /></d></r>"
}
Footer PD: same shape with s:ph=\"headless-footer\" and the footer rendering id.
| Constant | Value |
|---|---|
| Default layout device ID | {FE5D7FDF-89C0-4D99-9AA3-B5FBD009C9F3} |
| Default layout ID | {96E5F4BA-A2CF-4A4C-A4E7-64DA88226362} |
| Header placeholder | headless-header |
| Footer placeholder | headless-footer |
After this, Pages shows Header + Footer on every page using the Page Design — without per-page chrome authoring.
Assigning the design to a route by its Page Design field? Write the id braced, dashed and uppercase ({0A1B2C3D-4E5F-4A6B-8C7D-9E0F1A2B3C4D}, never {0a1b2c3d4e5f4a6b8c7d9e0f1a2b3c4d}). An undashed value is accepted and reads back fine, but the design merge cannot resolve it: headless-header and headless-footer come back as [] on Edge and in edit mode, with no error. An empty shell looks the same whether the merge worked or not, so assert that a chrome rendering actually arrives (measured 2026-09-26). More write-side wire formats are tabled in content-sdk-create-component (its GraphQL-sequence reference, § "Write-side wire formats").
A chrome block that must sit in the chrome but vary per page (a footer CTA whose headline changes by section, for example) has one working shape. Measured 2026-09-28 → 29:
Droplink override field on the page template's content section (e.g. Footer CTA). Source it to the small set of global variant datasources (query:$site/*[@@name='Data']/*[@@templatename='<Block>']).fields, render those fields instead of the partial's. Otherwise fall back to the partial's datasource. The override's own fields arrive in route.fields['<Field>'].fields as real Field objects, so they render through the same SDK field components and stay inline-editable. Only children the override needs (rows) take a server-side client.getData.Two shapes that fail:
headless-main moves it inside <main>, above the page's last section, and breaks the visual contract.headless-footer-page in the layout's <footer>) does not work either. The Layout Service silently drops a placeholder key that is not registered: it is missing from route.placeholders, and the head app logs only "Placeholder '…' was not found in the current rendering data".Derive a site content-model document mechanically:
<img> → Image, <a> → General Link)Author that model live via Authoring GraphQL (or clone OOTB renderings — see content-sdk-create-component) so items are visible on Preview Edge; defer LIVE publish.
Dependency order for hand or API authoring:
componentName exact)Avoid generic parameter names (Levels, Depth, Style, Items) — they collide with base templates; prefer Level or namespaced names.
Per rendering:
src/components/<Component>/<Component>.tsx (helpers go in src/lib/<feature>/ or src/app/api/<feature>/ — see content-sdk-component-naming-traps).<Text>, <RichText>, <Image>, <Link> — types from node_modules/@sitecore-content-sdk/react .d.ts.getPage / layout-debug payload, not from static prop names alone.content-sdk-resolver-patterns); decide variant vs sibling (content-sdk-variants-vs-siblings).tsc clean; confirm on preview; re-probe payload.Risks: wrong resolver → blank render; componentName typo → <MissingComponent>; helpers under src/components/<X>/ → polluted map; treating empty-state field shapes as populated → null deref; port drift from static names.
Client-triggered reads: Route Handler under src/app/api/…, never a Server Action (content-sdk-app-router-route-handler-vs-server-action).
layout-debug / resolver probe).content-sdk-app-router-theme-hydration-pattern).A head app has a defect class that no local gate can see: the component map, the layout data and
the rendering definitions live in three different systems, and only a rendered page proves they
agree. Lint, unit tests and the build all pass while a component resolves to the SDK's
MissingComponent placeholder on every page of a live site. Measured 2026-09-01: an SDK bump
regenerated one map key, the nav vanished site-wide, and 814 unit tests, lint, the build and the
SSG route count were all green.
The precondition — check it before trusting the gate. A preview deployment is only an honest
predictor of production if it resolves the same Edge context production will. On one measured estate the
Vercel Preview target deliberately carries the LIVE context id (not the preview one), so it
does. Verify for your project — vercel env pull <scratch> --environment=preview — because if
Preview points at the preview context instead, the deployment serves unpublished content at a
live-looking URL and a green smoke proves nothing about production.
Corollary, worth socialising: with the live context, the preview URL cannot show unpublished content. It is a production-fidelity gate, not a content preview surface.
Assert structure, never pixels. On a CMS-backed site the copy and imagery change independently of the code, so a pixel diff fires on every author edit; the gate then gets ignored, taking real regressions with it. Assert what holds regardless of what an author writes:
missing React implementation text on any route ← the reconciliationnav / main / footer present; nav carries real links, not all href="/"Harness notes. Use a SEPARATE Playwright config with no webServer block — this suite runs
against a remote URL, and a reuseExistingServer here can adopt a sibling head app on the same port
and pass confidently for the wrong site. Make the base URL required and throw when it is missing
rather than defaulting to localhost; a smoke suite that silently retargets is a check that cannot
fail. Trigger on the platform's deployment_status-style event, not on PR open — the URL does not
exist until the build finishes.
Two false-pass shapes this must survive:
vercel.com. Bare deployment
URLs sit behind deployment protection; only the production alias is public. Assert the final
origin, not just the status — otherwise a protected deployment reads as a healthy one.revalidate never refresh, so a page can serve build-time HTML indefinitely
(x-vercel-cache: HIT, x-nextjs-prerender: 1) while Edge is already right. Smoke the new
deployment, and do not conclude "published ⇒ visible".Prove the gate fails before trusting it. Plant a real mismatch — build with a component key the CM does not have, serve it, and confirm the smoke goes red. A gate nobody has watched fail is not a gate.
Only when the user explicitly asks to build with no tenant. Contain mocks to one seam:
getLayout(path) (or equivalent) module returning fixtures today / client.getPage tomorrow..d.ts).getDictionary, getErrorPage, static params) behind one flag in that module.npm run dev / sitecore-tools:build still hits Edge unless an offline script exists.setup-content-sdk — head-app scaffold + envsitecoreai-cli-cloud-workflow — CLI login / ser pullcontent-sdk-create-component — clone/customize renderings via Authoring GraphQLsitecoreai-edge-graphql-capture — Edge snapshotcontent-sdk-resolver-patterns, content-sdk-debug-layout-probe, content-sdk-component-naming-traps, content-sdk-variants-vs-siblings, content-sdk-app-router-component-level-navigation, content-sdk-app-router-theme-hydration-pattern, content-sdk-app-router-route-handler-vs-server-action, content-sdk-playground-patternWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
sitecore, content-sdk, cms-workflow, head-app, preview-gating
23 skills in this plugin
/content-sdk-analytics-eventsSends Content SDK analytics events: analytics and events plugins, pageView, event, form, identity, field limits, client vs server, bot and editing suppression. Use when adding or debugging tracking calls. Not consent or personalization./content-sdk-atomic-design-assessmentAssesses a Content SDK head app for Atomic Design: scan src/components, rate each low-code candidate / partial / keep-code, derive the atom set, plan a side-by-side migration. Use when asked which components could become atoms. Not writing atoms./content-sdk-collection-data-modelPicks the data model for a component that shows many items: owned rows, derived view, curated list or shared library, and how each is delivered. Use when migrating a tree-walking list or a list is not editable in Pages. Not row templates./content-sdk-component-naming-trapsTraps when adding or renaming Content SDK components: everything in src/components/ becomes a rendering, map keys are SDK-version sensitive, parameter names collide with template fields. Use when scaffolding, refactoring src/ or upgrading./content-sdk-component-reviewReviews one Content SDK component before promotion: verdict per axis (authorability, editing safety, naming, variants, data, scoping, lists, serialization), static and live read-only. Use before merge. Not planning or debugging./content-sdk-create-componentCreates a component (rendering) on a SitecoreAI tenant via Authoring GraphQL, by cloning an out-of-the-box component and customising templates and available renderings. Use when asked to create, clone or scaffold a rendering.npx claudepluginhub chris1415/sitecore-skills-pocs --plugin sitecore-content-sdkOther plugins' skills for the same job