Plate № 09 · Portfolio scaffolding

A pattern from the gf.cx specimen book

gfcx_subdomain_new · scaffold

Source · Dan, 2026-05-27

"Don't hand-roll a new gf.cx subdomain. The wrappers encode prior friction — every new subdomain starts from the latest learnings, not a blank slate."

The problem

Each new <name>.gf.cx subdomain shares the same first hour of setup work: Pages project create, custom-domain binding, fonts, primitives (cards.css, media.css), declarative landing, 404 page, wrangler.toml, _redirects, deploy command, the dashboard URL for the custom-domain pane. Hand-rolling each one rediscovers the same friction every time — and forgets the small things (Workers-with-Assets run_worker_first, Rocket Loader data-cfasync, BASE_URL constant) the previous one taught.

The shape

One script — ~/bin/gfcx_subdomain_new.py — encodes the current state of "what a fresh gf.cx subdomain looks like." Run it with a name; it generates the repo, the Pages project, the deploy command line, and prints the dashboard URL where the custom-domain CNAME needs to bind. Every new subdomain starts from the latest learnings, not a blank slate.

The discipline

Each new subdomain that surfaces a friction (a missing field, a forgotten CF setting, a default that was wrong) feeds back into the scaffold itself before the next subdomain spins up. This is what makes the scaffold compound: the third subdomain inherits the second's edge cases, the tenth inherits all nine.

What the scaffold bakes in today (v0.3.0)

A fresh subdomain is no longer just a landing page — the generator stamps the full belts-and-braces baseline, so a new surface ships finished, not minimal. A surface missing any of these is under-finished:

The principle

Don't hand-roll a new gf.cx subdomain. The wrappers encode prior friction.

The same principle applies to the wider ~/bin/ portfolio: wrangler-deploy > raw npx wrangler, verify-cf-token > raw curl, gfcx_status_hub_render > hand-templated dashboard. Reach for the wrapper first — it has already paid the cost of every gotcha you haven't hit yet.

What the scaffold emits

~/bin/gfcx_subdomain_new.py <name>

# Outputs:
#   ~/Code/<name>.gf.cx/          — local repo with all template files
#   wrangler.toml                  — workers-with-assets, run_worker_first=true
#   _redirects                     — trailing-slash + legacy redirect rules
#   functions/ip.ts|cf.ts|trace.ts — diagnostic probes out of the box
#   .github/workflows/deploy.yml   — git-push → Pages auto-deploy
#   site.config.json               — baseline audit manifest
#   post_deploy.sh                 — og:image capture on deploy
#
# Prints: Pages dashboard URL, custom-domain CNAME instruction

Reusable elements

Reference

Source
Dan, 2026-05-27 · xlab-co/toolkit · ~/bin/gfcx_subdomain_new.py. Compounded through v0.1.0 → v0.3.0 as new surfaces surfaced new friction.
In use / example
srvc.gf.cx — scaffolded by this generator; ships the full baseline (favicon, made-with, social card, probe endpoints, CF Access). Copy its wrangler.toml as a starting template; swap the project name and custom domain.
Reusable elements
gfcx_subdomain_new.py · five-layer surface baseline · site.config.json manifest · diagnostic probe functions · post-deploy og:image hook (listed above).
Origin
Compounding-kb throughline: "Bolt-on per-surface = friction, drift, and surfaces that never get the treatment. Scaffold-injected = the floor rises every time a new surface ships." — Dan, 2026-06-04.