Skip to content

link-in-bio-foundation — Handoff

URL: https://mkdocs.justinsforge.com/memory/handoffs/link-in-bio-foundation-2026-07-08/

Date: 2026-07-08 Owner: whichever agent/session picks this up next Parent session: this one (planning + Phase 1 Tasks 1-2, partial 3-4)


The Goal

Build the full creator/affiliate stack for JustinWieb and Gus the Bass (replacing Beacons/Linktree with owned infra). The master plan covers 11 layers (bio page, storefront, brand websites, click tracking, affiliate networks, analytics, email, CRM, community, course/paywall, payments) — see the plan doc, which is the source of truth for scope and phasing:

memory/plans/affiliate-click-foundation-2026-07-08.md ← read this in full before doing anything. It has the master stack table, the access-control rule (Michael only ever touches CreatorTrack apps; the brand websites are hand-built by Claude/Justin and NOT Michael-accessible), and Phase 1's 13 fully-decomposed tasks plus an 8-phase roadmap.

Right now we're mid-Phase-1: standing up the always-on Cloudflare edge (Pages + Workers + D1 + KV) that survives a home-internet outage, so gusthebass.com/links click tracking and email capture never depend on Console being up. CreatorTrack (home) is only the editor + reporting + Mautic sync layer, added in Tasks 7-11.

Current State

Done and committed (branch feat/codex-chat-surface in /home/justinwieb/forge, NOT main — that's just where the session happened to be, not a deliberate choice, worth noticing): - ecc2e0b — Listmonk fully scrubbed from Forge (unrelated cleanup, done earlier this session) - 4a6a9f1 — creator-stack tool briefing + the master plan doc - c1a8861Task 1 done: Cloudflare KV namespace links-map (eaca8ca562c3454885f2c7e3327a4f14) and D1 database links-events (4da9b1d3-99c3-47fd-8ce3-33413372bdc4) provisioned and recorded in infra/links-edge/README.md

Task 2 done, NOT yet committed: Worker project scaffolded at /home/justinwieb/forge/infra/links-edge/wrangler.toml (KV+D1 bindings, production routes commented out pending Task 5 domain cutover), package.json, tsconfig.json, .gitignore, schema.sql. Verified: npx wrangler deploy --dry-run compiles clean (4.44 KiB), both bindings resolve.

Task 3-4 code written, NOT yet verified or committed: src/index.ts (router), src/redirect.ts (/r/<id> — KV lookup, fail-open async click log to D1, 302), src/capture.ts (/c — email validation, per-IP rate limit via KV, D1 insert), src/cors.ts, src/ulid.ts. Schema applied to both remote and local D1 (wrangler d1 execute links-events --remote/--local --file schema.sql --yes, both succeeded). A local KV test key was just seeded (testseed{"destUrl":"https://example.com/rod","brand":"gus","label":"Rod"}) when the session was interrupted — the actual /r and /c HTTP verification (Task 3/4's verification commands in the plan) has NOT run yet.

Not started: Task 5 (deploy Worker + production routes — needs Justin confirmation before touching the live gusthebass.com domain), Task 6 (Pages project), Tasks 7-13 (all CreatorTrack-side: DB schema, the "Link In Bio" app itself, editor, publish pipeline, sync cron, e2e smoke test, register/document).

A git worktree dev slot is already up for the CreatorTrack side of this work (not yet used): feat/link-in-bio at /home/justinwieb/forge-suite-wt/feat/link-in-bio/, DB ct_feat_link_in_bio, preview port 3068 (no dev server running — bootstrap ran with --no-server). Recreate with bash scripts/forge_creatortrack_agent_bootstrap.sh feat/link-in-bio 3068 if the dev-slot reaper has cleaned it up by the time you read this (idle 45m / cap 4 — check first, see reference_creatortrack_dev_slot_reaper.md).

Files You'll Work With

File Purpose
memory/plans/affiliate-click-foundation-2026-07-08.md Read first. Master plan, all 13 Phase-1 tasks with exact files + verification commands, 8-phase roadmap
infra/links-edge/wrangler.toml Worker config: KV/D1 bindings, commented-out prod routes
infra/links-edge/src/{index,redirect,capture,cors,ulid}.ts The Worker source (written, unverified)
infra/links-edge/schema.sql D1 schema (clicks, captures tables), already applied remote+local
infra/links-edge/README.md Resource ids (KV/D1), auth notes, route plan
~/.forge-secrets/cloudflare.env CLOUDFLARE_API_TOKEN — has Workers/KV/D1/Pages edit scope, but is missing Account Settings: Memberships Read, so wrangler *list* subcommands fail with auth error 10000. Use the REST API directly (or wrangler create/deploy/execute commands, which work fine) to verify resources exist — don't trust a list failure as "nothing exists."
/home/justinwieb/forge-suite-wt/feat/link-in-bio/ CreatorTrack worktree dev slot for Tasks 7-13 (Next.js app, app/(suite)/link-in-bio/ route to be created)
/home/justinwieb/forge-suite/lib/apps.ts App catalog — Task 8 adds {id:"link-in-bio", name:"Link In Bio", route:"/link-in-bio"} here
/home/justinwieb/forge-suite/db/schema.ts + db/migrations/ Task 7 adds the links.* Postgres schema (pages, blocks, contacts, clicks mirror, captures mirror)

Likely Approach

  1. Finish Task 3/4 verification (where this session left off): run npx wrangler dev --local detached (background, don't let it hold the shell — see feedback_no_threads_with_subprocess_run.md and the backgrounded_daemon_holds_caller_pipe gotcha for why detachment matters), then hit GET localhost:8787/r/testseed (expect 302 to https://example.com/rod) and POST localhost:8787/c with a valid/invalid email (expect 200/400). Use Python's urllib or the sandboxed HTTP tool, not curl (blocked in this environment).
  2. Commit Tasks 2-4 together once verified (they were built as one unit): feat(links-edge): /r redirect + /c capture workers, verified locally.
  3. Task 5: before touching the live domain, confirm with Justin exactly which routes go live (gusthebass.com/r/*, /c) — the plan flags this [JUSTIN] because it changes production DNS/routing behavior on a domain currently serving a live static site. Don't deploy routes without that check-in.
  4. Task 6: Pages project gus-links, placeholder page, custom domain mapping for /links — same domain-touching caution as Task 5.
  5. Tasks 7-13: switch into the feat/link-in-bio CreatorTrack worktree, follow the plan's file list exactly (it already names every path). Use frontend-design skill for the editor UI (Task 9).
  6. Read memory/general/reference_creatortrack_dev_testing.md before touching the CT dev server (dev-auth gotchas) and reference_creatortrack_worktree_dev_turbopack_symlink.md (worktree dev needs next dev --webpack, already correctly used by the bootstrap script).

Don't Do

  • Don't deploy Task 5/6 production routes without Justin's explicit go — they touch a live revenue-adjacent domain (gusthebass.com) mid-flight.
  • Don't use Dub, PostHog, Affilimate, or any Phase 2+ tool yet — Phase 1 is deliberately just the owned /r + /c + Pages foundation. Those are separate future plans per the roadmap section.
  • Don't build the CreatorTrack "Link In Bio" UI as a generic "Links" app — it's user-facing named Link In Bio specifically (Justin corrected this once already); the Postgres schema namespace stays links.* internally, only the display name/route changed to link-in-bio.
  • Don't give Michael any access to the brand websites (gusthebass.com/justinwieb.com full sites) — those are Claude/Justin-built only, per the access-control rule in the plan. Michael only ever gets CreatorTrack apps (Link In Bio, Storefront), scoped to the Gus workspace.
  • Don't trust a wrangler ... list failure as "the resource doesn't exist" — this token's scope makes list fail while create/deploy/execute all work. Verify via REST API or by the create/execute commands themselves.
  • Don't work directly on forge-suite main for the CT-side tasks — use the feat/link-in-bio worktree slot.
  • Don't add Listmonk back, anywhere — it was deliberately and fully removed earlier this session (see reference_forge_mail_mautic.md). Email = Mautic + Resend, no exceptions.

Deliverables

  1. Verified, committed /r + /c Workers (Tasks 2-4 closed out).
  2. Justin's go-ahead + live Worker deploy + Pages project (Tasks 5-6).
  3. CreatorTrack links.* Postgres schema + the Link In Bio app (editor, publish pipeline) (Tasks 7-10).
  4. D1→CT sync cron with Mautic fan-out (Task 11).
  5. End-to-end smoke test proving the outage-resilience property: kill the sync timer, confirm /r+/c still work on the edge, restart, confirm catch-up (Task 12).
  6. Registered + documented: MEMORY.md index entry, reference_links_module.md topic file, eval harness green (Task 13).

Done When

  • gusthebass.com/links is live on Cloudflare Pages, editable by Michael (Gus-scoped) through the CreatorTrack "Link In Bio" app.
  • A real tap on an affiliate card logs to D1 and lands in CreatorTrack's links.clicks within one sync cycle.
  • A real email capture lands in Mautic's Gus segment and in links.contacts, within one sync cycle.
  • Killing home internet does NOT take down the live page or break click/capture logging (only pauses the CT-side sync, which catches up on reconnect).
  • Phase 1 is fully committed, task-by-task, each with its own commit per the plan's sizing rules.
  • The plan doc's Phase 1 section is marked done and the roadmap phases (2-8) remain for future /feature-plan rounds.