Better with Kent · draft

AI Agents Rewrote My Entire Website

One prompt · 483 files · production migration

orchestrator
subagents
review loop

Better with Kent

Durable skills for people who ship software

Today: the system behind a production-scale agent rewrite — not a magic prompt.

Cold open

PR #813 — the migration

bc-b429de5c · Fable orchestrator

  • One orchestrator prompt · six platform swaps
  • 483 files · ~235 commits · full kentcdodds.com
  • Real users · real data · production stakes

Six migrations in one

  • Fly → Cloudflare Workers
  • SQLite/LiteFS → D1 + read replication
  • Prisma → @remix-run/data-table
  • Cloudinary → R2 + Images
  • Mailgun → Cloudflare email
  • OG images → Satori
  • Constraint: total feature parity

The hard part

MDX without server eval

CI compiles MDX ES modules in R2/KV Worker Loader isolates

227/227 posts render-parity verified · content updates without redeploy

Architecture

Parent vs dynamic worker

flowchart LR
  req["Request"] --> parent["Parent worker"]
  parent -->|"cache HIT"| kv["KV HTML"]
  parent -->|"MISS / BYPASS"| dyn["Dynamic worker SSR"]
  dyn --> kvfill["fills page cache"]

Wrong: "every HTML render hits the dynamic worker." Right: parent often serves cached HTML.
Verified by bc-2069f545.

Kickoff

Prompt the system

bc-b429de5c · ~4,200 characters · one message to start

  • Goals + constraints + feature parity
  • Quality bar and exit criteria in the prompt

Five parts of the prompt

Goals Orchestrator Kody CI loop Exit

Composer 2.5 subagents for cost + speed

The closer

One prompt — then hands off

"This is the only prompt you're going to receive from me. This job is yours now."

Orchestration in action

bc-b429de5c · Composer 2.5 subagent swarms

  • 12 Composer 2.5 agents — parity, perf, errors
  • 5 audit + 3 cleanup subagents — cruft sweep
  • Agent shipped site tour + hydration screenshots unprompted

Honest story

Steering ≠ abdication

50 messages to bc-b429de5c over 5 days

  • Hard cutover — no parallel-run cruft
  • "Cloudinary completely out" — said four times

Three-layer review

CI bots Review agents Fix via Kody

Each layer catches a different class of bug · bc-25581046 + bc-019f3cac

Hard to reverse

What review caught

bc-25581046 · Vega · bc-019f3cac · Fable

  • /blog page-cache privacy leak
  • Unauthenticated OG signing → SSRF
  • Image masters one cancellation from gone

Kody closes the loop

  • Scoped CF token · DNS inspection · deploys
  • 300MB image archive to R2 from inside a worker
  • Review agents → working agent — no human relay

The twist setup

Perf scare

bc-8a489834 · Fly vs CF staging benchmarks

60–80ms Fly warm
1.2-2.2s CF cache-miss

"I should definitely not switch."

Verify the verifier

bc-50a80bfd · meta-analysis from Cloudflare's edge

  • Meta-agent: hot Fly vs cold staging — unfair benchmark
  • Warm cache HITs: 18–29ms — beat Fly
  • Real regression: cache-miss dynamic only

2026-07-08

Shipped

  • PR #813 merged · DNS flipped · live on Workers
  • Fly SQLite → D1 · sessions intact
  • Steady state: anonymous traffic → warm KV cache

Post-cutover cleanup

bc-c349545a · teardown playbook via Kody · #824

  • Archive migration tooling · rate-limit rules
  • Destroy Fly / cancel Cloudinary — asks first

Second wave

Cleanup audit

bc-5d897a4d · PR #844 merged

  • 6 Grok subagents — parallel repo audit
  • DELETE / STRIP / KEEP / ISSUE-ONLY report
  • Dead deps, env vars, stale docs — mostly lockfile churn

Third wave

Mock consolidation

bc-392ffc37 · PR #845 merged · closes #818

  • One canonical outbound mock per service
  • MSW bridges to workerd handlers — no fixture drift
  • Net −983 lines of duplicated mock code

Verify the number

Why net +17k?

bc-b128be5a · line-count audit agent

  • ~10k justified — D1 ORM, OG/media stack, page cache, MDX pipeline
  • ~4k tests + docs — the good kind of growth
  • ~3k duplication slack — mocks fixed in #845; bootstrap next

Good direction · still room to improve.

The full picture

Four PRs · one orchestration

Lines changed 40,329

excludes package-lock.json

Net +16,029

migration in · cleanup catching up

bc-b128be5a: most growth is real; cleanup continues.

Your turn

Try orchestration

Pick one real task. Write goals and constraints, assign the orchestrator role, and fan out subagents for the grunt work. You steer taste — not every step.

Frontier model plans · cheaper subagents execute · you review the system

Better with Kent

Prompt the system — verify the verifier

Subscribe · comment · get better with me