/sitecore-content-sdk-nextjs-pages-router:content-sdk-pages-router-component-scaffoldfrom Sitecore Content SDK - Next.js Pages Router
Scaffolds a new Sitecore component in a Content SDK Pages Router app: creates file layout, props interface, and places it in src/components/ for auto-registration in the component map.
Ships in Sitecore Content SDK - Next.js Pages 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.
Scaffold new Sitecore components so they integrate with the layout and editing pipeline. This app uses Pages Router with a single component map.
src/components/ (or existing feature folder). Define props (fields, params), export a single default component..sitecore/component-map.ts regenerates from src/components/ during npm run dev and npm run build; run npm run sitecore-tools:generate-map to refresh it on demand (see the content-sdk-pages-router-component-registration skill).npm run build to verify, then confirm the component appears in the map.Pages Router has no Server/Client split — one component shape, one map, no 'use client' map routing. Value components (Text/Image/Link) and field types import from @sitecore-content-sdk/nextjs. Convention: src/components/<Name>/<Name>.tsx.
// src/components/Promo/Promo.tsx
import { JSX } from 'react';
import { Text, Image, Link } from '@sitecore-content-sdk/nextjs';
import type { TextField, ImageField, LinkField } from '@sitecore-content-sdk/nextjs';
import type { ComponentRendering, ComponentParams } from '@sitecore-content-sdk/nextjs';
export interface PromoFields {
Title?: TextField;
Image?: ImageField;
Cta?: LinkField;
}
export interface PromoProps {
rendering: ComponentRendering & { fields?: PromoFields };
fields?: PromoFields;
params?: ComponentParams;
}
const Promo = ({ fields }: PromoProps): JSX.Element => (
<section>
<h2>
<Text field={fields?.Title} />
</h2>
<Image field={fields?.Image} />
{/* guard field EXISTENCE, not value — empty fields stay authorable in Pages */}
{fields?.Cta && <Link field={fields.Cta} />}
</section>
);
export default Promo;
Props are resolved by getComponentData(page.layout, context, components) in the catch-all page (see content-sdk-pages-router-component-data-strategy), then register in the single .sitecore/component-map.ts.
src/components/. Use existing folder conventions.fields: { title: Field; ... }) and any params. Use types from @sitecore-content-sdk/nextjs (as in the example above) or the app's types.npm run sitecore-tools:generate-map over hand-editing the map; register manually only when the generator cannot handle the change, and expect the next dev/build to overwrite it..sitecore/component-map.ts after regeneration (see the content-sdk-pages-router-component-registration skill). Pages Router has a single map, used by getComponentData and the editing API routes..next/, node_modules/, or build 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-pages-router11 skills in this plugin
/content-sdk-pages-router-component-data-strategyComponent data in a Content SDK Pages Router app: getComponentData after getPage resolves component props for the layout. Use when wiring component data or BYOC in a Pages Router app. Not App Router./content-sdk-pages-router-component-registrationRegisters components in the generated .sitecore/component-map.ts of a Content SDK Pages Router app (regenerate, never hand-edit). Use when adding a component or layout or the editor cannot find one. Not App Router./content-sdk-pages-router-component-variantsOther plugins' skills for the same job