/sitecore-platform:sitecoreai-health-checkfrom Sitecore Platform (SitecoreAI)
Read-only health check for SitecoreAI environments and sites: validates tenant binding, Edge routes, broken links, missing templates, logs, and delivery with a prioritized P0-P3 report.
Ships in Sitecore Platform (SitecoreAI). 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.
Read when SKILL.md points to them; scripts run unread.
Nothing doctor-shaped exists in SitecoreAI behind an API: the Broken Links report, EdgeOrphans and Validate are UI-only, there is no referrers query, and logs live on a separate Monitoring API. This skill composes its own read-only checks across four instruments and writes one prioritized report. Every instrument sees one truth:
| Instrument | Sees | Never use it as |
|---|---|---|
| Authoring GraphQL | master (and the search index) | proof of publication |
| Edge, live context | what is published | proof that master is fine |
| Edge, preview context | master in Edge shape | the "published" side of any join |
| Browser / unfollowed HTTP | what a visitor gets | a followed status (curl -L behind SSO = false 200) |
All traffic goes through scripts/lib/http.mjs, which refuses before the network:
mutation or subscription anywhere is refused), the client_credentials token mint, and the non-JSON /api/revalidate probe with no credential header (it cannot revalidate);GET /webhooks, /webhooks/{id}, /settings, and every /content route (the Edge administration client also holds edge.content:clearall);Each guard is mutation-tested (scripts/__tests__/http.mutation.test.mjs). Beyond the layer: never --yes, never ser pull into a product repo, never ser validate --fix, never change a log level, never republish, never create a credential. Declared side effect: the crawl fires the head app's page-view tracking once per URL.
| Scope | Flags | Runs |
|---|---|---|
| env | --env <cmEnvId> | X0, X1, ops (O3-O5), editing hosts (E2, E3), webhooks (D10), logs (O1, O2, T2 from logs) |
site (default with --site) | + --site <name> [--url <live>] | everything: census, content graph, drift, delivery, crawl |
| page | + --page /route | D1, R1 and the graph for that page's subtree, crawl of one page, media; logs SKIPPED |
| language | --lang <code>[,<code>…] (default en) | census (R1, D11) per language; graph, drift and D1 on the first; W3 on exactly these, or on every environment + version language when absent |
--checks narrows by id or family (binding ops eh delivery census graph crawl logs); X0 and X1 always run. A URL-only run (no --env) does the delivery checks alone. --root overrides the site root when Authoring sites cannot resolve it.
Git Bash rewrites /sitecore/... and /route arguments into Windows paths. Under Git Bash (MSYSTEM + EXEPATH set) the scripts undo the rewrite for paths under the Git install root; any other drive-letter path is refused, never guessed. MSYS_NO_PATHCONV=1 still works and is the safe choice in other shells.
| Credential (env names, three-segment convention) | Enables | Without it |
|---|---|---|
Org automation client SITECORE_DEPLOY_<LABEL>_ADMIN_CLIENT_ID/_SECRET (--org <label>) | X0, Deploy, Authoring, Monitoring logs, context ids | delivery-only run |
Edge administration client SITECORE_EDGE_<LABEL>_CLIENT_ID/_SECRET | D10 webhooks + settings | D10 SKIPPED |
| Tenant-scoped automation client | O6 Publishing jobs, E4 Sites API | SKIPPED (the org client gets 403 / 401 there) |
Access-gate cookie DOCTOR_GATE_COOKIE / --auth-cookie | authenticated robots + crawl on a private surface | those checks UNKNOWN |
Playwright (cwd or PLAYWRIGHT_MODULE) | hydrated crawl, console errors | crawl degraded to server HTML, D9 SKIPPED |
Unsuffixed fallback: when --org <label> finds no SITECORE_DEPLOY_<LABEL>_ADMIN_CLIENT_* but the unsuffixed SITECORE_DEPLOY_ADMIN_CLIENT_* exists, that pair is used and a note says so. It names no estate, so it is only safe because every check reads the named environment with it: a client of the wrong estate cannot read it and the check answers UNKNOWN, never pass.
The org token carries no tenant claim: X0 binds by the Deploy env read (host + context ids) and proves Authoring answers on that host. An editing-host env id is refused (its env read reports the CM host). Credentials come from env or --env-file; values are registered for redaction and never printed.
MSYS_NO_PATHCONV=1 node scripts/doctor.mjs --org <label> --env-file <creds.env> \
--env <cmEnvId> --site <SiteName> --url https://<live-host> [--visibility private --auth-cookie "<c>"] \
--out <dir> [--redact]
Run order (any P0 in the cheap steps is already in the report if you stop early):
/healthz, O3 deployments (advisory), O5 log levels, E2 registrations + stale Rendering Host items, E3 EH variables, D10 webhooks, D1 context, D2 robots, D3 protection, D4 revalidate, E1 editing config.sitecoreai-localization).Cost: about 3 minutes and 260 calls for a 43-route, 553-item site with a 60-page crawl; the graph costs ~7.4 calls per 100 items. Cap with --max-routes, --max-pages, --log-max-bytes.
| Sev | Means | Examples |
|---|---|---|
| P0 | broken or invisible for everyone now | Disallow: / on a public site, live route route:null, app on the preview context, open revalidate endpoint, media from the CM |
| P1 | broken for some readers, or breaks the next publish | internal 404, missing datasource/reference, item whose template is gone, sitemap on the CM host, disabled webhook |
| P2 | degraded or risky | soft 404, no webhook, editing secret unset on a delivery-only app, unpublished pages |
| P3 | hygiene, candidates, info | unreferenced data items, preview-only routes, noisy log lines |
total with what was received everywhere./sso-api means locked.--visibility private inverts robots, protection and noindex verdicts: ask whether the site is meant to be public or private, never infer it.may_be_intentional marks policy findings (no webhook, unset editing secret on a delivery-only app, drafts): the user decides.Exit 0 clean · 1 findings ≥ P1 or UNKNOWN · 2 harness error. Work P0 first. Each finding carries evidence, a remediation line, an owner (cms / code / ops) and, with an item id, Pages and Content Editor links. Typical routes:
cms): fix on master, verify on preview, publish only the item; stale Edge orphans → smart-publish the parent or an EdgeOrphans scan (UI);sitecoreai-edge-admin-webhooks).Layout of the report, statuses and the finding schema: references/report-format.md.
Go-live pipelines can call these directly; same scripts, same verdicts (exit 0 pass, 1 fail, 2 unknown):
| Script | Gate |
|---|---|
scripts/check-edge-context.mjs --env <cm> --site <s> [--app-env-file <pulled .env>]... | LIVE id serves the home route; each app env carries the LIVE id (preview = P0) |
scripts/check-live-robots.mjs --url <live> --visibility public|private [--auth-cookie] | robots per visibility; CM-host Sitemap: line is advisory |
scripts/check-media-delivery.mjs --url <live> [--pages /,/x] | unfollowed 200, non-HTML, from Edge; no media found = unknown |
scripts/check-live-templates.mjs --root <site root> [--context-id <live id>] | no item of the site reads UnknownTemplate on LIVE Edge (unpublished template); a template not on Edge at all is a P2 advisory; absent root = unknown |
scripts/crawl-live-links.mjs --url <live> [--require-browser] | every internal link resolves; MissingComponent; media sources on a dev host; noindex; console errors |
Run standalone, the crawl finds Playwright only from the cwd: point PLAYWRIGHT_MODULE at a head app's node_modules/playwright (with --require-browser, no browser = exit 2, never a pass). The context gate reads credentials from DOCTOR_ENV_FILES / --env-file. Exit codes are set via process.exitCode (a hard process.exit() while sockets close tripped a libuv assertion on Windows: exit 127 after a printed verdict).
scripts/check-estate-parity.mjs --site <s> --a-ctx-file <f> --b-ctx-file <f> [--lang en,de-DE] [--normalize-cm-host] compares one site's LIVE Edge delivery on two contexts (source and target tenant): route set, component structure, fields, route metadata, dictionary, media set, and an unfollowed GET of the target's media. Exit 0 parity, 1 differences, 2 undecided. A context file holds a bare id or a pulled .env. Prove the instrument first: A vs A must give 0; --pair /x=/y of two different routes and --site-b <other> must give 1. The full move procedure (drift probe, same-path cleanup, push, publish, parity, repoint, revert): the sitecoreai-cli-cloud-workflow skill, its estate-move reference.
references/check-catalogue.md: every check with surface, cost, severity, v0.1 status and the measured traps.references/query-recipes.md: Authoring, Edge, Deploy, Monitoring and Edge Admin reads with their measured limits.references/log-signatures.md: formats, the level-aware signature table, reading rules.references/report-format.md: exit codes, statuses, finding schema, redaction.sitecoreai-graphql-schemas · census: sitecoreai-edge-graphql-capture · webhooks: sitecoreai-edge-admin-webhooks · CLI logs and ser pull to scratch: sitecoreai-cli-cloud-workflow · robots: content-sdk-app-router-sitemap-robots · revalidate: content-sdk-app-router-cache-components-and-osr.references/check-catalogue.md (opens in a new tab)references/log-signatures.md (opens in a new tab)references/query-recipes.md (opens in a new tab)references/report-format.md (opens in a new tab)scripts/__tests__/_fake.mjs (opens in a new tab)scripts/__tests__/cli-env.test.mjs (opens in a new tab)scripts/__tests__/detectors.test.mjs (opens in a new tab)scripts/__tests__/estate-parity.test.mjs (opens in a new tab)scripts/__tests__/fixtures/graph-p7-clean.json (opens in a new tab)scripts/__tests__/fixtures/graph-p7-seed.json (opens in a new tab)scripts/__tests__/fixtures/graph-template-targets.json (opens in a new tab)scripts/__tests__/gates.test.mjs (opens in a new tab)scripts/__tests__/http.mutation.test.mjs (opens in a new tab)scripts/__tests__/http.test.mjs (opens in a new tab)scripts/__tests__/languages.test.mjs (opens in a new tab)scripts/__tests__/playwright-resolution.test.mjs (opens in a new tab)scripts/__tests__/report.test.mjs (opens in a new tab)scripts/check-edge-context.mjs (opens in a new tab)scripts/check-estate-parity.mjs (opens in a new tab)scripts/check-live-robots.mjs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
sitecoreai, health-check, edge-cms, broken-links, delivery-audit
npx claudepluginhub chris1415/sitecore-skills-pocs --plugin sitecore-platform17 skills in this plugin
/sitecoreai-agentSitecoreAI Agent API: high-level REST actions such as create page with components, create personalization version and generate brief. Use as the default entry point for apps, MCP servers or automations. It powers the Marketer MCP./sitecoreai-authOAuth client-credentials auth for the SitecoreAI APIs (Agent, Pages, Publishing, Sites): automation client, token endpoint, scopes, env vars, caching, 401s. Load before the first API call. Not head-app Edge context ids./sitecoreai-brand-voiceWrites Sitecore page content in a brand's voice and identity, taken from the PRD or spec or a Sitecore brand kit, never guessed. Sets register (brand, marketing, technical-neutral). Use for copy on a brand or client site. Not page structure./sitecoreai-cli-cloud-workflowSitecore CLI against a SitecoreAI tenant: login, project and environment lookup, connect, ser pull and push, and their silent traps. Use when pulling, pushing or moving a site between tenants, or on CLI environment errors./sitecoreai-content-compositionInventory-first page composition via the Marketer MCP: inventory the site's real components, then compose a page by choosing and ordering them, with the verified add-component recipe. Use when authoring or extending a page, not a single field./sitecoreai-edge-admin-webhooksExperience Edge Admin API: admin client, token, webhook CRUD (OnEnd vs OnUpdate), settings, cache clear, which webhook fits which job. Use when registering, testing or debugging a publish webhook. Not head-app revalidation code.Other plugins' skills for the same job