/sitecore-content-sdk-angular:content-sdk-angular-ssr-express-middlewarefrom Sitecore Content SDK - Angular
Documents the fixed Express middleware chain in src/server.ts of an Angular Content SDK app: order, shared loader cache, and server-only bundle boundary. Use when adding or reordering middleware.
Ships in Sitecore Content SDK - Angular. 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.
src/server.ts builds the Express app: the Content SDK middleware chain plus the Angular SSR handler. The order is load-bearing. Paths are relative to the head app.
Read first: src/server.ts, src/app/app.config.server.ts.
Order (as upstream gives it for Angular):
express.json(): must precede the /_data POST handlercreateSitecoreRevalidateMiddleware({ cache, defaultLocale, sites }): POST /api/revalidatecreateSitemapMiddleware({ client, sites }): /sitemap.xml, /sitemap-:id.xmlcreateRobotsMiddleware({ client, sites }): /robots.txtcreateLlmsTxtMiddleware({ client, sites }): /llms.txtcreateEditingConfigMiddleware({ components, metadataImport }): /api/editing/configcreateExperimentalFeaturesMiddleware(): /api/editing/experimentalcreateEditingRenderMiddleware(): /api/editing/rendercreateMultisiteMiddleware(...): resolves the site onto req.scParamscreateBotTrackingMiddleware(...): sets the sc_bot cookie before personalize decides to skipcreateRedirectsMiddleware(...): short-circuits before any CDP callcreatePersonalizeMiddleware(...): reads the site resolved in step 9createLoaderDataServiceMiddleware(config, { loaders: LOADERS, cache }): POST /_dataexpress.static(browserDistFolder, ...)angularApp.handle(req, { cache: loaderCache, req, res }): SSRUpstream note, kept visible: here multisite (9) runs before bot tracking (10). The Next.js templates run BotTracking before Multisite in their proxy chain. This skill states the Angular order only.
Why it matters: multisite precedes personalize (personalize reads the resolved site); bot tracking precedes personalize (the cookie gates the skip); redirects precede personalize (avoid a wasted CDP call); editing endpoints precede static and SSR; /_data precedes the SSR catch-all.
Shared matcher: steps 8 to 11 share middlewareMatcher (excludePaths: ['/healthz', '/metrics', /\.[^/]+$/]). The SDK already skips /api/*, /sitecore/*, files with extensions, and editing/preview requests. Only add app-specific routes there.
Request context: angularApp.handle(req, { cache, req, res }) puts the loader cache and the Node req / res on REQUEST_CONTEXT, which the SSR loader resolver and the server analytics provider both read.
Providers: app.config.server.ts adds provideServerRendering(withRoutes(serverRoutes)) and provideServerLoaderRunner(). Without provideServerLoaderRunner() the SSR branch of loaderResolver throws. In app.config.ts, provideClientHydration() is deliberately absent: with hydration the server-rendered DOM is reused and directive listeners (notably RouterLink clicks) can fail to attach. Do not add it without an explicit request and a plan to verify routing.
Add an endpoint: register it before express.static and the SSR handler, and after express.json() if it reads a body. If it should be exempt from multisite / redirects / personalize, add it to middlewareMatcher.excludePaths.
/_data before the SSR handler.express.static; add app-specific exemptions to middlewareMatcher.excludePaths.loaderCache instance to the revalidate middleware, the /_data middleware and angularApp.handle(req, { cache, req, res }).express, unstorage, node:* and every create*Middleware are server-only. Never import them from src/app/**.provideServerLoaderRunner() in app.config.server.ts./_data after the SSR handler.src/main.ts.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
express-middleware, angular-ssr, sitecore, content-sdk, server-config
18 skills in this plugin
/content-sdk-angular-component-data-strategyHow a component gets Sitecore data in an Angular Content SDK app: placeholder inputs, route resolve data, SitecoreContextService, no component-level fetch. Use when wiring data or it is missing after navigation. Not Next.js./content-sdk-angular-component-registrationRegisters components in .sitecore/component-map.ts and the SITECORE_COMPONENT_MAP token in an Angular Content SDK app. Use when a component shows as missing or the map changes. Not Next.js./content-sdk-angular-component-scaffoldCreates a standalone Sitecore component under src/app/components/ in an Angular Content SDK app: input() signals, default export, field directives. Use when adding a component. Not Next.js./content-sdk-angular-component-variantsVariants of one component type in an Angular Content SDK app via module exports and rendering.params, then map regeneration. Use for variants or several presentations of one component. Not Next.js./content-sdk-angular-dictionary-and-i18nLocales in an Angular Content SDK app: URL segments, scLocaleMatcher, angular.locales, getLanguage, dictionary via ngx-translate. Use for locale or translation issues. Not Next.js./content-sdk-angular-editing-safe-renderingMakes Angular Content SDK components work in Sitecore Pages editing, preview and Design Library: metadata mode, getEditingPreviewData, sc-editing-scripts. Use when editing breaks. Not Next.js.npx claudepluginhub chris1415/sitecore-skills-pocs --plugin sitecore-content-sdk-angularOther plugins' skills for the same job