Skip to content

Worker brief: Link In Bio Phase 2, Storefront module

You are an unattended Opus build worker. Justin has authorized this buildout; work autonomously. Hard limits: - NEVER merge to main. NEVER deploy to prod. NEVER run migrations against the prod DB (lifeos). NEVER commit secrets (~/.forge-secrets/*.env). - Doctrine: robust over quick (no band-aids, no --no-verify), fail loud (no catch-and-ignore), idempotent by default, test the path before claiming done. No em dashes. snake_case [source]_[entity]_[state]. Flat verbose filenames. - Commit OFTEN. The CreatorTrack dev-slot reaper deletes idle (45m) / over-cap worktrees and eats uncommitted work.

Setup (first): 1. cd /home/justinwieb/creatortrack 2. scripts/forge_creatortrack_agent_bootstrap.sh links-storefront 3062 (worktree on branch links-storefront + own dev DB clone). Add --no-server if you do not need the dev server yet. 3. Worktree dev-server: run next dev --webpack (turbopack symlink bug, forge/memory/general/reference_creatortrack_worktree_dev_turbopack_symlink.md); watch stale .next-dev types. 4. Dev auth: WORKSPACE_DEV_AUTH=1; NEVER fresh-login over http.

Read before planning: - /home/justinwieb/creatortrack/AGENTS.md (BEGIN:link-in-bio-module, ~lines 116-140) - forge/memory/general/reference_links_module.md - forge/memory/plans/affiliate-click-foundation-2026-07-08.md (Phase 2 = your scope) - CT app: app/(suite)/link-in-bio/*, components/apps/link-in-bio/*, lib/links-store.ts, lib/links/{render,cf,brands,bio-css}.ts, app/api/links/{route,publish/route}.ts - Schema: db/schema.ts (links pgSchema) - Edge worker: forge/infra/links-edge/src/{index,redirect,page}.ts, wrangler.toml, schema.sql - Publish pipeline: lib/links/render.ts (blocks -> HTML, affiliate hrefs -> /r/<linkId>), lib/links/cf.ts (KV upsert, gated on LINKS_PUBLISH_LIVE=1)

Current state: the /r click-redirect + KV/D1 pattern is live and reusable. Block kinds today: header/link/affiliate-card/email-capture/text. There is no storefront/catalog surface yet.

Scope (Phase 2, Storefront module): 1. links.products Postgres table: workspace-scoped + RLS (match links.* pattern). Columns at least: id, workspace_id, brand, title, image_url, price_cents, currency, dest_url (affiliate URL carrying the tag), external_asin (nullable), position, created_at. Michael-editable, Gus-scoped by per-app permission. 2. A storefront surface: prefer a new block kind storefront-section (grid of products) reusing the existing block/editor machinery, OR a light second app if cleaner. Amazon-style catalog grid (image + title + price). Products render as tracked /r/<linkId> links reusing deriveLinkId so tracking + KV/D1 logging come for free. 3. Publish path: extend lib/links/render.ts + cf.ts so a storefront page publishes to the edge at gusthebass.com/shop (host-scoped KV page key page:<host>:<slug>). Add the /shop route to forge/infra/links-edge/wrangler.toml and worker routing. Keep publish idempotent (same product blockId -> same linkId -> KV overwrite). 4. PA-API enrichment (image/title/price auto-fill): build the scaffold that reads Amazon keys from ~/.forge-secrets/ and stub it so manual product entry works fully NOW; the enrich call is a no-op until Justin supplies PA-API keys. Fail loud, never silent.

Process: 1. Read all references. 2. Run /feature-plan; write spec + task list to forge/memory/plans/links-storefront-2026-07-11.md. Then implement (Justin authorized it); keep the plan as contract. 3. Implement task by task, commit each boundary (feat(links): ...). Migrations to your dev clone ONLY. 4. Verify end-to-end: add a product via the editor/API, publish, curl the rendered /shop page and a /r/<linkId> to confirm the tracked redirect. Script the check; do not hand-drive. 5. Write forge/memory/handoffs/links-storefront-status-2026-07-11.md: built / tested / EXACT Justin-only unblock (Amazon PA-API keys for enrichment; note if any CF route add needs Justin) / branch name. Leave committed on links-storefront. Do NOT merge, deploy, or touch prod. Note: the edge worker deploy (wrangler deploy) is Justin's to run; prepare the config + a clear deploy note, do not deploy prod routes yourself. 6. /notify low "links-storefront worker" "Phase 2 storefront build done, see handoff" when finished.

Execute now.