Skip to content

Commit ceecf9e

Browse files
docs: CLAUDE.md described two different landings at once
The file documented the current six-chapter editorial build AND the retired five-act "Live surface" build it replaced, as though both were live. Three sections were describing code that no longer exists: The Mobile bullet turned on "the same five acts at every width" and `ActRadarLock`'s webgl prop. There are no `Act*.tsx` files in the tree. Rewritten around what is actually true — six chapters at every width, `ChapterArt` at lg and up, the catalog's 8-tool cap on a phone, and the fact that `MobileHome` is now imported by nothing. The fail-safe animation rule stays and now names `ui/Reveal.tsx` alongside FiveMinutePlan's canAnimate gate. Engine mechanics still inventoried the five acts by name and span and called scroll-as-time-axis the signature move. Replaced with a note that the build is gone, including that `fetchHistoryBulk` survives in trends.ts with no caller. The constellation bullet called `LiveConstellation` "the PEAK's lock target (act 3)". It is imported by nothing, as are `TechSphere` and `ScrollExpand`; the peak is the pinned catalog and uses no 3D. Kept the reasoning about why it never became a page-scale background, since that is the part worth not relearning, and flagged all three as unmounted rather than deleting code nobody asked me to delete. The separate ScrollExpand bullet said "still available for other routes" — corrected to mounted nowhere. Added what this session built and the file had no entry for: domainColour.ts as the single source for domain colour, TechLogo being app-wide rather than landing-only, and the catalog's filter chips plus the pinned-stage height constraint that governs them. Verified every claim against the tree before writing it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent cbbfc34 commit ceecf9e

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎CLAUDE.md‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,17 @@ To grow the signal further: add more subreddits/RSS feeds, fetch HN story text (
9090
- **App Router** (`frontend/src/app/`). Key routes: `/` (landing — **six editorial chapters on the `scrollcraft` engine, "chaptered editorial" grammar**; see below), `/explore`, `/trends`, `/compare`, `/tools/[slug]` (renders `LearningResources`), `/roadmap/[technology]` (interactive path — per-step "Watch on YouTube" + per-tool "Best course" videos, progress check-off), `/roadmaps`, `/watchlist`, plus the growth surfaces: `/plan/[slug]` (public shareable career-plan landing, per-goal OG preview), `/learn/[slug]` (SSR SEO guide "How to Learn X in 2026" with Course/FAQ JSON-LD), and `/api/og` (dynamic Open Graph card via `next/og`). `ShareButton` (native share + copy) drives the acquisition loop; goal→roadmap mapping lives in `src/data/goals.ts`. `sitemap.ts` lists all learn/roadmap/plan/tool pages. Set `NEXT_PUBLIC_SITE_URL` in production so OG/canonical/sitemap URLs are absolute.
9191
- **`frontend/src/data/trends.ts` is the only place the frontend talks to the backend.** Every page imports typed `fetchX()` helpers from here (`fetchTools`, `fetchOverview`, `fetchToolDetail`, `fetchLearningPath`, `fetchCompareTools`, etc.). Fetches use Next.js ISR (`revalidate`). **Do not hardcode tool/score/roadmap data in components — it must come through this layer.**
9292
- **Same-origin API proxy (do not undo).** The browser calls its OWN origin `/api/v1/*`; `frontend/next.config.ts` rewrites that to `BACKEND_ORIGIN` server-side. So there is **no CORS** and only the page's own port must be reachable (this fixed the class of bug where a hardcoded `http://<LAN-IP>:8000` was unreachable from the same machine/phone). `API_BASE` in `trends.ts` = `window.location.origin` on the client, `process.env.BACKEND_ORIGIN || "http://localhost:8000"` on the server (SSR/ISR). **`NEXT_PUBLIC_API_URL` was removed — do not reintroduce it.** Gotchas: `BACKEND_ORIGIN` is read at BUILD time by `rewrites()`, so it must be set before the build (docker-compose passes `http://backend:8000` as a build arg; Vercel sets the public backend URL); the rewrite is scoped to `/api/v1/*` so the app's own `/api/og` route is NOT proxied. Absolute site URL (OG/canonical/sitemap/JSON-LD) has a single source of truth: `frontend/src/lib/site.ts` (`SITE_URL` ← `NEXT_PUBLIC_SITE_URL`).
93-
- **Mobile:** the landing renders the **same five acts** at every width — what must be avoided on a phone is the WebGL context, not the design, so `ActRadarLock` takes a `webgl` prop and swaps its ground for a CSS lattice below 768px. R3F still never mounts there. `MobileHome` is now reached ONLY when there is no live data to build the acts from. Entrance animations there (and in `FiveMinutePlan`) are fail-safe: content only starts hidden once a visible tab is confirmed (`canAnimate` gate), else it paints visible — never stranded by an animation that doesn't fire. The `Navbar` is **app chrome** (tab strip + a live status line from `/overview`), transparent with a scroll-progress bar — Live surface forbids a wordmark-plus-CTA bar, and mono is kept for data/labels but not as a "technical" costume; `template.tsx`'s page transition is opacity-only (a transform there breaks the fixed navbar's stick).
93+
- **Mobile:** the landing renders the **same six chapters** at every width — the design is not what has to go on a phone. `ChapterArt` is `lg:block` only, and the pinned catalog caps at 8 tools behind its domain chips (the stage cannot scroll, so anything that does not fit is clipped away silently). **`MobileHome` is imported by nothing** — `page.tsx` falls back to a plain "reading the last cycle" state when there is no data, so the separate mobile page is dead code awaiting a decision. Entrance animations are fail-safe everywhere and must stay that way: content only starts hidden once the code has confirmed it can un-hide it, else it paints visible — the `canAnimate` gate in `FiveMinutePlan`, and the same rule in `ui/Reveal.tsx`. The `Navbar` is app chrome — a floating 50px pill (`fixed inset-x-0 top-3`, white surface, hairline) holding a tab strip over the surfaces plus a live status line from `/overview` at `lg` and up; `template.tsx`'s page transition is opacity-only, because a transform there breaks the fixed navbar's stick.
9494
- **Auth:** Clerk, wired via `<ClerkProvider>` in `frontend/src/app/layout.tsx`. Keep it.
9595
- **Design system ("warm editorial", adopted 2026-08-27, measured off `mindmarket.com` and replacing Dala):** **LIGHT-FIRST.** Cream `#F5F1E4` ground, white `#FFFFFF` and deeper beige `#E0DBCE` panels, charcoal `#2C2E2A` ink, `#6A6C64` secondary, `#5E605A` tertiary. Four accents: green `#8ED462`, coral `#FF705D`, yellow `#F5E211`, blue `#2BA0FF`; `--accent-1` is charcoal (filled buttons) and `--accent-2` is coral (punctuation). **Inter at weight 500 for headings AND body** (Dala's 400/200 rule is retired). **Panels have a REAL surface**: fill, 1px hairline, and a shadow with offset and blur, at **10px** radius; pills at 50px. The old "no card surface" rule and its `.route-data` hairline exception are both gone. **Data colours stay separate and constant** — score-green `#12B76A`, amber `#B54708`, red `#F04438`. Dark is the OPT-IN, retuned to a warm `#1B1917` rather than pure black so it reads as this system inverted. **The theme default lives in TWO places that must agree**: the pre-paint script in `app/layout.tsx` and the mount effect in `Navbar.tsx`. When they disagreed the Navbar silently won and the whole app stayed dark after the palette flip. **Colours a token swap cannot reach must be hand-edited**: `ChartContainer.tsx`, `api/og/route.tsx`, `3d/LiveConstellation.tsx`, `3d/TechSphere.tsx`. **Contrast is a much narrower margin on cream than on black** — `#B6B6B6` (the reference's own lightest grey) measures 1.79:1 as text, and their `#80827F` secondary is only 3.95:1 even on white; both were darkened rather than copied. **Tailwind gotcha:** `text-[var(--x)]` works, but `text-[color:var(--x)]` generates NOTHING (it parses as a variant), and Tailwind will not emit a colour utility for the feedback pill at all — hence the explicit `.fab-pill` rule. **A Tailwind font-size or colour utility does not apply to a `<button>` here at all** — measured across the landing, every `a`/`p`/`span`/`figcaption` carrying `text-[13px]` renders at 13px and every `button` renders at 18px, the browser default; the same buttons ignore `text-[var(--c-ink-2)]` and inherit the chapter's ink instead. This is almost certainly why `.btn-primary`/`.btn-secondary` were hand-written CSS. **Anything with a required type size or colour on a `<button>` belongs in `globals.css`, not in a `className`** — see `.chip`, `.on-ink`, `.on-accent`, `.fab-pill`. **Turbopack gotcha:** `globals.css` edits don't serve until `.next` is deleted and the dev server restarted; this bites EVERY time.
9696
- **Logo (`Navbar.tsx`)** — built on the reference's construction: an abstract letterform from **flat geometric primitives on a grid** (a large quarter-circle sweep, a solid square, a smaller quarter-circle), each gradient-filled, **no strokes and NO container badge** — the mark floats on the void. Ours makes the primitives mean something: quarter-circles are radar sweeps, the square is the stack. The **wordmark stays monochrome white at weight 400** — the mark carries all the colour, otherwise the two compete. Gradients are allowed here precisely because the spec exempts the logo and particle art.
97-
- **The landing is a `scrollcraft` build.** Chapters live in `components/landing/Ch*.tsx` (title → guess → measurement → **catalog, the peak** → order → colophon), 6 chapters at ~9.7vh, with `StackFolio` as the margin nav. **Signature move: reading builds your stack** — picks in the catalog fill the folio and the colophon computes from them. **Real objects, not emoji:** `ui/TechLogo.tsx` renders `simple-icons` brand marks (29 of 31; foundry and hardhat fall back to emoji), and `public/media/shot-*.png` are product screenshots captured from the running app. **`ui/AssetSlot.tsx` renders labelled placeholders** for the three assets still owed (screen recording, beta quotes, founder photo) — see `ASSETS-TODO.md`; never fill these with invented content. **Verification gotcha:** the dead-scroll check builds its signature from cues/clips/rails, so a bespoke animation is invisible to it and the peak was reported dead while animating correctly — publish `data-sc-verify-state` with the RENDERED value (never raw progress). The harness also needs `html.sc-ready`, so it cannot audit routes that don't mount the engine.
98-
- **Engine mechanics (adopted 2026-08-27).** The engine is vendored **byte-identical** at `public/scrollcraft/scrollcraft.js` (+ `src/lib/scrollcraft/scrollcraft.css`, imported at the top of `globals.css`) and **must never be edited** — bespoke behaviour goes in the page, driven off `--sc-p` and our own `data-sc-*`. Themed by remapping `--sc-*` onto Dala tokens at the end of `globals.css`, never by touching the engine's stylesheet. Five acts in `components/landing/` (instrument `pin` 1.6 → time-axis `pan` 2.4 → radar-lock `pin` **3.4, the peak** → sources `flow` → commit `pin` 2.3), 11.0vh total. **Signature move:** scroll is the time axis — the wheel scrubs the real `ToolSnapshot` series (`/tools/history/bulk`) and the ranking reorders; only POSITION tweens, every number shown is snapped to a real reading. Gotchas, each cost a debugging round: the engine is an **IIFE, not a module** (static import breaks SSR, dynamic import won't typecheck — load it as a script); `mount()` **collects acts once** and `layout()` never rescans, so `ScrollcraftRoot` must not mount until the data has rendered its acts; there is **no `destroy()`**, so the wrapper keeps one instance per root and empties `acts/worlds/clips` on unmount; and **Lenis is disabled on `/`** because two systems interpolating `scrollY` disagree about where the page is. Verify with `node <skill>/scripts/shoot.mjs --url http://localhost:3000` (needs `playwright-core` in `frontend/`) — it catches cue windows that never peak and contrast over media. Brief + fingerprint registry live in `scrollcraft/`.
99-
- **`ScrollExpand` (`ui/ScrollExpand.tsx`)** — a scroll-driven zoom/expand. `fit="media"` frames a 16:9 stage that opens 62%→100% while the media counter-zooms (`mediaZoom`); `fit="content"` wraps existing markup and applies only the scale. **No longer mounted on the landing** (its scale gesture fights pinned acts); still available for other routes. Keep the count low — past three or four, a page-wide zoom stops reading as a beat. It writes a `--expand` CSS var from ONE passive rAF-throttled listener, never per-frame React state.
97+
- **The landing is a `scrollcraft` build.** Chapters live in `components/landing/Ch*.tsx` (title → guess → measurement → **catalog, the peak** → order → colophon), 6 chapters at ~9.7vh, with `StackFolio` as the margin nav. **Signature move: reading builds your stack** — picks in the catalog fill the folio and the colophon computes from them, both rendering from the one `lib/stack/diagnose.ts` so they cannot drift. The catalog chapter carries **domain filter chips** and shows all 31 tools; because its stage is PINNED it cannot scroll, so short viewports get tighter spacing (`.catalog-*` under `max-height: 880px`) rather than fewer tools — at 1366x768 it fits with ~2px to spare. `StackFolio` has **two forms**: the margin folio at 2xl and up, and a docked pill below it (the margin needs 13rem of clear space that a 1440 laptop does not have), appearing only once something is picked. **Real objects, not emoji:** `ui/TechLogo.tsx` renders `simple-icons` brand marks (29 of 31; foundry and hardhat fall back to emoji) and is used **app-wide, not just here** — TrendCard, the explore card, the trends row, the tool detail header and the watchlist row all render marks, so the console does not revert to emoji the moment you leave the landing. `public/media/shot-*.png` are product screenshots captured from the running app. **`ui/AssetSlot.tsx` renders labelled placeholders** for the three assets still owed (screen recording, beta quotes, founder photo) — see `ASSETS-TODO.md`; never fill these with invented content. **Verification gotcha:** the dead-scroll check builds its signature from cues/clips/rails, so a bespoke animation is invisible to it and the peak was reported dead while animating correctly — publish `data-sc-verify-state` with the RENDERED value (never raw progress). The harness also needs `html.sc-ready`, so it cannot audit routes that don't mount the engine.
98+
- **Engine mechanics (adopted 2026-08-27).** The engine is vendored **byte-identical** at `public/scrollcraft/scrollcraft.js` (+ `src/lib/scrollcraft/scrollcraft.css`, imported at the top of `globals.css`) and **must never be edited** — bespoke behaviour goes in the page, driven off `--sc-p` and our own `data-sc-*`. Themed by remapping `--sc-*` onto Dala tokens at the end of `globals.css`, never by touching the engine's stylesheet. **The five-act "Live surface" build this paragraph used to inventory is gone** — there are no `Act*.tsx` files, and its scroll-as-time-axis signature move went with it (`fetchHistoryBulk` survives in `trends.ts` with no caller). The current build is the six chapters above. Gotchas, each cost a debugging round: the engine is an **IIFE, not a module** (static import breaks SSR, dynamic import won't typecheck — load it as a script); `mount()` **collects acts once** and `layout()` never rescans, so `ScrollcraftRoot` must not mount until the data has rendered its acts; there is **no `destroy()`**, so the wrapper keeps one instance per root and empties `acts/worlds/clips` on unmount; and **Lenis is disabled on `/`** because two systems interpolating `scrollY` disagree about where the page is. Verify with `node <skill>/scripts/shoot.mjs --url http://localhost:3000` (needs `playwright-core` in `frontend/`) — it catches cue windows that never peak and contrast over media. Brief + fingerprint registry live in `scrollcraft/`.
99+
- **`ScrollExpand` (`ui/ScrollExpand.tsx`)** — a scroll-driven zoom/expand. `fit="media"` frames a 16:9 stage that opens 62%→100% while the media counter-zooms (`mediaZoom`); `fit="content"` wraps existing markup and applies only the scale. **Mounted nowhere at all now** (its scale gesture fights pinned acts, and it was never adopted elsewhere) — see the unmounted-components note below before reaching for it. Keep the count low — past three or four, a page-wide zoom stops reading as a beat. It writes a `--expand` CSS var from ONE passive rAF-throttled listener, never per-frame React state.
100100
- **Ambient background — `ui/AmbientField.tsx`.** A fixed, scroll-driven field mounted ONCE in `layout.tsx` (above the route, so it survives navigation) and rendering nothing on `/`, where scrollcraft owns scrolling and the chapters' opaque grounds would occlude it. Three layers off one passive rAF listener writing two CSS vars: rules (a chart baseline grid), contacts, and a progress band. **Both parallax layers are BOUNDED and must stay that way** — a raw multiplier slides the repeating grid off its own overscan and flings the contacts a screen and a half above the viewport, so the rules offset is taken modulo the 96px tile and the contacts drift off `--af-p` within ±60px. It replaced `.ambient-particles` / `.ambient-orb*` / `.cursor-spotlight`, which were retired-palette leftovers (`#8052ff`, `#ffb829`, `#15846e`) the token swap never reached.
101101
- **Scroll reveal — `ui/Reveal.tsx`.** One shared IntersectionObserver for the whole app (31 rows on `/trends` would otherwise be 31 observers). **The resting state is VISIBLE**: it starts shown and only hides once the effect confirms an observer exists, motion is allowed, and `document.visibilityState !== "hidden"` — IO callbacks are suspended in a background tab, which is exactly how content gets stranded at opacity 0. It writes the class through the ref rather than holding state, because a setState in the effect body trips the repo's cascading-render rule. Stagger must roll over (`i % 6`), never climb with the index.
102-
- **The 3D constellation is now the PEAK's lock target** (act 3 of the landing), composited under a reticle driven from `--sc-p`. It is not rewritten and not a background. It was once promoted to a fixed full-viewport layer to copy the reference's brain; that failed because theirs is thousands of 1–2px triangles (a texture you look *through*) while ours is ~40 labelled data spheres (an information graphic you *read*). At viewport scale it became giant blobs and floating chips over the headline. Scroll-morphing between formations still exists in the component but is **gated to the `background` variant** — a contained figure that deforms as you scroll past reads as a glitch.
102+
- **The 3D constellation (`3d/LiveConstellation.tsx`) is imported by nothing**, and so are `3d/TechSphere.tsx` and `ui/ScrollExpand.tsx`. This bullet used to call the constellation "the PEAK's lock target (act 3)"; that was true of the retired five-act build. The peak is now the pinned catalog chapter, which uses no 3D at all. The reason it never became a page-scale background is still worth keeping: the reference's brain is thousands of 1–2px triangles (a texture you look *through*) while ours is ~40 labelled data spheres (an information graphic you *read*), so at viewport scale it became giant blobs and floating chips over the headline. Left in the tree, unmounted; delete or remount deliberately rather than by accident.
103+
- **One colour per domain — `lib/stack/domainColour.ts`.** The single source, keyed by roadmap slug (the one id the coverage bar's Domain *name* and a roadmap card's slug both resolve to, via `ROADMAP_BY_CATEGORY`). Before it, `diagnose()` assigned accents by catalog-size rank and `ChOrder` cycled a different array by list index, so Web Development was green in one chapter and coral in the next. Its eight tints deliberately are **not** the four-accent set extended — that array held three near-duplicate pairs, which is fine as decoration and useless as identity. All eight are light enough to carry charcoal `on-accent` text (the darkest, blue, is 4.90:1).
103104
- **Number formatting:** always pass a locale — bare `.toLocaleString()` uses the BROWSER's locale, so 2772018 rendered as `27,72,018` on an en-IN machine and would differ per visitor. Use `.toLocaleString('en-US')`.
104105

105106
## Constraints (do not break)

0 commit comments

Comments
 (0)