/vivreal-knowledge:vivreal-templates-knowledgefrom vivreal-knowledge
Use when working in Vivreal_Templates, the Next.js 16 universal customer-site template (every site builds `stable`) that renders a customer's content via VR_Client_API and @hillbombcreations/site-renderer. Covers the data-driven rule, clientFetchCached and the HMAC revalidate webhook, signed media, the demo-site noindex gate, SEO and OG images, theming, the ISR render mode and the stored-buildSpec trap, the storefront checkout path and the contact route. Triggers on: Vivreal_Templates, site template, customer site, clientFetch, getSiteData, stable branch, promote-stable, site-renderer install, SiteBeacon, OG image route, per-site font, revalidate webhook, SITE_RENDER_MODE, ISR, x-nextjs-cache, page never updates, lifecycleState, demo site, cart, checkout, PAYMENTS_PROVIDER_TYPES, hasProducts, site chrome, emailPopup, social band. Source of truth: `Vivreal_Templates` `CLAUDE.md` at `origin/stable`. Not this: the product model is vivreal-sites, the renderer is vivreal-renderer-knowledge.
Trending skills
7-day visitors to each skill page
Ships in vivreal-knowledge. 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.
Cross-repo flows, decisions and maps: the vivreal-hq dev docs under ${VIVREAL_REPOS}/vivreal-hq/docs/dev-docs/, starting at 03-use-cases/U16-serving-a-live-customer-site.md, 03-use-cases/U28-template-seeding.md; npm run docs:route -- "templates serving" from vivreal-hq names the rest. This skill and the repo's CLAUDE.md own the repo's internals.
Using this skill. It is loaded into the caller's own context; there is no expert agent to dispatch. Cite file:line at the deploy line's SHA for anything you act on, and re-derive any count or roster from source before you rely on it.
Source of truth: Vivreal_Templates CLAUDE.md (and the docs it links) at origin/stable.
Last synced: 2026-10-28 against origin/stable at d484a89 (read the renderer pin from package.json and the lockfile there; per-skill baseline in vivreal-skills scripts/skill-sources.json)
Last extended: 2026-09-16 (ISR render mode, the stored-buildSpec trap that froze vivreal.io's home page, and the Amplify-freeze fixes in #158)
Next.js 16.3.0 (App Router, TS strict, Tailwind 4, Turbopack builds) universal customer-site template, v0.2.0, the Next.js bump (from the 16.2.x line) clears the libvips/sharp CVEs. The repo has only main, stable, and dev PR branches (Phase 2, 2026-07-15): every customer site's Amplify app builds the shared stable branch. Merging main releases NOTHING, releases go out via the promote-stable workflow (see below), after which scripts/fleet-build.mjs starts release builds for the live build tier only (demo sites catch up weekly in demo-catchup.yml). Fully data-driven from the Vivreal CMS via VR_Client_API. Read ${VIVREAL_REPOS}/Vivreal_Templates/CLAUDE.md for depth (refreshed 2026-10-01, about 520 lines; it does not yet cover the 2026-10-03 contact-relay fix or the 1.80 to 1.83 adoptions). For the cross-repo site product/authoring model see vivreal-sites; for the AWS deploy pipeline see vivreal-site-deploy-pipeline; for site-visitor stats see vivreal-analytics-knowledge.
All fetching goes through src/lib/api/client.ts:
clientFetch<T>(path), fetch VR_Client_API, unwrap {success,data,error}.clientFetchSafe<T>(path, fallback), same with fallback on error.clientFetchCached, cached fetch tagged site:<SITE_ID> with SITE_CACHE_TTL_SECONDS (default 60); invalidated by the revalidate webhook. Preview tokens bypass the cache.isQuotaError/402 → renders <QuotaExceeded /> (src/app/error.tsx:20). VR_Client_API has returned no 402 at all since 2026-09-20, so this arm is unreachable today; keep it, do not build on it.Server Components first: page.tsx (async, fetches) → *Client.tsx (interactive). All generateMetadata() reads getSiteData().
src/app/api/revalidate/route.ts, Node runtime + force-dynamic (needs revalidateTag and node:crypto timingSafeEqual). VR_Secure_API's webhookDelivery Lambda POSTs change events signed X-Vivreal-Signature: sha256=<hex(HMAC_SHA256(secret, rawBody))>; after constant-time verification, tagsForEvent derives the affected tags, site:<SITE_ID> (site chrome/theme/nav/footer), collection:<refID>, integration:<type>, and calls revalidateTag. Fails closed (401) until REVALIDATE_WEBHOOK_SECRET is provisioned on the app.
Three rules that follow from how it is fed:
site.updated event. A Studio save goes through VR_Secure_API, which emits site.updated onto the webhook-delivery queue; the delivery worker posts it here and only that site's site:<id> tag drops. A script writing Mongo directly skips all of it: confirm the group has an active webhooks subscription ({ groupID, active: true, events: 'site.updated' }) and send the same body the portal sends, or make one API page write after it.POST /api/revalidate by hand. A hand-called hard invalidation broke robots.txt at the origin (its first statement binds connection(), and its cache entry did not survive), CloudFront cached the 500, and the whole host looked dead while the home page was fine at stable.<appId>.amplifyapp.com. The remedy, and the better tool for a site-record change anyway, is an Amplify start-job --job-type RELEASE on the same commit. Check the origin directly before concluding a site is down.SITE_RENDER_MODE), and the trap that froze vivreal.io's home page (2026-09-16)SITE_RENDER_MODE=isr (trimmed, case-insensitive, nothing else counts) opts a site into incremental static regeneration. src/app/page.tsx and src/app/[slug]/page.tsx export revalidate = 300, a literal that must match ISR_REVALIDATE_SECONDS in src/lib/renderMode.ts (renderMode.test.ts fails on drift). Each gated route's FIRST statement is await enforceDynamicUnlessIsr() (src/lib/renderGate.ts): with the gate off it calls connection() and the route renders per request, as force-dynamic did. [...segments] is still force-dynamic.s-maxage=<revalidate>, with NO stale-while-revalidate. next.config.ts sets expireTime: Math.min(ISR_REVALIDATE_SECONDS, parseSiteCacheTtlSeconds(...)) (the expireTime line, read at d484a89), equal to the page's revalidate, so a page past its window regenerates in the FOREGROUND inside the visitor's request, which Amplify keeps awake. A background window (any stale-while-revalidate) is the regression: Amplify freezes compute between requests, the background regeneration starves, and the page stays stale. A missing stale-while-revalidate is the healthy state, never a finding.x-nextjs-cache, s-maxage=<revalidate>), and so does /domains on the marketing site. A /[slug] page on a composed format reads searchParams (storefront filter and sort, lookup query), which makes that slug per request even with ISR on, so pages like /pricing and /faq keep sending private, no-store. That is by design (the generateStaticParams docblock), not a failed flip.content.* webhook reaches /api/revalidate, revalidateTag(tag, HARD_INVALIDATION) drops the entry, and the next request renders fresh (MISS, new ETag). Measured on vivreal.io home 2026-09-16: 12 and 26 seconds after a portal save, no rebuild.SITE_RENDER_MODE. next build on Amplify sees the whole Amplify env, but the running Next server only sees what the app's STORED buildSpec greps into .env.production. With isr in the env and no SITE_RENDER_MODE grep in the stored spec, the build prerenders the routes as ISR and the runtime runs the gate OFF. Every regeneration then calls connection() inside an SSG render, Next throws E132 ("Page changed from static to dynamic at runtime"), and ResponseCache re-stores the PREVIOUS entry with a 3 to 30 second revalidate, so the page never changes until a rebuild. It looks like a Home-only data problem (every no-store page shows edits at once); page size, fan-out and logs were all chased first and were all wrong. Customer sites with the gap log DYNAMIC_SERVER_USAGE on the gated routes (/robots.txt, /sitemap.xml, /icon, /apple-icon). And a SITE_RENDER_MODE write is INERT until that site rebuilds, while the fleet auto-syncs on the next Templates promote, so pair every write with an observed rebuild of that one site; the discriminator is x-nextjs-cache PRESENCE, not s-maxage.curl -s -o /dev/null -D - "https://<host>/?og=$RANDOM"). Broken looks like HIT with s-maxage=30 and an ETag that survives every save (Next re-stored the previous page after E132), or a save that never produces a MISS. A run of STALE with no-store is NOT a failure on its own. On 2026-09-16, after the fix, vivreal.io's home answered STALE for about 30 seconds and then HIT s-maxage=300 with a new ETag, and the two fixed customer homes answered STALE for over four minutes before settling on HIT s-maxage=300, with no error in their compute logs. The likely reason, inferred and not traced: Amplify compute runs each request as a short Lambda invocation (the log shows START/REPORT, 25 to 700 ms for a STALE response), so a background regeneration only gets CPU while requests keep arriving. The decisive test is a save: healthy gives MISS with a new ETag within seconds, because a hard tag invalidation renders in the foreground. It is the same shape as the degraded-data refusal (optOutOfCachingDegradedRender, whose docblock explains the E132 path), so check the stored spec before chasing upstream data.aws amplify get-app --app-id <id> --query app.buildSpec --output text | grep -c SITE_RENDER_MODE, next to the branch value (aws amplify get-branch --app-id <id> --branch-name stable --query 'branch.environmentVariables.SITE_RENDER_MODE') and the app-level map (branch overrides app). isr with a count of 0 is the bug. No isr value is consistent (dynamic) whatever the spec says. How to fix it without touching env maps: vivreal-eventhandler-knowledge, "Stored buildSpec".authoredBy worked) through the portal's own save, then watch the ?og= probe for MISS and a new ETag, and revert the same way./robots.txt, /sitemap.xml, /icon, /apple-icon) and / regenerate on the first request after their 300 s window. Request them with ?og=<random> every 15 s across that window. Each must go STALE then HIT (a regeneration completed) with no s-maxage=30, and the site's compute log (/aws/amplify/<appId>; the vivreal app has none) must show no Dynamic server usage ... used `connection` and no DYNAMIC_SERVER_USAGE for the window. A first pass where everything is already HIT proves nothing (no regeneration ran); wait out the window and repeat.filter-log-events. A 10-day filter-log-events per pattern took over five minutes per site; aws logs start-query with parse @message /(?<kind>Dynamic server usage|DYNAMIC_SERVER_USAGE|...)/ | stats count(*) by kind, bin(1d) answers in seconds. Group the route-named ones by Route (\S+) couldn't be rendered statically because it used `(\w+)` .Amplify compute runs each request as a short Lambda invocation (START/REPORT in /aws/amplify/<appId>) and freezes the process as soon as the response is sent. Code that assumes the process keeps running breaks here. Two cases were measured on every live site and fixed in #158:
client.vivreal.io failed in 67 to 148 ms, before reaching VR_Client_API (write ETIMEDOUT on Example Comedy Club after 238 s idle, ECONNRESET before TLS on Example Grain Co after 37 s). clientFetchCached fell back to degraded data and robots.txt refused (DegradedUpstreamError) for that one request; the next request always worked. src/lib/api/fetchWithReconnect.ts now retries a GET/HEAD whose fetch() REJECTS with a TypeError, at most twice. An HTTP response of any status, a POST, and a request whose own signal aborted are never retried. Each retry logs [clientFetch] connection failed on <url> (<code>), retry n or [edgeSiteMap] connection failed (<code>), retry n, so the rate is countable. doClientFetch and edgeSiteMap's fetchSiteMap both use it.edgeSiteMap armed setTimeout(abort, 800) for a background refresh that outlives its request; the timer expired while frozen and fired on thaw. 33 of 40 [edgeSiteMap] fetch failed, failing open: AbortError lines were logged 1 to 194 ms into the NEXT invocation, at 25 to 110 a day per site, so a quiet site rarely refreshed its redirect map or frozen-account verdict. src/lib/awakeTimeout.ts (startAwakeTimeout) counts awake time only: 100 ms ticks, each credited at most 300 ms, so a freeze of any length costs at most 300 ms of budget. It can run long under a CPU-bound render, which is the safe direction for fail-open callers.DegradedUpstreamErrors or gate errors.Init Duration about 1.9 s), and one was a single slow request after a 240 s idle gap; that page still rendered without a fallback.connection failed ... retry over the following days before calling that half proven.startAwakeTimeout), and treat any pooled connection as possibly dead on the first request after idle (use fetchWithReconnect for idempotent reads). Tests for either use node:test mock timers: t.mock.timers.setTime(Date.now() + 60_000) then tick(100) simulates a thaw, and the old setTimeout code fails that test.The contact route takes its recipient ONLY from the site (#181, 2026-10-03, 19 of 19 sites rebuilt). src/app/api/contact/route.ts resolves it server-side through resolveSiteContact / resolveContactRecipient (src/lib/contactRecipient.ts, via SITE_ID); anything a caller puts in the body is overwritten before the upstream request, and contactEmail is omitted when the site has none. Before it, the route relayed mail to any address a visitor chose. The other half is VR_Client_API v2.15.0, which made contactEmail optional so a site with no inbox still stores the message. Mail chrome comes from @hillbombcreations/email-brand (resolveTenantBrand, wrapInTenantLayout).
[slug] (universal page, COMPOSE_FORMATS; a format ABSENT from it 404s, the /shop and /about-us regressions; /privacy and /terms 404 on a site that stores no policy page since v6 (owner 2026-10-14, no invented legal text; they used to be synthesized as empty 200 pages), and the signup popup links its consent line only to a stored privacy page), [slug]/[itemId] (collection-item detail incl. collection-list arm + depth-2 nested pages), og/[slug] (dynamic OG image), api/{review,subscribe,shows,contact,checkout,validate-coupon,revalidate}, feeds/schedule.ics, mcp + .well-known/{mcp.json,llms.txt}.
Colors/logo/site name/social/contact all come from siteData. Never commit client-specific content, brand names, colors, or logos. SSR theme vars go on <html> (THEME_TOKEN_KEYS). Per-site: siteData.fontFamily (resolveSiteFont; Geist via next/font; the curated literal families via the renderer's siteFontsHref() sheet, which src/app/layout.tsx links ONLY on a site that draws a literal family, with the Google Fonts preconnects only when a sheet is linked, because next build --turbopack silently drops a globals.css @import url(); per-site sheets go through siteFontStylesheets(), which drops any href the base sheet covers; the site's --font-mono token is SSR'd on first render), siteData.favicon, styleVariant, nav chrome (headerStyle/headerWidth/secondaryCta/brand.logoHeight, siteData.chrome dark/light), footer (socialStyle/newsletterPlacement/brand.logoFilter/tagline), siteData.floatingCta FAB, siteData.emailPopup, inline email capture via Providers-injected onSubscribe. The "Powered by Vivreal" attribution is tier-gated: StaticPageTemplate (and the renderer Footer) call canHidePoweredBy, imported from the renderer re-export, the direct @hillbombcreations/tier-quotas dependency was DROPPED (a second private GitHub Packages package can't auth in customer Amplify builds).
Page-gate mirror retired: src/lib/pageGating.ts + its spec are DELETED, EmailPopup/index.tsx and Navigation/NavbarChrome.tsx import isPageAllowed/normalizePageSlug from the renderer (1.36.0); currentSlugFromPathname → normalizePageSlug is behavior-identical incl. the null case. Consequence: announcement bar per-page targeting now works, it was previously authored in Studio and honored by nobody (the hand-mirrored page gate was the cause); it's now honored via the renderer's isPageAllowed.
SiteAnalytics, the CUSTOMER's third-party tag (siteData.analytics {provider: google_analytics|plausible|fathom, trackingId}), fail-closed ID validation.SiteBeacon, Vivreal's first-party cookieless beacon → https://collect.vivreal.io/e (override NEXT_PUBLIC_ANALYTICS_ENDPOINT), gated on SITE_ID set and ≠ 'preview' (on by default for deployed sites, NOT gated on siteData.analytics).Origin resolution chain: NEXT_PUBLIC_SITE_URL → domainInformation.live_url → domainName (resolveSiteOrigin; domainInformation threads through getSiteData). Per-page seo.metaTitle/seo.metaDescription, exact-title rule (no title.template), buildOgImageUrl → /og/<slug>.
seo.noindex on a page emits robots {index:false, follow:false} from generateMetadata in BOTH [slug]/page.tsx and the home page.tsx; emitted only when set (the root layout.tsx demo-site rule stands alone). Stored as the negative (noindex), absence = indexed, no backfill needed./og fallback chain is three rungs, page labels.ogImage → site defaultOgImage → generated branded card. defaultOgImage is still read from siteDetails.values (src/lib/api/siteData/index.tsx:256): it is a MEDIA descriptor and values is where the mediaFields registry signs it.bb44233, 2026-09-29). VR_Secure_API writes chrome (announcement, utility strip, email popup and the rest) only to the site document's top level and merely preserves the siteDetails.values mirror, so the mirror goes stale on the first save and an owner's edit never arrived. A dual read was rejected on purpose: it keeps two sources of truth and lets a stale mirror win on the most-edited sites. A field unset at the top level now reads as unset; fix the DATA. The values spread stays for theme tokens, fonts, redirects, lifecycleState and analytics. The pure logic is in chrome.ts, a JSX-free module so node --test can reach it.Demo sites must not outrank the customer's real site. src/lib/seo/demoSafety.ts, isDemoSite() + getDemoSourceUrl(), keyed on siteData.lifecycleState ('demo' | 'live', flat siteDetails.values field alongside sourceUrl; flips at cutover via the revalidate webhook, no rebuild) with a SITE_LIFECYCLE env fallback. Fail-safe: absent ⇒ NOT demo ⇒ indexable. Wired into robots.tsx (Disallow: / for demos), getSiteMap (returns an empty sitemap for demos; the live sitemap is built by buildSitemapEntries in src/lib/seo/sitemap.ts from raw.pages), and the root layout.tsx generateMetadata (noindex,nofollow and NO canonical, src/lib/seo/rootMetadata.ts, owner decision W25-12a 2026-10-10; the old canonical to sourceUrl pointed re-skinned demos at their donor business and the kit demos at vivreal.io).
src/lib/api/media.ts is canonical:
getSignedUrl(field), reads currentFile.source (signed by VR_Client_API's signCloudFrontUrl; unsigned CDN URLs 403). Never build CDN URLs manually.getSrcSet(field), reads currentFile.srcset (signed resized variants; absent until the backfill has run for that media).getArtDirectedSources(field), maps {primary, sources[]} to the renderer's ContentItem.artDirectedSources (<picture>), dropping variants missing a media query or signed source.CDN domain media.vivreal.io lives in next.config.ts images.remotePatterns (plus *.s3.us-east-1.amazonaws.com). Signing TTL defaults to 86400 s on the API side (CLOUDFRONT_SIGNED_URL_TTL_SECONDS, raised from 300 s), and VR_Client_API signs at REQUEST time, not render time (P0C, 2026-09-28). Signed URLs still expire before crawlers read them, so src/components/JsonLd/unsignMediaUrl.ts strips Expires/Signature/Key-Pair-Id before JSON-LD/OG embedding (signed URLs expire before crawlers read them). images.unoptimized is env-gated (VIVREAL_PREVIEW_UNOPTIMIZED === '1', local pre-cutover previews only); dangerouslyAllowSVG is on with a hardened CSP (script-src 'none'; sandbox) so migrated SVG logos don't 400.
products[] = [{price, quantity, name}] to /api/checkout; VR_Client_API resolves the payments provider SERVER-side from the group's single active payments integration. The price slot carries a Stripe price id OR a Square catalog variationId, page config can never misroute money; a wrong/missing provider binding yields an EMPTY catalog, not a mis-charge.src/lib/payments.ts, PAYMENTS_PROVIDER_TYPES (stripe, square) + isPaymentsProvider(): a deliberate LOCAL mirror of VR_Secure_API's D4-mutex set (updateIntegrations.js PAYMENTS_PROVIDER_TYPES), same pattern as the renderer's local poweredBy tier set. Shopify is EXCLUDED on purpose (Phase 5 hosted-redirect checkout; not in the backend mutex set); a size-pinned test fails loudly on accidental additions. Consumers: the Providers hasProducts cart-mount gate, the [slug]/[itemId] detail route (provider resolved via collectBindingTargets, the SAME collector the list page uses, so list and detail fail consistently), and buildPageContext's productBridge routing.Providers hasProducts gate now WALKS coordinated-group child bindings (src/lib/payments.ts gained the walker; Providers/index.tsx simplified), a coordinated-group parent binding alone no longer hides the cart.composePage component overrides (ProductsPageComposed/CoordinatedProductsComposed, which carry SiteRendererBridge → the CartAdapter) were registered only in the products arm, so on any other format Add/Buy/card-click were silent no-ops (ProductsProvider.handleAdd guards on the adapter). Fixed via the shared LIVE_PRODUCTS_OVERRIDES module (src/components/PageTemplates/liveProductsOverrides.ts) + extracted parseProductQuery (src/lib/composition/productQuery.ts), registered for EVERY composed format; renderComposedPage accepts overrides + the controlled product query. The [slug]/[itemId] PDP arm fires when the page's bindings resolve a payments provider via collectBindingTargets, and falls through to the collection/menu arms on a product miss so catalog tiles keep working. Found on the first live Square E2E (catalog-format Shop page).Navigation/CartDialog.tsx + ProductDetailClient/FloatingCartDialog.tsx render the renderer's BrandMark instead of a cropped fixed-box logo ("never crop a brand logo").checkoutIdentifier threading (renderer ≥1.38.0): consumers resolve checkoutIdentifier ?? default_price, coalesced BEFORE resolveVariantableString, which is what keeps legacy Stripe sites argument-identical. The identifier passes through FOUR explicit whitelist projections; silently dropping it from any one breaks Square checkout (empty priceID) with no compile error, so each is a pure test-pinned module: lib/api/products/transformProduct.ts (objectValue → Product, adds checkoutIdentifier: objectValue.checkoutIdentifier ?? default_price ?? scalar variationId), lib/cartProduct.ts (rendererProductToTemplates), components/PageTemplates/ProductDetailRenderer/templatesProductToRenderer.ts, plus the renderer's own contentItemToProduct.npm test is node --experimental-strip-types --test "src/**/*.test.ts", it cannot load 'use client'/.tsx/server-only modules, and RUNTIME imports need relative explicit-.ts paths (type-only @/ imports are fine, they're stripped). Pure logic that needs pinning gets extracted into a plain .ts sibling (precedents: mapItem.ts, transformProduct.ts, cartProduct.ts, templatesProductToRenderer.ts).main = the only template; stable = the release channel every site builds. There are NO per-customer or per-template-type branches. Per-site emergency hold = disable that app's stable auto-build + explicit start-job..github/workflows/promote-stable.yml): workflow_dispatch-only manual promotion fast-forwarding main → stable. GitHub App installation token, promote-stable concurrency group, a merge-base --is-ancestor guard plus a non-force push (double fast-forward protection). It assumes the AWS role BEFORE pushing stable, then scripts/fleet-build.mjs starts one release build pinned to the promoted commit per app in the live build tier (the vivreal:buildTier tag; untagged counts as live). Inputs scope: live|all and dry_run. Demos catch up in demo-catchup.yml, which is also the recovery for a failed fan-out (tier: live); never re-run promote-stable to recover, it re-reads main and moves stable again.@emnapi transitive entries AND dropped sharp optional transitives (the 1.40.1 fleet rollout was blocked by a clean regen that dropped sharp's optional transitives); Amplify's npm ci then fails. That history is why NOT to regenerate: never delete node_modules + package-lock.json and reinstall, and never npm install on Windows, which prunes the Linux-only optional dependencies the Amplify build needs. Patch only the changed entry's version, resolved and integrity (from npm view <pkg>@<version> dist.tarball dist.integrity), confirm the optional-dependency count is unchanged, then prove it with npm ci --dry-run. The package-publisher agent owns that procedure.API_KEY, SITE_ID, NEXT_PUBLIC_SITE_URL, SITE_CACHE_TTL_SECONDS, REVALIDATE_WEBHOOK_SECRET, SITE_RENDER_MODE (set by hand per site, not by createAmplifyApp; it only reaches the runtime if the stored buildSpec greps it, see ISR render mode above), NEXT_PUBLIC_ANALYTICS_ENDPOINT, NEXT_PUBLIC_SENTRY_DSN, PARTNERS_ID (SHOWS_ID/TEAMMEMBERS_ID legacy fallbacks). BUCKET_NAME/CDN_BASE_URL are gone.Installed from GitHub Packages (.npmrc: @hillbombcreations:registry=npm.pkg.github.com + NODE_AUTH_TOKEN), read the current pin from package.json on the deployed line; it moves most weeks. A clean regen is the wrong tool here: it floats OTHER carets too (the 1.38.0 bump rode next 16.2.11→16.2.12 + sentry 10.68 to the whole fleet) and can DROP optional transitives (the 1.40.1 sharp incident above). Bump the version in package.json and text-patch the lockfile entry as in the Lockfile gotcha above, never a delete-and-reinstall; Amplify runs npm ci, so a stale or npm-pruned lock fails the fleet build. Treat the first post-merge main CI build as the canary before promote-stable. Local renderer dev: npm run dev:linked (runs ../vivreal-site-renderer/scripts/dev-sync.js). That overlays a dev build onto the installed package and never reverts it: dev-sync.js replaces dist/ and styles/ inside node_modules/@hillbombcreations/site-renderer and deliberately never writes that package's own package.json, so the version string, npm ls and the lockfile integrity all stay authentic and no ordinary check sees it (measured 2026-09-30: an overlay stood in for the published package here for five days and produced three wrong conclusions, all off green runs). Undo with node ../vivreal-site-renderer/scripts/dev-unlink.js; prove it either way with node ../vivreal-site-renderer/scripts/dev-status.js, a byte comparison against the tarball this repo's own lockfile integrity resolves to (about 0.2s, the only check with no false negatives). pretest and prebuild here refuse when the marker RENDERER-DEV-OVERLAY.json is present at the repo root (checks/assert-no-renderer-overlay.mjs, 2026-09-30); acknowledge deliberately with ALLOW_RENDERER_OVERLAY=1 npm test in bash or $env:ALLOW_RENDERER_OVERLAY='1'; npm test in PowerShell. The marker only exists from 2026-09-30, so its absence proves nothing about an older overlay; dev-status.js does. The old --install-links git-dep dance is dead. Private dependencies: this app has installed a SECOND private package, @hillbombcreations/email-brand (exact 1.1.0, package.json:18), since #173 on 2026-09-22, and every fleet build since has succeeded (19 of 19 on the 10-03 and 10-04 promotes). So the old rule that customer Amplify tokens can read only the renderer is not true of this app as it stands, even though CLAUDE.md:246 still calls a second private dependency a known way to brick the fleet. Do not add @hillbombcreations/tier-quotas (the renderer re-exports canHidePoweredBy, and FREE_YEAR_OFFER hand-copies the one number it needs), and confirm the Amplify token can read any new package before adding one. The RENDERER's own rule is separate and stands: the renderer package itself must not depend on another private package.
src/lib/detail/itemSummary, resolveItemSummary, called from src/app/[slug]/[itemId]/page.tsx); only web, mailto and tel links are kept. restrictToLinked (src/lib/detail/linkedItems) builds detail items only for what some link on the site reaches, mirroring the renderer's served-collection rule. src/middleware.ts answers scanner probes (.php, .asp, .aspx, .jsp, .cgi, wp-*, .env, .git and similar) with a data-free no-store 404, and an authored redirect for a legacy address still answers its 308. The Detail pages model is vivreal-sites references/detail-pages.md.SIGNUP_SUCCESS_TEXT, internal), and its sweep test refuses "inbox" or "confirm" in visitor copy; an authored success line still wins. Templates' subscribe page says the same (src/components/PageTemplates/SubscribeClient.tsx, Templates #199), and the kits dropped "check your inbox to confirm" (migrator master). The server side is VR_Client_API (vivreal-client-stack-knowledge).siteData.timezone is the business zone as VR_Client_API serves it (siteDetails.values.timezone), spread with no Templates code of its own; src/app/layout.tsx computes "today" with nowInZone(siteData.timezone). The chain and the repeat rules are the renderer's (vivreal-renderer-knowledge).origin/stable d484a89)src/app/api/indexnow/key/[key]/route.ts serves the key file; POST /api/indexnow/urls is the signed sitemap snapshot the EventHandler indexNowFlush worker reads (contract and auth in src/lib/indexnow/snapshot.ts, private, no-store).llms.txt at /llms.txt and /.well-known/llms.txt (src/app/llms.txt/route.ts, src/app/.well-known/llms.txt/route.ts).src/components/SiteConsent/ emits gtag('consent','default',...) before config from the stored choice and consent update on a choice; ad_personalization is always denied (consentCopy.test.ts).site-snapshot.json written by scripts/build-with-snapshot.mjs, after the live read and the data cache and before the caller's fallback, never written back into the cache (src/lib/api/snapshot/floor.ts, SNAPSHOT_FLOOR in src/lib/api/client.ts).AttributionCapture (root layout, beside SiteBeacon) writes the vr_attr attribution only within the consent choice (src/lib/attributionCapture.ts); GA4 and Ads conversion run through src/lib/analytics.ts.A site can show the owner's synced social posts. src/lib/api/collections/socialPost.ts maps a synced post to a renderer item (SOCIAL_POST_ITEM_FIELDS = date, href, imageUrl, with the caption as the title); a band resolves against the items as fetched; a dropped feed is an empty section, not a 404; per-post skips and the per-platform ticks go through one allowlist; the outbound TikTok oEmbed call from the live site is deleted. Which layouts may display posts comes from the renderer's isSocialEligible (Templates CLAUDE.md:398-412). The posts themselves come from the CMS hourly sync: see vivreal-social-sync.
templateType for layout, layout comes from pageConfigs[].format (one exception: templateType === 'restaurant' enables the FAB). Render-behavior changes belong in the renderer, not branch logic.data/mockData.ts is fallback only (used if the API is unavailable).The expert agents are retired (2026-10-28), so the review checklist they used to carry lives
here. Query rules (tenant scoping, the mainDb _id
lookup, the publishDate and archived filters) live in vivreal-knowledge:vivreal-db, and
packaging and limits in vivreal-infra:vivreal-lambda; they are not repeated here.
tenantDb[database].sites in getSiteDetails.js), the group's stored placement, not from the control-plane Vivreal database; the vivreal-db skill carries the routing rules. This expert reads Mongo only to verify site-doc shapes (pages, collectionGroups, siteDetails.values, deployment), and reads the copy in the tenant database.siteData.redirects; Templates src/lib/redirects.ts resolveMissingItemRedirect answers a 301 from it in [...segments] and [slug]/[itemId] when nothing else serves the path. A path that resolves to a real page is never redirected, so a redirect "not firing" usually means the old path still renders something.getMediaFilesFromFields.js:1-22 iterates mediaFields and reaches data[main] or data[main][sub], ceiling two, so no shape written inside a JSON-string field can ever be signed (which is why objectValue.demoSites could not be fixed by writing descriptors into it). Two locations that do work, both verified: a top-level array field on the item indexed by mediaFields, or the block config, which processSiteDetails.js:251-265 resolves with a real depth-6 recursive walk. Also: mediaFields is keyed by FILENAME, so same-named files collide (seven keys requested, six returned, old-mill-bakehouse.jpg resolving to the backgrounds path instead of the cards path).What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub hillbombcreations/vivreal-skills --plugin vivreal-knowledge27 skills in this plugin
/sentry-tracerUse when investigating what happened during a Vivreal user action across the stack, tracing an error end-to-end, validating a deploy, or doing tenant-scoped triage with Sentry. Teaches WHEN to trace cross-stack (frontend spans ↔ backend logs ↔ WebSocket events) and HOW (trace-ID propagation, the standard tag set, request_id fallback, service.* breadcrumbs). Triggers on: "what happened when I did X", "why did this error", trace this request, Sentry issue, deploy validation, "everything's broken for this group", crash, error timeline. For the full investigation agent with Sentry MCP tools wired in, dispatch the `sentry` agent / `/sentry-trace` (both in the `vivreal-sentry` plugin); this skill is the passively-loaded knowledge layer. Also covers the step from a Sentry error to the AWS and Atlas metric that confirms an infrastructure cause (502 with no backend event, Lambda timeout, Mongo connect-hang, throttling, OOM, stalled deploy)./vivreal-accounts-and-writesUse before filming, walking or capturing anything in the Vivreal portal or on vivreal.io, and before any write a capture or walk makes. Carries which login to use for which business (the demo account, the QA scratch owner, the owner session), the eight-step owner-approved write protocol (named approval, snapshot, write through the UI, fresh-process read-back, restore, manifest entry), the never-list (Post, Publish, Schedule, Connect and the rest), and the rules for stills that fill vivreal.io marketing slots (pair by what the slot says, no demo site has its own web address, mask comped plan figures). Shared by footage-recorder, tutorial-maker, help-page-producer, qa-walker and marketing-auditor. Triggers on: which login, demo account, QA scratch-2, test account, switch business, owner-approved write, write protocol, snapshot and restore, mutations, marketing still, screenshot swap, vivreal.io slot, walk harness, write guard, POST allow list, PRO badge./vivreal-admin-app-knowledgeUse when working on, walking, deploying or reasoning about the internal admin app (vivreal-hq packages/admin-app), the invite-only, sign-in-only staff hub that holds every staff surface since v7 (outreach CRM, sign-ups, monitoring, errors, tickets, flags, audit, usage, economics, deployed sites, team, staff push), covering where it lives, its own identity pool and session, how it calls the fleet with no active_ctx, the deploy by fast-forwarding deploy/admin-app, its two ops Lambdas, what each page reads, including the dark navy restyle and the Releases, Database, Marketing and Inbound pages. Source of truth: `vivreal-hq` `packages/admin-app/CLAUDE.md` (and the docs it links) at `origin/deploy/admin-app`./vivreal-agent-knowledgeUse when working on, writing about, or debugging Vivreal AI. The AI offering is connecting an AI agent through the Vivreal MCP server (VR-MCP-Server, plan flag mcpAccess, metered in mcpToolCalls), and nothing else: the in-app assistant is RETIRED (owner 2026-10-07, agentActions 0 on every tier; the global FAB, drawer and /agent page were deleted 2026-09-24) and only dead code survives in the portal (Studio AiRail, EditPlan) and VR_Secure_API's agent Lambda. Covers the copy rule ("AI agent", never assistant or a model name), the real gates, and the retired surface's archaeology. Triggers on: AI agent, MCP, connect an AI agent, AI assistant, AI assistant not showing, agentActions, aiActionsEnabled, aiSiteEditing, aiComponentGen, mcpAccess, mcpToolCalls, AiRail, useAgentAccess, EditPlan, proposeSiteEdits, agent/execute, agentProgress. Sources: VR-MCP-Server, Vivreal-Tier-Quotas src/tierQuotas.ts./vivreal-analytics-knowledgeUse when working on Vivreal's first-party analytics, VR_Analytics_API (the collect→store→rollup pipeline), the Templates SiteBeacon, or the per-site traffic dashboard (VR_Secure_API read route + portal AnalyticsPanel). Covers the CloudFront+WAF → Lambda Function URL ingest chain (X-Origin-Verify, bot filter, Joi, per-IP rate limit, daily-salt visitor hash), the analytics_rollup DynamoDB design, the daily rollup cron into mainDb.site_traffic_daily, the LIVE auto-deploy status (GitHub Actions → CloudFormation) plus the W4 CDN egress meter (runs unconditionally), and where increment 2 lives. Triggers on: analytics, site traffic, beacon, SiteBeacon, visitor stats, page views, unique visitors, analytics_rollup, site_traffic_daily, first-party analytics, per-site dashboard, collect.vivreal.io, visitor hash, rollup cron, CDN egress meter, VR_Analytics_API. Source of truth: `VR_Analytics_API` `CLAUDE.md` (and the docs it links) at `origin/main`./vivreal-blender-knowledgeUse when scripting or rendering in Blender for Vivreal, above all the Vivreal duck mascot in vivreal-hq/brand/mascot/model. Covers headless renders (blender -b -P script.py -- args, --factory-startup, --python-exit-code), bpy data versus ops, bmesh, depsgraph evaluated_get and new_from_object, mathutils transform gotchas, flat toon and NPR rendering in EEVEE (Emission plus the Standard view transform, exact sRGB hex, dither, filter size, transparent film, orthographic framing), outline methods compared (Freestyle, Grease Pencil Line Art, inverted hull, ID-pass edge inking), and the 4.2 to 5.2 API changes that break scripts (EEVEE engine id, blend_method, use_nodes, Grease Pencil v3). Triggers on: Blender, bpy, bmesh, headless render, background render, EEVEE, Workbench, Cycles, toon, cel, NPR, outline, inverted hull, Freestyle, Line Art, Grease Pencil, view transform, AgX, Filmic, mascot, the duck, duck.py, render.py, mascot-artist.