A Little Corner of My World

This website, a static-first Astro site with a world atlas, Pagefind search and a live pixel farm, held to byte budgets and accessibility gates. I built it by directing a team of AI coding agents.

Stack
Astro, TypeScript, MDX, Zod, Tailwind CSS v4, D3 (geo, zoom), Pagefind, Biome, Vitest, Playwright + axe, Cloudflare Pages
Architecture diagram. Content flows through astro build into static output, then through a local quality gate to Cloudflare Pages, which is not deployed yet. In the browser, JavaScript runs only in four islands.
Contents

Summary

This site is a personal magazine with three parts: work, journeys and photographs. Its homepage opens on a small living pixel farm. Under the hood it is a static-first Astro build. Every route is pre-rendered, JavaScript ships only in a short, closed list of islands, and every byte is checked against a named budget on every build.

I built it by directing a team of AI coding agents in Claude Code. The roles were a lead architect, a project manager, content and UI-migration engineers, and later product, design, content, DevOps and frontend roles under a Team Lead session. Independent reviewer agents audited the work at phase boundaries. My part was the product brief, the rulings the agents escalated to me (for example, keeping the serif font’s optical-size axis, ADR 0019), and deciding which content may be published at all. The work ran as twelve documented phases from 2026-07-18 to 2026-08-08. A rebuild of the structure around work, journeys and photographs followed on 2026-12-05.

Demo: you are looking at it. The homepage is the best entry point.

Problem

The prototypes looked right but were built wrong for production:

  • The homepage hydrated the whole page through a runtime that evaluated strings with new Function().
  • The atlas lived in an iframe. It downloaded D3, the map data and the fonts a second time, and it talked to the page through postMessage calls keyed by display names, not ids.
  • The stats bar showed hard-coded numbers: 48 cities on screen, against 20 in the data.

The goals were the opposite: static HTML first, one source of truth for every count, WCAG 2.1 AA, and a fast first view on a throttled phone. Later a stricter content rule was added: only owner-authorised content ships. In practice that means nine public travel journals in Chinese, their photos, and two case studies. There is no invented bio and no CV.

Architecture

Personal website architecture Content is authored as MDX and JSON under src and checked by Zod schemas and a content validator. Astro builds every route to static HTML and CSS, with every count derived at build time, and Pagefind indexes the output. A local quality gate runs typecheck, lint, unit tests, content validation, the build, dependency, link, budget and vendor checks, and Playwright end-to-end tests. The static output is meant for Cloudflare Pages, which is configured in a deploy workflow that has not run yet. In the browser, navigation is ordinary page loads, and JavaScript lives only in a closed list of four islands: the atlas, the command-K search, a CSS-first scroll reveal, and Little Agent Valley on the homepage. Content MDX + JSON in src/ Zod schemas, typed refs fixtures can't ship (0023) astro build static, no SSR adapter counts derived at build Pagefind index (0005) dist/ HTML + CSS, no JS default island JS, closed list static search index Quality gate — npm run ci (run locally; remote CI has not run yet) typecheck · Biome · Vitest · validate:content · build · check:deps check:links · check:budget (B-1…B-7) · check:valley · Playwright e2e (axe, Web Vitals) Cloudflare Pages — not deployed yet static files only; no server runtime Browser — ordinary page navigation, JS only in islands (ADR 0006) Atlas D3 + TopoJSON ⌘K search UI over Pagefind Scroll reveal CSS-first Little Agent Valley vendored, / only
Build-time content, a local quality gate, static hosting, and JavaScript only in islands.
Text description of the diagram

MDX and JSON content, checked by schemas, goes through astro build to static HTML and CSS, and Pagefind indexes the output. A local quality gate runs type, lint, unit, content, dependency, link, budget and end-to-end checks. The output is meant for Cloudflare Pages, which is not deployed yet. In the browser, JavaScript runs only in four islands: the atlas, the ⌘K search, a CSS-first scroll reveal and Little Agent Valley.

Content lives in typed collections. Long-form writing is a single collection with variants per type (ADR 0002). Travel journals, trips and photos have their own collections, and every photo is addressed by a stable id derived from a content hash (ADR 0023). Places are referenced by id, so a typo fails the build instead of rendering a broken link.

Everything that produces a number or a list on the page runs at build time. The browser only handles interaction: map pan and zoom, opening overlays, search queries and the farm.

Engineering decisions

  • Static-first with a closed island list (ADR 0006). No client-side router, no hydration of whole pages or layouts. A new island needs a new decision record, and the farm got one (ADR 0022).
  • The atlas as an inline island, not an iframe (ADR 0001), with a typed contract between build and runtime (ADR 0008). D3 is imported only inside the island. Before the runtime was written, ADR 0013 added each country’s map-data name to the contract, because matching on display names would break on the first country where the two differ.
  • Only the D3 modules the map uses, not the umbrella d3 package (ADR 0014). An earlier tampered transitive dependency made a small, traceable dependency tree a hard requirement.
  • Pagefind for search (ADR 0005). The index is a static file built from the published output, so search can never drift from the content.
  • Our own Playwright Web Vitals harness instead of Lighthouse (ADR 0017). Lighthouse brings 26 direct dependencies, including a second browser-automation stack and a telemetry client. We gave up the 0–100 score and kept the underlying metrics.
  • Budgets with exact definitions: each line fixes the compression level and the routes it covers (ADR 0017 §6–7).
  • Real content and fixtures are separate corpora (ADR 0023). Invented test content lives under tests/fixtures/, and a real build fails on any entry flagged as a fixture.
  • Design tokens with a 13 px type floor and CJK line heights for the Chinese journals (ADR 0024).

Implementation

Each phase ended with a written handoff. The quality gate grew one check at a time: Biome alone instead of ESLint and Prettier (ADR 0015), Vitest, Playwright for the atlas, search, accessibility, performance and the farm, a link checker, and a budget script with no dependencies. For the rebuild, an importer brought in the nine old blog posts. It never reads GPS data, and validation rejects any photo record with a location field.

Challenges

A ratified claim withdrawn. ADR 0017 had stated that network throttling has no effect over loopback. In Phase 12 that turned out to be false: only the navigation request is exempt, and subresources are throttled. The thresholds were re-derived in a new record (ADR 0020), not edited in place.

Evidence corrupted by a shared working tree. In Phase 11, two independent reviewers ran in the same working tree at once. One saw a half-rebuilt dist/ with 24 phantom broken links and a server the other had killed. Since then, every concurrent agent works in its own git worktree.

Tailwind reading the prose. Automatic class detection turned ordinary words in comments, documentation and even a vendored file into global CSS. At one point the word “shadow” in an ADR and a test file added 37 B gzip. With new utilities, the /atlas page reached 10,721 B of CSS against a 9,000 B ceiling. Rather than raise the ceiling, ADR 0024 turned detection off.

Contrast. The tertiary text colour measured 3.38:1 and was used in 43 places, so secondary text failed AA everywhere. One token change brought it to 5.46:1 (ADR 0018). Phase 12 closed all eight accessibility findings it tracked.

Photos behind a Referer check. The original photo host returns 403 to other sites. Instead of spoofing headers, the owner chose to rehost (ADR 0026). The pipeline is built and tested on generated images and waits for one-time access to the bucket. Until then, journal photos render as placeholders.

Trade-offs

  • About 156 KB of fonts kept on purpose. Keeping Newsreader’s optical-size axis costs 156,260 B. The owner ruled to keep it, and the ruling is recorded in ADR 0019 rather than hidden in a raised ceiling.
  • The farm costs bytes on /. 94 KB gzip arrives after load, under its own budget line, with 0.6 % headroom left.
  • No analytics, no dark mode, no translations. Analytics are left out for privacy; translations would put words in the owner’s mouth; dark mode is deferred.
  • Lab numbers only. Until deployment, every performance figure is a regression detector, not a measure of real visitors.

Verified outcomes

Budgets were measured with npm run check:budget on a local build on 2026-12-05. The other rows cite the record they come from.

Measure Result Record
Atlas runtime (B-1) 30,054 B / 34,000 B gzip check:budget
Map data (B-2) 38,403 B / 44,000 B gzip check:budget
JS on any static content route (B-3) 2,404 B / 4,500 B gzip check:budget
CSS on any route (B-4) 8,599 B / 9,000 B gzip check:budget
Fonts, total and preloaded (B-5a/b) 313,576 / 330,000 B and 166,704 / 175,000 B raw check:budget
Farm runtime (B-7) 94,476 B / 95,000 B gzip check:budget
Lab LCP, / and /atlas (median of 7) 616 ms and 608 ms against an 850 ms ceiling Phase 12 handoff §9c
Unit tests 82 / 82 npm test, 2026-12-05
End-to-end tests 67 / 67 on the fixture corpus (one perf flake under parallel load passed on an isolated re-run) CONTENT_MODEL.md §8
Accessibility axe: 0 WCAG 2.1 AA violations on the tested routes AgentValley reviews/final-acceptance.md

The lab profile is 412×823 at 2×, with 4× CPU throttling and a 150 ms, 1.6 Mbps link (ADR 0020). The GitHub Actions workflows have never run, because the repositories have no remote yet. The only CI evidence is npm run ci passing locally.

Lessons learned

  • Show that a gate can fail. Phase 12 broke the budget script on purpose in three ways. One of them, a missed dynamic import, made a budget pass forever while reporting more headroom. Only a positive check that the import is actually reachable caught it.
  • Byte ceilings are not correctness checks. When the wrong font file was shipped under the right name, every byte budget passed, because the wrong file was smaller. A structural check on the font’s axes and character coverage failed it.
  • Escalate trade-offs instead of absorbing them. The font ruling and the farm’s budget line both left a record of who chose what.
  • Isolate parallel agents. Separate worktrees turned the Phase 11 incident into a rule rather than a one-off fix.
  • Withdraw wrong claims on the record. The re-derived Web Vitals profile exists because an implementer proved a ratified claim false and stopped at the limit of their authority.