/sitecore-content-sdk:content-sdk-debug-layout-probefrom Sitecore Content SDK - Core
Diagnostic toolkit for Sitecore Content SDK layout responses. Adds a layout-debug API route, a resolver probe component, and an instrumented frame to inspect raw payloads when components render incorrectly or Edge/Preview differ.
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.
Inspecting what SitecoreAI actually delivers to your head app is harder than it should be: the layout response is opaque JSON, the SDL only types LayoutData { item: Item }, and Edge caches changes for ~30 s after publish. This skill installs three small, reusable pieces that turn the head app into a diagnostic surface.
fields will be (array? object? nested data?).Three pieces, in order:
/api/layout-debug routeCreate src/app/api/layout-debug/route.ts:
import { NextResponse } from 'next/server';
import client from 'src/lib/sitecore-client';
export async function GET(request: Request) {
const { searchParams } = new URL(request.url);
const site = searchParams.get('site') ?? 'training';
const locale = searchParams.get('locale') ?? 'en';
const rawPath = searchParams.get('path') ?? '/';
const pathSegments =
rawPath === '/' || rawPath === '' ? [] : rawPath.split('/').filter(Boolean);
try {
const page = await client.getPage(pathSegments, { site, locale });
return NextResponse.json({ request: { site, locale, path: rawPath, pathSegments }, result: page });
} catch (err) {
return NextResponse.json(
{ request: { site, locale, path: rawPath, pathSegments }, error: err instanceof Error ? { name: err.name, message: err.message } : String(err) },
{ status: 500 }
);
}
}
Hit it with curl -s "http://localhost:3000/api/layout-debug?site=<site>&locale=<locale>&path=<route>" | python3 -m json.tool. Returns the raw LayoutServiceData the SDK pulled from Edge.
ResolverProbe component (src/ui/resolver-probe.tsx)Pretty-prints fields, params, and rendering as JSON inside a card. Drop it in any new component that receives an unknown payload:
export const Default = (props) => (
<ResolverProbe component="My Mystery Component" {...props} />
);
The probe reports the payload's kind (array vs object vs primitive) so you can immediately classify the shape.
InstrumentedFrame wrapperA thin caption strip above the rendered component showing componentName · variant · pattern · dataSource. Color-coded left rail per resolver pattern (accent=standard, ok=all-fields, warn=integrated-graphql, ink=content-resolver). Makes the four delivery patterns visually distinct on a single page.
layout-debug route uses client.getPage() which hits Edge Delivery. Author changes need a publish + ~30 s before they appear here. If a parameter change has "no effect," publish first and wait — don't change more things blindly.client.getPreview(...) inside draftMode() (preview data from client.getPreviewData(await headers()) in the plain App Router template, from searchParams with Cache Components) instead of getPage. Add a ?mode=preview flag to the route if needed. Preview bypasses Edge.ResolverProbe before writing a real implementation. Discover the payload shape from the live response, not from prose docs./api/layout-debug before production deploy. It leaks the layout payload (incl. internal item IDs). Gate by process.env.NODE_ENV !== 'production' or delete before merge.tone="content-resolver" on InstrumentedFrame is the right default for any rendering whose payload shape isn't yet known — it visually flags "needs probing."tests/fixtures/graphql/<rendering>.json (with provenance comment) once the shape is confirmed, so future tests don't depend on a live tenant.fields is always an object. Some resolvers return arrays (Navigation, ChildrenContentResolver). Some return nested { data: { datasource: ... } } (Integrated GraphQL). The probe tells you which.result.layout.sitecore.route.placeholders populated.componentName / dataSource exactly — if it doesn't, the wrong component is registered for that name.Edge fetch failed usually means Edge context ID is wrong in .env.local; check SITECORE_EDGE_CONTEXT_ID.content-sdk-resolver-patterns — the catalog of payload shapes the probe will reveal.content-sdk-playground-pattern — the playground that owns this debug toolkit by default.sitecoreai-cli-cloud-workflow — pulling local serialized YAML lets you cross-check resolver behavior against authored state.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
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