Reference doc for adding content and understanding how this portfolio is wired. Written so future contributors can make changes without re-deriving the architecture each time. Last audit update: 2026-09-13.
- One source of truth for identity:
src/data/data.ts— an entity registry keyed byslug(name, date, role, accent color,hasCaseStudy, href). - Per-surface files reference entities by
slugand add only their own copy:src/data/work.ts→ Work page + homepage layoutsrc/data/about.tsx→ About page accordionssrc/work/<slug>.md→ case-study content (the only place body copy lives)src/data/craft.ts→ Craft gallery (standalone, not entity-based)src/data/timeline.ts→ homepage experience timeline
- Two pipelines do the heavy lifting:
- Images — author a
.png/.jpg, runnpm run optimize:images, and it generates.avif+.webpsiblings. You only ever reference the.png;<Picture>/bgImageSet()derive the modern formats at render for public paths. Bundledsrc/assetsimages need explicit format imports because Vite hashes filenames. - Routes & SEO — case-study routes, the sitemap, JSON-LD, and per-route
<head>tags are auto-discovered fromsrc/work/*.md(seesrc/lib/cases.ts→caseSlugs). Add a markdown file and they all appear.
- Images — author a
- The only manual SEO file is
public/llms.txt. Everything else regenerates onnpm run build.
npm run dev # Vite dev server (port 5000)
npm run build # tsc + client build + SSR build + prerender + 404 copy
npm run preview # preview the production build
npm run audit:assets # after build: duplicate pixels/files, image siblings, local links
npx tsc --noEmit --noUnusedLocals --noUnusedParameters # stricter code hygiene
npm run optimize:images # generate .avif/.webp for all raster images
node scripts/optimize-images.mjs <filter> # only paths containing <filter>npm run build is the source of truth. It typechecks, builds the client,
builds the SSR bundle (src/entry-server.tsx), runs scripts/prerender.mjs
(writes per-route HTML + sitemap.xml + robots.txt), then copies the shell to
404.html. It throws loudly if a work.ts slug is missing from the registry.
Files: public/craft/ + src/data/craft.ts
- Drop the image in
public/craft/(e.g.proj-home.png). Prefer.png/.jpg. Videos (.mov/.mp4/.webm) work but are not optimized — keep them small. npm run optimize:images(or... optimize-images.mjs proj).- Add one entry to the
ITEMSarray incraft.ts:{ src: c("proj-home.png"), label: "Project — home screen", date: "2026", alt: "What the screen actually shows", link: "https://…", linkLabel: "Visit" },
Notes:
idis auto-generated from array position — never set it.- Array order = grid order = lightbox order.
- A11y: Craft renders
alt={item.alt ?? item.label}(CraftCard.tsx). Most existing items only havelabel, so the title doubles as alt. For new items, set a realaltdescribing the image content, not just its name. - Optional
aspect(width/height) reserves layout space pre-load → avoids CLS.
Files: src/data/about.tsx (+ src/data/data.ts if it's a brand-new entity)
- Entity already in
data.ts? Just add anAccordionRowPropsentry to the right array (workExperience/freelancing/collaborations/activities):{ slug: "thing", description: ["Para one.", "Para two."], caseStudyHref: "https://…", caseStudyLabel: "View site" }
descriptionis a string or string[] (multiple paragraphs). The external link fields are only for entities without an internal case study. - Brand-new entity? Add it to
data.tsfirst (slug, name, date, role, accent,hasCaseStudy). All surfaces reference it by slug afterward. hasBorderTop: falsegoes on the first row of each section only.- About content is real DOM text and is server-prerendered → crawlable. No metadata edits needed.
IBM is now a full case study: src/work/ibm.md exists and its registry entry
has hasCaseStudy: true. The steps below use IBM's paths as a concrete example
of the setup needed for a new study; substitute the new project's slug and copy.
A. Create src/work/<slug>.md — this single file unlocks the route. Copy the
frontmatter shape from src/work/replit.md:
---
slug: ibm
title: IBM
subtitle: One-sentence description (~100–155 chars). Reused as the Work subtitle,
meta description, OG/Twitter description, and the llms.txt line — write it well.
role: Design Intern
type: Product Design, …
about:
- First paragraph. Markdown [links](https://…) are supported.
finalDesigns: <label>
---
## Section heading
Body copy.
 CaptionThe instant this file exists, these auto-generate on build: the /work/ibm
route, its sitemap.xml entry, CreativeWork + BreadcrumbList JSON-LD, and
all per-route <head> tags (title/description/canonical/OG, with
cover.png as the social card). The router also stops treating /work/ibm
as a noindex not-found.
B. Flip hasCaseStudy: true in data.ts. This drops the "Coming soon."
label and links the Work/Home card to the study (comingSoon is derived from it).
C. Add body images. Structural images (cs-hero, grid-1/2/3, home-hero,
preview) may already exist. For each in-body image referenced in the markdown:
drop the .png in public/images/<slug>/, run npm run optimize:images, then
reference it with descriptive alt. Markdown image syntax:
- Single:
 Caption - Two-up:
![/images/a.png "alt a" | /images/b.png "alt b"] cap a | cap b
D. Update public/llms.txt — add the case study under ## Case studies
(this is the ONE SEO file that is not auto-generated):
- [IBM](https://clementroze.com/work/ibm): one-line summary.
E. npm run build and verify: dist/work/<slug>.html has real body content,
dist/sitemap.xml lists the new URL, and <title>/OG tags are project-specific.
| Name | Purpose | Optimizer cap |
|---|---|---|
home-hero.png |
Homepage hero | 3840px (retina) |
cs-hero.png |
Case-study hero | 3840px |
cover.png |
Case-study cover background + OG social card | 3840px |
preview.png |
Floating hover preview on Work list | 2000px |
grid-1/2/3.png |
Work-page grid thumbnails | 2000px |
| anything else | In-body content images | 2000px |
home-hero, cs-hero, cover are the only names that get the larger hero cap
(see HERO_NAMES in optimize-images.mjs). Name accordingly.
- Author images as
.png/.jpg, reference the.png, and always runnpm run optimize:imagesafter adding. The.avif(and.webp) siblings are what ~99% of visitors actually download. Never link.avif/.webpdirectly for public content. Bundled assets may import a single WebP explicitly (for example the LinkedIn icon). Originals are kept as fallbacks. - Alt text is the main accessibility lever. Case-study images → alt in
markdown. Craft → the
altfield. Don't rely onlabel/filename. subtitle:in case-study frontmatter is reused four ways — treat it as the SEO meta description.- Never hand-edit
sitemap.xml,robots.txt, or the JSON-LD — generated. - Do hand-edit
public/llms.txtwhen case studies change. - Domain is the
SITE_ORIGINconstant insrc/lib/caseStudySchema.ts(https://clementroze.com). Everything derives from it — no per-content edits. - Verify with
npm run build, not justnpm run dev(dev doesn't prerender).
src/data/data.ts Entity registry (identity: slug, name, date, accent…)
src/data/work.ts Work page + homepage layout (by slug)
src/data/about.tsx About accordions (by slug)
src/data/craft.ts Craft gallery items (standalone)
src/work/<slug>.md Case-study content (frontmatter + body)
src/lib/cases.ts Route discovery (caseSlugs, caseExists, loadCase)
src/lib/parseCase.ts Markdown → structured case-study data
src/lib/caseStudySchema.ts JSON-LD builder + SITE_ORIGIN constant
src/lib/routeMeta.ts Per-route <head> metadata (title/desc/canonical/OG)
src/lib/router.tsx Custom history router
src/entry-server.tsx SSR entry (eager imports — see SSR gotcha below)
scripts/prerender.mjs Build-time: per-route HTML + sitemap + robots
scripts/optimize-images.mjs PNG/JPG → AVIF/WebP
src/components/Picture.tsx <picture> AVIF→WebP→PNG fallback + bgImageSet()
public/llms.txt AI-crawler guide (MANUAL — keep in sync)
public/fonts/ Self-hosted Helvetica Neue (see Fonts below)
- Hosting is Replit Static. It ignores
_redirects(Netlify-style). Real rewrites would live in.replit [[deployment.rewrites]]. Unmatched paths fall back to404.htmlserved as 200 (a soft-404). Mitigation already in place: unknown routes / invalid slugs render a realNotFoundpage with a runtimenoindex(seerouteMeta.ts+main.tsx), and the sitemap only lists real URLs. True 404 status codes aren't achievable on this host with current tooling — don't chase them; the noindex approach is the accepted remedy. - SSR requires eager imports.
src/entry-server.tsxmust import page components directly (not viaReact.lazy), or prerender won't await the chunks. The client (main.tsx) still uses lazy/createRoot— that's fine. - Browser APIs in components must be SSR-safe. Keep
window/documentreads insideuseEffect/event handlers, or guard render-time reads. The prerender wraps each route in try/catch and degrades to the shell on failure. - Image priority:
Pictureaccepts typedfetchPriorityand emits lowercasefetchpriorityfor React 18. Only the opening homepage artwork is high priority; later project artwork is lazy/low priority. Do not infer priority from an index inside a nested one-item list. - CSS font variable is
--font(it was renamed from--font-interwhen Inter was dropped). Body 400 = Helvetica Neue Roman, headings 500 = Medium. - Konami easter egg exists. ↑↑↓↓←→←→ B A toggles "rainbow mode" (also a Footer
button + a dismissable toast). State of truth is the
html.konamiclass; the Footer label syncs to it via aMutationObserver. The toast animates in only after the 6-column wipe reveal finishes. Relevant CSS:.konami-*instyles.css; logic inmain.tsx+Footer.tsx.
- Self-hosted Neue Helvetica Pro 55 Roman (weight 400) + 65 Medium
(weight 500) in
public/fonts/. These are the two weights the site uses. - Webfont license is single-domain (MyFonts/Monotype, Build ID 3867246).
It covers
clementroze.com. Don't reuse these files on other domains/sites. - The
@licensecomment instyles.css(andindex.html) is required — leave it in place. - The shipped files are the "line height adjustment" kit (corrected vertical metrics) — not the default kit. If re-downloading, grab that variant.
The code is already authored for clementroze.com (canonical, OG, SITE_ORIGIN
all point there even while served from a v17.* staging host). When going live:
- No code changes needed — only stale "v17 staging" wording in comments.
- Confirm the font license domain is
clementroze.com. - Add a 301 redirect
v17.* → clementroze.comso any indexed/shared staging URLs forward. - Re-scrape social cards (LinkedIn Post Inspector, Facebook Sharing Debugger).
- Validate a couple
/work/<slug>pages in Google's Rich Results Test once live.
- This repo commits directly to
main(solo portfolio); per-task commits are the norm. Match the existing commit-message style. End commit messages with theCo-Authored-Bytrailer. - Prefer editing the source-of-truth file, not generated output. If asked to
change a URL/title/description, trace it back to
data.ts/ the.mdfrontmatter /routeMeta.ts— don't patchdist/. - After content changes, run
npm run buildto confirm prerender + sitemap, not justnpm run dev. - When adding a case study, the checklist is essentially: one
.mdfile + flip one boolean indata.ts+ onellms.txtline + images (then build). Almost everything else is derived. - Watch for SSR-safety when adding components that touch
window/document.
Home.tsxassembles the page and owns vertical hero/page scrolling.Carousel.tsxowns horizontal project scrolling, drag/scrub state, native snap, navigation dots and slide accessibility. Inactive slide content isinert; the slide wrapper remains clickable to select an adjacent preview.FeaturedProject.tsxrenders one project and the opening artwork transition. It replaces the experimentaleffects/EffectB.tsxname and redundant array wrapper. Passopeningonly for the first project. Content comes fromdata/work.ts.ExperienceCarousel.tsxand its CSS own the timeline cards/ruler. The earlierHybridExperienceCarouselfilename was renamed; existinghybrid-experience__*CSS classes remain the styling contract. Content lives indata/timeline.ts.CraftPreview.tsxis intentionally retained but disabled bySHOW_CRAFT_PREVIEWin Home. It curates existing Craft images; do not copy those assets for Home. Re-enabling it requires checking pointer, wheel, keyboard and reduced motion.CraftCard.tsxowns gallery media readiness, lazy image loading and video visibility. Videos pause offscreen, while the lightbox is open, when the gallery pause toggle is enabled, or when reduced motion is requested. Failed media must clear the loading shimmer. Opening a video in the lightbox is user initiated.useCarouselKeyboard.tsgives focused carousels priority. Viewport-center arrow shortcuts apply only when focus is on the page body, never another control. Callback refs keep window listeners stable during scroll-driven renders.
- Keep native touch scrolling. Mouse drag must distinguish a click from movement, release capture on cancellation, and suppress only the gesture's pointer click. Keyboard activation must still work immediately afterward.
- Cancel animation frames, observers and delayed scrolls on unmount. Respect runtime changes to reduced motion, not just the value at first mount.
useRevealshares a reference-counted scroll-speed listener across gallery cards; the last cleanup removes it. New scroll measurements should be batched in rAF.- About navigation uses
about_openand optionallyabout_scrollin sessionStorage. Timeline links clearabout_scroll; case-study returns retain it. About restores one destination after the accordion expands, with a timeout fallback and cleanup. Keep the consumed request in a ref so StrictMode replay can reschedule it. - Keep inactive controls out of keyboard navigation. The timeline ruler retains its compact original spacing and colors by design. Do not rely on opacity alone to hide interactive content.
- Homepage featured artwork and experience cards share the homepage
--radius-imgtoken (16px), including on mobile. Other pages retain their existing radius. The opening featured artwork keeps its hero-to-card corner transition.
Scope: all tracked working-tree changes and new source/assets present at the start of this audit, plus shared components they affect. Existing user changes were preserved; no commit or deployment was made.
Fixed priority loading of all four featured images, competing/stale About scroll restoration, carousel focus ownership, hidden slide links, reveal listener cleanup, Craft video autoplay lifecycle, and an uncancelled lightbox close animation. Removed unused experimental About-story/Effect B CSS and an unused case-study type import. Kept the original timeline marker sizing/colors per design feedback and made the automatic intro less than five seconds. Component names now describe their purpose.
Removed three unused export families (nine files, about 3.7 MiB):
craft/wvbr-page.*, images/google/poppins.*, and images/ibm/cs-hero-t2.*.
Canonical artwork remains in wvbr-home.*, images/bio/poppins.*, and
images/ibm/cs-hero.*. Optimized format siblings are intentional fallbacks, not
redundant images. The audit script compares original decoded RGBA pixels as well
as exact file hashes; it does not classify visually similar crops as duplicates.
Validation: production TypeScript/client/SSR build and all 10 prerendered routes;
strict unused-symbol check; asset audit (687 image files, 20 HTML files including
route aliases/404, 527 unique local references); desktop/mobile browser smoke tests.
npm run audit:assets fails on duplicate exports, missing optimized public-content
siblings, or missing local resources linked from prerendered HTML. Run after build
so it examines current output. It checks public references, not external website
availability or every runtime-only UI state.
Remaining limits: this is not a WCAG certification or a cross-browser/device lab run. Screen-reader testing, real touch hardware, field Core Web Vitals and semantic review of all older image alt text remain useful release checks. Large original PNGs are retained as authoring/fallback assets; AVIF/WebP are the normal delivery path. The existing stylesheet and legacy scroll compatibility code can be split further in a dedicated refactor, with route-by-route visual verification.
At widths up to 768px, the hero uses its content height. Featured-work slides
vertically center their artwork/copy with 96px top and 112px bottom clearance.
The carousel grows with the tallest slide and uses min(88svh, 780px) as its
minimum slide height; do not restore a fixed 100svh height or 24px top padding.
Experience height combines a capped viewport proportion with card height plus
200px clearance, so short/landscape screens can scroll through the full content.
Mobile page snapping is proximity-based; horizontal carousel snapping and the
measured hero spring remain intact. The opening artwork observes layout resize
so its transition keeps following the actual section geometry.
Section footer text is 15px on mobile. Featured-work dots sit above the footer labels to prevent overlap at narrow widths. Desktop layouts and other pages keep their existing sizing. The disabled Craft preview has a corresponding mobile height rule; verify its stacked-card animations if it is enabled again.