Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

forge, i18n, docs, npm updates

miniaturization53bb9c0478bb
diff --git a/.i18nrc.json b/.i18nrc.json
index 81c18c5f2..118b0ab0d 100644
--- a/.i18nrc.json
+++ b/.i18nrc.json
@@ -18,11 +18,10 @@
"ru": "Русский"
},
"rtlLocales": ["ar", "he", "fa", "ur"],
- "provider": "gemini",
- "modelName": "gemini-2.5-flash",
+ "provider": "groq",
"temperature": 0.2,
"topP": 0.9,
- "concurrency": 4,
+ "concurrency": 2,
"splitToken": 1200,
"saveImmediately": true,
"reference": "three.ws is a platform to build, animate, rig, and monetize 3D AI agents on-chain. The audience is crypto-native developers and creators. Keep copy punchy and product-grade — match the energy of Vercel, Linear, and Stripe marketing. Prefer the natural, idiomatic phrasing a native speaker in that market would use over a literal word-for-word rendering. Preserve the marketing voice; do not pad or soften.",
diff --git a/api/_lib/forge-consumption-payment.js b/api/_lib/forge-consumption-payment.js
new file mode 100644
index 000000000..2dca498c2
--- /dev/null
+++ b/api/_lib/forge-consumption-payment.js
@@ -0,0 +1,170 @@
+// Pay-per-use proof for Forge consumption actions other than High — the home for
+// any priced, holder-gated Forge deliverable a non-holder may pay $THREE for once
+// instead of holding (Game-Ready export today; future consumption actions next).
+//
+// It generalizes the proven, single-purpose forge-high-payment.js: same two-phase
+// claim, same security model, but action-parameterized so one rail serves every
+// new consumption action. forge.high keeps its own dedicated module + table
+// (already shipped and tested) — this is the additive home for the rest, so adding
+// a new paid Forge action never means touching the High path.
+//
+// A non-holder pays through the existing token rail (api/_lib/token: quote →
+// settle), which records a settled `consumption` row in token_payments bound to
+// ref_type:'forge' and the client nonce as ref_id. The client then retries the
+// action with { payment_id, ref_id }, and this module is the server's authority on
+// whether that proof satisfies the holder gate.
+//
+// Two-phase, so an action that fails before it is dispatched never costs the user
+// their payment:
+// • assertForgePurchase() — read-only validation at the gate: the payment is a
+// settled `consumption` for the action, ref-bound, correctly priced, recent,
+// and not already redeemed. Satisfies the gate; consumes nothing.
+// • redeemForgePurchase() — the atomic single-use claim, taken immediately
+// before the worker dispatch. The PRIMARY KEY on payment_id makes it
+// race-safe: exactly one caller can claim a given payment, across all actions.
+// • releaseForgePurchase() — undo the claim when dispatch fails, so the settled
+// payment is reusable on retry. Never called after a successful dispatch.
+//
+// Single-use is global per payment (the payment_id PRIMARY KEY), so a payment can
+// only ever fund one job, regardless of action. Cross-action redemption is blocked
+// at assert time by the price check: a $0.10 Game-Ready payment can't satisfy a
+// $0.50 High gate and vice versa.
+//
+// Security model: Forge has no login, so authorization rests on the (payment_id,
+// ref_id) pair. payment_id is a server-minted UUID returned only to the settling
+// client; ref_id is the client nonce recorded on the payment at quote time. An
+// attacker would need both, and each pair buys exactly one dispatch.
+
+import { sql } from './db.js';
+import { priceForAction } from './pricing/catalog.js';
+
+// How long after settlement a payment may be redeemed. Generous — a paid action is
+// normally redeemed seconds after settling, but a failed dispatch (released claim)
+// may be retried later, and a holder may pay, get distracted, and come back. A
+// settled payment older than this is treated as stale rather than letting an
+// indefinitely-old proof unlock a dispatch.
+const REDEMPTION_WINDOW_MS = 24 * 60 * 60 * 1000;
+
+// The ref_type the client tags the quote with for every Forge consumption action,
+// and the purpose every consumption payment carries. Both are matched exactly so a
+// payment for some unrelated action (voice clone, MCP-3D) can never be redeemed
+// here, and the per-action price (below) keeps the Forge actions apart.
+const FORGE_REF_TYPE = 'forge';
+const CONSUMPTION_PURPOSE = 'consumption';
+
+function payErr(message, status, code, extra = {}) {
+ return Object.assign(new Error(message), { status, code, ...extra });
+}
+
+// Direct lookup of one settled payment by id — lighter than listPayments (which
+// pulls in the on-chain settle/verify module) and all this path needs. numeric
+// columns come back as strings from the driver; callers coerce what they compare.
+async function lookupPayment(paymentId) {
+ const [row] = await sql`
+ select id, purpose, usd, ref_type, ref_id, confirmed_at, created_at
+ from token_payments
+ where id = ${paymentId}
+ limit 1
+ `;
+ return row || null;
+}
+
+async function isRedeemed(paymentId) {
+ const [row] = await sql`
+ select payment_id from forge_consumption_redemptions where payment_id = ${paymentId} limit 1
+ `;
+ return Boolean(row);
+}
+
+/**
+ * Validate that a settled $THREE payment proves entitlement to one dispatch of the
+ * given Forge consumption action. Read-only: satisfies the gate without consuming
+ * the payment.
+ *
+ * @param {object} params
+ * @param {string} params.action a catalog action id (e.g. 'forge.gameready')
+ * @param {string} params.paymentId token_payments.id returned by settle
+ * @param {string} params.refId the client nonce the payment was bound to
+ * @param {string} [params.refType] the ref_type the quote was tagged with ('forge')
+ * @param {number} [params.discountBps] holder fee discount (bps) when a tier pass
+ * also rides along, so the expected price
+ * matches what the client was quoted
+ * @returns {Promise<{ ok: true, payment: { id, usd, settledAt } }>}
+ * @throws 402 payment_invalid | 402 payment_expired | 409 payment_already_used | 400 bad_request
+ */
+export async function assertForgePurchase({ action, paymentId, refId, refType = FORGE_REF_TYPE, discountBps = 0 }) {
+ if (!action) throw payErr('action is required', 400, 'bad_request');
+ if (!paymentId || !refId) {
+ throw payErr('payment_id and ref_id are required', 400, 'bad_request');
+ }
+
+ const payment = await lookupPayment(paymentId);
+ if (!payment) {
+ throw payErr('No settled $THREE payment found for this request.', 402, 'payment_invalid');
+ }
+ if (payment.purpose !== CONSUMPTION_PURPOSE || payment.ref_type !== refType) {
+ throw payErr('This payment is not a Forge payment.', 402, 'payment_invalid');
+ }
+ if (payment.ref_id !== refId) {
+ throw payErr('This payment does not match this request.', 402, 'payment_invalid');
+ }
+
+ // Price must equal the catalog price for the action (holder discount applied when
+ // a pass rides along), so an underpaid `consumption` quote — or a payment for a
+ // differently-priced Forge action — can't be redeemed here.
+ const expectedUsd = Number(priceForAction(action, { discountBps }).usd);
+ const paidUsd = Number(payment.usd);
+ if (!(Math.abs(paidUsd - expectedUsd) < 0.005)) {
+ throw payErr(
+ `This payment ($${paidUsd.toFixed(2)}) does not cover this action ($${expectedUsd.toFixed(2)}).`,
+ 402,
+ 'payment_invalid',
+ );
+ }
+
+ const settledAt = payment.confirmed_at || payment.created_at;
+ const ageMs = Date.now() - new Date(settledAt).getTime();
+ if (!(ageMs >= 0) || ageMs > REDEMPTION_WINDOW_MS) {
+ throw payErr('This payment has expired — pay again to continue.', 402, 'payment_expired');
+ }
+
+ if (await isRedeemed(paymentId)) {
+ throw payErr('This payment has already been used.', 409, 'payment_already_used');
+ }
+
+ return { ok: true, payment: { id: payment.id, usd: paidUsd, settledAt } };
+}
+
+/**
+ * Atomically claim a validated payment for one dispatch. Race-safe via the
+ * payment_id PRIMARY KEY: a concurrent claim of the same payment inserts nothing
+ * and returns { redeemed: false }. Call immediately before dispatch.
+ *
+ * @param {object} params
+ * @param {string} params.action the catalog action this payment funds (audit)
+ * @param {string} params.paymentId
+ * @param {string} params.refId
+ * @param {string} [params.jobId] job/creation handle, when known
+ * @param {string|Date} [params.settledAt]
+ * @returns {Promise<{ redeemed: boolean }>}
+ */
+export async function redeemForgePurchase({ action, paymentId, refId, jobId = null, settledAt = null }) {
+ const rows = await sql`
+ insert into forge_consumption_redemptions (payment_id, action, ref_id, job_id, settled_at)
+ values (${paymentId}, ${action}, ${refId}, ${jobId}, ${settledAt})
+ on conflict (payment_id) do nothing
+ returning payment_id
+ `;
+ return { redeemed: rows.length > 0 };
+}
+
+/**
+ * Release a claim so the settled payment is reusable on retry. Called only when a
+ * dispatch fails before any deliverable is produced — never after a successful
+ * dispatch, so a delivered result can never be claimed twice.
+ * @param {object} params
+ * @param {string} params.paymentId
+ */
+export async function releaseForgePurchase({ paymentId }) {
+ await sql`delete from forge_consumption_redemptions where payment_id = ${paymentId}`;
+}
diff --git a/api/_lib/forge-tiers.js b/api/_lib/forge-tiers.js
index 271b75038..784443e70 100644
--- a/api/_lib/forge-tiers.js
+++ b/api/_lib/forge-tiers.js
@@ -87,6 +87,16 @@ export function priceUsdcForTier(tier) {
return (priceAtomicsForTier(tier) / 1_000_000).toFixed(2);
}
+// USD price (string, e.g. "0.10") of a post-generation export option (Game-Ready),
+// derived from its atomic price in OUTPUTS so the pricing catalog reads it from
+// here rather than carrying a second copy. Throws for an unknown output id so a
+// typo can never silently price an export at $0.
+export function priceUsdcForOutput(outputId) {
+ const o = OUTPUTS[outputId];
+ if (!o) throw new Error(`unknown forge output: ${outputId}`);
+ return (o.priceUsdcAtomics / 1_000_000).toFixed(2);
+}
+
// Generation backends. `provider` selects the api/_providers/* client that
// talks to it. `byok` names the provider-key the caller must supply (false for
// platform-keyed backends). `requiresEnv` lists env vars that must be present
diff --git a/api/_lib/migrations/2026-06-21-forge-consumption-redemptions.sql b/api/_lib/migrations/2026-06-21-forge-consumption-redemptions.sql
new file mode 100644
index 000000000..686aa168f
--- /dev/null
+++ b/api/_lib/migrations/2026-06-21-forge-consumption-redemptions.sql
@@ -0,0 +1,55 @@
+-- Migration: forge_consumption_redemptions — single-use ledger for pay-per-use
+-- Forge consumption actions beyond High (Game-Ready export today; future actions
+-- next).
+-- Apply: node scripts/apply-migrations.mjs --apply --file 2026-06-21-forge-consumption-redemptions.sql
+-- Idempotent.
+--
+-- Token Utility — the consumption lever, generalized. A non-holder can pay $THREE
+-- per dispatch of a priced Forge action instead of holding (api/_lib/token quote →
+-- settle records the payment in token_payments). This table binds ONE settled
+-- `consumption` payment to ONE dispatch: the PRIMARY KEY on payment_id is the
+-- source of truth for "one payment = one dispatch", GLOBAL across actions — a
+-- second redemption of the same payment_id (for any action) violates it and is
+-- surfaced as payment_already_used. `action` records which catalog action the
+-- payment funded, for audit/reconciliation; it is NOT part of the uniqueness key.
+--
+-- forge.high keeps its own dedicated forge_high_redemptions ledger (already shipped
+-- and tested); this is the additive home for every other Forge consumption action,
+-- so monetizing a new one never touches the High path.
+--
+-- The row is written only when a dispatch is actually started. If it fails before
+-- dispatch (validation, rate limit, unconfigured worker) or the provider call
+-- itself throws, the claim is released (row deleted) so the settled payment stays
+-- reusable on retry — the user never loses a payment to a failure that produced no
+-- deliverable. Both timestamps are kept for audit/reconciliation.
+--
+-- No secrets are stored: payment_id references the public token_payments ledger.
+
+begin;
+
+create table if not exists forge_consumption_redemptions (
+ -- The settled consumption payment redeemed (one row per payment, ever, across
+ -- every action).
+ payment_id uuid primary key references token_payments(id) on delete cascade,
+ -- The catalog action this payment funded (e.g. 'forge.gameready'). Audit only —
+ -- single-use is enforced by the payment_id PRIMARY KEY, not by (payment_id, action).
+ action text not null,
+ -- The client nonce the payment was quoted/settled against (token_payments.ref_id).
+ -- Re-checked at redemption so possession of payment_id alone can't redeem.
+ ref_id text not null,
+ -- The job/creation the redemption funded (audit link; null for sync lanes that
+ -- complete inside the request before a handle exists).
+ job_id text,
+ -- When the underlying payment settled on-chain (copied from token_payments) and
+ -- when it was redeemed here — both kept so a redemption is fully reconcilable.
+ settled_at timestamptz,
+ redeemed_at timestamptz not null default now()
+);
+
+create index if not exists forge_consumption_redemptions_redeemed
+ on forge_consumption_redemptions (redeemed_at desc);
+
+create index if not exists forge_consumption_redemptions_action
+ on forge_consumption_redemptions (action);
+
+commit;
diff --git a/api/_lib/pricing/catalog.js b/api/_lib/pricing/catalog.js
index 980902c4a..27f2515fe 100644
--- a/api/_lib/pricing/catalog.js
+++ b/api/_lib/pricing/catalog.js
@@ -19,7 +19,7 @@
// This module is pure (no network, no DB, no env beyond forge-tiers' constants)
// so it is safe to import on the client for display and on the server for pricing.
-import { TIERS, priceUsdcForTier } from '../forge-tiers.js';
+import { TIERS, priceUsdcForTier, priceUsdcForOutput } from '../forge-tiers.js';
// ── Split-policy aliases ───────────────────────────────────────────────────────
// Names map 1:1 to SPLIT_POLICIES keys; aliased here so call sites read in
@@ -34,6 +34,10 @@ export const POLICY = Object.freeze({
// Prices come from forge-tiers.js so they're never duplicated.
const FORGE_STANDARD_USD = Number(priceUsdcForTier(TIERS.standard)); // 0.15
const FORGE_HIGH_USD = Number(priceUsdcForTier(TIERS.high)); // 0.50
+// Game-Ready export price, read from OUTPUTS.gameready (its source of truth) so
+// it isn't duplicated. The export drives the remesh worker (real GPU cost) to turn
+// any model into an engine-ready asset — a deliverable, billed per export.
+const FORGE_GAMEREADY_USD = Number(priceUsdcForOutput('gameready')); // 0.10
// ── The catalog ─────────────────────────────────────────────────────────────────
// id → { label, category, policy, usd }. `usd: null` ⇒ price set per-call.
@@ -51,6 +55,12 @@ export const CATALOG = Object.freeze({
policy: POLICY.CONSUMPTION,
usd: FORGE_HIGH_USD,
},
+ 'forge.gameready': {
+ label: 'Forge — Game-Ready export (Unity/Unreal)',
+ category: 'generation',
+ policy: POLICY.CONSUMPTION,
+ usd: FORGE_GAMEREADY_USD,
+ },
'mcp3d.text_to_3d': {
label: 'MCP-3D — text → 3D',
category: 'generation',
diff --git a/api/_lib/three-access.js b/api/_lib/three-access.js
index 15e291781..b7cd08fb9 100644
--- a/api/_lib/three-access.js
+++ b/api/_lib/three-access.js
@@ -40,8 +40,9 @@ function tierByLevel(level) {
// feature is hold-only. The price is attached by the caller from the
// pricing catalog so this module stays dependency-free.
//
-// Enforced today: only `forge.high` — the High-tier Forge gate in api/forge.js. The
-// rest are planned. As each gate ships, flip its `enforced` to true (and add a test);
+// Enforced today: `forge.high` (High-tier Forge gate in api/forge.js) and
+// `forge.gameready` (engine-ready export gate in api/forge-gameready.js). The rest
+// are planned. As each gate ships, flip its `enforced` to true (and add a test);
// nothing else changes — the access endpoint and /three pick it up automatically.
export const GATED_FEATURES = Object.freeze({
'forge.high': Object.freeze({
@@ -51,6 +52,13 @@ export const GATED_FEATURES = Object.freeze({
why: 'The High tier spends real GPU/vendor budget — holders fund it by holding, not draining.',
payPerUse: 'forge.high',
}),
+ 'forge.gameready': Object.freeze({
+ minLevel: 1,
+ enforced: true, // gated in api/forge-gameready.js — see tests/api/forge-gameready.test.js
+ label: 'Game-Ready export (Unity/Unreal retopo + PBR)',
+ why: 'Retopology + PBR re-bake runs the remesh GPU worker — holders fund it by holding, or pay per export.',
+ payPerUse: 'forge.gameready',
+ }),
'worlds.private': Object.freeze({
minLevel: 2,
enforced: false,
diff --git a/api/forge-gameready.js b/api/forge-gameready.js
index a1de93dce..2c71a8aa2 100644
--- a/api/forge-gameready.js
+++ b/api/forge-gameready.js
@@ -31,6 +31,15 @@ import { limits, clientIp } from './_lib/rate-limit.js';
import { assertPublicHttpsUrl, SsrfError } from './_lib/ssrf.js';
import { createRegenProvider } from './_providers/gcp.js';
import { putObject, publicUrl } from './_lib/r2.js';
+import { requireFeatureAccess } from './_lib/require-three.js';
+import {
+ assertForgePurchase,
+ redeemForgePurchase,
+ releaseForgePurchase,
+} from './_lib/forge-consumption-payment.js';
+import { priceForAction } from './_lib/pricing/catalog.js';
+
+const GAMEREADY_ACTION = 'forge.gameready';
// The composite job id is a base64url JSON envelope packing one upstream task per
// requested format, so it is far longer than a raw worker task id.
@@ -104,6 +113,40 @@ async function startJob(req, res) {
}
const body = await readJson(req, 4_000).catch(() => null);
+
+ // $THREE hold-or-pay gate (Token Utility — consumption lever). The engine-ready
+ // export runs the remesh GPU worker (retopology + PBR re-bake), so it's a holder
+ // perk with a per-use pay path — the same model as the High-tier Forge gate. This
+ // runs BEFORE any network-touching validation so a non-holder's 402 is hermetic
+ // (no DNS, no worker call). A verified holder (tier pass or on-chain tier) passes;
+ // a non-holder presents a settled $THREE payment instead. The payment is validated
+ // here (read-only) and claimed atomically just before dispatch (paidExport below).
+ let paidExport = null;
+ const paymentId = typeof body?.payment_id === 'string' ? body.payment_id.trim() : '';
+ const payRefId = typeof body?.ref_id === 'string' ? body.ref_id.trim() : '';
+ if (paymentId && payRefId) {
+ try {
+ const proof = await assertForgePurchase({ action: GAMEREADY_ACTION, paymentId, refId: payRefId });
+ paidExport = { paymentId, refId: payRefId, settledAt: proof.payment.settledAt };
+ } catch (err) {
+ let usd = null;
+ try {
+ usd = Number(priceForAction(GAMEREADY_ACTION).usd) || null;
+ } catch {
+ usd = null;
+ }
+ return json(res, err.status || 402, {
+ error: err.code || 'payment_invalid',
+ feature: GAMEREADY_ACTION,
+ pay_per_use: usd ? { action: GAMEREADY_ACTION, usd } : null,
+ message: err.message || 'That $THREE payment could not be verified.',
+ });
+ }
+ } else {
+ const gate = await requireFeatureAccess(req, res, GAMEREADY_ACTION, { body });
+ if (!gate.ok) return; // 402 three_hold_required already sent
+ }
+
const rawMeshUrl = typeof body?.mesh_url === 'string' ? body.mesh_url.trim() : '';
// Resolve + validate the host our side (rejects private/loopback/metadata IPs)
// before handing the URL to the worker — SSRF defense in depth.
@@ -141,6 +184,25 @@ async function startJob(req, res) {
return unconfigured(res);
}
+ // Claim the settled $THREE payment now — immediately before dispatch — so any
+ // failure above (validation, unconfigured worker) left it reusable. The atomic
+ // claim (payment_id PRIMARY KEY) is the single-use source of truth: a concurrent
+ // retry of the same payment loses the race and is told it was already used.
+ if (paidExport) {
+ const claim = await redeemForgePurchase({
+ action: GAMEREADY_ACTION,
+ paymentId: paidExport.paymentId,
+ refId: paidExport.refId,
+ settledAt: paidExport.settledAt,
+ });
+ if (!claim.redeemed) {
+ return json(res, 409, {
+ error: 'payment_already_used',
+ message: 'That payment was already used for an export. Pay again to export.',
+ });
+ }
+ }
+
const sub = {};
let maxEta = 0;
try {
@@ -161,6 +223,11 @@ async function startJob(req, res) {
maxEta = Math.max(maxEta, Number(job.eta) || 0);
}
} catch (err) {
+ // Dispatch failed before any artifact was produced — release the claim so the
+ // paid user can retry without paying again.
+ if (paidExport) {
+ await releaseForgePurchase({ paymentId: paidExport.paymentId }).catch(() => {});
+ }
return json(res, 502, {
error: 'gameready_failed',
message: err?.message || 'Game-Ready export could not start.',
diff --git a/docs/i18n.md b/docs/i18n.md
index 8e05426f5..9c4bc6a85 100644
--- a/docs/i18n.md
+++ b/docs/i18n.md
@@ -53,18 +53,36 @@ npm run i18n # extract + translate
Configuration lives in [`.i18nrc.json`](../.i18nrc.json) (schema:
[`scripts/i18n-rc.schema.json`](../scripts/i18n-rc.schema.json)). Backend is
-selected by `provider`:
-
-| provider | env var | notes |
-| ------------------ | -------------------------------------- | ----------------------------------------------------------------- |
-| `gemini` (default) | `GEMINI_API_KEY` or `GOOGLE_API_KEY` | Generative Language API; bills the GCP project that owns the key. |
-| `openai` | `OPENAI_API_KEY` (+ `OPENAI_BASE_URL`) | Any OpenAI-compatible endpoint. |
-| `anthropic` | `ANTHROPIC_API_KEY` | Claude Messages API. |
-
-> Running on GCP credits: keep `provider: "gemini"`. For Vertex AI (instead of
-> the Generative Language endpoint) point `OPENAI_BASE_URL` at a Vertex
-> OpenAI-compatible gateway and use `provider: "openai"`, or extend
-> `scripts/i18n-translate.mjs` with a Vertex backend.
+selected by `provider`. **The default is a free model — no card, no credits.**
+Env-var names match [`api/_lib/chat-models.js`](../api/_lib/chat-models.js), so a
+key that already powers `/chat` works here too. Set just one:
+
+| provider | free? | env var | get a key |
+| ---------------- | ------- | -------------------------------------- | ---------------------------------------------------------- |
+| `groq` (default) | ✅ free | `GROQ_API_KEY` | <https://console.groq.com/keys> — Llama 3.3 70B, fast |
+| `gemini` | ✅ free | `GEMINI_API_KEY` / `GOOGLE_API_KEY` | <https://aistudio.google.com/apikey> — free tier, best CJK |
+| `openrouter` | ✅ free | `OPENROUTER_API_KEY` | <https://openrouter.ai/keys> — use a `:free` model |
+| `nvidia` | ✅ free | `NVIDIA_API_KEY` | <https://build.nvidia.com> — free NIM credits |
+| `openai` | paid | `OPENAI_API_KEY` (+ `OPENAI_BASE_URL`) | any OpenAI-compatible endpoint |
+| `anthropic` | paid | `ANTHROPIC_API_KEY` | Claude Messages API |
+
+```bash
+export GROQ_API_KEY=... # free; the default provider
+npm run i18n:translate # done
+```
+
+Leave `modelName` unset to use the provider's default model, or pin one (e.g.
+`"modelName": "meta-llama/llama-3.3-70b-instruct:free"` for OpenRouter). Free
+tiers rate-limit, so `concurrency` defaults to `2` and the translator backs off
+and retries on HTTP 429 (honoring `Retry-After`).
+
+> **Quality note:** Llama 3.3 70B (Groq) is solid for Latin-script languages. For
+> CJK/Arabic/Hindi, the **Gemini free tier** (`provider: "gemini"`) is noticeably
+> better and still free — switch per run with no code change. Whatever you pick,
+> `npm run i18n:lint` catches any model that drops a placeholder or glossary term.
+>
+> Have GCP credits and want Vertex AI? Point `OPENAI_BASE_URL` at a Vertex
+> OpenAI-compatible gateway with `provider: "openai"`.
### Glossary lock (the important part)
diff --git a/docs/tutorials/animate-your-avatar.md b/docs/tutorials/animate-your-avatar.md
new file mode 100644
index 000000000..a01deb237
--- /dev/null
+++ b/docs/tutorials/animate-your-avatar.md
@@ -0,0 +1,213 @@
+# Animate your avatar
+
+By the end of this tutorial you'll be able to take any rigged avatar, browse the three.ws clip library, apply a motion to it live, control its speed and looping, and export an animated GLB you can use anywhere. You'll also understand *why* a clip authored for one skeleton plays correctly on yours — the runtime retargeting that makes the library universal.
+
+**Prerequisites:** a three.ws account and at least one rigged avatar ([create one](/create), or load any public avatar). No code required — everything here happens in the browser. Light JavaScript familiarity helps only for the optional "how retargeting works" section.
+
+---
+
+## What you're building
+
+```
+Pick an avatar ──► Browse the clip library ──► Click a clip
+ │
+ retarget onto your rig + play live
+ │
+ tune speed / loop ──► export animated GLB
+```
+
+You don't author motion from scratch (you can — that's the keyframe timeline, a separate workflow). Here you *apply* and *remix* the shared library: dozens of pre-baked clips — idle, walk, dances, gestures, reactions — that drive **any** humanoid rig without manual bone mapping.
+
+Two surfaces do this, and they're connected:
+
+| Surface | Route | What it's for |
+|---|---|---|
+| **Animation Studio** | [/pose](/pose) | Load an avatar, apply or generate motion, tune it, export an animated GLB |
+| **Animation Gallery** | [/animations](/animations) | Browse public community clips, preview on a live avatar, send any to the Studio |
+
+The Gallery is where you *discover* a clip; the Studio is where you *apply* it. Every Gallery card's **Open in Studio** button deep-links to `/pose?anim=<id>`, so the two are one workflow.
+
+---
+
+## How clips drive any rig (two minutes of theory)
+
+The thing that makes the library work is that **motion and body are stored separately**.
+
+- An avatar is a **GLB** — geometry, skeleton, skin, textures.
+- A motion is a **clip JSON** — keyframe tracks only, no geometry. One clip can play on every avatar.
+
+A clip's tracks are named against a **canonical skeleton** — a 53-bone humanoid set (`Hips → Spine → Spine1 → Spine2 → Neck → Head`, both arms `Shoulder → Arm → ForeArm → Hand` with finger chains, both legs `UpLeg → Leg → Foot → ToeBase`). Every clip in [public/animations/clips](../../public/animations/clips) is baked against the reference rig `public/avatars/cz.glb`.
+
+Your avatar almost certainly names its bones differently — `mixamorig:Hips`, `DEF-spine`, `J_Bip_C_Hips`, `pelvis`, `leftUpperArm`. Two runtime modules bridge that gap:
+
+1. **Bone-name canonicalization** ([src/glb-canonicalize.js](../../src/glb-canonicalize.js)) recognizes the common skeleton conventions — Mixamo (`mixamorig:`), Blender (`Armature_`, `.L`/`.R`), Rigify (`DEF-`/`ORG-`), Unreal (`upperarm_l`), VRM/VRoid (`J_Bip_L_UpperArm`), VRM 1.0 (`leftUpperArm`), Daz/Genesis (`lShldr`), MakeHuman, and simple rigs (`shoulderL`) — and maps each bone to its canonical name.
+
+2. **Retargeting** ([src/animation-retarget.js](../../src/animation-retarget.js)) rewrites each track onto your rig's actual bone names, applies a per-bone bind-pose correction (so an A-pose clip plays right on a T-pose rig, and a hip baked at −90°X doesn't tip the body over), and rescales hip translation by your avatar's height so root motion lands where it should.
+
+**There is no rig allowlist.** Any humanoid avatar drives the library through this canonicalize-then-retarget path. The only gates are sanity thresholds: a rig needs **≥8** recognizable humanoid bones, and a clip must map **≥50%** of its tracks onto the rig to land. Below that the motion would read as a few twitching joints, so the Studio refuses it with an actionable message instead of playing garbage. If you hit a brand-new skeleton convention the canonicalizer doesn't know, the fix is to add its bone-name mapping to `glb-canonicalize.js` — never to hardcode a curated list of supported rigs.
+
+---
+
+## Step 1: Open the Studio and load an avatar
+
+Open **[/pose](/pose)**. You'll land on the built-in **mannequin** — a primitive figure for FK/IK posing. The mannequin has no skinned skeleton to export, so the preset library stays locked until you load a real avatar.
+
+In the top bar, click **Load avatar** and pick one of your rigged avatars (or a public one). The right-panel **Animation** section unlocks the moment a compatible rig is loaded.
+
+If you'd rather skip the picker, deep-link directly:
+
+```
+/pose?avatar=<your-avatar-id>
+```
+
+The Studio reads `?avatar=` on boot and loads it for you. Add `&anim=<clip-id>` and it also opens that saved clip — this is exactly what the Gallery's **Open in Studio** button does.
+
+If the right panel shows **"Load a rigged avatar to animate"**, you're still on the mannequin — load an avatar. If it shows **"This rig can't be retargeted,"** the model exposes fewer than 8 recognizable humanoid bones (see Troubleshooting).
+
+---
+
+## Step 2: Browse the clip library
+
+With an avatar loaded, the **Animation** section on the right fills with a searchable, categorized gallery:
+
+- **Category chips** across the top (Featured plus grouped categories) filter the grid.
+- **Search** ("Search animations…") matches clip labels and names as you type.
+- Each **card** shows an icon, a label, and a **loop** / **once** badge so you know up front whether a clip cycles forever or plays a single shot.
+
+The library covers a wide range — idle breaths, walks, dances, celebrations, reactions, sitting and crouching poses, and more. Browse by category, or search for what you want (e.g. `dance`, `wave`, `idle`).
+
+> Want to browse the *full* community catalog first? Open the **[Animation Gallery](/animations)** in another tab. It lists public clips with hover-to-preview on a live avatar, a loop/one-shot filter, and infinite scroll. When you find one you like, click **Open in Studio** and it lands back here applied to your avatar.
+
+---
+
+## Step 3: Apply a clip
+
+Click any card. The Studio:
+
+1. Fetches that clip's JSON.
+2. Retargets it onto your loaded rig (rewrites bone names, corrects the bind pose, scales the hips).
+3. Plays it live on the figure in the viewport.
+
+The shared 3D stage **is** the preview — one figure performing the motion, the way Mixamo previews look, rather than a wall of video thumbnails. The active card gets a "now playing" equalizer animation and a highlighted border.
+
+The status line at the bottom of the stage confirms the retarget, e.g.:
+
+```
+Playing "Cheering" — 96% retargeted (51/53 bones matched).
+```
+
+That percentage is the coverage — how many of the clip's tracks found a home on your rig. A couple of dropped bones (often fingers a simpler rig lacks) is normal and fine. If coverage falls below 50%, the clip won't apply and the status explains why (see Troubleshooting).
+
+Clips marked **once** play a single shot and hold the final frame; **loop** clips cycle until you stop them or pick another.
+
+---
+
+## Step 4: Control playback — speed and loop
+
+Once a clip is playing, a **transport bar** appears under the gallery:
+
+- A pulsing **now-playing** indicator with the clip's name.
+- A **Speed** slider, `0.25×` to `2.5×`. Drag it to taste — `1.8×` turns a walk into something close to a jog; `0.5×` slows a gesture down for emphasis. The value updates live.
+- **⏹ Stop** ends the preview and hands the figure back to a clean rest pose.
+- **Export animated GLB** (covered next).
+
+Looping follows the clip's own `loop` flag (the **loop** / **once** badge). Speed is a live preview control *and* it's baked into the export — the GLB you download carries the tempo you previewed, not a default one.
+
+To swap clips, just click a different card — the new motion retargets and replaces the old one. To compare two dances, apply one, watch it, then click the other; the transport always reflects what's currently playing.
+
+---
+
+## Step 5: Generate a motion that doesn't exist yet
+
+The preset library is finite; your imagination isn't. At the top of the **Animation** section is a text-to-motion box:
+
+```
+Generate a motion — "waving confidently" [ ✨ Generate ]
+```
+
+Type a short description (e.g. `waving confidently`, `a slow bow`, `excited jumping`) and click **Generate**. The Studio submits a motion job, polls until the clip is ready (typically ~10–30s on a warm GPU; up to ~90s), then **retargets and plays it on your rig through the exact same path as a preset.** A generated motion behaves identically — same transport, speed slider, loop, and export. The status line counts the seconds while it works.
+
+If the deployment hasn't enabled text-to-animation, you'll get a clear "isn't enabled on this deployment yet" message rather than a hang. Either way, the preset library is always available.
+
+---
+
+## Step 6: Export an animated GLB
+
+When a clip looks right, click **Export animated GLB** in the transport bar.
+
+The Studio bakes the retargeted clip — at your chosen speed — onto your avatar's rig and downloads a single self-contained file:
+
+```
+<avatar-name>-<clip-name>.glb
+```
+
+This closes the loop: you started with a GLB (body) and a separate clip (motion), and you end with **one GLB that has the motion embedded.** It loads in any standard glTF viewer or in any three.ws surface, no retargeting required at play time.
+
+The figure is parked on the clip's first frame before export, so the file's rest pose is the animation's actual start — not wherever the live preview happened to pause.
+
+> The Studio can also export **clip JSON** (motion only, reusable on other rigs) and a **PNG screenshot** from the top bar, and — if you author your own motion on the keyframe timeline — save it to your account and list it. Those are adjacent workflows; this tutorial is the apply-and-remix path.
+
+---
+
+## Step 7: Discover and remix from the Gallery
+
+The **[Animation Gallery](/animations)** is the social, browse-first side of the same system. It lists public, community-authored clips:
+
+- **Search** and a **loop / one-shot** filter narrow the grid.
+- **Hover or click a card** to launch a live preview — an embedded viewer plays the clip on the reference CZ avatar, so you see real motion, not a static thumbnail.
+- **Open in Studio** deep-links to `/pose?anim=<id>`, dropping the clip into the Studio so you can apply it to *your* avatar, tune its speed, and export.
+
+This is the remix loop: find a motion someone else published, open it in the Studio, retarget it onto your own avatar, adjust it, export. Because every clip is format-light JSON addressed by canonical bone names, the same clip that previewed on the CZ avatar drives your custom rig with no extra work.
+
+---
+
+## Emotion and expression on the live agent
+
+Applying clips in the Studio is the **authoring** side. On a *running* agent, the same library drives emotion and gesture automatically through two complementary channels:
+
+**Gesture slots** ([src/runtime/animation-slots.js](../../src/runtime/animation-slots.js)) — a fixed emotional vocabulary the agent plays in conversation: `idle`, `wave`, `nod`, `shake`, `think`, `celebrate`, `concern`, `bow`, `point`, `shrug`, `dance`. Each slot resolves to a concrete library clip at runtime (e.g. `celebrate` → the `celebrate` clip, `think` → `pray`). An agent picks a slot when the moment calls for it; the clip retargets onto that agent's avatar exactly as in the Studio. You can override any slot per agent via `meta.edits.animations` — point `wave` at a different clip, or map a slot to a motion you authored yourself.
+
+**Facial expression** ([src/runtime/arkit52.js](../../src/runtime/arkit52.js)) — independent of the skeleton. If your avatar carries ARKit-52 blendshapes (most modern exports do — RPM, Avaturn, VRoid), the runtime resolves those morph targets and drives expression and lip-sync directly on the face. A skeletal clip plays the body; the blendshape layer plays the eyes, brows, and mouth on top.
+
+The division of labor: **clips move the body, blendshapes move the face, slots choose *which* body motion fits the emotion.** All three ride the same universal-rig foundation — name your bones (and your blendshapes) in a convention the resolvers know, and everything just works.
+
+---
+
+## Troubleshooting
+
+- **The Animation section says "Load a rigged avatar to animate."** You're on the built-in mannequin. The mannequin has no skinned skeleton to retarget or export — click **Load avatar** in the top bar (or open `/pose?avatar=<id>`).
+
+- **"This rig can't be retargeted — only N recognizable humanoid bones."** The model exposes fewer than 8 canonical bones. It's likely non-humanoid, a static prop, or a rig whose bone names the canonicalizer doesn't recognize. Re-export it as a standard humanoid (Mixamo, RPM, Avaturn, VRM all work), or auto-rig a rig-less mesh first.
+
+- **A clip won't apply: "can't retarget to this rig — only X/Y tracks mapped."** Coverage fell below 50%. The rig is missing too many of the clip's bones (often a stripped-down skeleton with no spine subdivisions or no fingers). Try a clip that uses fewer bones, or use a more complete humanoid rig. The fix for a recurring convention is to add its bone-name mapping in [src/glb-canonicalize.js](../../src/glb-canonicalize.js) — never a hardcoded allowlist.
+
+- **The motion plays but limbs look skewed or the body lies down.** This is the symptom the bind-pose correction exists to prevent, so it should be rare. It usually means the rig rests in an unusual pose the canonicalizer mapped but couldn't fully correct. Verify the avatar imports upright and T- or A-posed; re-export from the source tool if it doesn't.
+
+- **A few bones are "not on this rig" but it still plays.** Expected. The status note (`51/53 bones · 2 not on this rig`) just lists dropped tracks — usually fingers or toes a simpler rig lacks. As long as coverage is ≥50% the performance reads correctly.
+
+- **"Text-to-animation isn't enabled on this deployment yet."** The motion generator isn't configured on this instance. Use the preset library, which is always available.
+
+- **Generation times out.** The job exceeded the poll window. Try a shorter, simpler prompt.
+
+- **Export downloads nothing / fails.** Make sure a clip is actively playing (the transport bar is visible) before clicking **Export animated GLB** — export bakes the *currently previewing* clip onto the rig.
+
+---
+
+## Recap
+
+You learned the apply-and-remix workflow for motion on three.ws:
+
+- **The library is universal.** Motion is stored as canonical-skeleton clip JSON, separate from the avatar GLB. [glb-canonicalize.js](../../src/glb-canonicalize.js) maps any humanoid's bone names to canonical; [animation-retarget.js](../../src/animation-retarget.js) rewrites tracks, corrects the bind pose, and scales the hips so one clip drives every rig. No rig allowlist — only an 8-bone / 50%-coverage sanity gate.
+- **[/pose](/pose) is where you apply.** Load a rigged avatar, browse or search the categorized gallery, click to retarget and preview live, tune speed (0.25×–2.5×) and loop in the transport bar, and **export an animated GLB** with the motion baked in.
+- **[/animations](/animations) is where you discover.** Browse public community clips with live hover-preview, then **Open in Studio** to apply any of them to your own avatar.
+- **Generate what doesn't exist.** Text-to-motion synthesizes a brand-new clip and runs it through the identical retarget-and-apply path as a preset.
+- **On a live agent**, the same clips drive emotion through gesture **slots**, while **ARKit-52 blendshapes** drive facial expression independently — clips move the body, blendshapes move the face.
+
+**See also:**
+
+- [docs/animations.md](../animations.md) — the runtime animation registry, manifest, and agent slot reference.
+- [docs/3d-asset-pipeline.md](../3d-asset-pipeline.md) — how FBX, GLB, and clip JSON relate, and how clips are built and retargeted.
+- [docs/tutorials/swap-avatar-in-studio.md](swap-avatar-in-studio.md) — loading and switching avatars in the Studio.
+- [docs/tutorials/upload-custom-glb.md](upload-custom-glb.md) — getting a Mixamo or custom rig into three.ws as a clean, animatable GLB.
+
+Primary call to action: open **[/pose](/pose)**, load an avatar, and apply your first clip.
diff --git a/docs/tutorials/build-a-scene.md b/docs/tutorials/build-a-scene.md
new file mode 100644
index 000000000..5a5ba5ee6
--- /dev/null
+++ b/docs/tutorials/build-a-scene.md
@@ -0,0 +1,212 @@
+# Build a 3D scene in Scene Studio
+
+By the end of this tutorial you'll have composed a complete 3D scene in the browser — imported GLB models, arranged them with transform gizmos, edited their materials, lit the scene, and exported the whole thing as a single GLB you can drop anywhere. No install, no build step; everything runs client-side at [/scene](/scene).
+
+Along the way you'll learn how the editor's panels fit together, why the scene autosaves to your browser, and when to reach for the lighter [Scene Composer](/compose) instead.
+
+**Prerequisites:** a desktop browser (the editor is keyboard- and gizmo-driven). At least one GLB or glTF model to import — generate one for free from text at [/forge](/forge), or use any GLB file you already have. No account required.
+
+---
+
+## What you're building
+
+A scene is a collection of objects — meshes, lights, cameras — arranged in 3D space, with materials and a background, exported as one file:
+
+```
+Import GLB(s) → arrange with Move / Rotate / Scale → edit materials
+ ↓ ↓
+ add lights ───────────────► set background ───────► Export GLB → scene.glb
+```
+
+The result is a self-contained `scene.glb` (or `.gltf`) that carries every object, material, and embedded texture. You can re-import it later, hand it to another tool, or view it in AR.
+
+[Scene Studio](/scene) is a full editor — the vendored [mrdoob/three.js](https://github.com/mrdoob/three.js) editor (`r184`, MIT — see [src/scene-studio/vendor/README.md](src/scene-studio/vendor/README.md)) mounted under the three.ws nav. It is dark-locked: the editor chrome only ships a dark theme.
+
+---
+
+## How the editor is laid out (two minutes of orientation)
+
+[/scene](/scene) is a single full-screen workspace. Five regions do all the work:
+
+| Region | Where | What it's for |
+|---|---|---|
+| **Menubar** | top | File, Edit, Add, View, Help, Render — every command |
+| **Toolbar** | top-left, over the viewport | Move / Rotate / Scale gizmo modes |
+| **Viewport** | center | the live 3D scene; orbit, select, drag gizmos |
+| **Sidebar** | right | three tabs — **Scene**, **Project**, **Settings** |
+| **Animation** | bottom (resizable) | keyframe timeline for animated objects |
+
+The **Sidebar → Scene** tab is where you'll spend most of your time. It shows the **outliner** (the scene graph as a tree) at the top, and below it a **properties** area that changes depending on what's selected — Object, Geometry, and Material sub-panels for a mesh; light controls for a light.
+
+One thing to know up front: **the editor autosaves.** Every change (add, move, material edit, delete) is written to your browser's local storage about a second later, and restored when you return to [/scene](/scene). Your scene persists across reloads on the same browser — but it is *local*, not synced to an account. To keep a scene permanently or move it elsewhere, you **export** it (Step 7) or save the project JSON (`File → Save`).
+
+---
+
+## Step 1: Open Scene Studio
+
+Go to [/scene](/scene). You'll see an empty viewport with a default grid and lighting.
+
+If you arrived from another surface — for example clicking **Open in Scene Studio** after a [Forge](/forge) generation, or a hand-off from the [Animation Studio](/pose) — the model is already loaded into the scene and selected for you. In that case skip to Step 3.
+
+Orbit the empty scene to get oriented:
+
+- **Orbit** — left-drag in the viewport
+- **Pan** — right-drag
+- **Zoom** — scroll wheel
+
+---
+
+## Step 2: Import a GLB
+
+There are two ways to bring a model in, and they behave slightly differently.
+
+**Drag and drop (fastest):** drag a `.glb` or `.gltf` file from your file manager straight onto the viewport. The editor loads it, adds it to the scene, and lists it in the outliner. Dropping a folder works too — it imports every model inside.
+
+**File → Import:** open the **File** menu, click **Import**, and pick one or more files. This is the same path as drag-and-drop and supports the same formats.
+
+Scene Studio imports far more than GLB. The vendored loader (see [src/scene-studio/vendor/js/Loader.js](src/scene-studio/vendor/js/Loader.js)) accepts `glb`, `gltf`, `fbx`, `obj`, `dae` (Collada), `usdz`, `ply`, `stl`, `3mf`, `amf`, `drc`, `vox`, `wrl`, `svg`, and several more — but **GLB is the recommended format**: it bundles mesh, materials, and textures into one binary file, and it's what every other three.ws surface produces.
+
+> **Deep-link import.** You can also load a model by URL: `/scene?model=<glb_url>&name=<label>`. The editor fetches the GLB, adds it through the normal undo-able import path, then strips the query from the address bar so a reload doesn't import a duplicate. This is exactly how the **Open in Scene Studio** hand-off works. The URL must be `https://` or a same-origin path.
+
+After import, the model appears in the outliner. Click its row to select it — a transform gizmo snaps onto it in the viewport.
+
+---
+
+## Step 3: Arrange objects with the transform gizmo
+
+Select an object (click it in the viewport or its outliner row), then choose a transform mode. The three modes live in the Toolbar and on the keyboard:
+
+| Mode | Toolbar | Key |
+|---|---|---|
+| **Move** (translate) | the move icon | `W` |
+| **Rotate** | the rotate icon | `E` |
+| **Scale** | the scale icon | `R` |
+
+Drag the colored gizmo handles in the viewport to transform along an axis. Useful companions while you arrange:
+
+- **`F`** — focus the camera on the selected object (frames it in view).
+- **Snapping** — hold while dragging, or set a snap distance, to move in fixed increments.
+- **World / Local space** — the gizmo can operate in world axes or the object's own axes.
+
+For precision, type exact values instead of dragging: with the object selected, open **Sidebar → Scene** and use the **Object** sub-panel's **Position**, **Rotation**, and **Scale** number fields. Every edit here goes through the editor's command system, so it's fully undoable.
+
+**Multiple copies?** With an object selected, **Edit → Clone** (or the duplicate shortcut) makes an independent copy you can reposition. **Edit → Center** moves the object so its bounding box is centered on its own origin — handy when an imported model arrives off-center.
+
+Everything you do is undoable: **Edit → Undo** (`Ctrl+Z`) and **Edit → Redo** (`Ctrl+Shift+Z`). The full edit history is also browsable under **Sidebar → Settings → History**.
+
+---
+
+## Step 4: Organize the scene graph
+
+As the scene grows, keep the outliner tidy.
+
+- **Rename** — select an object and edit the **Name** field in the **Object** sub-panel. Clear names make a complex scene navigable.
+- **Group** — **Add → Group** creates an empty container. Drag objects onto the group's row in the outliner to nest them. Transforming the group moves everything inside it as a unit — ideal for, say, a table and everything on it.
+- **Delete** — select and press `Del`, or **Edit → Delete**.
+
+A well-organized outliner pays off at export time: groups and names survive into the exported GLB.
+
+---
+
+## Step 5: Edit materials
+
+Select a mesh, then open **Sidebar → Scene**. Below the Object and Geometry sub-panels is the **Material** sub-panel — this is the live material editor.
+
+The exact controls depend on the material type (imported GLB models typically use a physically-based `MeshStandardMaterial`). Common properties you can edit:
+
+- **Color** — the base color swatch. Click it to open a color picker.
+- **Roughness** and **Metalness** — the PBR sliders that define whether a surface looks matte or glossy, dielectric or metallic.
+- **Emissive** — a color the material gives off regardless of lighting (good for glowing elements).
+- **Maps** — texture slots (color/albedo, normal, roughness, metalness, emissive, and more). Click a map slot to assign an image.
+- **Opacity / Transparent** — make a material see-through.
+- **Side** — render the front, back, or both faces.
+
+Every change renders in the viewport immediately and is captured in undo history. If a primitive you added looks unlit and flat, it's usually because the scene has no light yet — that's the next step.
+
+> **Add primitives directly.** You don't have to import everything. **Add → Mesh** drops in a Box, Sphere, Plane, Cylinder, Torus, Capsule, Text, and more — each with a fresh editable material. Great for floors, platforms, and blockout geometry.
+
+---
+
+## Step 6: Light the scene
+
+A scene with no lights renders dark (unlit materials show flat color; PBR materials show nearly black). Add lights from the **Add → Light** submenu:
+
+| Light | Use it for |
+|---|---|
+| **Ambient** | a flat base fill so nothing is pure black |
+| **Directional** | a sun — parallel rays, casts a consistent shadow direction |
+| **Hemisphere** | sky/ground gradient fill, good for outdoor scenes |
+| **Point** | a bulb — radiates in all directions from a position |
+| **Spot** | a cone — a focused beam with an angle and falloff |
+
+Each light appears in the outliner like any other object. Select it to:
+
+- **Position** it with the Move gizmo (`W`) — point and spot lights have a position; directional and spot lights also have a target.
+- **Edit its properties** in the Sidebar: **Color** and **Intensity** for every light; **Distance**, **Angle**, and **Penumbra** for the lights that have them.
+
+A solid starting rig: one **Directional** light for key/shadow direction plus a low-intensity **Ambient** or **Hemisphere** light to lift the shadows. Adjust intensities until the scene reads the way you want.
+
+**Set the background and environment** while you're here. In **Sidebar → Scene**, the **Background** control switches between a solid **Color**, a **Texture**, or an **Equirectangular** HDR/image (which doubles as image-based lighting). You can also add **Fog** for depth. These settings export with the scene.
+
+---
+
+## Step 7: Export the scene
+
+When the scene looks right, open **File → Export** and choose a format. For a complete, portable scene, pick **GLB**:
+
+- **GLB** — exports the **entire scene** (all objects, materials, embedded textures, and any optimized animations) as one binary `scene.glb`. This is the recommended output.
+- **GLTF** — same content as GLB but as human-readable JSON (`scene.gltf`), with assets referenced/embedded per the glTF spec.
+
+The Export submenu also offers single-object/whole-scene formats for specific pipelines: **OBJ** and **DRC** (these export the *selected* object — select a mesh first), and **PLY**, **STL** (ASCII and binary variants), and **USDZ** for the whole scene. Reach for these only when a downstream tool requires them; for everything on three.ws, **GLB** is the right choice.
+
+The file downloads through your browser. That's your finished scene — re-import it anywhere, [view it in AR](/docs/tutorials/view-in-ar), or hand it to another agent.
+
+> **Save the editable project too.** Export bakes the scene into a delivery format. To keep working on it later with full editor state, use **File → Save**, which writes a `project.json` you can reopen with **File → Open**. The autosaved browser copy persists between visits, but `project.json` is your portable, backup-able source of truth.
+
+---
+
+## When to use Scene Composer instead
+
+[Scene Composer](/compose) is a distinct, lighter surface — not the full editor. Where Scene Studio is a general-purpose 3D editor, Composer is purpose-built for **forging items from text and dressing an avatar**:
+
+- **Forge from text, in place.** Describe an item ("a glowing katana with blue neon energy"), pick a type (accessory, item, scene, creature, vehicle), and it's generated and dropped straight into the scene — no separate trip to [/forge](/forge).
+- **Attach to avatar bones.** Load an avatar (paste a GLB URL or browse your avatars), then attach items to specific skeleton bones — a hat to the head, a sword to the hand. The item rides the bone.
+- **Familiar arranging.** The same `W` / `E` / `R` Move/Rotate/Scale gizmos, `F` to focus, `Del` to remove, undo/redo, and camera presets — with a streamlined inspector.
+- **Two outputs.** **Export GLB** downloads the composition, and **Save Outfit** persists the assembled set to your account.
+
+Rule of thumb: reach for **[/compose](/compose)** when you're generating items and equipping an avatar; reach for **[/scene](/scene)** when you need the full editor — many models, fine material control, primitives, multiple lights, and the broad set of import/export formats.
+
+---
+
+## Troubleshooting
+
+- **My scene is black / models look unlit.** The scene has no light. Add a light from **Add → Light** (start with Directional + a low Ambient). PBR materials render near-black without lighting.
+- **An imported model is huge, tiny, or far off-screen.** Models export at wildly different scales. Select it, press `F` to focus, then use **Scale** (`R`) or the Object sub-panel's Scale fields. If it's off-center, **Edit → Center**.
+- **The deep-link import failed.** `/scene?model=…` only accepts `https://` or same-origin URLs, and the host must allow the fetch (CORS). The editor will tell you to drag the GLB in instead — that path always works.
+- **I lost my scene after closing the tab.** The autosave is per-browser and per-origin: a different browser, profile, or private window won't have it. For anything you care about, **File → Save** the `project.json` or **File → Export** a GLB.
+- **The editor loaded in light mode / looks wrong.** Scene Studio is dark-locked; the chrome only ships a dark theme. If styling looks broken, hard-reload to clear a stale cache.
+- **OBJ / DRC export did nothing.** Those formats export the *selected* object, not the whole scene. Select a mesh first. For the full scene, use **GLB** or **GLTF**.
+- **Drag-and-drop won't import.** Drop onto the viewport, not the sidebar, and use a supported extension (`.glb`/`.gltf` recommended). For a stubborn file, try **File → Import**.
+
+---
+
+## Recap
+
+You composed and exported a complete 3D scene in the browser:
+
+- **Imported** GLBs by drag-and-drop, **File → Import**, or the `/scene?model=` deep link — GLB recommended, but many formats accepted.
+- **Arranged** objects with the Move / Rotate / Scale gizmos (`W` / `E` / `R`), `F` to focus, plus precise numeric transforms and **Clone** / **Center** — all undoable.
+- **Organized** the scene graph with names and **Add → Group**.
+- **Edited materials** (color, roughness, metalness, emissive, maps) in the live Material sub-panel, and added primitives via **Add → Mesh**.
+- **Lit the scene** with Directional / Ambient / Point / Spot / Hemisphere lights and set a Color / Texture / Equirectangular background.
+- **Exported** the whole scene as a self-contained **GLB** (and learned to **File → Save** the editable `project.json`).
+
+The leverage of [Scene Studio](/scene) is that it's a *real* editor producing a *portable* file: a single GLB that flows into AR, other tools, and the rest of three.ws. When your task is forging items and dressing an avatar instead, the lighter [Scene Composer](/compose) is the faster path.
+
+## See also
+
+- [Generate a 3D model from text](/docs/tutorials/text-to-3d) — make GLBs to import here.
+- [Image to 3D](/docs/tutorials/image-to-3d) — turn a photo into a model.
+- [Upload a custom GLB](/docs/tutorials/upload-custom-glb) — bring your own assets in.
+- [View in AR](/docs/tutorials/view-in-ar) — open your exported scene on a phone.
+- [Swap an avatar in the studio](/docs/tutorials/swap-avatar-in-studio) — work with avatars across the editors.
diff --git a/docs/tutorials/place-agent-irl.md b/docs/tutorials/place-agent-irl.md
new file mode 100644
index 000000000..b11d65b35
--- /dev/null
+++ b/docs/tutorials/place-agent-irl.md
@@ -0,0 +1,238 @@
+# Place a 3D agent in your real environment with IRL
+
+By the end of this tutorial you'll have walked one of your 3D agents around your living room — anchored to your real floor through the phone camera, steered with an on-screen joystick — and left it pinned at a real spot where anyone standing next to it can discover it. You'll do it all in the browser on your phone, with no app to install.
+
+Along the way you'll understand the difference between **viewing a model in AR** and **placing an agent in the world**, how proximity discovery works, and exactly what your camera, motion, and location sensors do and don't share.
+
+**Prerequisites:** a smartphone (iPhone with Safari, or an Android phone with Chrome). HTTPS is required for camera and motion access, so use the live site — open [three.ws/irl](/irl) on the phone itself. No account is needed to try it; signing in lets you place a permanent pin and switch between your own agents.
+
+---
+
+## What you're building
+
+```
+You, in your kitchen: open /irl → tap Camera AR → joystick-walk the agent across the floor
+ → aim the camera at the spot you want → tap Pin here
+ ↓
+Anyone who walks up to that spot later: opens /irl, points their camera, and finds your
+ agent standing exactly where you left it
+```
+
+IRL turns the real world into the stage. The camera feed becomes the floor, your phone's gyroscope keeps the agent locked in place as you turn, and a pin you drop is **private by location** — it's never on a map or a feed, only reachable by being physically near it.
+
+---
+
+## IRL is not the model viewer's AR (read this first)
+
+three.ws has two camera-AR experiences. They look similar through the lens but solve different problems — don't confuse them.
+
+| | [View in AR](/docs/tutorials/view-in-ar) | **IRL** (this tutorial) |
+|---|---|---|
+| Goal | See **one** 3D model at true scale in your room | **Walk and place** your agent in the world for others to find |
+| Entry | The **AR** tab on any avatar / Forge model | The [/irl](/irl) product page |
+| Movement | None — the model sits where you place it | Joystick / WASD walking, drag-to-orbit |
+| Persistence | Nothing is saved | A **pin** that lives at a real GPS spot |
+| Discovery | Private to you, this session only | Anyone standing nearby finds it in person |
+| Multiplayer | No | Anonymous nearby presence, ambient reactions |
+
+If you just want to orbit a single model in your kitchen, use [View in AR](/docs/tutorials/view-in-ar) — it covers iOS Quick Look, Android Scene Viewer, and WebXR for a one-off model. **This** tutorial is about the `/irl` product: a live, walkable agent you anchor and leave behind.
+
+---
+
+## How IRL works (two minutes of theory)
+
+IRL is a phone-camera experience built on three sensors, each rendered **on your device**:
+
+- **Camera** — `getUserMedia` with `facingMode: 'environment'` opens the rear camera and draws it full-screen behind a transparent Three.js canvas. That's the "passthrough": your real room shows through, the agent renders on top. Frames are never uploaded or stored.
+- **Motion & orientation** — your phone's gyroscope (`deviceorientation`) keeps the agent locked to its spot as you turn to look around. iOS 13+ asks for a one-time permission gesture for this.
+- **Location** — used only to drop a pin at the spot where you're standing and to find the handful of pins right around you. Your position is never shared with other users.
+
+A **pin** is the unit of placement: an agent anchored at a real coordinate. The platform never exposes a list, map, or directory of pins. The only read that returns someone else's agent is the per-viewer proximity feed (`GET /api/irl/pins`), which requires you to send your *own* location and clamps the search radius to between 10 and 60 metres server-side. You discover agents by walking up to them — never by browsing where they are.
+
+> WebGL is required to render the scene. On a browser without it, IRL shows a designed "this device can't run IRL AR" state and points you to [/agents](/agents) instead of throwing a blank canvas.
+
+---
+
+## Step 1: Open IRL on your phone
+
+On the phone, go to [three.ws/irl](/irl).
+
+You'll see your agent rendered against the ambient dark background, an **IRL** badge in the top bar, and a big white **Camera AR** button at the bottom. The subtitle reads *"Turn on Camera AR, then tap Pin here to anchor your agent in real space."* — that line is your always-visible signpost to the next step.
+
+To start with a specific agent's avatar, append `?avatar=` to the URL:
+
+```
+https://three.ws/irl?avatar=YOUR_AVATAR_ID
+```
+
+An explicit `?avatar=` link always wins over the avatar you used last visit. (Links from an agent profile's "View in IRL" button also pass `?agent=` to deep-focus that agent's pin once it's nearby.)
+
+---
+
+## Step 2: Turn on Camera AR
+
+Tap **Camera AR**.
+
+The browser asks for camera permission — **Allow** it. This only happens once per origin. The rear camera feed fills the screen, the badge dot turns green, and the button switches to its active green state. Your agent is now standing on your real floor.
+
+A few things are happening under the hood:
+
+- The page requests the **environment-facing** camera (`facingMode: { ideal: 'environment' }`), so you get the rear lens, not the selfie cam.
+- A single mutex owns the camera and render loop, so the passthrough and the 3D scene never fight over the GPU.
+- On iOS, the page also asks for **Motion & Orientation** access — grant it so the agent stays locked in place when you rotate the phone. If you deny a sensor, a one-tap recovery chip appears so you can re-request it without digging through Settings.
+
+If the camera doesn't start, jump to [Troubleshooting](#troubleshooting).
+
+---
+
+## Step 3: Walk the agent with the joystick (or WASD)
+
+Now move the agent around your real space.
+
+**On a phone**, a virtual joystick lives in the bottom-left corner. Drag it to walk; push further from center to move faster. Release to stop.
+
+**On desktop** (or any device with a keyboard), use:
+
+- `W` `A` `S` `D` or the arrow keys to move
+- `Shift` to run
+- Click-and-drag anywhere on the canvas to orbit the camera
+
+The keyboard hints are shown on the right edge of the desktop layout. Movement keys are ignored while you're typing in a caption or message field, or while a sheet is open, so walking never fights with text input.
+
+Walk the agent to the exact spot in your room where you want it to live — in front of your desk, by the door, on the rug. The camera passthrough is the floor; treat it like one.
+
+---
+
+## Step 4: Drop 3D objects on your floor (tap-to-place)
+
+You can decorate the space with simple 3D props before you pin.
+
+1. Tap **Add object** in the secondary row. The object picker slides up.
+2. Choose a shape — **Orb**, **Crate**, **Crystal**, **Ring**, or **Pillar**.
+3. Tap a spot on the floor through the camera. The object lands there at real-world scale, anchored to the surface you tapped.
+4. Add as many as you like. Tap **Clear** to remove them all.
+
+Tap-to-place uses a raycast from your tap into the scene, so objects sit where the floor is in view. These props are local scene dressing — they make the space feel inhabited while you compose the shot before pinning your agent.
+
+---
+
+## Step 5: Pin your agent in real space
+
+This is the step that makes IRL different from the model viewer: you leave the agent behind at a real location.
+
+1. Aim the camera so the agent is standing where you want it anchored.
+2. Tap **Pin here**.
+3. The caption panel slides up. Optionally add a short note — e.g. *"P2P trades here — DM me on Telegram."* Captions are optional.
+4. Tap **Pin it**.
+
+The agent locks to its spot. The status line confirms with something like *"Pinned facing north — others nearby can see you for 7 days."* While pinned, the joystick is hidden (a locked agent doesn't walk), and the gyroscope keeps it glued in place as you move your phone around it.
+
+There are a few placement paths depending on your device and intent:
+
+- **Pin here** — drops the agent at your current GPS spot using the camera + gyro. This is the default and works on every supported phone, including iOS Safari.
+- **Place on floor** — appears only when your browser supports a WebXR `immersive-ar` session (Chrome on Android with ARCore). It uses real hit-test surface detection: sweep your phone slowly to find the floor, and the agent anchors to the detected plane. A green check confirms the anchor took.
+- **Place on map** — pick a spot on a map instead of using your live position, useful for placing an agent somewhere you're not standing.
+
+### Signed-in vs anonymous pins
+
+- **Not signed in:** your pin works immediately and **expires on its own after 7 days**. The phone holds an anonymous device token (a bearer credential scoped to that device) so you can still manage your own anonymous pins.
+- **Signed in:** the pin is permanent until you remove it, and you can switch which of your agents is placed via **My Agents**. Manage and remove your pins from your dashboard or the **My pins** sheet.
+
+Either way, every pin you place is listed only to you — never in any public view.
+
+---
+
+## Step 6: Discover and interact with nearby agents
+
+When you're standing near a pinned agent (yours or someone else's), it appears in your camera view with a name label. The top bar shows a green **"N nearby"** badge as agents resolve around you, and a directional nudge arrow rides the screen edge pointing toward the nearest one until it's on-screen.
+
+Tap an agent's label or model to open its **inspect card**:
+
+- Its bio, on-chain reputation tier, and any paid services it offers
+- **Pay via x402** to use a service it sells
+- **Leave a message** that lands in the owner's IRL feed
+- **View profile** to open its full agent page
+- **Report this pin** if something's wrong — a pin is hidden once enough distinct people flag it
+
+If others are viewing the same area, you'll see an anonymous **"N viewing nearby"** presence chip. You can optionally opt in to **Appear nearby**, which shows you to co-viewers as a coarse ghost marker — never your precise GPS.
+
+---
+
+## Step 7: Understand location privacy (and the controls you hold)
+
+This is the part to get right before you place agents in places you care about. The full breakdown lives on the [IRL location privacy page](/irl-privacy); here's what matters for using the product.
+
+**The one-line model:** a placed agent appears to someone *only* when they're physically within a few dozen metres of it. There is no list, map, feed, or directory of where agents are — not for other users, and not public. Your own placements are visible only to you.
+
+**What others can see:**
+
+- An anonymous "someone is viewing nearby" count when you're in the same area
+- A coarse ghost marker — but only if you opt in, snapped to a rough area
+- An agent placed at a spot, once they're standing near it themselves
+- An ambient reaction when someone interacts with an agent you're both near
+
+**What no one can see:**
+
+- A list, map, or directory of where agents are placed
+- Your exact GPS coordinates — they stay on your device unless you place a pin
+- Who placed any agent — no account or device id is ever attached (the public read strips `user_id`/`device_token` and returns only an `is_mine` boolean)
+- Where you are when you're not within reach of an agent in person
+
+**The controls** (open **Location & privacy** from the top bar — the shield icon):
+
+- **Discovery precision — Precise or Approximate.** Approximate keeps your exact position off the servers while you browse; nearby agents resolve a little less precisely in exchange. Placement is always exactly where you choose.
+- **Appear to others nearby — off by default.** Turn it on to show as a coarse ghost to co-viewers.
+- **Your placements — remove anytime.** Every pin is in your dashboard, visible only to you. Anonymous pins also expire on their own after 7 days.
+
+The camera and motion sensors are processed entirely on-device — camera frames are drawn to your screen and never uploaded; gyroscope readings position the scene in real time and never leave the phone. Location is checked only against what's within a few dozen metres of you, never a wider window.
+
+---
+
+## Troubleshooting
+
+### "This device can't run IRL AR"
+
+IRL renders the scene with WebGL. If your browser lacks it, you'll see a designed unsupported-device state instead of a blank canvas. Reopen IRL in an up-to-date Chrome, Safari, or Edge.
+
+### The camera won't start
+
+- **Permission denied.** Camera AR needs the rear camera. Re-grant it from the one-tap recovery chip, or in the browser's site settings, then tap **Camera AR** again. IRL requires HTTPS — `getUserMedia` is blocked on insecure origins, so use the live `https://three.ws/irl` (not a plain `http://` dev server).
+- **Another tab or app holds the camera.** Close anything else using the camera and retry — only one consumer can hold it at a time.
+
+### The agent drifts or won't stay locked when I turn
+
+This is the motion sensor. On iOS, IRL needs a one-time **Motion & Orientation** permission granted via a tap — accept it when prompted, or re-request it from the recovery chip. Without the gyroscope, the agent can't stay anchored as you rotate the phone.
+
+### "Place on floor" button never appears
+
+That button is the WebXR hit-test path, available only where the browser supports an `immersive-ar` session (Chrome on Android with ARCore). iOS Safari has no `immersive-ar`, so it stays on the **Pin here** gyro + GPS path — which works fine; you just don't get plane hit-testing. Desktop never shows it (no camera passthrough).
+
+### Nobody's nearby / the radar is empty
+
+With a tight discovery radius and no map, an empty view is the *common* first experience — it means "keep exploring," not "broken." Walk around, or be the first to pin at your spot. If the nearby badge turns amber, the proximity read was temporarily rate-limited or unreachable; it self-heals on the next cycle.
+
+### My pin disappeared
+
+Anonymous pins (placed without signing in) expire after 7 days by design — the **My pins** sheet shows a live countdown so you know when. Sign in before pinning to make it permanent.
+
+---
+
+## Recap
+
+You placed a live 3D agent in your real environment with the [/irl](/irl) product:
+
+- **Camera AR** opens the rear camera as a full-screen passthrough; the agent renders on top of your real room.
+- **Joystick / WASD** walk the agent across the floor; drag to orbit.
+- **Add object** taps simple 3D props onto the detected floor.
+- **Pin here** anchors the agent at a real GPS spot — anonymous pins last 7 days, signed-in pins are permanent.
+- **Discovery is proximity-only:** agents are found by being physically near them, never via a map, list, or feed. Identity is stripped; your camera and motion stay on-device; location is used only for nearby proximity.
+
+This is fundamentally different from viewing a single model in AR. If you only need to orbit one 3D model in your room, that's [View in AR](/docs/tutorials/view-in-ar) instead.
+
+### See also
+
+- [IRL — open the product](/irl) — place your agent now
+- [How location works on IRL](/irl-privacy) — the full privacy model, sensor-by-sensor
+- [Tutorial: Place your 3D model in AR](/docs/tutorials/view-in-ar) — the single-model viewer (Quick Look / Scene Viewer / WebXR)
+- [AR & WebXR reference](/docs/ar) — the underlying AR methods and programmatic API
+- [Privacy policy](/legal/privacy) — how your data is handled platform-wide
diff --git a/docs/tutorials/walk-companion.md b/docs/tutorials/walk-companion.md
new file mode 100644
index 000000000..9f338c4de
--- /dev/null
+++ b/docs/tutorials/walk-companion.md
@@ -0,0 +1,345 @@
+# Add the Walk Companion to your site
+
+By the end of this tutorial you'll have a **3D avatar walking across your own website** — a corner mascot that idles, follows the cursor, and waves on navigation, plus a full-page playground the visitor can steer with WASD or a touch joystick. You'll add it two ways: a zero-build iframe you can paste onto any page, and the `@three-ws/walk` npm package when you want the real site-wide companion.
+
+Along the way you'll see what the [/walk](/walk) product offers — live demos across six environments, the one-tag embed, the Chrome extension that walks the whole web, and the distance leaderboard — and exactly which attributes and APIs are real.
+
+**Prerequisites:** a website you can edit and a WebGL-capable browser. The iframe path needs no tooling at all; the npm path assumes light JavaScript familiarity and that you already bundle [Three.js](https://threejs.org) (>= 0.150).
+
+---
+
+## What you're building
+
+Two surfaces, one engine:
+
+```
+Corner companion Full-page playground
+┌───────────────┐ ┌───────────────────────────┐
+│ your page │ click │ ▢ walk across the page │
+│ │ ────▶ │ WASD / joystick │
+│ 🤖 ◀ idles │ ▢ ▢ │
+│ follows cursor │ 🤖 strolling │
+└───────────────┘ └───────────────────────────┘
+```
+
+The companion mounts in a corner and stays out of the way: it idles, turns to follow the cursor, waves when the visitor navigates, and greets each page. Click it and it **detaches into a full-page playground** — the visitor steers across the page from a gentle aerial view, or platforms across your real DOM with gravity and jumps. Walk onto a link and it opens like a doorway into the next page.
+
+This is the same engine that powers the walking companion on three.ws, published as the `@three-ws/walk` package.
+
+---
+
+## The /walk product (two minutes)
+
+Before you embed it, it helps to know what the live [/walk](/walk) page exposes — every piece below is something you can link to or reuse:
+
+| Surface | Route | What it is |
+|---|---|---|
+| Walk app | [/walk/app](/walk/app) | Drive your avatar with WASD or a touch joystick across six environments |
+| Live demos | embedded on [/walk](/walk) | Real (not video) iframes for `beach`, `night`, `grid`, and more |
+| One-tag embed | [/walk-embed](/walk-embed) | The chrome-less iframe you drop on any site |
+| Chrome extension | [/extension](/extension) | Your avatar walks over every page you visit, reading them aloud |
+| Distance leaderboard | [/walk-leaderboard](/walk-leaderboard) | The longest strolls on three.ws — daily, weekly, all-time |
+
+The six built-in environments are fixed and need no HDRI downloads: `studio`, `void`, `beach`, `sunset`, `night`, `grid`. You select one with the `env` query param.
+
+---
+
+## Step 1: The one-tag embed (no build step)
+
+The fastest way to put a walking avatar on a page is the [/walk-embed](/walk-embed) iframe. It's intentionally chrome-less — no nav, no footer — so it drops cleanly into a card or a corner.
+
+```html
+<!-- three.ws Walk — drop in anywhere -->
+<iframe
+ src="https://three.ws/walk-embed?env=void&autoplay=true"
+ width="360" height="480"
+ style="border:0;background:transparent"
+ title="three.ws walking avatar"></iframe>
+```
+
+That's the exact snippet the [/walk](/walk) page hands out. The background is transparent, so the avatar floats over whatever your page already has behind it.
+
+### Embed query params
+
+The embed reads its world and controls from the URL. The verified params:
+
+| Param | Values | Effect |
+|---|---|---|
+| `env` | `studio` `void` `beach` `sunset` `night` `grid` | The environment (default scene if omitted) |
+| `autoplay` | `true` | Start animating immediately |
+| `controls` | `joystick` `keyboard` `none` | How (or whether) the visitor steers |
+| `orbit` | `true` `false` | Allow drag-to-orbit the camera |
+| `avatar` | a roster id or your avatar id | Which avatar walks |
+
+A live, drivable demo on a beach:
+
+```html
+<iframe
+ src="https://three.ws/walk-embed?env=beach&controls=joystick&autoplay=true"
+ width="100%" height="520"
+ style="border:0;background:transparent"
+ title="Walk on the beach"
+ allow="accelerometer; gyroscope"></iframe>
+```
+
+A passive showpiece (no controls, just walking) for a hero section:
+
+```html
+<iframe
+ src="https://three.ws/walk-embed?env=void&autoplay=true&controls=none&orbit=false"
+ width="360" height="480"
+ style="border:0;background:transparent"
+ title="three.ws walking avatar"></iframe>
+```
+
+The `allow="accelerometer; gyroscope"` attribute lets the joystick respond to device tilt on mobile. Add it whenever `controls=joystick`.
+
+---
+
+## Step 2: Drive the embed from the host page (postMessage)
+
+The embed isn't a black box — it speaks a versioned `postMessage` contract so your page can tell the avatar where to walk, what to say, and which environment to show. The contract is defined in [src/walk-embed-events.js](src/walk-embed-events.js) and documented interactively at [/docs/walk-embed-api](/docs/walk-embed-api).
+
+Every message is namespaced to the `three-walk` channel and carries a protocol version, so it never collides with other `message` listeners on your page.
+
+```html
+<iframe id="walk" src="https://three.ws/walk-embed?env=studio&autoplay=true"
+ width="360" height="480" style="border:0;background:transparent"
+ title="three.ws walking avatar"></iframe>
+
+<script>
+ const frame = document.getElementById('walk');
+ const send = (type, payload = {}) =>
+ frame.contentWindow.postMessage({ channel: 'three-walk', v: 1, type, ...payload }, '*');
+
+ // Wait for the avatar to load before commanding it.
+ window.addEventListener('message', (e) => {
+ if (e.source !== frame.contentWindow) return; // source check = auth
+ const msg = e.data;
+ if (!msg || msg.channel !== 'three-walk') return;
+
+ if (msg.type === 'walk:ready') {
+ send('walk:say', { text: 'Hi — thanks for visiting.' });
+ send('walk:goto', { x: 4, z: 0 }); // walk to a world spot
+ }
+ if (msg.type === 'walk:position') {
+ // { x, z, heading } streams ~10 Hz while the avatar moves
+ }
+ });
+</script>
+```
+
+The commands a host can send (inbound) and the events the iframe emits (outbound), straight from the contract:
+
+| Direction | Message | Payload |
+|---|---|---|
+| host → iframe | `walk:goto` | `{ x, z }` — walk to a world position, then stop |
+| host → iframe | `walk:gesture` | `{ gesture }` — one of `idle` `walk` `run` `wave` `jump` |
+| host → iframe | `walk:say` | `{ text, voice?, durationMs? }` |
+| host → iframe | `walk:env` | `{ env }` — one of the six environments |
+| host → iframe | `walk:avatar` | `{ avatarId }` |
+| host → iframe | `walk:config` | `{ speed?, bg?, controls? }` |
+| iframe → host | `walk:ready` | `{ avatarId, env }` (fires once, when loaded) |
+| iframe → host | `walk:position` | `{ x, z, heading }` (~10 Hz while moving) |
+| iframe → host | `walk:gesture` | `{ gesture }` |
+| iframe → host | `walk:speak` | `{ text, durationMs }` |
+| iframe → host | `walk:error` | `{ code, message }` |
+
+Two things the runtime enforces, so plan around them:
+
+- **The source check is the authentication.** The iframe only accepts messages whose source is its parent window; your host listener should likewise gate on `e.source === frame.contentWindow`. The optional origin allow-list is belt-and-suspenders on top of that.
+- **Inputs are clamped and bounded.** `walk:goto` coordinates are clamped to the world radius (about ±11.5m), `walk:say` text is capped at 280 characters, and unknown commands come back as a `walk:error` rather than silently failing.
+
+If you mount the iframe *after* it has already loaded and miss the initial `walk:ready`, send `walk:ping` and the iframe re-emits `walk:ready`.
+
+---
+
+## Step 3: The real site-wide companion (npm)
+
+The iframe is great for a fixed card. For the actual corner-mascot-plus-playground experience that follows the visitor across your whole site, install the SDK.
+
+```bash
+npm install @three-ws/walk three
+```
+
+`three` is a **peer dependency** — the package brings none of its own; you supply >= 0.150 from your app.
+
+```js
+import { createWalkCompanion } from '@three-ws/walk';
+
+const walk = createWalkCompanion();
+walk.bootstrap();
+```
+
+`createWalkCompanion` is **side-effect free on import** — nothing touches the DOM, and no Three.js is fetched, until you call `bootstrap()` or `enable()`. A page that never turns the companion on pays nothing for shipping the import.
+
+`bootstrap()` is the app-style entry: it auto-mounts based on the visitor's saved preference, honors `?walk=` deep links, and resumes the playground after a page "dive." If you'd rather drive it yourself:
+
+```js
+const walk = createWalkCompanion({ defaultAvatarId: 'fox' });
+
+walk.enable(); // mount the corner companion
+walk.openPicker(); // let the visitor choose an avatar
+walk.setAvatar('michelle'); // persist + hot-swap the live avatar
+walk.disable(); // remove it
+```
+
+The returned control object surface:
+
+```ts
+walk.isEnabled(): boolean
+walk.enable(): void
+walk.disable(): void
+walk.toggle(): void
+walk.setAvatar(idOrEntry): void // persist + hot-swap the live avatar
+walk.openPicker(): void
+walk.bootstrap(): void // auto-mount + ?walk= deep links
+walk.instance // the live companion (or null)
+```
+
+### URL controls
+
+Once `bootstrap()` is wired, these query params work on any page:
+
+- `?walk=1` — force the companion on
+- `?walk=0` — force it off
+- `?walk=play` — deep-link straight into the full-page playground
+- `?avatar=<id>` — load a specific avatar (a roster id, or one of your own)
+
+---
+
+## Step 4: Point the SDK at your assets
+
+The companion needs two sets of assets served from your origin (or a CDN you point at). The defaults match the three.ws layout; override them when yours differ.
+
+- The avatar GLBs the roster references (e.g. `/avatars/*.glb`).
+- The shared animation manifest + clips (`/animations/manifest.json` + clips), used to retarget motion onto rigs that ship no locomotion.
+
+```js
+createWalkCompanion({
+ assetBase: 'https://cdn.example.com', // prepended to static GLB paths
+ apiBase: '', // prepended to the /api/avatars/<id>/glb proxy
+ manifestUrl: '/animations/manifest.json',
+ docsUrl: '/avatar-studio', // "make your own" link in the picker footer
+}).bootstrap();
+```
+
+Other options worth knowing: `excludedRoutes` (path prefixes where the companion never mounts — full-screen 3D routes by default), `enablePicker` (set `false` to hide the avatar switcher), `greeting` (a `(path) => string | null` to customise the per-page hello), and `storagePrefix` (the localStorage/sessionStorage key namespace, default `walk`).
+
+---
+
+## Step 5: Choose who walks — the roster
+
+Every visitor can pick who walks with them from a built-in roster: a robot mascot, humanoids, a fox, dancers, and showpieces. Each entry declares a rig strategy so it **always moves** — nothing freezes in a bind/T-pose:
+
+| `rig` | Used for | How it animates |
+|---|---|---|
+| `embedded` | self-animated or non-humanoid GLBs (robot, fox) | plays the clips baked into the GLB; falls back to the first clip so it never freezes |
+| `shared` | humanoids with no locomotion (or only a T-pose) | retargets the shared clip library (`idle`/`walk`/`run`/`wave`/`jump`) onto the rig |
+
+The default avatar is `robot`. To extend the roster with your own brand mascot:
+
+```js
+import { createWalkCompanion, WALK_AVATARS } from '@three-ws/walk';
+
+createWalkCompanion({
+ avatars: [
+ ...WALK_AVATARS,
+ {
+ id: 'mascot',
+ name: 'Our Mascot',
+ category: 'Brand',
+ asset: '/brand/mascot.glb',
+ source: 'static',
+ rig: 'shared', // retarget the shared library onto it
+ accent: '#ff0066',
+ },
+ ],
+ defaultAvatarId: 'mascot',
+}).bootstrap();
+```
+
+User-generated avatars served by the GLB proxy (`/api/avatars/<id>/glb`) resolve at runtime via `makeApiAvatarEntry(id)` — you don't have to list them.
+
+---
+
+## Step 6: Walk the whole web — the Chrome extension
+
+The embed and SDK put the avatar on *your* site. The Chrome extension puts it on *every* site the visitor opens. Link to [/extension](/extension) from your page, or just point people there.
+
+What the extension does, per the product page:
+
+- The avatar walks over any page the user visits — articles, docs, social feeds.
+- It reads pages aloud as it strolls — a living browsing companion.
+- The visitor picks any of their three.ws avatars from the popup and switches in one click.
+- Minimal permissions, no tracking. Privacy details are on [/extension/privacy](/extension/privacy).
+
+This is the one path you don't embed — you point your visitors at the install. It's the most ambitious surface of the [/walk](/walk) product, and the strongest reason to give your users a three.ws avatar in the first place.
+
+---
+
+## Step 7: The distance leaderboard
+
+Every stroll logs distance, and the longest ones climb the global board at [/walk-leaderboard](/walk-leaderboard) — ranked daily, weekly, and all-time. The data is real, served from `/api/walk/leaderboard`, so you can surface a "top walkers" teaser on your own page:
+
+```js
+async function loadTopWalkers() {
+ const res = await fetch(
+ 'https://three.ws/api/walk/leaderboard?period=all-time&metric=distance',
+ { headers: { accept: 'application/json' } },
+ );
+ if (!res.ok) throw new Error(`HTTP ${res.status}`);
+ const data = await res.json();
+ // The endpoint may return { leaders } | { walkers } | { entries } | [...]
+ const rows = Array.isArray(data)
+ ? data
+ : data.leaders || data.walkers || data.entries || data.results || data.data || [];
+ return rows.slice(0, 3); // each: { name, distance, image_url?, url? }
+}
+```
+
+Format distances for display the way the live page does — meters under 1km, kilometres above:
+
+```js
+function formatDistance(meters) {
+ const m = Number(meters);
+ if (!Number.isFinite(m) || m <= 0) return '—';
+ if (m >= 1000) return (m / 1000).toFixed(m >= 10000 ? 0 : 1) + ' km';
+ return Math.round(m) + ' m';
+}
+```
+
+Always design the empty and error states: a fresh deployment has no walks logged yet, and a transient fetch failure should offer a retry rather than a blank panel.
+
+---
+
+## Troubleshooting
+
+- **Iframe is blank / "loading avatar…" never clears** — the host needs WebGL. Confirm the browser is WebGL-capable and the page isn't blocking the iframe with a restrictive `Content-Security-Policy` `frame-src`. The embed ships `frame-ancestors *`, so it's the host CSP that usually blocks it.
+- **postMessage commands do nothing** — you're probably sending before `walk:ready`. Wait for the `walk:ready` event, or send `walk:ping` to re-trigger it. Also confirm your envelope is `{ channel: 'three-walk', v: 1, type, ...payload }` — messages without the channel are ignored unless they use a known legacy `walk:*` type.
+- **`walk:goto` lands somewhere unexpected** — coordinates are clamped to the world radius (~±11.5m). A target outside the ground disc is pulled back in.
+- **`walk:env` rejected with a `walk:error`** — `env` must be exactly one of `studio` `void` `beach` `sunset` `night` `grid`. Anything else is refused.
+- **Avatar shows a frozen T-pose** — that means the rig strategy is wrong for the GLB. A humanoid that ships only a T-pose must use `rig: 'shared'` so the shared clip library is retargeted onto it; `embedded` is only for GLBs that carry their own clips.
+- **SDK throws on import about `three`** — `three` is a peer dependency. Install it (`npm install three`) and make sure your bundle resolves a single copy >= 0.150.
+- **Companion never appears after `bootstrap()`** — check it's not an excluded route. By default the corner mascot skips full-screen 3D paths (`/walk`, `/walk-embed`, `/play`, `/ar`, and similar). Override `excludedRoutes` if your paths overlap.
+- **The companion loaded Three.js on a page that doesn't use it** — it shouldn't: `createWalkCompanion` is side-effect-free on import and fetches nothing until `enable()`/`bootstrap()`. If you see a fetch, something is calling `enable()` unconditionally.
+
+---
+
+## Recap
+
+You added a walking 3D avatar to your site three ways and learned what the [/walk](/walk) product ships:
+
+- **One-tag embed** — paste the [/walk-embed](/walk-embed) iframe, pick the world and controls with query params (`env`, `controls`, `orbit`, `avatar`). No build step.
+- **postMessage contract** — drive the embed from the host page with `walk:goto` / `walk:say` / `walk:env` and listen for `walk:ready` / `walk:position`, on the versioned `three-walk` channel. Full reference at [/docs/walk-embed-api](/docs/walk-embed-api).
+- **`@three-ws/walk` SDK** — `createWalkCompanion().bootstrap()` mounts the real corner companion plus the full-page playground, side-effect-free until enabled, with a built-in avatar picker and a two-strategy roster that never T-poses.
+- **The product surfaces** — the [/extension](/extension) that walks the whole web, and the distance [/walk-leaderboard](/walk-leaderboard) you can read from `/api/walk/leaderboard`.
+
+The leverage is composability: the same engine renders the corner mascot, the full-page playground, the standalone embed, and the extension — so an avatar you build once walks everywhere.
+
+## See also
+
+- [Walk docs](/docs/walk) — the full developer + user reference for the walking-avatar system
+- [Walk embed API](/docs/walk-embed-api) — interactive playground for the postMessage contract
+- [Swap your avatar in Studio](/docs/tutorials/swap-avatar-in-studio) — build the avatar that walks
+- [Embed your agent on a website](/docs/tutorials/embed-on-website) — the other side of putting three.ws on your page
diff --git a/prompts/00-README.md b/prompts/00-README.md
new file mode 100644
index 000000000..a8c0a56dc
--- /dev/null
+++ b/prompts/00-README.md
@@ -0,0 +1,90 @@
+# three.ws — Road to Production / $1B
+
+A phased catalog of self-contained work prompts. Each numbered `.md` file is designed to be
+pasted into a **fresh chat** and executed end-to-end by a senior agent with no prior context.
+Run them roughly in order; many within a phase can run in parallel (separate chats), but
+**stage explicit paths only** since agents share one worktree.
+
+## How to use
+1. Open a new chat in this repo.
+2. Paste the full contents of one prompt file (`01`…`50`).
+3. Let the agent execute, verify, and report. Review the diff.
+4. Commit + push when satisfied (`git push threeD main && git push threews main`).
+5. Move to the next prompt.
+
+## Phases
+- **Phase 1 — Audit & baseline** (`01`–`05`): find every gap before fixing. Run first; they produce
+ the issue lists later phases consume.
+- **Phase 2 — Cross-cutting quality** (`06`–`14`): tests, errors, a11y, responsive, perf, SEO, design, security.
+- **Phase 3 — Product surfaces** (`15`–`26`): harden each surface end-to-end.
+- **Phase 4 — Payments / on-chain / agent economy** (`27`–`34`).
+- **Phase 5 — Infra & ops** (`35`–`41`).
+- **Phase 6 — Growth, GTM & launch** (`42`–`50`). `50` is the final go/no-go gate.
+
+## Recommended order
+Phase 1 first. Then Phase 2 in parallel with Phase 3. Phase 4–5 once core surfaces are stable.
+Phase 6 last, ending on `50-final-launch-checklist.md`.
+
+## Global operating rules (every prompt repeats these — non-negotiable)
+- Read `CLAUDE.md` and `STRUCTURE.md` first; CLAUDE.md overrides defaults.
+- **No mocks / fake data / placeholders / TODOs / stubs.** Real APIs and implementations only.
+- **$THREE is the only coin** (CA `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Never reference any other token, anywhere.
+- Concurrent agents share this worktree — stage explicit paths (never `git add -A`); re-check `git status`/`git diff --staged` before committing.
+- esbuild trap: never commit `api/*.js` starting with `__defProp`/`createRequire`; recover with `git restore -- api/ public/`.
+- Every user-visible change → `data/changelog.json` entry + `npm run build:pages`.
+- Push to BOTH remotes when asked; never pull/fetch/merge from `threeD`.
+- Definition of done = CLAUDE.md's checklist.
+
+## Index
+| # | Prompt | Phase |
+|---|---|---|
+| 01 | production-readiness-audit | 1 |
+| 02 | dead-paths-and-broken-links | 1 |
+| 03 | console-errors-warnings-sweep | 1 |
+| 04 | build-deploy-artifact-integrity | 1 |
+| 05 | routing-and-404-audit | 1 |
+| 06 | test-coverage-unit | 2 |
+| 07 | e2e-critical-flows | 2 |
+| 08 | error-handling-failsafes | 2 |
+| 09 | accessibility-audit | 2 |
+| 10 | responsive-mobile-audit | 2 |
+| 11 | performance-web-vitals | 2 |
+| 12 | seo-metadata | 2 |
+| 13 | design-system-consistency | 2 |
+| 14 | security-review | 2 |
+| 15 | forge-pipeline | 3 |
+| 16 | walk-sdk-companion-playground | 3 |
+| 17 | avatar-create-edit-rig | 3 |
+| 18 | agent-studio | 3 |
+| 19 | marketplace | 3 |
+| 20 | gallery-discovery | 3 |
+| 21 | social-club-city | 3 |
+| 22 | onboarding-wizard | 3 |
+| 23 | feature-tour | 3 |
+| 24 | scene-studio | 3 |
+| 25 | search | 3 |
+| 26 | dashboard | 3 |
+| 27 | x402-payments | 4 |
+| 28 | wallet-connect-funding | 4 |
+| 29 | pumpfun-launches | 4 |
+| 30 | three-holder-gating | 4 |
+| 31 | mcp-servers | 4 |
+| 32 | published-sdks-docs | 4 |
+| 33 | onchain-contracts | 4 |
+| 34 | solana-base-parity | 4 |
+| 35 | api-rate-limiting-abuse | 5 |
+| 36 | observability-logging-alerting | 5 |
+| 37 | ci-cd-gates | 5 |
+| 38 | database-migrations | 5 |
+| 39 | load-stress-testing | 5 |
+| 40 | caching-cdn-assets | 5 |
+| 41 | uptime-health-status | 5 |
+| 42 | homepage-conversion | 6 |
+| 43 | docs-completeness | 6 |
+| 44 | legal-compliance | 6 |
+| 45 | analytics-funnels | 6 |
+| 46 | notifications-email | 6 |
+| 47 | i18n-completeness | 6 |
+| 48 | pricing-monetization | 6 |
+| 49 | pwa-extension | 6 |
+| 50 | final-launch-checklist | 6 |
diff --git a/prompts/01-production-readiness-audit.md b/prompts/01-production-readiness-audit.md
new file mode 100644
index 000000000..a54709718
--- /dev/null
+++ b/prompts/01-production-readiness-audit.md
@@ -0,0 +1,52 @@
+# 01 · Production-Readiness Master Audit
+
+## Mission
+Produce the authoritative, evidence-backed list of everything standing between three.ws and a
+flawless production launch. You are not fixing here — you are **mapping reality** so the rest of
+the workstreams have a precise target. The bar is a platform that competes with Vercel/Linear/Stripe.
+
+## Context
+- Single npm-workspaces monorepo. Read `STRUCTURE.md` for the surface map, then `CLAUDE.md`.
+- ~20 product surfaces under `src/` + `pages/`, Vercel functions in `api/`, workers in `workers/`,
+ SDKs at top level and in `packages/`, contracts in `contracts/`.
+- Existing audit tooling (use it, don't reinvent): `npm run audit:web`, `npm run audit:pages`,
+ `npm run audit:handlers`, `npm run check:images`, `npm run lint`, `npm run typecheck`,
+ `npm run test:core`, `npm run build`.
+
+## Tasks
+1. **Inventory every reachable surface.** Cross-reference `data/pages.json`, `vercel.json` routes,
+ and the nav (`src/nav.js` / header) to list every user-reachable route. Flag any route in nav
+ with no page, or any page with no nav/link path (orphans).
+2. **Run the full audit suite** above and capture results. For each failure, record file:line and
+ root cause (not just the symptom).
+3. **Scan for CLAUDE.md violations** repo-wide: `TODO`, `FIXME`, `not implemented`,
+ `throw new Error('not implemented')`, `setTimeout(`-based fake loading, `const sample`/`mock`/
+ `placeholder` arrays shipped to UI, commented-out code blocks. Report counts + locations.
+4. **Coin-policy scan:** grep for any token reference that is not `$THREE` / the canonical CA in
+ source, copy, fixtures, tests, docs. Any hit is a release blocker — list it.
+5. **State-completeness spot check:** for the top 15 surfaces, confirm loading / empty / error
+ states exist. List every surface missing one.
+6. **Secrets & config:** confirm no secrets are committed; list required env vars per surface and
+ whether each has a graceful absence path.
+
+## Deliverable
+Write `docs/audit/production-readiness-YYYY-MM-DD.md` containing:
+- An executive summary (top 10 blockers, ranked by launch risk).
+- A categorized issue table: `Area | Issue | Evidence (file:line) | Severity (P0–P3) | Suggested prompt #`.
+- A coverage matrix of surfaces × (reachable, states designed, tests, a11y, mobile, perf, errors).
+- A "ready / not ready" verdict per surface.
+Do **not** fix issues in this prompt — route each to the relevant numbered prompt (02–50).
+
+## Acceptance
+- The report is exhaustive and every claim cites evidence (path + line or command output).
+- A reader can hand any single row to a fresh agent and they'd know exactly what to do.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first (they override defaults)
+- No mocks / fake data / placeholders / TODOs / stubs. Real APIs and implementations only.
+- $THREE is the only coin (CA `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Never reference any other token, anywhere.
+- Concurrent agents share this worktree — stage explicit paths (never `git add -A`); re-check `git status`/`git diff --staged` before committing.
+- esbuild trap: never commit `api/*.js` starting with `__defProp`/`createRequire`; recover with `git restore -- api/ public/`.
+- Every user-visible change → `data/changelog.json` entry + `npm run build:pages`.
+- Push to BOTH remotes when asked (`git push threeD main && git push threews main`); never pull/fetch/merge from `threeD`.
+- Definition of done = CLAUDE.md's checklist.
diff --git a/prompts/02-dead-paths-and-broken-links.md b/prompts/02-dead-paths-and-broken-links.md
new file mode 100644
index 000000000..fe13c1099
--- /dev/null
+++ b/prompts/02-dead-paths-and-broken-links.md
@@ -0,0 +1,45 @@
+# 02 · Dead Paths & Broken Links Sweep
+
+## Mission
+Every link must go somewhere live; every button must do something; every state must be
+reachable. Eliminate all dead paths across the platform. (Precedent: the account menu's
+"Edit Avatar" linked to an unrouted `/avatar-edit` and 404'd — find and kill every case like it.)
+
+## Context
+- Routes live in `vercel.json` (legacy `routes` array, `src`→`dest`). The catch-all
+ `/(.*)` → `/$1` means an unrouted extensionless path 404s instead of falling back to `.html`.
+- Pages: `pages/*.html`; entry modules: `src/*.js`. Nav: `src/nav.js` and per-page headers.
+- Helper scripts: `npm run audit:pages`, `npm run audit:handlers` (empty click handlers),
+ `npm run check:images`.
+
+## Tasks
+1. **Internal link extraction.** Grep all `href="/..."`, `location.href = '/...'`,
+ `router/navigate('/...')`, and `data-*` nav attributes across `src/`, `pages/`, `public/`.
+ Normalize to paths.
+2. **Route resolution.** For each internal path, confirm a matching `vercel.json` route OR a real
+ static file. Flag every path that resolves to the catch-all with no backing file (a latent 404).
+ Pay special attention to extensionless pretty paths (`/avatar-edit`, `/create`, `/agent/:id/edit`).
+3. **Empty/again handlers.** Run `npm run audit:handlers`; fix every button/link whose handler is a
+ no-op, `#`, `javascript:void(0)`, or missing.
+4. **Cross-surface wiring.** Verify the "second-order" links CLAUDE.md cares about exist: marketplace
+ → agent profile, gallery → forge, dashboard → edit, agent profile → launch history, etc.
+5. **External links.** Verify external/CDN links are https, not dead, and `rel="noopener"` where
+ `target="_blank"`.
+6. **Fix** each finding with the correct destination (prefer the canonical pretty route; add the
+ missing `vercel.json` route when a page has no extensionless entry, mirroring sibling pages).
+
+## Acceptance
+- `npm run audit:pages` and `npm run audit:handlers` pass clean.
+- Zero internal links resolve to a non-existent file.
+- A repo-wide grep for the fixed bad paths returns nothing.
+- Changelog entry for any user-visible fix; `vercel.json` changes noted as deploy-time.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first (they override defaults)
+- No mocks / fake data / placeholders / TODOs / stubs. Real APIs and implementations only.
+- $THREE is the only coin (CA `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Never reference any other token, anywhere.
+- Concurrent agents share this worktree — stage explicit paths (never `git add -A`); re-check `git status`/`git diff --staged` before committing.
+- esbuild trap: never commit `api/*.js` starting with `__defProp`/`createRequire`; recover with `git restore -- api/ public/`.
+- Every user-visible change → `data/changelog.json` entry + `npm run build:pages`.
+- Push to BOTH remotes when asked (`git push threeD main && git push threews main`); never pull/fetch/merge from `threeD`.
+- Definition of done = CLAUDE.md's checklist.
diff --git a/prompts/03-console-errors-warnings-sweep.md b/prompts/03-console-errors-warnings-sweep.md
new file mode 100644
index 000000000..b4a96e7ec
--- /dev/null
+++ b/prompts/03-console-errors-warnings-sweep.md
@@ -0,0 +1,41 @@
+# 03 · Zero Console Errors & Warnings
+
+## Mission
+Open every major page in a real browser and drive it until the console is **silent** — no errors,
+no warnings from our code, no failed network requests, no unhandled rejections. A clean console is
+table stakes for the quality bar in CLAUDE.md's Definition of Done.
+
+## Context
+- Vite dev server: `npm run dev` (port 3000). Pages serve at `http://localhost:3000/<page>.html`.
+- Playwright is installed (`node_modules/.bin/playwright`, `playwright-core`, chromium available).
+- Note: in Codespaces, Vite's HMR WebSocket fails through the proxy (a 302 on the wss handshake) —
+ that specific warning is environment noise, not a page bug. Everything else counts.
+
+## Tasks
+1. Build a small Playwright script (keep it in `scripts/`, not repo root) that loads each route from
+ `data/pages.json`, waits for network idle, exercises the primary interaction, and collects
+ `console` (error/warning) + `pageerror` + failed responses (4xx/5xx).
+2. Run it headless at 1440×900 and 390×844 (desktop + mobile). Capture a table of
+ `route | errors | warnings | failed requests`.
+3. **Fix every real issue at its root**: missing assets, null derefs, race conditions on mount,
+ double-initialized listeners, deprecated API calls, CORS/CSP violations, 404'd fetches.
+4. Re-run until the table is clean (excluding the documented HMR-proxy noise).
+5. Delete the throwaway script when done, or land it under `scripts/` as a reusable
+ `npm run`-able check if it adds lasting value (wire it into `package.json` if so).
+
+## Acceptance
+- Every route loads with a clean console at both viewports.
+- No unhandled promise rejections anywhere.
+- No failed same-origin network requests on initial load + primary interaction.
+- Report saved to `docs/audit/console-sweep-YYYY-MM-DD.md`; changelog entry for any user-visible fix.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first (they override defaults)
+- No mocks / fake data / placeholders / TODOs / stubs. Real APIs and implementations only.
+- $THREE is the only coin (CA `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Never reference any other token, anywhere.
+- Concurrent agents share this worktree — stage explicit paths (never `git add -A`); re-check `git status`/`git diff --staged` before committing.
+- esbuild trap: never commit `api/*.js` starting with `__defProp`/`createRequire`; recover with `git restore -- api/ public/`.
+- No throwaway scripts in the repo root — put tooling in `scripts/` or delete it.
+- Every user-visible change → `data/changelog.json` entry + `npm run build:pages`.
+- Push to BOTH remotes when asked (`git push threeD main && git push threews main`); never pull/fetch/merge from `threeD`.
+- Definition of done = CLAUDE.md's checklist.
diff --git a/prompts/04-build-deploy-artifact-integrity.md b/prompts/04-build-deploy-artifact-integrity.md
new file mode 100644
index 000000000..b08389941
--- /dev/null
+++ b/prompts/04-build-deploy-artifact-integrity.md
@@ -0,0 +1,44 @@
+# 04 · Build & Deploy Artifact Integrity
+
+## Mission
+Guarantee that what we ship is what we wrote. The build must be reproducible, the deploy artifacts
+clean, and the notorious esbuild-overwrite trap impossible to commit by accident.
+
+## Context
+- Build: `npm run build` (Vite, `NODE_OPTIONS` memory bump) then `scripts/strip-sw-from-embeds.mjs`.
+- Vercel build path: `npm run build:vercel` (`scripts/build-vercel.mjs`); `npm run check:dist`.
+- **Known trap (CLAUDE.md):** `npx vercel build` overwrites `api/*.js` source in place with huge
+ esbuild bundles (first line `__defProp`/`createRequire`). These must never be committed.
+- Deploy audit: `npm run audit:deploy` (`scripts/audit-deploy-artifacts.mjs`).
+
+## Tasks
+1. **Reproducible build:** run `npm run build` from clean (`npm run clean`) and confirm it succeeds
+ with no warnings from our code. Record build time + bundle sizes; flag any chunk that's
+ unexpectedly large.
+2. **Artifact audit:** run `npm run audit:deploy` and `npm run check:dist`; fix anything flagged.
+3. **esbuild-trap guard:** add a committable safeguard — a pre-commit-style check (script under
+ `scripts/`, optionally wired into `npm run` and/or `.husky`/git hook docs) that rejects staging
+ any `api/*.js` whose first line matches `__defProp`/`createRequire`/`esbuild`. Verify it triggers
+ on a planted sample and is removed cleanly after.
+4. **Source-map & secret hygiene:** confirm no `.env`, secrets, source maps with secrets, or
+ internal docs leak into `dist/`. Confirm `dist/` and scratch artifacts are gitignored.
+5. **Embed integrity:** verify `strip-sw-from-embeds.mjs` actually strips the service worker from
+ embed bundles (embeds must not register the SW). Test one embed page.
+6. **CI parity:** ensure local `npm run build` matches what CI/Vercel runs; document any divergence
+ in `docs/build.md`.
+
+## Acceptance
+- Clean `npm run build`, `npm run check:dist`, `npm run audit:deploy` all green.
+- The esbuild-trap guard provably blocks a bundled `api/*.js` from being staged.
+- No secrets/source artifacts in `dist/`.
+- Findings + the new guard documented; changelog entry only if user-visible.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first (they override defaults)
+- No mocks / fake data / placeholders / TODOs / stubs. Real APIs and implementations only.
+- $THREE is the only coin (CA `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Never reference any other token, anywhere.
+- Concurrent agents share this worktree — stage explicit paths (never `git add -A`); re-check `git status`/`git diff --staged` before committing.
+- esbuild trap: never commit `api/*.js` starting with `__defProp`/`createRequire`; recover with `git restore -- api/ public/`.
+- No throwaway scripts in the repo root — put tooling in `scripts/`.
+- Push to BOTH remotes when asked (`git push threeD main && git push threews main`); never pull/fetch/merge from `threeD`.
+- Definition of done = CLAUDE.md's checklist.
diff --git a/prompts/05-routing-and-404-audit.md b/prompts/05-routing-and-404-audit.md
new file mode 100644
index 000000000..3404d3f86
--- /dev/null
+++ b/prompts/05-routing-and-404-audit.md
@@ -0,0 +1,44 @@
+# 05 · Routing & 404 Audit (vercel.json)
+
+## Mission
+Make routing bulletproof: every page reachable by its canonical pretty URL, every legacy/aliased
+path redirected, a real designed 404, and no path that silently dead-ends.
+
+## Context
+- `vercel.json` uses the legacy `routes` array; order matters (first match wins) and the final
+ `/(.*)` → `/$1` is the catch-all. Query strings pass through automatically.
+- Every page generally needs BOTH `/<name>` and `/<name>/` → `/<name>.html` (see how
+ `/avatar-studio` is wired). Pretty resource routes use captures, e.g.
+ `/avatars/([^/]+)/edit` → `/avatar-edit.html?id=$1`.
+- `data/pages.json` is the source of truth for the page catalog; `npm run audit:pages`.
+
+## Tasks
+1. **Coverage:** for every page in `data/pages.json` and every `pages/*.html`, confirm an
+ extensionless route exists (both with and without trailing slash). Add the missing ones,
+ mirroring the established pattern. List pages that intentionally have no pretty route.
+2. **Order/conflict check:** detect shadowed routes (an earlier broad pattern swallowing a later
+ specific one) and fix ordering.
+3. **404 page:** confirm there is a real, on-brand 404 with navigation back into the product (not a
+ blank/borrowed page). If routing can't produce a true 404 status for unknown paths, wire a
+ catch-all to a `404.html` with correct status. Design loading/empty/error per CLAUDE.md.
+4. **Redirects:** add 308 redirects for any legacy URLs that exist in the wild (old slugs, `?id=`
+ forms that now have pretty equivalents) so links/bookmarks never break.
+5. **Trailing-slash + case consistency:** pick one canonical form and redirect the other.
+6. **Verify** with a script that requests every route (and a few known-bad paths) against a local
+ `npm run build` preview or the dev server and asserts status + final destination.
+
+## Acceptance
+- `npm run audit:pages` clean; every catalog page reachable by pretty URL.
+- Unknown paths return a designed 404 (correct status).
+- No shadowed routes; legacy paths 308-redirect to canonical.
+- `vercel.json` valid JSON; changes flagged as deploy-time-effective.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first (they override defaults)
+- No mocks / fake data / placeholders / TODOs / stubs. Real APIs and implementations only.
+- $THREE is the only coin (CA `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Never reference any other token, anywhere.
+- Concurrent agents share this worktree — stage explicit paths (never `git add -A`); re-check `git status`/`git diff --staged` before committing.
+- esbuild trap: never commit `api/*.js` starting with `__defProp`/`createRequire`; recover with `git restore -- api/ public/`.
+- Every user-visible change → `data/changelog.json` entry + `npm run build:pages`.
+- Push to BOTH remotes when asked (`git push threeD main && git push threews main`); never pull/fetch/merge from `threeD`.
+- Definition of done = CLAUDE.md's checklist.
diff --git a/prompts/06-test-coverage-unit.md b/prompts/06-test-coverage-unit.md
new file mode 100644
index 000000000..33f9a489e
--- /dev/null
+++ b/prompts/06-test-coverage-unit.md
@@ -0,0 +1,43 @@
+# 06 · Unit & Integration Test Coverage (Vitest)
+
+## Mission
+Raise unit/integration coverage on the logic that, if it breaks, costs money or trust: payments,
+wallet, gating, avatar/rig pipeline, routing/curriculum, SDK surfaces. Tests must be real (no
+mocked-away core logic) and deterministic.
+
+## Context
+- Runner: Vitest (`npm run test:core` for `--maxWorkers=1`, `vitest run` for full). E2E is separate
+ (Playwright, prompt 07). Existing tests in `tests/`.
+- `npm run test:gate` (`scripts/test-gate.mjs`) is the gate; `npm run typecheck` (tsc on `jsconfig.json`).
+- Pure logic to target first: `walk-sdk/src/*` (roster/config/retarget), `src/glb-canonicalize.js`
+ (already has tests — extend for new skeletons), `api/_lib/*` (payment/x402 helpers, skill license),
+ curriculum/playlist builders, price/quota/access-matrix logic.
+
+## Tasks
+1. **Coverage baseline:** run vitest with coverage; record per-area %. Identify the highest-risk
+ uncovered modules (money, auth, gating, rig retarget, route resolution).
+2. **Write tests** for those modules: happy path + boundary + failure. For `glb-canonicalize`, add a
+ case for every skeleton convention named in CLAUDE.md (Mixamo/Avaturn/Unreal/VRM/VRoid/VRM1.0/
+ Daz/MakeHuman/Blender `.L`/simple `shoulderL`).
+3. **x402 / payment helpers:** test amount math, currency = USDC, the malformed-RPC-reply recovery
+ path, and that no code path can reference a non-`$THREE` token.
+4. **Determinism:** remove flakiness (no real network in unit tests — use the project's existing
+ fixtures/harness; keep integration tests that DO hit real services in a clearly separated suite
+ that the gate can run with creds).
+5. **Wire the gate:** ensure `npm run test:gate` runs the new suites and fails on regression.
+6. Keep `npm run typecheck` clean for any files you touch.
+
+## Acceptance
+- Coverage on money/auth/gating/rig modules materially up (state before/after numbers).
+- `npm run test:core` and `npm run test:gate` green and deterministic across 3 consecutive runs.
+- No core logic mocked away to make a test pass; no `$THREE`-policy violation slips through.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first (they override defaults)
+- No mocks of core logic, no fake data, no stubs that hide real behavior. Real implementations.
+- $THREE is the only coin (CA `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Never reference any other token, anywhere.
+- Concurrent agents share this worktree — stage explicit paths (never `git add -A`); re-check before committing.
+- esbuild trap: never commit `api/*.js` starting with `__defProp`/`createRequire`.
+- Tests are internal — no changelog entry needed unless a user-visible bug was fixed along the way.
+- Push to BOTH remotes when asked; never pull/fetch/merge from `threeD`.
+- Definition of done = CLAUDE.md's checklist.
diff --git a/prompts/07-e2e-critical-flows.md b/prompts/07-e2e-critical-flows.md
new file mode 100644
index 000000000..066db9df7
--- /dev/null
+++ b/prompts/07-e2e-critical-flows.md
@@ -0,0 +1,46 @@
+# 07 · End-to-End Critical Flows (Playwright)
+
+## Mission
+Lock down the revenue- and trust-critical journeys with real browser E2E tests so a regression can
+never reach production silently.
+
+## Context
+- Playwright configured; `npm run test:e2e`. Existing specs in `tests/e2e/` (e.g. `avatar-edit.spec.js`).
+- Dev server `npm run dev` (port 3000). Pages serve at `/<page>.html` and pretty routes.
+
+## Critical journeys to cover (one spec each)
+1. **Forge text→3D:** load `/forge`, enter a prompt, pick the free NVIDIA engine, Generate, assert
+ the stage transitions empty→generating→result and a GLB viewer mounts.
+2. **Forge photo→3D:** upload a reference image, generate, assert result.
+3. **Avatar create → edit → save:** create flow → `/avatars/:id/edit` → change wardrobe/sculpt → save,
+ assert persistence.
+4. **Walk companion + playground:** enable the companion, open the full-page playground, move with
+ WASD, assert the avatar walks and the chosen avatar loads.
+5. **Wallet connect:** connect, assert connected state + balance render (use the project's test/dev
+ wallet path, not a mock).
+6. **x402 paid call:** exercise one paid endpoint through the real x402 flow end-to-end.
+7. **Marketplace browse → item → action.**
+8. **Onboarding wizard:** complete all steps to a deployed embed.
+9. **Search:** query → results → navigate to a result.
+10. **Feature tour:** start, advance stops, enter free-roam, exit.
+
+## Tasks
+- Author stable selectors (prefer roles/test-ids; add `data-testid` where DOM is ambiguous).
+- Each spec asserts the **designed states** (loading/empty/error/success), not just the happy pixel.
+- Make them resilient to async (web-first assertions, no arbitrary sleeps).
+- Wire into `npm run test:e2e` and the CI gate (prompt 37).
+- Document any flow that needs creds/secrets to run, and how CI supplies them.
+
+## Acceptance
+- All 10 specs pass locally against `npm run dev` (or a built preview).
+- No arbitrary timeouts; specs are stable across 3 runs.
+- Specs assert error/empty states, not only success.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first (they override defaults)
+- No mocks of the flows under test — drive the real UI and real endpoints (use the project's dev/test wallet + free engines).
+- $THREE is the only coin (CA `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Never reference any other token, anywhere.
+- Concurrent agents share this worktree — stage explicit paths; re-check before committing.
+- esbuild trap: never commit `api/*.js` starting with `__defProp`/`createRequire`.
+- Push to BOTH remotes when asked; never pull/fetch/merge from `threeD`.
+- Definition of done = CLAUDE.md's checklist.
diff --git a/prompts/08-error-handling-failsafes.md b/prompts/08-error-handling-failsafes.md
new file mode 100644
index 000000000..47ed2c841
--- /dev/null
+++ b/prompts/08-error-handling-failsafes.md
@@ -0,0 +1,45 @@
+# 08 · Error Handling & Failsafes
+
+## Mission
+No error without a solution. Every boundary (network, user input, wallet, RPC, 3D asset load)
+degrades gracefully with a clear, actionable recovery path — never a blank void, never a thrown
+stack to the user, never a silent failure. (Precedent: USDC checkout now survives a malformed RPC
+reply instead of erroring — apply that discipline everywhere.)
+
+## Context
+- CLAUDE.md: "Errors handled at boundaries; internal code trusts itself." "No errors without
+ solutions." Real fallbacks/failsafes, not lazy propagation.
+- Boundaries: `api/` handlers, `workers/`, Solana RPC calls, wallet adapters, GLB/animation loaders
+ (`src/glb-canonicalize.js`, `walk-sdk/src/internal/load-avatar.js`), x402 (`api/x402/*`,
+ `src/forge-pay.js`).
+
+## Tasks
+1. **Map boundaries:** list every network/RPC/wallet/asset-load call site. For each, verify there is
+ (a) a typed error path, (b) a user-facing message that says what happened + how to recover, and
+ (c) a real fallback where one exists (retry, alternate RPC, default avatar, free engine, etc.).
+2. **Global safety nets:** ensure a top-level `unhandledrejection` + `error` handler reports to the
+ client-error endpoint (`/api/client-errors`) and the user sees a recoverable state, not a frozen UI.
+3. **API handlers:** every `api/*.js` returns structured errors with correct status codes; no
+ unhandled throws; no leaking internals/stack traces to clients; inputs validated at the edge.
+4. **3D/asset failures:** a failed GLB never shows a T-pose or blank canvas — confirm the
+ default-rig / default-avatar fallbacks (CLAUDE.md avatar rule) hold on every viewer surface.
+5. **Retry/backoff:** adopt the existing resilience helper (memory note: cockatiel) for flaky
+ external calls instead of hand-rolling; add idempotency where a retry could double-charge.
+6. **Kill lazy propagation:** replace any `catch (e) { throw e }` / silent `catch {}` that hides a
+ real failure with a real handler or a logged, recoverable fallback.
+
+## Acceptance
+- Every boundary has designed error + recovery UI; no blank/frozen states under failure injection.
+- No unhandled rejections (verify with prompt 03's sweep under forced-offline + forced-RPC-failure).
+- API handlers return correct status codes and never leak stack traces.
+- Asset-load failures fall back, never T-pose.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first (they override defaults)
+- No mocks / fake data / placeholders / TODOs / stubs. Real fallbacks and failsafes only.
+- $THREE is the only coin (CA `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Never reference any other token, anywhere.
+- Concurrent agents share this worktree — stage explicit paths; re-check before committing.
+- esbuild trap: never commit `api/*.js` starting with `__defProp`/`createRequire`; recover with `git restore -- api/ public/`.
+- Every user-visible change → `data/changelog.json` entry + `npm run build:pages`.
+- Push to BOTH remotes when asked; never pull/fetch/merge from `threeD`.
+- Definition of done = CLAUDE.md's checklist.
diff --git a/prompts/09-accessibility-audit.md b/prompts/09-accessibility-audit.md
new file mode 100644
index 000000000..6de299a21
--- /dev/null
+++ b/prompts/09-accessibility-audit.md
@@ -0,0 +1,39 @@
+# 09 · Accessibility (WCAG 2.1 AA)
+
+## Mission
+Make the entire platform usable by keyboard and screen reader with sufficient contrast and clear
+focus. Accessibility is non-negotiable per CLAUDE.md.
+
+## Context
+- Vanilla JS + Vite, many custom interactive widgets (pickers, tabs, drawers, 3D canvases, toasts).
+- Design tokens / CSS variables in `style.css` and per-page styles.
+
+## Tasks
+1. **Automated pass:** run axe-core (via Playwright) over every route from `data/pages.json`; record
+ violations by route + rule. Fix all serious/critical.
+2. **Keyboard:** every interactive element reachable and operable by keyboard; logical tab order;
+ visible focus rings everywhere; no keyboard traps. Custom widgets (avatar picker, tour controls,
+ chapter panel, mode switches, drawers) get correct roles + arrow-key patterns.
+3. **Screen reader:** semantic HTML first; ARIA only where needed and correct. Label every control,
+ icon-only button, and form field. Live regions for async status (generation progress, toasts).
+4. **Contrast:** verify text + UI contrast meets AA against the dark theme tokens; fix failing
+ token usages at the token level so fixes propagate.
+5. **Media/3D:** provide text alternatives / descriptions for canvases where meaningful; respect
+ `prefers-reduced-motion` (already used in some modules — make it universal).
+6. **Forms:** associate labels, describe errors with `aria-describedby`, announce validation.
+
+## Acceptance
+- axe-core: zero serious/critical violations across all routes.
+- Full keyboard walkthrough of the top 12 surfaces with visible focus and no traps.
+- Contrast AA verified; `prefers-reduced-motion` honored platform-wide.
+- Changelog entry (improvement) for the accessibility pass.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first (they override defaults)
+- No mocks / fake data / placeholders / TODOs / stubs. Real implementations only.
+- $THREE is the only coin (CA `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Never reference any other token, anywhere.
+- Concurrent agents share this worktree — stage explicit paths; re-check before committing.
+- esbuild trap: never commit `api/*.js` starting with `__defProp`/`createRequire`.
+- Every user-visible change → `data/changelog.json` entry + `npm run build:pages`.
+- Push to BOTH remotes when asked; never pull/fetch/merge from `threeD`.
+- Definition of done = CLAUDE.md's checklist.
diff --git a/prompts/10-responsive-mobile-audit.md b/prompts/10-responsive-mobile-audit.md
new file mode 100644
index 000000000..ed381e3c4
--- /dev/null
+++ b/prompts/10-responsive-mobile-audit.md
@@ -0,0 +1,40 @@
+# 10 · Responsive & Mobile Audit
+
+## Mission
+Every surface looks and works great at 320px, 768px, and 1440px. No horizontal scroll, no
+overlap, no cramped or lopsided layouts, touch targets ≥44px. (Precedent: the Forge page was
+left-heavy because a two-column grid trapped content in one column — find every layout that
+collapses or wastes space.)
+
+## Context
+- CLAUDE.md: test 320/768/1440 mentally and for real; relative units; flex/grid over fixed widths.
+- Recent fixes: mobile Walk Companion toggle; Forge full-width layout. Use these as the quality bar.
+
+## Tasks
+1. **Screenshot matrix:** Playwright-capture every route at 320, 768, 1440 (and 390 for modern phones).
+ Build a contact sheet; flag overflow, overlap, clipped controls, empty dead space, unreadable text.
+2. **Fix layout bugs at the source:** prefer fixing the grid/flex container, not patching with media
+ queries on children. Ensure two-column desktop layouts use the full width and stack cleanly on mobile.
+3. **Touch ergonomics:** tap targets ≥44px; on-screen controls for anything keyboard-only on desktop
+ (the walk playground already has a d-pad — ensure parity elsewhere).
+4. **Viewport + safe areas:** correct `<meta viewport>`, `env(safe-area-inset-*)` on fixed bars,
+ no content under notches/home indicators.
+5. **3D canvases:** verify renderers resize correctly on rotation/resize and cap pixel ratio on mobile
+ for perf.
+6. **Nav:** mobile menu contains every primary action reachable on desktop (no desktop-only entry points).
+
+## Acceptance
+- No horizontal scroll or overlap at 320/390/768/1440 on any route.
+- All primary actions reachable on mobile; touch targets ≥44px.
+- 3D surfaces resize correctly; contact sheet saved to `docs/audit/responsive-YYYY-MM-DD/`.
+- Changelog entry for user-visible layout fixes.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first (they override defaults)
+- No mocks / fake data / placeholders / TODOs / stubs. Real implementations only.
+- $THREE is the only coin (CA `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Never reference any other token, anywhere.
+- Concurrent agents share this worktree — stage explicit paths; re-check before committing.
+- esbuild trap: never commit `api/*.js` starting with `__defProp`/`createRequire`.
+- Every user-visible change → `data/changelog.json` entry + `npm run build:pages`.
+- Push to BOTH remotes when asked; never pull/fetch/merge from `threeD`.
+- Definition of done = CLAUDE.md's checklist.
diff --git a/prompts/11-performance-web-vitals.md b/prompts/11-performance-web-vitals.md
new file mode 100644
index 000000000..866374dee
--- /dev/null
+++ b/prompts/11-performance-web-vitals.md
@@ -0,0 +1,41 @@
+# 11 · Performance & Core Web Vitals
+
+## Mission
+Fast by default. Hit green Core Web Vitals (LCP < 2.5s, INP < 200ms, CLS < 0.1) on key pages, and
+keep the 3D-heavy surfaces smooth (no jank, controlled memory).
+
+## Context
+- Vite build with code-splitting; Three.js + GLB/animation assets are the heavy hitters.
+- CLAUDE.md: lazy-load heavy modules, debounce input, paginate lists, `will-change`/`transform`
+ for animation. Asset pipeline + compression scripts exist: `npm run optimize:glb`,
+ `npm run compress:glbs`, `npm run check:images`.
+
+## Tasks
+1. **Measure:** Lighthouse (or Playwright + web-vitals) on homepage, `/forge`, `/marketplace`,
+ `/gallery`, a heavy 3D page, and the dashboard. Record LCP/INP/CLS + JS transfer + main-thread time.
+2. **JS:** audit bundle chunks; lazy-load Three.js and per-surface heavy modules so the homepage
+ doesn't pay for the editor. Defer non-critical scripts. Remove dead imports.
+3. **Assets:** run GLB optimization/compression; serve compressed textures (KTX2) where supported;
+ confirm images are responsive + lazy (`npm run check:images --strict` clean); preconnect/preload
+ the LCP asset.
+4. **3D runtime:** cap `devicePixelRatio` on mobile, frustum-cull, dispose GPU resources on unmount
+ (verify no WebGL context leaks across navigation), throttle expensive per-frame work.
+5. **Layout stability:** reserve space for async content (skeletons) so CLS stays low.
+6. **Caching:** verify static asset cache headers (see `vercel.json` asset route) are aggressive +
+ immutable for hashed assets.
+
+## Acceptance
+- Green CWV on the measured key pages (before/after numbers in the report).
+- No WebGL context leak when navigating between 3D pages repeatedly.
+- `npm run check:images --strict` clean; bundle sizes reduced (document deltas).
+- Report saved to `docs/audit/perf-YYYY-MM-DD.md`; changelog for user-visible speedups.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first (they override defaults)
+- No mocks / fake data / placeholders / TODOs / stubs. Real implementations only.
+- $THREE is the only coin (CA `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Never reference any other token, anywhere.
+- Concurrent agents share this worktree — stage explicit paths; re-check before committing.
+- esbuild trap: never commit `api/*.js` starting with `__defProp`/`createRequire`.
+- Every user-visible change → `data/changelog.json` entry + `npm run build:pages`.
+- Push to BOTH remotes when asked; never pull/fetch/merge from `threeD`.
+- Definition of done = CLAUDE.md's checklist.
diff --git a/prompts/12-seo-metadata.md b/prompts/12-seo-metadata.md
new file mode 100644
index 000000000..f25b87969
--- /dev/null
+++ b/prompts/12-seo-metadata.md
@@ -0,0 +1,39 @@
+# 12 · SEO & Metadata Completeness
+
+## Mission
+Every page is discoverable, shareable, and indexable: complete titles/descriptions, Open Graph +
+Twitter cards, canonical URLs, structured data, sitemap, robots, and rich link previews.
+
+## Context
+- Metadata pipeline already exists: `scripts/inject-seo-meta.mjs`, `scripts/inject-blog-seo.mjs`,
+ `npm run seo:meta`; page catalog in `data/pages.json`; OG image endpoints under `api/og/`.
+- Sitemap + `public/llms.txt` / `llms-full.txt` are generated by the page-index build.
+
+## Tasks
+1. **Per-page meta:** confirm every page has a unique, human, keyword-aware `<title>` and
+ `<meta description>` (no duplicates, no truncation). Fill gaps via the catalog + injector.
+2. **Social cards:** OG + Twitter tags on every page with a working OG image (use/extend the `api/og/`
+ generators). Validate with a card-preview check for the top 20 pages.
+3. **Canonical + hreflang:** canonical URL on every page; with i18n live (Spanish), correct
+ `hreflang` alternates. No canonical pointing at a 404 or non-pretty URL.
+4. **Structured data:** add appropriate JSON-LD (Organization, WebSite + SearchAction, Product for
+ marketplace items, BreadcrumbList, Article for blog/changelog). Validate against schema.org.
+5. **Sitemap + robots:** regenerate sitemap; ensure it lists only canonical, indexable URLs and
+ excludes embeds/utility routes; `robots.txt` correct; `llms.txt` accurate.
+6. **Crawlability:** confirm key content renders without JS where feasible, or that prerender/meta
+ suffices for crawlers; no important page `noindex` by accident.
+
+## Acceptance
+- `npm run seo:meta` clean; every page has unique title/description/canonical/OG/Twitter.
+- JSON-LD validates; sitemap + robots + llms.txt regenerated and correct.
+- Top-20 social previews render correctly (screenshots in `docs/audit/seo-YYYY-MM-DD/`).
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first (they override defaults)
+- No mocks / fake data / placeholders / TODOs / stubs. Real implementations only.
+- $THREE is the only coin (CA `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Never reference any other token, anywhere.
+- Concurrent agents share this worktree — stage explicit paths; re-check before committing.
+- esbuild trap: never commit `api/*.js` starting with `__defProp`/`createRequire`.
+- Every user-visible change → `data/changelog.json` entry + `npm run build:pages`.
+- Push to BOTH remotes when asked; never pull/fetch/merge from `threeD`.
+- Definition of done = CLAUDE.md's checklist.
diff --git a/prompts/13-design-system-consistency.md b/prompts/13-design-system-consistency.md
new file mode 100644
index 000000000..746a41733
--- /dev/null
+++ b/prompts/13-design-system-consistency.md
@@ -0,0 +1,39 @@
+# 13 · Design System & Visual Consistency
+
+## Mission
+Make the whole product feel like one premium surface: consistent spacing, typography, color tokens,
+radii, shadows, motion, and component patterns. Eliminate one-off styles and visual drift.
+
+## Context
+- Global tokens/CSS variables in `style.css`; per-page `<style>` blocks; `dashboard-next` has its own
+ `--nxt-*` token set. Many surfaces hand-rolled their own buttons/cards/inputs.
+
+## Tasks
+1. **Token audit:** inventory every CSS custom property and every raw hex/px value used outside
+ tokens. Replace ad-hoc values with tokens; reconcile the global tokens vs `--nxt-*` (document the
+ intended relationship, unify where sensible).
+2. **Component inventory:** catalog buttons, inputs, cards, chips, tabs, modals, toasts, tooltips,
+ empty/loading/error states across surfaces. Identify divergent implementations of the same thing
+ and converge them on a single canonical pattern (extract shared CSS/JS where it reduces code).
+3. **Microinteractions:** ensure consistent hover/active/focus states and transitions (opacity +
+ transform) on all interactive elements, per CLAUDE.md. No jarring pops.
+4. **Empty/loading/error states:** standardize their look-and-feel (skeletons preferred over spinners).
+5. **Iconography & typography:** one icon style, consistent type scale, consistent line-heights.
+6. **Dark/light + theme boot:** confirm `scripts/inject-theme-boot.mjs` prevents FOUC and themes are
+ consistent; no flashes or mismatched surfaces.
+
+## Acceptance
+- A short `docs/design-system.md` documenting tokens + canonical components.
+- Measurable reduction in one-off styles (before/after grep counts of raw hex/px).
+- Consistent hover/active/focus + transitions on every interactive element on the top 12 surfaces.
+- No theme FOUC; changelog entry (improvement) for visible polish.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first (they override defaults)
+- No mocks / fake data / placeholders / TODOs / stubs. Real implementations only.
+- $THREE is the only coin (CA `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Never reference any other token, anywhere.
+- Concurrent agents share this worktree — stage explicit paths; re-check before committing.
+- esbuild trap: never commit `api/*.js` starting with `__defProp`/`createRequire`.
+- Every user-visible change → `data/changelog.json` entry + `npm run build:pages`.
+- Push to BOTH remotes when asked; never pull/fetch/merge from `threeD`.
+- Definition of done = CLAUDE.md's checklist.
diff --git a/prompts/14-security-review.md b/prompts/14-security-review.md
new file mode 100644
index 000000000..de70a8dcb
--- /dev/null
+++ b/prompts/14-security-review.md
@@ -0,0 +1,44 @@
+# 14 · Security Review & Hardening
+
+## Mission
+A platform that touches wallets, payments, and user content must be hard to abuse. Find and fix
+auth gaps, injection vectors, secret leaks, SSRF, XSS, CSRF, insecure CORS/CSP, and unsafe defaults.
+This is defensive security on our own codebase.
+
+## Context
+- Vercel functions in `api/`, workers in `workers/`, on-chain in `contracts/`, wallet/x402 flows.
+- `api/client-errors`, CSP headers configured per-route in `vercel.json` (e.g. embed CSPs).
+- Auth: session cookies (`/api/auth/me`), wallet auth, skill-license checks.
+
+## Tasks
+1. **Authn/Authz:** verify every `api/*` that mutates or returns private data checks the session /
+ ownership. Test for IDOR (e.g., editing/reading another user's avatar/agent by id — confirm
+ `owner_id` checks like avatar-edit's are everywhere). List endpoints + their auth requirement.
+2. **Input validation:** validate + sanitize all inputs at the API edge (types, bounds, allow-lists).
+ No SQL/command/path injection; safe file handling for uploads (size/type/content sniffing).
+3. **XSS:** audit every place user/agent content reaches the DOM. Ensure escaping (`esc()` usage is
+ consistent) and no `innerHTML` of untrusted strings; sanitize rich content.
+4. **SSRF/proxy:** GLB/image proxies and any URL-fetching endpoint must allow-list schemes/hosts and
+ reject internal addresses (the avatar GLB proxy, OG fetchers, page-agent fetchers).
+5. **Secrets:** confirm no secrets in source, history, client bundles, or `dist/`. Server-only env
+ stays server-only; rotate anything exposed. Document required env per surface.
+6. **Headers:** CSP (tighten beyond embeds), HSTS, `X-Content-Type-Options`, `Referrer-Policy`,
+ `Permissions-Policy`. CORS scoped, not `*`, for credentialed endpoints.
+7. **Rate-limit hooks:** confirm abuse-prone endpoints are protected (hand off specifics to prompt 35).
+8. **Dependencies:** `npm audit` + review; patch high/criticals; pin/verify forked deps.
+
+## Acceptance
+- A `docs/security/review-YYYY-MM-DD.md` with findings, severity, fix status, and an endpoint→auth matrix.
+- No IDOR on owned resources; uploads/proxies hardened; no secret leakage.
+- Security headers present on all routes; `npm audit` shows no unaddressed high/criticals.
+- Coordinate any user-visible change with a changelog `security` entry (no sensitive details).
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first (they override defaults)
+- Defensive security only — harden our own code; no offensive tooling.
+- No mocks / fake data / placeholders / TODOs / stubs. Real implementations only.
+- $THREE is the only coin (CA `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Never reference any other token, anywhere.
+- Concurrent agents share this worktree — stage explicit paths; re-check before committing.
+- esbuild trap: never commit `api/*.js` starting with `__defProp`/`createRequire`; recover with `git restore -- api/ public/`.
+- Push to BOTH remotes when asked; never pull/fetch/merge from `threeD`.
+- Definition of done = CLAUDE.md's checklist.
diff --git a/prompts/15-forge-pipeline.md b/prompts/15-forge-pipeline.md
new file mode 100644
index 000000000..c08e5298f
--- /dev/null
+++ b/prompts/15-forge-pipeline.md
@@ -0,0 +1,38 @@
+# 15 · Forge (Text/Photo → 3D) — End-to-End Hardening
+
+## Mission
+Make Forge a flawless, screenshot-worthy text/photo→3D pipeline across every engine, with perfect
+states, robust error recovery, and a result experience (orbit, AR, export, refine) that feels best-in-class.
+
+## Context
+- Page: `pages/forge.html`; logic: `src/forge.js` and `src/forge-*.js` (ar, dropzone, enhance,
+ export, gameready, optimize, pay, prompt-studio, refine, reveal, showcase, stylize).
+- Engines: NVIDIA (free, no key), Hunyuan3D (free), Fast, Meshy, Tripo, Rodin, Stability, Replicate
+ (own-key). Free lane = NVIDIA NIM TRELLIS. Layout is the two-column workspace (rail + stage).
+- High quality is a $THREE-holder perk (hold-to-unlock or pay-per-generation) — keep gating correct.
+
+## Tasks
+1. **Every engine works or is honestly disabled:** verify each engine's availability state (free /
+ your-own-key / busy / unavailable) is accurate and reflects reality; selecting an unavailable
+ engine never silently fails.
+2. **All states designed:** empty (idle viewer/showcase), generating (real progress steps, not fake
+ timers), success (viewer + actions), error (actionable, retry, switch-engine). Confirm no
+ `setTimeout` fake progress; progress reflects real pipeline stages.
+3. **Text + photo modes:** prompt coaching, Surprise/Enhance, aspect ratios; photo mode multi-view
+ upload (1–4), drag-reorder, paste, size/type validation, helpful errors.
+4. **Result experience:** orbit controls, AR (`forge-ar`), export/download (`forge-export`,
+ `forge-gameready`, `forge-optimize`), refine/stylize. Each reachable, each works on a real GLB.
+5. **Persistence:** "Your creations" durable list; community showcase loads real data (the showcase
+ regressed before — verify it renders live models, not empty tiles).
+6. **Gating + pay:** $THREE perk line + connect-wallet path correct; pay-per-generation via x402
+ works end-to-end; never reference any non-$THREE token.
+7. **Performance:** lazy-load heavy engine/export modules; dispose viewers on teardown.
+
+## Acceptance
+- Generate succeeds on the free lane (text + photo) with correct state transitions and a viewable GLB.
+- Every result action (orbit/AR/export/refine) works on a real model.
+- Showcase + creations render live data; gating + pay-per-gen verified.
+- Clean console; responsive at 320/768/1440; E2E (prompt 07) green. Changelog for visible changes.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. No mocks/fake data/stubs. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles (`__defProp`/`createRequire`). User-visible change → `data/changelog.json` + `npm run build:pages`. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/16-walk-sdk-companion-playground.md b/prompts/16-walk-sdk-companion-playground.md
new file mode 100644
index 000000000..cf5a59ef5
--- /dev/null
+++ b/prompts/16-walk-sdk-companion-playground.md
@@ -0,0 +1,36 @@
+# 16 · Walk SDK — Companion, Playground & Picker
+
+## Mission
+Make the Walk experience (corner companion + full-page playground + avatar picker) bulletproof and
+delightful everywhere it ships — on three.ws and as the published `@three-ws/walk` package.
+
+## Context
+- SDK: `walk-sdk/src/*` (`companion.js`, `playground.js`, `picker.js`, `roster.js`, `config.js`,
+ `internal/load-avatar.js`, `internal/runtime.js`). App entries: `src/walk-companion.js`,
+ `src/walk-playground.js`. Full page: `src/walk.js` (platformer w/ gravity).
+- Playground has Stroll + Platformer modes, keyboard/WASD/gamepad/touch d-pad, dive-into-links.
+- Avatar rule (CLAUDE.md): any humanoid drives the shared clip library via canonicalize+retarget;
+ non-humanoid falls back to default rig — never a T-pose.
+
+## Tasks
+1. **Avatar universality:** verify every roster avatar + a user-generated avatar loads and animates
+ (idle/walk/run/wave/jump) in companion AND both playground modes — never a bind/T-pose. Add any
+ missing skeleton mapping to `glb-canonicalize.js` (+ a test).
+2. **Companion:** mount/unmount cleanly, no WebGL leaks, respects excluded routes, mobile toggle
+ works (recent fix — keep parity), picker hot-swap persists to the shared key.
+3. **Playground:** gravity/collision correct in platformer; stroll roams; mode switch (M) preserves
+ position; dive-into-link navigates with the resume drop-in; touch d-pad on mobile; gamepad works.
+4. **Picker:** searchable, grouped, keyboard-navigable, "Make your own" link; selection hot-swaps
+ live rig everywhere it's embedded.
+5. **SDK packaging:** `@three-ws/walk` builds, types/exports correct, embeddable on a third-party
+ page with one tag; README accurate; no hard dependency on app internals.
+6. **States + errors:** GLB load failure falls back to default rig with a message; reduced-motion honored.
+
+## Acceptance
+- Every avatar animates in all surfaces; zero T-pose; zero WebGL leak across navigation.
+- Companion + playground work on desktop + mobile (keyboard, touch, gamepad).
+- `@three-ws/walk` builds and embeds cleanly on a bare HTML page; README verified.
+- E2E (prompt 07) for companion+playground green; changelog for visible changes.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. No mocks/fake data/stubs. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. User-visible change → `data/changelog.json` + `npm run build:pages`. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/17-avatar-create-edit-rig.md b/prompts/17-avatar-create-edit-rig.md
new file mode 100644
index 000000000..e65a0bdda
--- /dev/null
+++ b/prompts/17-avatar-create-edit-rig.md
@@ -0,0 +1,35 @@
+# 17 · Avatar Pipeline — Create, Edit, Rig, Animate
+
+## Mission
+The full avatar lifecycle — generate (text/selfie/photo), customize (wardrobe/sculpt/accessories),
+rig, animate, save, and use everywhere — must be seamless, owned-by-you, and never produce a broken
+or T-posed model.
+
+## Context
+- Create flows: `/create`, `/create/selfie`, `/create/prompt`, `/avatar-studio` (full editor),
+ `character-studio/` (forked builder). Edit: `src/avatar-edit.js` + `pages/avatar-edit.html`
+ (`/avatars/:id/edit`); sculpt `src/avatar-sculpt.js`; accessories `src/agent-accessories.js`.
+- Canonicalize/retarget: `src/glb-canonicalize.js`, `src/animation-retarget.js`,
+ `AnimationManager.supportsCanonicalClips()`. Snapshot: `src/voice/avatar-snapshot.js`.
+- MCP avatar tools: `forge_avatar`, `text_to_avatar`, `mesh_forge`, `rig_mesh`.
+
+## Tasks
+1. **Create → own:** each create path produces a real, owned, riggable GLB; ownership checks
+ (`owner_id`) enforced on read/edit (no IDOR). Empty/loading/error states designed.
+2. **Edit:** wardrobe, hats, glasses, earrings, sculpt morphs, animate tab all apply live and persist;
+ "no GLB / not owner / no avatar specified" states are graceful (not 404s — see prompt 02/05).
+3. **Rig + animate:** every saved avatar drives the shared clip library; rig fallback for
+ non-humanoid; add skeleton mappings + tests for any rig that T-poses.
+4. **Snapshot/thumbnail:** save generates a correct thumbnail used across gallery/marketplace/dashboard.
+5. **Cross-surface use:** the saved avatar appears as the walk companion, tour guide, dashboard topbar
+ avatar, and is selectable in pickers (shared storage key).
+6. **MCP parity:** `forge_avatar`/`rig_mesh` produce results consistent with the web pipeline.
+
+## Acceptance
+- Create→edit→save→use round-trips for text, selfie, and photo inputs with persistence.
+- No T-pose anywhere; ownership enforced; all edit states designed.
+- Thumbnails generate and propagate; MCP avatar tools match web output.
+- E2E (prompt 07) green; changelog for visible changes.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. No mocks/fake data/stubs. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. User-visible change → `data/changelog.json` + `npm run build:pages`. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/18-agent-studio.md b/prompts/18-agent-studio.md
new file mode 100644
index 000000000..ac49f0782
--- /dev/null
+++ b/prompts/18-agent-studio.md
@@ -0,0 +1,34 @@
+# 18 · Agent Studio — Create, Configure, Deploy
+
+## Mission
+The agent builder is the heart of the platform: author an agent's avatar, brain (LLM + prompt),
+memory, skills, money, and on-chain identity in one place with a live 3D preview — flawlessly.
+
+## Context
+- Create: `pages/create-agent.html`, `src/create-agent.js`; review `pages/create-review.html`.
+- Studio: the agent editor (brain/memory/body/money/skills) with a live `<agent-3d>` preview
+ (`src/element.js`, `avatar-sdk/`). Agent edit route `/agent/:id/edit` (`agent-edit.html`).
+- Models: pick the agent's LLM (Claude family default — use latest, see `claude-api` skill); skills
+ catalog + on-chain skill licenses (`contracts/skill-license`, `api/skills/*`).
+
+## Tasks
+1. **Full create flow:** avatar → brain (model + system prompt) → skills → identity → monetization →
+ deploy embed. Every step validated, resumable, with designed states; no dead step.
+2. **Brain tab:** model picker uses real, current model IDs (latest Claude by default); prompt editor
+ robust; no stray overlay/stacked-panel bugs (a recent fix — keep it clean).
+3. **Memory:** create/edit/delete custom memories (per the memory tutorial) via dashboard, chat, MCP,
+ API, and skills — all paths work and persist.
+4. **Skills:** browse, enable, purchase (skill license = 1/1 SPL NFT + PDA); access checks enforced;
+ pay-what-you-want + reviews where applicable.
+5. **Live preview:** `<agent-3d>` reflects edits in real time; never errors out — default-avatar
+ fallback holds.
+6. **Deploy:** produces a working embed widget + monetization; the embed loads on a third-party page.
+7. **Identity:** ERC-8004 registration path works; reputation reads.
+
+## Acceptance
+- End-to-end create→deploy produces a live, embeddable, monetizable agent with on-chain identity.
+- Every tab's states designed; live preview never throws; memory CRUD works on all 5 paths.
+- Skill purchase + access enforcement verified; clean console; E2E green; changelog for visible changes.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. No mocks/fake data/stubs. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. User-visible change → `data/changelog.json` + `npm run build:pages`. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist. For anything LLM/model-related, consult the `claude-api` skill and use current model IDs.
diff --git a/prompts/19-marketplace.md b/prompts/19-marketplace.md
new file mode 100644
index 000000000..ccf7f79f3
--- /dev/null
+++ b/prompts/19-marketplace.md
@@ -0,0 +1,30 @@
+# 19 · Marketplace — Agents, Skills, Avatars
+
+## Mission
+A trustworthy, liquid marketplace where users discover and buy access to agents, skills, and avatars
+from other creators — with real listings, real prices, real purchase flows, and clear ownership.
+
+## Context
+- Marketplace surfaces under `src/` + `pages/`; purchases settle via x402 (USDC) and/or on-chain
+ skill licenses; creator payouts + affiliate breakdowns exist (recent commits).
+- Item types: agents, skills (1/1 SPL NFT license), avatars/accessories.
+
+## Tasks
+1. **Listings:** real data from the catalog APIs; pagination, sorting, filtering, search within the
+ marketplace; every card links to a real detail page (no dead links — prompt 02).
+2. **Detail pages:** complete info (preview, price, creator, reputation, reviews), with a working
+ buy/access CTA and all states (loading/empty/error/sold/owned).
+3. **Purchase flow:** x402 USDC purchase + on-chain skill license mint where applicable; idempotent,
+ no double-charge; clear receipts; ownership reflected immediately after purchase.
+4. **Creator side:** list/manage items, see sales + affiliate breakdown + payouts; pay-what-you-want
+ pricing where supported.
+5. **Reviews + reputation:** real reviews; ERC-8004 reputation surfaced; no fake/seed reviews shipped.
+6. **Cross-links:** marketplace ↔ agent profiles, gallery, launches (second-order wiring per CLAUDE.md).
+
+## Acceptance
+- Browse → detail → buy → owned round-trips with real USDC/x402 + license mint; no double-charge.
+- Creator dashboard shows real sales/affiliate/payout data; reviews + reputation real.
+- All states designed; no dead links; clean console; responsive; changelog for visible changes.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. No mocks/fake data/stubs (no seeded reviews/listings in prod). $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`) — purchases settle in USDC; never reference any other token. Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. User-visible change → `data/changelog.json` + `npm run build:pages`. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/20-gallery-discovery.md b/prompts/20-gallery-discovery.md
new file mode 100644
index 000000000..548bec6d7
--- /dev/null
+++ b/prompts/20-gallery-discovery.md
@@ -0,0 +1,32 @@
+# 20 · Gallery & Discovery
+
+## Mission
+Make discovery addictive: browse every public avatar, agent, animation, and forged model in fast,
+beautiful, filterable grids that always show real, live content and route cleanly into detail/use.
+
+## Context
+- Gallery surfaces (`/gallery`, explore endpoints `/api/explore`), animation gallery, forge showcase
+ (`src/forge-showcase.js`), launches feed (`/launches`, `/api/pump/launches`).
+- "Made with Forge" homepage strip recently regressed to empty tiles — discovery must never show
+ placeholder voids.
+
+## Tasks
+1. **Live data everywhere:** every grid loads real items from real endpoints with pagination/
+ infinite-scroll; designed empty state ("be the first…") when truly empty — never blank tiles.
+2. **Filtering/sorting/search:** category, recency, popularity; consistent across galleries; URL-
+ reflectable so views are shareable.
+3. **Performance:** lazy-load thumbnails + viewers; virtualize/paginate large grids; dispose 3D
+ previews offscreen (no WebGL leaks).
+4. **Detail/use routing:** each item → a real detail page or direct action (apply animation, open in
+ forge/editor, view agent). No dead links.
+5. **Launches feed:** renders coins users launched via three.ws from platform launch records (allowed
+ per CLAUDE.md) — runtime data only, never hardcode/recommend a specific non-$THREE mint.
+6. **Quality:** hover/focus states, skeletons, smooth transitions; responsive grids.
+
+## Acceptance
+- Every gallery shows live, paginated content with working filters/sort/search; no placeholder voids.
+- All items route to a real destination; no WebGL leaks scrolling large grids.
+- Launches feed renders from real launch records only; clean console; responsive; changelog for visible changes.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. No mocks/fake data/stubs/sample arrays. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`); the launches feed may render user-launched mints from real records but never hardcode/recommend one. Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. User-visible change → `data/changelog.json` + `npm run build:pages`. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/21-social-club-city.md b/prompts/21-social-club-city.md
new file mode 100644
index 000000000..ca82df90e
--- /dev/null
+++ b/prompts/21-social-club-city.md
@@ -0,0 +1,31 @@
+# 21 · Social Surfaces — Club, City, IRL, Multiplayer
+
+## Mission
+Make the shared 3D social spaces (club, city, IRL/AR, arena, multiplayer) reliable, performant, and
+fun — real avatars, real presence, graceful degradation when a feature/asset is unavailable.
+
+## Context
+- Surfaces: `src/club.js`, `src/club-entrance.js`, `src/club-crowd.js`, `src/city.js`, `src/irl.js`,
+ the agent arena (3D trading floor), `multiplayer/` (Colyseus). Excluded from the corner companion.
+- Heavy 3D + networking; built assets via `npm run build:club-assets`, `build:walk-environments`.
+
+## Tasks
+1. **Entry + presence:** entering a space loads the user's avatar (no T-pose), shows others present,
+ and handles join/leave cleanly. Connection loss degrades gracefully (reconnect, status, no freeze).
+2. **Performance/memory:** crowd rendering is bounded + LOD'd; dispose on exit (no WebGL/socket
+ leaks); cap pixel ratio on mobile; steady frame rate with N avatars.
+3. **Movement/interaction:** WASD/touch movement, camera, interactions consistent with the walk
+ platformer; dancers/NPCs animate via shared library with default-rig fallback.
+4. **Arena:** agents render as avatars with live, on-chain-verifiable P&L tags + trade reactions; every
+ number traces to a real on-chain trade. No fabricated data.
+5. **Multiplayer server:** Colyseus rooms stable; reconnection; rate-limited; no crash on malformed
+ messages; document deploy/runbook.
+6. **States:** loading/empty/error designed for each space; AR permission prompts handled.
+
+## Acceptance
+- Join/move/leave works with real avatars + presence; graceful reconnect on network loss.
+- Stable frame rate with a crowd; zero leaks on exit; arena numbers verifiable on-chain.
+- Multiplayer server resilient to bad input; clean console; responsive; changelog for visible changes.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. No mocks/fake data/stubs; arena/social data must be real + on-chain-verifiable. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. User-visible change → `data/changelog.json` + `npm run build:pages`. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/22-onboarding-wizard.md b/prompts/22-onboarding-wizard.md
new file mode 100644
index 000000000..241868faa
--- /dev/null
+++ b/prompts/22-onboarding-wizard.md
@@ -0,0 +1,32 @@
+# 22 · Onboarding Wizard (first 5 minutes)
+
+## Mission
+A new visitor goes from zero to a deployed, monetizable 3D agent in under 5 minutes, delighted the
+whole way. This funnel is the #1 driver of activation — make it frictionless and beautiful.
+
+## Context
+- 5-step wizard (per `data/pages.json`): create a 3D avatar → name your agent → enable skills →
+ deploy an embed widget → set up monetization. Create flows under `/create*`.
+- Account/auth: `/api/auth/me`, `/login`; wallet connect optional but supported.
+
+## Tasks
+1. **Flow integrity:** each step is reachable, resumable (refresh-safe), skippable where sensible, and
+ advances only on valid input. Progress indicator accurate. No dead step, no place to get stuck.
+2. **Avatar step:** fast text/selfie avatar creation with a live preview; sensible default if the user
+ skips; never a T-pose.
+3. **Skills + monetization:** real skills catalog; monetization setup produces a working paid surface
+ (x402). Wallet connect optional and clearly explained.
+4. **Deploy step:** generates a real embed snippet that works when pasted on a third-party page; copy
+ button; preview.
+5. **Empty/error/loading states** designed for every step; network failures recover.
+6. **Conversion polish:** microcopy, progress reassurance, "you're almost there" cues, celebratory
+ completion that routes into the dashboard with next actions.
+7. **Analytics hooks:** emit funnel events per step (coordinate with prompt 45) without blocking UX.
+
+## Acceptance
+- A fresh user completes all 5 steps to a deployed, embeddable, monetizable agent in <5 min.
+- Resumable + refresh-safe; every step's states designed; embed works on a bare page.
+- Funnel events emitted; clean console; responsive; changelog entry for visible changes.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. No mocks/fake data/stubs. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. User-visible change → `data/changelog.json` + `npm run build:pages`. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/23-feature-tour.md b/prompts/23-feature-tour.md
new file mode 100644
index 000000000..fcf65f0cc
--- /dev/null
+++ b/prompts/23-feature-tour.md
@@ -0,0 +1,34 @@
+# 23 · Feature Tour — Guided Product Walkthrough
+
+## Mission
+Polish the 3D guided tour into a signature, screenshot-worthy onboarding experience that teaches the
+whole product, works across routes, and never glitches.
+
+## Context
+- `src/feature-tour/*`: `director.js` (orchestration), `guide-avatar.js` (3D guide + gravity),
+ `controls.js`, `chapters.js` (map + settings + avatar picker), `narrator.js` (TTS),
+ `spotlight.js`, `free-roam.js` (WASD/click/drag walking), `curriculum.js`. Curriculum built by
+ `scripts/build-tour.mjs` → `/tour/curriculum.json`. Entry: `src/feature-tour.js`.
+- Recent: guide defaults to "Ava", obeys gravity, avatar picker, keyboard free-roam.
+
+## Tasks
+1. **Curriculum coverage:** every major surface has a correct, current tour stop with a real on-page
+ target; fix stale selectors/targets; Quick + Full tracks both coherent.
+2. **Cross-route continuity:** navigating between stops on different pages re-hydrates correctly and
+ never strands the guide off-route; off-route recovery is graceful.
+3. **Guide quality:** walk/approach/point/gravity smooth; speech bubble + spotlight + beam aligned;
+ reduced-motion honored; no WebGL leak on exit.
+4. **Controls + chapters:** play/pause/seek/speed/mute/roam/exit all work; chapter jump; avatar picker
+ swaps the guide; voice selection drives real TTS.
+5. **Free-roam:** WASD/arrows (+Shift run), click-to-walk, drag, edge-scroll across the page; doesn't
+ hijack typing or page clicks.
+6. **TTS:** narration plays on the free lane with backstop; mute/speed respected; no audio overlap.
+7. **States:** loading/empty/error designed; tour degrades to captions if WebGL/TTS unavailable.
+
+## Acceptance
+- Full tour runs across all routes without stranding/glitching; Quick + Full both correct.
+- Controls/chapters/picker/voice/free-roam all functional; reduced-motion honored; no leaks.
+- Degrades gracefully without WebGL/TTS; clean console; responsive; changelog for visible changes.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. No mocks/fake data/stubs. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. User-visible change → `data/changelog.json` + `npm run build:pages`. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/24-scene-studio.md b/prompts/24-scene-studio.md
new file mode 100644
index 000000000..9d1b29405
--- /dev/null
+++ b/prompts/24-scene-studio.md
@@ -0,0 +1,29 @@
+# 24 · Scene Studio — 3D Scene Editor
+
+## Mission
+Make the in-browser 3D scene editor (import GLBs, compose scenes, edit materials/lights, export) a
+reliable, professional tool that never loses work and exports correctly.
+
+## Context
+- `src/scene-studio/` (`→ /scene`), vendored three.js r184 editor (MIT). Imports GLBs, composes,
+ edits materials/lights, exports.
+
+## Tasks
+1. **Import/export integrity:** GLB/GLTF import preserves materials/animations; export round-trips
+ without corruption; supported formats documented; large-file handling with progress + error states.
+2. **Editing UX:** transform gizmos, hierarchy, material/light editing all functional and discoverable;
+ undo/redo reliable; keyboard shortcuts documented.
+3. **Persistence:** autosave / no silent work loss; warn before navigation with unsaved changes;
+ restore on reload.
+4. **Performance:** handle reasonably complex scenes without jank; dispose resources; cap pixel ratio.
+5. **States:** empty (start a scene / import), loading, error (bad file → actionable message), populated.
+6. **Vendor hygiene:** keep the vendored editor cleanly separated (see `vendor/README.md`); our
+ customizations isolated so upstream updates remain possible.
+
+## Acceptance
+- Import → edit → export round-trips correctly on real GLBs incl. animations.
+- Undo/redo + autosave reliable; no silent work loss; large-file + bad-file states designed.
+- No leaks; clean console; responsive; changelog for visible changes.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. No mocks/fake data/stubs. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Stage explicit paths; never `git add -A`. Keep vendored code isolated. Don't commit `api/*.js` bundles. User-visible change → `data/changelog.json` + `npm run build:pages`. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/25-search.md b/prompts/25-search.md
new file mode 100644
index 000000000..ad070009a
--- /dev/null
+++ b/prompts/25-search.md
@@ -0,0 +1,29 @@
+# 25 · Search & Command Palette
+
+## Mission
+Global search (top-nav ⌘K) returns fast, relevant results across pages, agents, skills, avatars,
+docs, and launches — and routes the user straight to what they want.
+
+## Context
+- Top-nav search + `dashboard-next` command palette (`data-action="open-palette"`, ⌘K).
+- Catalog: `data/pages.json`; entity APIs for agents/skills/avatars/launches.
+
+## Tasks
+1. **Coverage:** index/search pages, agents, skills, avatars, docs, changelog, launches. Define what's
+ searchable and ensure each result type routes correctly.
+2. **Relevance + speed:** debounced input; ranked results (name > tags > description); keyboard
+ navigation (arrows + Enter); recent/suggested when empty.
+3. **States:** empty query (suggestions), no results (helpful message + nearest actions), loading,
+ error. Never a blank dropdown.
+4. **Command palette:** quick actions (create agent, open forge, go to dashboard, toggle theme, etc.)
+ alongside entity results; consistent with top-nav search.
+5. **Accessibility:** full keyboard operation, ARIA combobox/listbox semantics, focus management.
+6. **Performance:** results render < 100ms after debounce on a warm index; no main-thread jank.
+
+## Acceptance
+- ⌘K opens instantly; queries return ranked, routable results across all entity types.
+- All states designed; fully keyboard-operable with correct ARIA; no blank dropdowns.
+- Clean console; responsive; changelog for visible changes.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. No mocks/fake data/stubs. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. User-visible change → `data/changelog.json` + `npm run build:pages`. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/26-dashboard.md b/prompts/26-dashboard.md
new file mode 100644
index 000000000..048aa69ab
--- /dev/null
+++ b/prompts/26-dashboard.md
@@ -0,0 +1,29 @@
+# 26 · Dashboard (dashboard-next)
+
+## Mission
+The signed-in home must surface what matters and turn data into action: agents, avatars, earnings,
+usage, notifications, account — all real, all actionable, beautifully laid out.
+
+## Context
+- `src/dashboard-next/*`: `pages/*` (home, account, walk, developers, etc.), `components/*` (topbar,
+ drawer), `nav.js`, `api.js`. Topbar has command palette, notifications, walking avatar, user menu.
+- Auth via `/api/auth/me`; notifications via `/api/notifications`.
+
+## Tasks
+1. **Real, actionable data:** every widget loads real data (agents, avatars, earnings/affiliate,
+ usage, recent activity) with deep links into the relevant editor/surface. No decorative dead panels.
+2. **Account:** profile, wallet, email, plan, API keys, security settings — all functional with
+ designed states; sign-in/out flows correct.
+3. **Notifications:** real unread counts + dropdown + activity drawer; mark-read; deep links.
+4. **Empty states:** a new user with nothing sees inviting, actionable empty states (create your first
+ agent/avatar), not blank panels — and those CTAs route correctly (e.g. create button → `/create`).
+5. **Topbar avatar:** the user's avatar lives in the topbar (no T-pose), links to edit; reacts to events.
+6. **Performance + consistency:** fast loads, skeletons, consistent `--nxt-*` tokens, responsive.
+
+## Acceptance
+- Every widget shows real data and links to a real action; empty states inviting + correctly routed.
+- Account/notifications/avatar all functional; designed loading/empty/error states throughout.
+- Clean console; responsive; changelog for visible changes.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. No mocks/fake data/stubs. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. User-visible change → `data/changelog.json` + `npm run build:pages`. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/27-x402-payments.md b/prompts/27-x402-payments.md
new file mode 100644
index 000000000..6569562e8
--- /dev/null
+++ b/prompts/27-x402-payments.md
@@ -0,0 +1,33 @@
+# 27 · x402 Payments — End-to-End Robustness
+
+## Mission
+Payments are sacred. Every x402 paid flow (paying for a service, charging for an endpoint) must be
+correct, idempotent, observable, and bulletproof — no double-charges, no silent failures, no lost money.
+
+## Context
+- x402 endpoints under `api/x402/*` (checkout, service, pay-by-name, fact-check, tutor, etc.);
+ helpers in `api/_lib/*`; client flows in `src/forge-pay.js` and skill/marketplace purchases.
+- Settlement currency is USDC. Recent fix: USDC checkout survives a malformed RPC reply.
+- Discovery/indexing context lives in the team memory (CDP Bazaar / x402scan / 402index) + a verifier.
+
+## Tasks
+1. **Map every paid flow:** list each x402 endpoint + each client call site; document price, currency
+ (USDC), and what's delivered on success.
+2. **Idempotency + no double-charge:** ensure retries/network blips can't charge twice; payment intents
+ keyed; settlement verified before delivering the good; failed delivery after charge has a refund/retry path.
+3. **Resilience:** adopt the resilience helper (cockatiel per team memory) for RPC/settlement calls;
+ handle malformed RPC replies (precedent), timeouts, congestion — with clear user messaging.
+4. **Receipts + records:** every payment recorded with a verifiable reference; user sees a receipt;
+ server logs enough to reconcile.
+5. **Discovery:** confirm our paid endpoints are correctly described and indexable (run the verifier);
+ `402` responses return correct PaymentRequired payloads (v2 transport) for MCP + HTTP.
+6. **Tests:** unit tests for amount math + currency + recovery paths; an E2E that pays a real endpoint
+ on a test path; never reference any non-$THREE token in any fixture.
+
+## Acceptance
+- Every paid flow verified end-to-end with real USDC settlement; provably no double-charge under retry.
+- Malformed-RPC / timeout / congestion handled with clear UX; receipts + reconciliation records exist.
+- Discovery verifier passes; `402` payloads correct; tests green; changelog for visible changes.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. No mocks of payment logic; settle in USDC. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`) — never reference another token, even in fixtures. Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles (`__defProp`/`createRequire`) — recover with `git restore -- api/ public/`. User-visible change → `data/changelog.json` + `npm run build:pages`. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/28-wallet-connect-funding.md b/prompts/28-wallet-connect-funding.md
new file mode 100644
index 000000000..f510f2e26
--- /dev/null
+++ b/prompts/28-wallet-connect-funding.md
@@ -0,0 +1,32 @@
+# 28 · Wallet Connect & Funding Flows
+
+## Mission
+Connecting a wallet, checking balances, funding (onramp/deposit), sending, and trading must be smooth
+and trustworthy across Solana (default) and Base/EVM (secondary), for both humans and agents.
+
+## Context
+- Solana is the platform-wide default network; Base/EVM secondary (team memory).
+- Flows surface the skills: `authenticate-wallet`, `fund`, `send-usdc`, `trade`; MetaMask agent CLI
+ skills exist; agent wallet bridge (`scripts/agent-wallet-x402-bridge.mjs`, `npm run smoke:agent-wallet`).
+- Connect entry points: top-nav, forge perk row, marketplace checkout, dashboard account.
+
+## Tasks
+1. **Connect:** every connect entry point works, shows connected state + address + balance, and
+ persists across pages; disconnect works. Failures (no extension, rejected, wrong network) handled.
+2. **Network correctness:** Solana default; Base/EVM where applicable; clear network labeling; no
+ silent wrong-network sends.
+3. **Funding:** onramp / deposit / buy-USDC flows complete with clear status; insufficient-balance
+ states guide the user to fund before send/trade.
+4. **Send/trade:** USDC/SOL/ETH/POL sends + swaps work with confirmation, fee disclosure, and receipts;
+ address/ENS/SNS resolution correct (`ens_sns_resolve`, `*.threews.sol`).
+5. **Agent wallets:** the agent wallet bridge + smoke (`npm run smoke:agent-wallet`) pass; agents can
+ pay via x402 using their wallet.
+6. **Security:** never expose private keys client-side; sign flows safe; confirm amounts before signing.
+
+## Acceptance
+- Connect/disconnect + balance + funding + send + trade all work on Solana (and Base where supported).
+- Insufficient-balance + wrong-network + rejected-signature states designed; receipts shown.
+- `npm run smoke:agent-wallet` passes; clean console; changelog for visible changes.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. Solana is the default network. No mocks of wallet/tx logic. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`); settlement in USDC. Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. User-visible change → `data/changelog.json` + `npm run build:pages`. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/29-pumpfun-launches.md b/prompts/29-pumpfun-launches.md
new file mode 100644
index 000000000..83c74daf7
--- /dev/null
+++ b/prompts/29-pumpfun-launches.md
@@ -0,0 +1,33 @@
+# 29 · Pump.fun Launches & Token Tooling
+
+## Mission
+The launch pipeline (create a coin via three.ws, optional atomic dev-buy/snipe, launch directory)
+must be safe, accurate, and reliable — with the platform itself only ever promoting $THREE.
+
+## Context
+- Pump.fun feed + Solana RPC are real APIs (never mock). Launcher accepts an arbitrary mint at
+ runtime (allowed plumbing). Launch directory renders user-launched coins from platform records
+ (`/launches`, `/api/pump/launches`, `pump_agent_mints`) — allowed runtime data only.
+- Tooling: `packages/pumpfun-mcp`, `npm run pump:smoke`, `npm run pump:refresh-idls`,
+ workers `worker:sniper` / `deploy:sniper`. Atomic launch+first-buy in one Jito bundle (recent).
+
+## Tasks
+1. **Launch flow:** create-token works end-to-end with correct fees/rent, metadata, and confirmation;
+ designed states; clear errors on RPC/congestion failure.
+2. **Atomic dev-buy/snipe:** first-buy lands in the same tx/bundle as the mint; spend caps + slippage
+ enforced; funder covers rent + buy; no path that overspends or double-submits.
+3. **Launch directory:** renders real launch records; each entry links to agent profile/launch history;
+ never hardcodes or recommends a specific non-$THREE mint anywhere in source or copy.
+4. **Coin-policy guard:** audit the entire launch surface + copy + tests so the platform only ever
+ *promotes* $THREE; arbitrary mints appear strictly as runtime user data.
+5. **Resilience:** RPC failover/retry; IDL freshness (`pump:refresh-idls`); smoke test green
+ (`npm run pump:smoke`).
+6. **Sniper worker:** dry-run vs live clearly separated; caps enforced; deploy runbook documented.
+
+## Acceptance
+- Launch (+ optional atomic dev-buy) succeeds on a real path with caps/slippage enforced.
+- Directory shows real records with correct links; coin-policy audit clean (only $THREE promoted).
+- `npm run pump:smoke` green; sniper dry/live separated + documented; changelog for visible changes.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. Never mock pump.fun/Solana RPC. $THREE is the only coin the platform promotes (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`); arbitrary mints only as runtime user input/launch records — never hardcode/recommend one. Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. User-visible change → `data/changelog.json` + `npm run build:pages`. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/30-three-holder-gating.md b/prompts/30-three-holder-gating.md
new file mode 100644
index 000000000..368c5ba4c
--- /dev/null
+++ b/prompts/30-three-holder-gating.md
@@ -0,0 +1,32 @@
+# 30 · $THREE Holder Gating — Consistency & Correctness
+
+## Mission
+$THREE holder perks (e.g. Forge high-quality, free-generation multipliers, premium features) must be
+gated consistently and correctly everywhere, with a clean unlock/upsell path and a wallet-aware access matrix.
+
+## Context
+- $THREE CA: `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`. Perks appear in Forge (quality tiers,
+ "hold for up to 10× free generations"), and likely other premium surfaces.
+- Wallet-aware access matrix drives perk lines + connect-wallet CTAs (e.g. `updatePerkLine` in forge).
+
+## Tasks
+1. **Inventory perks:** list every feature gated by $THREE holding (threshold, benefit). Confirm each
+ reads from one canonical access-matrix/util, not ad-hoc per-surface logic.
+2. **Correct balance checks:** holdings read from the real on-chain balance (Solana); thresholds
+ correct; caching sane; refresh on wallet change.
+3. **Unlock + upsell UX:** non-holders see a non-blocking upsell + a reachable connect-wallet path;
+ holders who haven't connected can reveal their perk; states never dead-end.
+4. **Pay-per-use alternative:** where a perk is also pay-per-use (e.g. Forge high quality), the x402
+ path works as an alternative to holding.
+5. **Consistency:** identical thresholds + messaging across surfaces; no surface that ignores gating or
+ gates differently.
+6. **Tests:** unit-test the access matrix (holder/non-holder/threshold-edge/disconnected); never
+ reference any non-$THREE token.
+
+## Acceptance
+- One canonical gating util used everywhere; thresholds + copy consistent across all gated surfaces.
+- Holder/non-holder/pay-per-use paths all work; perk lines + connect CTAs correct and reachable.
+- Access-matrix tests green; clean console; changelog for visible changes.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`) — never reference another token. No mocks of balance/gating logic. Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. User-visible change → `data/changelog.json` + `npm run build:pages`. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/31-mcp-servers.md b/prompts/31-mcp-servers.md
new file mode 100644
index 000000000..d455ff084
--- /dev/null
+++ b/prompts/31-mcp-servers.md
@@ -0,0 +1,34 @@
+# 31 · MCP Servers — Production Hardening
+
+## Mission
+Every published MCP server is correct, documented, paid-where-stated, and verifiably working against
+its remote — so external agents can rely on three.ws tools.
+
+## Context
+- Servers: `mcp-server/`, `mcp-bridge/`, `packages/*-mcp/` (avatar-agent, pumpfun, ibm-watsonx,
+ ibm-x402, three-token, threews-avatar). Tooling: `npm run audit:mcp`, `smoke:mcp`, `test:mcp`,
+ `publish:mcp(:dry)`.
+- Local server exposes paid tools (each quotes USDC price; `_meta` x402 payload) + one free tool
+ (`forge_free`). Paid calls without payment return PaymentRequired structuredContent (v2 transport).
+
+## Tasks
+1. **Manifest audit:** `npm run audit:mcp` clean — names, descriptions, prices (USDC), and the v2
+ PaymentRequired behavior correct for every paid tool; the free tool needs no payment/key.
+2. **Remote smoke + tests:** `npm run smoke:mcp` and `npm run test:mcp` green against live remotes;
+ document required env/creds; note any tool that needs interactive auth (may be absent headless).
+3. **Tool correctness:** each tool's inputs/outputs match its schema and actually perform the action
+ (forge_free returns a real GLB + viewer link; avatar/rig/mesh tools produce real assets; reads
+ return real data). No stubbed tools.
+4. **Errors:** invalid input → structured error; payment-required → correct 402 payload; never a crash.
+5. **Docs + publishing:** each server's README accurate (install, auth, tools, pricing); `publish:mcp:dry`
+ clean; versions consistent.
+6. **Coin policy:** any token-related tool references only $THREE / runtime-supplied mints; never
+ hardcodes another token.
+
+## Acceptance
+- `audit:mcp`, `smoke:mcp`, `test:mcp` all green; `publish:mcp:dry` clean.
+- Every tool performs its real action; paid tools return correct 402 payloads; free tool needs no key.
+- READMEs accurate; coin policy clean.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. No stubbed tools/mocks; real actions + real data. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`); pricing in USDC. Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. User-visible change → `data/changelog.json` + `npm run build:pages`. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/32-published-sdks-docs.md b/prompts/32-published-sdks-docs.md
new file mode 100644
index 000000000..37ea16954
--- /dev/null
+++ b/prompts/32-published-sdks-docs.md
@@ -0,0 +1,32 @@
+# 32 · Published SDKs — Quality, Types & Docs
+
+## Mission
+Every published package is something an external developer can adopt in minutes: clean API, correct
+types, accurate README, working examples, and a verified build/publish path.
+
+## Context
+- Published: `@three-ws/avatar` (avatar-sdk), `@three-ws/walk` (walk-sdk), `@three-ws/page-agent`
+ (page-agent-sdk), `@three-ws/agent-payments`, `@three-ws/agent-protocol-sdk`, `@three-ws/sdk`,
+ `@three-ws/solana-agent`, plus `packages/*` (avatar-schema, avatar-cli, viewer-presets) and MCP servers.
+- Tooling: `npm run publish:packages(:dry)`, `publish:lib`, `build:lib`; web component `<agent-3d>`.
+
+## Tasks
+1. **API surface review:** each SDK has a coherent, documented public API; no leaking internals; stable
+ exports; semver-appropriate versions.
+2. **Types:** TypeScript types/`.d.ts` correct and shipped; `npm run typecheck` clean for consumers;
+ subpath exports (e.g. avatar `/react`, `/creator`, `/viewer`) resolve.
+3. **READMEs + examples:** install → minimal working example → API reference for each package. Verify
+ the example actually runs (embed `<agent-3d>` and `@three-ws/walk` on a bare HTML page).
+4. **Build/publish dry-run:** `npm run publish:packages:dry` and `publish:mcp:dry` clean; no missing
+ files, no accidental private code shipped, correct `files`/`exports`/`main`/`module`/`types`.
+5. **Examples dir:** `examples/` demos load and work (`embed-test`, `web-component`, `two-agents`,
+ `minimal`).
+6. **Versioning + changelog:** per-package changelogs/versions consistent; breaking changes called out.
+
+## Acceptance
+- Each published package: correct types, accurate README, a verified working example.
+- `publish:packages:dry` + `publish:mcp:dry` clean; subpath exports resolve; `examples/` all work.
+- No private/internal code leaks into published artifacts.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. No mocks/fake data/stubs in examples — real, runnable. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. Keep forks (character-studio, agent-payments-sdk) cleanly attributed. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/33-onchain-contracts.md b/prompts/33-onchain-contracts.md
new file mode 100644
index 000000000..e8129d7b6
--- /dev/null
+++ b/prompts/33-onchain-contracts.md
@@ -0,0 +1,32 @@
+# 33 · On-Chain Contracts — Review & Test
+
+## Mission
+The on-chain programs (agent identity, skill licenses, agent invocation) must be correct, tested, and
+safe before they secure real value.
+
+## Context
+- `contracts/` (Foundry, ERC-8004 agent identity), `contracts/skill-license/` (Anchor: each skill =
+ 1/1 SPL NFT + `SkillLicense` PDA; backend `api/_lib/skill-license-onchain.js`),
+ `contracts/agent-invocation/` (Anchor: verifiable A2A invocation events; SDK `agent-protocol-sdk/`).
+- Parity verifiers: `npm run verify:onchain`, `npm run smoke:onchain`, `npm run verify:solana`.
+
+## Tasks
+1. **Test coverage:** unit + integration tests for each program — minting, ownership/transfer, access
+ checks, invocation event verification, failure/permission cases. Run the Foundry + Anchor suites.
+2. **Security review:** access control, signer checks, PDA derivation, reentrancy/replay (where
+ relevant), arithmetic safety, upgrade authority. Document trust assumptions.
+3. **Backend parity:** the DB-backed access checks and the on-chain `SkillLicense` checks agree;
+ `verify:onchain` / `smoke:onchain` / `verify:solana` pass.
+4. **Deployment:** documented, reproducible deploy with addresses recorded; IDLs current and committed
+ where the app depends on them.
+5. **Gas/cost:** reasonable compute/rent; no pathological costs.
+6. **Coin policy:** nothing references a non-$THREE token; test fixtures use $THREE CA or a clearly
+ synthetic placeholder — never a real third-party mint.
+
+## Acceptance
+- Foundry + Anchor test suites pass with meaningful coverage incl. failure cases.
+- Security review documented; backend↔on-chain parity verified by the smoke/verify scripts.
+- Deploy reproducible + addresses/IDLs recorded; fixtures coin-policy clean.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. No real third-party mints in tests/fixtures — use $THREE (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`) or a synthetic placeholder. No mocks of on-chain logic in integration tests. Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/34-solana-base-parity.md b/prompts/34-solana-base-parity.md
new file mode 100644
index 000000000..6ca14f8ff
--- /dev/null
+++ b/prompts/34-solana-base-parity.md
@@ -0,0 +1,29 @@
+# 34 · Solana / Base Parity & Cross-Chain Correctness
+
+## Mission
+Where the platform supports both chains, behavior must be correct and consistent — Solana as the
+default, Base/EVM as a well-behaved secondary — with no silent divergence.
+
+## Context
+- Solana is the platform-wide default; Base/EVM secondary (team memory). Cross-chain SDKs:
+ `sdk/`, `solana-agent-sdk/`, `agent-payments-sdk/`, `agent-protocol-sdk/`.
+- Parity tooling: `npm run verify:solana`, `npm run verify:onchain`, `npm run smoke:onchain`.
+
+## Tasks
+1. **Default correctness:** Solana is the default everywhere a chain is chosen implicitly; Base/EVM is
+ opt-in and clearly labeled; no surface silently defaults to the wrong chain.
+2. **Feature parity matrix:** for each cross-chain capability (pay, send, name resolution, identity),
+ document what's supported on each chain and ensure the UI only offers what actually works.
+3. **Parity verifiers:** `verify:solana` / `verify:onchain` / `smoke:onchain` pass; fix divergences.
+4. **Address/name handling:** correct validation + resolution per chain (SNS `*.threews.sol` on
+ Solana, ENS on EVM); no cross-chain address confusion.
+5. **Errors:** chain-specific failures (RPC, congestion, wrong network) handled with clear messaging.
+6. **Docs:** a cross-chain support matrix in `docs/` so users + integrators know what works where.
+
+## Acceptance
+- Solana default honored platform-wide; Base/EVM opt-in + correctly scoped.
+- Parity verifiers pass; UI offers only working capabilities per chain; address/name handling correct.
+- Cross-chain support matrix documented.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. Solana is the default network. No mocks of chain logic. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`); settlement in USDC. Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. User-visible change → `data/changelog.json` + `npm run build:pages`. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/35-api-rate-limiting-abuse.md b/prompts/35-api-rate-limiting-abuse.md
new file mode 100644
index 000000000..717c82e27
--- /dev/null
+++ b/prompts/35-api-rate-limiting-abuse.md
@@ -0,0 +1,30 @@
+# 35 · API Rate Limiting & Abuse Protection
+
+## Mission
+Protect every public endpoint from abuse, scraping, spam, and cost-explosion (LLM/3D generation are
+expensive) — without harming legitimate users.
+
+## Context
+- Vercel functions in `api/`, workers in `workers/`. Expensive endpoints: forge generation, avatar
+ generation, TTS, LLM proxies, x402 settlement, pump launches.
+- Some abuse-prone endpoints may already have ad-hoc limits — unify them.
+
+## Tasks
+1. **Inventory + classify** every `api/*` endpoint by cost + abuse risk (free/cheap/expensive/mutating).
+2. **Rate limiting:** apply consistent, configurable limits (per-IP + per-account + per-wallet where
+ relevant) via one shared utility — not ad-hoc per file. Sensible 429s with `Retry-After`.
+3. **Quotas:** enforce free-generation quotas + $THREE-holder multipliers server-side (don't trust the
+ client); coordinate with gating (prompt 30).
+4. **Abuse defenses:** bot/spam protection on public write endpoints (uploads, reviews, launches);
+ captcha/proof-of-work or signed-request where appropriate; size/type limits on uploads.
+5. **Cost guards:** hard ceilings on expensive operations; circuit-breakers when upstream providers
+ error or costs spike; graceful "try again / use free lane" UX.
+6. **Observability hooks:** emit rate-limit + quota events (coordinate with prompt 36) to spot abuse.
+
+## Acceptance
+- One shared rate-limit/quota utility applied across all public endpoints; correct 429 + Retry-After.
+- Quotas + holder multipliers enforced server-side; uploads/writes bounded + protected.
+- Cost ceilings + circuit-breakers in place; abuse events observable; legitimate flows unaffected.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. No mocks/fake data/stubs. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles (`__defProp`/`createRequire`) — recover with `git restore -- api/ public/`. User-visible change → `data/changelog.json` + `npm run build:pages`. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/36-observability-logging-alerting.md b/prompts/36-observability-logging-alerting.md
new file mode 100644
index 000000000..f80eea97e
--- /dev/null
+++ b/prompts/36-observability-logging-alerting.md
@@ -0,0 +1,31 @@
+# 36 · Observability — Logging, Metrics, Errors, Alerting
+
+## Mission
+When something breaks in production, we know before users tell us, and we can diagnose it fast.
+Structured logs, error tracking, key metrics, and alerts on the flows that matter (payments, generation, auth).
+
+## Context
+- `api/client-errors` endpoint exists for client error reporting. Usage events flushed via
+ `api/cron/flush-usage-events` (cron). Workers run oracle/sniper.
+
+## Tasks
+1. **Client errors:** ensure the global error/unhandledrejection handlers (prompt 08) report to
+ `/api/client-errors` with enough context (route, user agent, release), and that those land somewhere
+ queryable. Add release/version tagging.
+2. **Server logs:** structured, leveled logs in `api/` + `workers/` (no `console.log` soup, no secret
+ leakage); request IDs to correlate; consistent error logging at boundaries.
+3. **Key metrics:** instrument the money/critical flows — payment success/failure, generation
+ success/latency/cost, auth success/failure, rate-limit hits, queue depth. Wire to usage events.
+4. **Alerting:** define alerts/thresholds for payment failure spikes, generation error rate, auth
+ failures, 5xx rate, cron failures; document where alerts go.
+5. **Dashboards:** a minimal ops dashboard or documented queries for the above.
+6. **Cron health:** verify the cron jobs (flush-usage-events, auto-rig-sweep, smart-money-rollup, etc.)
+ succeed and surface failures.
+
+## Acceptance
+- Client + server errors are captured, release-tagged, and queryable; no secret leakage in logs.
+- Money/critical flows emit metrics; alerts defined with thresholds + destinations documented.
+- Cron jobs monitored; a runbook (`docs/ops/observability.md`) explains how to diagnose incidents.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. No mocks/fake data/stubs; logs must never leak secrets. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/37-ci-cd-gates.md b/prompts/37-ci-cd-gates.md
new file mode 100644
index 000000000..f85d49778
--- /dev/null
+++ b/prompts/37-ci-cd-gates.md
@@ -0,0 +1,31 @@
+# 37 · CI/CD Pipeline & Quality Gates
+
+## Mission
+Make it impossible to ship broken: a fast, reliable CI pipeline that runs lint, types, tests, audits,
+and build on every change, and a safe deploy path to Vercel for both mirrors.
+
+## Context
+- Scripts: `lint`, `typecheck`, `test`/`test:core`/`test:gate`, `test:e2e`, `audit:web`,
+ `audit:pages`, `audit:handlers`, `check:images`, `audit:deploy`, `verify`, `build`.
+- Two GitHub remotes: `threeD` (push-only mirror), `threews` (canonical). Deploy: `npm run deploy`.
+
+## Tasks
+1. **CI workflow:** a GitHub Actions (or equivalent) pipeline that on PR/push runs: install →
+ `lint` → `typecheck` → `test:gate` → `test:core` → page/handler/image audits → `build`. Fast,
+ cached, parallelized where possible. Fail the build on any gate failure.
+2. **E2E in CI:** run `test:e2e` (Playwright) on a built preview; provide required secrets via CI env;
+ mark which specs need creds.
+3. **Pre-commit/pre-push hooks:** lightweight local hooks (format check, lint-staged, the esbuild-trap
+ guard from prompt 04) — documented, opt-in friendly.
+4. **Deploy safety:** document/automate the deploy so it runs `check:dist` + `audit:deploy` before
+ `vercel --prod`; ensure both mirrors stay in sync (push `threeD` and `threews`); never force-push.
+5. **Status checks:** required checks on the canonical repo before merge; coin-policy + secret scan in CI.
+6. **Reproducibility:** pin tool versions; document Node version; cache `node_modules`/build artifacts.
+
+## Acceptance
+- CI runs lint+types+tests+audits+build on every PR and blocks on failure; E2E runs on a preview.
+- Pre-commit/pre-push hooks documented incl. esbuild-trap + secret/coin-policy scan.
+- Deploy path documented + safe; both mirrors stay in sync; runbook in `docs/ops/ci-cd.md`.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. No mocks/fake data/stubs. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. Push to BOTH remotes (`git push threeD main && git push threews main`); never pull/fetch/merge from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/38-database-migrations.md b/prompts/38-database-migrations.md
new file mode 100644
index 000000000..19e896269
--- /dev/null
+++ b/prompts/38-database-migrations.md
@@ -0,0 +1,30 @@
+# 38 · Database Migrations & Data Integrity
+
+## Mission
+The data layer is correct, migratable, backed up, and consistent — no orphaned records, no drift
+between schema and code, no destructive migration without a path back.
+
+## Context
+- Migration tooling: `npm run db:migrate` (`scripts/apply-migrations.mjs --apply`), `npm run db:status`.
+- Data backs avatars, agents, skills, licenses, usage events, launches, reviews, notifications.
+
+## Tasks
+1. **Schema ↔ code parity:** confirm every table/column the code reads/writes exists and matches;
+ `npm run db:status` clean; no pending/unapplied migrations on the deploy path.
+2. **Migration safety:** migrations are idempotent + reversible (or have a documented forward-fix);
+ no destructive change without backup + rollback notes; additive-first.
+3. **Integrity:** foreign keys / constraints / indexes for hot queries; no orphaned rows (e.g. avatars
+ without owners, licenses without items); add constraints where missing.
+4. **Ownership invariants:** enforce `owner_id` and access invariants at the DB level where feasible
+ (defense in depth with the API checks from prompt 14).
+5. **Backups + retention:** document backup cadence + restore procedure; data retention for usage
+ events; PII handling aligned with the privacy policy (prompt 44).
+6. **Performance:** index the queries that power dashboards/galleries/marketplace; check slow queries.
+
+## Acceptance
+- `db:status` clean; migrations idempotent + reversible/forward-fixable; additive-first.
+- Integrity constraints + indexes in place; no orphaned records in the critical tables.
+- Backup/restore + retention documented in `docs/ops/data.md`.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. No mocks/fake data/stubs; never run a destructive migration without backup + rollback. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/39-load-stress-testing.md b/prompts/39-load-stress-testing.md
new file mode 100644
index 000000000..e4a24e139
--- /dev/null
+++ b/prompts/39-load-stress-testing.md
@@ -0,0 +1,29 @@
+# 39 · Load & Stress Testing
+
+## Mission
+Know the platform's limits before users find them. Load-test the hot paths, find the breaking points,
+and fix or document the scaling story so a launch spike doesn't take us down.
+
+## Context
+- Hot paths: page loads (static + SSR-ish), forge/avatar generation (expensive, upstream-bound),
+ x402 settlement, auth, galleries/marketplace reads, multiplayer rooms (Colyseus), MCP remotes.
+
+## Tasks
+1. **Define SLOs:** target p50/p95 latency + error rate + concurrency for each hot path.
+2. **Load scripts:** build repeatable load tests (k6/artillery or a Node harness in `scripts/`) for the
+ read paths and the generation/payment paths (against a staging/test environment + free lanes).
+3. **Find limits:** ramp concurrency until SLOs break; record where + why (DB, RPC, provider rate
+ limits, function cold starts, memory). Capture the breaking point per path.
+4. **Fix the cheap wins:** caching, connection pooling, batching, queueing for expensive jobs,
+ backpressure; ensure rate limits (prompt 35) shed load gracefully rather than collapsing.
+5. **Multiplayer:** stress Colyseus rooms with many concurrent clients; verify stability + memory.
+6. **Document scaling:** a `docs/ops/scaling.md` with measured limits, current headroom, and the plan
+ for the next 10×.
+
+## Acceptance
+- Load tests exist + are repeatable; measured p50/p95/error/concurrency per hot path vs SLOs.
+- Breaking points documented; cheap wins applied; load shed gracefully under overload (no cascade).
+- `docs/ops/scaling.md` captures limits + headroom + next-10× plan.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. Load-test only our own infra (staging/test env + free lanes) — no third-party targeting. No mocks/fake data/stubs. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Put harnesses in `scripts/`, not the repo root. Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/40-caching-cdn-assets.md b/prompts/40-caching-cdn-assets.md
new file mode 100644
index 000000000..95a6730fe
--- /dev/null
+++ b/prompts/40-caching-cdn-assets.md
@@ -0,0 +1,30 @@
+# 40 · Caching, CDN & Asset Delivery
+
+## Mission
+Assets (GLBs, textures, animations, images, JS) load fast worldwide with correct cache headers,
+immutable hashing, and a healthy CDN/R2 setup — and never serve stale HTML.
+
+## Context
+- `vercel.json` has an asset cache route (`max-age=604800, stale-while-revalidate=2592000` for
+ media). R2 storage + CORS (`npm run apply:r2-cors`, `scripts/set-r2-cors.mjs`). Three.js decoders
+ copied via `scripts/copy-three-decoders.mjs`. GLB optimize/compress scripts exist.
+
+## Tasks
+1. **Cache headers:** hashed/immutable assets → `immutable, max-age=31536000`; HTML → revalidate (no
+ stale pages); media → the long SWR policy. Audit + fix headers per asset class in `vercel.json`.
+2. **R2/CDN:** verify R2 CORS is correct (`apply:r2-cors`), assets are reachable cross-origin, and
+ user-generated GLBs are served efficiently with correct content types + caching.
+3. **Asset optimization:** run `optimize:glb`/`compress:glbs`; ensure shipped GLBs are compressed
+ (meshopt/Draco/KTX2 as appropriate) and decoders are present (`copy-three-decoders`).
+4. **Preload/preconnect:** preconnect to asset origins; preload the LCP asset per key page (coordinate
+ with prompt 11).
+5. **Cache busting:** confirm deploys invalidate HTML/JSON appropriately; no users stuck on old bundles.
+6. **Fallbacks:** asset-origin failure degrades gracefully (default avatar/rig), never a hard break.
+
+## Acceptance
+- Correct cache headers per asset class; HTML never served stale; immutable assets cached a year.
+- R2 CORS + content types correct; user GLBs served efficiently; decoders present.
+- Assets optimized/compressed (document size deltas); LCP asset preloaded; graceful asset-failure fallback.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. No mocks/fake data/stubs. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. `vercel.json` changes are deploy-time. User-visible change → `data/changelog.json` + `npm run build:pages`. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/41-uptime-health-status.md b/prompts/41-uptime-health-status.md
new file mode 100644
index 000000000..71298a35e
--- /dev/null
+++ b/prompts/41-uptime-health-status.md
@@ -0,0 +1,30 @@
+# 41 · Uptime, Health Checks & Status Page
+
+## Mission
+The platform stays up, knows when it isn't, and tells users honestly. Health checks on every critical
+dependency, automated uptime monitoring, and a public status page.
+
+## Context
+- Dependencies: Vercel functions, DB, Solana RPC, x402 settlement, LLM/3D providers (NVIDIA NIM,
+ Anthropic/OpenAI proxies, Meshy/Tripo/etc.), TTS, R2, multiplayer server, MCP remotes.
+
+## Tasks
+1. **Health endpoints:** a `/api/health` (and per-subsystem checks) that verifies DB, RPC, provider
+ reachability, and returns structured status — without leaking secrets or doing expensive work.
+2. **Uptime monitoring:** external monitors on the homepage, key APIs, MCP remotes, and the
+ multiplayer server; alert on downtime (coordinate with prompt 36 alerting).
+3. **Dependency degradation:** when a provider is down, the UI shows the right state (engine
+ "unavailable", "try the free lane", "payments temporarily unavailable") instead of failing hard.
+4. **Status page:** a public status page (or integrate a provider) reflecting subsystem health +
+ incident history; link it from the footer.
+5. **Smoke checks:** wire `smoke:mcp`, `smoke:onchain`, `smoke:agent-wallet`, `pump:smoke` into a
+ scheduled health run; surface failures.
+6. **Incident runbook:** `docs/ops/incidents.md` — who, what, how to triage common outages.
+
+## Acceptance
+- `/api/health` + per-subsystem checks return accurate status; external uptime monitors + alerts live.
+- Provider-down states degrade gracefully in the UI; public status page live + linked.
+- Scheduled smoke checks running; incident runbook documented.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. No mocks/fake data/stubs; health checks must reflect reality and never leak secrets. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. User-visible change → `data/changelog.json` + `npm run build:pages`. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/42-homepage-conversion.md b/prompts/42-homepage-conversion.md
new file mode 100644
index 000000000..54be3ca0e
--- /dev/null
+++ b/prompts/42-homepage-conversion.md
@@ -0,0 +1,32 @@
+# 42 · Homepage & Conversion Optimization
+
+## Mission
+The homepage must instantly communicate what three.ws is, prove it with a live demo, and convert
+visitors into agent-builders. This is the top of the funnel — make it world-class.
+
+## Context
+- Homepage + landing surfaces (`src/dashboard-next/pages/home.js` for the signed-in home; public
+ landing in `pages/` + `src/`). Live demos: `<agent-3d>`, walk companion, "Made with Forge" strip.
+- i18n live (language picker, Spanish). Recent: "Made with Forge" strip fixed to show live models.
+
+## Tasks
+1. **Clear value prop:** above-the-fold answers "what is this + why care + what do I do next" in
+ seconds; a single primary CTA (Create your agent) and a secondary (see it / try Forge).
+2. **Live proof:** a real, performant interactive demo (a live agent / walk companion / forge strip)
+ that loads fast and never shows placeholder voids.
+3. **Conversion path:** every section drives toward create/onboarding; remove dead ends; strong
+ social proof (real numbers/launches/creations, not fabricated stats).
+4. **Performance:** the homepage is the most-measured page — green CWV (coordinate with prompt 11),
+ minimal JS above the fold, lazy demos.
+5. **Trust + clarity:** $THREE positioned correctly (the one coin), pricing/onramp clarity, footer
+ with docs/status/legal/social.
+6. **A/B-ready:** instrument the primary CTA + hero variants (coordinate with prompt 45) so conversion
+ can be measured + improved.
+
+## Acceptance
+- Above-the-fold communicates value + has a clear primary CTA; live demo loads fast, no voids.
+- Every section routes toward onboarding; social proof is real; green CWV on the homepage.
+- CTA/hero instrumented for measurement; clean console; responsive; changelog for visible changes.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. No mocks/fake data/fabricated stats. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. User-visible change → `data/changelog.json` + `npm run build:pages`. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/43-docs-completeness.md b/prompts/43-docs-completeness.md
new file mode 100644
index 000000000..205d2ff8e
--- /dev/null
+++ b/prompts/43-docs-completeness.md
@@ -0,0 +1,29 @@
+# 43 · Documentation Completeness
+
+## Mission
+A developer or user can accomplish anything on three.ws by reading the docs — every API, SDK, MCP
+tool, embed, and concept is documented accurately with working examples.
+
+## Context
+- Docs surfaces (`/docs`), tutorials (e.g. `/tutorials/*`), API reference, SDK READMEs, MCP docs,
+ `specs/`, `STRUCTURE.md`. The MCP HTTP surface is `/api/mcp-3d`.
+
+## Tasks
+1. **API reference:** document every public `api/*` endpoint actually meant for external use — method,
+ params, auth, x402 pricing, responses, errors, examples. Mark internal-only endpoints as such.
+2. **SDK docs:** ensure each published SDK (prompt 32) has install + quickstart + reference, and the
+ docs site links them. Embed guide for `<agent-3d>` + `@three-ws/walk` + `@three-ws/page-agent`.
+3. **MCP docs:** document every tool (free `forge_free` + paid), pricing, payment flow, and how to
+ connect a client; keep in sync with `audit:mcp`.
+4. **Tutorials:** end-to-end guides for the core jobs (create an agent, forge a model, embed an agent,
+ monetize a skill, launch a coin, use memories). Each verified by following it.
+5. **Concepts:** explain $THREE, x402, ERC-8004 identity, skill licenses, avatars/rigs — accurately.
+6. **Freshness:** every code sample runs; no stale endpoints/params; a docs lint/check where possible.
+
+## Acceptance
+- Every external API/SDK/MCP tool documented with a working, verified example.
+- Core tutorials exist + were followed successfully; concepts explained correctly.
+- No stale samples; docs link the published packages; changelog (docs) entry for notable additions.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. No fake/sample-only docs — every example runs. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. User-visible change → `data/changelog.json` + `npm run build:pages`. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/44-legal-compliance.md b/prompts/44-legal-compliance.md
new file mode 100644
index 000000000..a1e3993d4
--- /dev/null
+++ b/prompts/44-legal-compliance.md
@@ -0,0 +1,31 @@
+# 44 · Legal, Privacy & Compliance
+
+## Mission
+Ship the legal and compliance foundation a serious platform needs: Terms of Service, Privacy Policy,
+cookie/consent handling, content policy, and clear disclaimers — accurate to what the product does.
+
+## Context
+- Platform handles accounts, wallets, payments (USDC/x402), user-generated 3D content, token launches,
+ and AI generation. i18n live. $THREE is the only coin promoted.
+
+## Tasks
+1. **Core policies:** Terms of Service, Privacy Policy, and a Content/Acceptable-Use Policy as real,
+ reachable pages (footer + signup). Reflect actual data flows (what's collected, why, retention,
+ third parties: providers, RPC, analytics).
+2. **Cookie/consent:** consent mechanism for analytics/tracking where required; honor opt-out; no
+ non-essential tracking before consent.
+3. **Disclaimers:** crypto/token risk disclaimers where coins/launches appear; AI-content disclaimer;
+ "not financial advice." $THREE referenced correctly; no implied guarantees.
+4. **User content + IP:** clear ownership/licensing terms for generated avatars/models; DMCA/abuse
+ reporting path; respect upstream licenses (character-studio MIT, three.js, Mixamo terms).
+5. **Data rights:** account deletion + data export paths (coordinate with prompt 38 retention); PII
+ minimization.
+6. **Accessibility statement** + contact; link everything from the footer.
+
+## Acceptance
+- ToS, Privacy, Content policy live + accurate + linked; consent handling correct.
+- Risk/AI disclaimers present where needed; user-content IP terms clear; DMCA/abuse path exists.
+- Account deletion + data export work; upstream licenses respected; footer links complete.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. Policies must reflect reality — no placeholder legalese that misstates the product. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`); never reference another token. Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. User-visible change → `data/changelog.json` + `npm run build:pages`. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist. (This is product/legal scaffolding, not legal advice — flag anything that needs counsel review.)
diff --git a/prompts/45-analytics-funnels.md b/prompts/45-analytics-funnels.md
new file mode 100644
index 000000000..81b7f6155
--- /dev/null
+++ b/prompts/45-analytics-funnels.md
@@ -0,0 +1,31 @@
+# 45 · Analytics & Conversion Funnels
+
+## Mission
+Measure what matters so growth is data-driven: instrument acquisition → activation → revenue →
+retention, with privacy-respecting analytics and honest dashboards.
+
+## Context
+- Usage events pipeline exists (`api/cron/flush-usage-events`). Onboarding wizard (prompt 22) and
+ homepage (prompt 42) are the key funnels. Consent handling from prompt 44.
+
+## Tasks
+1. **Event taxonomy:** define a clean, documented event schema (names, props) for the core funnels:
+ landing → signup → avatar created → agent created → embed deployed → first payment → repeat use.
+ Avoid event sprawl; one source of truth.
+2. **Instrumentation:** emit those events from the real flows (non-blocking, consent-gated). Reuse the
+ usage-events pipeline rather than bolting on a second system where possible.
+3. **Funnels + retention:** build (or wire a provider for) funnel + cohort/retention views for the core
+ journeys; surface drop-off points.
+4. **Revenue analytics:** track payment volume, conversion to paid, $THREE-perk usage, creator earnings
+ — tied to real settlement data, not estimates.
+5. **Privacy:** respect consent + Do-Not-Track; no PII in analytics; document what's collected (sync
+ with prompt 44).
+6. **Actionability:** a dashboard the team checks daily; alert on funnel regressions (sync prompt 36).
+
+## Acceptance
+- Documented event taxonomy emitted from real flows, consent-gated + non-blocking.
+- Funnel + retention + revenue views exist and reflect real data; drop-off visible.
+- No PII in analytics; collection documented; regression alerts wired.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. No fabricated metrics; analytics reflect real events. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. User-visible change → `data/changelog.json` + `npm run build:pages`. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/46-notifications-email.md b/prompts/46-notifications-email.md
new file mode 100644
index 000000000..96459df4e
--- /dev/null
+++ b/prompts/46-notifications-email.md
@@ -0,0 +1,32 @@
+# 46 · Notifications & Transactional Email
+
+## Mission
+Keep users informed and re-engaged: in-app notifications + reliable transactional email (and the
+holders' changelog channel) that are timely, correct, and respectful of preferences.
+
+## Context
+- In-app notifications: `/api/notifications` (`unread_count`), topbar bell + activity drawer.
+- Transactional emails exist (recent commit). Holders' changelog → Telegram via
+ `npm run changelog:push` (`scripts/changelog-telegram.mjs`, needs `TELEGRAM_BOT_TOKEN` +
+ `TELEGRAM_CHANGELOG_CHAT_ID`).
+
+## Tasks
+1. **In-app notifications:** real events (purchase, sale, payout, agent activity, mentions, system),
+ unread counts, mark-read, deep links; designed empty/error states; no phantom badges.
+2. **Transactional email:** verify the critical emails (welcome, payment receipt, payout, password/login,
+ security alerts) send reliably with correct content + links; deliverability (SPF/DKIM/DMARC) set up;
+ plain-text + HTML; unsubscribe where required.
+3. **Preferences:** users control which notifications/emails they get; honor opt-outs; no spam.
+4. **Changelog channel:** confirm `npm run changelog:push --dry-run` previews correctly and the live
+ push posts new entries to the holders' Telegram; skip gracefully when creds absent.
+5. **Reliability:** queue + retry for email/notification delivery; failures logged (sync prompt 36);
+ idempotent (no duplicate sends).
+6. **Templates:** on-brand, accessible, responsive email templates; consistent with the design system.
+
+## Acceptance
+- In-app notifications real + actionable with correct counts; critical transactional emails send reliably.
+- Deliverability configured; preferences honored; changelog push verified (dry-run + live path).
+- Delivery queued/retried + idempotent; templates on-brand + responsive.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. No mocks/fake data/stubs; real sends. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. User-visible change → `data/changelog.json` + `npm run build:pages` (then `changelog:push` after deploy). Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/47-i18n-completeness.md b/prompts/47-i18n-completeness.md
new file mode 100644
index 000000000..354e329e5
--- /dev/null
+++ b/prompts/47-i18n-completeness.md
@@ -0,0 +1,31 @@
+# 47 · Internationalization Completeness
+
+## Mission
+Make the platform fully localizable and ship more languages cleanly, with brand/protocol terms locked
+and English as a safe fallback.
+
+## Context
+- i18n pipeline: `npm run i18n` (`i18n:extract` + `i18n:translate`), `npm run i18n:lint`. Language
+ picker live (Spanish first); choice remembered. The pipeline locks brand/protocol terms ($THREE,
+ the CA, USDC, x402) and falls back to English.
+
+## Tasks
+1. **String coverage:** run `i18n:extract`; find untranslated/hardcoded strings across `src/`/`pages/`;
+ externalize them so nothing user-facing is left un-extractable. `i18n:lint` clean.
+2. **Locked terms:** verify the term-locking actually preserves $THREE, the CA, USDC, x402, brand names
+ in every locale; add any missing locks.
+3. **Add languages:** extend beyond Spanish to the next priority locales via the pipeline; verify
+ layout doesn't break with longer strings (German/French) or RTL (Arabic) if in scope.
+4. **Quality:** spot-check translations for correctness in context; fix obvious machine-translation
+ errors; ensure dates/numbers/currency format per locale.
+5. **Fallback:** missing keys always fall back to English (never show raw keys); language switch is
+ instant + persisted.
+6. **SEO:** `hreflang` alternates correct (sync prompt 12) for each shipped locale.
+
+## Acceptance
+- `i18n:lint` clean; no hardcoded user-facing strings; locked terms preserved in every locale.
+- ≥1 new locale shipped via the pipeline with layout verified; fallback to English never shows raw keys.
+- Locale-correct formatting; `hreflang` correct; language switch instant + remembered.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. $THREE, the CA, USDC, x402 must never be altered by translation. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). No fake/placeholder translations shipped. Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. User-visible change → `data/changelog.json` + `npm run build:pages`. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/48-pricing-monetization.md b/prompts/48-pricing-monetization.md
new file mode 100644
index 000000000..57e40d5b7
--- /dev/null
+++ b/prompts/48-pricing-monetization.md
@@ -0,0 +1,30 @@
+# 48 · Pricing & Monetization Surfaces
+
+## Mission
+Make money clearly and fairly: transparent pricing, working paid tiers, creator monetization, and
+$THREE perks — all consistent, all real, all converting.
+
+## Context
+- Monetization spans: Forge quality tiers + pay-per-generation (x402), $THREE holder perks (prompt 30),
+ skill licenses + pay-what-you-want + creator payouts + affiliate breakdown (recent commits),
+ marketplace (prompt 19), MCP paid tools (prompt 31).
+
+## Tasks
+1. **Pricing page:** a clear, honest pricing/plans page (free vs $THREE-holder vs pay-per-use) with
+ what each unlocks; reachable from nav/footer; no contradictory prices across surfaces.
+2. **Paid tiers:** every paid feature's purchase/unlock path works end-to-end (x402 USDC); receipts;
+ immediate entitlement. No paywall that dead-ends.
+3. **Creator monetization:** listing, pay-what-you-want, payouts, and affiliate breakdown are accurate
+ and reconcile with real settlement; creators can see + withdraw earnings.
+4. **$THREE perks:** consistent with prompt 30; the value of holding is clearly communicated where
+ relevant without overpromising.
+5. **Consistency:** one canonical price source per item; the same price everywhere it's shown.
+6. **Conversion:** upgrade/upsell moments are well-placed + non-annoying; instrument them (prompt 45).
+
+## Acceptance
+- A clear pricing page; every paid path works with USDC + receipts + immediate entitlement.
+- Creator earnings/affiliate/payouts reconcile with real settlement; prices consistent everywhere.
+- $THREE perk value communicated accurately; upsells instrumented; changelog for visible changes.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. No fake prices/mock checkouts; settle in USDC. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. User-visible change → `data/changelog.json` + `npm run build:pages`. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/49-pwa-extension.md b/prompts/49-pwa-extension.md
new file mode 100644
index 000000000..9388a6baa
--- /dev/null
+++ b/prompts/49-pwa-extension.md
@@ -0,0 +1,30 @@
+# 49 · PWA, Service Worker & Browser Extension
+
+## Mission
+Polish the installable PWA and the Chrome extension so the "your avatar walks anywhere on the web"
+promise is real, reliable, and store-ready — without the service worker ever breaking embeds.
+
+## Context
+- PWA: service worker + `npm run generate-icons` (`scripts/generate-pwa-icons.mjs`); embeds must NOT
+ register the SW (`scripts/strip-sw-from-embeds.mjs`). Extension: `npm run build:extension(:prod)`
+ (`scripts/build-extension.mjs`, `build-extension-icons.mjs`).
+
+## Tasks
+1. **PWA correctness:** valid manifest, icons (all sizes), installability, offline shell where
+ sensible; SW caching strategy doesn't serve stale HTML/bundles (sync prompt 40); update flow
+ prompts users to refresh.
+2. **Embed safety:** verify embeds never register the SW (the strip step works) — an embed on a
+ third-party site must not hijack their SW scope.
+3. **Extension:** the Walk extension builds (`build:extension:prod`), loads the companion on arbitrary
+ sites, respects the user's chosen avatar, and degrades gracefully on hostile/CSP-strict pages.
+4. **Permissions:** request the minimum extension permissions; document why each is needed for store review.
+5. **Store readiness:** listing assets, privacy disclosures, and a tested packaged build; versioning.
+6. **Cross-browser:** verify the extension on Chrome (+ Edge); note Firefox/Safari status.
+
+## Acceptance
+- PWA installs + updates cleanly; SW never serves stale HTML; embeds provably don't register the SW.
+- Extension builds + loads the companion on real sites with the chosen avatar; minimal permissions.
+- Store-listing assets + privacy disclosures ready; packaged build tested; changelog for visible changes.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. No mocks/fake data/stubs. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. User-visible change → `data/changelog.json` + `npm run build:pages`. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/50-final-launch-checklist.md b/prompts/50-final-launch-checklist.md
new file mode 100644
index 000000000..ddc62def5
--- /dev/null
+++ b/prompts/50-final-launch-checklist.md
@@ -0,0 +1,34 @@
+# 50 · Final Launch Checklist & Go/No-Go
+
+## Mission
+The gate. Verify every prior workstream actually landed, run the full verification suite, and produce
+an honest go/no-go for production launch. Nothing ships red.
+
+## Context
+- This consumes the outputs of prompts 01–49 and the `docs/audit/*` reports they produced.
+- Full suite: `lint`, `typecheck`, `test`, `test:e2e`, all `audit:*`, `check:images`, `build`,
+ `check:dist`, `audit:deploy`, the smoke scripts (`smoke:mcp`, `smoke:onchain`, `smoke:agent-wallet`,
+ `pump:smoke`), parity (`verify:solana`, `verify:onchain`).
+
+## Tasks
+1. **Re-run everything:** execute the full suite above; capture results. Every gate must be green
+ (or have an explicit, accepted, documented exception).
+2. **Surface verdicts:** for each of the ~20 surfaces, confirm prompt 01's "ready/not ready" is now
+ "ready" — reachable, all states designed, no console errors, real data, tested, a11y, responsive,
+ perf, error-handled. List any still-red with the owning prompt #.
+3. **Money paths:** end-to-end re-verify payments, gating, wallet, marketplace, launches — no
+ double-charge, correct settlement, correct entitlements.
+4. **Coin policy final scan:** repo-wide — only $THREE is referenced/promoted; arbitrary mints only as
+ runtime user data. Any hit blocks launch.
+5. **Security + legal + ops:** prompt 14 findings closed; legal pages live (44); observability +
+ alerts + health + status live (36/41); CI gates enforced (37); backups (38).
+6. **Launch runbook:** `docs/launch/go-no-go-YYYY-MM-DD.md` with the full checklist, evidence links,
+ open risks, rollback plan, and a clear GO / NO-GO recommendation per area.
+
+## Acceptance
+- Full verification suite green (or documented, accepted exceptions only).
+- Every surface "ready"; money paths re-verified; coin-policy scan clean.
+- Security/legal/ops/CI/backups confirmed; go/no-go runbook published with evidence + rollback plan.
+
+---
+### Operating rules — read CLAUDE.md + STRUCTURE.md first. No green-washing — report failures honestly with output. $THREE only (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Stage explicit paths; never `git add -A`. Don't commit `api/*.js` bundles. User-visible change → `data/changelog.json` + `npm run build:pages`. Push both remotes when asked; never pull from `threeD`. DoD = CLAUDE.md checklist.
diff --git a/prompts/avatar-autorig/00-README.md b/prompts/avatar-autorig/00-README.md
new file mode 100644
index 000000000..cec90d29e
--- /dev/null
+++ b/prompts/avatar-autorig/00-README.md
@@ -0,0 +1,74 @@
+# Auto-rig hardening program
+
+A 9-part, self-contained prompt program to take three.ws auto-rigging from
+"shipped but fragile" to production-grade. Each file is written to be pasted
+into a **fresh Claude Code chat** at the repo root and executed end to end —
+no prior context needed.
+
+## Why this exists
+
+three.ws already auto-rigs avatars created from prompts and selfies, and a
+recent change extended auto-rig to **every** creation path (upload, URL import,
+chat/MCP forge save) with a webhook + poll + cron completion backstop. A
+multi-agent adversarial audit of that work surfaced **41 verified-new issues**.
+This program turns those findings into discrete, acceptance-tested tasks.
+
+The headline finding: the original implementation **mutated the avatar in place**
+(rewrote `storage_key`), which silently breaks attestation, IPFS pins, embeds,
+version history, and concurrent edits. Prompt **01 is the keystone** — it
+converts auto-rig to **sibling-materialization** (the rigged GLB becomes a new
+avatar row with `parent_avatar_id` = the static source, and the agent is
+re-pointed), which dissolves that whole bug class. Every later prompt assumes
+the sibling model.
+
+## Run order & dependencies
+
+Run **01 first** — it changes the data model the rest build on. After that,
+02–09 are largely independent and can run in parallel chats, with the noted
+soft dependencies.
+
+| # | Prompt | Depends on | What it fixes |
+|---|--------|-----------|---------------|
+| 01 | [01-sibling-materialization.md](01-sibling-materialization.md) | — | **Keystone.** In-place swap → rigged sibling; fixes checksum/attestation, IPFS, embeds, versioning, lost-update races. |
+| 02 | [02-completion-statemachine.md](02-completion-statemachine.md) | 01 | Orphaned `done`+null jobs no driver recovers; cron reaper starved under backlog; reuse delivered-but-unfinalized results; concurrent-finalize idempotency. |
+| 03 | [03-ssrf-hardening.md](03-ssrf-hardening.md) | — | The webhook host-pins provider URLs; the poll, cron, and reconstruct paths do **not**. Centralize the guard. |
+| 04 | [04-cost-and-consent-gates.md](04-cost-and-consent-gates.md) | 01 | Every static create fires a paid GPU job bypassing the rate limiter; no humanoid gate; private avatars exfiltrated via permanent public URL. |
+| 05 | [05-coverage-gaps.md](05-coverage-gaps.md) | 01 | MCP `save_avatar` never rigs (or provisions an agent); fork mid-rig mislabels; manual rig panel races auto-rig. |
+| 06 | [06-rig-cache-and-backfill.md](06-rig-cache-and-backfill.md) | 01, 04 | Checksum-keyed rig cache (templates + dupes become instant/free); backfill the existing static catalog. |
+| 07 | [07-quality-gate-and-fallback.md](07-quality-gate-and-fallback.md) | 01 | Validate the rig actually drives the clip library before publishing the sibling; GCP UniRig fallback for Replicate outages. |
+| 08 | [08-observability-and-events.md](08-observability-and-events.md) | 01 | `avatar.rigged` webhook event; lifecycle metrics; "Rigging…→Animation-ready" UI; failure-rate / backlog alerts. |
+| 09 | [09-test-suite.md](09-test-suite.md) | 01–08 | Full unit + integration coverage of the new paths; refresh `scripts/verify-auto-rig.mjs`. Run **last**. |
+
+Suggested waves:
+1. **01** (alone — data-model change).
+2. **02, 03, 04, 05, 07, 08** in parallel chats.
+3. **06** (after 04), then **09** (after everything).
+
+## Deferred follow-ups (tracked here, not yet prompted)
+
+Surfaced by the audit and referenced from 01's "Out of scope" — promote to their
+own prompts when 01 lands:
+
+- **GLB-proxy cache-busting** — the id-keyed proxy at `api/avatars/[id]/[action].js:656`
+ sends `immutable`/long `s-maxage`; even with a new sibling id, audit whether any
+ embed/SDK consumer caches by source id and add explicit purge/ETag handling.
+- **Rigged-sibling IPFS re-pin** — when a pinned avatar gets a rigged sibling,
+ orchestrate a real Pinata re-pin + re-attestation of the rigged bytes (01 only
+ avoids the orphan).
+- **Parent→rigged lineage UX** — "view original", lineage badge, and grid dedupe
+ so the rigged sibling and its static parent read as one entity in the gallery.
+
+## Conventions every prompt follows
+
+- Embeds the non-negotiable operating rules (no mocks, `$THREE`-only, dual-remote
+ push, changelog discipline, definition of done).
+- Grounded in **real file paths + line numbers** verified against the codebase.
+- Numbered, acceptance-tested requirements with explicit verification commands.
+
+## Provenance
+
+Derived from the multi-agent auto-rig audit (41 verified findings across
+correctness, security, data-integrity, cross-feature/UX, scale, and tests).
+Findings excluded from this program because they were already fixed in the
+shipping code: the cron backstop, stale-variant invalidation, and the
+double-job idempotency guard.
diff --git a/prompts/avatar-autorig/01-sibling-materialization.md b/prompts/avatar-autorig/01-sibling-materialization.md
new file mode 100644
index 000000000..79381d453
--- /dev/null
+++ b/prompts/avatar-autorig/01-sibling-materialization.md
@@ -0,0 +1,171 @@
+# Convert auto-rig from in-place swap to sibling-materialization (keystone refactor)
+
+> One-line: "Paste this into a fresh Claude Code chat at the repo root and execute it fully."
+
+## Operating rules (non-negotiable)
+- You are building **three.ws** — a platform meant to compete with the best in the world. Senior-engineer bar: no shortcuts, ship complete polished work.
+- **No mocks, no fake data, no placeholders, no TODO comments, no stub functions, no `throw new Error("not implemented")`, no fake setTimeout loading.** Real APIs, real endpoints, real wiring only. If credentials are missing, locate them in `.env` / `vercel env`, else proceed with the real integration.
+- **$THREE is the ONLY coin** this platform may reference. Contract: `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`. Never name, import, hardcode, or recommend any other token anywhere (code, tests, fixtures, copy, commits). If you find another coin referenced, remove it.
+- **Concurrent agents share this worktree.** Stage explicit paths only (never `git add -A`/`git add .`); re-check `git status` and `git diff --staged` immediately before any commit.
+- **Changelog:** every user-visible change gets an entry in `data/changelog.json` (date, holder-readable title + summary, tags from feature|improvement|fix|sdk|infra|docs|security); then run `npm run build:pages`. Internal-only chores get no entry.
+- **Push to BOTH remotes when asked to push:** `git push threeD main` AND `git push threews main`. NEVER pull/fetch/merge from `threeD` (push-only mirror); pulls come from `threews` only.
+- **Trap:** `npx vercel build` overwrites `api/*.js` with esbuild bundles — before committing an `api/` diff, check `head -1` for `__defProp`/`createRequire` and `git restore -- api/ public/` if contaminated.
+- **Definition of done:** code wired + reachable in the UI; every state designed (loading/empty/error/populated/overflow); no console errors/warnings from your code; real API calls verified; existing tests pass (`npm test`); `git diff` self-reviewed; you'd demo it proudly to senior engineers.
+- Read `CLAUDE.md` and `STRUCTURE.md` first. Use TodoWrite for 3+ step tasks. Keep communication short.
+
+## Context
+
+When a static (skeleton-less) avatar is uploaded, imported, or saved from the forge/chat flow, three.ws auto-rigs it into an animation-ready model so the agent that owns it can walk, wave, and emote. Today that completion step (`finalizeAutoRigStage` in `api/_lib/auto-rig.js`) **mutates the existing avatar row in place** — it writes the rigged GLB to a new R2 key, then overwrites `storage_key`, `size_bytes`, `source_meta`, and `tags` on the *same* `avatars.id`.
+
+That in-place swap is the root of a class of data-integrity bugs because several other systems treat an avatar row as an *immutable, content-addressed* artifact keyed by its `id`:
+
+- **Attestations** (`src/attestations/gltf.js`) bind an on-chain signature to a specific `glbSha256`. The in-place swap changes the bytes under a row whose `checksum_sha256` / `storage_mode.attestation.hash` still describe the *old* static mesh — the attestation now verifies against bytes that no longer exist at that id.
+- **IPFS pins** (`storage_mode.ipfs`) point a CID at the static bytes. After the swap, the row claims `primary`/`r2.key` is the rigged GLB while `ipfs.cid` silently still resolves to the orphaned static mesh.
+- **The id-keyed GLB proxy** (`api/avatars/[id]/[action].js`, GET `glb`) serves bytes with `cache-control: public, max-age=300, s-maxage=86400, immutable` on the premise that "rotation produces a new key." The in-place swap violates that premise for any embed/CDN that fetched the old immutable bytes by id.
+- There is **no `avatar_versions` trail** and no provenance row for the upgrade, so rigging is not reversible and the lineage is invisible.
+
+The reconstruct pipeline (`api/_lib/reconstruct-finalize.js`) already solved this correctly: its `materializeReconstructAvatar` always calls `createAvatar(...)` to mint a **new** row for the rigged result. And `POST /api/avatars` (`api/avatars/index.js`) already knows how to **re-point** an `agent_identities` row from a parent avatar to a freshly-created child when `parent_avatar_id` is supplied. This task makes auto-rig adopt that same sibling-materialization model, which is the keystone that dissolves all four bugs at once. Getting avatar provenance right is table-stakes for a platform that wants to mint on-chain agents and sell rigged avatars — a $1B bar cannot have "the bytes under this id silently changed" anywhere in the data model.
+
+## Objective
+
+Replace the in-place `storage_key` mutation in `finalizeAutoRigStage` with **sibling-materialization**: the rigged GLB becomes a **new avatar row** (parent = the static source), the owning agent identity (and any other references) re-point from the static avatar to the rigged one, all storage-integrity fields (`checksum_sha256`, `storage_mode`, IPFS pin state) are recomputed/marked correctly on the new row, an `avatar_versions` trail makes the upgrade reversible, and the original static avatar survives untouched so a rigging failure can never lose the user's avatar.
+
+## Background findings
+
+Confirmed by reading the code:
+
+- `api/_lib/auto-rig.js:158` `finalizeAutoRigStage({ userId, jobId, job, glbUrl })` — the in-place swap. Lines `223–234` run `update avatars set storage_key = ${newKey}, size_bytes, source_meta, tags, usdz_key=null, halfbody_key=null, baked_storage_key=null where id = ${avatarId}`. It never recomputes `checksum_sha256`, never touches `storage_mode`, never writes `avatar_versions`, and returns `{ status: 'done', resultAvatarId: avatarId }` (the **same** id it was handed). The deleted/missing-avatar branch (`:178`) returns `{ status:'done', resultAvatarId: avatarId }` and a "no avatar/glbUrl" branch (`:167`) returns `{ status:'done' }`.
+- `api/_lib/reconstruct-finalize.js:54` `materializeReconstructAvatar(...)` — the pattern to mirror: it canonicalizes bones, `putObject(...)`, then `createAvatar({ userId, storageKey, input: { slug, name, ..., checksum_sha256: null, parent_avatar_id: null, source_meta, tags } })`, marks the job `result_avatar_id = avatar.id`, and fires an `avatar.created` webhook. Note it passes `checksum_sha256: null` today — you will compute a real hash for the rig sibling.
+- `api/_lib/avatars.js:106` `createAvatar({ userId, input, storageKey })` enforces quotas, generates a slug, builds `storage_mode` via `defaultStorageMode({ storage_key, checksum_sha256 })`, and inserts the row. `:554` `storageKeyFor({ userId, slug })` returns `u/<userId>/<slug>/<ts>.glb`. `:411` `_servedStorageKey` and `:391` `resolveAvatarUrl` decide which key is served.
+- `api/_lib/storage-mode.js:35` `defaultStorageMode(avatarRow)` seeds `r2.key = storage_key`, `attestation.hash = checksum_sha256`, `ipfs.pinned = false`. `:50` `readStorageMode(avatarId)` deep-merges the stored JSONB over the default.
+- `api/avatars/index.js:130–138` — the canonical agent re-point: `update agent_identities set avatar_id = ${avatar.id} where user_id = ... and avatar_id = ${parent_avatar_id} and deleted_at is null`. `:88–95` validates `parent_avatar_id` ownership.
+- `api/avatars/[id]/[action].js:163` `handlePinIpfs` reads `checksum_sha256, storage_key` and writes `storage_mode.ipfs`. `:639` the GLB proxy serves `storage_key`/baked key with the `immutable` cache header at `:656`.
+- `api/avatars/[id].js:202` `handleGlbPatch` is the existing model for an `avatar_versions` insert: `insert into avatar_versions (avatar_id, storage_key, created_by) values (...)`, wrapped in a try/catch that no-ops on `42P01` / "does not exist" (the table may not be migrated on all envs). Reuse this exact defensive pattern.
+- `src/attestations/gltf.js:96` `verifyGlTFAttestation` recomputes `sha256Hex(glbBlob)` and compares to `attestation.glbSha256` — this is why the new row must carry the **rigged** bytes' hash.
+- Callers of `finalizeAutoRigStage` (all must accept the new return shape, keep idempotency):
+ - `api/webhooks/replicate.js:238`
+ - `api/avatars/_actions.js:538` (regenerate-status poll; sets `job.result_avatar_id = result.resultAvatarId`)
+ - `api/cron/auto-rig-sweep.js:120`
+- `maybeAutoRigAvatar` (`api/_lib/auto-rig.js:85`) submits the job with `sourceAvatarId: avatar.id` and an idempotency guard (`:108`) on `source_avatar_id + mode='rerig' + params.auto_rig='true' + status in (queued,running,rigging)`. The job's `source_avatar_id` is the static avatar id — that becomes the **parent** of the sibling.
+
+## Scope — in / out
+
+**In:**
+- Rewrite `finalizeAutoRigStage` in `api/_lib/auto-rig.js` to materialize a sibling avatar row instead of mutating in place.
+- Recompute `checksum_sha256` for the rigged bytes; ensure `storage_mode` on the sibling is correct (R2 key + attestation hash); mark/clear IPFS state so no orphaned pin is implied.
+- Re-point `agent_identities` from the static avatar to the sibling (mirror `api/avatars/index.js`).
+- Write an `avatar_versions` trail row so the rig is reversible (mirror `api/avatars/[id].js`).
+- Update the three callers to the new return shape; preserve idempotency (no duplicate siblings on webhook+poll+cron racing the same job).
+- Preserve the fail-soft contract: the static avatar must remain a valid, owned, animatable-via-fallback avatar if anything fails.
+- Add/extend a unit test under `tests/` covering the new behavior.
+- Changelog entry (this is user-visible: rigged avatars now appear as a distinct, attested, reversible model).
+
+**Out (defer — see "Out of scope / follow-ups"):**
+- The deep CDN/edge purge of already-cached id-keyed GLB bytes (cache-busting strategy for the proxy) — at minimum the sibling has a new id **and** a new R2 key, which is sufficient here.
+- The auto-rig **frontend/library UX** (how the gallery renders parent→rigged lineage, "view original" affordance).
+- Real Pinata re-pin orchestration of the rigged bytes (here you only mark the inherited pin stale / leave the sibling unpinned; a follow-up prompt can auto-pin rigged siblings).
+- Changing `maybeAutoRigAvatar` submission/gating logic.
+
+## Key files & entry points
+
+- `api/_lib/auto-rig.js` — `finalizeAutoRigStage` (rewrite), `maybeAutoRigAvatar` (unchanged), `canonicalize`, `fetchGlbBuffer` helpers.
+- `api/_lib/reconstruct-finalize.js` — `materializeReconstructAvatar`: the sibling pattern to mirror (createAvatar + job marking + webhook).
+- `api/_lib/avatars.js` — `createAvatar`, `storageKeyFor`, `defaultStorageMode` usage; quota enforcement.
+- `api/_lib/storage-mode.js` — `defaultStorageMode`, `readStorageMode`, `storageModeSchema` (validate any storage_mode you write).
+- `api/avatars/index.js` (`:130`) — canonical `agent_identities` re-point on `parent_avatar_id`.
+- `api/avatars/[id].js` (`:202`) — canonical `avatar_versions` insert with `42P01` guard.
+- `api/avatars/[id]/[action].js` — `handlePinIpfs` (`:163`), GLB proxy + immutable cache header (`:639`/`:656`).
+- `src/attestations/gltf.js` (`:96`) — why the rigged bytes need their own hash.
+- Callers: `api/webhooks/replicate.js:238`, `api/avatars/_actions.js:538`, `api/cron/auto-rig-sweep.js:120`.
+- `tests/` — find the existing auto-rig / reconstruct-finalize test (`grep -rl "finalizeAutoRigStage\|materializeReconstructAvatar\|auto-rig" tests`) and extend it.
+
+## Requirements
+
+Each requirement has an **acceptance criterion (AC)**.
+
+1. **Materialize a sibling row, not an in-place swap.** In `finalizeAutoRigStage`, after fetching + canonicalizing the rigged GLB and `putObject`-ing it to a fresh key (`storageKeyFor`, slug `rigged-XXXXXX`), call `createAvatar({ userId, storageKey: newKey, input: {...} })` to mint a NEW row whose `parent_avatar_id` is the static source avatar id. Do **not** run `update avatars set storage_key = ...` on the source row.
+ - **AC:** After completion the source avatar's `storage_key`, `size_bytes`, `checksum_sha256`, `source_meta`, and `storage_mode` are byte-for-byte unchanged from before the job; a new `avatars` row exists with `parent_avatar_id = <sourceId>`, `source = 'auto-rig'` (or equivalent provenance), tags including `rigged` and excluding `unrigged`, and `source_meta.is_rigged = true`.
+
+2. **Carry the static avatar's identity onto the sibling.** The sibling inherits a sensible `name` (e.g. the source's name, or the source name unchanged), `description`, and `visibility` from the source row so the user's library doesn't show a renamed mystery avatar. Copy forward relevant `source_meta` provenance: `unrigged_avatar_id = <sourceId>`, `unrigged_storage_key = <source.storage_key>`, `auto_rigged: true`, `rig_provider: 'auto-rig'`, `rig_job_id: jobId`, plus the inspected skeleton stats (`skeleton_joint_count`, `skin_count`, `node_count`, `animation_count`) from `inspectGlb`.
+ - **AC:** Reading the sibling via `getAvatar` returns the same `visibility` as the source and a `source_meta.unrigged_avatar_id` equal to the source id; the source row's own `source_meta` is unchanged.
+
+3. **Recompute `checksum_sha256` for the rigged bytes.** Compute `createHash('sha256').update(glbBuf).digest('hex')` on the canonicalized rigged buffer and pass it as `input.checksum_sha256` to `createAvatar`. (Do **not** reuse the `_hashAppearance` canonical-JSON hash — that is for appearance, not GLB bytes.)
+ - **AC:** The sibling row's `checksum_sha256` equals the sha256 of the exact bytes written to R2; `defaultStorageMode` therefore stamps `attestation.hash` to that same hash (verify via `readStorageMode(siblingId)`).
+
+4. **`storage_mode` on the sibling is correct and schema-valid.** Because `createAvatar` builds `storage_mode` from `defaultStorageMode({ storage_key: newKey, checksum_sha256 })`, the sibling automatically gets `primary:'r2'`, `r2.key = newKey`, `r2.present:true`, `attestation.hash = <rigged sha256>`, and `ipfs.pinned:false`. Confirm this and validate it with `validateStorageMode` (from `storage-mode.js`) before/after if you construct any storage_mode by hand.
+ - **AC:** `validateStorageMode(await readStorageMode(siblingId))` does not throw; `r2.key === newKey`; `ipfs.pinned === false` (the sibling starts unpinned — no inherited/orphaned CID).
+
+5. **No silently-orphaned IPFS pin.** The static source may already be IPFS-pinned (`storage_mode.ipfs.pinned = true` → a CID for the static bytes). The sibling must **not** inherit that CID (its bytes differ). If the source was pinned, stamp the source's `storage_mode` (or the sibling's `source_meta`) with a marker that the static pin is now superseded — e.g. set `source.source_meta.rigged_superseded_by = <siblingId>` so a future re-pin job / the UI can detect the rigged version exists. Do not call Pinata here (that's a follow-up).
+ - **AC:** The sibling's `storage_mode.ipfs.cid` is `null`; if the source had `ipfs.pinned`, the source row carries a marker pointing to the sibling. No row claims a CID for bytes it does not hold.
+
+6. **Write an `avatar_versions` trail.** Insert a version row recording the rig upgrade, mirroring `api/avatars/[id].js:240` including the `42P01`/"does not exist" guard so it no-ops on un-migrated envs. Record enough to reverse the rig: at minimum `avatar_id` = source id (or sibling id — pick one and document it in a comment), `storage_key` of the rigged GLB, and `created_by = userId`. If the table supports more columns (check `grep -rn "avatar_versions" migrations/ db/ sql/`), populate them.
+ - **AC:** After a successful finalize an `avatar_versions` row exists referencing the rigged `storage_key`; on an env without the table the finalize still succeeds (warning logged, no throw).
+
+7. **Re-point the owning agent identity to the sibling.** Mirror `api/avatars/index.js:130–138`: `update agent_identities set avatar_id = <siblingId> where user_id = <userId> and avatar_id = <sourceId> and deleted_at is null`. The agent keeps its `id`, wallet, chain id, and ERC-8004 id — only its avatar pointer moves to the now-animatable model.
+ - **AC:** An agent that pointed at the source avatar points at the sibling after finalize; its `id` and wallet are unchanged. If no agent pointed at the source, the update affects 0 rows and finalize still succeeds.
+
+8. **Mark the job done with the sibling id.** `update avatar_regen_jobs set result_avatar_id = <siblingId>, status = 'done'` for `job_id + user_id`. Return `{ status: 'done', resultAvatarId: <siblingId> }`.
+ - **AC:** The job row's `result_avatar_id` is the **sibling** id (not the source id); the function return value matches.
+
+9. **Idempotency across racing callers.** The webhook (`replicate.js`), the poll (`_actions.js`), and the cron sweep (`auto-rig-sweep.js`) can each fire `finalizeAutoRigStage` for the same job. A second invocation must NOT create a second sibling. Before materializing, check the job row: if it already has `result_avatar_id` set (and status `done`), short-circuit and return `{ status:'done', resultAvatarId: <existing> }`. Re-read the job inside the function (don't trust a possibly-stale `job` arg) or guard the create with the existing `result_avatar_id`.
+ - **AC:** Calling `finalizeAutoRigStage` twice with the same `jobId` yields exactly one sibling row and the same `resultAvatarId` both times.
+
+10. **Fail-soft: the static avatar is never lost.** Every early-return / error branch must leave the source avatar valid and owned. The existing branches — source deleted between submit and completion (`:178`), missing `avatarId`/`glbUrl` (`:167`) — must be preserved (no sibling, job closed, no throw into the caller). A fetch/canonicalize/putObject failure must not delete or mutate the source row.
+ - **AC:** If `glbUrl` is unreachable, `finalizeAutoRigStage` rejects or returns without having altered the source avatar; the source avatar still resolves and animates via the canonical-clip fallback (`AnimationManager.supportsCanonicalClips()`), exactly as before auto-rig existed.
+
+11. **Update all three callers to the new return shape.** `replicate.js:238`, `_actions.js:538`, `auto-rig-sweep.js:120` already consume `{ status, resultAvatarId }`. Verify each correctly surfaces the **sibling** id (e.g. `_actions.js` sets `job.result_avatar_id = result.resultAvatarId`). The regenerate-status poll response (`_actions.js:545`) must report the sibling id as `resultAvatarId` so the browser navigates to the rigged avatar.
+ - **AC:** `grep`-verify no caller assumes `resultAvatarId === source_avatar_id`; the poll/webhook responses carry the sibling id.
+
+12. **Fire the `avatar.created` webhook for the sibling.** Mirror `materializeReconstructAvatar` (`reconstruct-finalize.js:127`): `dispatchWebhooks({ userId, eventType:'avatar.created', data:{ id, name, slug, source:'auto-rig' } }).catch(()=>{})`.
+ - **AC:** A configured webhook receives one `avatar.created` event for the sibling on finalize.
+
+13. **Quota awareness.** `createAvatar` calls `enforceQuotas`, which can throw `402 plan_limit_count` / `plan_limit_storage`. A rig completion must not hard-fail and leave the job stuck if the user is at quota. Catch the quota error, leave the source avatar intact, mark the job `done` (or a terminal state your callers already handle) with a `source_meta`/job note explaining the rigged sibling couldn't be created due to quota, and return without throwing.
+ - **AC:** With a user at `max_avatars`, finalize completes without throwing, no sibling is created, the source avatar is untouched, and the job reaches a terminal state (not stuck in `rigging`/`running`).
+
+14. **Changelog.** Add a `data/changelog.json` entry (tag `improvement` or `fix`): plain-language "Auto-rigged avatars now keep your original as a separate, attested, reversible model" framing. Run `npm run build:pages`.
+ - **AC:** `npm run build:pages` passes and regenerates `CHANGELOG.md` / `public/changelog.json` / `public/changelog.xml` with the new entry.
+
+## Implementation notes
+
+- **Mirror, don't fork.** `materializeReconstructAvatar` already does canonicalize → `putObject` → `createAvatar` → mark job → `dispatchWebhooks`. Lift that exact ordering. The only deltas for auto-rig: `parent_avatar_id` is the **source** avatar id (not `null`), `checksum_sha256` is a real hash (not `null`), tags carry `rigged`, and you also re-point `agent_identities` + write `avatar_versions`.
+- **Hash the bytes, not appearance.** Use `import { createHash } from 'node:crypto'` and hash the canonicalized `glbBuf` (the same buffer you `putObject`). Do this *after* `canonicalize(glbBuf)` so the hash matches the stored bytes.
+- **Re-read the job for idempotency.** `select result_avatar_id, status from avatar_regen_jobs where job_id=${jobId} and user_id=${userId}` at the top; if `result_avatar_id` is non-null, return it. This closes the webhook/poll/cron race without a new lock.
+- **Read the source row once** (the existing `select id, slug, storage_key, source_meta, tags from avatars where id=${avatarId} ...` at `auto-rig.js:172`) and additionally select `name, description, visibility, checksum_sha256, storage_mode` so you can carry identity forward and detect a prior IPFS pin.
+- **`storage_mode`** is set for you by `createAvatar` → `defaultStorageMode`. Only construct one by hand if you need to mark the *source* as superseded; if you do, run it through `validateStorageMode` first.
+- **`avatar_versions` columns:** confirm the real schema before inserting (`grep -rn "avatar_versions" migrations db sql` and inspect the live table if reachable). Stick to the columns `api/avatars/[id].js` already writes (`avatar_id, storage_key, created_by`) unless you confirm more exist.
+- **Gotcha — `npx vercel build`:** never run it casually; it rewrites `api/*.js` into esbuild bundles. If you see `__defProp`/`createRequire` at the top of a changed `api/` file, `git restore -- api/ public/`.
+- **Gotcha — concurrent agents:** other agents may edit `api/_lib/*` on `main`. Stage explicit paths only; re-check `git diff --staged` before committing.
+- **Keep `finalizeAutoRigStage` async-pure** of UI concerns; it's shared by a webhook, a cron, and a poll. No `res`/HTTP in it.
+
+## Verification
+
+Run, in order:
+
+1. `npm test` — full suite must stay green. Run the targeted test you extended: `npx vitest run tests/<auto-rig-or-reconstruct>.test.js` (locate it via `grep -rl "finalizeAutoRigStage\|auto-rig" tests`).
+2. **New/extended unit test** must assert: (a) source avatar row unchanged after finalize; (b) sibling row created with `parent_avatar_id = source`, real `checksum_sha256`, `tags` includes `rigged`; (c) `agent_identities.avatar_id` moved from source to sibling; (d) double-finalize yields one sibling (idempotency); (e) job `result_avatar_id` = sibling id; (f) a `glbUrl`-fetch failure leaves the source intact. Use the project's existing DB/test harness (check how the current auto-rig/reconstruct test stubs `sql`, `putObject`, `getRegenProvider`, `fetch`).
+3. `node -e "import('./api/_lib/storage-mode.js').then(m=>console.log(m.validateStorageMode(m.defaultStorageMode({storage_key:'u/x/y/z.glb',checksum_sha256:'a'.repeat(64)}))))"` — sanity-check the storage_mode you'll produce passes the schema.
+4. **Manual end-to-end** (if a rerig model is configured in `.env` / `vercel env`, i.e. `REPLICATE_RERIG_MODEL`): `npm run dev`, upload a static GLB through the UI, watch the regenerate-status poll (`api/avatars/_actions.js`) flip to `done`, and confirm in the network tab the response carries a **new** `resultAvatarId` distinct from the uploaded avatar id. Open both rows: the original is still present and static; the sibling is rigged and the agent now points at it.
+5. `git diff` self-review — every changed line justified; confirm no in-place `update avatars set storage_key` remains in `finalizeAutoRigStage`; confirm no other coin/token introduced anywhere.
+6. `head -1 api/_lib/auto-rig.js` (and any other changed `api/*.js`) — must be source, not `__defProp`/`createRequire`.
+
+## Definition of done
+
+- [ ] `finalizeAutoRigStage` materializes a sibling via `createAvatar` (parent = source); the in-place `storage_key` swap is gone.
+- [ ] Sibling carries real `checksum_sha256`, valid `storage_mode` (r2.key + attestation.hash correct, `ipfs.cid = null`), correct rig tags/`source_meta`.
+- [ ] Source avatar row is provably unchanged on success and on every failure branch (fail-soft preserved).
+- [ ] No orphaned IPFS pin: sibling unpinned, source marked superseded if it was pinned.
+- [ ] `avatar_versions` trail written (with `42P01` guard); rig is reversible.
+- [ ] `agent_identities` re-pointed source → sibling (id/wallet unchanged).
+- [ ] Idempotent across webhook + poll + cron (one sibling, same `resultAvatarId`).
+- [ ] All three callers (`replicate.js`, `_actions.js`, `auto-rig-sweep.js`) verified against the new return shape; sibling id surfaced to the browser.
+- [ ] Quota-exceeded path is graceful (job terminal, source intact, no throw).
+- [ ] `avatar.created` webhook fired for the sibling.
+- [ ] Unit test extended and passing; `npm test` green.
+- [ ] `data/changelog.json` entry added; `npm run build:pages` passes.
+- [ ] `git diff` self-reviewed; no esbuild contamination; no non-$THREE token anywhere.
+
+## Out of scope / follow-ups
+
+- **CDN/edge purge of stale id-keyed GLB bytes** for embeds that already cached the source by id (the `immutable` proxy header at `api/avatars/[id]/[action].js:656`). The sibling's new id + new R2 key is sufficient for this prompt; the deep cache-busting fix is a deferred follow-up (tracked in `00-README.md`).
+- **Auto-pin the rigged sibling to IPFS** (real Pinata orchestration of the rigged bytes + re-attestation). Here we only avoid the orphan; wiring the re-pin is a deferred follow-up (tracked in `00-README.md`).
+- **Gallery/library UX for parent→rigged lineage** ("view original", lineage badge, dedupe in the grid) — deferred frontend follow-up (tracked in `00-README.md`).
diff --git a/prompts/avatar-autorig/02-completion-statemachine.md b/prompts/avatar-autorig/02-completion-statemachine.md
new file mode 100644
index 000000000..200441b76
--- /dev/null
+++ b/prompts/avatar-autorig/02-completion-statemachine.md
@@ -0,0 +1,188 @@
+# Fix the auto-rig completion state machine (orphaned `done`+`null` jobs, unconditional reaper, idempotent finalize)
+
+> One-line: "Paste this into a fresh Claude Code chat at the repo root and execute it fully."
+
+## Operating rules (non-negotiable)
+- You are building **three.ws** — a platform meant to compete with the best in the world. Senior-engineer bar: no shortcuts, ship complete polished work.
+- **No mocks, no fake data, no placeholders, no TODO comments, no stub functions, no `throw new Error("not implemented")`, no fake setTimeout loading.** Real APIs, real endpoints, real wiring only. If credentials are missing, locate them in `.env` / `vercel env`, else proceed with the real integration.
+- **$THREE is the ONLY coin** this platform may reference. Contract: `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`. Never name, import, hardcode, or recommend any other token anywhere (code, tests, fixtures, copy, commits). If you find another coin referenced, remove it.
+- **Concurrent agents share this worktree.** Stage explicit paths only (never `git add -A`/`git add .`); re-check `git status` and `git diff --staged` immediately before any commit.
+- **Changelog:** every user-visible change gets an entry in `data/changelog.json` (date, holder-readable title + summary, tags from feature|improvement|fix|sdk|infra|docs|security); then run `npm run build:pages`. Internal-only chores get no entry.
+- **Push to BOTH remotes when asked to push:** `git push threeD main` AND `git push threews main`. NEVER pull/fetch/merge from `threeD` (push-only mirror); pulls come from `threews` only.
+- **Trap:** `npx vercel build` overwrites `api/*.js` with esbuild bundles — before committing an `api/` diff, check `head -1` for `__defProp`/`createRequire` and `git restore -- api/ public/` if contaminated.
+- **Definition of done:** code wired + reachable in the UI; every state designed (loading/empty/error/populated/overflow); no console errors/warnings from your code; real API calls verified; existing tests pass (`npm test`); `git diff` self-reviewed; you'd demo it proudly to senior engineers.
+- Read `CLAUDE.md` and `STRUCTURE.md` first. Use TodoWrite for 3+ step tasks. Keep communication short.
+
+## Context
+
+Every avatar born on three.ws — a GLB upload, a URL import, a chat/MCP "text → 3D avatar" forge save — is supposed to become animation-ready. When a freshly-created static mesh has no skeleton, `maybeAutoRigAvatar` (`api/_lib/auto-rig.js`) fires a background `rerig` job tagged `auto_rig: true` and the rigged GLB is later swapped in place on the **same** avatar row. The agent the user already owns simply gains the ability to walk, wave, and emote.
+
+There are three independent drivers that are supposed to carry that job to completion:
+1. **The Replicate webhook** (`api/webhooks/replicate.js`) — instant, the happy path.
+2. **The browser status poll** (`api/avatars/_actions.js`, the `regenerate-status` handler) — for browser flows that poll.
+3. **The cron sweep** (`api/cron/auto-rig-sweep.js`, every 5 min per `vercel.json`) — the backstop for headless/MCP creations that never poll and for dropped webhooks.
+
+In production this state machine has gaps that strand avatars as permanently static even though the rig succeeded at the provider. For headless MCP creations (which never poll) the cron is the **only** safety net, so any hole in it is a silent, unrecoverable failure — the exact opposite of the Avaturn-parity promise. This task closes every hole so that a rig that completes at the provider **always** lands on the avatar, no matter which driver fires, how many fire, or what fails mid-flight.
+
+This is the auto-rig **lifecycle** task. The mesh→rig **gate** (when to rig at all) is a separate concern — see `01-...md` if present in `prompts/`. Do not re-open the gate logic here.
+
+## Objective
+
+Make the auto-rig job lifecycle eventually-consistent and crash-safe: a `rerig`/`auto_rig` job whose provider work succeeded is **always** finalized onto its source avatar — recovered even when finalize previously threw after the status flipped to `done`, recovered even under a full candidate backlog, and safe when the webhook, poll, and cron all finalize the same job concurrently.
+
+## Background findings (verified against the code)
+
+1. **Permanent-orphan bug — `done` + `result_avatar_id IS NULL` is invisible to every recovery driver.**
+ In `api/webhooks/replicate.js`, the row is flipped to its terminal status **before** finalize runs:
+ - lines 189–196 — the `update avatar_regen_jobs set status = ${nextStatus} …` runs unconditionally; for a succeeded prediction `nextStatus === 'done'`.
+ - lines 237–242 — `finalizeAutoRigStage(...)` is then called inside a `try/catch` whose `catch` only `console.warn`s (line 240) and swallows the error.
+ So if `finalizeAutoRigStage` throws (R2 write fails, provider GLB fetch 500s, DB hiccup), the job is left at `status = 'done'`, `result_avatar_id IS NULL`. Now look at who can recover it:
+ - The cron candidate query (`api/cron/auto-rig-sweep.js` lines 65–76) filters `status in ('queued', 'running')` — it will **never** select a `done` row.
+ - The browser poll (`api/avatars/_actions.js` lines 530–543) *could* re-finalize, but headless/MCP creations never poll.
+ Result: the avatar is stranded static forever with no driver able to retry. This is the core bug.
+
+2. **The MAX_AGE zombie reaper can be starved by a real backlog.**
+ In `api/cron/auto-rig-sweep.js` the reaper (lines 80–95) is nested **inside `if (!rows.length)`** — it only runs on a tick where the candidate query (lines 65–76, `limit ${BATCH}` with `BATCH = 25`, line 34) returned **zero** rows. Under a sustained backlog of ≥25 quiet candidates, every tick fills the batch, `rows.length > 0`, and the reaper never executes — zombies older than `MAX_AGE` (`"6 hours"`, line 33) accrete indefinitely.
+
+3. **Candidate ordering is correct but throughput may be thin.**
+ The candidate query already does `order by updated_at asc` (line 74), oldest-quiet-first — good. But `BATCH = 25` every 5 minutes caps throughput at 300 jobs/hour; a burst of headless creations can outrun it. Throughput must exceed plausible inflow.
+
+4. **The webhook re-fetches a GLB it already has, and the poll re-derives one it already stored.**
+ `finalizeAutoRigStage` (`api/_lib/auto-rig.js` lines 158–237) takes a `glbUrl` and `fetchGlbBuffer`s it (line 185). The webhook already extracted the provider URL into `result_glb_url` at line 192. When the cron recovers a `done`+`null` job it has `result_glb_url` in hand and should **not** re-hit the provider's `status()` for a URL it already stored — re-fetching is wasted latency and an extra failure surface.
+
+5. **Finalize is not guarded against concurrent runs.**
+ `finalizeAutoRigStage` (lines 158–237) does read-then-write with no concurrency guard. The webhook, the poll, and the cron can all fire for one job in the same window. Two finalizers racing would each write a fresh rigged GLB to a new R2 key and each run `closeJob`, double-billing the provider fetch and orphaning one R2 object. There must be a single winner.
+
+6. **Cron schedule:** `vercel.json` line ~3758 schedules `/api/cron/auto-rig-sweep` at `*/5 * * * *`.
+
+## Scope — in / out
+
+**In scope (touch these):**
+- `api/cron/auto-rig-sweep.js` — un-nest the reaper, add a `done`+`null` recovery lane, raise throughput.
+- `api/webhooks/replicate.js` — make the auto-rig branch not strand jobs at `done`+`null` (see Requirement 1 for the two allowed strategies).
+- `api/_lib/auto-rig.js` — make `finalizeAutoRigStage` idempotent / concurrency-guarded, and let it reuse a stored `result_glb_url`.
+- `api/avatars/_actions.js` — only if Requirement 1's chosen strategy changes the `done` transition contract the poll relies on (lines 530–543).
+- `vercel.json` — cron schedule only if you shorten it (Requirement 3).
+- `tests/` — new test file(s) per Requirement 6.
+- `data/changelog.json` — one `fix` entry (user-visible: stranded avatars now self-heal).
+
+**Out of scope (do NOT touch):**
+- The mesh→rig **gate** decision (`rigInfoIsRigged`, `maybeAutoRigAvatar` submission logic) — separate prompt `01-...md`.
+- The reconstruct pipeline finalize (`finalizeReconstructStage`, `api/_lib/reconstruct-finalize.js`) beyond what's structurally shared — do not refactor it.
+- Webhook signature verification (`verifyStandardWebhook`, SSRF host pinning) — leave intact.
+- Manual rig panel / client-side sibling materialization.
+- Any coin/token references.
+
+## Key files & entry points
+
+- `api/_lib/auto-rig.js` — `maybeAutoRigAvatar` (submit) and **`finalizeAutoRigStage`** (lines 158–237, the shared completion stage that fetches/canonicalizes/stores the rigged GLB and swaps it in place; `closeJob` helper lines 160–165). Primary edit target for idempotency + url-reuse.
+- `api/webhooks/replicate.js` — Replicate completion receiver. Status flip lines 189–196; auto-rig finalize branch lines 229–242 with the swallowed `catch` at 240.
+- `api/cron/auto-rig-sweep.js` — the 5-minute backstop. `QUIET_WINDOW`/`MAX_AGE`/`BATCH` constants lines 30–34; candidate query lines 65–76; **reaper nested in `if (!rows.length)`** lines 80–95; per-job loop lines 107–144; `failJob` helper lines 51–57.
+- `api/avatars/_actions.js` — the `regenerate-status` poll. Provider poll lines 460–493; auto-rig finalize branch lines 530–543.
+- `vercel.json` — cron entry for `/api/cron/auto-rig-sweep` (~line 3758).
+- `tests/auto-rig-gate.test.js` — existing gate test (do not modify; mirror its `vitest` style).
+- `tests/agent-monetization.test.js` lines 18–33 — reference pattern for mocking `api/_lib/db.js`'s `sql` tagged template with a queue of canned result sets.
+
+## Requirements
+
+Each requirement has an acceptance criterion. All must hold.
+
+### 1. Eliminate the permanent `done` + `result_avatar_id IS NULL` orphan
+Choose **one** of these two strategies and implement it fully and consistently across all three drivers:
+
+- **Strategy A (preferred — finalize owns the single `done` transition):** In `api/webhooks/replicate.js`, for the auto-rig case do **not** let the unconditional status update (lines 189–196) write `status = 'done'`. Instead, when an auto-rig job's prediction succeeded, persist the provider's `result_glb_url` and a non-terminal `status` (e.g. keep/restore `'running'`, or introduce a `'finalizing'` status), then call `finalizeAutoRigStage`, and let **`finalizeAutoRigStage`'s `closeJob` be the *only* writer of `status = 'done'`** (it already sets `status = 'done'` together with `result_avatar_id` atomically at lines 162–165). A finalize that throws then leaves the job at the non-terminal status, which the cron's existing `status in ('queued','running')` filter still selects. Apply the same "don't flip auto-rig jobs to `done` before finalize" rule to the poll path (`api/avatars/_actions.js` lines 472–479) so the three drivers share one contract. The reconstruct branch's behavior must be unchanged.
+- **Strategy B (cron also sweeps the orphan tail):** Keep the early `done` flip, but add a **second candidate lane** to the cron (`api/cron/auto-rig-sweep.js`) that selects `mode = 'rerig' AND params->>'auto_rig' = 'true' AND status = 'done' AND result_avatar_id IS NULL` and finalizes them by reusing the stored `result_glb_url` (Requirement 4) — no provider `status()` call needed. This lane must also be subject to the `QUIET_WINDOW` so it never races a webhook finalize in progress.
+
+**Acceptance:** A unit/integration test (Requirement 6a) drives a job to `status = 'done', result_avatar_id IS NULL` with a valid stored `result_glb_url`, runs the recovery driver once, and asserts the job ends `status = 'done', result_avatar_id = <source avatar id>` with the avatar's `storage_key` re-pointed and `source_meta.is_rigged === true`. With Strategy A, also assert that a finalize throw leaves the job at the **non-terminal** status (cron-selectable), never `'done'`+`null`.
+
+### 2. Run the MAX_AGE reaper unconditionally every tick
+In `api/cron/auto-rig-sweep.js`, move the reaper (currently lines 80–95) **out** of the `if (!rows.length)` block so it executes on **every** tick regardless of candidate count. The reaper's `update … set status = 'failed', error = '…' where … created_at <= now() - ${MAX_AGE}::interval` must run before, after, or alongside the candidate processing — but never be gated by a non-empty batch. Add `reaped` to the summary unconditionally.
+
+**Acceptance:** Test 6b stubs the candidate query to return a full `BATCH` of rows (`rows.length === BATCH`) **and** stubs the reaper update to return ≥1 reaped row; after one handler invocation the response includes `reaped >= 1`, proving the reaper ran despite a full batch.
+
+### 3. Make throughput exceed plausible inflow
+Either raise `BATCH` (line 34) to a value that clears a realistic headless-creation burst within a couple of ticks (e.g. 100) **or** shorten the cron schedule in `vercel.json` (`*/5 * * * *` → a tighter interval), or both. Pick deliberately and justify the number in a code comment with the arithmetic (jobs/tick × ticks/hour vs. expected inflow). Keep candidate ordering `order by updated_at asc` (oldest-quiet-first, already at line 74) so no job starves under load.
+
+**Acceptance:** The constant/schedule change is present, commented with the throughput arithmetic, and the candidate query still orders oldest-first. No magic number without a comment.
+
+### 4. Reuse a delivered-but-unfinalized `result_glb_url`
+When a recovery driver already has the provider GLB URL stored on the row (the webhook wrote it to `result_glb_url` at `api/webhooks/replicate.js` line 192), the cron recovery lane must finalize from that stored URL **without** calling `provider.instance.status()` again. Pass the stored `result_glb_url` straight into `finalizeAutoRigStage({ … glbUrl })`. Only fall back to a provider `status()` poll when `result_glb_url` is absent. `finalizeAutoRigStage` already accepts `glbUrl` (line 158) — no signature change needed there.
+
+**Acceptance:** Test 4 (may be folded into 6a) asserts that when recovering a `done`+`null` job whose row carries `result_glb_url`, the provider's `status()` is **not** invoked (spy asserts zero calls) and finalize still completes.
+
+### 5. Make `finalizeAutoRigStage` idempotent under concurrent drivers
+Guard `finalizeAutoRigStage` (`api/_lib/auto-rig.js`) so that when the webhook, poll, and cron fire for the same `job_id` concurrently, exactly **one** materializes the avatar and the losers no-op cleanly. Implement a real DB-level claim, not an in-process lock (the three drivers are separate serverless invocations). Recommended: an atomic conditional claim at the top of finalize, e.g.
+```
+update avatar_regen_jobs
+set status = 'finalizing', updated_at = now()
+where job_id = ${jobId} and user_id = ${userId} and result_avatar_id is null
+ and status <> 'finalizing'
+returning job_id
+```
+If the claim returns zero rows, another driver already owns (or completed) this job — return early as a no-op (e.g. `{ status: 'done', skipped: 'in_progress' }`) without fetching the GLB or writing R2. The winner proceeds through fetch → canonicalize → R2 put → avatar update → `closeJob`. If the winner then **throws**, it must release the claim back to a cron-selectable status (don't leave it wedged at `'finalizing'` forever) — either reset to `'running'` in a `catch`/`finally`, or have the cron also treat a stale `'finalizing'` (older than `QUIET_WINDOW`) as a recovery candidate. Pick one and make it consistent with Requirement 1's status set.
+
+**Acceptance:** Test 6c runs two `finalizeAutoRigStage` calls for the same job against the shared `sql` mock where only the first claim returns a row; asserts exactly one R2 `putObject` and one avatar `update` occur, the second call no-ops, and the job ends `done`+`result_avatar_id` set. A thrown winner leaves the job at a cron-selectable (non-`'done'`, non-wedged) status.
+
+### 6. Tests proving the three guarantees
+Add `tests/auto-rig-completion.test.js` (vitest, mirroring `tests/auto-rig-gate.test.js` style and the `sql` mock pattern in `tests/agent-monetization.test.js` lines 18–33). Stub `api/_lib/db.js`'s `sql` with a queued result-set fixture, stub `api/_lib/r2.js`'s `putObject`/`publicUrl`, and stub the regen provider where a driver would call it. Cover:
+- **6a — done+null is recovered:** a `done`+`null` job with a valid `result_glb_url` is finalized to `done`+`result_avatar_id` by the recovery driver; provider `status()` not called (Req 4).
+- **6b — reaper runs under backlog:** full `BATCH` of candidates **and** a stubbed reaper update returning rows ⇒ handler response carries `reaped >= 1` (Req 2).
+- **6c — double-finalize is safe:** two concurrent finalizes ⇒ one winner, one no-op, single R2 write, job ends `done`+`result_avatar_id` (Req 5).
+
+**Acceptance:** `npx vitest run tests/auto-rig-completion.test.js` passes; full `npm test` still green.
+
+## Implementation notes
+
+- **Mirror the existing close contract.** `closeJob` (`api/_lib/auto-rig.js` lines 160–165) already writes `result_avatar_id` + `status = 'done'` together. Keep that atomicity. Strategy A simply removes every *other* writer of `status = 'done'` for auto-rig jobs so `closeJob` is the sole one.
+- **Don't break reconstruct.** The webhook (lines 204–223) and poll (lines 507–524) reconstruct branches must keep behaving exactly as today. Only the `mode === 'rerig' && params.auto_rig === true` paths change. Gate every edit on that predicate.
+- **Status vocabulary.** The codebase already uses `'queued' | 'running' | 'rigging' | 'done' | 'failed'`. If you introduce `'finalizing'`, ensure the cron candidate query and the `regenerate-status` response handling tolerate it (it should read as "in flight", not terminal). Grep for every `status in (...)` and every `status === 'done'` on `avatar_regen_jobs` before you finalize the vocabulary so nothing else mis-buckets the new value.
+- **SSRF guard stays.** When the cron recovery lane finalizes from a stored `result_glb_url`, that URL originated from the webhook which only stores it after `isAllowedResultUrl` passes (webhook lines 204–207). The cron does not need to re-validate, but do **not** loosen the webhook's host pin.
+- **Reaper SQL is already correct** (lines 83–92) — you are only relocating it out of the `if`, not rewriting it. Keep `returning job_id` so `reaped` stays accurate.
+- **`failJob` helper** (lines 51–57) is reusable for the unpollable/no-`ext_job_id` case (line 109–115) — don't duplicate it.
+- **Provider resolution** is a single `getRegenProvider()` for all auto-rig jobs (cron lines 97–105) — no per-job key juggling. The `done`+`null` recovery lane (Req 4) shouldn't even need the provider when `result_glb_url` is present; resolve the provider lazily only if a candidate lacks the stored URL.
+- **No esbuild contamination:** after editing `api/*.js`, run `head -1 api/webhooks/replicate.js api/cron/auto-rig-sweep.js api/_lib/auto-rig.js api/avatars/_actions.js` and confirm none start with `__defProp`/`createRequire`.
+
+## Verification
+
+Run, in order, and paste results into your final summary:
+
+1. **Targeted tests:**
+ ```
+ npx vitest run tests/auto-rig-completion.test.js
+ ```
+ All three cases (6a/6b/6c) green.
+2. **Full suite (no regressions):**
+ ```
+ npm test
+ ```
+ (or at minimum `npx vitest run` if Playwright deps are unavailable — say which you ran.)
+3. **No bundle contamination:**
+ ```
+ head -1 api/webhooks/replicate.js api/cron/auto-rig-sweep.js api/_lib/auto-rig.js api/avatars/_actions.js
+ ```
+ None start with `__defProp`/`createRequire`.
+4. **Manual cron smoke (real handler, local):** start the dev server (`npm run dev`), then invoke the cron with the real secret:
+ ```
+ curl -s -H "Authorization: Bearer $CRON_SECRET" http://localhost:3000/api/cron/auto-rig-sweep | jq
+ ```
+ Confirm the JSON always includes `reaped` (proving the reaper ran) and `scanned`/`finalized`/`failed`/`pending`/`errored`. (If `CRON_SECRET` is absent locally, note the 503 `not_configured` is the correct fail-closed behavior and rely on the tests.)
+5. **Diff review:** `git diff` every changed file; justify each line; confirm only the `rerig`/`auto_rig` paths changed and reconstruct/webhook-signature code is untouched.
+
+## Definition of done
+
+- [ ] A `done`+`null` auto-rig job with a stored `result_glb_url` is recovered by at least one headless-capable driver (cron), proven by test 6a.
+- [ ] The MAX_AGE reaper runs on **every** cron tick regardless of candidate count, proven by test 6b; `reaped` always present in the response.
+- [ ] Throughput (BATCH and/or schedule) is raised with a commented arithmetic justification; candidates ordered oldest-quiet-first.
+- [ ] Recovery reuses a stored `result_glb_url` instead of re-polling the provider (test 4/6a).
+- [ ] `finalizeAutoRigStage` is concurrency-safe via a DB-level claim: one winner, losers no-op, a thrown winner releases the claim to a cron-selectable status (test 6c).
+- [ ] Reconstruct pipeline, webhook signature verification, SSRF host pinning, and the rig gate are all unchanged.
+- [ ] `npm test` green; no console errors/warnings from changed code; no esbuild-contaminated `api/*.js`.
+- [ ] `data/changelog.json` has one `fix` entry (plain language: avatars that failed to finish rigging now self-heal); `npm run build:pages` run and passing.
+- [ ] `git diff` self-reviewed; staged with explicit paths only.
+
+## Out of scope / follow-ups
+
+- Mesh→rig **gate** tuning (when to auto-rig at all) — `01-...md`.
+- Reconstruct-pipeline finalize hardening (`api/_lib/reconstruct-finalize.js`) — defer unless a shared helper extraction is trivially safe.
+- Surfacing a per-avatar "rigging…" / "rig failed, retry" state in the avatar UI — note the gap for a follow-up UI prompt; don't build it here.
+- Provider-side webhook retry configuration on Replicate — infra, out of band.
diff --git a/prompts/avatar-autorig/03-ssrf-hardening.md b/prompts/avatar-autorig/03-ssrf-hardening.md
new file mode 100644
index 000000000..5c1581fec
--- /dev/null
+++ b/prompts/avatar-autorig/03-ssrf-hardening.md
@@ -0,0 +1,154 @@
+# Centralize SSRF host-pinning for all provider-result GLB fetches
+
+> One-line: "Paste this into a fresh Claude Code chat at the repo root and execute it fully."
+
+## Operating rules (non-negotiable)
+- You are building **three.ws** — a platform meant to compete with the best in the world. Senior-engineer bar: no shortcuts, ship complete polished work.
+- **No mocks, no fake data, no placeholders, no TODO comments, no stub functions, no `throw new Error("not implemented")`, no fake setTimeout loading.** Real APIs, real endpoints, real wiring only. If credentials are missing, locate them in `.env` / `vercel env`, else proceed with the real integration.
+- **$THREE is the ONLY coin** this platform may reference. Contract: `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`. Never name, import, hardcode, or recommend any other token anywhere.
+- **Concurrent agents share this worktree.** Stage explicit paths only (never `git add -A`/`git add .`); re-check `git status` and `git diff --staged` immediately before any commit.
+- **Changelog:** every user-visible change gets an entry in `data/changelog.json` (date, holder-readable title + summary, tags from feature|improvement|fix|sdk|infra|docs|security); then run `npm run build:pages`. Internal-only chores get no entry.
+- **Push to BOTH remotes when asked to push:** `git push threeD main` AND `git push threews main`. NEVER pull/fetch/merge from `threeD`; pulls come from `threews` only.
+- **Trap:** `npx vercel build` overwrites `api/*.js` with esbuild bundles — before committing an `api/` diff, check `head -1` for `__defProp`/`createRequire` and `git restore -- api/ public/` if contaminated.
+- **Definition of done:** code wired + reachable; every state designed; no console errors/warnings from your code; real API calls verified; existing tests pass (`npm test`); `git diff` self-reviewed; you'd demo it proudly to senior engineers.
+- Read `CLAUDE.md` and `STRUCTURE.md` first. Use TodoWrite for 3+ step tasks. Keep communication short.
+
+## Context
+The auto-rig pipeline submits a `rerig` job to a remote provider (Replicate today), then fetches the provider-returned GLB URL server-side, canonicalizes it, and stores it. **Fetching an attacker-influenceable URL server-side is a classic SSRF sink:** if a forged/compromised provider payload points the fetch at `http://169.254.169.254/...` (cloud metadata), `http://127.0.0.1:.../` (loopback), or an RFC1918 address, the server will dutifully connect.
+
+The Replicate **webhook** path already defends this with a host allowlist (`isAllowedResultUrl`) that pins the URL to Replicate's delivery hosts before handing it to the finalize stage. But the **other three completion paths fetch the same kind of URL with a bare `fetch()` and no guard at all**: the browser regenerate-status poll, the cron sweep, and the reconstruct rig poller. This is an inconsistent, partial defense — exactly the kind of half-wired security boundary the operating rules forbid. The repo also already ships a battle-tested SSRF guard (`api/_lib/ssrf-guard.js`) with DNS-resolution, per-redirect-hop re-validation, and IP-pinned connect — but the auto-rig fetch paths don't use it.
+
+This is part 3 of the 9-part auto-rig hardening program in `prompts/avatar-autorig/`. It is independent of the sibling-materialization keystone (`01-sibling-materialization.md`) — apply the guard to whatever finalize signature exists when you run. Coordinate with `02-completion-statemachine.md` (same paths) only to avoid stepping on its edits.
+
+## Background findings
+Confirm each of these by reading the code before you change anything.
+
+1. **The GOOD path — webhook host-pin.** `api/webhooks/replicate.js`:
+ - `REPLICATE_RESULT_HOSTS` (~line 63-67): `['replicate.delivery','replicate.com','pbxt.replicate.delivery']`.
+ - `isAllowedResultUrl(raw)` (~line 69-79): parses the URL, requires `https:`, lowercases the host, allows exact match or `.`-suffix match against the host list.
+ - `extractGlbUrl(output)` (~line 81-98): pulls a URL out of provider output. **Weakness:** for a plain string it returns `output` verbatim (line 83) with no `http(s)` check; the object branch (line 92-96) returns any stringy value at keys `glb|mesh|mesh_url|output_url|url|model` with no scheme check. The host-pin downstream currently saves it on the webhook path only.
+ - Both finalize calls are gated by `isAllowedResultUrl(nextGlbUrl)` (line 207 and line 232) before `finalizeReconstructStage` / `finalizeAutoRigStage`. Good — but this gate lives in this one file.
+
+2. **NO-pin path #1 — browser poll.** `api/avatars/_actions.js`:
+ - Poll at line 459-493 reads `update.resultGlbUrl` from `provider.instance.status(...)` and writes it to `avatar_regen_jobs.result_glb_url` with **no host validation**.
+ - It then calls `finalizeReconstructStage(... glbUrl: job.result_glb_url)` (line 519), `finalizeAutoRigStage(... glbUrl: job.result_glb_url)` (line 538), and `pollRiggingStage(...)` (line 500) — none guarded.
+
+3. **NO-pin path #2 — cron sweep.** `api/cron/auto-rig-sweep.js` line 117-125: `update = await provider.instance.status(job.ext_job_id)`; on `done` it calls `finalizeAutoRigStage({ ... glbUrl: update.resultGlbUrl })` with **no host validation**.
+
+4. **NO-pin path #3 — rig poller.** `api/_lib/reconstruct-finalize.js`:
+ - `fetchGlbBuffer(url)` (line 27-35) is a bare `await fetch(url)` — no SSRF guard.
+ - `pollRiggingStage` fetches `update.resultGlbUrl` (line 251) and `rig.unriggedUrl` (line 238, 262) through it.
+ - `finalizeReconstructStage` fetches `glbUrl` (line 142) through it.
+ - `api/_lib/auto-rig.js` has its OWN duplicate `fetchGlbBuffer` (line 48-56), also a bare `fetch`, used by `finalizeAutoRigStage` (line 185).
+
+5. **The reusable guard already exists.** `api/_lib/ssrf-guard.js` exports:
+ - `assertSafePublicUrl(input, { allowHttp })` (line 101) — parse + protocol-check + DNS-resolve + per-address private/metadata/loopback rejection; throws `SsrfBlockedError`.
+ - `fetchSafePublicUrl(input, init, opts)` (line 134) — assert + fetch, follows redirects MANUALLY re-validating each hop.
+ - `fetchSafePublicUrlPinned(input, init, opts)` (line 159) — IP-pinned connect, closes the DNS-rebinding window; intended "for any fetch whose response is forwarded to another service or executed." Already used by `api/pump-fun-mcp.js`, `api/widgets/[id]/[action].js`, `api/_lib/onchain.js`, etc.
+ - `SsrfBlockedError` (line 65) — `code: 'ssrf_blocked'`, `status: 400`.
+ - Blocks: AWS/Azure/GCP/Alibaba IMDS IPs, all RFC1918, loopback, link-local, ULA, CGNAT, multicast, `::ffff:` mapped (line 22-63).
+
+6. **Test framework.** `npm test` = `vitest run && playwright test` (`package.json` line 145). Vitest config at `vitest.config.js`. Existing related test: `tests/auto-rig-gate.test.js`.
+
+## Scope — in / out
+**In scope**
+- A single shared "provider-result URL" guard module: parse + scheme + **provider-host allowlist** + the full `ssrf-guard.js` IP/DNS checks.
+- Replace the per-path host-pin and bare `fetch()` calls on ALL FOUR paths (webhook, browser poll, cron sweep, reconstruct rig poller incl. `auto-rig.js`) with the shared guard.
+- Tighten `extractGlbUrl` so non-`http(s)` / non-string output is never returned as a fetch target.
+- Vitest tests proving private/loopback/metadata hosts are rejected on the poll AND cron paths, not just the webhook.
+
+**Out of scope**
+- Changing provider submission, the rig/materialize decision, or completion state transitions (that's `02-completion-statemachine.md`).
+- Cost/consent gates (`04-`), cache/backfill (`06-`), quality gate (`07-`), observability events (`08-`).
+- Re-architecting `ssrf-guard.js` itself — reuse it as-is.
+
+## Key files & entry points
+- `api/_lib/ssrf-guard.js` — reuse `fetchSafePublicUrlPinned` / `assertSafePublicUrl` / `SsrfBlockedError`. Do not reimplement IP checks.
+- `api/_lib/provider-result-url.js` — **NEW** shared module you will create (name it precisely; see Requirements).
+- `api/webhooks/replicate.js` — move `REPLICATE_RESULT_HOSTS` + `isAllowedResultUrl` + harden `extractGlbUrl` into the shared module; import from there.
+- `api/avatars/_actions.js` — poll (line 459-493) + finalize calls (line 500/519/538).
+- `api/cron/auto-rig-sweep.js` — line 117-125.
+- `api/_lib/reconstruct-finalize.js` — `fetchGlbBuffer` (line 27-35), used by `finalizeReconstructStage` + `pollRiggingStage`.
+- `api/_lib/auto-rig.js` — duplicate `fetchGlbBuffer` (line 48-56), used by `finalizeAutoRigStage`.
+- `tests/` — add a vitest spec; mirror `tests/auto-rig-gate.test.js` style.
+
+## Requirements
+Each requirement has an acceptance criterion (AC). All must hold.
+
+1. **Create `api/_lib/provider-result-url.js`** exporting:
+ - `PROVIDER_RESULT_HOSTS` — the allowlist, seeded from the webhook's `REPLICATE_RESULT_HOSTS` (`replicate.delivery`, `replicate.com`, `pbxt.replicate.delivery`). Comment that these are the hosts a provider serves rigged/reconstructed GLBs from.
+ - `isAllowedProviderResultUrl(raw)` — exactly the webhook semantics: parse; require `https:`; lowercase host; exact-or-`.`-suffix match against `PROVIDER_RESULT_HOSTS`; return boolean (never throw).
+ - `extractGlbUrl(output)` — hardened version (see Req 3).
+ - `assertProviderResultUrl(raw)` — throws `SsrfBlockedError('result url not on an allowed provider host')` when `isAllowedProviderResultUrl(raw)` is false; otherwise returns the raw string. Reuse the existing `SsrfBlockedError` class.
+ - `fetchProviderGlbBuffer(url, { maxBytes })` — the single canonical fetch-and-buffer helper (see Req 4).
+ - **AC:** `node -e "import('./api/_lib/provider-result-url.js').then(m=>console.log(Object.keys(m)))"` lists all five exports; importing has no side effects.
+
+2. **Webhook reuses the shared module — no behavior change there.** In `api/webhooks/replicate.js`, delete the local `REPLICATE_RESULT_HOSTS`, `isAllowedResultUrl`, and `extractGlbUrl`; import `isAllowedProviderResultUrl` (aliased to `isAllowedResultUrl` at call sites or rename the calls) and `extractGlbUrl` from `provider-result-url.js`. The two finalize gates (line 207, 232) keep gating on the allowlist check.
+ - **AC:** `grep -n "REPLICATE_RESULT_HOSTS\|function isAllowedResultUrl\|function extractGlbUrl" api/webhooks/replicate.js` returns nothing; the file imports them from `../_lib/provider-result-url.js`; webhook still rejects a non-allowlisted output URL (does not call finalize).
+
+3. **Harden `extractGlbUrl`.** A returned value MUST be a `string` that begins with `https://` (or `http://` only if you also keep an `allowHttp` story consistent with the guard — default reject `http:`). For the string branch, validate scheme before returning. For the array branch, keep the "prefer `.glb`" preference but only return entries matching `^https?:\/\//`. For the object branch, validate each candidate's scheme. Non-string, empty, or non-http(s) input returns `null`.
+ - **AC:** unit assertions: `extractGlbUrl('file:///etc/passwd')`, `extractGlbUrl('javascript:alert(1)')`, `extractGlbUrl({ url: 'gopher://x' })`, `extractGlbUrl(42)`, `extractGlbUrl({ url: 169 })` all return `null`; `extractGlbUrl('https://pbxt.replicate.delivery/x.glb')` returns the string; `extractGlbUrl(['https://a/x.glb','https://b/y.png'])` returns the `.glb` entry.
+
+4. **`fetchProviderGlbBuffer` is the only place provider GLB bytes are fetched.** It must:
+ - Call `assertProviderResultUrl(url)` first (host allowlist gate).
+ - Fetch via `fetchSafePublicUrlPinned(url, { signal }, { allowHttp: false })` from `ssrf-guard.js` (pinned connect + per-hop re-validation — the response is stored/forwarded, so use the pinned variant, matching `ssrf-guard.js`'s own guidance at line 152-158).
+ - Enforce the existing `MAX_GLB_BYTES` ceiling (64 MB) on both the `content-length` header and the actual buffer length, preserving the current error messages (`fetch glb: <status>`, `glb too large: <n> bytes`).
+ - Apply a request timeout (use `AbortSignal.timeout(...)`, e.g. 30s) so a hung provider host can't wedge a serverless invocation.
+ - **AC:** calling it with `http://169.254.169.254/x.glb`, `https://localhost/x.glb`-style private targets, or any non-allowlisted host throws `SsrfBlockedError` (`code === 'ssrf_blocked'`) BEFORE any socket to a private range; a 64 MB+ `content-length` throws the size error.
+
+5. **Replace both duplicate `fetchGlbBuffer` definitions with the shared helper.** In `api/_lib/reconstruct-finalize.js` (line 27-35) and `api/_lib/auto-rig.js` (line 48-56), delete the local `fetchGlbBuffer` and import `fetchProviderGlbBuffer` (use it directly or re-export a `fetchGlbBuffer` alias). Every call site — `finalizeReconstructStage` (line 142), `pollRiggingStage` (line 238, 251, 262), `finalizeAutoRigStage` (line 185) — now routes through the guarded fetch.
+ - **AC:** `grep -rn "await fetch(" api/_lib/reconstruct-finalize.js api/_lib/auto-rig.js` returns nothing; both files import from `provider-result-url.js`; `MAX_GLB_BYTES` is defined once (in the shared module) and not duplicated.
+
+6. **Browser poll path gates before persisting/fetching.** In `api/avatars/_actions.js` poll block (line 459-493), when `update.resultGlbUrl` is present, validate it with `isAllowedProviderResultUrl` before writing it to `result_glb_url`. If it fails, do NOT persist the URL — set `nextStatus = 'failed'` and `nextError = 'provider returned a disallowed result url'` so the job terminates cleanly and the client sees an actionable error instead of a silent SSRF attempt. (Defense-in-depth: the shared fetch helper would reject it anyway, but failing early keeps a poisoned URL out of the DB.)
+ - **AC:** a stubbed provider `status()` returning `resultGlbUrl: 'http://127.0.0.1/x.glb'` results in the job row going `failed` with that error string and `result_glb_url` left null; no finalize stage is invoked.
+
+7. **Cron sweep gates before finalize.** In `api/cron/auto-rig-sweep.js` (line 117-125), before calling `finalizeAutoRigStage`, validate `update.resultGlbUrl` with `isAllowedProviderResultUrl`. On failure call `failJob(...)` with `'provider returned a disallowed result url'` and increment `summary.failed` instead of finalizing.
+ - **AC:** a stubbed `status()` returning a private/metadata `resultGlbUrl` fails the job (does not call `finalizeAutoRigStage`); a valid `pbxt.replicate.delivery` URL still finalizes.
+
+8. **No path can reach `putObject` with attacker-controlled bytes from a disallowed host.** Audit: every server-side fetch of a provider-returned URL in the auto-rig/reconstruct flow goes through `fetchProviderGlbBuffer`. `rig.unriggedUrl` is one we generated via `publicUrl(...)` (R2 host) — it must ALSO pass the guard (your own R2/CDN public host must therefore be in `PROVIDER_RESULT_HOSTS`, or `unriggedUrl` fetches must use a separate already-trusted helper). Decide explicitly and comment which hosts are allowed and why. Do not leave `rig.unriggedUrl` fetching through a bare `fetch`.
+ - **AC:** `grep -rn "fetch(" api/_lib/reconstruct-finalize.js api/_lib/auto-rig.js api/cron/auto-rig-sweep.js` shows only guarded helpers (or `fetchSafePublicUrl*`); the R2 public host is covered so legitimate `unriggedUrl` fetches succeed in `npm test`.
+
+9. **Errors handled at the boundary.** A `SsrfBlockedError` thrown mid-finalize must not crash the webhook ack, the cron sweep loop, or the poll response — each already has a try/catch; ensure the blocked case is caught there and logged with the job id (`console.warn('[<path>] blocked result url', { jobId, host })`), never swallowed silently into a 500.
+ - **AC:** triggering a blocked URL on each path produces a warn log and a clean response (webhook 200 ack, cron continues the batch, poll returns `failed`), no unhandled rejection.
+
+10. **Tests (vitest).** Add `tests/provider-result-url.test.js` covering: `extractGlbUrl` hardening (Req 3 ACs); `isAllowedProviderResultUrl` allow/deny matrix incl. `.`-suffix match and `http:` rejection; `assertProviderResultUrl` throws `SsrfBlockedError` on a disallowed host. Add `tests/auto-rig-ssrf.test.js` (or extend an existing spec) that stubs `getRegenProvider`/`provider.instance.status` to return a loopback/metadata `resultGlbUrl` and asserts: (a) the browser-poll handler fails the job without persisting the URL; (b) the cron sweep fails the job without calling `finalizeAutoRigStage`. Stub the provider — never hit a real network host in tests.
+ - **AC:** `npx vitest run tests/provider-result-url.test.js tests/auto-rig-ssrf.test.js` passes; the SSRF cases would FAIL against the pre-change code (verify by reasoning/temporarily reverting the guard).
+
+## Implementation notes
+- **Reuse, don't reinvent.** All IP/DNS/redirect logic lives in `ssrf-guard.js`. The new module adds only the provider-host allowlist + GLB extraction/size-ceiling on top. The pinned fetch (`fetchSafePublicUrlPinned`) already re-validates every redirect hop (line 204-208) — that satisfies "re-validate every redirect hop."
+- **Layering.** Host allowlist (`isAllowedProviderResultUrl`) is the narrow positive gate; `ssrf-guard.js` is the broad negative gate. Apply BOTH: a provider could be compromised to redirect a `replicate.delivery` URL toward a private IP, so the IP check still matters after the host check passes.
+- **`extractGlbUrl` string branch** is the riskiest line (`replicate.js` line 83 returns `output` raw). A provider field like `output: "file:///etc/passwd"` currently passes straight through. Validate scheme there.
+- **Match existing error surfaces.** Keep `fetch glb: <status>` and `glb too large` messages so existing error-path tests/logs don't churn.
+- **`SsrfBlockedError` import** comes from `ssrf-guard.js`; do not define a second error class.
+- **Don't double-define `MAX_GLB_BYTES`** — export it from the shared module and import in both `reconstruct-finalize.js` and `auto-rig.js`.
+- **Coordinate with `01-` / `02-`.** If sibling-materialization changed `finalizeAutoRigStage`'s signature, apply the guarded fetch to whatever fetch call exists. The guard is orthogonal to the materialization shape.
+- **Watch the `npx vercel build` trap** — if you ever run it, check `head -1 api/...` for `__defProp` and `git restore` before committing.
+
+## Verification
+Run and read the output of each:
+- `npx vitest run tests/provider-result-url.test.js tests/auto-rig-ssrf.test.js` — new specs pass.
+- `npm test` — full suite still green (vitest + playwright).
+- `grep -rn "await fetch(" api/_lib/reconstruct-finalize.js api/_lib/auto-rig.js` — empty (all routed through the guard).
+- `grep -n "REPLICATE_RESULT_HOSTS\|function isAllowedResultUrl\|function extractGlbUrl" api/webhooks/replicate.js` — empty (moved to shared module).
+- `grep -rn "provider-result-url" api/` — imported by `replicate.js`, `_actions.js`, `auto-rig-sweep.js`, `reconstruct-finalize.js`, `auto-rig.js`.
+- Manual reasoning check: trace each of the four paths (webhook, poll, cron, rig poller) and confirm there is no `fetch(<provider url>)` that bypasses `assertProviderResultUrl` + a `ssrf-guard.js` fetch.
+- `head -1 api/_lib/provider-result-url.js api/webhooks/replicate.js` — confirm not esbuild-bundled (no `__defProp`/`createRequire`).
+- `git diff --staged` self-review before committing; stage explicit paths only.
+
+## Definition of done
+- [ ] `api/_lib/provider-result-url.js` exists with the five exports; reuses `ssrf-guard.js` (no reimplemented IP logic).
+- [ ] All four provider-result fetch paths (webhook, browser poll, cron sweep, reconstruct rig poller incl. `auto-rig.js`) go through `assertProviderResultUrl` + `fetchProviderGlbBuffer`.
+- [ ] `extractGlbUrl` rejects non-http(s) / non-string output.
+- [ ] Browser poll and cron sweep fail the job cleanly on a disallowed URL without persisting/finalizing it.
+- [ ] No bare `await fetch(<provider url>)` remains in the auto-rig/reconstruct flow.
+- [ ] New vitest specs pass and would fail against pre-change code; `npm test` green.
+- [ ] No console errors/warnings from your code beyond the intended `[..] blocked result url` warns.
+- [ ] Changelog entry added (tag `security`, holder-readable: "Hardened avatar auto-rig against malicious provider URLs across all completion paths") and `npm run build:pages` run.
+- [ ] `git diff --staged` reviewed; explicit paths staged; not esbuild-contaminated.
+
+## Out of scope / follow-ups
+- Completion state-machine consistency across these same paths → `02-completion-statemachine.md`.
+- Sibling-avatar materialization semantics → `01-sibling-materialization.md` (KEYSTONE).
+- Cost/consent gates before submitting rig jobs → `04-cost-and-consent-gates.md`.
+- Coverage gaps for other creation paths → `05-coverage-gaps.md`.
+- Rig cache/backfill → `06-rig-cache-and-backfill.md`; quality gate/fallback → `07-quality-gate-and-fallback.md`; observability/events → `08-observability-and-events.md`; full test suite → `09-test-suite.md`.
diff --git a/prompts/avatar-autorig/04-cost-and-consent-gates.md b/prompts/avatar-autorig/04-cost-and-consent-gates.md
new file mode 100644
index 000000000..c8a837722
--- /dev/null
+++ b/prompts/avatar-autorig/04-cost-and-consent-gates.md
@@ -0,0 +1,153 @@
+# Gate auto-rig spend, abuse, humanoid eligibility, and private-avatar privacy
+
+> One-line: "Paste this into a fresh Claude Code chat at the repo root and execute it fully."
+
+## Operating rules (non-negotiable)
+- You are building **three.ws** — a platform meant to compete with the best in the world. Senior-engineer bar: no shortcuts, ship complete polished work.
+- **No mocks, no fake data, no placeholders, no TODO comments, no stub functions, no `throw new Error("not implemented")`, no fake setTimeout loading.** Real APIs, real endpoints, real wiring only. If credentials are missing, locate them in `.env` / `vercel env`, else proceed with the real integration.
+- **$THREE is the ONLY coin** this platform may reference. Contract: `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`. Never name, import, hardcode, or recommend any other token anywhere.
+- **Concurrent agents share this worktree.** Stage explicit paths only (never `git add -A`/`git add .`); re-check `git status` and `git diff --staged` immediately before any commit.
+- **Changelog:** every user-visible change gets an entry in `data/changelog.json` (date, holder-readable title + summary, tags from feature|improvement|fix|sdk|infra|docs|security); then run `npm run build:pages`. Internal-only chores get no entry.
+- **Push to BOTH remotes when asked to push:** `git push threeD main` AND `git push threews main`. NEVER pull/fetch/merge from `threeD`; pulls come from `threews` only.
+- **Trap:** `npx vercel build` overwrites `api/*.js` with esbuild bundles — before committing an `api/` diff, check `head -1` for `__defProp`/`createRequire` and `git restore -- api/ public/` if contaminated.
+- **Definition of done:** code wired + reachable; every state designed; no console errors/warnings from your code; real API calls verified; existing tests pass (`npm test`); `git diff` self-reviewed; you'd demo it proudly to senior engineers.
+- Read `CLAUDE.md` and `STRUCTURE.md` first. Use TodoWrite for 3+ step tasks. Keep communication short.
+
+## Context
+Auto-rig fires on **every** non-rigged avatar create. `POST /api/avatars` (upload/import) and `POST /api/avatars/from-forge` (chat "text → 3D avatar" save) both call `maybeAutoRigAvatar()` from a `queueMicrotask` after the 201 returns. That call submits a **paid GPU rerig job** on Replicate / a self-host backend. Today the spend path is wide open: there is no per-user rate limit on the rig submission, no plan/holder gate, no daily account spend ceiling, no humanoid eligibility check, and private avatars are handed a **permanent public R2 URL** to a third-party provider. This is the cost-and-consent gate for the auto-rig program. It sits alongside `01-sibling-materialization.md` (the keystone — auto-rig now materializes a rigged SIBLING avatar with `parent_avatar_id` = the static source, rather than swapping `storage_key` in place; build this on the sibling model, not the in-place swap) and the abuse/SSRF work in `03-ssrf-hardening.md`.
+
+Why it matters: each auto-rig job is real money (UniRig GPU time). An attacker can script avatar creates and burn the platform's GPU budget at zero cost to themselves; a non-humanoid mesh burns a job and produces a garbage skeleton; and a user's **private** avatar mesh is currently shipped to an external provider over a long-lived public URL with no record and no opt-out. The forge MCP tool already solved the humanoid problem with a real classifier and the money-safety posture — we mirror that bar server-side.
+
+## Background findings
+Confirm each by reading the file before you change it.
+
+- `api/avatars/index.js:153-160` — `handleCreate` calls `maybeAutoRigAvatar({ userId, avatar, rigInfo: body.source_meta, source })` inside `queueMicrotask`, **after** `json(res, 201, ...)`. The create path itself has **no** `limits.upload` (or any) rate-limit call — uploads are gated only by `enforceQuotas` (size). So the paid rig job is submitted with zero rate limiting.
+- `api/avatars/from-forge.js:62-66` — this route **does** call `limits.upload(auth.userId)` (60/h) before the save, but that bucket gates the *save*, not the rig; and at `:163-170` it auto-rigs unconditionally for static meshes. At `:83` and `:143`/`:167` it trusts a **client-supplied `rigged:true`** body flag (`const rigged = body?.rigged === true`) — fed straight into `rigInfoIsRigged` via `is_rigged`. A client can send `rigged:true` on a static mesh to **skip** the rig gate, or `rigged:false` to **force** a paid rig — neither is verified against the actual GLB.
+- `api/_lib/auto-rig.js:85-147` — `maybeAutoRigAvatar` gates only on: avatar present, `rigInfoIsRigged(rigInfo)`, provider configured + `supportsMode('rerig')`, and an in-flight idempotency check (`:108-116`). There is **no** rate limit, **no** plan/tier gate, **no** spend ceiling, and **no** humanoid eligibility check before `provider.instance.submit(...)` at `:121`.
+- `api/_lib/auto-rig.js:118` — `const sourceUrl = publicUrl(avatar.storage_key)` always hands a **permanent public CDN URL** to the provider via `submit({ sourceUrl, ... })` at `:121-128`, regardless of the avatar's `visibility`. `maybeAutoRigAvatar`'s signature (`{ userId, avatar, rigInfo, source }`) does not even receive `visibility`, though `createAvatar` returns it on the `avatar` row (`api/_lib/avatars.js:106-128`, `returning *` → `decorate(row)`).
+- `api/_lib/r2.js:61-65` — `presignGet({ key, expiresIn = 600 })` already exists and returns a short-lived signed GET URL for bucket keys (passes through absolute URLs untouched). This is the privacy-preserving handoff URL.
+- `api/_lib/rate-limit.js:380` — `limits.upload = getLimiter('upload', { limit: 60, window: '1 h' })` exists but is **not** marked `critical`. There is **no** `limits.rig` bucket. Money-moving buckets in this file use `critical: true` (fail closed in prod without Redis) and many add a `*Global` circuit breaker (e.g. `mcp3dGenerate`/`mcp3dGenerateGlobal` at `:309-321`, `videoGenerateUser`/`videoGenerateGlobal` at `:698-703`) — mirror that pattern.
+- `mcp-server/src/tools/_humanoid.js` — `classifyHumanoidPrompt(prompt)` is a dependency-free, synchronous keyword classifier returning `{ humanoid, confidence, reason, signals }`. `forge_avatar` (`mcp-server/src/tools/forge-avatar.js:313-341`) runs it **before** paid work and only hard-blocks on a confident `humanoid:false`. This is the exact gate to reuse for prompt-derived auto-rig decisions.
+- `api/_lib/three-tier.js` — `resolveUserTier(user)`, `holderUsd(wallet)`, `tierForUsd(usd)`, `TIERS` exist for $THREE holder tiering. `getSessionUser` returns `u.plan` (`api/_lib/auth.js:185`). Use these for the plan/tier gate — do not invent a new entitlement system.
+
+## Scope — in / out
+**In:**
+- A dedicated `limits.rig` per-user rate limit + a `limits.rigGlobal` circuit breaker, enforced **inside** `maybeAutoRigAvatar` before `submit`.
+- A daily per-account spend ceiling on auto-rig jobs (count-based, keyed per user, 24h window, critical).
+- A humanoid eligibility gate before paying to rig, reusing the `classifyHumanoidPrompt` classifier on the prompt/source signal, with a non-humanoid skip.
+- Privacy: private avatars get a short-lived presigned GET URL (not a permanent public URL) handed to the provider; record in `source_meta` that the mesh was sent externally; opt-out env for private avatars.
+- Stop trusting the client `rigged` flag in `from-forge` without server-side GLB verification.
+- Tests for all of the above.
+
+**Out (do not touch here):**
+- The sibling-materialization completion path (`01-sibling-materialization.md`).
+- SSRF hardening of provider/import URLs (`03-ssrf-hardening.md`).
+- Quality gate / fallback on the rigged result (`07-quality-gate-and-fallback.md`).
+- Observability/event emission beyond the minimal `source_meta` breadcrumbs here (`08-observability-and-events.md`).
+
+## Key files & entry points
+- `api/_lib/auto-rig.js` — `maybeAutoRigAvatar()` is where every gate lands (before `submit` at `:121`). `rigInfoIsRigged` at `:41` defines "already rigged".
+- `api/avatars/index.js` — `handleCreate` at `:45`; the auto-rig `queueMicrotask` at `:153`.
+- `api/avatars/from-forge.js` — client `rigged` flag at `:83`; auto-rig `queueMicrotask` at `:163`.
+- `api/_lib/rate-limit.js` — add buckets in the `limits` object (~`:380`, near `upload`).
+- `api/_lib/r2.js` — `presignGet` at `:61`, `publicUrl` at `:139`.
+- `api/_lib/three-tier.js` — `resolveUserTier`, `holderUsd`, `tierForUsd`, `TIERS`.
+- `mcp-server/src/tools/_humanoid.js` — `classifyHumanoidPrompt`. **This module lives under `mcp-server/`.** Either import it from `api/` if the path resolves cleanly under Vercel bundling, or (preferred) extract the classifier into a shared module both consume — see Implementation notes.
+- `tests/` — add a focused test file (e.g. `tests/auto-rig-gates.test.js`).
+
+## Requirements
+Each requirement is numbered with an explicit acceptance criterion.
+
+1. **Add `limits.rig` and `limits.rigGlobal` to `api/_lib/rate-limit.js`.**
+ - `rig: (userId) => getLimiter('rig', { limit: 10, window: '1 h', critical: true }).limit(userId)` — per-user hourly ceiling on auto-rig submissions. `critical: true` so a Redis outage in prod fails closed (a paid job is money-moving), matching the posture of `mcp3dGenerate`/`videoGenerateUser`.
+ - `rigGlobal: () => getLimiter('rig:global', { limit: Math.max(60, Number(process.env.AUTO_RIG_GLOBAL_HOURLY) || 300), window: '1 h', critical: true }).limit('global')` — the shared-GPU-budget circuit breaker, env-tunable, floored, mirroring `mcp3dGenerateGlobal`.
+ - **Acceptance:** both buckets export and are callable; defaults are documented in a comment matching the surrounding style; `limits.rig` and `limits.rigGlobal` resolve `{ success }` objects in a unit test using the in-memory limiter.
+
+2. **Add a daily per-account spend ceiling `limits.rigDaily`.**
+ - `rigDaily: (userId) => getLimiter('rig:daily', { limit: Math.max(5, Number(process.env.AUTO_RIG_DAILY_PER_USER) || 20), window: '1 d', critical: true }).limit(userId)`.
+ - This is the hard cost cap independent of the hourly burst bucket — a 24h ceiling so a user can't drip-feed 10/h around the clock.
+ - **Acceptance:** the bucket exists, is `critical`, env-tunable, floored at 5; documented in a comment.
+
+3. **Enforce all three buckets INSIDE `maybeAutoRigAvatar`, before `submit`.**
+ - In `api/_lib/auto-rig.js`, after the `canRig` check and the in-flight idempotency check (so a no-op never consumes budget), and before building `sourceUrl`/calling `submit`, check in order: `limits.rig(userId)`, `limits.rigDaily(userId)`, `limits.rigGlobal()`. On any `!success`, return `{ queued: false, skipped: 'rate_limited' }` (or `'daily_cap'` / `'global_cap'` to distinguish) without submitting and without inserting a job row.
+ - The whole function must remain best-effort (never throw into the caller) — wrap the limiter calls so a limiter error degrades to "skip rig", never a thrown create.
+ - **Acceptance:** a test that stubs the limiter to deny returns the corresponding `skipped` reason and asserts `provider.instance.submit` was **not** called and **no** `avatar_regen_jobs` row was inserted.
+
+4. **Add a plan/holder tier gate before paying to rig.**
+ - Auto-rig is a paid perk. Decide eligibility from the owner's plan / $THREE holder tier using `api/_lib/three-tier.js` (`resolveUserTier`) and the user's `plan`. Implement a single `isAutoRigEligible({ userId, plan })`-style helper (place it in `auto-rig.js` or a small `api/_lib/auto-rig-eligibility.js`) that returns a boolean. Make the policy explicit and env-overridable via `AUTO_RIG_REQUIRE_TIER` (default: allow all authenticated owners through, but the gate **exists and is wired** so tightening is a config change, not a code change). Free uploads from a brand-new account that exhibit abuse patterns are already bounded by req 3; this gate is the deliberate plan lever.
+ - `maybeAutoRigAvatar` must call it before submit; on ineligible, return `{ queued: false, skipped: 'plan_gate' }`.
+ - **Acceptance:** with `AUTO_RIG_REQUIRE_TIER` set to a tier the test user lacks, `maybeAutoRigAvatar` returns `skipped: 'plan_gate'` and does not submit; with the default policy, an authenticated owner passes.
+
+5. **Add a humanoid eligibility gate before paying to rig.**
+ - Reuse `classifyHumanoidPrompt`. The reliable text signal available at auto-rig time is the generation prompt: `from-forge` has `source_meta.source_prompt` (`api/avatars/from-forge.js:139-146`); uploads may carry `source_meta.source_prompt`/`source_meta.prompt`. Pass the best available prompt string into `maybeAutoRigAvatar` (extend its signature, e.g. `{ ..., prompt }`, and have both callers supply it from `body.source_meta?.source_prompt` / equivalent).
+ - Run the classifier; **only hard-skip on a confident `humanoid:false`** (mirror `forge_avatar`'s posture — ambiguity proceeds, since the user explicitly created an avatar). On skip, return `{ queued: false, skipped: 'not_humanoid' }` and record the reason on the avatar's `source_meta` (e.g. `auto_rig_skipped: 'not_humanoid'`, `auto_rig_skip_reason: verdict.reason`) so the UI/owner can see why it didn't rig.
+ - When **no** prompt is available (a raw GLB upload), do not block on text — proceed (req 3's spend caps remain the backstop). Leave a `source_meta.auto_rig_humanoid_check: 'no_prompt'` breadcrumb.
+ - **Acceptance:** `maybeAutoRigAvatar({ ..., prompt: 'an oak dining table' })` returns `skipped: 'not_humanoid'`, does not submit, and stamps the skip reason in `source_meta`; `prompt: 'a cartoon astronaut'` proceeds; no prompt proceeds.
+
+6. **Share the humanoid classifier without duplicating the term lists.**
+ - Do not copy/paste the keyword arrays. Either (a) import `classifyHumanoidPrompt` from `mcp-server/src/tools/_humanoid.js` if it bundles cleanly into the Vercel function, or (b) move the classifier into a shared location (e.g. `src/shared/humanoid-classify.js` or `api/_lib/humanoid-classify.js`) and re-export from `mcp-server/src/tools/_humanoid.js` so both the MCP tool and the API use one source of truth. Update `tests/` references accordingly.
+ - **Acceptance:** there is exactly one definition of the humanoid term lists in the repo (`grep -rn "NON_HUMANOID_TERMS"` shows a single declaration); `forge_avatar` and auto-rig both import it; existing `forge_avatar` behavior is unchanged.
+
+7. **Privacy: never hand a permanent public URL for a private avatar to the provider.**
+ - `maybeAutoRigAvatar` must receive `visibility` (extend signature; both callers pass `avatar.visibility`).
+ - For `visibility === 'private'`: by default do **not** auto-rig at all (private means the owner did not consent to external processing) — return `{ queued: false, skipped: 'private_opt_out' }`. Provide `AUTO_RIG_PRIVATE` env: when set to `'presigned'`, auto-rig is allowed for private avatars but the `sourceUrl` handed to `submit` is a `presignGet({ key: avatar.storage_key, expiresIn: 3600 })` short-lived URL (1h, long enough for the GPU job to fetch) instead of `publicUrl(...)`. When unset/`'off'`, private avatars are skipped.
+ - For `public`/`unlisted` avatars, keep using `publicUrl(...)` (they are already externally reachable).
+ - Whenever a mesh is sent externally for rigging, stamp `source_meta.rig_mesh_sent_external = true` and `source_meta.rig_mesh_url_kind = 'public' | 'presigned'` on the avatar row at submit time (update `avatars.source_meta` with a merge, not a clobber), so there is a durable record that the mesh left the platform.
+ - **Acceptance:** a private avatar with `AUTO_RIG_PRIVATE` unset returns `skipped: 'private_opt_out'` and does not submit; with `AUTO_RIG_PRIVATE=presigned`, `submit` is called with a `sourceUrl` produced by `presignGet` (assert it is the presigned value, not `publicUrl`), and `source_meta.rig_mesh_url_kind === 'presigned'`; a public avatar uses `publicUrl` and stamps `'public'`.
+
+8. **Stop trusting the client `rigged` flag in `from-forge` to skip the gate.**
+ - In `api/avatars/from-forge.js`, the rig decision must come from the **server-side `inspectGlb(buf)`** result (already computed at `:117` as `info`), not the client `rigged` body flag. Use `info.isRigged` / `info.skeletonJointCount` for `rigInfo`. Keep `rigged` only as a provenance annotation in `source_meta` (clearly labeled, e.g. `client_claimed_rigged`), never as the gate input.
+ - Concretely: change the `maybeAutoRigAvatar` `rigInfo` at `:167` to `{ is_rigged: info.isRigged === true, skeleton_joint_count: info.skeletonJointCount ?? null }` (drop `rigged ||`), and change `source_meta.is_rigged` at `:143` to derive from `info` (server truth), recording the client claim separately.
+ - **Acceptance:** a `from-forge` request with `rigged:true` on a body whose fetched GLB has **no** skeleton still auto-rigs (server inspection wins); a request with `rigged:false` on a GLB that **is** skinned is treated as already-rigged and skipped. Add a test driving both via `inspectGlb` on real fixture GLBs (`tests/fixtures/` — reuse an existing rigged + static fixture; if none, generate them deterministically with the project's GLB helpers, no external download).
+
+9. **Wire the new signature through both callers.**
+ - `api/avatars/index.js:153-160` and `api/avatars/from-forge.js:163-170` must pass `visibility: avatar.visibility` and `prompt: <best source prompt>` to `maybeAutoRigAvatar`. Both remain fire-and-forget; the 201 still returns immediately.
+ - **Acceptance:** `grep` shows both call sites pass `visibility` and `prompt`; create flows still return 201 before the rig work runs (no added `await` on the rig path in the request handler).
+
+10. **Changelog.** Add a `data/changelog.json` entry (tag `security` + `improvement`): holder-readable, e.g. title "Auto-rig now respects privacy, plan limits, and humanoid eligibility" with a plain-language summary (private avatars aren't sent to third parties without opt-in; rigging is rate-limited and skips non-humanoid meshes). Run `npm run build:pages`.
+ - **Acceptance:** `npm run build:pages` passes (it validates the entry) and regenerates `CHANGELOG.md`, `public/changelog.json`, `public/changelog.xml`.
+
+## Implementation notes
+- **Order of gates inside `maybeAutoRigAvatar`** (cheapest/most-decisive first, so no budget is wasted): (1) avatar present, (2) `rigInfoIsRigged` already-rigged short-circuit, (3) provider `canRig`, (4) in-flight idempotency, (5) `visibility` privacy decision (private → skip or presign), (6) plan/tier eligibility, (7) humanoid classification (when a prompt exists), (8) rate limits `rig` → `rigDaily` → `rigGlobal`, (9) build `sourceUrl` (public vs presigned), (10) `submit`, (11) insert job row + stamp `source_meta`. Steps 1–4 are already present — insert 5–8 between them and the existing `sourceUrl` line at `:118`.
+- **Best-effort contract is sacred.** `maybeAutoRigAvatar` must never throw into `handleCreate`. Wrap each new gate in the existing top-level `try/catch` (which already returns `{ queued:false, skipped:'error' }`), and make limiter/presign calls individually defensive so a transient infra failure degrades to "skip rig", never a failed create.
+- **`source_meta` merge, not clobber.** When stamping `rig_mesh_sent_external`, `rig_mesh_url_kind`, `auto_rig_skipped`, etc., read the current row's `source_meta` and merge (the finalize stage at `auto-rig.js:201` already does `{ ...(av.source_meta || {}), ... }` — follow that idiom). Use a single `update avatars set source_meta = ... where id = ... and owner_id = ...` keyed by both columns, as the rest of the file does.
+- **Presigned URL lifetime.** Use `expiresIn: 3600`. The job submits immediately and the provider fetches within seconds-to-minutes, but a queued backend may fetch later; 1h is the safe upper bound. Do not exceed it — the point is a short-lived URL.
+- **Classifier reuse:** prefer extracting to `api/_lib/humanoid-classify.js` and re-exporting from the MCP module — it keeps the API self-contained under Vercel bundling and avoids reaching across the `mcp-server/` boundary at runtime. Mirror the existing `src/shared/rig-classify.js` ↔ `auto-rig.js:38-46` split pattern (shared logic, snake_case server shape).
+- **Tier gate default must not regress current behavior** for legit users: default policy allows authenticated owners. The value is that the lever now exists and the abuse caps (req 1–3) are the real teeth.
+- **Do not add a rate limit to the create request itself** here — that is a broader change; the rig submission is the money path and is where the limit belongs. (If you also want to gate the create, note it as a follow-up, don't scope-creep.)
+
+## Verification
+- `npm test` — full suite green, including the new `tests/auto-rig-gates.test.js`.
+- New test must cover, with the in-memory limiter and a stubbed provider (`supportsMode('rerig') === true`, spy on `submit`):
+ - rate-limit deny → `skipped: 'rate_limited'`/`'daily_cap'`/`'global_cap'`, no submit, no job row;
+ - plan gate (`AUTO_RIG_REQUIRE_TIER`) deny → `skipped: 'plan_gate'`, no submit;
+ - non-humanoid prompt → `skipped: 'not_humanoid'`, no submit, skip reason in `source_meta`;
+ - humanoid prompt + public avatar → submit called with `publicUrl`, `source_meta.rig_mesh_url_kind === 'public'`;
+ - private avatar, `AUTO_RIG_PRIVATE` unset → `skipped: 'private_opt_out'`;
+ - private avatar, `AUTO_RIG_PRIVATE=presigned` → submit called with presigned URL, `rig_mesh_url_kind === 'presigned'`;
+ - `from-forge` rig decision derives from `inspectGlb`, not the client `rigged` flag (two fixtures).
+- `grep -rn "NON_HUMANOID_TERMS"` → exactly one declaration.
+- Manual: with a local `.env` lacking Redis (in-memory limiter), create an avatar via `POST /api/avatars` and confirm the 201 returns immediately and the rig path logs a gate decision (not an unbounded submit). Confirm `head -1` of any changed `api/*.js` is **not** `__defProp`/`createRequire` before staging.
+- `npm run build:pages` passes and updates the changelog artifacts.
+
+## Definition of done
+- [ ] `limits.rig`, `limits.rigDaily`, `limits.rigGlobal` added, `critical`, env-tunable, documented.
+- [ ] All three limits + plan gate + humanoid gate + privacy decision enforced inside `maybeAutoRigAvatar` before `submit`, in the order above; function still never throws into the caller.
+- [ ] Private avatars are not sent externally unless `AUTO_RIG_PRIVATE=presigned`, and then only via a 1h presigned GET; `source_meta` records `rig_mesh_sent_external` + `rig_mesh_url_kind`.
+- [ ] `from-forge` rig gate uses server-side `inspectGlb`, not the client `rigged` flag; client claim kept only as labeled provenance.
+- [ ] Humanoid classifier has a single definition; both `forge_avatar` and auto-rig import it; `forge_avatar` behavior unchanged.
+- [ ] Both call sites pass `visibility` and `prompt`; 201 still returns before rig work.
+- [ ] New `tests/auto-rig-gates.test.js` covers every case above; `npm test` green.
+- [ ] Changelog entry added; `npm run build:pages` green.
+- [ ] No other coin referenced anywhere in the diff; staged explicit paths only; `git diff --staged` self-reviewed; no esbuild-bundled `api/*.js`.
+
+## Out of scope / follow-ups
+- Sibling-avatar materialization + completion swap → `01-sibling-materialization.md` (build on top of it; this prompt's `source_meta` stamps must survive into the sibling).
+- Completion state machine for rig jobs → `02-completion-statemachine.md`.
+- SSRF hardening of the provider/import fetch path → `03-ssrf-hardening.md`.
+- Coverage of additional create entry points (studio, reconstruct) → `05-coverage-gaps.md`.
+- Rig result caching / backfill of already-created static avatars → `06-rig-cache-and-backfill.md`.
+- Post-rig quality gate + fallback to static on a bad skeleton → `07-quality-gate-and-fallback.md`.
+- Emitting rig lifecycle events/metrics beyond the `source_meta` breadcrumbs here → `08-observability-and-events.md`.
+- Consolidated test suite hardening → `09-test-suite.md`.
+- Rate-limiting the avatar *create* request itself (not just the rig submission) — deferred, broader auth-surface change.
diff --git a/prompts/b/33-onboarding-activation.md b/prompts/b/33-onboarding-activation.md
new file mode 100644
index 000000000..f9e445e8a
--- /dev/null
+++ b/prompts/b/33-onboarding-activation.md
@@ -0,0 +1,102 @@
+# 33 — Onboarding & activation funnel
+
+> Part of the three.ws "Production → $1B" program. Run in a fresh chat. Read
+> `/CLAUDE.md` first (its rules override everything) and `prompts/production-1b/00-README.md`
+> for shared context.
+
+## Why this matters for $1B
+
+Activation — a new visitor reaching their first "aha" — is the single biggest lever
+on growth. Every dollar of acquisition is wasted if a first-timer can't make
+something real in the first minute. three.ws already has the pieces (welcome modal,
+"Getting started 0/3" checklist, a "What is three.ws" page, an 88-stop guided 3D
+tour), but they must compose into one coherent path with a clear, fast first win and
+honest measurement, or the funnel leaks at the top.
+
+## Mission
+
+Turn the first-run experience into a single, polished path that gets a brand-new
+visitor from "what is this?" to "I made a 3D thing" in about 60 seconds, with every
+step instrumented so activation is measurable.
+
+## Map (trust but verify — files move)
+
+- **Getting-started checklist + welcome modal** — [public/getting-started.js](../../public/getting-started.js)
+ (the `STEPS` array: core `create → brain → embed`, optional `onchain → monetize`;
+ renders the bottom-right "Getting started N/3" pill), [public/getting-started.css](../../public/getting-started.css).
+- **In-product feature discovery** — [public/feature-discovery.js](../../public/feature-discovery.js)
+ ("Have you tried…", `tws:feature-done` "what's next" cards), [public/feature-discovery.css](../../public/feature-discovery.css).
+- **Intro / explainer pages** — [pages/what-is.html](../../pages/what-is.html) (`/what-is`),
+ [pages/start.html](../../pages/start.html) (`/start`).
+- **Guided 3D tour** — [src/feature-tour/director.js](../../src/feature-tour/director.js),
+ [src/feature-tour/curriculum.js](../../src/feature-tour/curriculum.js),
+ [public/tour/curriculum.json](../../public/tour/curriculum.json) (built by
+ `scripts/build-tour.mjs`); tour page is `/tour`.
+- **First "aha" surfaces** — [pages/forge.html](../../pages/forge.html) +
+ [src/forge.js](../../src/forge.js) (free NVIDIA NIM text→3D), `/create` and
+ [src/create-prompt.js](../../src/create-prompt.js) (text→avatar). The free lanes
+ need no wallet.
+- **Analytics taxonomy** — [src/analytics.js](../../src/analytics.js)
+ (`FUNNELS.activation`: `landing_viewed → wallet_connect_started →
+ wallet_connect_succeeded → agent_created`), [src/acquisition-analytics.js](../../src/acquisition-analytics.js).
+
+## Do this
+
+1. **Walk the real funnel in a browser** (`npm run dev`): open `/` in a fresh
+ incognito profile (clear `localStorage`), follow the welcome modal → `/create` →
+ finish a free generation. Time it. Note every dead-end, dead click, or moment of
+ confusion. The free core path must never demand a wallet.
+2. **Make the first win the default.** The fastest aha is the free NIM text→3D /
+ text→avatar lane — ensure the welcome modal and `/start` route there first, with a
+ one-line prompt suggestion so a blank composer never stalls a first-timer.
+3. **Unify the three entry points** so they tell one story: the welcome modal
+ (`getting-started.js`), `/what-is`, and `/tour`. Cross-link them; remove
+ contradictory copy; ensure the "Getting started N/3" pill resumes correctly across
+ pages and reflects real milestones (verify the `done()` route matchers in `STEPS`
+ still point at live routes via `vercel.json`).
+4. **Instrument activation honestly.** Confirm `AGENT_CREATED` / first-generation and
+ each checklist `complete()` fire `track()` events through `src/analytics.js`
+ (extend `FUNNELS.activation` or `ANALYTICS_EVENTS` if a step in the real path isn't
+ covered — keep names in the existing taxonomy, never invent ad-hoc strings). No raw
+ wallet addresses or PII as props (use `shortWallet()`).
+5. **Design every onboarding state:** welcome modal has focus trap + Escape + "Maybe
+ later" (verify), the checklist has an empty/first-run state and a celebratory
+ complete state, and `tws:feature-done` "what's next" cards point only at confirmed
+ live routes.
+6. **Reduce time-to-value.** Cut any step that isn't required for the first win;
+ defer wallet/on-chain prompts until after the user has made something. Lazy-load
+ the heavy tour director so it never delays the homepage LCP.
+7. **Verify resume + opt-out.** `data-getting-started="off"`, "Hide this", and the
+ immersive-route exclusions must all work; progress persists across reloads and
+ pages; the tour rehydrates from `sessionStorage` mid-flow.
+8. **Run tests + changelog.** `npx vitest run` for any touched module and the tour
+ build (`node scripts/build-tour.mjs` stays clean). Add a `data/changelog.json`
+ entry for the user-visible onboarding improvement and run `npm run build:pages`.
+
+## Must-not
+
+- Do not gate the free core path behind a wallet, sign-up, or payment — the first aha
+ must be free.
+- Do not ship a fake progress bar or `setTimeout` "loading"; generation progress comes
+ from real API responses only.
+- Do not send PII (raw wallets, emails) to analytics; route through the taxonomy in
+ `src/analytics.js` and truncate with `shortWallet()`.
+- Do not reference any coin other than `$THREE`; the optional "monetize" step settles
+ in `$THREE` only.
+- Do not break the existing resume/opt-out behavior or double-mount the guide
+ (`window.__twsGuide` idempotency).
+
+## Acceptance (all true before claiming done)
+
+- [ ] A fresh incognito visitor reaches a finished free 3D creation in ≤60s with no
+ wallet and no console errors/warnings.
+- [ ] Welcome modal, `/what-is`, and `/tour` tell one consistent story and cross-link;
+ every CTA target is a live route.
+- [ ] "Getting started N/3" pill resumes across pages, reflects real milestones, and
+ has designed first-run + complete states.
+- [ ] Each activation step fires a taxonomy event via `src/analytics.js` with no PII;
+ `FUNNELS.activation` reflects the real path.
+- [ ] Opt-out (`data-getting-started="off"`, "Hide this", immersive exclusions) and
+ tour mid-flow rehydration all work.
+- [ ] Touched tests pass, `scripts/build-tour.mjs` is clean, and the changelog entry
+ is added with `npm run build:pages` clean.
diff --git a/prompts/b/34-home-landing-conversion.md b/prompts/b/34-home-landing-conversion.md
new file mode 100644
index 000000000..eb5674d5e
--- /dev/null
+++ b/prompts/b/34-home-landing-conversion.md
@@ -0,0 +1,101 @@
+# 34 — Home / landing conversion
+
+> Part of the three.ws "Production → $1B" program. Run in a fresh chat. Read
+> `/CLAUDE.md` first (its rules override everything) and `prompts/production-1b/00-README.md`
+> for shared context.
+
+## Why this matters for $1B
+
+The homepage is where ad spend, press, and word-of-mouth all land. A first-time
+visitor decides in about 5 seconds whether to stay. If the hero doesn't instantly
+communicate "give your AI a body" and offer an obvious, fast next action, the
+acquisition funnel dies before activation (prompt 33) even begins. A clear,
+fast-loading, mobile-first, socially-proven landing page is the cheapest growth lever
+the platform has.
+
+## Mission
+
+Make the home page make a cold visitor understand the product in 5 seconds and act:
+sharp hero, one above-the-fold primary CTA, a live demo they can touch, credible
+social proof, benefit-led copy, fast LCP, and flawless mobile.
+
+## Map (trust but verify — files move)
+
+- **Home page** — [pages/home.html](../../pages/home.html) (`/`). Hero h1 currently
+ "The 3D agent layer of the internet." with bullets Create/Embed/Earn and the
+ `.hero-cta-row` (`/create`, `/forge`, `#embed`, `/tour`). All inline `<style>` +
+ `<script type="module">`.
+- **Live demo embeds** — [src/home-forge.js](../../src/home-forge.js) (mini Forge:
+ real `/api/forge` text→3D in-page), [src/forge-showcase.js](../../src/forge-showcase.js)
+ ("Fresh from the Forge" community feed), [src/home-live-token.js](../../src/home-live-token.js)
+ (live $THREE price), [src/api-playground.js](../../public/api-playground.js) and the
+ `<agent-3d>` web component embed (`agent-3d/latest/agent-3d.js`).
+- **Social proof / press strip** — the `.press-row` block in
+ [pages/home.html](../../pages/home.html) (Anthropic, Coinbase, IBM, AWS, Google
+ Cloud, Alibaba Cloud, Solana, CoinMarketCap, CoinGecko, HackerNoon) with SVGs in
+ [public/featured-logos/](../../public/featured-logos).
+- **CTA + funnel instrumentation** — `data-cta` / `data-cta-loc` attributes on every
+ CTA, consumed by [src/acquisition-analytics.js](../../src/acquisition-analytics.js)
+ → [src/analytics.js](../../src/analytics.js) (`CTA_CLICKED`, `LANDING_VIEWED`).
+- **Performance budget** — Core Web Vitals work lives in
+ `prompts/production-1b/10-*`; OG/structured data in `prompts/production-1b/14-*`.
+
+## Do this
+
+1. **Open `/` cold on mobile and desktop** (`npm run dev`; emulate 320 / 768 / 1440).
+ Read the hero as a stranger: in 5 seconds, is it obvious this turns your AI into an
+ embeddable 3D avatar? Sharpen the h1/sub/bullets toward the plain promise ("give
+ your AI a body" — make a 3D agent, embed it anywhere) without losing the existing
+ voice or the i18n `data-i18n-*` hooks.
+2. **One unmistakable primary CTA above the fold.** The hero has four buttons; keep
+ the primary "Build your agent" visually dominant and make the rest clearly
+ secondary so the eye has one path. Verify each `href` resolves in `vercel.json` and
+ carries `data-cta`/`data-cta-loc`.
+3. **Prove it with a live demo, not a screenshot.** Confirm the mini-Forge
+ (`home-forge.js`) and the `<agent-3d>` embed actually run real generations / render
+ live on load, with real elapsed time and designed loading/empty/error states (no
+ `setTimeout` fakery). The showcase strip hides itself when empty — verify it never
+ shows a hollow row.
+4. **Make social proof credible and honest.** Keep the press/partner strip truthful
+ (only real, linkable mentions — the SVGs in `public/featured-logos/`); ensure logos
+ are lazy, accessible (alt/label), and don't push down the hero. Do not invent or
+ overstate any endorsement.
+5. **Fast LCP.** The hero text/CTA must be the LCP and must not wait on the 3D embed
+ or model-viewer scripts — defer/lazy-load heavy modules (tour director, model
+ viewer, showcase) below the fold. Preload the hero font/critical CSS only. Confirm
+ no layout shift from late-loading logos or demos.
+6. **Mobile is first-class.** At 320px the hero, CTA, and one demo must be usable
+ without horizontal scroll; the CTA stays reachable (sticky or repeated near the
+ fold). Touch targets ≥44px; the press strip wraps, never overflows.
+7. **Wire the funnel.** Every CTA fires `CTA_CLICKED` with `cta`/`location`; the page
+ fires `LANDING_VIEWED` once with referrer + UTM (already in
+ `acquisition-analytics.js`) — verify it loads on `/` and no PII leaks.
+8. **Verify + changelog.** Lighthouse the page locally (LCP, CLS), run touched tests
+ (`npx vitest run`), add a `data/changelog.json` entry for the conversion
+ improvement, and run `npm run build:pages`.
+
+## Must-not
+
+- Do not invent press/partner logos or overstate endorsements — only real, linkable
+ mentions; this is a trust surface, not a dark pattern.
+- Do not block LCP on the 3D embed, model-viewer, or any third-party script.
+- Do not ship a fake/looping demo or a `setTimeout` progress bar — the demo is the
+ real pipeline or it is not shown.
+- Do not reference any coin other than `$THREE` (the live token widget is $THREE only).
+- Do not strip `data-i18n-*`, `data-cta`, or accessibility attributes from existing
+ elements.
+
+## Acceptance (all true before claiming done)
+
+- [ ] A cold visitor understands "give your AI a body" in ≤5s; one dominant
+ above-the-fold CTA; all CTA `href`s resolve.
+- [ ] The live demo runs the real pipeline on load with designed loading/empty/error
+ states; the showcase never shows a hollow row.
+- [ ] Press/partner proof is truthful, accessible, lazy, and does not push the hero
+ below the fold.
+- [ ] LCP is the hero (not the 3D embed); no CLS from late logos/demos; verified in
+ Lighthouse locally.
+- [ ] Usable at 320 / 768 / 1440 with no horizontal scroll and ≥44px touch targets.
+- [ ] `LANDING_VIEWED` + every `CTA_CLICKED` fire with no PII; no console
+ errors/warnings.
+- [ ] Touched tests pass; changelog entry added and `npm run build:pages` clean.
diff --git a/prompts/b/35-pricing-monetization.md b/prompts/b/35-pricing-monetization.md
new file mode 100644
index 000000000..ca1e716d9
--- /dev/null
+++ b/prompts/b/35-pricing-monetization.md
@@ -0,0 +1,105 @@
+# 35 — Pricing & monetization surfaces
+
+> Part of the three.ws "Production → $1B" program. Run in a fresh chat. Read
+> `/CLAUDE.md` first (its rules override everything) and `prompts/production-1b/00-README.md`
+> for shared context.
+
+## Why this matters for $1B
+
+Revenue is the proof a platform is worth $1B. A visitor must understand what's free,
+what costs, and exactly what they get for the money — in seconds, with no surprise
+charges. three.ws monetizes two ways: a public pricing page (Free + paid generation)
+and per-call x402 micropayments priced from a single catalog. If costs are opaque,
+inconsistent across surfaces, or ever leak a vendor's billing internals, trust and
+conversion both collapse.
+
+## Mission
+
+Make pricing and monetization clear, consistent, and value-aligned everywhere: one
+source-of-truth catalog driving the pricing page, the x402 pay-per-call flow, and the
+`/pay` surface, with transparent costs, honest upgrade paths, and zero vendor billing
+exposure.
+
+## Map (trust but verify — files move)
+
+- **Pricing catalog (source of truth)** — [api/_lib/pricing/catalog.js](../../api/_lib/pricing/catalog.js)
+ (`CATALOG`, `publicCatalog()`, `priceForAction()`, `catalogEntry()`; prices in USD,
+ settled in `$THREE`; Forge tier prices READ from `forge-tiers.js`, not duplicated),
+ [api/_lib/pricing/charge-three.js](../../api/_lib/pricing/charge-three.js),
+ [api/_lib/forge-tiers.js](../../api/_lib/forge-tiers.js) (free draft tier on NVIDIA NIM).
+- **Public pricing page** — [pages/pricing.html](../../pages/pricing.html) (`/pricing`),
+ [public/pricing.css](../../public/pricing.css). Has a Free tier ("$0/forever, no
+ credit card") + paid tiers in `#pricing-tiers`.
+- **x402 pay surfaces** — [public/pay/index.html](../../public/pay/index.html) (`/pay`),
+ [public/pay/calls/index.html](../../public/pay/calls), [public/pay/c/index.html](../../public/pay/c),
+ the buyer modal in [api/x402-checkout.js](../../api/x402-checkout.js) +
+ [public/x402-checkout.js](../../public/x402-checkout.js),
+ [public/x402-pay-core.js](../../public/x402-pay-core.js).
+- **Paid endpoints (catalog consumers)** — [api/x402/](../../api/x402) (e.g.
+ `forge.js`, `skill-call.js`, `service.js`, `mint-to-mesh.js`),
+ [api/_lib/x402-paid-endpoint.js](../../api/_lib/x402-paid-endpoint.js),
+ [api/_lib/x402-spec.js](../../api/_lib/x402-spec.js).
+- **Conversion instrumentation** — [src/analytics.js](../../src/analytics.js)
+ (`token_*` and CTA events). Trading/PnL disclaimers live with the market surfaces
+ (prompt `22-*`).
+
+## Do this
+
+1. **Map every price to the catalog.** Confirm `pages/pricing.html` and every `/pay`
+ surface read from `api/_lib/pricing/catalog.js` (or `publicCatalog()` over an
+ endpoint) — no hardcoded dollar amounts duplicated in HTML/JS that can drift from
+ the catalog. Where a number is hardcoded today, wire it to the catalog or document
+ why it's a fixed marketing figure.
+2. **Walk the buyer flow in a browser** (`npm run dev`): `/pricing`, then a real
+ per-call purchase via the `/pay` modal (`x402-checkout.js`). Confirm the quote is
+ shown in USD with the `$THREE` settle amount, costs are explicit before signing,
+ and the success/receipt state is clear (link to `my-receipts`).
+3. **Never expose vendor billing.** Audit every error path in the pay/x402 chain: a
+ provider quota/credit/billing message, raw 402/429/5xx body, or vendor URL must be
+ masked to neutral, actionable copy ("Payment couldn't complete — try again");
+ server logs keep the detail. This is a hard `/CLAUDE.md` rule.
+4. **Value-metric alignment.** Make the unit of charge obvious and tied to value
+ delivered (per generation / per call / per tier), not opaque "credits" with no
+ anchor. If a credits model is shown, it must convert transparently to the same
+ catalog prices.
+5. **Design every state on the pay surfaces:** loading (quote fetching), empty (no
+ wallet connected → connect path), error (masked, retryable), and success
+ (receipt). The free tier must be clearly the default with no card required.
+6. **Honest upgrade paths.** From the free Forge draft, the path to Standard/High (and
+ from a free agent to monetizing it) must be discoverable and benefit-led, never a
+ nag or a forced wall in front of the free aha. No dark patterns (no fake scarcity,
+ no pre-checked add-ons, no hidden recurring charges).
+7. **Instrument conversion.** Fire the existing `token_*` / CTA taxonomy events
+ through `src/analytics.js` on pricing views, buy intent, quote shown, and settle —
+ no raw wallet/PII (use `shortWallet()`).
+8. **Test + changelog.** Run the pricing/x402 tests (`npx vitest run` over
+ `tests/**/x402*`, `tests/**/pricing*`, `tests/**/forge-tiers*` as present), add a
+ `data/changelog.json` entry for any user-visible pricing change, and run
+ `npm run build:pages`.
+
+## Must-not
+
+- Do not surface any third party's billing page, credit balance, quota text, or raw
+ error to a buyer — mask to neutral copy, log detail server-side.
+- Do not duplicate prices: the catalog (`api/_lib/pricing/catalog.js`) is the single
+ source of truth; surfaces read from it.
+- Do not use dark patterns — no fake scarcity/countdowns, pre-checked upsells, hidden
+ recurring charges, or a wall in front of the free aha.
+- Do not reference, price, or settle in any coin other than `$THREE` (USD is the quote
+ unit; `$THREE` is the settle unit).
+- Do not show a trading/PnL/market figure without the required disclaimer.
+
+## Acceptance (all true before claiming done)
+
+- [ ] `/pricing` and every `/pay` surface read prices from the catalog; no drifting
+ hardcoded amounts.
+- [ ] A real per-call purchase completes in-browser with USD quote + `$THREE` settle
+ shown before signing and a clear receipt after.
+- [ ] Every pay/x402 failure mode yields neutral, actionable copy — no vendor billing
+ internals — verified by tests.
+- [ ] Free tier is the obvious default (no card); upgrade paths are benefit-led with
+ no dark patterns.
+- [ ] Loading/empty/error/success states designed on the pay surfaces; no console
+ errors/warnings.
+- [ ] Conversion events fire through the taxonomy with no PII.
+- [ ] Pricing/x402 tests pass; changelog entry added and `npm run build:pages` clean.
diff --git a/prompts/b/36-growth-analytics.md b/prompts/b/36-growth-analytics.md
new file mode 100644
index 000000000..ddc63fa50
--- /dev/null
+++ b/prompts/b/36-growth-analytics.md
@@ -0,0 +1,111 @@
+# 36 — Growth analytics instrumentation
+
+> Part of the three.ws "Production → $1B" program. Run in a fresh chat. Read
+> `/CLAUDE.md` first (its rules override everything) and `prompts/production-1b/00-README.md`
+> for shared context.
+
+## Why this matters for $1B
+
+You cannot grow what you cannot measure. To scale acquisition, activation, and
+retention deliberately, every meaningful step in the funnel must emit a clean,
+consistently-named event — and never leak PII, or the platform becomes a privacy
+liability instead of a $1B business. three.ws already has the spine (PostHog +
+Vercel Web Analytics injected by Vite, a typed event taxonomy in `src/analytics.js`,
+a first-party error reporter). The job is to complete coverage across the full funnel
+without drift and without leaking.
+
+## Mission
+
+Complete privacy-respecting, consistently-taxonomied event instrumentation across the
+activation → conversion → retention funnels, with dashboards/funnels that line up and
+zero PII in any event.
+
+## Map (trust but verify — files move)
+
+- **Event taxonomy + facade (source of truth)** — [src/analytics.js](../../src/analytics.js)
+ (`ANALYTICS_EVENTS`, `FUNNELS.activation`, `FUNNELS.three`, `track()`,
+ `trackFunnelStep()`, `identifyUser()` / `resetIdentity()`, `trackError()`,
+ `shortWallet()`). `track()` validates against the catalog and rejects unknown
+ events — never bypass it.
+- **Acquisition instrumentation** — [src/acquisition-analytics.js](../../src/acquisition-analytics.js)
+ (`LANDING_VIEWED` once + delegated `CTA_CLICKED` over `data-cta`/`data-cta-loc`).
+- **Existing call sites** — [src/wallet-auth.js](../../src/wallet-auth.js),
+ [src/account.js](../../src/account.js), [src/create-agent.js](../../src/create-agent.js),
+ [src/marketplace.js](../../src/marketplace.js), [src/three-token-page.js](../../src/three-token-page.js),
+ [src/swap-jupiter.js](../../src/swap-jupiter.js), [src/agent-detail.js](../../src/agent-detail.js),
+ [src/dashboard-next/shell.js](../../src/dashboard-next/shell.js).
+- **Provider injection (do not duplicate)** — the `posthog-analytics`,
+ `vercel-analytics`, and `client-error-reporter` plugins in
+ [vite.config.js](../../vite.config.js) (PostHog snippet, `person_profiles:
+ 'identified_only'`, ingest proxied through `/ingest`).
+- **Server-side event/error sinks** — [public/error-reporter.js](../../public/error-reporter.js)
+ → [api/client-errors.js](../../api/client-errors.js); per-surface analytics in
+ [api/marketplace/analytics.js](../../api/marketplace/analytics.js),
+ [api/walk/analytics.js](../../api/walk/analytics.js),
+ [api/creators/skill-analytics.js](../../api/creators/skill-analytics.js).
+- **Privacy reference** — [public/legal/privacy.html](../../public/legal/privacy.html)
+ ("no IPs, no fingerprints", "no third-party advertising cookies"). Instrumentation
+ must stay true to this.
+
+## Do this
+
+1. **Inventory before adding.** Grep for `track(`, `trackFunnelStep(`, `data-cta`, and
+ `ANALYTICS_EVENTS` to map what already fires. Do not reinvent the spine — extend
+ `src/analytics.js`. List the funnel gaps (any real step with no event).
+2. **Complete the funnels by journey.** Ensure each stage emits a taxonomy event:
+ acquisition (`landing_viewed`, `cta_clicked`), activation (`agent_created`,
+ first-generation, checklist steps from prompt 33), conversion (the `token_*` and
+ pay/x402 events from prompt 35), retention (return visits, key surfaces opened via
+ `SURFACE_OPENED`, share actions). Add missing event names to `ANALYTICS_EVENTS` and
+ wire them into `FUNNELS` so PostHog funnel insights line up automatically.
+3. **One taxonomy, no drift.** All events go through the validating `track()` /
+ `trackFunnelStep()` facade — no raw `window.posthog.capture()` ad-hoc strings in
+ feature code. Names are snake_case and live only in `ANALYTICS_EVENTS`.
+4. **PII audit — hard requirement.** No raw wallet addresses, emails, prompt text, or
+ tokens as event props. Truncate wallets with `shortWallet()`; drop free-text
+ prompts (send a length/category, not content). Verify `person_profiles:
+ 'identified_only'` and that `identifyUser()` is called only after auth resolves
+ with non-PII identifiers. Reconcile with `public/legal/privacy.html`.
+5. **Fail-safe by design.** Every analytics call must no-op when PostHog is absent or
+ blocked (`window.__posthog_blocked`) — verify the app works identically with an ad
+ blocker on, in an embed iframe, and offline. Analytics can never break the page.
+6. **Verify events fire in a browser** (`npm run dev`): with PostHog network calls
+ visible, walk landing → create → a free generation → a pay flow and confirm each
+ expected event fires once with correct, PII-free props. Confirm dedupe (e.g.
+ `LANDING_VIEWED` fires exactly once).
+7. **Dashboards/funnels.** Document the canonical activation, conversion, and
+ retention funnels (the `FUNNELS` map is the contract) so PostHog funnel/insight
+ definitions match the code. Keep this in the existing analytics docs, not a new
+ throwaway file.
+8. **Test + changelog.** Run touched tests (`npx vitest run`, including any
+ `tests/**/analytics*`); add a `data/changelog.json` entry only if a user-visible
+ surface changed (pure instrumentation is internal and usually skips the changelog —
+ see `/CLAUDE.md`). Run `npm run build:pages` if you touched anything that feeds it.
+
+## Must-not
+
+- Do not send PII as event props — no raw wallets, emails, prompt/message text, or
+ tokens. Truncate and categorize.
+- Do not bypass the `track()` facade with ad-hoc `posthog.capture()` calls or invent
+ event names outside `ANALYTICS_EVENTS`.
+- Do not add a second analytics vendor, advertising pixel, or fingerprinting — stay
+ within the existing PostHog + Vercel stack and the privacy policy.
+- Do not let an analytics failure (blocked/offline/embed) break or block the app.
+- Do not reference any coin other than `$THREE` in event names or props.
+
+## Acceptance (all true before claiming done)
+
+- [ ] Every funnel stage (acquisition → activation → conversion → retention) emits a
+ taxonomy event through `track()` / `trackFunnelStep()`; gaps closed.
+- [ ] No ad-hoc event strings or raw `posthog.capture()` in feature code; all names in
+ `ANALYTICS_EVENTS`.
+- [ ] PII audit passes — no raw wallets/emails/prompt text/tokens in any event;
+ consistent with `public/legal/privacy.html`.
+- [ ] App behaves identically with PostHog blocked, in an embed iframe, and offline
+ (no errors, no broken flows).
+- [ ] Each expected event verified firing once with PII-free props in a real browser
+ session.
+- [ ] `FUNNELS` matches documented PostHog funnels; docs updated in place (no
+ throwaway file).
+- [ ] Touched tests pass; changelog handled per `/CLAUDE.md` and `npm run build:pages`
+ clean if it was touched.
diff --git a/prompts/market/00-README-orchestration.md b/prompts/market/00-README-orchestration.md
new file mode 100644
index 000000000..b299ee195
--- /dev/null
+++ b/prompts/market/00-README-orchestration.md
@@ -0,0 +1,138 @@
+# three.ws — Production Campaign to $1B (Orchestration Index)
+
+This directory is a **campaign**, not a feature. Its single goal: take three.ws from
+"impressive and mostly built" to **100% production-ready, proper, and professional** —
+the quality, reliability, and depth a platform needs to be credibly worth **$1B**.
+
+Each `.md` here is a **self-contained task prompt**. Paste one into its own fresh agent
+chat. The agent works in this shared worktree, follows `CLAUDE.md` exactly, ships the
+work end-to-end, verifies it for real, then **deletes its own prompt file**. When a track
+directory contains only its `00-README.md`, that track is done. When every track is done,
+the campaign is done.
+
+> **This is not a greenfield build.** three.ws already ships 125+ pages, 100+ API
+> endpoints, SDKs, MCP servers, workers, on-chain contracts, and payment rails. These
+> prompts **harden, complete, and connect what exists** — they do not rewrite it. Read
+> before you write. Reuse before you build. Delete dead paths. Every prompt assumes the
+> agent first reads `CLAUDE.md`, `STRUCTURE.md`, and `00b-the-bar.md`.
+
+> **Concurrency note.** Multiple agents run in this worktree simultaneously. There may be
+> a parallel hardening checklist under `prompts/road-to-1b/`; this campaign is the broader,
+> structured complement (7 tracks across reliability, growth, surfaces, monetization,
+> ecosystem, infra, and trust). The two are compatible — neither owns the other's files.
+
+---
+
+## The $1B thesis (read this — every agent internalizes it)
+
+A platform is worth $1B when it is **trusted with money, used daily, and built upon by
+others**. That decomposes into exactly the things this campaign hardens:
+
+1. **Trust** — nobody pays an agent, mints a coin, or wires a wallet through software that
+ throws unhandled errors, loses funds on an edge case, or 500s under load. Reliability,
+ payment correctness, and security are the *foundation of valuation*, not chores.
+2. **Activation & retention** — value the first-time visitor reaches in 60 seconds, and a
+ reason to come back tomorrow. A platform nobody activates on is worth its liquidation value.
+3. **Monetization depth** — real revenue surfaces: $THREE holder value, x402 paid rails,
+ marketplace economics, billing. Revenue × multiple = valuation.
+4. **Distribution & network effects** — SEO, virality, an SDK/MCP ecosystem others build on.
+ The platform that other products depend on is the one that compounds.
+5. **Polish that signals seriousness** — every state designed, every surface screenshot-worthy,
+ accessible, fast, branded. Polish is how trust is *communicated* before it is earned.
+
+If a piece of work doesn't advance one of these five, it isn't on the path to $1B. If it
+advances several, do it first.
+
+**The bar:** Vercel / Linear / Stripe / Figma. If you wouldn't screenshot it and put it in
+your portfolio, it isn't done. See `00b-the-bar.md` for the concrete, measurable definition.
+
+---
+
+## How to run the campaign
+
+Each prompt is independent enough to run in its own chat, but the tracks have a natural
+priority. **Run Track A (Reliability) first and keep it green** — every other track ships
+on top of a foundation that must not wobble. Then fan out B–G in parallel; within a track,
+the lower numbers are usually prerequisites for the higher ones (noted per file).
+
+```
+A — Reliability, Observability & Trust ← foundation. Do first. Never regress.
+ │
+ ├── B — Activation, Growth & Distribution (turn visitors into users)
+ ├── C — Surface Completeness (every page to the bar)
+ ├── D — Monetization & $THREE Economy (turn users into revenue)
+ ├── E — Developer Ecosystem & SDKs (turn users into builders)
+ ├── F — Scale & Infrastructure (hold up under success)
+ └── G — Trust, Compliance, Access & Brand (be safe, legal, universal)
+```
+
+Concurrent agents share this worktree. **Stage explicit paths only — never `git add -A`.**
+Re-check `git status` and `git diff --staged` immediately before any commit. Each prompt
+declares a file-ownership lane; stay in it. Shared files (`data/changelog.json`,
+`data/pages.json`) are **append-only** — never reformat them.
+
+---
+
+## Track index
+
+| Track | Directory | Prompts | What "done" buys us |
+|---|---|---|---|
+| **A** | [`A-reliability/`](A-reliability/) | A1–A7 | A platform that does not lose money, data, or uptime. The trust foundation. |
+| **B** | [`B-growth/`](B-growth/) | B1–B6 | Visitors activate and come back. SEO, virality, analytics, lifecycle. |
+| **C** | [`C-surfaces/`](C-surfaces/) | C1–C6 | All 125+ pages finished to the screenshot bar — every state, mobile, a11y. |
+| **D** | [`D-monetization/`](D-monetization/) | D1–D4 | Real revenue: $THREE value, billing, x402 rails, marketplace economics. |
+| **E** | [`E-ecosystem/`](E-ecosystem/) | E1–E4 | Others build on us: SDKs, MCP servers, docs, templates — network effects. |
+| **F** | [`F-infra/`](F-infra/) | F1–F3 | It holds up under success: data layer, workers, CI/CD, deploy safety. |
+| **G** | [`G-trust/`](G-trust/) | G1–G4 | Safe, legal, accessible, on-brand everywhere. |
+
+Each track directory has its own `00-README.md` with the per-track run order and the
+file-ownership map for that track's prompts. Total: **34 task prompts** + 2 framing docs.
+
+---
+
+## Global definition of done (every prompt inherits this — in addition to its own)
+
+A task is **not** done until ALL of these hold. This is `CLAUDE.md`'s definition of done,
+restated as the campaign's non-negotiable floor:
+
+- [ ] Code written, wired into the UI/flow, and **reachable** by a real user via navigation.
+- [ ] **No mocks, fake data, placeholders, TODOs, stubs, or `setTimeout` fake-loading.** Real
+ APIs, real endpoints, real data. Missing credential → find it in `.env` / `vercel env`.
+- [ ] **The only coin is `$THREE`** (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Never
+ name, hardcode, or recommend any other token anywhere. (Runtime-supplied mints in
+ user-launch directories are the only mechanical exception — see `CLAUDE.md`.)
+- [ ] **Every state designed:** loading (skeletons > spinners), empty (tells the user what to
+ do next), error (actionable recovery), populated, overflow. Tested at 320 / 768 / 1440px.
+- [ ] Every interactive element has hover, active, and focus states. Keyboard-navigable.
+ `prefers-reduced-motion` respected.
+- [ ] **Design tokens only** (`public/tokens.css` / `DESIGN-TOKENS.md`) — no hardcoded colors,
+ spacing, or fonts.
+- [ ] Verified for real: `npm run dev` (port 3000), exercised in a browser, **zero console
+ errors/warnings from your code**, network tab shows real calls returning real data.
+- [ ] Existing tests pass (`npm test`); new logic has new tests. Money/auth/3D paths covered.
+- [ ] **Changelog:** user-visible change → append a holder-readable entry to
+ `data/changelog.json` (tags: feature, improvement, fix, sdk, infra, docs, security).
+ Internal-only chores get no entry. Run `npm run build:pages` to validate it.
+- [ ] `git diff` self-reviewed — every changed line justified. Stage explicit paths only.
+- [ ] Watch the two repo traps: `npx vercel build` overwrites `api/*.js` with bundles
+ (check `head -1` for `__defProp`/`createRequire` before committing an `api/` diff);
+ and **never** `git pull`/`fetch`/`merge` from the `threeD` mirror.
+
+If you cannot verify a step, **say so explicitly**. Do not claim done.
+
+---
+
+## The self-improvement pass (do this before deleting your prompt)
+
+After the task is complete and verified, run `CLAUDE.md`'s five-point self-review (lazy /
+user / integration / edge-case / pride). Find the **single biggest remaining quality gap**
+in what you touched, fix it, then:
+
+1. Append your changelog entry (if user-visible).
+2. `rm` your own prompt file.
+3. Report — in two or three sentences — what you shipped, what you verified, and any seam or
+ follow-up the next agent should know about.
+
+A silo is a failure. The best work in this campaign **wires surfaces together** — observability
+that feeds the status page, analytics that feeds retention, a paid endpoint that appears in the
+marketplace and the docs. Find the connections. Wire them.
diff --git a/prompts/market/00b-the-bar.md b/prompts/market/00b-the-bar.md
new file mode 100644
index 000000000..572944e6d
--- /dev/null
+++ b/prompts/market/00b-the-bar.md
@@ -0,0 +1,98 @@
+# The Bar — what "production-ready" and "$1B" mean concretely
+
+Every agent in this campaign reads this before starting. "Make it good" is not a spec.
+This is the spec. These are the measurable thresholds that separate a demo from a platform
+worth a billion dollars. When your task is done, it clears these bars — or it isn't done.
+
+---
+
+## 1. Reliability bars (Track A is the gate for all of these)
+
+- **No unhandled rejections, no uncaught exceptions** reach the user. Every network call,
+ every wallet/RPC interaction, every payment has an error boundary that produces an
+ *actionable* state — never a blank screen, a spinner that spins forever, or a raw stack trace.
+- **No money is ever lost or double-spent.** Payment, mint, send, and trade paths are
+ idempotent, retry-safe, and confirm on-chain before claiming success. A failed transaction
+ surfaces a clear "this did not go through, your funds are safe" state.
+- **Graceful degradation, always.** When an upstream is down (a 3D engine, an RPC, an LLM,
+ pump.fun), the surface degrades to a useful state with a real retry — exactly the failure
+ we already see on Forge ("free engines all busy"). That state must offer a path forward
+ (switch engine, queue, notify-me), not a dead end.
+- **Observability is total.** Every error is captured (Sentry/Axiom — already wired in
+ `api/_lib/sentry.js`, `api/_lib/axiom.js`, `api/client-errors.js`), every paid call is
+ traced, every worker reports health. If it can fail silently today, it can't after.
+
+## 2. Performance bars
+
+- **Largest Contentful Paint < 2.5s, CLS < 0.1, INP < 200ms** on a mid-tier mobile over 4G,
+ on every primary surface. `.lighthouserc.json` already exists — wire it into CI and hold it.
+- **3D loads progressively.** No surface blocks on a multi-MB GLB. Lazy-load Three.js and
+ heavy modules, show a real loading skeleton, draco/meshopt-compress assets, dispose GPU
+ resources on unmount. 60fps on the avatar presence; no jank on scroll.
+- **No layout shift, no FOUC.** Theme boots before paint (`inject-theme-boot.mjs` exists).
+ Fonts and tokens resolve before content renders.
+
+## 3. Polish bars (the "screenshot test")
+
+For every surface, all five states are deliberately designed and reachable:
+- **Loading** — skeleton screens that match the populated layout, not a centered spinner.
+- **Empty** — explains what this is and gives the user the next action (a button, an example,
+ a prompt idea). Never a blank void or the word "No data."
+- **Error** — names what went wrong in plain language and gives a real recovery action.
+- **Populated** — the design tokens, spacing rhythm, and typography are consistent with the
+ rest of the platform. Microinteractions (hover, active, focus, state-change transitions).
+- **Overflow** — 0, 1, 1000 items; a 200-character name; a wallet with $0 and one with $10M.
+
+Plus: keyboard-navigable, screen-reader-labelled, `prefers-reduced-motion` honored, contrast
+≥ WCAG AA, responsive at 320 / 768 / 1440px. **If you would not screenshot it and post it,
+raise it before moving on.**
+
+## 4. Trust & correctness bars
+
+- **The only coin is `$THREE`** (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Zero
+ references to any other token anywhere — code, copy, tests, fixtures, metadata. (Runtime
+ user-launch directories are the sole mechanical exception per `CLAUDE.md`.)
+- **No secrets in the client.** Every API key lives server-side behind a proxy. Grep the
+ built client bundle for key patterns as part of done.
+- **Inputs are validated at the boundary** and trusted internally. Rate-limited where
+ abusable (`@upstash/ratelimit` is available). CSRF-protected where state-changing
+ (`api/csrf-token.js` exists).
+- **Honest UI.** No fake progress bars, no `setTimeout` loaders, no sample arrays shipped to
+ production, no "coming soon" buttons that look live. If it renders, it works.
+
+## 5. Growth & monetization bars
+
+- **Activation is measured.** Every primary surface emits real analytics events
+ (`src/acquisition-analytics.js` exists) into a funnel you can read. "We think users like
+ it" is not data.
+- **The first-run path reaches value in under 60 seconds** with no signup wall before the
+ first "wow" (the Forge free lane, the walk companion, a sample agent).
+- **Every shareable moment has an OG card and a share action.** A generated model, a trade
+ win, an agent profile — each produces a link that unfurls beautifully (many `*-og.js`
+ endpoints already exist; make them universal and gorgeous).
+- **$THREE holding unlocks visible, consistent value** across every surface that gates on it
+ (we already gate Forge "High quality" on holders) — same tiering, same upgrade path,
+ everywhere. Revenue surfaces (billing, x402 paid endpoints, marketplace fees) actually
+ charge, actually settle, actually reconcile.
+
+## 6. Ecosystem bars
+
+- **An outside developer can go from zero to a working integration in 10 minutes** using the
+ published docs and an SDK, without reading our source.
+- **Every SDK and MCP server has:** a real README with a copy-paste quickstart, typed
+ surfaces, a runnable example, semantic versioning, and a smoke test in CI
+ (`audit:mcp`, `smoke:mcp`, `test:mcp` already exist — they must pass and be enforced).
+
+---
+
+## How to use this doc
+
+When you pick up a prompt, map its task to the bars above and treat the relevant ones as
+acceptance criteria. In your completion report, state which bars you cleared and how you
+verified each (the number, the screenshot, the trace, the passing test). "Looks good" is
+not verification. A measured threshold is.
+
+The accumulation of these decisions — every state designed, every error caught, every
+millisecond shaved, every surface shareable — *is* the difference between a project and a
+billion-dollar platform. There is no single feature that gets us there. There is only the
+bar, held on every surface, every time.
diff --git a/prompts/market/A-reliability/00-README.md b/prompts/market/A-reliability/00-README.md
new file mode 100644
index 000000000..4776850b6
--- /dev/null
+++ b/prompts/market/A-reliability/00-README.md
@@ -0,0 +1,64 @@
+# Track A — Reliability, Observability & Trust
+
+This is the foundation every other track ships on. A platform is worth $1B when it is
+**trusted with money, used daily, and built upon by others** — and all three collapse the
+moment software loses funds, 500s under load, or fails silently. Track A makes that
+impossible. Run it first; keep it green; never let B–G regress it.
+
+Read `prompts/production-campaign/00-README-orchestration.md` and `00b-the-bar.md` first —
+the global definition of done and the reliability/performance bars there are inherited by
+every prompt below. This README only adds the track-local run order and the file-ownership
+map that lets the seven prompts run in parallel without colliding.
+
+> **This is hardening, not greenfield.** three.ws already ships `api/_lib/sentry.js`,
+> `_lib/axiom.js`, `_lib/http.js` (the `wrap()` boundary used by ~91 of 100 handlers),
+> `_lib/resilience.js` (cockatiel), `_lib/rate-limit.js` (@upstash/ratelimit),
+> `api/client-errors.js`, `api/csrf-token.js`, a `pages/status.html`, `.lighthouserc.json`,
+> `scripts/test-gate.mjs`, and `.github/workflows/ci.yml`. The gaps are **coverage and
+> enforcement**: observability reaches only a handful of handlers and zero workers, ~42
+> routes are unrate-limited, ~77 are unvalidated, the resilience helper has one call site,
+> and CI gates lint+vitest but not the test gate, Lighthouse, or playwright. Extend what
+> exists. Do not rewrite working code.
+
+---
+
+## The seven prompts
+
+| ID | Mission (one line) | Run order / depends on |
+|---|---|---|
+| **A1** | Wire Sentry + Axiom + trace/request IDs across **every** `api/*.js` handler and every worker; alert on error-rate spikes; readable error dashboard. Make silent failure impossible. | **First.** Foundation for A2–A7's verification. No deps. |
+| **A2** | One error-envelope shape, zod validation, `@upstash/ratelimit`, and idempotency keys across the ~100 `api/*.js` endpoints. | After A1 (so new boundaries emit traces). |
+| **A3** | Audit every money path (x402 checkout, agent-wallet custody/sends, USDC, billing, mint): idempotency, on-chain confirm before success, "your funds are safe" failed state, no double-spend. | After A1 + A2 (envelope + traces in place). |
+| **A4** | Auth, CSRF, secret hygiene (grep the built bundle), per-endpoint authorization, abuse prevention, security headers/CSP. | After A2 (shares the boundary helpers). |
+| **A5** | Raise vitest+playwright coverage on money/auth/3D paths, kill flakes, enforce `test:gate` in CI. | After A2/A3/A4 land the code it must cover. |
+| **A6** | Lighthouse CI as a gate, hold Core Web Vitals budgets, lazy-load Three.js, compress GLBs, mobile perf. | Parallel with A1–A5 (own lane). |
+| **A7** | Circuit breakers (cockatiel), upstream fallback (RPC/3D/LLM/pump.fun), health checks, `/status` page, and fix the Forge "free engines all busy" dead-end into a graceful path. | After A1 (health feeds observability + status). |
+
+**Recommended order:** A1 → (A2 ∥ A6) → (A3 ∥ A4 ∥ A7) → A5. A1 lands the telemetry every
+other prompt verifies against; A5 is last because it must cover the code A2–A4 ship.
+
+---
+
+## File-ownership map (run in parallel without colliding)
+
+Each prompt owns a lane. Where two prompts must touch a shared file, the **owner** is named;
+the other prompt extends additively and never reformats. `data/changelog.json` and
+`data/pages.json` are append-only for everyone.
+
+| Prompt | Owns (primary write lane) | May read / extend additively (not owner) |
+|---|---|---|
+| **A1** | `api/_lib/sentry.js`, `api/_lib/axiom.js`, `api/_lib/alerts.js`, `api/client-errors.js`, worker telemetry shims, `docs/ops/observability.md` (new) | `api/_lib/http.js` `wrap()` (coordinate with A2) |
+| **A2** | `api/_lib/http.js`, `api/_lib/validate.js`, `api/_lib/rate-limit.js`, per-handler validation/limits in `api/*.js`, `docs/API_AUDIT.md` | error-envelope shape consumed by A3/A4 |
+| **A3** | `api/x402-checkout.js`, `api/_lib/agent-wallet.js`, `api/_lib/x402-*.js`, `api/_lib/subscription-billing.js`, `src/agent-wallet/`, money-path tests | idempotency keys from A2; envelope from A2 |
+| **A4** | `api/csrf-token.js`, `api/_lib/csrf.js`, `api/_lib/auth.js`, `src/auth/`, security headers in `api/_lib/http.js` (coordinate with A2), `docs/security/` | per-endpoint authz wired into A2's boundary |
+| **A5** | `vitest.config.js`, `playwright.config.js`, `scripts/test-gate.mjs`, `tests/**`, `.github/workflows/ci.yml` (test jobs) | covers code from A2/A3/A4 |
+| **A6** | `.lighthouserc.json`, `.github/workflows/ci.yml` (lighthouse job), `scripts/optimize-glb.mjs`, `scripts/compress-glbs.mjs`, lazy-load wiring in `src/` 3D entry points | shares `ci.yml` with A5 — append jobs, don't reformat |
+| **A7** | `api/_lib/resilience.js`, `api/_lib/forge-health.js`, `api/_lib/provider-health.js`, `api/forge.js` + `src/forge.js` busy path, `pages/status.html`, `api/health*.js` | health events flow into A1's telemetry |
+
+**Shared-file protocol:** `api/_lib/http.js` is touched by A1 (telemetry inside `wrap()`),
+A2 (envelope/validation/limits), and A4 (headers/CSP). A2 owns its structure; A1 and A4 add
+named helpers and call them — no reformatting, stage explicit hunks, re-read `git diff
+--staged` before commit. `ci.yml` is shared by A5 (test jobs) and A6 (lighthouse job): each
+appends a job, neither rewrites the file.
+
+When this directory contains only this `00-README.md`, Track A is done.
diff --git a/prompts/market/A-reliability/A1-observability-backbone.md b/prompts/market/A-reliability/A1-observability-backbone.md
new file mode 100644
index 000000000..a428da34e
--- /dev/null
+++ b/prompts/market/A-reliability/A1-observability-backbone.md
@@ -0,0 +1,93 @@
+# A1 — Observability Backbone
+
+You are a senior engineer + product thinker building **three.ws**. Read `CLAUDE.md`,
+`STRUCTURE.md`, and `prompts/production-campaign/00b-the-bar.md` first. **Prerequisites:** none —
+this is the first prompt in Track A; every other prompt verifies its work against the telemetry
+you land here.
+
+## Why this matters for $1B
+A platform trusted with money cannot fail silently. The day an x402 settlement or an
+agent-wallet send fails and nobody is paged is the day trust dies — and you only find out from
+an angry holder, not a dashboard. "Observability is total" is a $1B reliability bar
+(`00b-the-bar.md` §1): every error captured, every paid call traced, every worker reporting
+health. Right now that bar is half-met, and the half that's missing is where money moves.
+
+## Current state (read before you write)
+- `api/_lib/http.js` exports `wrap(handler)` — the boundary ~91 of 100 `api/*.js` handlers
+ already use. It calls `captureException(err, { ref, url, method })` on a thrown error and
+ stamps a `ref`. That `ref` is the seam to build on.
+- `api/_lib/sentry.js` exports `captureException` / `captureMessage` (Sentry guarded by
+ `SENTRY_DSN`). `api/_lib/axiom.js` exports `axiomEnabled()`, `ingestEvent(fields)`,
+ `recordPaymentMetric(...)`. `api/_lib/alerts.js` exports `sendOpsAlert(title, detail, opts)`.
+- `api/client-errors.js` ingests browser errors from `public/error-reporter.js` and logs one
+ structured `[client-error]` line; it forwards to Sentry when configured.
+- **The gap (measured):** only 3 handlers import sentry directly, **0 import axiom**, and no
+ worker (`workers/agent-sniper`, `workers/deploy`, `workers/model-*`, `workers/avatar-*`)
+ emits structured telemetry. There is no per-request **trace/request ID** propagated into
+ logs, no **error-rate spike** alert, and no single **readable error view**. Silent failure
+ is still possible. Verify these counts yourself with grep before writing.
+
+## Your mission
+### 1. Make `wrap()` the universal trace + telemetry boundary
+In `api/_lib/http.js`, extend `wrap()` (additively — do not change its signature or break the
+existing `ref`) to: derive a **request ID** (reuse an inbound `x-request-id` / Vercel
+`x-vercel-id` if present, else generate one), set it on the response header, and thread it
+through every `captureException` context **and** an `ingestEvent` call to Axiom on both success
+(sampled) and failure (always) with `{ route, method, status, durationMs, requestId, ref }`.
+Every handler that already uses `wrap()` inherits this for free — that's the leverage. Audit the
+~9 handlers NOT using `wrap()` and either wrap them or justify each in `docs/ops/observability.md`.
+
+### 2. Structured logging with trace IDs, one shape
+Add a tiny structured logger to `api/_lib/axiom.js` (or a new `api/_lib/log.js` it re-exports)
+that emits one JSON line per event — `{ ts, level, route, requestId, msg, ...fields }` — to
+stdout (so Vercel log drains capture it) AND to Axiom when enabled. Replace ad-hoc
+`console.log`/`console.error` on money/auth paths with it. Make `requestId` flow from `wrap()`
+into handlers (attach to `req` or pass via context) so a single request is traceable end to end.
+
+### 3. Bring workers into the same telemetry plane
+Workers run outside the `api/` boundary and are currently dark. Add a shared worker telemetry
+shim (mirror the axiom/sentry helpers — reuse, don't fork) so every worker in `workers/*`
+reports: start, completion, failure (with Sentry capture), and a **heartbeat/health** signal.
+Wire it into each worker's main loop / job handler. A worker that dies must page, not vanish.
+
+### 4. Alert on error-rate spikes — not just single errors
+`sendOpsAlert` fires per-error today. Add rate-aware alerting: when a route's error rate or a
+worker's failure count crosses a threshold over a short window, fire **one** deduped ops alert
+(reuse the existing dedupe in `_lib/alerts.js`/`sentry.js`; don't double-page). Money/auth
+routes get a tighter threshold than read endpoints. Document thresholds in `docs/ops/`.
+
+### 5. A readable error dashboard / surface
+Engineers and the status page both need a human view. Provide a real, reachable surface — a
+queryable Axiom dashboard config committed to the repo **and** a small authenticated internal
+read endpoint (or extend an existing ops/admin surface) that summarizes recent error counts by
+route, top error refs, and worker health. No raw stack traces to unauthenticated users. Wire
+its health summary so A7's `/status` page can consume it (the seam between A1 and A7).
+
+### 6. Verify the wiring is live, not theoretical
+Trigger a real error on a non-money route and confirm: a Sentry event with the `requestId`, an
+Axiom event for the same request, the response carrying the request-ID header, and (by forcing
+a burst) exactly one spike alert. Capture the trace IDs in your completion report.
+
+## Definition of done
+Clears `00b-the-bar.md` §1 "Observability is total": **every** `api/*.js` handler emits a traced
+success/failure event with a propagated request ID; **every** worker reports start/finish/fail +
+heartbeat; error-rate spikes page once (deduped); a readable, auth-gated error/health surface
+exists and feeds A7's status page. No `console.log` left on money/auth paths. Real triggered
+error produces a correlated Sentry + Axiom + header trail (IDs in the report). Inherits the global
+definition of done in `00-README-orchestration.md`. If `SENTRY_DSN`/`AXIOM_*` are absent locally,
+say so and verify the code paths/no-op guards instead of claiming live capture.
+
+## Operating rules (override defaults)
+No mocks/fake data/placeholders/TODOs/stubs. `$THREE` is the only coin. Design tokens only
+(`public/tokens.css`) for any UI. Stage explicit paths only (never `git add -A`); re-check
+`git diff --staged` before commit. Own the telemetry lane — `api/_lib/sentry.js`,
+`_lib/axiom.js`, `_lib/alerts.js`, `api/client-errors.js`, worker shims, `docs/ops/`. You touch
+`_lib/http.js` `wrap()` additively; A2 owns that file's structure — coordinate, add named
+helpers, don't reformat. Extend the existing helpers; don't rewrite them.
+
+## When finished
+Run `CLAUDE.md`'s five self-review checks. Ship one improvement (e.g. sample-rate control, or a
+PII scrub on logged fields tied to A4's hygiene). Append a `data/changelog.json` entry (tag:
+`infra`) — holders care that the platform watches itself. Then delete this prompt file
+(`prompts/production-campaign/A-reliability/A1-observability-backbone.md`) and report what you
+shipped, the verification trace IDs, and the health-summary seam you left for A7.
diff --git a/prompts/market/A-reliability/A2-api-hardening.md b/prompts/market/A-reliability/A2-api-hardening.md
new file mode 100644
index 000000000..fc03a6558
--- /dev/null
+++ b/prompts/market/A-reliability/A2-api-hardening.md
@@ -0,0 +1,90 @@
+# A2 — API Hardening
+
+You are a senior engineer + product thinker building **three.ws**. Read `CLAUDE.md`,
+`STRUCTURE.md`, and `prompts/production-campaign/00b-the-bar.md` first. **Prerequisites:** A1
+(so the new boundaries you harden emit traces and request IDs).
+
+## Why this matters for $1B
+Every public endpoint is attack surface and trust surface at once. An unvalidated body that
+500s, a mutating route that double-charges on a retry, or a rate-free endpoint that lets one
+client exhaust an upstream — each one breaks the "trusted with money, used daily" promise.
+`00b-the-bar.md` §4 is explicit: "Inputs are validated at the boundary and trusted internally.
+Rate-limited where abusable. CSRF-protected where state-changing." This prompt makes that true
+across all ~100 endpoints with **one** consistent shape so the platform behaves predictably
+under load and abuse.
+
+## Current state (read before you write)
+- `api/_lib/http.js` is the shared boundary: `wrap()`, `json()`, `error()`, `serverError()`,
+ `validationError()`, `rateLimited()`, `readJson()`, `method()`, `cors()`. Error responses
+ already force `no-store` and set `x-content-type-options`/`x-frame-options`. This is your base.
+- `api/_lib/rate-limit.js` wraps `@upstash/ratelimit` (`limits`, `clientIp`). `api/_lib/validate.js`
+ exists. `zod@^3` is a dependency.
+- **The gap (measured — verify with grep):** of 100 `api/*.js` handlers, only ~58 import
+ rate-limit and only ~23 use zod/validate. Mutating routes lack **idempotency keys**. The
+ error response shape is *mostly* consistent but not enforced — different handlers return
+ different bodies. There is no single documented envelope contract.
+
+## Your mission
+### 1. Define and enforce ONE error-envelope shape
+Pin the canonical error body in `api/_lib/http.js` (extend `error()`/`validationError()`/
+`serverError()` so they're the only way to emit an error) — e.g.
+`{ ok: false, error: { code, message, requestId, ref?, fields? } }` — carrying A1's `requestId`.
+Document it once in `docs/API_AUDIT.md`. Migrate handlers returning ad-hoc error bodies to the
+helpers. Success responses stay as-is unless trivially normalizable; do not churn working reads.
+
+### 2. Validate input at every boundary with zod
+For every handler that reads a body, query, or path params, add a zod schema and parse at the
+top, returning `validationError()` (with field-level detail) on failure. Centralize reusable
+schemas in `api/_lib/validate.js`. Internal code then trusts its inputs — no defensive
+re-checking downstream. Prioritize: mutating routes, money routes, anything taking a wallet
+address / mint / amount. Cover the ~77 currently-unvalidated handlers; track progress in
+`docs/API_AUDIT.md`.
+
+### 3. Rate-limit every abusable route
+Apply `@upstash/ratelimit` via `_lib/rate-limit.js` to the ~42 routes that lack it. Tier the
+limits: generous on cheap reads, tight on expensive/abusable ones (generation, LLM proxies,
+mint, send, anything that spends an upstream's quota or money). On limit, return the consistent
+`rateLimited()` envelope with a `Retry-After`. Use `clientIp` + (for authed routes) the
+identity as the key. If Redis is unavailable, fail **open** for reads and **closed** for
+money/auth routes — never crash.
+
+### 4. Idempotency keys on every mutating route
+Add idempotency to POST/PUT/PATCH/DELETE handlers that create or change state. Accept an
+`Idempotency-Key` header (and/or derive a deterministic key from the operation); store
+key→result in Redis with a TTL; on a repeat key, return the stored result instead of re-running.
+This is the boundary contract; A3 will rely on it for the money paths specifically — so make the
+helper reusable and money-path-grade. Build a small `idempotent(handler, keyFn)` helper alongside
+`wrap()` and document it.
+
+### 5. Error boundaries at every network/input edge
+Audit handlers for un-awaited promises, unguarded `JSON.parse`, and upstream calls without
+try/catch. Every network/input boundary must produce an actionable envelope, never a raw 500 or
+hung request. Internal logic (post-validation) trusts itself — don't over-wrap pure functions.
+
+### 6. Produce the audit ledger
+Update `docs/API_AUDIT.md` into a real per-endpoint matrix: validated ✓, rate-limited ✓,
+idempotent ✓ (or N/A for reads), auth-gated (defer detail to A4), envelope ✓. This is the
+checklist A5 turns into tests and A4 cross-checks for authz.
+
+## Definition of done
+Clears `00b-the-bar.md` §4: all ~100 handlers validate input at the boundary, every abusable
+route is rate-limited with a `Retry-After`, every mutating route is idempotent and retry-safe,
+and **one** error-envelope shape is enforced through `http.js` helpers carrying A1's requestId.
+`docs/API_AUDIT.md` is a complete, accurate matrix. A retried mutating request returns the same
+result, not a duplicate. Inherits the global definition of done in `00-README-orchestration.md`.
+
+## Operating rules (override defaults)
+No mocks/fake data/placeholders/TODOs/stubs. `$THREE` is the only coin. Design tokens only for any
+UI. Stage explicit paths only (never `git add -A`); re-check `git diff --staged` before commit.
+**You own `api/_lib/http.js`'s structure**, `_lib/validate.js`, `_lib/rate-limit.js`, the
+per-handler validation/limits, and `docs/API_AUDIT.md`. A1 adds telemetry inside `wrap()` and A4
+adds headers/CSP — accept their additive helpers; don't undo them. Extend; don't rewrite working
+handlers' success paths.
+
+## When finished
+Run `CLAUDE.md`'s five self-review checks. Ship one improvement (e.g. a body-size cap or a
+content-type guard applied platform-wide via the boundary). Append a `data/changelog.json` entry
+(tag: `improvement` or `security`) only if user-visible (e.g. clearer error messages). Then delete
+this prompt file (`prompts/production-campaign/A-reliability/A2-api-hardening.md`) and report the
+envelope shape, the idempotency helper signature (A3 depends on it), and any route you left
+deliberately un-limited and why.
diff --git a/prompts/market/A-reliability/A3-payment-correctness.md b/prompts/market/A-reliability/A3-payment-correctness.md
new file mode 100644
index 000000000..04d96d5b8
--- /dev/null
+++ b/prompts/market/A-reliability/A3-payment-correctness.md
@@ -0,0 +1,102 @@
+# A3 — Payment Correctness
+
+You are a senior engineer + product thinker building **three.ws**. Read `CLAUDE.md`,
+`STRUCTURE.md`, and `prompts/production-campaign/00b-the-bar.md` first. **Prerequisites:** A1
+(traces on money paths) and A2 (the idempotency helper + error envelope you'll reuse).
+
+## Why this matters for $1B
+This is **the** trust foundation. A platform that loses funds once is worth zero forever — no
+feature, no growth, no polish recovers from "it took my money and gave me nothing." `00b-the-bar.md`
+§1 states it plainly: "No money is ever lost or double-spent. Payment, mint, send, and trade paths
+are idempotent, retry-safe, and confirm on-chain before claiming success. A failed transaction
+surfaces a clear 'this did not go through, your funds are safe' state." Every dollar that flows
+through three.ws flows through the paths you audit here.
+
+## Current state (read before you write)
+- **x402 checkout:** `api/x402-checkout.js` already builds Solana/EVM payment transactions, uses
+ `createAssociatedTokenAccountIdempotentInstruction` (idempotent ATA), and has retry/confirm
+ logic ("confirm and prompts a clean retry, never a double charge"). `api/_lib/x402-solana-confirm.js`,
+ `_lib/x402-spending-ledger.js`, `_lib/x402-spending-cap.js`, `_lib/evm-payment-verify.js`,
+ `_lib/x402-errors.js` (the `X402Error` type) are the supporting cast.
+- **Agent-wallet custody/sends:** `api/_lib/agent-wallet.js`, `_lib/agent-spend-policy.js`,
+ `_lib/solana-transfer.js`, `_lib/evm-transfer.js`, `src/agent-wallet/ownership.js`. Existing
+ guard tests: `tests/agent-custody-guards.test.js`.
+- **Billing / subscriptions:** `api/_lib/subscription-billing.js`, `_lib/subscription-checkout.js`,
+ `_lib/subscription-pricing.js`. Existing: `tests/billing.test.js`.
+- **Mint / launch:** `api/pump-launch.js`, `_lib/pump-platform-fee.js`, `_lib/onchain-deploy.js`,
+ `_lib/payout.js`, `_lib/royalty.js`, `_lib/fee.js`.
+- **The gap:** correctness is strong in places (x402 checkout) and unproven elsewhere. There is no
+ single audit guaranteeing **every** money path: (a) is idempotent under retry, (b) confirms
+ on-chain before reporting success, (c) has a designed failed/refund state, (d) cannot
+ double-spend. Verify each path's current behavior by reading it — do not assume.
+
+## Your mission
+### 1. Enumerate every money path, then audit each against four invariants
+Build the inventory (x402 checkout + paid-endpoint settlement, agent-wallet sends, USDC
+transfers, subscription billing, mint/launch fees, payouts/royalties, copy-trade execution, any
+`*-spending-*` ledger write). For each, verify and fix: **(a) Idempotency** — a retried request
+with the same idempotency key (A2's helper) never moves funds twice; **(b) Confirm-before-success**
+— success is reported only after on-chain confirmation (reuse `x402-solana-confirm.js` /
+`evm-payment-verify.js` patterns), never on broadcast; **(c) Failed/refund state**; **(d)
+No double-spend** under concurrent requests (Redis lock / atomic ledger write).
+
+### 2. "Your funds are safe" failure state — everywhere money moves
+Every money path's failure must produce the exact reassurance pattern from the bar: a clear,
+designed state that says *this did not go through, your funds are safe*, with a real retry. No
+ambiguous "error" toast on a payment, no spinner that spins after a broadcast, no silent
+swallow. Wire this in both the API envelope (A2 shape) and the UI surfaces that call these paths
+(Forge high-quality unlock, x402 checkout, agent send, billing). Distinguish "broadcast failed
+(funds untouched)" from "broadcast succeeded, confirmation pending" — they need different copy.
+
+### 3. On-chain confirmation gate on every send/mint
+No path reports success on a signature alone. Each must poll/confirm to the right commitment
+('confirmed'/'finalized' as appropriate) within a budget, then verify the on-chain effect (token
+received, ATA funded, fee paid) before flipping state to success. On timeout, return a "pending —
+we'll confirm" state, never a false success. Record the signature so a later reconciliation can
+resolve pending → success/failed.
+
+### 4. Atomic ledgers and concurrency safety
+The spending ledger and any balance/cap accounting must be atomic — concurrent requests on the
+same wallet cannot both pass a cap check and both spend. Use Redis atomic ops / a per-wallet lock.
+Reconcile pending entries (a sweep that confirms or fails stuck signatures) so the ledger never
+drifts from chain truth.
+
+### 5. Reconciliation + alerting on money anomalies
+Wire money-path failures and anomalies (a confirm timeout, a ledger mismatch, a refund) into A1's
+telemetry with `recordPaymentMetric(...)` and a tighter ops-alert threshold. A stuck or failed
+payment must page. Add a reconciliation routine (endpoint or worker) that resolves pending
+signatures and flags drift.
+
+### 6. Prove it with tests
+Extend `tests/agent-custody-guards.test.js` and `tests/billing.test.js` and add money-path specs:
+double-submit returns one effect; broadcast-then-confirm-fail yields the "funds safe" state;
+concurrent cap checks can't both pass; a pending signature reconciles correctly. These feed A5's
+gate — make them offline-safe so `scripts/test-gate.mjs` can include them.
+
+## Definition of done
+Clears `00b-the-bar.md` §1 money clause for **every** path in the inventory: idempotent,
+retry-safe, confirm-on-chain-before-success, no double-spend, and a designed "your funds are safe"
+failure state in both API and UI. Atomic ledger; reconciliation resolves pending. Money anomalies
+page via A1. New tests cover double-submit, confirm-failure, and concurrency, and run in the gate.
+Inherits the global definition of done in `00-README-orchestration.md`. Where you cannot exercise a
+live mainnet path locally, verify the logic and tests and say so — never claim a live settlement you
+didn't observe.
+
+## Operating rules (override defaults)
+No mocks/fake data/placeholders/TODOs/stubs — **and no real third-party mints in tests/fixtures**;
+use `$THREE` (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`) or a clearly-synthetic placeholder.
+`$THREE` is the only coin. Stage explicit paths only (never `git add -A`); re-check `git diff
+--staged` before commit (watch the `npx vercel build` trap that bundles `api/*.js` — check `head -1`
+for `__defProp`). **You own the money paths**: `api/x402-checkout.js`, `_lib/agent-wallet.js`,
+`_lib/x402-*`, `_lib/subscription-billing.js`, `src/agent-wallet/`, money-path tests. Reuse A2's
+idempotency helper and A1's payment metrics; don't fork them. Extend the strong existing logic; don't
+rewrite working confirm code.
+
+## When finished
+Run `CLAUDE.md`'s five self-review checks. Ship one improvement (e.g. the pending-signature
+reconciliation sweep, or a per-wallet daily-spend safety ceiling). Append a `data/changelog.json`
+entry (tag: `security` or `fix`) — "your funds are safe" guarantees are exactly what holders want to
+read. Then delete this prompt file
+(`prompts/production-campaign/A-reliability/A3-payment-correctness.md`) and report the money-path
+inventory, which invariants each path already met vs. you fixed, and any path needing live-mainnet
+verification you couldn't do locally.
diff --git a/prompts/market/A-reliability/A4-security-hardening.md b/prompts/market/A-reliability/A4-security-hardening.md
new file mode 100644
index 000000000..b9ea31ec1
--- /dev/null
+++ b/prompts/market/A-reliability/A4-security-hardening.md
@@ -0,0 +1,92 @@
+# A4 — Security Hardening
+
+You are a senior engineer + product thinker building **three.ws**. Read `CLAUDE.md`,
+`STRUCTURE.md`, and `prompts/production-campaign/00b-the-bar.md` first. **Prerequisites:** A2
+(shares the `http.js` boundary where authz and headers attach).
+
+## Why this matters for $1B
+Trust is the whole valuation thesis, and security is its hard edge. One leaked server key in the
+client bundle, one endpoint that lets user A move user B's funds, one CSRF hole on a state-changing
+route — any of these is a single-incident, reputation-ending event for a platform that holds money
+and wallets. `00b-the-bar.md` §4: "No secrets in the client. Every API key lives server-side behind
+a proxy. Grep the built client bundle for key patterns as part of done." This prompt makes the
+attack surface boring.
+
+## Current state (read before you write)
+- `api/_lib/http.js` already sets `x-content-type-options: nosniff`, `x-frame-options: DENY`,
+ `referrer-policy: strict-origin-when-cross-origin` on responses — a base to build CSP and the
+ rest on. `api/csrf-token.js` + `api/_lib/csrf.js` exist. `api/_lib/auth.js`, `_lib/account-auth.js`,
+ `_lib/siwe.js`, `_lib/siws.js`, `_lib/siwx-server.js`, `_lib/zauth.js`, `_lib/privy.js`,
+ `_lib/saml.js` cover auth; `src/auth/` (email-auth, walletconnect-bridge) the client side.
+- `api/_lib/ssrf-guard.js` / `_lib/ssrf.js`, `_lib/secret-box.js`, `_lib/pii.js`,
+ `_lib/moderation.js`, `_lib/granite-guardian.js` exist. Security docs: `docs/security/SECURITY_AUDIT.md`,
+ `SECURITY_REMEDIATION.md`.
+- **The gap:** CSRF and auth helpers exist but aren't provably applied on **every** state-changing
+ and money/auth route; there is no committed proof that **no server secret reaches the client
+ bundle**; there is no platform-wide **CSP**; per-endpoint **authorization** (does this identity own
+ this resource?) is uneven. Read the helpers and the route list — verify, don't assume.
+
+## Your mission
+### 1. Grep the BUILT bundle for secrets — and gate it
+Build the client (read how the repo builds; do **not** run `npx vercel build`, which corrupts
+`api/*.js` — use the documented `vite`/`build:*` path) and grep the output for key patterns
+(`sk-`, `SENTRY_DSN` if private, RPC keys, Privy/Helius/Birdeye/ElevenLabs/OpenAI/Anthropic keys,
+`PRIVATE_KEY`, JWT secrets, `process.env.*` leaks). Any hit is a leaked secret — move it behind a
+server proxy. Add a committed scanner (a script A5 wires into CI) that fails the build on a future
+leak. This is a hard gate, not advisory.
+
+### 2. CSRF on every state-changing route
+Confirm `api/csrf-token.js` issues and `_lib/csrf.js` verifies a token, then enforce verification on
+**every** POST/PUT/PATCH/DELETE that isn't a signature-authenticated API (where the wallet signature
+is the CSRF defense). Cross-check against A2's `docs/API_AUDIT.md` matrix — add a "CSRF ✓" column.
+No state-changing browser route may be unprotected.
+
+### 3. Per-endpoint authorization — ownership checks everywhere
+Validation (A2) proves the input is well-formed; authorization proves *this caller may do this*. Audit
+every endpoint that reads or mutates a user-owned resource (wallet, agent, build, billing, world,
+launch) and add an ownership/role check: the authenticated identity must own (or be permitted on) the
+target. An IDOR — user A reading/moving user B's wallet by changing an ID — must be impossible. Use the
+existing auth/identity helpers; centralize a `requireOwner`/`requireAuth` guard so it's consistent.
+
+### 4. Security headers + a real CSP
+Extend the `http.js` header block (additively — A2 owns the file's structure) and the HTML/static
+layer with a real Content-Security-Policy (script/style/connect/img/font sources scoped to what the
+app actually loads — no blanket `unsafe-inline` for scripts where avoidable), plus `Strict-Transport-Security`,
+`Permissions-Policy`, and `Cross-Origin-Opener/Resource-Policy` where appropriate. Test that the CSP
+doesn't break Three.js, wallet SDKs, or the existing pages — tighten iteratively, don't ship a CSP
+that white-screens a surface.
+
+### 5. Abuse prevention + secret hygiene
+Layer on top of A2's rate limits: bot/abuse heuristics on the expensive, money-adjacent, and
+auth-bruteforceable routes (login, mint, send, generation). Confirm secrets are read only via
+`_lib/env.js`/`_lib/secret-box.js` server-side, never logged (coordinate with A1 so logged fields are
+scrubbed of PII/secrets), and rotated-friendly. Verify SSRF guards cover every server-side fetch of a
+user-supplied URL.
+
+### 6. Update the security audit ledger
+Turn `docs/security/SECURITY_AUDIT.md` into a current, accurate map: bundle-secret scan result, CSRF
+coverage, authz coverage, CSP policy, abuse controls, SSRF coverage, open items with owners. This is
+the document an external auditor (and Track G) reads.
+
+## Definition of done
+Clears `00b-the-bar.md` §4 security clauses: a committed scan proves **zero** server secrets in the
+client bundle and gates future leaks; CSRF enforced on every state-changing browser route; an ownership
+check on every user-owned-resource endpoint (no IDOR); a real CSP + security headers live without
+breaking any surface; abuse controls on auth/money/generation routes; SSRF guarded on every user-URL
+fetch. `docs/security/SECURITY_AUDIT.md` reflects reality. Inherits the global definition of done in
+`00-README-orchestration.md`.
+
+## Operating rules (override defaults)
+No mocks/fake data/placeholders/TODOs/stubs. `$THREE` is the only coin. Design tokens only for any UI.
+Stage explicit paths only (never `git add -A`); re-check `git diff --staged` before commit. **Do NOT
+run `npx vercel build`** (it bundles `api/*.js` — `head -1` check before any `api/` commit). You own
+`api/csrf-token.js`, `_lib/csrf.js`, `_lib/auth.js`, `src/auth/`, the header/CSP block in `http.js`
+(additive — A2 owns structure), and `docs/security/`. Reuse existing auth/SSRF/secret helpers; don't
+rewrite working auth flows.
+
+## When finished
+Run `CLAUDE.md`'s five self-review checks. Ship one improvement (e.g. a CSP report-only collector that
+feeds A1, or auth-bruteforce lockout). Append a `data/changelog.json` entry (tag: `security`) — visible
+trust signals matter to holders. Then delete this prompt file
+(`prompts/production-campaign/A-reliability/A4-security-hardening.md`) and report the bundle-scan result,
+the CSP policy shipped, any route you found unauthorized and fixed, and the scanner seam A5 should gate.
diff --git a/prompts/market/A-reliability/A5-test-coverage-ci-gate.md b/prompts/market/A-reliability/A5-test-coverage-ci-gate.md
new file mode 100644
index 000000000..91084ba47
--- /dev/null
+++ b/prompts/market/A-reliability/A5-test-coverage-ci-gate.md
@@ -0,0 +1,89 @@
+# A5 — Test Coverage & CI Gate
+
+You are a senior engineer + product thinker building **three.ws**. Read `CLAUDE.md`,
+`STRUCTURE.md`, and `prompts/production-campaign/00b-the-bar.md` first. **Prerequisites:** A2,
+A3, A4 (their new code is what you must cover; their audit ledgers are your test checklists).
+
+## Why this matters for $1B
+Reliability that isn't enforced by CI is reliability that regresses on the next deploy. A1–A4 can
+make the platform correct today; only a green, enforced gate keeps it correct tomorrow. The $1B
+distinction is a platform where a money/auth/3D regression **cannot ship** — the build fails first.
+A flaky suite is as bad as no suite: it trains everyone to ignore red, and then a real failure slips
+through. This prompt turns the test surface into a trustworthy gate.
+
+## Current state (read before you write)
+- 219 specs under `tests/` (`*.test.js`). `vitest.config.js` and `playwright.config.js` configure
+ unit + browser tests; `npm test` drives a real browser via Playwright and includes specs that need
+ live DB/RPC credentials.
+- `scripts/test-gate.mjs` runs a **curated, offline-safe subset** ("money-path confirmation handling,
+ the HTTP cache/error boundary, custody spend guards, payment verification") so a regression in those
+ FAILS THE DEPLOY. Its header explicitly invites adding new money/auth invariant tests.
+- `.github/workflows/ci.yml` runs: Lint (`eslint`), Unit tests (`vitest run`), Source guards
+ (`check-api-not-bundled`, `check:images`, `build:pages`), Typecheck (advisory). **It does NOT run
+ `scripts/test-gate.mjs`, Playwright, or coverage thresholds.**
+- **The gap:** coverage on money/auth/3D paths is unmeasured; flakes are unaddressed; the curated gate
+ exists but isn't enforced in CI as the merge-blocking checkpoint; there are no coverage budgets.
+
+## Your mission
+### 1. Measure coverage, then raise it on the paths that matter
+Turn on vitest coverage (v8/istanbul) and read the real numbers. Set **enforced** thresholds — not a
+blanket global, but a meaningful floor on the critical lanes: money paths (A3's inventory),
+auth/authz (A4), and the 3D pipeline (`src/glb-canonicalize.js`, `src/animation-retarget.js`,
+forge/avatar flows). Write the missing tests to clear the floor. Cover the A2 boundary helpers
+(envelope, validation, idempotency, rate-limit) and the A4 guards (CSRF, ownership, bundle-secret
+scan) directly.
+
+### 2. Make the money/auth/3D specs gate-grade and offline-safe
+Extend `scripts/test-gate.mjs` to include the new A3/A4 invariant tests (double-submit idempotency,
+confirm-failure "funds safe", concurrent cap, IDOR/authz rejection) — keeping every gate test
+green-offline (no live DB/RPC/browser), per its own header rule. The gate is the fast, deterministic
+checkpoint; the heavy suite stays in `npm test`.
+
+### 3. Eliminate flakes — root-cause, don't retry-paper-over
+Find the flaky specs (run the suite repeatedly; look for time/order/network nondeterminism). Fix the
+cause: fake timers for time-dependent logic, deterministic seeds, awaited async, isolated state,
+stable Playwright selectors (`getByRole`/test-ids, not brittle CSS) and proper auto-waiting instead of
+arbitrary `waitForTimeout`. A test that's green 100/100 runs or it's deleted/fixed — no `retry: 3`
+masking real instability on money/auth paths.
+
+### 4. Enforce `test:gate` (and Playwright) in CI
+Wire `scripts/test-gate.mjs` into `.github/workflows/ci.yml` as a **required**, merge-blocking job.
+Add a Playwright job for the critical e2e flows (first-run Forge free lane, wallet connect, an x402
+checkout dry path, the status page) — run it headless with the right browser deps, artifact traces on
+failure. Append jobs additively; **A6 also edits `ci.yml`** for Lighthouse — coordinate, don't reformat
+the file, stage explicit hunks.
+
+### 5. Cover the new code from A2/A3/A4 explicitly
+Walk A2's `docs/API_AUDIT.md` and A4's `docs/security/SECURITY_AUDIT.md` as checklists: each
+"validated/rate-limited/idempotent/CSRF/authz ✓" claim should have a test that proves it. Where a claim
+has no test, write one or correct the ledger. The audit and the tests must agree.
+
+### 6. Document the testing contract
+Add/refresh a short `docs/ops/testing.md` (or extend an existing testing doc): what runs in the gate
+vs. the full suite, how to add a gate-grade test, the coverage floors and where they're enforced, how
+to debug a Playwright trace. So the next contributor keeps the gate green by default.
+
+## Definition of done
+The critical lanes (money, auth, 3D) meet an **enforced** coverage floor; A2/A3/A4's new logic has
+direct tests that match their audit ledgers; flakes are root-caused (no retry-masking on money/auth);
+`scripts/test-gate.mjs` and a Playwright critical-path job are **required, merge-blocking** in
+`ci.yml`; the testing contract is documented. `00b-the-bar.md`'s "existing tests pass; new logic has
+new tests; money/auth/3D paths covered" is enforced by machinery, not goodwill. Inherits the global
+definition of done in `00-README-orchestration.md`. Note explicitly which specs need live credentials
+and therefore live in the heavy suite, not the gate.
+
+## Operating rules (override defaults)
+No mocks of **our own** money/RPC logic — test the real code paths with offline-safe inputs; **no real
+third-party mints in fixtures** (use `$THREE` or a synthetic placeholder). `$THREE` is the only coin.
+Stage explicit paths only (never `git add -A`); re-check `git diff --staged` before commit. You own
+`vitest.config.js`, `playwright.config.js`, `scripts/test-gate.mjs`, `tests/**`, and the test jobs in
+`.github/workflows/ci.yml` (shared with A6 — append, don't reformat). Don't weaken a threshold to pass;
+fix the code or write the test.
+
+## When finished
+Run `CLAUDE.md`'s five self-review checks. Ship one improvement (e.g. coverage trend artifact, or a
+mutation-test smoke on the money path). No changelog entry unless something user-visible changed (CI is
+an internal chore) — but if a flaky-bug fix changed real behavior, log it (tag: `fix`). Then delete this
+prompt file (`prompts/production-campaign/A-reliability/A5-test-coverage-ci-gate.md`) and report the
+coverage numbers before/after, the gate job names now blocking merge, and any flake you quarantined with
+a follow-up needed.
diff --git a/prompts/market/A-reliability/A6-performance-web-vitals.md b/prompts/market/A-reliability/A6-performance-web-vitals.md
new file mode 100644
index 000000000..eb68635bb
--- /dev/null
+++ b/prompts/market/A-reliability/A6-performance-web-vitals.md
@@ -0,0 +1,85 @@
+# A6 — Performance & Web Vitals
+
+You are a senior engineer + product thinker building **three.ws**. Read `CLAUDE.md`,
+`STRUCTURE.md`, and `prompts/production-campaign/00b-the-bar.md` first. **Prerequisites:** none —
+this prompt owns its own lane and can run in parallel with A1–A5 (it shares only `ci.yml` with A5;
+coordinate there).
+
+## Why this matters for $1B
+Performance is trust the user feels before they read a word. A 3D platform that ships a multi-MB GLB
+on the critical path, janks on scroll, or shifts layout under the user's cursor reads as a prototype,
+not a $1B product. `00b-the-bar.md` §2 sets the hard numbers: **LCP < 2.5s, CLS < 0.1, INP < 200ms on
+a mid-tier mobile over 4G, on every primary surface**; 3D loads progressively; no FOUC. Speed is also
+growth — every 100ms of LCP is activation lost. This prompt makes the numbers real and keeps them real.
+
+## Current state (read before you write)
+- `.lighthouserc.json` already exists. `scripts/optimize-glb.mjs` and `scripts/compress-glbs.mjs`
+ exist for asset compression. `inject-theme-boot.mjs` boots the theme before paint (the status page
+ and others already inline the theme-boot script — no-flash is partly solved).
+- `.github/workflows/ci.yml` runs lint/vitest/source-guards/typecheck but **does not run Lighthouse**.
+- Three.js powers the 3D surfaces (Forge, avatar presence, viewers). It's heavy; verify how/where it's
+ imported and whether it's on the critical path of pages that don't need it immediately.
+- **The gap:** Core Web Vitals are not measured or budgeted in CI; `.lighthouserc.json` is unenforced;
+ GLB compression isn't proven applied to shipped assets; Three.js lazy-loading and GPU disposal are
+ inconsistent. Read the actual import graph and asset sizes before optimizing — measure first.
+
+## Your mission
+### 1. Wire Lighthouse CI as an enforced gate with real budgets
+Flesh out `.lighthouserc.json` with assertions that enforce the §2 budgets (LCP < 2.5s, CLS < 0.1,
+INP < 200ms — plus TBT/total-byte-weight guards) on the **primary surfaces** (home, Forge, an agent
+profile, the marketplace, the status page). Add a Lighthouse job to `.github/workflows/ci.yml` that runs
+on a mobile/4G throttle profile and **fails the build** when a budget regresses. Append the job
+additively — **A5 also edits `ci.yml`** (test jobs); coordinate, don't reformat, stage explicit hunks.
+
+### 2. Lazy-load Three.js and every heavy module off the critical path
+Trace the Three.js import graph. Any surface that doesn't render 3D above the fold must not pay for
+Three.js in its initial bundle — dynamic-`import()` it on demand behind a real loading skeleton (not a
+spinner, not a `setTimeout` fake). Same for other heavy deps (wallet SDKs, charting). Verify in the
+network tab that the 3D chunk loads only when a 3D surface is actually entered.
+
+### 3. Compress GLBs and load them progressively
+Run `scripts/optimize-glb.mjs` / `scripts/compress-glbs.mjs` over the shipped GLB assets (draco/meshopt)
+and confirm the size drop. No surface blocks on a multi-MB model: stream/lazy-load the GLB with a
+skeleton that matches the final layout, and **dispose GPU resources on unmount** (geometries, materials,
+textures, renderer) so navigating away doesn't leak memory or tank the next surface's frame rate.
+Target 60fps on the avatar presence and no jank on scroll.
+
+### 4. Kill layout shift and FOUC on every primary surface
+Confirm theme/tokens/fonts resolve before content paints (build on `inject-theme-boot.mjs`); reserve
+space for async content (images, 3D canvases, lists) with explicit dimensions/aspect-ratios so nothing
+shifts; preload the critical font; set `font-display` sensibly. CLS < 0.1 means the page doesn't move
+under the user — verify with the Lighthouse trace, not by eye.
+
+### 5. Mobile performance pass
+Test the budgets on a mid-tier mobile profile at 320px and 768px. Debounce input handlers, paginate long
+lists, use `transform`/`will-change` for animations (and honor `prefers-reduced-motion`), avoid main-
+thread-blocking work during interaction (INP). Defer non-critical third-party scripts. The first-run
+path (`00b-the-bar.md` §5: value in < 60s) must be fast on a phone, not just a laptop.
+
+### 6. Prove the numbers and hold them
+Run Lighthouse on each primary surface before/after and record the LCP/CLS/INP deltas in your report.
+The CI gate then holds them: a future PR that regresses a budget fails. Document the budgets and how to
+read a failing Lighthouse run in `docs/ops/`.
+
+## Definition of done
+Clears `00b-the-bar.md` §2: every primary surface meets LCP < 2.5s, CLS < 0.1, INP < 200ms on a
+mobile/4G profile, enforced by a **merge-blocking** Lighthouse CI job; Three.js and heavy modules are
+lazy-loaded behind real skeletons; shipped GLBs are draco/meshopt-compressed with progressive load and
+GPU disposal; no FOUC or layout shift on primary surfaces; mobile is fast at 320/768px. Before/after
+numbers in the report. Inherits the global definition of done in `00-README-orchestration.md`.
+
+## Operating rules (override defaults)
+No mocks/fake data/placeholders/TODOs/stubs — **no `setTimeout` fake-loading or fake progress bars**;
+real async with real skeletons only. `$THREE` is the only coin. Design tokens only (`public/tokens.css`)
+for any skeleton/loading UI. Stage explicit paths only (never `git add -A`); re-check `git diff --staged`
+before commit (watch the `npx vercel build` `api/*.js` bundling trap if you build). You own
+`.lighthouserc.json`, the Lighthouse job in `ci.yml` (shared with A5 — append, don't reformat), the GLB
+scripts, and the lazy-load wiring in `src/` 3D entry points. Don't rewrite working render code — extend
+its loading/disposal.
+
+## When finished
+Run `CLAUDE.md`'s five self-review checks. Ship one improvement (e.g. a route-level prefetch of the 3D
+chunk on hover, or an OG-image perf win). Append a `data/changelog.json` entry (tag: `improvement`) —
+"the app got faster" is user-visible. Then delete this prompt file
+(`prompts/production-campaign/A-reliability/A6-performance-web-vitals.md`) and report the before/after
+Web Vitals per surface, the GLB size reductions, and any surface that can't yet hold a budget and why.
diff --git a/prompts/market/B-growth/00-README.md b/prompts/market/B-growth/00-README.md
new file mode 100644
index 000000000..3d2b2bb33
--- /dev/null
+++ b/prompts/market/B-growth/00-README.md
@@ -0,0 +1,52 @@
+# Track B — Activation, Growth & Distribution
+
+**Goal: turn visitors into users who come back.** three.ws is impressive and mostly
+built — 125+ pages, 100+ endpoints, SDKs, MCP servers, payment rails. What it lacks is
+the growth machinery that compounds: a first run that reaches value in under 60 seconds,
+SEO that makes every page discoverable, analytics that prove activation, share loops that
+turn each forged model and trade win into a new visitor, lifecycle messaging that earns a
+second session, and a landing page that converts. A platform nobody activates on is worth
+its liquidation value. This track builds the funnel — acquisition → activation → retention
+→ revenue — and instruments every stage so "we think users like it" becomes a number.
+
+Read `CLAUDE.md`, `STRUCTURE.md`, `prompts/production-campaign/00-README-orchestration.md`,
+and `prompts/production-campaign/00b-the-bar.md` before any prompt here. Every prompt
+inherits the global definition of done; each adds its own.
+
+## The six prompts
+
+| ID | Mission (one line) | Run order |
+|---|---|---|
+| **B1** | First-run flow to real value in <60s, no signup wall before the first "wow" — built on the feature-tour, activation measured. | First (unblocks B3, B6) |
+| **B2** | SEO + structured data across all 125+ pages: canonical, sitemap, JSON-LD, OG, llms.txt — inject scripts wired into the build and held. | First (independent) |
+| **B3** | Clean event taxonomy + funnel instrumentation on every primary surface, readable in a dashboard. Extends `src/acquisition-analytics.js`. | After B1 |
+| **B4** | Every shareable moment → a gorgeous universal OG card + one-tap share + a referral loop. Built on `api/*-og.js` and `@vercel/og`. | After B3 (uses events) |
+| **B5** | Lifecycle email, notifications, changelog→Telegram, re-engagement digests, win-back — honest opt-in/opt-out. | After B3 |
+| **B6** | Conversion-optimize home/landing: value prop, social proof, CTA hierarchy, above-the-fold wow — measured. | Last (consumes B1–B4) |
+
+**Run order in one line:** B1 + B2 in parallel first → then B3 → then B4 + B5 in parallel
+→ then B6 last (it depends on the activation path, the funnel, the share cards, and the
+press strip all existing). Each is independent enough to run in its own chat; the
+dependencies above are about *quality of result*, not hard blocks.
+
+## File-ownership map (parallel-safe lanes)
+
+Stage explicit paths only — never `git add -A`. Shared files (`data/changelog.json`,
+`data/pages.json`) are **append-only**; never reformat them. If two prompts run at once,
+these lanes do not collide:
+
+| Prompt | Owns (edit freely) | Touches lightly (append/wire only) |
+|---|---|---|
+| **B1** | `src/feature-tour/*`, `pages/start.html`, `src/start.js`, `pages/home.html` (first-run trigger only) | `src/acquisition-analytics.js` (emit activation events) |
+| **B2** | `scripts/inject-seo-meta.mjs`, `scripts/inject-blog-seo.mjs`, `scripts/build-page-index.mjs`, `docs/llms.txt`, `docs/llms-full.txt`, `public/llms.txt`, `vercel.json`/`vite.config.js` (sitemap wiring) | `package.json` scripts (build wiring), per-page `<head>` via injectors |
+| **B3** | `src/acquisition-analytics.js`, `src/analytics.js`, a new analytics dashboard page | per-surface `data-cta`/event hooks (additive attributes only) |
+| **B4** | `api/agent-og.js`, `api/avatar-og.js`, `api/feature-og.js`, `api/a-og.js`, `api/app-og.js`, `api/*-share.js`, `api/agent-oembed.js`, share UI components, `src/dashboard-next/pages/referrals.js`, `src/dashboard-next/referral-claim.js` | shared OG render helper under `api/_lib/` |
+| **B5** | `api/_lib/email.js`, `api/newsletter-subscribe.js`, `scripts/changelog-telegram.mjs`, `api/alerts/*`, `src/notifications.js`, new digest/win-back cron(s) under `api/cron/` | email-preference UI in account settings |
+| **B6** | `pages/home.html` (full landing), home hero/CTA/social-proof CSS+markup | consumes B1's first-run trigger, B3's events, B4's share cards |
+
+`pages/home.html` is touched by B1 (trigger wire), B6 (full conversion pass), and B3
+(event hooks). Coordinate: **B6 owns home.html's layout/markup**; B1 adds only the
+first-run entry hook; B3 adds only `data-cta`/event attributes. Re-check `git diff --staged`
+before committing.
+
+When this directory contains only this `00-README.md`, Track B is done.
diff --git a/prompts/market/B-growth/B1-onboarding-activation.md b/prompts/market/B-growth/B1-onboarding-activation.md
new file mode 100644
index 000000000..428bf79f3
--- /dev/null
+++ b/prompts/market/B-growth/B1-onboarding-activation.md
@@ -0,0 +1,92 @@
+# B1 — Onboarding & Activation: real value in under 60 seconds
+
+You are a senior engineer + product thinker building **three.ws**. Read `CLAUDE.md`,
+`STRUCTURE.md`, and `prompts/production-campaign/00b-the-bar.md` first. **Prerequisites:** none.
+
+## Why this matters for $1B
+Activation is the hinge of the entire valuation. A visitor who reaches a "wow" in their first
+minute — a textured 3D model they typed into existence, a walk companion strolling their
+screen, an agent that talks back — becomes a user; one who hits a signup wall first becomes a
+bounce. The bar (`00b-the-bar.md` §5) is explicit: **first-run path to value in under 60
+seconds with no signup wall before the first wow.** Every other growth surface — SEO, share
+loops, lifecycle email — is wasted spend if the moment a visitor arrives is a dead end. This
+prompt makes the front door convert.
+
+## Current state (read before you write)
+- `src/feature-tour/` is a complete guided-tour engine: `index.js` (`createFeatureTour()`),
+ `director.js`, `narrator.js`, `guide-avatar.js`, `controls.js`, `free-roam.js`,
+ `chapters.js`, `curriculum.js`, `spotlight.js`. It exists but is not wired as a first-run
+ activation flow — it's a tour, not an onboarding funnel with a measured outcome.
+- `pages/start.html` + `src/start.js` are the intended entry surface. Read them: see what they
+ currently render and whether they route a brand-new visitor to a value moment.
+- `docs/onboarding/ONBOARDING-PLAN-2026-06-19.md` is the product plan — read it and honor the
+ intent; do not contradict it without reason.
+- Free value lanes that need NO signup: the **Forge free lane** (NVIDIA NIM / TRELLIS
+ text→3D — grep for the free engine path; the MCP `forge_free` tool proves it's free), the
+ **walk companion** (`walk-sdk/`, `src/walk-companion.js`), and a **sample agent** profile.
+- The gap: no single, deliberate, measured first-run that picks one of these, gets a true
+ first-time visitor to the "wow" with zero auth, then *earns* the signup ask afterward.
+
+## Your mission
+### 1. Design the <60s first-run path on `pages/start.html` / `src/start.js`
+Detect a first-time visitor (no session, no `localStorage` activation flag). Present one
+crisp choice or a smart default that leads to the fastest real wow: **a Forge free-lane
+prompt box** ("Type anything → get a 3D model") is the strongest default. Pre-fill an
+example prompt so a click — not typing — can trigger it. The path must hit real value (a
+real GLB from the free engine, a real companion on screen) **before any auth**. No mock, no
+canned asset — the actual free pipeline.
+
+### 2. Drive it with the existing feature-tour, don't rebuild it
+Use `createFeatureTour()` / `director.js` / `narrator.js` / `spotlight.js` to choreograph the
+moment — spotlight the prompt box, narrate the one instruction, celebrate the result. Extend
+the tour engine where it lacks an "activation outcome" concept; do not fork it. The guide
+avatar (`guide-avatar.js`) should feel alive, not scripted. Respect `prefers-reduced-motion`.
+
+### 3. Hold the signup wall until after the wow
+No login, wallet-connect, or email gate before the first delivered value. After the wow,
+present the upgrade ask in context ("Save this model / Forge in high quality with $THREE /
+Create an account to keep your gallery") — the ask is *earned*, tied to a concrete next
+benefit, and dismissible. Never a modal that blocks the value the user just saw.
+
+### 4. Make it resumable and honest about failure
+Persist activation progress so a refresh or a return visit doesn't restart the wow. If the
+free engine is busy (the real "free engines all busy" state from `00b-the-bar.md` §1), the
+flow degrades to a real alternative — switch to the walk companion wow, queue, or notify-me —
+never a dead end or a fake spinner.
+
+### 5. Measure activation
+Emit real funnel events at each step (first-run shown → wow attempted → wow delivered →
+signup ask shown → converted) via `src/acquisition-analytics.js` (it already exports
+`trackLandingView`, `wireCtaTracking`, and routes through `src/analytics.js`'s
+`trackFunnelStep('activation', …)`). Use the existing `ANALYTICS_EVENTS`/`FUNNELS` taxonomy;
+add the few activation steps it's missing. This is the data B3 reads — wire it cleanly, don't
+invent a parallel system.
+
+### 6. Wire the entry points
+The first-run path must be reachable: a new visitor landing on `pages/home.html` or
+`pages/start.html` enters it without hunting. Add only the minimal first-run trigger to
+`home.html` (B6 owns its full layout — coordinate, append a hook, don't restyle it).
+
+## Definition of done
+Maps to `00b-the-bar.md` §5 (activation measured, <60s to value, no pre-wow signup wall) and
+§3 (every state designed). Specifically: a real first-time visitor reaches genuine value
+(real GLB or real companion) in **under 60 seconds, no auth**, verified with a stopwatch in a
+fresh incognito session; the busy/error path offers a real way forward; activation funnel
+events fire into the existing taxonomy and are visible in the network tab; resumable across
+refresh; loading/empty/error/celebrate states all designed and on-token; keyboard- and
+screen-reader-navigable. **Also inherits the global definition of done in
+`00-README-orchestration.md`.**
+
+## Operating rules (override defaults)
+No mocks/fake data/placeholders/TODOs/stubs. No `setTimeout` fake-loading — the free engine is
+real async. `$THREE` is the only coin. Design tokens only. Stage explicit paths only (never
+`git add -A`); re-check `git diff --staged` before commit. Own the onboarding/feature-tour
+lane; extend the existing tour engine and analytics module, don't rewrite them.
+
+## When finished
+Run the five self-review checks (lazy / user / integration / edge-case / pride). Ship one
+improvement — e.g. a second example prompt that showcases a different model type, or a
+"share your first model" hook that hands off cleanly to B4. Append a `data/changelog.json`
+entry (user-visible: tag `feature`). Then delete this prompt file
+(`prompts/production-campaign/B-growth/B1-onboarding-activation.md`) and report what you
+shipped, the measured time-to-wow, and the activation events you emitted (the seam B3 builds on).
diff --git a/prompts/market/B-growth/B2-seo-structured-data.md b/prompts/market/B-growth/B2-seo-structured-data.md
new file mode 100644
index 000000000..cdd5bdbee
--- /dev/null
+++ b/prompts/market/B-growth/B2-seo-structured-data.md
@@ -0,0 +1,89 @@
+# B2 — SEO & Structured Data across all 125+ pages
+
+You are a senior engineer + product thinker building **three.ws**. Read `CLAUDE.md`,
+`STRUCTURE.md`, and `prompts/production-campaign/00b-the-bar.md` first. **Prerequisites:** none.
+
+## Why this matters for $1B
+Distribution is one of the five pillars (`00-README-orchestration.md`). A platform with 125+
+genuinely useful surfaces that search engines and AI crawlers can't parse is invisible — it
+compounds nothing. Correct metadata, canonical URLs, a complete sitemap, and JSON-LD
+structured data are how Google, Bing, and increasingly the LLM crawlers (which `llms.txt`
+exists to serve) understand what three.ws *is* and rank/cite it. This is the cheapest, highest-
+leverage growth work in the campaign: it makes every other page you've already built
+discoverable, shareable, and machine-readable — permanently.
+
+## Current state (read before you write)
+- `scripts/inject-seo-meta.mjs`, `scripts/inject-blog-seo.mjs`, and
+ `scripts/build-page-index.mjs` already exist and are **already wired into `prebuild`** in
+ `package.json` (`inject-blog-seo --write` → `build-page-index` → `audit-page-index --strict`
+ → `inject-seo-meta --write`). There's also a `seo:meta` script. Read all three scripts and
+ the `prebuild` chain before changing anything — the wiring exists; your job is to make the
+ *output complete and correct on every page*, not to re-architect the pipeline.
+- `data/pages.json` is the page registry that feeds the index and changelog. `docs/llms.txt`,
+ `docs/llms-full.txt`, and `public/llms.txt` exist — confirm they're current and served.
+- Per-page OG: many `api/*-og.js` endpoints render dynamic cards (B4 owns those). Static pages
+ need correct static OG tags from the injector.
+- The gap to audit: which of the 125+ pages are *missing* canonical URLs, unique
+ title/description, OG/Twitter tags, or JSON-LD? Is the sitemap complete and submitted? Is
+ `audit-page-index --strict` actually catching omissions, or passing pages with empty meta?
+
+## Your mission
+### 1. Audit coverage across all pages
+Run `node scripts/build-page-index.mjs` and `node scripts/audit-page-index.mjs --strict`; read
+`data/pages.json` against the actual files in `pages/`. Produce the real list of pages missing
+canonical, unique title (<60 chars), description (<160 chars), OG image, or structured data.
+Generalize if a script name differs — find the actual injector.
+
+### 2. Make `inject-seo-meta.mjs` emit complete, correct metadata for every page
+Each page gets: a unique `<title>` and meta description, a `<link rel="canonical">` to the
+production URL, full Open Graph (`og:title`, `og:description`, `og:image`, `og:url`,
+`og:type`) and Twitter Card tags, and `theme-color`. Derive from `data/pages.json` where
+possible — no hand-maintained per-page duplication. Default OG image must be on-brand; dynamic
+pages defer to B4's `api/*-og.js` endpoints (wire the URL, coordinate, don't reimplement).
+
+### 3. Add JSON-LD structured data
+Emit appropriate `schema.org` JSON-LD per page type: `WebSite` + `SearchAction` on home,
+`SoftwareApplication`/`Product` on product surfaces, `Article`/`BlogPosting` on blog (extend
+`inject-blog-seo.mjs`), `BreadcrumbList` on nested pages, `Organization` site-wide. Validate
+the shape — malformed JSON-LD is worse than none.
+
+### 4. Generate and serve a complete sitemap + robots
+Build `sitemap.xml` from `data/pages.json` (every public page, real `lastmod`, sensible
+`priority`/`changefreq`) and a correct `robots.txt` pointing at it. Wire generation into the
+build (alongside `build-page-index`), not a manual step. Confirm both are served at the root
+in production (check `vercel.json` rewrites).
+
+### 5. Keep `llms.txt` / `llms-full.txt` accurate and built
+These tell AI crawlers what three.ws offers. Make `docs/llms.txt`, `docs/llms-full.txt`, and
+`public/llms.txt` consistent and regenerated from the page registry (not hand-edited and
+stale). Cover the real product surfaces from `STRUCTURE.md`. `$THREE` is the only coin named.
+
+### 6. Hold it in the build (regression-proof)
+Strengthen `audit-page-index --strict` (or its sibling) to **fail the build** on any public
+page missing canonical, title, description, or OG image — so future pages can't ship SEO-
+broken. This is the "wire the inject scripts into the build and hold them" deliverable.
+
+## Definition of done
+Maps to the distribution pillar and §3 polish (no FOUC from injected tags). Specifically:
+every public page has a unique canonical, title, description, OG + Twitter tags, and valid
+JSON-LD (spot-check 5+ across types in Google's Rich Results Test mentally / via the validator
+shape); `sitemap.xml` + `robots.txt` are complete, built, and served; `llms.txt` files are
+regenerated and accurate; the build **fails** if a page ships without required meta; no
+console errors; the injected `<head>` causes no layout shift. **Also inherits the global
+definition of done in `00-README-orchestration.md`.**
+
+## Operating rules (override defaults)
+No mocks/fake data/placeholders/TODOs. `$THREE` is the only coin — scrub any other token from
+meta, JSON-LD, sitemap, llms.txt. Design tokens for any visible default-OG art. **Watch the
+`api/*.js` bundle trap** (`__defProp`/`createRequire` in `head -1`) if you touch any endpoint.
+Stage explicit paths only (never `git add -A`); re-check `git diff --staged` before commit.
+Own the SEO/build-script lane; extend the existing injectors and page-index pipeline, don't
+replace them.
+
+## When finished
+Run the five self-review checks. Ship one improvement — e.g. `hreflang` readiness, a
+`SearchAction` that actually resolves to the site search, or an OG-image fallback chain.
+Append a `data/changelog.json` entry if user-visible (tag `improvement`/`infra`). Then delete
+this prompt file (`prompts/production-campaign/B-growth/B2-seo-structured-data.md`) and report
+the before/after coverage numbers, the build gate you added, and any page type still needing a
+bespoke JSON-LD schema (seam for C-surfaces).
diff --git a/prompts/market/B-growth/B3-analytics-funnel.md b/prompts/market/B-growth/B3-analytics-funnel.md
new file mode 100644
index 000000000..02e09550d
--- /dev/null
+++ b/prompts/market/B-growth/B3-analytics-funnel.md
@@ -0,0 +1,87 @@
+# B3 — Analytics & Funnel Instrumentation
+
+You are a senior engineer + product thinker building **three.ws**. Read `CLAUDE.md`,
+`STRUCTURE.md`, and `prompts/production-campaign/00b-the-bar.md` first. **Prerequisites:**
+B1 (it emits the activation events this funnel reads — runs better after, not hard-blocked).
+
+## Why this matters for $1B
+"We think users like it" is not data, and you cannot raise a billion-dollar valuation on a
+vibe. The bar (`00b-the-bar.md` §5) is unambiguous: **every primary surface emits real
+analytics events into a funnel you can read.** Without it, every other growth decision in this
+track — which onboarding wins, which share card converts, which lifecycle email earns a return
+— is a guess. This prompt builds the one clean taxonomy that turns three.ws's behavior into
+measurable acquisition → activation → retention → revenue, and a dashboard that makes it
+legible. It's the instrument panel the whole campaign flies by.
+
+## Current state (read before you write)
+- `src/acquisition-analytics.js` exists and exports `trackLandingView()` (fires
+ `LANDING_VIEWED` as the first activation step), `wireCtaTracking()` (delegated `data-cta`
+ click capture → `CTA_CLICKED`), and `initAcquisitionAnalytics()`. It imports `track`,
+ `ANALYTICS_EVENTS`, `FUNNELS`, and `trackFunnelStep` from `src/analytics.js` — **read that
+ module**: it's the core event bus and taxonomy. Do NOT fork either; extend them.
+- `src/app.js` has a view beacon (grep "view beacon for analytics" ~line 1262) — understand
+ what's already fired and from where, so you don't double-count or invent a parallel path.
+- The gap: the taxonomy is partial (a couple of events, one funnel). There is no end-to-end
+ acquisition→activation→retention→revenue funnel covering Forge, walk, agents, marketplace,
+ x402 pay, and $THREE surfaces, and no dashboard to read it.
+
+## Your mission
+### 1. Define one clean event taxonomy (extend `ANALYTICS_EVENTS` / `FUNNELS`)
+In `src/analytics.js`, formalize a small, consistent, namespaced event set across four funnel
+stages — **acquisition** (landing viewed, referral arrived, share clicked-through),
+**activation** (first-run shown, wow delivered, account created), **retention** (returned,
+session N, gallery revisited), **revenue** (checkout started, $THREE-gated upgrade,
+x402 paid, mint/launch). Names are documentation: `forge.free.generate.succeeded`, not
+`event7`. Define the `FUNNELS` map so each stage's ordered steps are explicit and queryable.
+
+### 2. Instrument every primary surface — additively
+Add event emission on Forge (free + high-quality), the walk companion, agent profiles, the
+marketplace, x402 checkout, and the $THREE-gated upgrades. Prefer the existing `data-cta`
+attribute pattern (`wireCtaTracking` already delegates) so most CTAs are captured by markup,
+not bespoke handlers. For surfaces lacking it, add `data-cta`/`data-funnel-step` attributes —
+**additive only**, no behavior change. Coordinate with B1 (activation events) and B6 (home
+CTAs): use the same taxonomy, don't define a second one.
+
+### 3. Confirm the event sink is real (no fake telemetry)
+Trace where `track()` actually sends — a real beacon/endpoint (Axiom is already wired server-
+side per `00b-the-bar.md` §1; there may be a client `/api/` collector). If events are
+currently swallowed, wire a real, batched, `sendBeacon`-based sink to a real endpoint. No
+`console.log` analytics, no dropped events. Respect Do-Not-Track and any consent gate
+(coordinate with G-trust if a consent banner exists).
+
+### 4. Build a funnel dashboard surface
+Create a real dashboard page (fit it into `src/dashboard-next/` to match the existing pattern,
+or a dedicated `/analytics` page) that reads aggregated funnel data from a real query endpoint
+and renders the four-stage funnel with conversion rates, drop-off, and a time range. Every
+state designed: loading (skeleton), empty ("no events yet — here's how events flow in"), error
+(actionable), populated (on-token charts). This is what makes the data *readable*, per the bar.
+
+### 5. Make it privacy-honest and resilient
+Boundary-handle the sink (network failure must never break a user surface — fire-and-forget,
+buffered). No PII in events. Sampling/rate-limit if volume warrants. Document the taxonomy
+inline so the next agent emits correctly.
+
+## Definition of done
+Maps to `00b-the-bar.md` §5 (activation measured, funnel readable) and §4 (honest UI, inputs
+validated). Specifically: a single coherent taxonomy in `src/analytics.js` covering all four
+funnel stages; every primary surface emits real events visible in the network tab going to a
+real sink; a dashboard renders the acquisition→activation→retention→revenue funnel with real
+conversion numbers and all five states; DNT/consent respected; no double-counting with the
+existing `app.js` beacon; no console errors. **Also inherits the global definition of done in
+`00-README-orchestration.md`.**
+
+## Operating rules (override defaults)
+No mocks/fake data/placeholders/TODOs — no fabricated funnel numbers in the dashboard, real
+aggregates only. `$THREE` is the only coin. Design tokens only for the dashboard. Stage
+explicit paths only (never `git add -A`); re-check `git diff --staged` before commit. Own the
+analytics lane (`src/analytics.js`, `src/acquisition-analytics.js`, the dashboard page);
+extend the existing modules, never fork them — adding `data-cta` attributes to other surfaces
+is additive and in-lane.
+
+## When finished
+Run the five self-review checks. Ship one improvement — e.g. a per-surface conversion sparkline
+on the dashboard, or a shareable "this week's activation rate" tile. Append a
+`data/changelog.json` entry if the dashboard is user-visible (tag `feature`/`infra`). Then
+delete this prompt file (`prompts/production-campaign/B-growth/B3-analytics-funnel.md`) and
+report the taxonomy you shipped, which surfaces are instrumented, and the dashboard URL — the
+seam B4, B5, and B6 measure their work against.
diff --git a/prompts/market/B-growth/B4-virality-share-loops.md b/prompts/market/B-growth/B4-virality-share-loops.md
new file mode 100644
index 000000000..419114862
--- /dev/null
+++ b/prompts/market/B-growth/B4-virality-share-loops.md
@@ -0,0 +1,91 @@
+# B4 — Virality, Share Loops & Referrals
+
+You are a senior engineer + product thinker building **three.ws**. Read `CLAUDE.md`,
+`STRUCTURE.md`, and `prompts/production-campaign/00b-the-bar.md` first. **Prerequisites:**
+B3 (share/referral events feed the funnel — run after, not hard-blocked).
+
+## Why this matters for $1B
+Network effects are the difference between linear growth and a compounding curve
+(`00-README-orchestration.md` pillar 4). The cheapest acquisition channel is a user showing
+off what they made. The bar (`00b-the-bar.md` §5): **every shareable moment has an OG card
+and a share action — a generated model, a trade win, an agent profile — each a link that
+unfurls beautifully.** three.ws already has the raw materials (a fleet of `*-og.js` endpoints,
+`@vercel/og`, share endpoints, a referrals page) but they're not unified into a gorgeous,
+universal, one-tap loop that closes back into activation. This prompt turns every proud moment
+into a new visitor.
+
+## Current state (read before you write)
+- OG endpoints already exist: `api/agent-og.js`, `api/avatar-og.js`, `api/feature-og.js`,
+ `api/a-og.js`, `api/app-og.js` — and `@vercel/og` is a dependency (`package.json`). They use
+ a `wrap()` handler pattern (read `api/agent-og.js`). Quality and design consistency across
+ them is uneven — your job is to make them universal and screenshot-worthy.
+- Share endpoints exist: `api/agent-share.js`, `api/forge-share.js`, `api/oracle-share.js`,
+ `api/trader-share.js`, plus `api/agent-oembed.js` (oEmbed for rich embeds). Read them — share
+ routing exists in pieces; it's not one cohesive, on-brand action everywhere.
+- A referral surface already exists: `src/dashboard-next/pages/referrals.js` and
+ `src/dashboard-next/referral-claim.js`. Read both — extend, don't rebuild.
+- The gap: no shared OG render system (each endpoint reinvents layout), no one-tap share on
+ every shareable surface, and the referral loop isn't wired to attribute new activations.
+
+## Your mission
+### 1. Build one gorgeous, universal OG render system
+Extract a shared `@vercel/og` layout helper into `api/_lib/` (brand frame, $THREE-consistent
+palette from design tokens, three.ws logo, dynamic title/subtitle/art slot, model thumbnail or
+avatar render). Refactor `agent-og.js`, `avatar-og.js`, `feature-og.js`, `a-og.js`,
+`app-og.js` to use it so every card is unmistakably three.ws and pixel-clean at 1200×630.
+Handle overflow (200-char names), missing art (on-brand fallback), and edge data — never a
+broken or empty card. Cards must render fast (cache headers) and never 500.
+
+### 2. Add a one-tap share action to every shareable moment
+A reusable share control (Web Share API where available, copy-link + X/Telegram/Farcaster
+fallback) on: a forged model (post-Forge, ties to B1's wow), a trade win (trader surface),
+an agent profile, and a launched coin's record. Each share produces a real link whose `<head>`
+points at the right `*-og.js` card and oEmbed (`agent-oembed.js`) so it unfurls everywhere
+(X, Discord, Telegram, iMessage, Slack). Verify the unfurl shape, not just that the image 200s.
+
+### 3. Close the referral loop
+Extend `src/dashboard-next/pages/referrals.js` + `referral-claim.js`: every signed-in user gets
+a real referral link; sharing a model/profile/win carries that referral param; an arriving
+referee is attributed on activation (account create / first paid action). Surface real referral
+stats (clicks → activations → rewards) — no fabricated counts. Define the reward honestly
+(coordinate with D-monetization for any $THREE-denominated incentive; never invent another
+token).
+
+### 4. Wire share + referral events into the funnel
+Emit B3's taxonomy events: `share.clicked`, `share.completed`, `referral.link.created`,
+`referral.arrived`, `referral.activated`. This makes virality measurable — k-factor becomes a
+number on B3's dashboard, not a hope.
+
+### 5. Make sharing irresistible, not an afterthought
+The share affordance appears at the peak emotional moment (model delivered, win banked), is
+one tap, previews the actual card before sending, and confirms with delight. Hover/active/focus
+states, reduced-motion honored, keyboard-reachable. The card is the product's billboard —
+treat it like one.
+
+## Definition of done
+Maps to `00b-the-bar.md` §5 (every shareable moment → gorgeous OG card + share action) and §3
+(screenshot test). Specifically: all five OG endpoints render through one shared, on-brand
+helper and unfurl correctly on X/Discord/Telegram (verified); a one-tap share exists on
+forged-model, trade-win, agent-profile, and launch surfaces with working fallbacks; the
+referral link attributes real arrivals to activation with honest stats; share/referral events
+flow into B3's funnel; OG endpoints cache, never 500, and handle overflow/missing art; no
+console errors. **Also inherits the global definition of done in
+`00-README-orchestration.md`.**
+
+## Operating rules (override defaults)
+No mocks/fake data/placeholders/TODOs — no fake referral counts, no canned share preview.
+`$THREE` is the only coin in any card, copy, reward, or metadata. Design tokens only for OG
+art and share UI. **Watch the `api/*.js` bundle trap** — check `head -1` of every edited
+endpoint for `__defProp`/`createRequire` before committing; recover with
+`git restore -- api/ public/`. Stage explicit paths only (never `git add -A`); re-check
+`git diff --staged` before commit. Own the OG/share/referral lane; extend the existing
+endpoints and referral pages, don't replace them.
+
+## When finished
+Run the five self-review checks. Ship one improvement — e.g. an animated/looping OG variant for
+platforms that support it, or a "remix this model" deep link that drops the referee straight
+into B1's first-run with the original prompt. Append a `data/changelog.json` entry (tag
+`feature`). Then delete this prompt file
+(`prompts/production-campaign/B-growth/B4-virality-share-loops.md`) and report the unified OG
+system, the surfaces that now share in one tap, the referral attribution path, and the
+k-factor events — the seam B6 uses for social proof.
diff --git a/prompts/market/B-growth/B5-retention-lifecycle.md b/prompts/market/B-growth/B5-retention-lifecycle.md
new file mode 100644
index 000000000..21d6da6ff
--- /dev/null
+++ b/prompts/market/B-growth/B5-retention-lifecycle.md
@@ -0,0 +1,89 @@
+# B5 — Retention & Lifecycle Messaging
+
+You are a senior engineer + product thinker building **three.ws**. Read `CLAUDE.md`,
+`STRUCTURE.md`, and `prompts/production-campaign/00b-the-bar.md` first. **Prerequisites:**
+B3 (lifecycle triggers fire on funnel events — run after, not hard-blocked).
+
+## Why this matters for $1B
+Activation gets a user in the door once; **retention is what a valuation is built on** — daily
+use and a reason to come back tomorrow (`00-README-orchestration.md` pillar 2). A platform with
+great activation and zero lifecycle messaging leaks every cohort it acquires. The machinery is
+already here — Resend is a dependency, transactional email exists, the changelog→Telegram push
+exists, notifications and pump alerts exist — but it isn't orchestrated into a coherent
+lifecycle that welcomes, re-engages, digests, and wins back, *honestly opted into*. This prompt
+turns one-time visitors into a returning, compounding user base.
+
+## Current state (read before you write)
+- `api/_lib/email.js` is real transactional email via **Resend** (`process.env.RESEND_API_KEY`),
+ fire-and-forget, with `buildPayload()` and render helpers already written: `renderWelcome`,
+ `renderVerify`, `renderPasswordReset`, `renderSubscriptionConfirm`, `renderPurchaseReceipt`,
+ `renderSaleNotification`. Read it — extend this module's render set; don't reinvent sending.
+- `api/newsletter-subscribe.js` uses Resend audiences (`RESEND_AUDIENCE_ID`) — the opt-in
+ subscribe path exists. Confirm there's an honest unsubscribe path; build one if missing.
+- `scripts/changelog-telegram.mjs` (`npm run changelog:push`) posts new `data/changelog.json`
+ entries to the holders' Telegram channel — the changelog→Telegram loop exists; verify it's
+ reliable and idempotent (no double-posts).
+- `src/notifications.js` and `api/alerts/` (`rules.js`, `rules/[id].js`, evaluated by a
+ pumpfun-monitor cron) are the in-app/pump notification system. Read them — the eventing and
+ cron pattern you'll reuse for digests lives here.
+- The gap: no welcome/onboarding-nudge sequence, no re-engagement digest, no win-back for
+ dormant users, and opt-in/opt-out preferences aren't centralized or honest everywhere.
+
+## Your mission
+### 1. Build the lifecycle email sequence on `api/_lib/email.js`
+Add render helpers + triggered sends for the real moments: **welcome** (post-signup — extend
+`renderWelcome` into a true day-0 nudge toward the next action), **activation nudge** (signed
+up but hasn't forged/walked), **re-engagement digest** (what's new in your gallery, $THREE
+updates, launches), and **win-back** (dormant N days). Each email is on-brand, plain-text +
+HTML, single clear CTA, and links to a real surface. Reuse the existing Resend send path — no
+new mailer.
+
+### 2. Trigger off real funnel state, not a schedule alone
+Wire triggers to B3's funnel events where event-driven (welcome on `account.created`,
+activation nudge on "signed up, no wow after X"), and a cron under `api/cron/` (match the
+pumpfun-monitor cron pattern in `api/alerts/`) for time-based digests/win-back that query real
+user state. No blasting — segment by real behavior. Idempotent: a user never gets the same
+lifecycle email twice.
+
+### 3. Unify in-app notifications with the lifecycle
+`src/notifications.js` should surface the same lifecycle moments in-app (new launch, sale,
+digest-worthy events) so messaging is consistent across channels. Reuse `api/alerts/` rules
+where a user has configured them; don't duplicate the alert engine.
+
+### 4. Harden the changelog→Telegram push
+Make `scripts/changelog-telegram.mjs` bulletproof: idempotent (track what's posted, never
+double-send), `--dry-run` honored, and gracefully skips when `TELEGRAM_BOT_TOKEN` /
+`TELEGRAM_CHANGELOG_CHAT_ID` are absent. This is a holder-facing retention channel — it must
+not spam or miss.
+
+### 5. Honest opt-in / opt-out everywhere
+A real preference center (extend account settings) for: lifecycle email, product digests,
+in-app notifications, Telegram. Every email has a working one-click unsubscribe (List-
+Unsubscribe header + link) wired to Resend audiences. Default to the minimum honest set; never
+opt a user in silently. Respect the preference on every send — verify the gate.
+
+## Definition of done
+Maps to pillar 2 (retention) and §4 (honest UI). Specifically: welcome, activation-nudge,
+digest, and win-back emails send via the existing Resend path, triggered by real state, fully
+idempotent, with working unsubscribe; a preference center honors opt-out on every channel;
+in-app notifications mirror lifecycle moments without duplicating the alert engine; the
+changelog→Telegram push is idempotent and credential-safe; no email/notification fires against
+a user who opted out (verified); no secrets client-side; no console errors. **Also inherits the
+global definition of done in `00-README-orchestration.md`.**
+
+## Operating rules (override defaults)
+No mocks/fake data/placeholders/TODOs — real Resend sends, real user-state queries, no canned
+recipient lists. `$THREE` is the only coin named in any email, digest, push, or notification.
+Design tokens (or the email's existing template tokens) for all rendered mail. **Watch the
+`api/*.js` bundle trap** on edited endpoints/crons. Stage explicit paths only (never
+`git add -A`); re-check `git diff --staged` before commit. Own the lifecycle/notifications
+lane; extend `api/_lib/email.js`, `src/notifications.js`, `api/alerts/`, and the Telegram
+script — don't fork them.
+
+## When finished
+Run the five self-review checks. Ship one improvement — e.g. a "your first model, one week
+later" win-back that re-uses B4's OG card, or a digest that surfaces the user's own funnel
+progress from B3. Append a `data/changelog.json` entry if user-visible (tag `feature`). Then
+delete this prompt file (`prompts/production-campaign/B-growth/B5-retention-lifecycle.md`) and
+report the lifecycle sequence, the trigger sources, the preference center, and the idempotency
+guarantees — note any send that still needs a real cohort to validate (seam for the next agent).
diff --git a/prompts/market/B-growth/B6-home-landing-conversion.md b/prompts/market/B-growth/B6-home-landing-conversion.md
new file mode 100644
index 000000000..8c803e866
--- /dev/null
+++ b/prompts/market/B-growth/B6-home-landing-conversion.md
@@ -0,0 +1,90 @@
+# B6 — Home & Landing Conversion
+
+You are a senior engineer + product thinker building **three.ws**. Read `CLAUDE.md`,
+`STRUCTURE.md`, and `prompts/production-campaign/00b-the-bar.md` first. **Prerequisites:**
+B1 (the first-run path the hero CTA drops into), B3 (the events that measure conversion),
+B4 (the share cards / social proof). Run **last** in Track B — it consumes the others.
+
+## Why this matters for $1B
+The home page is the single most-trafficked surface and the one that decides whether a visitor
+becomes a user or a bounce. Polish that signals seriousness (`00-README-orchestration.md`
+pillar 5) is communicated here first: a sharp value prop, credible social proof, a clear CTA
+hierarchy, and an above-the-fold "wow" are how trust is established *before* it's earned. A
+landing page that buries what three.ws does, or asks for signup before showing value, wastes
+every dollar of acquisition the rest of this track generates. This prompt makes the front door
+convert at the bar of Vercel / Linear / Stripe.
+
+## Current state (read before you write)
+- `pages/home.html` is the landing surface and already contains a **press/partner strip**
+ (grep `press-strip` / `press-logo` — the markup and styles exist around line 294+). That's
+ real social proof to feature, not invent.
+- `public/features.json` is the feature registry (large — the source of truth for what to
+ showcase). `data/pages.json` is the page registry. The hero/value-prop today — read it and
+ judge honestly against the bar: is the value prop sharp in five words? Is there an above-the-
+ fold wow? Is the CTA hierarchy clear or a wall of equal-weight buttons?
+- B1 ships the first-run path the primary CTA must drop into; B3 ships the event taxonomy
+ conversion is measured with; B4 ships the share cards and referral proof. Build on them.
+- The gap: the landing isn't conversion-optimized — value prop, above-fold wow, CTA hierarchy,
+ and measured social proof need a deliberate pass.
+
+## Your mission
+### 1. Sharpen the value proposition above the fold
+One sentence a stranger understands in three seconds: what three.ws is and the one thing it
+lets them do *right now*. Supporting subhead, then the primary CTA. No jargon, no coin-pitch
+in the hero — the value is the product. Real, on-token typography and spacing rhythm.
+
+### 2. Make the above-the-fold a live "wow", not a static screenshot
+Per `00b-the-bar.md` §2/§3: a real, progressively-loaded 3D moment — a rigged avatar idling,
+or a rotating freshly-forged model — that loads behind a real skeleton, lazy-loads Three.js,
+hits 60fps, disposes GPU resources, and never blocks LCP (< 2.5s, CLS < 0.1). The wow must be
+real (an actual GLB/companion), never a video of a feature that then 404s.
+
+### 3. Build a clear CTA hierarchy that drops into B1's first-run
+One unmistakable primary CTA ("Forge a 3D model free" / "Type anything → get a model") wired to
+B1's <60s first-run path — no signup wall before the wow. Secondary CTAs (explore agents, walk
+companion, docs) are visibly subordinate. Every CTA carries B3's `data-cta`/funnel attributes
+so conversion is measured. No dead or "coming soon" buttons.
+
+### 4. Feature real social proof
+Elevate the existing press/partner strip (don't fabricate logos — use what's already there).
+Add credible, real proof: live counts (models forged, agents created, $THREE-gated unlocks)
+pulled from real endpoints with honest empty/loading states — never hardcoded vanity numbers.
+Surface a real shared model or agent card from B4's OG system as living proof of the product.
+
+### 5. Tell the product story down the page
+Below the fold, a tight, scannable walk through the real surfaces (Forge, walk companion,
+agents, marketplace, $THREE) sourced from `public/features.json` — each with a real
+screenshot/3D snippet and a working link to the actual surface. Every link goes somewhere real;
+every section earns its scroll. Mobile-first at 320 / 768 / 1440px.
+
+### 6. Measure conversion end-to-end
+Emit B3's funnel events: `landing.viewed` (exists), hero CTA clicked, scroll-depth milestones,
+section CTA clicks, first-run entered. The home page's conversion rate must be a number on B3's
+dashboard — verify the events fire in the network tab.
+
+## Definition of done
+Maps to `00b-the-bar.md` §2 (LCP < 2.5s, CLS < 0.1, progressive 3D, no FOUC), §3 (screenshot
+test, all states, responsive, a11y), and §5 (no pre-wow signup wall, conversion measured).
+Specifically: a sharp above-the-fold value prop + live 3D wow that hits the performance bars
+(measured in Lighthouse mentally / via `.lighthouserc.json`); a clear CTA hierarchy whose
+primary action enters B1's first-run with no signup gate; real, honest social proof (existing
+press strip + live counts with designed empty/loading states); every section link resolves;
+conversion events flow to B3; keyboard/screen-reader/reduced-motion clean; no console errors.
+**Also inherits the global definition of done in `00-README-orchestration.md`.**
+
+## Operating rules (override defaults)
+No mocks/fake data/placeholders/TODOs — no fabricated counts, no fake testimonial, no canned
+hero video, no `setTimeout` wow. `$THREE` is the only coin referenced anywhere on the page.
+Design tokens only — no hardcoded colors/spacing/fonts. Stage explicit paths only (never
+`git add -A`); re-check `git diff --staged` before commit. **You own `pages/home.html`'s
+layout and markup** — coordinate with B1 (it added only a first-run trigger hook) and B3 (it
+added only `data-cta` attributes); preserve their hooks, restyle freely around them. Extend the
+existing home surface; don't replace the whole page wholesale.
+
+## When finished
+Run the five self-review checks. Ship one improvement — e.g. an A/B-ready hero variant flag
+wired to B3, or a "made on three.ws" live gallery rail fed by B4's share records. Append a
+`data/changelog.json` entry (tag `improvement`/`feature`). Then delete this prompt file
+(`prompts/production-campaign/B-growth/B6-home-landing-conversion.md`) and report the value
+prop, the measured LCP/CLS, the CTA→first-run wiring, the real social proof you surfaced, and
+the conversion events — the last seam that closes Track B's funnel loop.
diff --git a/prompts/market/D-monetization/00-README.md b/prompts/market/D-monetization/00-README.md
new file mode 100644
index 000000000..14bbe9980
--- /dev/null
+++ b/prompts/market/D-monetization/00-README.md
@@ -0,0 +1,58 @@
+# Track D — Monetization & $THREE Economy
+
+**Goal:** turn users into **real, reconciled revenue**. Not pricing pages that don't bill,
+not paid endpoints that don't settle, not "holder perks" that mean nothing on the page next
+door. Every dollar this track touches is quoted to the user, charged on a real rail, settled
+on-chain or through a real processor, and **reconciled** against a ledger you can audit. The
+$1B thesis pillar this owns is *monetization depth*: revenue × multiple = valuation, and a
+multiple only exists when the revenue is real and the books balance.
+
+The platform already has the bones: holder tiers (`api/_lib/three-tier.js`,
+`three-access.js`), a fee module (`api/_lib/fee.js`, `marketplace-platform-fee.js`), royalty
+ledger (`api/_lib/royalty.js`), payouts (`api/_lib/payout.js`, `api/billing/`), an x402
+catalog at `/.well-known/x402.json` (`api/wk.js`), and ~28 paid endpoints under `api/x402/`.
+This track **completes and connects** them — it does not rewrite the payment plumbing.
+
+**The only coin is `$THREE`** (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). It appears
+nowhere as a recommendation outside that one address; no other token appears anywhere — code,
+copy, tests, fixtures. Runtime user-launch mints are the sole mechanical exception (CLAUDE.md).
+
+---
+
+## Prompts
+
+| # | File | Mission (one line) |
+|---|---|---|
+| **D1** | `D1-three-holder-value-system.md` | One $THREE-holder value system — balance → tier → perks → upgrade path — applied identically on every gating surface. Foundational. |
+| **D2** | `D2-billing-pricing-metering.md` | Real billing: a pricing surface, usage metering, invoices/receipts, and the AWS Marketplace metering + entitlement path. Real charges, real reconciliation. |
+| **D3** | `D3-x402-paid-endpoints-network.md` | Complete and verify the x402 paid-endpoint network + discovery indexing (CDP Bazaar / x402scan / 402index). Every paid endpoint quotes price, settles USDC, is discoverable. |
+| **D4** | `D4-marketplace-economics.md` | Marketplace economics: platform fees, creator royalties, payment splits (@0xsplits/splits-sdk), creator payouts, on-chain skill licenses. Trustless where possible. |
+
+## Run order
+
+```
+D1 (holder value system) ← FOUNDATIONAL. Run first.
+ │ one helper, one tier ladder, one upgrade UX — everything else gates and prices off it
+ ├── D2 (billing / pricing / metering) ← consumes D1 tier discounts in the priced ledger
+ ├── D3 (x402 paid network + discovery) ← consumes D1 tier discounts at quote time
+ └── D4 (marketplace economics) ← consumes D1 tiers for creator perks; D2 ledger for payouts
+```
+
+D1 is the gate: it establishes the single tier ladder, the single balance/tier helper, and
+the single upgrade UX that D2's pricing, D3's quotes, and D4's creator perks all reference.
+Run D1 to completion first. D2–D4 may then run in parallel; each reads D1's contracts, never
+forks its own copy of "what does holding $THREE get you."
+
+## File-ownership map
+
+Stage explicit paths only — never `git add -A`. Shared files (`data/changelog.json`) are
+append-only. Lanes:
+
+| Prompt | Owns (edit freely) | Reads / extends (do not rewrite) |
+|---|---|---|
+| **D1** | `api/_lib/three-tier.js`, `three-access.js`, `three-gate.js`, a shared client gate module under `public/`, the `/account`-tier surface | `forge-tiers.js`, `holder-pass.js`, `balances.js` |
+| **D2** | `api/billing/*`, a pricing page under `pages/`, `api/aws-marketplace/*`, a metering/entitlement lib in `api/_lib/` | `api/_lib/fee.js`, `api/config.js`, D1's tier helper |
+| **D3** | `api/x402/*`, `api/wk.js`, `.well-known/x402.json` build path, `scripts/verify-x402-discovery.mjs`, a registration script | `public/x402*.js`, `api/x402-checkout.js`, D1's tier helper |
+| **D4** | `api/_lib/royalty.js`, `payout.js`, `marketplace-platform-fee.js`, a splits lib in `api/_lib/`, `contracts/skill-license/*`, `api/_lib/skill-license-onchain.js`, `api/creators/*` | D1's tier helper, D2's ledger |
+
+When this directory contains only `00-README.md`, Track D is done.
diff --git a/prompts/market/D-monetization/D1-three-holder-value-system.md b/prompts/market/D-monetization/D1-three-holder-value-system.md
new file mode 100644
index 000000000..cf2c64f20
--- /dev/null
+++ b/prompts/market/D-monetization/D1-three-holder-value-system.md
@@ -0,0 +1,107 @@
+# D1 — One $THREE-Holder Value System, Everywhere
+
+You are a senior engineer + product thinker building **three.ws**. Read `CLAUDE.md`,
+`STRUCTURE.md`, and `prompts/production-campaign/00b-the-bar.md` first. **Prerequisites:** none
+— this is the foundation D2/D3/D4 price and gate against.
+
+## Why this matters for $1B
+
+Holding $THREE is the platform's deflation-free status lever: hold (don't spend) to unlock
+perks. That promise is only worth a multiple if it is **consistent** — the same balance must
+mean the same tier, the same perks, the same discount, on every surface that gates on it.
+Today Forge gates "High quality" on holders but the tier ladder, the perk copy, the upgrade
+path, and the balance check live in separate places and are wired into exactly one surface.
+A holder who sees a "Silver perk" on one page and a dead "for holders only" string on another
+does not believe the token has value — and a token nobody believes in has no market cap to
+multiply. One helper, one UX, everywhere is what makes the economy legible.
+
+## Current state (read before you write)
+
+- `api/_lib/three-tier.js` — the **source of truth**: the `TIERS` ladder (Member → Bronze →
+ Silver → …), `minUsd` thresholds, `discountBps`, `rateMultiplier`, perks, and the signed
+ tier pass (`signTierPass`/`verifyTierPass`) the multiplayer server verifies. Resolves a
+ tier from the live USD value of $THREE held; degrades to Member on a price/RPC hiccup.
+- `api/_lib/three-access.js` — `featureId → { minLevel, enforced, label, why, payPerUse }`
+ registry + `resolveAccess(user, featureId)` (async, for display) and `accessFromTierLevel`
+ (pure, for enforcement). This is the platform-wide access table — but inventory it: how many
+ real `featureId`s are registered vs. how many surfaces actually gate?
+- `api/_lib/three-gate.js` — raw on-chain balance check (`checkThreeBalance`), fails **open**.
+- `api/_lib/holder-pass.js` — the per-coin world-entry pass; `balances.js` — wallet balances.
+- `api/_lib/forge-tiers.js` — Forge's quality tiers; the one surface that gates today.
+- **The gap:** the ladder and access table exist server-side, but there is no single **client**
+ module that every page imports to (1) read the user's tier, (2) render the same tier badge +
+ perk list, (3) gate an affordance with a consistent locked state, and (4) route to one
+ upgrade path. Each surface that wants to gate re-implements the check and the copy.
+
+## Your mission
+
+### 1. Lock the tier ladder + access registry as the single source of truth
+Audit `TIERS` in `three-tier.js` for completeness (every tier has perks, a `discountBps`, a
+`rateMultiplier`, and reachable, sensible `minUsd` thresholds). Inventory `three-access.js`:
+register a `featureId` for **every** surface that should gate on holding — Forge high quality
+(exists), private/branded worlds, priority MCP routing, higher free quotas, early-access pages.
+Each entry needs honest `label`/`why` copy a holder reads in the UI. No invented perks that
+aren't wired — if you register it, the gating surface honors it in this PR or a sibling prompt.
+
+### 2. Ship ONE client holder-value module — `public/three-tier-client.js`
+A single ES module every gating surface imports. It must:
+- Resolve the signed-in user's tier from a real endpoint (extend/confirm an
+ `api/account/tier` or `api/three/access` endpoint that returns `{ tier, usdHeld, nextTier,
+ usdToNext, perks }` from `resolveUserTier`). No client-side balance math — server is truth.
+- Export `renderTierBadge(el, tier)`, `gateAffordance(el, { featureId, onUnlock })`, and
+ `requireTier(featureId)` returning `{ allowed, tier, upgradeUrl }`.
+- A consistent **locked state**: disabled affordance + a tooltip/popover stating the exact
+ requirement ("Hold $25 of $THREE to unlock — you hold $8") and a single upgrade CTA.
+- Cache the tier for the session; refresh on wallet/auth change. Never block paint on the fetch.
+
+### 3. Build the canonical upgrade path — one `/account` (or `/three`) tier surface
+One page renders the full ladder: current tier highlighted, every tier's perks, the live
+$-to-next-tier delta, and a real "Hold more $THREE" action that links to the $THREE acquisition
+flow (the existing $THREE token/buy surface — `$THREE` CA `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`).
+Every locked state across the platform routes here. Design all five states (loading skeleton
+of the ladder, empty/not-signed-in with a connect CTA, error, populated, overflow at $10M+).
+
+### 4. Replace the per-page reinventions with the shared module
+Migrate the Forge "High quality" gate to consume `three-tier-client.js` + `three-access.js`
+instead of its bespoke check. Then wire the shared gate into the other registered surfaces
+(private worlds, priority routing) so they show the same badge, locked state, and upgrade
+route. Delete any duplicated tier copy/threshold literals you find — one ladder, referenced.
+
+### 5. Make holding *visibly* pay off where the user already is
+Surface the holder discount and quota multiplier inline at the point of value: a tier badge in
+the nav/account menu, the holder discount line on any priced action (a seam D2/D3 consume),
+and the perk the user just unlocked called out on the relevant surface. Holding must feel like
+it did something, not just change a number on a settings page.
+
+### 6. Test the ladder and the gate
+Extend tests so the tier resolution, the fail-open balance behavior, the pure
+`accessFromTierLevel` enforcement, and the signed tier-pass round-trip are covered. Add a test
+asserting every `three-access.js` `featureId` maps to a real tier level and has non-empty copy.
+
+## Definition of done
+
+Clears 00b-the-bar.md's monetization bar ("$THREE holding unlocks visible, consistent value
+across every surface that gates on it — same tiering, same upgrade path, everywhere") and the
+polish bar (all five states designed on the tier surface and the locked state). Inherits the
+global definition of done in `00-README-orchestration.md`. Specifically: one client module is
+the only holder gate in the codebase; Forge and ≥2 more surfaces consume it; the upgrade page
+is reachable from every locked state; tier resolution degrades gracefully and is tested;
+`npm test` green; verified in a browser with a real wallet at a real and a zero balance.
+
+## Operating rules (override defaults)
+
+No mocks/fake data/placeholders/TODOs/stubs. **`$THREE` is the ONLY coin** — never name,
+hardcode, or recommend any other token (runtime user-launch mints are the sole mechanical
+exception per CLAUDE.md). Design tokens only. Stage explicit paths only (never `git add -A`).
+Own the holder-value lane (`three-tier.js`, `three-access.js`, `three-gate.js`, the client
+module, the tier surface); extend `balances.js`/`holder-pass.js`/`forge-tiers.js`, don't
+rewrite them.
+
+## When finished
+
+Self-review (CLAUDE.md's five checks). Ship one improvement (e.g. an empty-state illustration
+on the tier surface, or a keyboard-navigable ladder). Append a `data/changelog.json` entry
+(holder-readable, tag `feature` or `improvement`) since this is user-visible. Then delete this
+prompt file (`prompts/production-campaign/D-monetization/D1-three-holder-value-system.md`) and
+report what you shipped + the seam D2/D3/D4 consume (the tier-resolution endpoint shape and the
+`discountBps`/`rateMultiplier` contract they price against).
diff --git a/prompts/market/D-monetization/D2-billing-pricing-metering.md b/prompts/market/D-monetization/D2-billing-pricing-metering.md
new file mode 100644
index 000000000..41beb2194
--- /dev/null
+++ b/prompts/market/D-monetization/D2-billing-pricing-metering.md
@@ -0,0 +1,112 @@
+# D2 — Production Billing: Pricing, Metering, Invoices & AWS Marketplace
+
+You are a senior engineer + product thinker building **three.ws**. Read `CLAUDE.md`,
+`STRUCTURE.md`, and `prompts/production-campaign/00b-the-bar.md` first. **Prerequisites:**
+`D1-three-holder-value-system.md` — pricing applies the holder discount from D1's tier ladder.
+
+## Why this matters for $1B
+
+A platform is "trusted with money" only when its books balance. Right now revenue accrues in
+fragments — a fee here, a royalty ledger there, a payout endpoint elsewhere — with no single
+pricing surface a customer can read, no usage meter they can audit, and no invoice/receipt
+they can expense. Enterprises buying through **AWS Marketplace** (the deps are installed:
+`@aws-sdk/client-marketplace-metering`, `@aws-sdk/client-marketplace-entitlement-service`)
+will not sign without metered billing and entitlement checks that actually call AWS. Real,
+reconciled billing is the difference between "we charge sometimes" and a revenue line an
+acquirer can underwrite at a multiple. This prompt makes the meter real, the invoice real, and
+the AWS path real.
+
+## Current state (read before you write)
+
+- `api/billing/` — `fee-info.js` (public fee rate via `getFeeBps`), `revenue.js` (aggregated
+ per-agent earnings dashboard), `receipts.js`, `summary.js`, `payout-wallets/`,
+ `withdrawals/`. `tests/billing.test.js` exists. Read each — what's a real ledger query vs. a
+ display stub.
+- `api/_lib/fee.js` — `getFeeBps`, the platform fee rate. `api/config.js` — public client
+ config (the pattern for surfacing capability flags to the browser).
+- `api/aws-marketplace/` — `register.js`, `link.js`, `issue-key.js`, `subscription.js`; page
+ `pages/aws-marketplace/welcome.html`. **Inspect:** do these actually call the AWS Marketplace
+ metering/entitlement SDKs, or do they stub the entitlement/metering record? That is the gap.
+- The deps `@aws-sdk/client-marketplace-metering` and `-entitlement-service` are in
+ `package.json` but **grep shows no import** — wire them.
+- **The gap:** no single customer-facing pricing page; usage is not metered into a queryable
+ ledger that produces invoices/receipts; the AWS Marketplace path issues keys but does not
+ `BatchMeterUsage`/`MeterUsage` against AWS or check entitlements via `GetEntitlements`.
+
+## Your mission
+
+### 1. A real pricing surface — `pages/pricing.html`
+One canonical page that reads pricing from a server source of truth (not hardcoded HTML): the
+per-action USDC prices (`forge-tiers.js` `priceUsdcAtomics` is already the truth for Forge;
+generalize to a `/api/pricing` endpoint that returns every priced action + the platform fee +
+the holder-tier discount table from D1). Render tiers, per-action prices, the live holder
+discount, and a "you hold $THREE, your price" personalization when signed in. All five states
+designed. This page is what a buyer reads before they spend a cent.
+
+### 2. Usage metering into a queryable ledger
+Establish one metering primitive — `api/_lib/metering.js` — that every priced action calls
+after it succeeds (`recordUsage({ userId, action, units, priceUsdcAtomics, settlementRef })`)
+writing to a `usage_events` table (Postgres via `api/_lib/db.js`, the pattern `royalty.js`
+already uses). It must be **idempotent** on a settlement/request key so a retried charge is
+never double-metered (00b reliability bar: no double-spend). Back-link each row to its
+on-chain settlement (x402) or processor reference. Wire it into the existing priced endpoints
+that currently charge but don't meter.
+
+### 3. Invoices & receipts from the ledger
+Turn `api/billing/receipts.js` into a real per-charge receipt (action, units, price, fee,
+holder discount applied, settlement tx link, timestamp) and add a periodic **invoice** view
+(`api/billing/invoices` + a `/billing` or `/account/billing` surface) that rolls usage_events
+into a statement the user can read, download (PDF or printable), and reconcile against their
+wallet/card. Every line item traces to a settlement ref. Design the empty state ("no usage
+yet — here's what gets billed") and the populated statement.
+
+### 4. Wire the real AWS Marketplace metering + entitlement path
+In `api/aws-marketplace/`, make the metering and entitlement calls **real**: on a metered
+action, call `BatchMeterUsage`/`MeterUsage` (`@aws-sdk/client-marketplace-metering`) with the
+customer's AWS identifier and the dimension/units; gate entitled features by `GetEntitlements`
+(`@aws-sdk/client-marketplace-entitlement-service`). Resolve the customer via the existing
+`register.js`/`link.js` token flow. Handle the AWS error surface at the boundary (throttling,
+expired entitlement) with an actionable state. Credentials come from `vercel env` / `.env`
+(`AWS_*`, `AWS_MARKETPLACE_PRODUCT_CODE`); if absent, the path ships **inert** (like the fee
+module) and never fakes a meter — never invents a metering record AWS didn't accept.
+
+### 5. Reconciliation — the books must balance
+Add a reconciliation pass (a script under `scripts/` or a worker) that cross-checks
+`usage_events` settlement refs against actual on-chain USDC settlements (and AWS metering
+acknowledgements) and flags any usage with no matching settlement, or settlement with no
+usage. Surface the reconciliation status on the revenue dashboard so an operator can see "all
+charges reconciled" vs. "N unreconciled." This is the trust bar made concrete.
+
+### 6. Test the money paths
+Extend `tests/billing.test.js`: metering idempotency (a duplicate settlement key meters once),
+invoice rollup math (sum of line items = statement total, fee + holder discount applied
+correctly), and the AWS metering call shape (mock the AWS client at the SDK boundary in tests
+only — never a fake meter in product code). Money math has tests.
+
+## Definition of done
+
+Clears 00b-the-bar.md's monetization bar ("revenue surfaces … actually charge, actually
+settle, actually reconcile") and the trust/correctness bar (idempotent, no double-charge,
+inputs validated at the boundary). Inherits the global definition of done in
+`00-README-orchestration.md`. Specifically: a pricing page reads server truth and shows the
+holder price; every priced action meters idempotently into one ledger; receipts and an invoice
+statement reconcile to settlements; the AWS path calls real metering/entitlement SDKs (or ships
+inert without faking); `npm test` green; verified with a real charge end-to-end.
+
+## Operating rules (override defaults)
+
+No mocks/fake data/placeholders/TODOs/stubs. **`$THREE` is the ONLY coin** — never name,
+hardcode, or recommend any other token (runtime user-launch mints are the sole mechanical
+exception per CLAUDE.md). Design tokens only. Stage explicit paths only (never `git add -A`).
+Own the billing lane (`api/billing/*`, `api/aws-marketplace/*`, the pricing page, the metering
+lib); extend `api/_lib/fee.js` and consume D1's tier helper — don't rewrite the fee or tier
+modules.
+
+## When finished
+
+Self-review (CLAUDE.md's five checks). Ship one improvement (e.g. an invoice PDF download, or a
+"reconciled" badge on the revenue dashboard). Append a `data/changelog.json` entry
+(holder-readable, tag `feature`) since pricing/invoices are user-visible. Then delete this
+prompt file (`prompts/production-campaign/D-monetization/D2-billing-pricing-metering.md`) and
+report what you shipped + the seam for the next agent (the `recordUsage` contract and the
+`/api/pricing` shape D3/D4 meter and price against).
diff --git a/prompts/market/D-monetization/D3-x402-paid-endpoints-network.md b/prompts/market/D-monetization/D3-x402-paid-endpoints-network.md
new file mode 100644
index 000000000..91ab3f5e1
--- /dev/null
+++ b/prompts/market/D-monetization/D3-x402-paid-endpoints-network.md
@@ -0,0 +1,114 @@
+# D3 — The x402 Paid-Endpoint Network & Discovery Indexing
+
+You are a senior engineer + product thinker building **three.ws**. Read `CLAUDE.md`,
+`STRUCTURE.md`, and `prompts/production-campaign/00b-the-bar.md` first. **Prerequisites:**
+`D1-three-holder-value-system.md` — quotes apply D1's holder discount at price time.
+
+## Why this matters for $1B
+
+x402 is how three.ws gets paid by **other agents** — machine-to-machine USDC settlement with
+no signup, no invoice, no human. A network of paid endpoints that are *discoverable* is a
+distribution-and-revenue flywheel: an agent in CDP Bazaar finds our endpoint, pays, settles,
+and we're indexed as a provider others build on. The platform that other products pay to call
+is the one that compounds. But discoverability is brittle — a single newline in a Solana
+`payTo` once delisted all 43 of our resources. Every paid endpoint must quote a real price,
+settle real USDC, and pass the indexers' own validation, continuously verified. This is
+revenue and network effect in one rail.
+
+## Current state (read before you write)
+
+- `api/x402/` — ~28 paid endpoints (`forge.js`, `skill-call.js`, `crypto-intel.js`,
+ `vanity.js`, `mint-to-mesh.js`, `tutor.js`, `fact-check.js`, `pay-by-name.js`,
+ `my-receipts.js`, …). `api/x402-checkout.js` is the checkout/settlement core.
+- `public/x402.js`, `x402-pay-core.js`, `x402-paywall.js`, `x402-discover.js` — the client
+ paywall + discovery UI. `public/.well-known`/`api/wk.js` build the catalog.
+- **Discovery (from repo memory — read `x402-discovery-indexing.md`):** the catalog is
+ published at `/.well-known/x402.json` (built in `api/wk.js`) + `/openapi.json`. Indexers:
+ **CDP Bazaar** (catalogs only after a payment SETTLES through the CDP facilitator — EVM/Base,
+ not Solana; needs `discoverable:true`; bazaar `info` must validate against its `schema`),
+ **x402scan** (Base + Solana; prefers static `/openapi.json`), **402index**
+ (`client.register(url)`, all chains, domain-verification = instant).
+- **Verifier:** `node scripts/verify-x402-discovery.mjs` (ajv) fetches the live catalog and
+ runs the indexers' checks — info-vs-schema, required `accept` fields, `payTo` whitespace,
+ Base/Solana coverage, `serviceName` ≤32 ASCII, tags ≤5, `output.example` presence.
+- Related scripts already exist: `x402-register-discovery.mjs`, `verify-x402-endpoints.mjs`,
+ `x402-paid-sweep.mjs`, `trigger-bazaar.sh`.
+- **The gaps (memory's still-open list):** active registration to x402scan + 402index (we're
+ passive crawl only); `/openapi.json` covers ~50% of endpoints; most resources lack
+ `output.example`; the Solana-first vs CDP-EVM-settlement cataloging tension is unresolved.
+
+## Your mission
+
+### 1. Audit every `api/x402/` endpoint against the paid-endpoint contract
+For each endpoint confirm it: (a) returns a real `402 Payment Required` with an `accept` quote
+(price in USDC atomics, `payTo`, chain) when unpaid; (b) verifies and **settles** the payment
+before doing work; (c) returns a receipt the buyer can reconcile. Fix any endpoint that quotes
+but doesn't settle, or settles but doesn't receipt. Apply D1's holder discount to the quoted
+price for signed-in holders (a holder pays less to call our paid endpoints — make the discount
+real in the `accept` amount, traceable in the receipt).
+
+### 2. Make the catalog pass every indexer's validation, continuously
+Bring `/.well-known/x402.json` (via `api/wk.js`) and `/openapi.json` to **100%** coverage of
+the live paid endpoints. Every resource: `discoverable:true`, bazaar `info` validating against
+its declared `schema`, `payTo` with **zero whitespace/newlines** (the delisting trap),
+`serviceName` ≤32 ASCII, ≤5 tags, a real `output.example`, GET=query-params /
+POST=`bodyType:"json"`. Run `node scripts/verify-x402-discovery.mjs` until it is fully green —
+treat every check it makes as acceptance criteria, not advice.
+
+### 3. Close the `/openapi.json` and `output.example` gaps
+Generate the missing half of `/openapi.json` from the same source of truth that builds
+`x402.json` (don't maintain two catalogs by hand — derive both). Backfill a realistic, schema-
+valid `output.example` on every resource so x402scan and the bazaar render and validate the
+endpoint. Examples use only `$THREE` or clearly-synthetic placeholders — **never** a real
+non-`$THREE` mint, creator, or holder address.
+
+### 4. Active registration, not just passive crawl
+Make `scripts/x402-register-discovery.mjs` a real, idempotent registration to **x402scan**
+(`x402scan.com/resources/register`) and **402index** (`client.register(url)`, no auth, domain
+verification). It must be safe to re-run (no duplicate listings), report what it registered,
+and confirm the listing landed. CDP Bazaar is settlement-triggered — ensure a real settlement
+fires through the CDP facilitator so Bazaar catalogs us (the `trigger-bazaar.sh` / paid-sweep
+path), and document which endpoints are EVM/Base-settling for that purpose.
+
+### 5. Resolve the Solana-first vs CDP-EVM-settlement tension honestly
+Solana is the platform default (repo memory), but CDP Bazaar catalogs on EVM/Base settlement.
+Decide per endpoint: expose a Base `accept` option where Bazaar cataloging matters, keep Solana
+as the default rail elsewhere, and make the catalog declare both chains where an endpoint
+settles on both. The user/agent always sees an honest, settleable quote on whichever chain
+they pay. Don't hide the dual-rail — surface it in the paywall (`public/x402-paywall.js`).
+
+### 6. Wire discovery into the product, not just the indexers
+The endpoints we publish should also be discoverable **inside** three.ws: surface the paid-
+endpoint catalog on a `/x402` or services page (extend `public/x402-discover.js`) so a human or
+agent on the platform can browse, see the price, and pay — and so a newly added endpoint shows
+up everywhere at once (00-README's "wire surfaces together"). Add a CI/cron guard that runs the
+verifier after any catalog change so a regression can't silently delist us again.
+
+## Definition of done
+
+Clears 00b-the-bar.md's monetization bar (x402 paid endpoints "actually charge, actually
+settle, actually reconcile") and the trust bar (idempotent settlement, no funds lost, honest
+quotes). Inherits the global definition of done in `00-README-orchestration.md`. Specifically:
+`verify-x402-discovery.mjs` is fully green; `/.well-known/x402.json` and `/openapi.json` cover
+100% of paid endpoints with valid `output.example`s; every endpoint quotes→settles→receipts;
+active registration to x402scan + 402index is idempotent and confirmed; the catalog is browsable
+in-product; a real paid call (Solana and Base where dual-rail) verified end-to-end.
+
+## Operating rules (override defaults)
+
+No mocks/fake data/placeholders/TODOs/stubs. **`$THREE` is the ONLY coin** — never name,
+hardcode, or recommend any other token; `output.example`s use `$THREE` or synthetic
+placeholders only (runtime user-launch mints are the sole mechanical exception per CLAUDE.md).
+Design tokens only. Stage explicit paths only (never `git add -A`). Own the x402 lane
+(`api/x402/*`, `api/wk.js`, the catalog, the verifier + registration scripts); extend
+`api/x402-checkout.js` and `public/x402*.js` and consume D1's tier helper — don't rewrite the
+settlement core.
+
+## When finished
+
+Self-review (CLAUDE.md's five checks). Ship one improvement (e.g. the in-product services
+catalog page, or the CI verifier guard). Append a `data/changelog.json` entry (holder-readable,
+tag `feature` or `infra`) if user-visible. Then delete this prompt file
+(`prompts/production-campaign/D-monetization/D3-x402-paid-endpoints-network.md`) and report
+what you shipped + the verifier's final state + the seam for the next agent (which endpoints
+settle on which chains, and the catalog source-of-truth shape).
diff --git a/prompts/market/D-monetization/D4-marketplace-economics.md b/prompts/market/D-monetization/D4-marketplace-economics.md
new file mode 100644
index 000000000..abd91c8d9
--- /dev/null
+++ b/prompts/market/D-monetization/D4-marketplace-economics.md
@@ -0,0 +1,117 @@
+# D4 — Marketplace Economics: Fees, Royalties, Splits & On-Chain Licenses
+
+You are a senior engineer + product thinker building **three.ws**. Read `CLAUDE.md`,
+`STRUCTURE.md`, and `prompts/production-campaign/00b-the-bar.md` first. **Prerequisites:**
+`D1-three-holder-value-system.md` (creator/buyer tier perks) and ideally
+`D2-billing-pricing-metering.md` (payouts reconcile against D2's ledger).
+
+## Why this matters for $1B
+
+A marketplace is worth a multiple when creators **trust it with their money**. That means a
+fee they can see, a royalty they reliably receive, a split that pays every collaborator their
+exact share, a payout they can withdraw, and — where possible — a license whose terms are
+enforced **on-chain** so nobody has to trust an off-chain ledger. Creators who get paid
+correctly, every time, bring more creators; that supply is the network effect. A skill license
+that mints and enforces trustlessly is the kind of primitive an acquirer underwrites as
+defensible IP. This prompt turns "we take a fee somewhere" into a transparent, trustless
+creator economy.
+
+## Current state (read before you write)
+
+- `api/_lib/marketplace-platform-fee.js` — the platform fee on a skill purchase: a **real**
+ on-chain USDC transfer appended to the buyer's single transaction, routed to the treasury;
+ fee comes out of the listed price, creator nets the remainder, buyer total never marked up;
+ ships inert when no treasury wallet or rate is configured. Read its honesty contract — the
+ purchase response surfaces a `fee` block.
+- `api/_lib/royalty.js` — `billSkillRoyalty` (records a `royalty_ledger` debit after a paid
+ skill returns) and `settleRoyalties` (the settle-royalties cron; redeems EIP-7710
+ delegations, marks ledger rows settled/failed). EVM USDC, viem.
+- `api/_lib/payout.js` — `resolvePayoutAddress(agentId, chain)`; `api/billing/payout-wallets/`,
+ `withdrawals/`. `api/_lib/vanity-bounty-payout.js` — an existing payout pattern.
+- `contracts/skill-license/` — an Anchor (Solana) program (`src/`, `Anchor.toml`,
+ `README.md`, `DEPLOYMENT.md`). `api/_lib/skill-license-onchain.js` — the client that reads/
+ writes the on-chain license. `api/creators/[id].js`, `api/creators/skill-analytics.js`.
+- **The dep `@0xsplits/splits-sdk` is in `package.json` but grep shows NO import** — payment
+ splits among multiple collaborators are not yet wired. That's the headline gap.
+- **The gap:** fee + royalty + payout each work in isolation; multi-party **splits** don't
+ exist; the on-chain skill license isn't wired into the purchase/enforcement path end-to-end;
+ creators lack a single "what I earned, what split where, what I can withdraw" surface.
+
+## Your mission
+
+### 1. Payment splits — wire `@0xsplits/splits-sdk` for multi-collaborator skills
+Build `api/_lib/splits.js` so a skill or asset with multiple contributors pays each their exact
+share atomically. Use `@0xsplits/splits-sdk` to create/resolve an immutable (or mutable-by-
+owner) split contract per multi-party listing, and route the creator's net (after platform fee)
+into the split so 0xSplits handles the on-chain distribution — **trustless, no custody**. A
+single-creator listing pays the creator directly (no split overhead). The split allocation is
+set by the creators at listing time and shown to the buyer ("proceeds split: 70/30"). Handle
+the no-split and the N-way cases; validate shares sum to 100%.
+
+### 2. Make platform fee + royalty + split one coherent settlement
+Today fee (Solana, in-tx) and royalty (EVM, delegated) are separate. Define the canonical
+money flow for a marketplace purchase: buyer pays `price` → platform fee out → creator net →
+(if multi-party) into the 0xSplits contract → recorded in `royalty_ledger` / D2's
+`usage_events`. Every hop is on-chain or ledgered; the purchase response surfaces the full
+breakdown (price, fee, creator net, split recipients) — no hidden cut (CLAUDE.md Rule 1 & 9).
+Reuse `marketplace-platform-fee.js`'s honesty contract; don't fork a second fee module.
+
+### 3. Wire the on-chain skill license end-to-end
+Connect `contracts/skill-license/` + `api/_lib/skill-license-onchain.js` into the purchase
+path: a purchase mints/records an on-chain license proving the buyer's right to call the skill,
+and the skill executor **verifies the on-chain license** (or a signed proof of it) before
+running — so entitlement is enforced trustlessly, not just by a database row. Follow
+`DEPLOYMENT.md` for the deployed program ID / env. Where the program isn't deployed in an
+environment, the path degrades to the ledger check and never fakes an on-chain license.
+
+### 4. Creator payouts — a real withdraw flow
+Make `api/billing/withdrawals/` + `payout.js` a complete withdraw experience: a creator sees
+their settled balance (from the royalty ledger + split distributions), picks a payout wallet
+(`payout-wallets/`), and withdraws real USDC on a real chain. Idempotent (no double-payout on
+retry — 00b reliability bar), with a clear pending → settled → failed status and a tx link.
+Design the empty state ("no earnings to withdraw yet") and the in-flight/failed states.
+
+### 5. A creator economics dashboard
+Extend `api/creators/[id].js` + `skill-analytics.js` and ship a `/creators` (or
+`/dashboard/earnings`) surface: per-skill revenue, the fee taken, royalties earned, split
+recipients and their shares, on-chain license count, and the withdraw action. This is where a
+creator decides three.ws is worth building on. All five states; tie into D2's invoices so a
+creator's earnings reconcile against the same ledger buyers are billed from.
+
+### 6. Test the economics
+Cover the money math: fee + creator net = price (buyer never over-charged); N-way split shares
+sum to 100% and each recipient's atomics are exact; royalty ledger debits and settles
+idempotently; payout doesn't double-pay on retry; on-chain license verification gates execution.
+Fixtures use `$THREE` (CA `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`) or clearly-synthetic
+placeholders — **never** a real non-`$THREE` mint or wallet.
+
+## Definition of done
+
+Clears 00b-the-bar.md's monetization bar ("marketplace fees actually charge, actually settle,
+actually reconcile") and the trust bar (trustless where possible, no funds lost, idempotent,
+honest breakdown). Inherits the global definition of done in `00-README-orchestration.md`.
+Specifically: multi-party splits pay each collaborator their exact share via 0xSplits;
+fee+royalty+split form one transparent settlement; the on-chain skill license is minted on
+purchase and verified before execution; creators can withdraw real USDC idempotently; a creator
+dashboard reconciles to D2's ledger; `npm test` green; a full purchase→split→withdraw verified
+end-to-end.
+
+## Operating rules (override defaults)
+
+No mocks/fake data/placeholders/TODOs/stubs. **`$THREE` is the ONLY coin** — never name,
+hardcode, or recommend any other token; fixtures use `$THREE` or synthetic placeholders only
+(runtime user-launch mints are the sole mechanical exception per CLAUDE.md). Design tokens only.
+Stage explicit paths only (never `git add -A`). Own the marketplace-economics lane
+(`royalty.js`, `payout.js`, `marketplace-platform-fee.js`, the splits lib, `contracts/
+skill-license/*`, `skill-license-onchain.js`, `api/creators/*`); consume D1's tier helper and
+D2's ledger — don't rewrite the fee or settlement modules.
+
+## When finished
+
+Self-review (CLAUDE.md's five checks). Ship one improvement (e.g. a "proceeds split"
+visualization on the listing, or a tx-link receipt on every payout). Append a
+`data/changelog.json` entry (holder-readable, tag `feature`) since creator economics are
+user-visible. Then delete this prompt file
+(`prompts/production-campaign/D-monetization/D4-marketplace-economics.md`) and report what you
+shipped + any seam (the split-contract resolution and the on-chain license verification
+contract the skill executor depends on).
diff --git a/prompts/market/E-ecosystem/00-README.md b/prompts/market/E-ecosystem/00-README.md
new file mode 100644
index 000000000..eb528c029
--- /dev/null
+++ b/prompts/market/E-ecosystem/00-README.md
@@ -0,0 +1,41 @@
+# Track E — Developer Ecosystem & SDKs
+
+**Goal: others build on us.** A platform is worth $1B when third parties depend on it.
+This track turns three.ws's published SDKs, MCP servers, docs, and examples into a surface
+an *outside* developer can take from zero to a working integration in **under 10 minutes** —
+without reading our source, without a support thread, without a single broken link. That is
+the network-effects pillar of the $1B thesis (`00-README-orchestration.md` §4): the product
+others build on is the one that compounds.
+
+Read `CLAUDE.md`, `STRUCTURE.md`, and `00b-the-bar.md` (the **Ecosystem bars**, §6) before
+picking up any prompt here. STRUCTURE.md is the map of every SDK/MCP package and is the
+source of truth for which package name maps to which directory.
+
+## The 4 prompts
+
+| # | File | Mission | Run order |
+|---|---|---|---|
+| **E1** | [`E1-sdk-production-polish.md`](E1-sdk-production-polish.md) | Bring the 5 published SDKs (`avatar-sdk`, `walk-sdk`, `page-agent-sdk`, `tour-sdk`, `agent-payments-sdk`) to production DX: copy-paste README quickstart, typed surfaces, a runnable example, semver + per-package `CHANGELOG.md`, and a CI smoke test. | Anytime (foundation for E3/E4) |
+| **E2** | [`E2-mcp-servers-production.md`](E2-mcp-servers-production.md) | Bring every MCP server (`mcp-server`, `mcp-bridge`, and the 6 `packages/*` MCP servers) to production: enforce `audit:mcp` / `smoke:mcp` / `test:mcp` in CI, document every tool with example calls, validate all `server*.json` manifests. | Anytime (parallel to E1) |
+| **E3** | [`E3-docs-api-reference.md`](E3-docs-api-reference.md) | Complete the docs site + API reference: every public endpoint and SDK surface documented, quickstarts that actually run, a live status link, real `llms.txt` / `llms-full.txt` (today both are empty placeholders), working search. | After E1 + E2 land (consumes their surfaces); can start early on layout/search |
+| **E4** | [`E4-examples-templates-starters.md`](E4-examples-templates-starters.md) | A copy-paste library of runnable examples, embeds, and starter templates: `examples/*`, `coach-leo`, `multiplayer`, framework starters (React/Next/vanilla — none exist yet), and the `<agent-3d>` / `<page-agent>` / `<agent-presence>` web components. | After E1 (links the SDKs); parallel-safe with E3 |
+
+**Recommended order:** E1 ∥ E2 first (independent, each owns its package dirs), then E3 and E4
+in parallel (both consume E1/E2 outputs but own disjoint trees). None block the others hard —
+the table's "run order" is for maximum link-integrity, not a strict gate.
+
+## File-ownership map (disjoint — parallel-safe)
+
+| Prompt | Owns (edit freely) | Must not touch |
+|---|---|---|
+| **E1** | `avatar-sdk/`, `walk-sdk/`, `page-agent-sdk/`, `tour-sdk/`, `agent-payments-sdk/` (READMEs, `types/`, `examples/`, `package.json`, new `CHANGELOG.md`), `scripts/publish-packages.mjs` (read-only ref) | `packages/*-mcp/`, `mcp-server/`, `mcp-bridge/`, `docs/`, `examples/` (top-level) |
+| **E2** | `mcp-server/`, `mcp-bridge/`, `packages/avatar-agent-mcp/`, `packages/pumpfun-mcp/`, `packages/ibm-watsonx-mcp/`, `packages/ibm-x402-mcp/`, `packages/three-token-mcp/`, `packages/threews-avatar-mcp/`, root `server*.json`, `scripts/audit-mcp-manifests.mjs` / `smoke-mcp-remotes.mjs` / `test-mcp-all.mjs` | SDK dirs, `docs/`, `examples/` |
+| **E3** | `docs/` (`api-reference.md`, `index.html`, `quick-start.md`, `llms.txt`, `llms-full.txt`, `api/`, search assets) | SDK source, MCP source, `examples/` |
+| **E4** | `examples/`, `examples/coach-leo/`, `multiplayer/`, new framework-starter dirs under `examples/`, web-component embed pages | SDK/MCP `src/`, `docs/` |
+
+**Shared, append-only (any prompt):** `.github/workflows/ci.yml` (E1 + E2 both add jobs —
+add a *new named job*, never rewrite existing ones), `data/changelog.json` (append one entry,
+never reformat), `package.json` root `scripts` (add, never remove). Coordinate via distinct
+job/script names. Stage explicit paths only — never `git add -A`.
+
+When this directory contains only this `00-README.md`, Track E is done.
diff --git a/prompts/market/E-ecosystem/E1-sdk-production-polish.md b/prompts/market/E-ecosystem/E1-sdk-production-polish.md
new file mode 100644
index 000000000..da8d4b239
--- /dev/null
+++ b/prompts/market/E-ecosystem/E1-sdk-production-polish.md
@@ -0,0 +1,101 @@
+# E1 — SDK Production Polish
+
+You are a senior engineer + product thinker building **three.ws**. Read `CLAUDE.md`,
+`STRUCTURE.md`, and `prompts/production-campaign/00b-the-bar.md` first. **Prerequisites:** none.
+
+## Why this matters for $1B
+The five published SDKs are the front door for every external developer who builds *on*
+three.ws instead of just visiting it — the network-effects pillar (`00-README-orchestration.md`
+§4). A dev who installs `@three-ws/avatar`, copies the README, and has a rendered agent in
+their app inside ten minutes becomes a distribution channel we didn't pay for. A dev who hits
+an untyped surface, a stale README, or an example that throws on line one churns and tells
+their team we're not serious. Production DX on these five packages is the cheapest growth we
+own.
+
+## Current state (read before you write)
+Inspect each SDK dir — `STRUCTURE.md` §npm-workspaces maps the names:
+- `avatar-sdk/` → `@three-ws/avatar` v0.2.0 — `<agent-3d>` web component + React subpath; has
+ `README.md`, `types/index.d.ts`, `build.mjs`. **No CHANGELOG, no test/example npm scripts.**
+- `walk-sdk/` → `@three-ws/walk` v0.1.0 — corner companion + playground. Has README + types.
+ **No CHANGELOG.**
+- `page-agent-sdk/` → `@three-ws/page-agent` v0.1.0 — `<page-agent>` page narrator. Best-off
+ today: has `test/`, `examples/` (index/headless/react/custom-avatar), `PUBLISHING.md`,
+ `CONTRIBUTING.md`. **No CHANGELOG.** Use it as the reference bar for the others.
+- `tour-sdk/` → `@three-ws/tour` v0.1.0 — has `test/` (vitest), `examples/curriculum.example.json`,
+ `bin/`, `curriculum.schema.json`. **No copy-paste README quickstart, no CHANGELOG.**
+- `agent-payments-sdk/` → `@three-ws/agent-payments` v3.2.0 — TS, has `docs/` (api/events/pdas/x402),
+ `typecheck`, jest `test`. **No CHANGELOG; README quickstart not verified runnable.**
+
+The gap is uniform: there is **no `CHANGELOG.md` in any of the five**, README quickstarts are
+not all copy-paste-runnable, typed surfaces are inconsistent, and none has a CI smoke test that
+proves the published entrypoint imports. `scripts/publish-packages.mjs` exists (read it to learn
+the publish flow and version-bump expectations — do not change publish behavior).
+
+## Your mission
+### 1. Copy-paste quickstart in every README (the 10-minute test)
+For each of the five, the README's first scrollful must take a stranger from `npm i` to a
+working result with **one block they can paste verbatim**. Real install, real import path
+(verify against the `exports` map in each `package.json`), real minimal usage that renders/runs.
+For `avatar-sdk` show both the `<agent-3d>` web-component path and the React subpath. For
+`page-agent-sdk` the `<page-agent>` drop-in. No pseudo-code, no `// ...your code here`. Every
+endpoint or key the example needs is named and sourced from env (never inline a secret).
+
+### 2. Typed, documented public surface
+Audit each package's `types/` (or generated `.d.ts` for `agent-payments-sdk`) against what the
+README and `exports` actually expose. Every public export typed; every option object documented
+with TSDoc on the type. For `agent-payments-sdk` keep `npm run typecheck` green. No `any` on a
+public boundary that can be tightened. Don't rewrite implementations — type and document the
+surface that already ships.
+
+### 3. One runnable example per SDK
+Each SDK gets at least one example a dev can actually run (extend `page-agent-sdk/examples/` and
+`tour-sdk/examples/` as the pattern). `avatar-sdk` and `walk-sdk` have none — add an
+`examples/index.html` (or `.jsx`) that imports the built entrypoint and produces a visible
+result against **real** three.ws endpoints. Wire an `npm run example` (or documented open
+instruction) so it's discoverable. Examples use real APIs and real keys via env — no mocks.
+
+### 4. Semver + per-package CHANGELOG.md
+Add a `CHANGELOG.md` (Keep-a-Changelog format) to each of the five, seeded from git history of
+that dir and the current published version. Confirm each `version` in `package.json` follows
+semver and matches what's on npm (or the next intended bump). Document the version + compat
+matrix (peer `three` / `react` ranges already declared) in the README.
+
+### 5. CI smoke test that proves the entrypoint imports
+Add a `smoke` (or `test`) npm script to any SDK lacking one that, at minimum, imports the built
+entrypoint and asserts the documented public exports exist (web-component registration,
+factory fn, React export). Then add a **new named job** to `.github/workflows/ci.yml`
+(e.g. `sdk-smoke`) that builds and smoke-tests all five on PRs. Add a new named job — do not
+rewrite existing jobs (E2 also touches this file; coordinate by job name).
+
+### 6. Tighten the seam to docs/examples
+The published surface you document here is consumed by E3 (docs) and E4 (examples). Make import
+paths, export names, and quickstart copy **identical** to what those tracks will reference —
+note any package whose README quickstart you couldn't verify runnable so E4 can build a real
+example against it.
+
+## Definition of done
+Clears `00b-the-bar.md` §6 (Ecosystem): an outside dev goes zero→working integration in 10
+minutes from each README alone; every SDK has a copy-paste quickstart, typed public surface, a
+runnable example, semver + CHANGELOG, and a CI smoke test that passes and is enforced. Inherits
+the **global definition of done** in `00-README-orchestration.md` (no mocks, `$THREE`-only,
+explicit-path staging, existing tests pass, self-reviewed diff). Verify each quickstart by
+actually running it; state in your report which package's quickstart you ran and the result.
+
+## Operating rules (override defaults)
+No mocks/fake data/placeholders/TODOs/stubs. `$THREE` is the only coin — if any SDK README,
+example, or fixture references another token, remove it. Stage explicit paths only (never
+`git add -A`). Own the five SDK dirs (`avatar-sdk/`, `walk-sdk/`, `page-agent-sdk/`,
+`tour-sdk/`, `agent-payments-sdk/`) and a new CI job; **extend the existing packages, don't
+rewrite them** — type and document the shipping surface, don't redesign APIs. Keep examples
+real (real three.ws endpoints, real keys via env). Do not change `scripts/publish-packages.mjs`
+behavior; read it only to align versions/changelogs. Don't touch MCP dirs, `docs/`, or
+top-level `examples/` (E2/E3/E4 own those).
+
+## When finished
+Run CLAUDE.md's five self-review checks (lazy / user / integration / edge-case / pride). Ship
+one improvement beyond the checklist (e.g. a compat matrix, a `npm create`-able starter hook, an
+OG-able example screenshot). Append a `data/changelog.json` entry (tag: `sdk`) — holder-readable,
+e.g. "Production-ready SDK quickstarts: install to working integration in under 10 minutes."
+Run `npm run build:pages` to validate it. Then delete this prompt file
+(`prompts/production-campaign/E-ecosystem/E1-sdk-production-polish.md`) and report what you
+shipped, which quickstart you ran to verify the 10-minute claim, and any seam E3/E4 need.
diff --git a/prompts/market/F-infra/00-README.md b/prompts/market/F-infra/00-README.md
new file mode 100644
index 000000000..03119d5c8
--- /dev/null
+++ b/prompts/market/F-infra/00-README.md
@@ -0,0 +1,25 @@
+# Track F — Scale & Infrastructure
+
+**Goal: it holds up under success.** Activation, monetization, and ecosystem work (Tracks B–E) only matter if the platform doesn't fold the day the traffic arrives. This track hardens the three layers that fail silently and catastrophically at scale: the **data layer** (Neon Postgres, Upstash Redis, R2/CDN), the **workers** (oracle, agent-sniper, the Forge GPU generation chain + QStash), and the **deploy path** (CI/CD gates, the `api/*.js` bundle footgun, preview deploys, rollback). When this track is done, a viral spike is a non-event: indexed reads stay under budget, the Redis quota stays bounded, no worker dies on a bad signal or loses a job, the "free engines all busy" state queues instead of dead-ends, and no known production footgun can ship twice.
+
+This is **hardening, not greenfield.** The data clients, migration runner, limiter set, QStash adapter, model workers, and most CI scripts already exist (`api/_lib/db.js`, `apply-migrations.mjs`, `rate-limit.js`, `qstash.js`, `workers/*`, `scripts/audit-*`). These prompts make them atomic, bounded, observable, and gated — they do not rewrite them.
+
+## Prompts
+
+| # | File | Mission | Run order |
+|---|------|---------|-----------|
+| **F1** | `F1-data-layer.md` | Atomic + reversible Neon migrations (`db:migrate` + `--verify`), hot-table indexes & a written query-perf budget, serverless connection-pooling correctness, Redis caching/rate-limit hardening (singleton, critical-bucket fail-closed), R2/CDN + CORS as code (`set-r2-cors.mjs`, `api/cdn-object.js`). | **First** — F2 & F3 build on its DB/Redis/QStash hardening and want its `--verify` + guard in CI. |
+| **F2** | `F2-workers-reliability.md` | Crash-safe oracle & agent-sniper (drain, heartbeat, idempotent money paths), QStash retries/backoff/**dead-letter**, model-* + post-process worker health & concurrency budgets, and turning Forge's "free engines all busy" into a durable **queue + ETA + notify-me**. | After F1 (shares infra). Can overlap. |
+| **F3** | `F3-cicd-deploy-safety.md` | Promote unenforced audits (`test:gate`, `audit:pages/handlers/mcp/deploy`, `check:dist`, lighthouse) into real CI merge gates, lock the `api/*.js` bundle-overwrite trap, preview deploys + `audit:deploy` per PR, and a one-command rollback runbook for web + workers + data. | Last — gates the work F1 & F2 land; wants their checks wired in. |
+
+Run **F1 → F2 → F3**; F2 and F3 can begin once F1's shared-infra changes are understood. Each prompt deletes itself when complete; when only this `00-README.md` remains, Track F is done.
+
+## File-ownership map
+
+Concurrent agents share this worktree — **stage explicit paths only, never `git add -A`.** Each prompt owns a lane:
+
+- **F1 — data layer:** `scripts/apply-migrations.mjs`, new forward migrations in `api/_lib/migrations/`, `api/_lib/{db,redis,cache,rate-limit,r2}.js`, `api/cdn-object.js`, `scripts/set-r2-cors.mjs`, `cors.json`, `scripts/migrate-redis.mjs`, query-budget + pooling docs in `docs/ops/`.
+- **F2 — workers & Forge pipeline:** `workers/*` (oracle, agent-sniper, model-*, remesh/texture/segment/rembg/stylize/unirig, avatar-pipeline-controller), `workers/deploy/`, `scripts/deploy-sniper.mjs`, `api/_lib/qstash.js` + QStash receiver endpoints, `api/forge.js` + `api/_lib/forge-tiers.js` backpressure, `src/forge.js` queue UI.
+- **F3 — CI/CD & deploy safety:** `.github/workflows/ci.yml`, `scripts/{audit-*,check-*,test-gate,build-vercel,check-api-not-bundled}.mjs`, `vercel.json` deploy config, `.lighthouserc.json` wiring, `docs/deployment.md`, `docs/ops/` runbooks.
+
+Shared, append-only files (`data/changelog.json`, `data/pages.json`) are never reformatted — only appended. The two repo traps apply to every prompt here: `npx vercel build` overwrites `api/*.js` with esbuild bundles (check `head -1` for `__defProp`/`createRequire` before committing an `api/` diff; recover with `git restore -- api/ public/`), and **never** `git pull`/`fetch`/`merge` from the `threeD` mirror. `$THREE` is the only coin.
diff --git a/prompts/market/F-infra/F1-data-layer.md b/prompts/market/F-infra/F1-data-layer.md
new file mode 100644
index 000000000..3d7679164
--- /dev/null
+++ b/prompts/market/F-infra/F1-data-layer.md
@@ -0,0 +1,43 @@
+# F1 — Production Data Layer (Postgres · Redis · R2/CDN)
+
+You are a senior engineer + product thinker building **three.ws**. Read `CLAUDE.md`, `STRUCTURE.md`, and `prompts/production-campaign/00b-the-bar.md` first. **Prerequisites:** none.
+
+## Why this matters for $1B
+The data layer is where trust lives. Neon holds every payment intent, mint, and custodial balance; Upstash Redis is the only thing standing between a viral spike and an unbounded GPU/LLM bill (the June 2026 500k/mo Upstash blowout and the cost-limiter fail-closed posture both already live in this repo); R2 + the first-party CDN serve every GLB and thumbnail. At $1B scale a single missing index turns a 30ms read into a 3s table scan, an unbounded Redis fan-out drains the quota and 503s the whole site, and a botched migration with no rollback path corrupts the ledger. This task makes the data layer hold under success — fast, bounded, and recoverable.
+
+## Current state (read before you write)
+- **Migrations:** `scripts/apply-migrations.mjs` (`npm run db:migrate` → `--apply`) is already safe-by-default: dry-run unless `--apply`, tracks `schema_migrations` (filename + sha256 + applied_at), and **refuses on hash drift**. 190+ `.sql` files live in `api/_lib/migrations/`. It runs each file via the websocket `Pool` (multi-statement), records the hash, and is idempotent. Gap: no per-migration transaction wrapping, no documented rollback companion, no index/perf review of recent migrations, no CI guard that pending migrations parse.
+- **Postgres client:** `api/_lib/db.js` — lazy `neon()` HTTP client with a composable-fragment Proxy + `sqlValues()` bulk-insert helper and NUL stripping. HTTP driver, no long-lived pool on the hot path.
+- **Redis:** `api/_lib/redis.js` — single shared `getRedis()` singleton (returns `null` when unconfigured); `api/_lib/cache.js`; `api/_lib/rate-limit.js` — a large, resilient limiter set (critical buckets fail **closed** in prod, cheap read buckets are `local:` per-instance to spare quota). `scripts/migrate-redis.mjs` exists. `docs/ops/redis.md` documents the quota story.
+- **R2/CDN:** `api/cdn-object.js` (`/cdn/<key>` → S3 stream, `s-maxage` CDN cache, key validation), `scripts/set-r2-cors.mjs` (idempotent `PutBucketCors`, accepts `S3_*` or `R2_*` env, wildcard preview origins), `cors.json`, `api/_lib/r2.js`.
+
+## Your mission
+### 1. Make migrations transactional + reversible without rewriting the runner
+Wrap each migration apply in `scripts/apply-migrations.mjs` in a single Postgres transaction (`BEGIN`/`COMMIT`, `ROLLBACK` on error) so a multi-statement file that fails halfway leaves the schema clean instead of half-applied — only record the `schema_migrations` row inside the committed transaction. Add a `--verify` mode that parses + EXPLAINs pending migrations against the live DB **in a rolled-back transaction** (no writes) so CI and operators can confirm a migration is sound before `--apply`. Document the rollback convention: every destructive migration (`drop`, `alter … drop column`, type narrowing) ships with a paired `*.down.sql` or a documented roll-forward, and the runner surfaces which pending files are destructive. Do not break the existing drift-refusal or dry-run-default behavior.
+
+### 2. Index + query-budget audit of the hot tables
+Identify the highest-traffic read paths (payments/`payment_intents`, `pump_trades`, `usage_events`, `agents`/`avatars` lists, `three_holder_snapshot`, oracle/sniper tables). For each, confirm the columns in every `WHERE`/`ORDER BY`/`JOIN` are indexed; add the missing indexes as a **new** forward migration in `api/_lib/migrations/` (use `CREATE INDEX CONCURRENTLY` where the table is large and live — note that `CONCURRENTLY` cannot run inside a transaction, so gate it so step 1's wrapper skips wrapping those files). Establish a written **query performance budget** in `docs/ops/` (e.g. p95 < 50ms for indexed reads, no unbounded `SELECT *` on growth tables, every list endpoint paginated) and check current offenders against it.
+
+### 3. Connection pooling correctness for serverless
+Audit how `api/_lib/db.js` is used under Vercel fan-out: the Neon HTTP driver is right for short serverless calls, but any long-lived/batch path (cron, migrations, workers) must use the websocket `Pool` and **close it**. Confirm no endpoint leaks a `Pool`, and that the migration runner's `pool.end()` in `finally` survives the new transaction logic. Document when to reach for HTTP `sql` vs pooled `Pool` in `docs/ops/`.
+
+### 4. Redis caching + rate-limit hardening
+Audit `api/_lib/cache.js` and `getRedis()` callers: every cache read must have a TTL, a documented invalidation trigger, and a graceful path when `getRedis()` returns `null` (degrade, never throw). Confirm no module constructs its own `new Redis()` (the singleton exists precisely to stop the quota blowout — grep for it). Spot-check `api/_lib/rate-limit.js`: every new money/GPU/LLM-spend bucket must be `critical: true` (fail closed in prod without Redis), every high-frequency side-effect-free read should be `local:`. Add a CI/audit guard that flags a `new Redis(` outside the singleton and a critical-looking bucket missing `critical`.
+
+### 5. R2/CDN + CORS as code
+Verify `scripts/set-r2-cors.mjs` is the single source of truth for bucket CORS and that `cors.json` matches the live policy; wire a documented "apply CORS" step into the deploy/ops runbook (`docs/ops/` or `docs/deployment.md`) so a new R2 token or preview origin never silently breaks uploads/previews. Confirm `api/cdn-object.js` sets correct `s-maxage`/`Cache-Control` and `Content-Type` for GLB/USDZ/poster types, validates keys (no traversal), and streams (never buffers) large objects. Add cache-header coverage to its test if absent.
+
+### 6. Verify it for real
+Run `npm run db:migrate` (dry-run) and the new `--verify` against a real DATABASE_URL if available (`.env.local` / `vercel env pull`); if creds are absent locally, say so explicitly and prove the logic with tests. Run `npm test` for the data-layer suites. Exercise a `/cdn/<key>` fetch and confirm CORS headers in the network tab.
+
+## Definition of done
+Inherits the **global definition of done** in `00-README-orchestration.md`. Plus, mapped to `00b-the-bar.md`:
+- **Reliability bar:** migrations are atomic + reversible; a half-applied file is impossible; drift refusal intact. No Redis-absent path throws — cost buckets fail closed, read buckets degrade. R2/CORS is reproducible from code, not dashboard memory.
+- **Performance bar:** every hot read path is index-backed and inside the documented query budget; no unbounded scans on growth tables; the CDN absorbs repeat GLB reads.
+- New logic has tests (migration transaction/verify, cache TTL/degrade, CORS headers); `npm test` green. Every claim verified against a real DB or explicitly flagged as un-runnable locally with the reason.
+
+## Operating rules (override defaults)
+No mocks/fake data/placeholders/TODOs/stubs. `$THREE` is the only coin. Design tokens only where UI is touched (this track is mostly infra). Stage explicit paths only (never `git add -A`). Watch the `api/*.js` bundle-overwrite trap (check `head -1` of any changed `api/` file for `__defProp`/`createRequire` before committing). Never pull/fetch/merge from the `threeD` mirror. Own the **data layer** (migrations runner, `api/_lib/db.js`/`redis.js`/`cache.js`/`rate-limit.js`/`r2.js`, `api/cdn-object.js`, R2/CORS scripts, new index migrations, `docs/ops/`) — extend existing infra, do not rewrite it. New migrations are forward-only and append to `api/_lib/migrations/`.
+
+## When finished
+Self-review (CLAUDE.md's five checks). Ship one improvement (e.g. a `db:migrate --verify` CI step, or an EXPLAIN-driven index you found). Append a `data/changelog.json` entry if user-visible (tag: `infra`). Then delete this prompt file (`prompts/production-campaign/F-infra/F1-data-layer.md`) and report what you shipped + any seam for the next agent (F2 workers depend on the same DB/Redis/QStash infra; F3 will want your `--verify` step in CI).
diff --git a/prompts/market/F-infra/F2-workers-reliability.md b/prompts/market/F-infra/F2-workers-reliability.md
new file mode 100644
index 000000000..4002ea1ff
--- /dev/null
+++ b/prompts/market/F-infra/F2-workers-reliability.md
@@ -0,0 +1,40 @@
+# F2 — Bulletproof Workers & the Forge Pipeline
+
+You are a senior engineer + product thinker building **three.ws**. Read `CLAUDE.md`, `STRUCTURE.md`, and `prompts/production-campaign/00b-the-bar.md` first. **Prerequisites:** F1 (shares the same DB/Redis/QStash infra) is helpful but not blocking.
+
+## Why this matters for $1B
+The workers are where the platform meets real money and real GPUs. `workers/oracle` and `workers/agent-sniper` act on live signals from custodial wallets — a crash mid-trade, a missed heartbeat, or a runaway loop is lost or double-spent funds. The `model-*` generation workers (TRELLIS, Hunyuan3D, TripoSG, TripoSR, text2motion) plus the post-processing chain (remesh, texture, segment, rembg, stylize, unirig) are the Forge product — the first-run "wow." Today that wow already degrades to a designed *"free engines all busy"* / *"provider busy, try again"* state (see `api/forge.js`), which is honest but a dead-ish end. A $1B platform turns backpressure into a queue with a real ETA and a notify-me, never a spinning void or a lost job. This task makes every worker crash-safe, observable, concurrency-bounded, and retry/dead-letter-backed.
+
+## Current state (read before you write)
+- **QStash adapter:** `api/_lib/qstash.js` — `qstashEnabled()`, `publishJob({ url, body, delaySeconds, retries=3, deduplicationId })`, `verifyQstashSignature()` (current + next signing key rotation). Used for work exceeding Vercel's exec cap. Gap: no dead-letter capture, no per-job-type retry/backoff policy, thin caller coverage.
+- **Long-lived workers (NOT Vercel):** `workers/oracle/` (index.js + score/agent/settle self-scheduling loops, SIGINT/SIGTERM drain, `unhandledRejection` logged; `ORACLE_MODE=simulate|live`, `ORACLE_GLOBAL_KILL`) and `workers/agent-sniper/` (index.js, `heartbeat.js`, `error-tracker.js`, `config.js`, simulate-by-default). Deployed to Cloud Run via `scripts/deploy-sniper.mjs` (minScale=maxScale=1, verifies a fresh heartbeat post-deploy) and `workers/deploy/`.
+- **GPU model workers (Cloud Run, Python):** `workers/model-trellis|model-hunyuan3d|model-triposg|model-triposr|model-text2motion/` and `workers/remesh|texture|segment|rembg|stylize|unirig/`. Each is a FastAPI-ish service: `POST /infer → 202 {task_id, status:"queued"}`, `GET /tasks/:id`, `GET /health → {ok, model, gpu_available}`, honors `MAX_CONCURRENT` (default 1), bearer `API_KEY`, `worker_security.py`. Orchestrated by `workers/avatar-pipeline-controller/`.
+- **Forge backpressure today:** `api/forge.js` already returns designed busy states (`provider_busy`, "free 3D Spaces are all busy or warming up", "rigger is busy", paid-limit → "free engines stay open"). Tier gating in `api/_lib/forge-tiers.js`. The gap is no durable queue + ETA + notify-me when *every* free engine is busy — the job evaporates and the user must hand-retry.
+
+## Your mission
+### 1. Crash-safety + observability on oracle and agent-sniper
+Audit the loops in `workers/oracle/` and `workers/agent-sniper/`: every iteration must be wrapped so a single bad signal/trade can't kill the process or wedge the loop; `unhandledRejection`/`uncaughtException` must log to the existing error tracker (sniper has `error-tracker.js`) **and** the platform's Sentry/Axiom path, never just `console`. Confirm graceful SIGTERM drain finishes the in-flight trade (or marks it abandoned safely) before exit. Verify the heartbeat (`heartbeat.js`) is fresh-checked on deploy and surfaced somewhere readable (status page / `/api` health) so a silently-dead worker is detectable. Confirm `*_MODE=simulate` and the global-kill switch genuinely block all real spend.
+
+### 2. Retries, backoff, and a dead-letter path on QStash
+Extend `api/_lib/qstash.js` callers (and the receiver endpoints) into a real reliability layer: per-job-type retry counts + exponential backoff (QStash supports this via publish options), idempotent handlers keyed on `deduplicationId` so a re-delivered job never double-acts (double-mint, double-charge), and a **dead-letter capture** — when a job exhausts retries, persist it (Neon table or Redis) with its payload + error so it's inspectable and replayable instead of silently dropped. Every receiver verifies the signature (`verifyQstashSignature`) before doing work. Add a tiny operator path to list/replay dead-lettered jobs.
+
+### 3. Health + concurrency budgets across the model-* and post-process workers
+Confirm every GPU worker honors `MAX_CONCURRENT` and rejects (or queues) over-budget `/infer` with a clear status the controller can read — never an OOM/crash. Standardize `GET /health` to report `{ok, model, gpu_available, in_flight, queue_depth}` so the controller and the Forge backpressure logic (mission 4) can route around a saturated engine. Audit `workers/avatar-pipeline-controller/` for: per-stage timeouts, retry on transient 5xx with backoff, and a hard cap so a stuck stage can't pin a job forever. Bearer-auth (`worker_security.py`) and signature checks must be enforced on every worker, not just some.
+
+### 4. Turn "free engines all busy" into a real queue with ETA + notify-me
+This is the product win. When `api/forge.js` hits the all-busy state across every free engine, instead of dead-ending: enqueue the job durably (QStash + a Neon `forge_*` jobs row — reuse `forge_seed_jobs`/`forge_creations`-style tables if they fit), return a real position/ETA to the UI, and offer **notify-me** (resolve via the existing notifications path when the GLB is ready). The existing designed busy copy stays as the immediate state, but it now backs onto a queue that actually completes the job and surfaces it — no lost work, no infinite spinner. Wire the populated/queued/failed states honestly (real status polling, no `setTimeout` fake progress). Holders' raised free-lane ceilings (already in `rate-limit.js` via tiered buckets) must reflect in queue priority/ETA consistently.
+
+### 5. Verify it for real
+Run the worker(s) locally in `simulate` mode where possible and exercise a job end-to-end; for GPU workers (Cloud Run) verify the `/health` contract and concurrency rejection with a local stub of the contract only if no GPU is reachable — say so explicitly. Drive the Forge all-busy path in a browser against `npm run dev`, confirm the queue/ETA/notify-me states render with real polling and zero console errors, and confirm a queued job actually completes and notifies. Run `npm test` (worker + forge suites).
+
+## Definition of done
+Inherits the **global definition of done** in `00-README-orchestration.md`. Plus, mapped to `00b-the-bar.md`:
+- **Reliability bar:** no unhandled rejection/exception kills a worker or reaches a user; every money-moving worker action is idempotent and retry-safe; a failed job dead-letters (inspectable + replayable), never silently drops; `simulate`/global-kill provably block real spend.
+- **Graceful degradation bar:** the Forge "free engines all busy" state offers a real path forward (queue + ETA + notify-me) that completes the job — exactly the failure the bar names by example. Every worker reports health + concurrency so the system routes around saturation.
+- All five Forge states (loading skeleton, empty, error w/ recovery, populated, queued/overflow) designed and reachable; real status polling, no fake progress. `npm test` green; new logic (idempotency, dead-letter, queue) covered.
+
+## Operating rules (override defaults)
+No mocks/fake data/placeholders/TODOs/stubs. `$THREE` is the only coin. Design tokens only where the Forge UI is touched (`public/tokens.css`/`DESIGN-TOKENS.md`). Stage explicit paths only (never `git add -A`). Watch the `api/*.js` bundle-overwrite trap (check `head -1` of any changed `api/` file for `__defProp`/`createRequire`; `api/forge.js` is in scope). Never pull/fetch/merge from the `threeD` mirror. Own the **workers + Forge pipeline reliability** (`workers/*`, `workers/avatar-pipeline-controller/`, `api/_lib/qstash.js`, QStash receiver endpoints, `api/forge.js` + `api/_lib/forge-tiers.js` backpressure, `src/forge.js` queue UI, deploy scripts under `scripts/deploy-sniper.mjs`/`workers/deploy/`) — extend existing infra, do not rewrite it.
+
+## When finished
+Self-review (CLAUDE.md's five checks). Ship one improvement (e.g. a worker health tile on the status page, or replayable dead-letter listing). Append a `data/changelog.json` entry — the Forge queue/notify-me is user-visible (tag: `infra`, or `improvement` for the queue UX). Then delete this prompt file (`prompts/production-campaign/F-infra/F2-workers-reliability.md`) and report what you shipped + any seam for the next agent (F3 will want worker health + the dead-letter check wired into CI/deploy gates; the status page is the natural home for worker health).
diff --git a/prompts/market/F-infra/F3-cicd-deploy-safety.md b/prompts/market/F-infra/F3-cicd-deploy-safety.md
new file mode 100644
index 000000000..3fad60ebe
--- /dev/null
+++ b/prompts/market/F-infra/F3-cicd-deploy-safety.md
@@ -0,0 +1,43 @@
+# F3 — Harden CI/CD & Deploy Safety
+
+You are a senior engineer + product thinker building **three.ws**. Read `CLAUDE.md`, `STRUCTURE.md`, and `prompts/production-campaign/00b-the-bar.md` first. **Prerequisites:** F1 (its `db:migrate --verify` and Redis-singleton guard want a CI home) and F2 (worker health / dead-letter checks want a gate) — coordinate, but F3 can land independently.
+
+## Why this matters for $1B
+CI/CD is the platform's immune system. Real money rides on this code, so every merge to `main` auto-deploys to Vercel — which means a broken build, a leaked secret, a regressed Lighthouse score, or the documented `npx vercel build` footgun (it overwrites `api/*.js` source with esbuild bundles) ships straight to production. This repo has already taken production down: 465 consecutive 500s for 90 minutes on 2026-06-11 from a committed symlink + an unresolvable peer-dep import — exactly what `scripts/audit-deploy-artifacts.mjs` now catches. A $1B platform never has a class of failure it can ship twice: every known footgun becomes a CI gate, every deploy is preview-verified, and there is always a one-command rollback. This task turns the existing checks-that-exist-but-aren't-enforced into real merge gates and a safe deploy path.
+
+## Current state (read before you write)
+- **CI:** `.github/workflows/ci.yml` — four jobs on PR + push to `main`: `lint` (eslint, errors only), `test` (`npx vitest run`), `guards` (`scripts/check-api-not-bundled.mjs`, `npm run check:images`, `npm run build:pages`), `typecheck` (advisory, `continue-on-error: true`). Real but thin — many production guards exist as npm scripts and are **not** wired into CI.
+- **Available-but-unenforced scripts** (in `package.json`): `test:gate` (`scripts/test-gate.mjs`), `audit:pages` (`scripts/audit-page-index.mjs`), `audit:handlers` (`scripts/audit-empty-handlers.mjs`), `audit:mcp` (`scripts/audit-mcp-manifests.mjs`), `audit:deploy` (`scripts/audit-deploy-artifacts.mjs` — symlink + peer-dep + phantom-import preflight), `check:dist` (`scripts/check-dist.mjs` — verifies `dist/agent-3d/*` SDK build + version match), `smoke:onchain`, `smoke:mcp`, `test:mcp`. `.lighthouserc.json` exists (LCP/CLS/INP budgets per `00b-the-bar.md`) but is not run in CI.
+- **The bundle trap:** `scripts/check-api-not-bundled.mjs` already runs in CI and fails if `npx vercel build` clobbered an `api/*.js` source file with an esbuild bundle (`__defProp`/`createRequire` on line 1). Keep and strengthen it; the build orchestrator is `scripts/build-vercel.mjs`.
+- **Deploy:** Vercel via `vercel.json`; `scripts/build-vercel.mjs` (hash-cached, parallel sub-builds). Workers deploy separately (`scripts/deploy-sniper.mjs`, `workers/deploy/`). `docs/deployment.md` + `docs/ops/` document ops.
+
+## Your mission
+### 1. Promote the audits into real merge gates
+Expand `.github/workflows/ci.yml` so the existing-but-unenforced scripts become required checks. Add jobs (or steps in `guards`) for `test:gate`, `audit:pages`, `audit:handlers`, `audit:mcp`, `audit:deploy`, and `check:dist`. Run them in parallel where independent; cache `npm ci` (already `cache: npm`). Each must fail the build on a real regression — no `continue-on-error` on a money/correctness check. Keep `typecheck` advisory until its backlog is burned down (note the path to flip it). Where F1 added a migration `--verify` and a Redis-singleton/critical-bucket guard, wire those in too.
+
+### 2. Make the bundle-overwrite trap un-shippable
+`scripts/check-api-not-bundled.mjs` guards committed `api/*.js`. Strengthen the guard end-to-end: confirm it scans **every** `api/**/*.js` (including nested dirs like `api/_lib`, `api/coin`, `api/club`), catches `__defProp`/`createRequire`/`esbuild` banner signatures, and runs both in CI and (ideally) as a pre-commit-style local check documented in `docs/deployment.md`. Confirm `scripts/build-vercel.mjs` / `vercel.json` never write esbuild output back over source in the committed tree. Document the recovery (`git restore -- api/ public/`) prominently in the deploy runbook so an agent who trips it self-recovers in one command.
+
+### 3. Lighthouse / Core Web Vitals gate
+Wire `.lighthouserc.json` into CI as a real (initially advisory-then-enforced) job against the primary surfaces, holding the `00b-the-bar.md` budgets (LCP < 2.5s, CLS < 0.1, INP < 200ms). Run it against a preview deploy URL (mission 4) or a local `npm run dev`/`vite preview` build. Start advisory if current scores aren't green, but record the baseline and the gap so the next surfaces agent (Track C) can close it; flip to enforced for any surface already in budget.
+
+### 4. Preview deploys + `audit:deploy` artifacts on every PR
+Ensure every PR gets a Vercel **preview deploy** (Vercel's GitHub integration or a workflow that runs `vercel build`/`deploy --prebuilt`) so changes are verified on a real URL before merge, never first-seen in production. Run `audit:deploy` (`scripts/audit-deploy-artifacts.mjs`) as a hard gate — it catches the exact 2026-06-11 class (committed symlinks, unresolvable peer-deps, phantom imports) in seconds. Surface the preview URL + the artifact audit result on the PR. Confirm the smoke checks (`smoke:onchain`, `smoke:mcp`) run against the preview or a safe target, not production money paths.
+
+### 5. A documented, one-command rollback path
+There must be a safe, fast rollback for both halves of the system: Vercel (instant promote of the previous good deployment — document the `vercel rollback`/promote-previous flow and how to find the last-green SHA) and the Cloud Run workers (`scripts/deploy-sniper.mjs --skip-build` redeploys the current image; document redeploying a prior revision). Write this into `docs/deployment.md` / `docs/ops/` as a runbook: how to detect a bad deploy (the heartbeat/health from F2, the 500-rate), how to roll back each surface, and how to confirm recovery. The DB rollback convention from F1 (forward-only + paired down-migrations) is referenced here as the data half of rollback.
+
+### 6. Verify it for real
+Run the full CI suite locally (`npm run lint`, `npx vitest run`, `npm run test:gate`, `npm run audit:pages`, `npm run audit:handlers`, `npm run audit:mcp`, `npm run audit:deploy`, `npm run check:dist`, `npm run build:pages`) and confirm each passes or surface the real failure. Deliberately introduce a fake bundled `api/*.js` and a committed symlink in a scratch branch (then revert) to prove the guards fire. Confirm the workflow YAML is valid and the new jobs are wired as required checks. Never run `npx vercel build` against the working tree without checking `head -1` of changed `api/` files afterward.
+
+## Definition of done
+Inherits the **global definition of done** in `00-README-orchestration.md`. Plus, mapped to `00b-the-bar.md`:
+- **Reliability bar:** every documented production footgun (bundle overwrite, committed symlink, peer-dep/phantom import, empty handler, broken page index, MCP manifest drift, missing SDK dist) is a CI gate that fails the build — the 2026-06-11 class cannot ship again. Every merge is preview-verified; there is a one-command rollback for web + workers + data, written down.
+- **Performance bar:** Lighthouse/CWV budgets are run in CI with a recorded baseline and an enforced floor on in-budget surfaces.
+- CI is green on `main`; the new gates demonstrably fire on the failure they guard (proven, not assumed). `npm test` and all wired audits pass.
+
+## Operating rules (override defaults)
+No mocks/fake data/placeholders/TODOs/stubs. `$THREE` is the only coin. Design tokens only where UI is touched (this track is infra/CI). Stage explicit paths only (never `git add -A`). **Critically watch the `api/*.js` bundle-overwrite trap** — this prompt touches the build; check `head -1` of any changed `api/` file for `__defProp`/`createRequire` and `git restore -- api/ public/` if tripped. Never pull/fetch/merge from the `threeD` mirror. Own **CI/CD + deploy safety** (`.github/workflows/ci.yml`, the `scripts/audit-*`/`check-*`/`test-gate`/`build-vercel` scripts, `vercel.json` deploy config, `.lighthouserc.json` wiring, `docs/deployment.md`, `docs/ops/` runbooks) — extend existing infra, do not rewrite it. Do not commit or push unless the user asks.
+
+## When finished
+Self-review (CLAUDE.md's five checks). Ship one improvement (e.g. the rollback runbook, or a PR comment that posts the preview URL + audit results). Append a `data/changelog.json` entry only if user-visible (CI hardening is usually internal — skip silently if so; the rollback runbook in `docs/` may warrant a `docs`/`infra` entry). Then delete this prompt file (`prompts/production-campaign/F-infra/F3-cicd-deploy-safety.md`) and report what you shipped + which gates now enforce + any seam (e.g. Lighthouse left advisory for Track C, a worker-health check F2 should feed in).
diff --git a/prompts/prod/00-README.md b/prompts/prod/00-README.md
new file mode 100644
index 000000000..7efa85f13
--- /dev/null
+++ b/prompts/prod/00-README.md
@@ -0,0 +1,127 @@
+# Road to $1B — production-readiness program
+
+> Read this first, then `/CLAUDE.md`. Every prompt in this folder assumes both.
+
+This is the **spine** that takes three.ws from "impressive demo" to a platform a
+serious diligence team, a million users, and a $THREE holder base would all trust.
+It is deliberately separate from the feature-expansion prompt libraries elsewhere in
+`prompts/` (`feature-innovation/`, `agent-studio/`, `living-agents/`, …) — those add
+surface area; **this track makes the surface area we already have correct, safe, fast,
+and fundable.**
+
+The only coin is **$THREE** (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). No
+exceptions, anywhere. See `/CLAUDE.md`.
+
+## How to run this
+
+Each numbered file is a **self-contained prompt for a fresh chat**. Open a new
+session, paste the file's contents (or say "do `prompts/road-to-1b/NN-*.md`"), and let
+the agent execute it end to end. One prompt = one focused, shippable unit of work.
+
+Run **in number order within a phase**. Phases are mostly sequential; inside a phase,
+prompts marked `Parallel-safe with:` can run in separate chats at the same time.
+Foundation (Phase 0) and hardening (Phase 1) come before everything — you cannot
+polish or grow on top of stubs and security holes.
+
+Each prompt ends with an **Acceptance** checklist. A prompt is not done until every
+box is checked, `npm test` is green, and any user-visible change has a
+`data/changelog.json` entry (`npm run build:pages` validates it).
+
+## The repo in one breath
+
+Vanilla-JS + Vite monorepo, 20 npm workspaces. ~125 pages (`pages/`), ~810 front-end
+modules (`src/`), ~961 Vercel functions (`api/`), Cloudflare workers (`workers/`),
+Three.js for 3D, Solana + pump.fun + x402 for money, real OpenAI/Anthropic via worker
+proxies. `STRUCTURE.md` maps every surface to its directory — read it before
+exploring. Useful existing gates: `npm run audit:web`, `audit:pages`,
+`audit:handlers`, `audit:empty-handlers`, `check:images`, `test:gate`, `verify:solana`,
+`smoke:onchain`, `audit:deploy`, `lint`, `typecheck`.
+
+## Phase map
+
+| # | Prompt | Phase |
+|---|---|---|
+| 01 | Production-readiness audit & scorecard | 0 — Foundation & truth |
+| 02 | No stubs, mocks, TODOs — hard-rule cleanup | 0 |
+| 03 | Dead paths, broken links & empty handlers | 0 |
+| 04 | $THREE-only compliance sweep | 0 |
+| 05 | Secrets & env hygiene | 1 — Correctness & hardening |
+| 06 | Error handling & resilience | 1 |
+| 07 | Security hardening | 1 |
+| 08 | Rate limiting & abuse prevention | 1 |
+| 09 | Test suite green & CI gate | 1 |
+| 10 | Resilience of external calls | 2 — Reliability at scale |
+| 11 | Observability (logs, metrics, alerts) | 2 |
+| 12 | Frontend performance & Core Web Vitals | 3 — Experience quality |
+| 13 | Accessibility (WCAG 2.2 AA) | 3 |
+| 14 | Responsive & mobile | 3 |
+| 15 | Every state designed + design-system consistency | 3 |
+| 16 | SEO, metadata, Open Graph & structured data | 3 |
+| 17 | Cross-browser & device QA | 3 |
+| 18 | Studio suite completeness (Forge, Avatar, Animation, Scene) | 4 — Surface completeness |
+| 19 | Agent creation & Agent Studio | 4 |
+| 20 | Marketplace, skills & purchase flow | 4 |
+| 21 | Trading & intelligence suite (Oracle, radars, leaderboards) | 4 |
+| 22 | Launch suite (Launch a Coin, Launchpad, Coin Intel, Claim) | 4 |
+| 23 | Worlds, Coin Clash & multiplayer | 4 |
+| 24 | Wallets & payments (x402, agent wallets, USDC, pay-by-name) | 4 |
+| 25 | SDK release-readiness | 5 — Developer platform |
+| 26 | MCP servers & agent interoperability | 5 |
+| 27 | Docs, tutorials & API reference | 5 |
+| 28 | Onboarding, guided tour & activation funnel | 5 |
+| 29 | Conversion funnel & landing optimization | 6 — Growth & business |
+| 30 | Analytics & growth instrumentation | 6 |
+| 31 | Monetization, pricing & $THREE utility | 6 |
+| 32 | Legal, compliance & trust | 6 |
+| 33 | Infrastructure, CI/CD & deploy safety | 6 |
+| 34 | Launch-readiness gate & go-to-market QA | 6 |
+
+## Why "$1B" is the bar, concretely
+
+A $1B platform is not "more features." It is: **nothing is fake** (Phase 0), **nothing
+leaks or breaks under load or attack** (Phases 1–2), **it feels world-class on any
+device** (Phase 3), **every surface a user can reach is finished** (Phase 4),
+**developers can build on it** (Phase 5), and **the funnel from first visit to paying,
+retained user is measured and optimized** (Phase 6). Each phase is a precondition for
+the next being worth anything.
+
+## Prompt template (for adding new ones)
+
+```
+# NN — Title
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** N — <name>
+**Owns:** <paths/surfaces this prompt may change>
+**Depends on:** <numbers or "none"> · **Parallel-safe with:** <numbers or "—">
+
+## Why this matters for $1B
+<2–4 lines tying the work to trust / fundability / growth>
+
+## Mission
+<one crisp sentence>
+
+## Map
+<real repo paths, scripts, surfaces>
+
+## Do this
+1. … (specific, ordered, references real scripts/paths — never generic)
+
+## Must-not
+- …
+
+## Acceptance
+- [ ] … ; `npm test` green; changelog entry if user-visible.
+```
+
+## Global definition of done (applies to every prompt)
+
+- No mocks, fake data, placeholders, TODOs, stubs, or `throw "not implemented"`.
+- Every interactive element has hover/active/focus states; every page has designed
+ loading/empty/error/populated states.
+- Real APIs only; errors handled at network/input boundaries.
+- `npm test` green; `npm run lint` and `npm run typecheck` clean for touched code.
+- `git diff` self-reviewed; every changed line justified.
+- User-visible change → `data/changelog.json` entry (plain language, holder-readable).
+- You would demo it, unprompted, to a room of senior engineers.
diff --git a/prompts/prod/01-production-readiness-audit.md b/prompts/prod/01-production-readiness-audit.md
new file mode 100644
index 000000000..36e51bbf4
--- /dev/null
+++ b/prompts/prod/01-production-readiness-audit.md
@@ -0,0 +1,56 @@
+# 01 — Production-readiness audit & scorecard
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 0 — Foundation & truth
+**Owns:** read-only across the whole repo; output is a single committed scorecard doc (e.g. `docs/road-to-1b/production-readiness-scorecard.md`).
+**Depends on:** none · **Parallel-safe with:** —
+
+## Why this matters for $1B
+You cannot fix what you have not measured. This prompt produces the prioritized,
+evidence-backed backlog that the rest of this track (02–34) executes against. A
+diligence team and a million users both meet the same surfaces; this audit tells
+the truth about which ones are finished and which only look finished.
+
+## Mission
+Produce an honest, prioritized production-readiness scorecard of three.ws with
+file:line evidence and an ordered remediation list mapped to prompts 02–34.
+
+## Map
+- Existing gates (cite by name): `npm run audit:web`, `npm run audit:pages`,
+ `npm run audit:handlers`, `npm run audit:empty-handlers`, `npm run check:images`,
+ `npm run lint`, `npm run typecheck`, `npm test`.
+- Surfaces (from `STRUCTURE.md`): Studios (`character-studio/`, `src/scene-studio/`,
+ Forge/Avatar/Animation), Agents (`api/`, agent profiles), Marketplace/skills,
+ Trading/intel (`workers/oracle/`, radars, leaderboards), Launch
+ (`pages/launches.html`, `api/pump/`), Worlds (`multiplayer/`), Wallets/x402
+ (`api/x402-*`, `api/_lib/agent-wallet.js`), SDKs (`sdk/`, `*-sdk/`, `packages/`),
+ Docs. Page inventory: `data/pages.json`.
+
+## Do this
+1. Run every gate and capture raw output verbatim into the scorecard:
+ `npm run audit:web`, `audit:pages`, `audit:handlers`, `audit:empty-handlers`,
+ `check:images`, `lint`, `typecheck`, `test`. Note pass/fail and counts.
+2. Grep the tree for hard-rule violations and record each as `path:line`:
+ `TODO`/`FIXME`/`HACK`, `throw new Error('not implemented'`, `setTimeout` fake
+ loading/progress, `sampleAgents`/`const sample`/fallback arrays,
+ `mock`/`fake`/`placeholder`, and commented-out code blocks. Scope to shippable
+ paths (`src/`, `api/`, `workers/`, `pages/`, SDK dirs); exclude `node_modules`,
+ `dist`, vendored trees.
+3. Inventory all pages in `data/pages.json`: for each, mark whether it has a real
+ backend, real data, and designed loading/empty/error/populated states.
+4. Score each surface above **Red / Amber / Green** on six axes: completeness,
+ states, error handling, mobile, accessibility, performance. One row per surface.
+5. Emit one prioritized scorecard: severity-ordered, every **Red** item carries an
+ owner-prompt number (02–34) and file:line evidence. End with an ordered
+ remediation list that reads as the execution plan for this track.
+
+## Must-not
+- Do not fix, edit, or refactor anything — this is audit-only.
+- Do not soften, round up, or omit findings to make a surface look greener.
+- Do not invent paths; cite only what you verified exists.
+
+## Acceptance
+- [ ] Scorecard committed under `docs/`; every Red item has an owner-prompt number and file:line evidence.
+- [ ] Output reproducible via the listed scripts; raw gate output captured.
+- [ ] No code changed (`git diff` shows only the new doc); `npm test` still green.
diff --git a/prompts/prod/02-no-stubs-mocks-todos.md b/prompts/prod/02-no-stubs-mocks-todos.md
new file mode 100644
index 000000000..532035d66
--- /dev/null
+++ b/prompts/prod/02-no-stubs-mocks-todos.md
@@ -0,0 +1,51 @@
+# 02 — No stubs, mocks, TODOs — hard-rule cleanup
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 0 — Foundation & truth
+**Owns:** `src/`, `api/`, `workers/`, `pages/`, `scripts/`, SDK dirs (`sdk/`, `*-sdk/`, `packages/`).
+**Depends on:** 01 · **Parallel-safe with:** 04
+
+## Why this matters for $1B
+`/CLAUDE.md` forbids mocks, fake data, placeholders, TODOs, and stubs without
+exception. A single shipped placeholder reads to users and diligence as an
+"unfinished company." This prompt closes that gap by replacing every fake with a
+real implementation, never by hiding it.
+
+## Mission
+Eliminate every mock, fake-data fallback, placeholder, TODO/FIXME, stub function,
+`throw new Error("not implemented")`, fake `setTimeout` loading, and commented-out
+code from shippable paths — replacing each with the real thing.
+
+## Map
+- Source of violations: the scorecard from prompt 01 (file:line list).
+- Empty-handler gate: `npm run audit:empty-handlers` (`scripts/audit-empty-handlers.mjs`).
+- Real backends live in `api/` and `workers/`; real data flows through them — wire
+ to those, never to a local sample array.
+
+## Do this
+1. Take the violation list from prompt 01. For each, implement the real behavior
+ per `/CLAUDE.md` "No errors without solutions" — find the root cause and the
+ correct fix; do not propagate a lazy error.
+2. Replace every sample/fallback array (`sampleAgents`, `const sample…`, demo
+ arrays) with a real fetch to the owning `api/` route, plus a designed empty
+ state for the zero-result case.
+3. Convert fake progress / `setTimeout`-driven loading into real async tied to the
+ actual request lifecycle; show a real loading state (skeleton preferred).
+4. Replace every `throw new Error('not implemented')` and stub function body with a
+ complete implementation; remove `// implement later` / `// TODO` comments only
+ after the work behind them is done.
+5. Delete commented-out code blocks and dead/unused imports in the files you touch.
+6. Run `npm run audit:empty-handlers` and resolve every flagged handler — no no-op
+ bodies left behind.
+7. Grep the touched paths to confirm the banned patterns are gone before reporting.
+
+## Must-not
+- Do not hide a stub behind a feature flag, env guard, or `if (false)`.
+- Do not delete a feature to "remove" its stub — finish the feature.
+- Do not introduce a new mock/fixture to satisfy a now-real call path.
+
+## Acceptance
+- [ ] Grep for the banned patterns returns nothing in shippable code.
+- [ ] `npm run audit:empty-handlers` clean; `npm run lint` and `npm run typecheck` clean for touched files.
+- [ ] `npm test` green; changelog entry only if user-visible behavior changed.
diff --git a/prompts/prod/03-dead-paths-and-broken-links.md b/prompts/prod/03-dead-paths-and-broken-links.md
new file mode 100644
index 000000000..bcc94cd15
--- /dev/null
+++ b/prompts/prod/03-dead-paths-and-broken-links.md
@@ -0,0 +1,50 @@
+# 03 — Dead paths, broken links & empty handlers
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 0 — Foundation & truth
+**Owns:** `pages/`, `src/`, `data/pages.json`, nav/footer/CTA components (incl. `src/dashboard-next/components/topbar.js`).
+**Depends on:** 01 · **Parallel-safe with:** 02, 04
+
+## Why this matters for $1B
+Every dead button and every 404 link is a trust leak. A platform that competes
+with Vercel and Linear has zero unreachable states and zero broken paths — every
+link resolves, every button does something real, every declared state is reachable.
+
+## Mission
+Guarantee every link resolves, every button performs a real action, every declared
+state is reachable, and every page is reachable from navigation.
+
+## Map
+- Gates: `npm run audit:pages` (`scripts/audit-page-index.mjs`),
+ `npm run audit:handlers` and `npm run audit:empty-handlers`
+ (`scripts/audit-empty-handlers.mjs`).
+- Navigation surfaces: topbar `src/dashboard-next/components/topbar.js`, the site
+ footer, in-page CTAs, the guided tour, and the "All pages" directory.
+- Route registry: `data/pages.json` (e.g. the `/launches` entry); page bodies in
+ `pages/`.
+
+## Do this
+1. Run `npm run audit:pages`, `npm run audit:handlers`, and
+ `npm run audit:empty-handlers`; record every flagged page and handler.
+2. Crawl the topbar (`src/dashboard-next/components/topbar.js`), footer, and in-page
+ CTAs for `href`s that 404, point to `#`, or go nowhere. Fix the destination or
+ remove the link with intent — never leave a dead link in place.
+3. Verify every page in `data/pages.json` is linked from navigation and actually
+ renders; flag any orphaned route (declared but unreachable) and wire it in.
+4. Find buttons with no handler or no-op handlers (cross-reference
+ `audit:empty-handlers`); give each a real action or remove the control.
+5. Confirm browser back/forward and deep-links land on the correct state; fix any
+ route that only works when reached via the in-app click path.
+6. Confirm the guided tour and the "All pages" directory reference only real,
+ live routes — no stops on missing or renamed pages.
+
+## Must-not
+- Do not paper over a broken link by suppressing the click — fix the destination or remove the link.
+- Do not add a route to `data/pages.json` that has no rendering page behind it.
+- Do not leave a control visible if it cannot perform its action.
+
+## Acceptance
+- [ ] `audit:pages`, `audit:handlers`, `audit:empty-handlers` all clean.
+- [ ] Manual nav crawl (topbar, footer, CTAs, tour, directory) finds zero dead links or no-op buttons.
+- [ ] Every `data/pages.json` route is reachable and renders; `npm test` green; changelog entry if user-visible.
diff --git a/prompts/prod/04-three-coin-compliance.md b/prompts/prod/04-three-coin-compliance.md
new file mode 100644
index 000000000..23587f1f8
--- /dev/null
+++ b/prompts/prod/04-three-coin-compliance.md
@@ -0,0 +1,54 @@
+# 04 — $THREE-only compliance sweep
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 0 — Foundation & truth
+**Owns:** entire repo — code, comments, tests, fixtures, docs, UI copy, metadata.
+**Depends on:** none · **Parallel-safe with:** 02, 03
+
+## Why this matters for $1B
+Brand and legal integrity: three.ws promotes exactly one coin, **$THREE**
+(`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Per `/CLAUDE.md`, any stray
+token reference is treated like a leaked secret. A platform raising at $1B cannot
+have a competing or partner ticker hiding in source, copy, or a fixture.
+
+## Mission
+Ensure $THREE is the only coin referenced anywhere, with the two allowed
+runtime-data exceptions left intact and verified runtime-only.
+
+## Map
+- $THREE token tooling: `packages/three-token-mcp/`, `api/pump/check-three-balance.js`.
+- Allowed exception 1 — generic launcher: `api/pump/` (e.g. `launch-prep.js`,
+ `launch-agent.js`, the `[action].js` route) accepting an arbitrary user-supplied
+ mint at runtime.
+- Allowed exception 2 — platform launch directories rendering user-launched coins
+ from platform records at runtime: `/launches` (`pages/launches.html`,
+ `data/pages.json`), agent-profile launch history, and `/api/pump/launches`
+ (the `case 'launches'` handler in `api/pump/[action].js`) reading the
+ `pump_agent_mints` table.
+
+## Do this
+1. Grep the whole tree for hardcoded mint addresses (base58 ~32–44 chars), token
+ tickers, and coin names across `src/`, `api/`, `workers/`, `pages/`, `tests/`,
+ `docs/`, and fixtures.
+2. Remove every non-$THREE coin reference in source, copy, tests, fixtures, docs,
+ and metadata — treat each like a leaked secret, not a cosmetic edit.
+3. Verify the two mechanical exceptions still work and stay runtime-data-only: the
+ generic pump.fun launcher takes the mint as user input (no hardcoded mint); the
+ launch-directory feeds (`/launches`, agent-profile history, `/api/pump/launches`
+ over `pump_agent_mints`) render only coins users launched through the platform.
+4. Confirm fixtures and tests use only the $THREE CA above or a clearly-synthetic
+ placeholder (e.g. `THREEsynthetic1111…`) — never a real third-party mint,
+ creator, or holder address.
+5. Add a CI grep guard if feasible (a script under `scripts/` wired so a stray
+ non-$THREE ticker/mint in source fails the build), excluding the two exceptions.
+
+## Must-not
+- Do not remove or break the two legitimate runtime-data exceptions.
+- Do not hardcode, market, or recommend any specific non-$THREE mint anywhere.
+- Do not acknowledge any past, partner, demo, or test launch — $THREE is the only coin.
+
+## Acceptance
+- [ ] Tree grep shows no other coin in source, copy, tests, fixtures, or docs.
+- [ ] Both exceptions verified runtime-only; fixtures use the $THREE CA or a synthetic placeholder.
+- [ ] CI grep guard added (if feasible); `npm test` green; changelog entry if user-visible.
diff --git a/prompts/prod/05-secrets-and-env-hygiene.md b/prompts/prod/05-secrets-and-env-hygiene.md
new file mode 100644
index 000000000..ae1c9e2b6
--- /dev/null
+++ b/prompts/prod/05-secrets-and-env-hygiene.md
@@ -0,0 +1,56 @@
+# 05 — Secrets & env hygiene
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 0 — Foundation
+**Owns:** `.env*`, `vercel.json` (`env`), `api/`, `workers/`, `.gitignore`, anything reading `process.env`.
+**Depends on:** none. Run early — a leaked key is a $1B-killer.
+
+## Why this matters for $1B
+A single leaked private key (Solana parent secret, RPC key, bot token) can drain
+funds and end the company. Diligence teams scan git history for secrets. This must be
+airtight.
+
+## Mission
+Guarantee no secret is committed, every secret is loaded from the environment with a
+clear failure when missing, and the set of required env vars is documented and
+validated at boot.
+
+## Map
+- Required secrets referenced across the codebase include (verify the live set):
+ `THREEWS_SOL_PARENT_SECRET_BASE58`, Solana RPC keys, `TELEGRAM_BOT_TOKEN`,
+ `TELEGRAM_CHANGELOG_CHAT_ID`, OpenAI/Anthropic keys (via worker proxies), x402
+ facilitator config.
+- `vercel.json` has an `env` block. Functions in `api/`, workers in `workers/`.
+
+## Do this
+1. Scan the working tree **and git history** for committed secrets (use
+ `git log -p` filtered, or a tool like gitleaks/trufflehog run locally). Treat any
+ hit as an incident: rotate the key, purge if feasible, and document.
+2. Confirm `.gitignore` excludes `.env`, `.env.*` (except `.env.example`), key files,
+ and any wallet keypair JSON. Add what's missing.
+3. Create/maintain a complete `.env.example` listing **every** env var the app reads,
+ grouped by surface, with a one-line description and whether it's required. Derive
+ the list by grepping `process.env.` across `api/`, `workers/`, `src/`, `scripts/`.
+4. Add a startup/env-validation step (a small `api/_lib/env.js` or similar) that, on
+ cold start, asserts required vars are present and fails loud with a precise message
+ naming the missing var — never a silent undefined that 500s later.
+5. Ensure secrets are read server-side only. Grep `public/` and client `src/` for any
+ secret-looking value or `VITE_`-exposed secret that should be server-only. Move
+ them behind an API route or worker proxy.
+6. Confirm the AI provider keys are only ever used via the worker proxies, never
+ shipped to the client (per `/CLAUDE.md` stack notes).
+7. Document secret rotation steps in `docs/` (where to rotate each, blast radius).
+
+## Must-not
+- Do not print secrets in logs or error messages.
+- Do not commit a real key even to `.env.example` — use obvious placeholders.
+- Do not expose any secret via a `VITE_`/client-bundled var.
+
+## Acceptance
+- [ ] git history + working tree scanned; zero live secrets present (rotations done if found).
+- [ ] `.gitignore` covers all secret/keypair patterns.
+- [ ] `.env.example` is complete and grouped, derived from actual `process.env` usage.
+- [ ] Boot-time env validation fails loud on missing required vars, naming each.
+- [ ] No secret reachable from the client bundle.
+- [ ] Rotation runbook written in `docs/`.
diff --git a/prompts/prod/06-error-handling-and-resilience.md b/prompts/prod/06-error-handling-and-resilience.md
new file mode 100644
index 000000000..3d71eccff
--- /dev/null
+++ b/prompts/prod/06-error-handling-and-resilience.md
@@ -0,0 +1,59 @@
+# 06 — Error handling & resilience
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 1 — Cross-cutting hardening
+**Owns:** `api/` (~960 handlers), `workers/`, `api/_lib/`, client fetch wrappers in `src/`/`public/`.
+**Depends on:** `04` (no fake fallbacks).
+
+## Why this matters for $1B
+At scale, dependencies fail constantly — RPC nodes time out, providers rate-limit,
+pump.fun hiccups. A $1B platform degrades gracefully and self-heals. `/CLAUDE.md`:
+"No errors without solutions. Ship working fallbacks and failsafes. Lazy error
+propagation is not engineering."
+
+## Mission
+Every external call has timeout, retry-with-backoff, circuit-breaking where
+appropriate, and a designed failure path. Every handler returns correct status codes
+and structured errors. No unhandled rejections.
+
+## Map
+- Resilience helper: **cockatiel** is the vetted choice (see existing usage in
+ `api/_lib/`). Reuse it — do not hand-roll retry loops.
+- Real upstreams: Solana RPC (already has "resilient Solana RPC" work — see git log),
+ Pump.fun feed, OpenAI/Anthropic worker proxies, x402 facilitator.
+- Recent hardening precedent: `api/x402-checkout.js` ATA-probe hardening against
+ malformed RPC replies — match that rigor.
+
+## Do this
+1. Inventory every outbound call in `api/` and `workers/`. For each, confirm:
+ explicit timeout, bounded retry with jittered backoff (cockatiel), and a
+ circuit-breaker for hot paths that hammer a flaky upstream.
+2. Standardize a shared `fetchWithResilience` / RPC-client wrapper in `api/_lib/`
+ and migrate unprotected callers to it (additive — don't churn already-protected
+ code, per memory guidance).
+3. Validate and defensively parse every upstream response. Never assume shape;
+ malformed replies must not throw raw — they map to a clean error or a safe
+ default. (Generalize the x402 ATA-probe pattern.)
+4. Standardize API error responses: correct HTTP status, a stable `{ error: { code,
+ message } }` shape, no stack traces or secrets leaked to clients. Log full detail
+ server-side.
+5. Add a top-level handler wrapper that catches unhandled rejections/exceptions per
+ request and converts them to a clean 5xx with a request id.
+6. Client side: every `fetch` has a timeout + abort, and surfaces a designed,
+ actionable error state (ties to prompt `12`). Add retry on idempotent GETs.
+7. Add tests for the failure paths: simulate timeouts, 429s, malformed JSON, partial
+ responses. Confirm graceful degradation, not crashes.
+
+## Must-not
+- Do not swallow errors silently or return `200` with empty data on failure.
+- Do not leak stack traces, internal URLs, or secrets in error responses.
+- Do not retry non-idempotent writes blindly (risk of double-spend/double-mint).
+
+## Acceptance
+- [ ] Every external call has timeout + bounded retry; hot paths have circuit-breakers.
+- [ ] Shared resilient client adopted across previously-unprotected handlers.
+- [ ] All upstream responses defensively parsed; malformed input handled, never thrown raw.
+- [ ] Uniform structured error responses with correct status codes; no leaks.
+- [ ] Failure-path tests added and green.
+- [ ] No unhandled promise rejections (cross-check prompt `03`).
diff --git a/prompts/prod/07-security-hardening.md b/prompts/prod/07-security-hardening.md
new file mode 100644
index 000000000..3bc8c9bae
--- /dev/null
+++ b/prompts/prod/07-security-hardening.md
@@ -0,0 +1,62 @@
+# 07 — Security hardening
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 1 — Cross-cutting hardening
+**Owns:** `api/`, `workers/`, auth middleware in `api/_lib/`, `vercel.json` (headers/routes), wallet/payment paths.
+**Depends on:** `05` (secrets), `06` (error handling). Pairs with `08` (rate limiting).
+
+## Why this matters for $1B
+This platform custodies wallets and moves money (x402, $THREE, skill purchases). One
+authz bug = drained funds = dead company. Security is the difference between a
+fundable platform and a liability.
+
+## Mission
+Close every authn/authz gap, validate every input, set hardening headers, and ensure
+money-moving paths are airtight. Run a real security review and fix what it finds.
+
+## Map
+- Auth/ownership model: `agent_identities.user_id` is immutable, one agent = one
+ owner (see `prompts/agent-wallets/00-README-orchestration.md`). Only the owner can
+ withdraw / set limits / rebrand.
+- Money paths: `api/x402-*`, `api/payments/*`, `api/pump/*`, withdrawal endpoints,
+ `api/_lib/agent-wallet.js`, `api/_lib/skill-license-onchain.js`.
+- `vercel.json` controls routes + can set headers.
+
+## Do this
+1. Run the repo's security-review skill/process (`/security-review`) over the current
+ state and triage findings by severity.
+2. **AuthZ on every mutating endpoint:** confirm the caller owns the resource before
+ any write/withdraw/rebrand/spend. Audit `api/` for endpoints that trust a
+ client-supplied `user_id`/`agent_id` without verifying the session. Fix every one.
+3. **Input validation at boundaries:** validate/normalize every request body, query
+ param, and path param (lengths, types, ranges, address formats, amount bounds).
+ Reject early with 400. Prevent injection (SQL/NoSQL/command), path traversal, SSRF
+ (especially anywhere a URL is fetched on the user's behalf).
+4. **Money-path invariants:** amount sanity bounds, idempotency keys on
+ transfers/mints to prevent double-spend, replay protection on signed requests,
+ server-side recomputation of prices (never trust client-sent amounts).
+5. **Security headers** via `vercel.json` or middleware: `Content-Security-Policy`
+ (tightened, not `unsafe-inline` everywhere), `Strict-Transport-Security`,
+ `X-Content-Type-Options`, `Referrer-Policy`, `Permissions-Policy`, frame controls
+ for embeds (allow only intended embed routes).
+6. **CORS:** lock API CORS to known origins; don't reflect arbitrary `Origin`.
+7. **Dependency audit:** `npm audit` (and `npm audit --workspaces`); fix high/critical
+ by upgrade. Document any accepted advisory with rationale.
+8. **Secrets in transit/logs:** confirm prompt `05` outcomes hold; no PII/secrets in
+ logs.
+9. Add regression tests for each fixed authz/validation hole.
+
+## Must-not
+- Do not trust any client-supplied identity, amount, or price.
+- Do not weaken CSP to "make something work" — fix the inline/eval cause.
+- Do not retry or replay money-moving requests without idempotency.
+
+## Acceptance
+- [ ] `/security-review` findings triaged and resolved (or risk-accepted with written rationale).
+- [ ] Every mutating endpoint verifies ownership/session server-side.
+- [ ] All inputs validated at the boundary; injection/traversal/SSRF closed.
+- [ ] Money paths have amount bounds + idempotency + server-side price recomputation.
+- [ ] Hardening headers + locked CORS in place; CSP tightened.
+- [ ] `npm audit` clean of high/critical (or documented).
+- [ ] Regression tests cover the fixed holes; `npm test` green.
diff --git a/prompts/prod/08-rate-limiting-and-abuse.md b/prompts/prod/08-rate-limiting-and-abuse.md
new file mode 100644
index 000000000..7cf1d4d2f
--- /dev/null
+++ b/prompts/prod/08-rate-limiting-and-abuse.md
@@ -0,0 +1,58 @@
+# 08 — Rate limiting & abuse prevention
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 1 — Correctness & hardening
+**Owns:** `api/`, `workers/`, the shared limiter in `api/_lib/rate-limit.js` + `api/_lib/http.js`, Upstash Redis usage (`api/_lib/redis.js`).
+**Depends on:** `07` (security hardening) · **Parallel-safe with:** `09`
+
+## Why this matters for $1B
+Every expensive call — text-to-3D, image gen, LLM proxy, Solana RPC, mint/launch —
+spends real GPU, model, and chain budget. Unmetered, one abuser (or a distributed
+flood) drains the spend cap, trips fail-closed lanes, and takes the platform down for
+everyone. Abuse = downtime = lost users and burned margin. Metering is what lets a free
+tier exist without bankrupting the business.
+
+## Mission
+Put per-identity and per-IP rate limits, per-tier quotas, and abuse defenses on every
+expensive or money-moving endpoint, standardized on the existing shared limiter.
+
+## Map
+- Shared limiter: `api/_lib/rate-limit.js` (Upstash `Ratelimit`, sliding-window,
+ in-memory dev fallback, `FORGE_PAID_GLOBAL_HOURLY` platform ceiling, cost limiters
+ that fail closed when Redis is unconfigured). Helpers `rateLimited` +
+ `setRateLimitHeaders` (with `Retry-After`, RFC 9110 §10.2.3) live in `api/_lib/http.js`.
+- Health signal: `api/_lib/forge-health.js` already probes the rate-limiter store
+ ("paid generation lanes fail closed" when it is down) — keep this accurate.
+- Cost-bearing endpoints: text-to-3D `api/forge.js` (already lane-aware via `rl` /
+ `rateLimited`), image gen `api/_mcp3d/text-to-image.js` + `api/_mcp3d/vertex-imagen.js`,
+ LLM proxy `api/llm/anthropic.js`, RPC `api/solana-rpc.js`, mint/launch under
+ `api/pump/`, the x402 family via `api/_lib/x402-paid-endpoint.js` and `api/x402/`.
+
+## Do this
+1. Inventory every cost-bearing / money-moving handler in `api/` and `workers/`. For
+ each, record who pays (GPU, model tokens, RPC credits, chain fees) and whether it
+ already routes through `rateLimited` from `api/_lib/http.js`.
+2. Standardize on `api/_lib/rate-limit.js` — do not hand-roll new limiters. Add
+ sliding-window limits keyed by authenticated identity first, then by IP. Never key
+ off client-supplied identity (verify the session as `07` requires).
+3. Add per-tier quotas: a free tier and a higher-ceiling $THREE-holder tier. Keep the
+ platform-wide circuit breaker (`FORGE_PAID_GLOBAL_HOURLY` and the x402 facilitator
+ backstop) intact and env-tunable.
+4. Protect upload endpoints (size, MIME type, count) before any expensive processing.
+5. Add lightweight bot/abuse heuristics (burst detection, repeated-junk-payload
+ rejection) and surface a clear `429` with `Retry-After` via `rateLimited`.
+6. Add tests under `tests/` simulating burst traffic against the limited endpoints,
+ asserting `429` + `Retry-After` once the window is exhausted.
+
+## Must-not
+- Do not trust client-supplied identity for keying limits.
+- Do not silently drop requests — always return `429` with a reason and `Retry-After`.
+- Do not weaken the fail-closed behavior of the cost/money limiters when Redis is down.
+
+## Acceptance
+- [ ] Every expensive endpoint has a documented limit + per-tier quota, all routed
+ through `api/_lib/rate-limit.js`.
+- [ ] `429` responses are designed (reason + `Retry-After`); upload guards in place.
+- [ ] Burst tests pass; `npm test` green; `npm run lint` + `npm run typecheck` clean.
+- [ ] Changelog `improvement`/`security` entry if user-visible; `npm test` green.
diff --git a/prompts/prod/09-accessibility-wcag.md b/prompts/prod/09-accessibility-wcag.md
new file mode 100644
index 000000000..5c3cf04d4
--- /dev/null
+++ b/prompts/prod/09-accessibility-wcag.md
@@ -0,0 +1,62 @@
+# 09 — Accessibility (WCAG 2.2 AA)
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 1 — Cross-cutting hardening
+**Owns:** all `pages/*.html`, `src/` UI components, `public/` shared UI (nav, modals, tour, walk companion).
+**Depends on:** `02` (dead paths). Pairs with `11`, `12`, `13`.
+
+## Why this matters for $1B
+Accessibility is required for enterprise/government sales, reduces legal risk, and is
+explicitly non-optional in `/CLAUDE.md`: "Semantic HTML. ARIA labels. Keyboard
+navigation. Sufficient color contrast. Focus indicators." It also just makes the
+product better for everyone.
+
+## Mission
+Bring the whole site to WCAG 2.2 AA: keyboard-operable, screen-reader-coherent,
+sufficient contrast, visible focus, respects reduced-motion.
+
+## Map
+- 125 pages in `pages/`. Shared interactive UI: `public/nav.js`, payment modals
+ (`public/x402*.js`), feature tour (`src/feature-tour/`), walk companion
+ (`src/walk-companion.js`, `walk-sdk/`).
+- Design tokens live in the global stylesheet (`public/` CSS, `style.css`) — fix
+ contrast at the token level where possible (coordinate with prompt `13`).
+
+## Do this
+1. Run automated audits (axe-core / Lighthouse a11y) across every page; capture
+ violations. Automated catches ~30% — also do manual keyboard + screen-reader
+ passes on the top 15 flows (forge, marketplace, agent profile, wallet, checkout,
+ tour, walk).
+2. **Semantic structure:** one `<h1>` per page, logical heading order, landmarks
+ (`<nav> <main> <header> <footer>`), lists for lists, `<button>` for actions and
+ `<a>` for navigation (no `<div onclick>`).
+3. **Keyboard:** every interactive element reachable and operable by keyboard in a
+ logical tab order; no keyboard traps; modals/tour/menus trap focus while open and
+ restore it on close; ESC closes overlays. Visible, high-contrast focus ring
+ everywhere (never `outline: none` without a replacement).
+4. **Screen readers:** ARIA labels/roles on icon buttons, custom controls, tabs,
+ dialogs, live regions for async updates (generation progress, toasts, balances).
+ `alt` text on meaningful images; `aria-hidden` on decorative.
+5. **Contrast:** all text and UI states meet 4.5:1 (3:1 for large text/UI). Fix at
+ the token level. Check both themes.
+6. **Forms:** every input has a programmatic label; errors are announced and
+ associated with their field; required/invalid states are not color-only.
+7. **Motion:** honor `prefers-reduced-motion` for the tour, walk companion, 3D
+ auto-orbit, and transitions.
+8. **3D canvases:** provide accessible alternatives/labels for `<model-viewer>` and
+ custom canvases (name, description, keyboard orbit where feasible).
+9. Add an axe-core check to the Playwright page sweep so regressions fail CI.
+
+## Must-not
+- Do not remove focus outlines without an equally-visible replacement.
+- Do not use color as the only signal for state/errors.
+- Do not add ARIA that lies about state — incorrect ARIA is worse than none.
+
+## Acceptance
+- [ ] axe-core/Lighthouse a11y: 0 serious/critical violations across all pages.
+- [ ] Top 15 flows fully keyboard-operable; focus managed in all overlays.
+- [ ] Screen-reader pass on top flows is coherent (labels, roles, live regions).
+- [ ] All text/UI meets AA contrast in both themes (fixed at token level).
+- [ ] `prefers-reduced-motion` honored everywhere motion exists.
+- [ ] axe check wired into CI page sweep.
diff --git a/prompts/prod/09-test-suite-green-and-ci-gate.md b/prompts/prod/09-test-suite-green-and-ci-gate.md
new file mode 100644
index 000000000..3c70d5ac2
--- /dev/null
+++ b/prompts/prod/09-test-suite-green-and-ci-gate.md
@@ -0,0 +1,56 @@
+# 09 — Test suite green & CI gate
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 1 — Correctness & hardening
+**Owns:** `tests/`, `vitest.config.js`, `playwright.config.js`, `.github/workflows/ci.yml`, the `test*`/`lint`/`typecheck` scripts in `package.json`.
+**Depends on:** `02` (no stubs) · **Parallel-safe with:** `08`
+
+## Why this matters for $1B
+Green, meaningful tests plus a blocking CI gate are table stakes for fundability and
+for shipping safely at scale. Real money rides on `api/` and the chain paths — a red
+suite or a CI that waves failures through is how a money bug reaches production. The
+repo already has ~456 test files and a `.github/workflows/ci.yml` merge gate; this
+prompt makes it trustworthy.
+
+## Mission
+Get the full suite green, cover the highest-risk money/3D/auth paths, and make CI block
+merges on red.
+
+## Map
+- Suites/scripts (`package.json`): `npm test` = `vitest run && playwright test`;
+ `test:core` (single-worker vitest), `test:gate` (`scripts/test-gate.mjs`), `test:e2e`
+ (`playwright test`), `test:pages` (`scripts/test-pages.mjs`).
+- Config: `vitest.config.js`, `playwright.config.js` (`testDir: 'tests/e2e'`).
+- Quality gates: `npm run lint` (`eslint .`), `npm run typecheck` (`tsc -p jsconfig.json`).
+- CI: `.github/workflows/ci.yml` jobs — `lint`, `test` (`vitest run`), `guards`
+ (`check-api-not-bundled.mjs`, `check:images`, `build:pages`), `typecheck` (currently
+ `continue-on-error: true`, advisory).
+- Risk-path example: `tests/glb-canonicalize.test.js` is the per-skeleton convention
+ test required by `/CLAUDE.md`.
+
+## Do this
+1. Run `npm test`, `npm run test:e2e`, `npm run test:pages`, and `npm run test:gate`.
+ Fix every failure, or quarantine it behind a tracked issue — no permanent skips.
+2. Add tests for the highest-risk paths surfaced by prompt `01`: wallet/withdraw authz,
+ x402 payment, the forge generation fallback chain (`api/forge.js` lanes), and
+ `glb-canonicalize` per the `tests/glb-canonicalize.test.js` convention.
+3. Make `npm run lint` and `npm run typecheck` pass for touched code; clear typecheck
+ errors so `.github/workflows/ci.yml` can flip `typecheck` from advisory to blocking.
+4. Verify the CI workflow runs lint + tests + guards and blocks on failure on PRs and
+ pushes to `main`; tighten the typecheck job to a hard gate once it is clean.
+5. Identify flaky tests (re-run suspect specs), de-flake them at the source, and record
+ any that remain quarantined with their tracking issue.
+
+## Must-not
+- Do not `.skip`/`.only` a test to go green without a tracked issue.
+- Do not weaken assertions, shrink fixtures, or delete cases to force a pass.
+- Do not mock real APIs to dodge a failure — fix the code or the test setup.
+
+## Acceptance
+- [ ] `npm test`, `npm run test:e2e`, `npm run test:pages`, `npm run lint`, and
+ `npm run typecheck` all green locally and in `.github/workflows/ci.yml`.
+- [ ] CI blocks merges on red (typecheck moved off `continue-on-error` once clean).
+- [ ] New tests cover the top risk paths (wallet/withdraw, x402, forge fallback, glb).
+- [ ] Flaky tests de-flaked or quarantined with a tracked issue; `npm test` green.
+- [ ] Changelog entry only if a user-visible behavior changed (usually internal).
diff --git a/prompts/prod/10-performance-core-web-vitals.md b/prompts/prod/10-performance-core-web-vitals.md
new file mode 100644
index 000000000..f10323915
--- /dev/null
+++ b/prompts/prod/10-performance-core-web-vitals.md
@@ -0,0 +1,52 @@
+# 10 — Performance & Core Web Vitals
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 1 — Cross-cutting hardening
+**Owns:** `vite.config.js`, `pages/`, `src/`, `public/`, 3D asset loading, build pipeline.
+**Depends on:** `03` (clean console). Pairs with `11`, `28`.
+
+## Why this matters for $1B
+A 3D-heavy platform that janks or loads slowly loses users at the door and ranks
+worse in search. `/CLAUDE.md`: "Performance by default. Lazy-load heavy modules.
+Don't ship jank." Speed is conversion is revenue is valuation.
+
+## Mission
+Hit good Core Web Vitals on every key page (LCP < 2.5s, INP < 200ms, CLS < 0.1 on a
+mid-tier device/throttled network) and keep heavy 3D from blocking first paint.
+
+## Do this
+1. Establish a baseline: run Lighthouse (mobile, throttled) on the top 15 pages.
+ Record LCP/INP/CLS/TBT and bundle sizes. Set per-page budgets and a script to
+ enforce them in CI.
+2. **JS:** code-split per route; lazy-load Three.js, model-viewer, character-studio,
+ scene-studio, and other heavy modules so they never block initial render. Defer
+ non-critical scripts. Tree-shake; remove dead imports (cross-check prompt `04`).
+3. **3D assets:** compress GLBs (`npm run compress:glbs` / `optimize:glb`), use Draco/
+ meshopt, lazy-load models below the fold, show a lightweight poster/skeleton until
+ the model is ready, and cap texture sizes. Never auto-load a heavy model the user
+ can't see yet.
+4. **Images:** responsive `srcset`, modern formats (AVIF/WebP), explicit
+ width/height to kill CLS, lazy-load offscreen images. Run `npm run check:images`.
+5. **Fonts:** `font-display: swap`, preload the critical face, subset if possible.
+6. **CSS:** inline critical CSS for above-the-fold; defer the rest. Remove unused CSS.
+7. **Caching:** correct `Cache-Control` for static assets (immutable hashed assets,
+ sensible TTLs for data) via `vercel.json`. Confirm CDN/R2 caching for GLBs.
+8. **Layout stability:** reserve space for async content (models, images, ads/embeds)
+ to keep CLS near zero.
+9. **INP:** debounce input handlers, break up long tasks, avoid main-thread 3D work
+ that blocks interaction; move heavy compute to workers where possible.
+10. Re-run Lighthouse; confirm budgets met. Wire the budget check into CI.
+
+## Must-not
+- Do not block first paint on Three.js or any 3D module.
+- Do not ship uncompressed GLBs or unsized images.
+- Do not regress accessibility (prompt `09`) for performance.
+
+## Acceptance
+- [ ] Top 15 pages: LCP < 2.5s, INP < 200ms, CLS < 0.1 (mobile, throttled).
+- [ ] Heavy modules (Three.js, model-viewer, studios) are lazy/code-split.
+- [ ] GLBs compressed (Draco/meshopt) and lazy-loaded with posters/skeletons.
+- [ ] Images responsive, sized, modern-format, lazy below fold.
+- [ ] Per-page performance budgets enforced in CI.
+- [ ] Lighthouse perf score ≥ 90 on key pages.
diff --git a/prompts/prod/11-mobile-responsiveness.md b/prompts/prod/11-mobile-responsiveness.md
new file mode 100644
index 000000000..9565128ce
--- /dev/null
+++ b/prompts/prod/11-mobile-responsiveness.md
@@ -0,0 +1,57 @@
+# 11 — Mobile responsiveness
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 1 — Cross-cutting hardening
+**Owns:** all `pages/*.html`, `src/` UI, `public/` shared UI + CSS.
+**Depends on:** `02`, `13`. Pairs with `09`, `12`.
+
+## Why this matters for $1B
+Most first-touch traffic is mobile. Recent git history shows the tour and walk
+companion were "effectively broken on phones" until fixed — treat that as a signal
+that mobile coverage is uneven. A platform that breaks on phones can't go viral.
+
+## Mission
+Every page and flow works and looks intentional at 320px, 768px, and 1440px, with
+real touch targets and no horizontal scroll.
+
+## Map
+- 125 pages in `pages/`. Mobile-sensitive surfaces flagged in git history: feature
+ tour (`src/feature-tour/`), walk companion (`src/walk-companion.js`), nav
+ (`public/nav.js` — mobile menu), payment modals, forge (`pages/forge.html`).
+- Audio/interaction gotcha: mobile browsers block audio until a tap, and the
+ permission resets per page — the tour already handles this; preserve that pattern.
+
+## Do this
+1. Sweep every page at 320 / 375 / 768 / 1024 / 1440 (Playwright device emulation +
+ real-device spot checks). Capture: horizontal overflow, clipped content, unreadable
+ text, overlapping elements, off-screen controls, tiny tap targets.
+2. Fix layout with fluid units, fl/grid, and `clamp()` — not fixed widths. Eliminate
+ every source of horizontal scroll.
+3. **Tap targets ≥ 44×44px** with adequate spacing. Audit all icon buttons, tabs,
+ close buttons, and dense control rows.
+4. **Reachability:** confirm every desktop action has a mobile equivalent. Any control
+ that lives only in a collapsing desktop nav must also appear in the mobile menu
+ (this exact bug hit the walk companion — re-audit for siblings).
+5. **Modals/sheets:** payment, share, settings, and tour overlays fit small screens,
+ scroll internally if needed, and have phone-sized controls.
+6. **3D on mobile:** model-viewer/canvases are touch-orbitable, sized to viewport,
+ and don't overheat/jank low-end devices; provide a lighter path if needed.
+7. **Forms/keyboards:** correct `inputmode`/`type`, no zoom-on-focus jump (16px+ font
+ on inputs), visible submit above the on-screen keyboard.
+8. **Safe areas:** respect notches/home indicators (`env(safe-area-inset-*)`).
+9. Add mobile-viewport assertions (no overflow, tap-target size) to the Playwright
+ sweep.
+
+## Must-not
+- Do not hide functionality on mobile instead of adapting it.
+- Do not ship sub-44px tap targets or fixed-width layouts.
+- Do not regress the tour's per-page audio-unlock handling.
+
+## Acceptance
+- [ ] Every page clean at 320/768/1440 — no horizontal scroll, no clipping/overlap.
+- [ ] All tap targets ≥ 44×44px with spacing.
+- [ ] Every desktop action reachable on mobile (incl. nav-collapsed controls).
+- [ ] Modals/overlays and 3D canvases usable on phones.
+- [ ] Forms behave with on-screen keyboards; safe areas respected.
+- [ ] Mobile-overflow + tap-target assertions in CI sweep.
diff --git a/prompts/prod/12-every-state-designed.md b/prompts/prod/12-every-state-designed.md
new file mode 100644
index 000000000..5cced411a
--- /dev/null
+++ b/prompts/prod/12-every-state-designed.md
@@ -0,0 +1,56 @@
+# 12 — Every state designed (loading / empty / error)
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 1 — Cross-cutting hardening
+**Owns:** every data-driven view across `pages/`, `src/`, `public/`.
+**Depends on:** `04` (no fake fallbacks), `06` (error handling).
+
+## Why this matters for $1B
+`/CLAUDE.md`: "Every state is designed. A page with no data should tell the user what
+to do, not show a blank void." The gap between an adequate product and a $1B one is
+the accumulation of these moments — the empty state that converts, the error that
+recovers, the skeleton that reassures.
+
+## Mission
+Every async, list, and detail view has intentional loading, empty, error, and
+overflow states. No blank voids, no raw spinners where a skeleton belongs, no dead
+ends on failure.
+
+## Map
+- Data-driven surfaces: marketplace, launches feed, agent profiles, wallet/activity,
+ bounties, communities, collections, gallery, forge results, search results.
+- Reuse/establish shared components for skeletons, empty states, and error states so
+ every surface is consistent (coordinate with prompt `13`).
+
+## Do this
+1. Inventory every view that fetches or renders variable data. For each, define all
+ four states: **loading**, **empty**, **error**, **populated** (+ overflow:
+ pagination/virtualization for large lists).
+2. **Loading:** skeleton screens that match the populated layout (preferred over
+ spinners), tied to real request lifecycle (no fake `setTimeout`).
+3. **Empty:** explain what this is, why it's empty, and the one clear next action
+ (CTA) — e.g. "No agents yet — forge your first" with a button. Add a tasteful
+ illustration/icon. Empty ≠ blank.
+4. **Error:** say what went wrong in human terms and offer recovery (Retry, go back,
+ contact). Wire Retry to actually re-run the fetch. Never show raw error objects.
+5. **Overflow:** lists handle 0 / 1 / many / very-many (paginate or virtualize at
+ scale per prompt `10`); long strings truncate with full value on hover/title;
+ layouts survive extreme content.
+6. Build shared `<Skeleton>`, `<EmptyState>`, `<ErrorState>` primitives (or the
+ vanilla-JS equivalent helpers) and adopt them everywhere for consistency.
+7. Verify each state in a real browser by forcing it (throttle, offline, empty
+ account, error injection).
+
+## Must-not
+- Do not ship a bare spinner where a skeleton fits, or a blank area for empty.
+- Do not display raw stack traces / JSON errors to users.
+- Do not leave a Retry button that doesn't retry.
+
+## Acceptance
+- [ ] Every data view has designed loading, empty, error, and overflow states.
+- [ ] Loading uses layout-matched skeletons tied to real async.
+- [ ] Empty states have copy + a working CTA, not a void.
+- [ ] Error states are human and have working recovery actions.
+- [ ] Shared state primitives exist and are reused across surfaces.
+- [ ] States verified in-browser by forcing each one.
diff --git a/prompts/prod/13-accessibility.md b/prompts/prod/13-accessibility.md
new file mode 100644
index 000000000..935a25ed3
--- /dev/null
+++ b/prompts/prod/13-accessibility.md
@@ -0,0 +1,53 @@
+# 13 — Accessibility (WCAG 2.2 AA)
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 3 — Experience quality
+**Owns:** `pages/`, `src/` components, design tokens/CSS variables, the 3D viewer controls.
+**Depends on:** none (run after Phase 0/1) · **Parallel-safe with:** `12`, `14`, `15`, `16`, `17`
+
+## Why this matters for $1B
+`/CLAUDE.md` makes accessibility non-optional. It widens the market, is a legal
+requirement in many jurisdictions, and signals the craft a $1B platform is held to. An
+interface only mouse-and-sighted users can operate caps growth and invites risk.
+
+## Mission
+Bring every interactive surface to WCAG 2.2 AA — semantic HTML, keyboard nav, ARIA,
+contrast, focus, and reduced-motion.
+
+## Map
+- Top surfaces: `pages/index.html` (home), `pages/forge.html`, `pages/marketplace.html`,
+ `pages/trending.html`, `pages/agent-detail.html`, and an editor such as Animation
+ Studio (`pages/animations.html`) or Scene Studio (`pages/scene.html` / `src/scene-studio/`).
+- Shared UI + tokens: components and CSS variables under `src/`; the 3D canvas/orbit
+ controls used by the viewer and editors.
+- Existing gates to lean on: `npm run audit:web` (`scripts/page-audit.mjs`) and the
+ page suite `npm run test:pages` (`scripts/test-pages.mjs`).
+
+## Do this
+1. Audit the top surfaces with axe and Lighthouse accessibility; record per-surface
+ scores and every serious violation as the baseline.
+2. Fix semantic structure: landmarks (`header`/`nav`/`main`/`footer`), one logical
+ heading order, labelled controls, lists where appropriate.
+3. Make everything keyboard-operable, including the 3D canvas controls and every modal:
+ focus trap while open, `Esc` to close, focus returned to the trigger on close, no
+ keyboard traps elsewhere.
+4. Add ARIA only where native semantics cannot express the role/state — never to
+ paper over a non-semantic element that should be a `button`/`a`.
+5. Verify color contrast against the design tokens (4.5:1 text, 3:1 large text/UI);
+ fix token values rather than one-off overrides.
+6. Honor `prefers-reduced-motion` for the heavy transitions and 3D motion; ensure
+ visible focus rings everywhere, meaningful `alt` text on informative images, and
+ form errors that are announced (`aria-live` / `aria-describedby`).
+
+## Must-not
+- Do not add ARIA that lies about state (e.g. static `aria-expanded`).
+- Do not remove focus outlines without a clearly-visible replacement.
+- Do not hide content from assistive tech to "clean up" the a11y report.
+
+## Acceptance
+- [ ] axe/Lighthouse accessibility >= 95 on the top surfaces, no serious violations.
+- [ ] Full keyboard walkthrough documented (tab order, modals, 3D controls, `Esc`).
+- [ ] Contrast meets AA against design tokens; `prefers-reduced-motion` respected.
+- [ ] `npm test` green; `npm run lint` + `npm run typecheck` clean for touched code.
+- [ ] Changelog `improvement` entry (e.g. "Keyboard + screen-reader support").
diff --git a/prompts/prod/13-design-system-consistency.md b/prompts/prod/13-design-system-consistency.md
new file mode 100644
index 000000000..73bd98309
--- /dev/null
+++ b/prompts/prod/13-design-system-consistency.md
@@ -0,0 +1,56 @@
+# 13 — Design-system consistency
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 1 — Cross-cutting hardening
+**Owns:** global CSS / design tokens (`style.css`, `public/*.css`), shared components, every page's styling.
+**Depends on:** none. Pairs with `09`, `11`, `12`.
+
+## Why this matters for $1B
+Consistency compounds into perceived quality. `/CLAUDE.md`: "Consistent spacing and
+typography. Use the existing design tokens / CSS variables." A site that uses the same
+spacing scale, type ramp, and component vocabulary everywhere reads as one premium
+product — not a pile of separately-built pages.
+
+## Mission
+One coherent design system: documented tokens, a consistent type/spacing/color scale,
+reusable components, and every page conformed to it. No ad-hoc magic numbers.
+
+## Map
+- Existing tokens: the forge page references `--space-md/lg/xl/2xl`, `--text-xs..xl`,
+ `--ink`, `--ink-dim`, `--stroke`, `--surface-*`, `--radius-*`, `--font-display/
+ body/mono`, `--leading-*`. Treat these as the canonical token set.
+- 125 pages in `pages/`, many with inline `<style>` blocks — the main source of drift.
+
+## Do this
+1. Catalog the existing tokens (the `--space/--text/--ink/--surface/--stroke/--radius/
+ --font/--leading` families). If a token catalog doc doesn't exist, create
+ `docs/design-system.md` documenting every token, its value, and when to use it.
+2. Audit pages for **hardcoded values** that should be tokens: raw px spacing, hex
+ colors, font sizes, border radii, shadows. Replace with the nearest token; if no
+ token fits, the scale has a gap — extend the scale deliberately, don't add a
+ one-off.
+3. **Components:** identify repeated UI (buttons, cards, chips, tabs, modals, inputs,
+ toasts, badges) re-implemented per page. Extract canonical, accessible, themeable
+ versions and replace duplicates. Match hover/active/focus states everywhere.
+4. **Type & spacing rhythm:** enforce the type ramp and an 8pt-ish spacing scale
+ site-wide. Fix inconsistent line-heights and vertical rhythm.
+5. **Color & theming:** both light and dark themes pass contrast (prompt `09`) and use
+ only tokens. No hardcoded colors that break theming.
+6. **Microinteractions:** ensure consistent transition timing/easing tokens for
+ hover/active/enter/exit (`/CLAUDE.md`: "Transitions matter"). Honor reduced-motion.
+7. Add a lint/check (stylelint or a custom scan) that flags hardcoded colors/spacing
+ outside the token system, and wire it into CI.
+
+## Must-not
+- Do not introduce a parallel token set or rename existing tokens (breaks every page).
+- Do not add one-off magic numbers when a token exists.
+- Do not refactor working components purely for style — extract shared ones additively.
+
+## Acceptance
+- [ ] `docs/design-system.md` documents the full token set and components.
+- [ ] Hardcoded color/spacing/type values replaced with tokens (scale extended only deliberately).
+- [ ] Canonical reusable components extracted and adopted; duplicates removed.
+- [ ] Consistent hover/active/focus + transition tokens across the site.
+- [ ] Both themes consistent and contrast-passing.
+- [ ] Token-drift lint wired into CI.
diff --git a/prompts/prod/14-seo-and-structured-data.md b/prompts/prod/14-seo-and-structured-data.md
new file mode 100644
index 000000000..c3504f389
--- /dev/null
+++ b/prompts/prod/14-seo-and-structured-data.md
@@ -0,0 +1,61 @@
+# 14 — SEO & structured data
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 1 — Cross-cutting hardening
+**Owns:** `pages/` `<head>`s, `public/sitemap/`, `public/llms.txt`, `public/llms-full.txt`, `data/pages.json`, `scripts/build-page-index.mjs`, `scripts/seo-meta` (`npm run seo:meta`).
+**Depends on:** `10` (perf affects ranking). Pairs with `34`.
+
+## Why this matters for $1B
+Organic discovery is the cheapest growth channel and a durable moat. 293 pages across
+11 sections is a large surface to rank. Done right, search + AI-agent discovery
+(llms.txt) compounds for free.
+
+## Mission
+Every page is discoverable, correctly titled/described, share-ready, and emits valid
+structured data. The sitemap, llms.txt, and AI-discovery surfaces are complete and
+current.
+
+## Map
+- `npm run seo:meta` audits meta. `npm run build:pages` regenerates page index +
+ sitemap + changelog from `data/pages.json` + `data/changelog.json`.
+- AI discovery: `public/llms.txt`, `public/llms-full.txt` (regenerated by build).
+- x402 endpoint discovery indexing is tracked separately (see memory note) — don't
+ duplicate that here, but cross-link.
+
+## Do this
+1. Run `npm run seo:meta` and fix every page missing or sharing a `<title>` /
+ `<meta description>`. Titles unique, descriptive, < ~60 chars; descriptions
+ compelling, < ~155 chars.
+2. **Open Graph + Twitter cards** on every page: `og:title/description/image/url/type`
+ + `twitter:card` and a real share image (per-section default + per-entity dynamic
+ for agents/launches/collections). Verify with a card validator.
+3. **Canonical URLs** on every page; resolve duplicate-content (trailing slash, query
+ params) via canonical + `vercel.json` redirects.
+4. **Structured data (JSON-LD):** `Organization`/`WebSite` site-wide;
+ `BreadcrumbList` on nested pages; `Product`/`Offer` on marketplace/skill pages;
+ `Article` on blog posts; `SoftwareApplication` on SDK pages. Validate with the Rich
+ Results test.
+5. **Sitemap:** confirm `public/sitemap/` includes every public page with sane
+ priorities and `lastmod`; submit-ready. `robots.txt` correct (allow public, block
+ private/API, point to sitemap).
+6. **llms.txt / llms-full.txt:** ensure they describe the full product surface and
+ stay regenerated by `build:pages`. This is how agents discover the platform — keep
+ it first-class.
+7. **Semantic + perf:** correct heading hierarchy (shared with prompt `09`), fast LCP
+ (prompt `10`), and crawlable content (no JS-only critical content where avoidable).
+8. Wire `seo:meta` into CI so a page can't ship without meta.
+
+## Must-not
+- Do not duplicate titles/descriptions across pages.
+- Do not reference any coin other than `$THREE` in any meta/structured data/share copy.
+- Do not block crawlers from public pages or expose private/API routes in the sitemap.
+
+## Acceptance
+- [ ] `npm run seo:meta` clean — every page unique title + description.
+- [ ] OG/Twitter tags + share images on every page; validated.
+- [ ] Canonicals + redirects resolve duplicate content.
+- [ ] Valid JSON-LD on org/breadcrumb/product/article/SDK pages (Rich Results passes).
+- [ ] Complete sitemap + correct robots.txt.
+- [ ] llms.txt/llms-full.txt complete and regenerated by build.
+- [ ] `seo:meta` enforced in CI.
diff --git a/prompts/prod/15-forge-end-to-end.md b/prompts/prod/15-forge-end-to-end.md
new file mode 100644
index 000000000..ca311ba5f
--- /dev/null
+++ b/prompts/prod/15-forge-end-to-end.md
@@ -0,0 +1,61 @@
+# 15 — Forge, end-to-end
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 2 — Product surface completeness
+**Owns:** `pages/forge.html`, forge API lane (text/image → 3D), `forge_free`/`mesh_forge`/`rig_mesh`/`forge_avatar` MCP tools, viewer (`avatar-sdk/`).
+**Depends on:** `06`, `08`, `12`. Pairs with `21`, `23`.
+
+## Why this matters for $1B
+Forge is the product's "wow" — text/photos → a textured 3D model in the browser. It's
+the top-of-funnel magic that makes people screenshot and share. It must feel
+instant, reliable, and delightful, with zero dead ends.
+
+## Mission
+Make the full forge flow production-grade: input → generation → preview → rig →
+download/AR/share, every mode, every state, on every device.
+
+## Map
+- UI: `pages/forge.html` (full-width layout; modes: Describe it / From photos /
+ sketch-when-live). Stage uses `<model-viewer>`; idle teaser shows a live community
+ model.
+- Engines: free NVIDIA NIM / TRELLIS lane (`forge_free`), `mesh_forge` chain,
+ auto-rig (`rig_mesh`, `forge_avatar`). Catalog gating hides engines with no live
+ worker (note the hidden sketch tab).
+- Auto-rig universality rules: `/CLAUDE.md` "Avatar animation is universal" +
+ `src/glb-canonicalize.js`, `src/animation-retarget.js`.
+
+## Do this
+1. Exercise every mode end-to-end with real generations: text→3D, photos→3D, and
+ sketch (only if a live worker exists — otherwise keep it correctly hidden, no dead
+ tab). Confirm real API calls succeed with real data.
+2. **Generation lifecycle:** real progress tied to the actual job (no fake bars), with
+ honest stages (queued → generating → texturing → rigging → ready). Handle slow
+ jobs, timeouts, and partial failures with retry — never a hung spinner.
+3. **Preview:** orbit, zoom, AR, and lighting all work; mobile touch-orbit smooth;
+ poster/skeleton until model loads (prompt `10`); model framed nicely by default.
+4. **Auto-rig:** generated humanoids drive the canonical clip library (idle/walk,
+ legs included) per the universality rule; non-humanoid props fall back cleanly to
+ the default rig — never a bind-pose T-pose. Verify with a couple of distinct rigs.
+5. **Output actions:** download GLB, view in AR, open in viewer, save to account, and
+ share (with a real OG image of the model) — every button does real work.
+6. **States:** designed loading/empty/error (prompt `12`); rate-limit + upgrade path
+ for the free lane (prompt `08`); clear messaging when an engine is down.
+7. **Cross-wiring:** a forged model links into the rest of the platform — save to
+ profile, list on marketplace, use as an agent avatar, launch flow. Wire those
+ connections (`/CLAUDE.md`: "A marketplace that doesn't link to agent profiles is
+ half-built").
+8. Add tests for the prepare/generate/rig API paths and a Playwright happy-path.
+
+## Must-not
+- Do not show fake progress or fake "done" on failure.
+- Do not leave a generated model with no next action.
+- Do not hardcode a curated rig allowlist — extend `glb-canonicalize.js` for new skeletons.
+
+## Acceptance
+- [ ] Every visible mode produces a real model end-to-end; hidden modes stay hidden until live.
+- [ ] Honest progress lifecycle; timeouts/partial failures recover with retry.
+- [ ] Preview (orbit/zoom/AR) works desktop + mobile with poster/skeleton.
+- [ ] Auto-rig drives canonical clips on humanoids; clean fallback for props.
+- [ ] Download / AR / save / share / list-on-marketplace all work and cross-link.
+- [ ] Designed states + free-lane rate limiting; API + Playwright tests green.
diff --git a/prompts/prod/16-marketplace-end-to-end.md b/prompts/prod/16-marketplace-end-to-end.md
new file mode 100644
index 000000000..0b7ac33ce
--- /dev/null
+++ b/prompts/prod/16-marketplace-end-to-end.md
@@ -0,0 +1,58 @@
+# 16 — Marketplace, end-to-end
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 2 — Product surface completeness
+**Owns:** `marketplace/`, `pages/marketplace*.html`, related `api/` (skills, listings, purchases), `prompts/monetization/` outcomes.
+**Depends on:** `12`, `17`, `18`. Pairs with `32`.
+
+## Why this matters for $1B
+A marketplace is a flywheel: creators list, buyers buy, both stick. Marketplace
+GMV is the headline metric a $1B 3D-agent platform is valued on. It must be
+trustworthy, fast, searchable, and conversion-optimized.
+
+## Mission
+A complete, polished marketplace: browse → discover → evaluate → purchase → own →
+use, with sorting/filtering/search, real listings, and airtight purchase flows.
+
+## Map
+- `marketplace/` dir + `pages/` marketplace surfaces. Skill purchase flow and
+ on-chain skill licenses: `api/skills/*`, `api/_lib/skill-license-onchain.js`,
+ `contracts/skill-license/` (each purchased skill = a 1/1 SPL NFT + `SkillLicense`
+ PDA). Existing monetization prompts: `prompts/monetization/`.
+
+## Do this
+1. **Discovery:** listings load from real data with sorting (price, recency,
+ popularity, rating) and filtering (category, price range, chain, creator). Add
+ real search with sensible relevance. `/CLAUDE.md` innovation standard: if list
+ views lack sorting, add it.
+2. **Listing detail:** rich, accurate detail page — 3D preview, description, price,
+ creator (links to agent profile, prompt `17`), reviews/ratings if present,
+ ownership state. Every claim backed by real data.
+3. **Purchase flow:** end-to-end with real payments (x402 / Solana Pay, prompt `18`).
+ States: prepare → pay → confirming (poll) → owned. Idempotent, replay-safe,
+ server-side price (prompt `07`). On success, the buy button becomes "Owned" and the
+ skill/asset is actually usable.
+4. **Ownership & licenses:** reflect on-chain `SkillLicense` state truthfully; gate
+ access by the real license, handle pending/confirmed/failed clearly.
+5. **Creator side:** list/edit/unlist flows, pricing, and creator analytics (sales,
+ revenue, views) — real data, designed empty states for new creators.
+6. **Trust & safety:** report/flag listings, basic content checks (ties to prompt
+ `36`), and clear refund/dispute messaging where relevant.
+7. **States & scale:** designed loading/empty/error (prompt `12`); paginate/virtualize
+ large catalogs (prompt `10`); 0/1/many handled.
+8. Add E2E tests for browse + purchase (build on `prompts/monetization/23-*`).
+
+## Must-not
+- Do not show listings from sample arrays — real data only.
+- Do not trust client-sent prices; recompute server-side.
+- Do not mark a purchase complete before on-chain/payment confirmation.
+- Do not reference any coin other than `$THREE` in copy (runtime user-launched mints in launch feeds are the allowed exception).
+
+## Acceptance
+- [ ] Browse with working sort + filter + search over real listings.
+- [ ] Listing detail accurate, with 3D preview and creator link.
+- [ ] Purchase flow end-to-end with real payment, idempotent, correct states, real ownership unlock.
+- [ ] License/ownership reflects on-chain truth; access gated correctly.
+- [ ] Creator list/edit/unlist + analytics work with designed empty states.
+- [ ] Report/flag + scale handling present; E2E purchase test green.
diff --git a/prompts/prod/17-agent-profiles-and-economy.md b/prompts/prod/17-agent-profiles-and-economy.md
new file mode 100644
index 000000000..acdc4e59f
--- /dev/null
+++ b/prompts/prod/17-agent-profiles-and-economy.md
@@ -0,0 +1,64 @@
+# 17 — Agent profiles & economy
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 2 — Product surface completeness
+**Owns:** `pages/agent-*.html` (detail, economy, exchange, trade, studio, wallet), `api/agents/*`, agent identity/reputation (`contracts/`, ERC-8004), AgenC reads.
+**Depends on:** `16`, `18`. Pairs with `15`, `22`.
+
+## Why this matters for $1B
+Every avatar is an autonomous agent with its own wallet and identity. The agent
+profile is the canonical "place" an agent lives — its storefront, reputation, wallet,
+and activity. This is the social + economic graph that makes the platform defensible.
+
+## Mission
+A complete, beautiful, deeply-wired agent profile and economy: identity, wallet,
+launches, skills, reputation, activity, and agent-to-agent interactions — all real,
+all cross-linked.
+
+## Map
+- Pages: `agent-detail.html`, `agent-economy.html`, `agent-exchange.html`,
+ `agent-trade.html`, `agent-studio.html`, `agent-wallet.html`, `agent-embed.html`.
+- Backend: `api/agents/*` (incl. `fork.js`), `api/_lib/avatar-agent.js`,
+ `api/_lib/agent-wallet.js`. Ownership model is in
+ `prompts/agent-wallets/00-README-orchestration.md` (one agent = one owner,
+ `user_id` immutable, fork mints a fresh wallet). Reputation: ERC-8004 in
+ `contracts/`, `agent_reputation` tool. AgenC reads via MCP.
+
+## Do this
+1. **Profile page:** 3D avatar (animated, not T-pose), name/vanity, owner, bio,
+ reputation, wallet summary, skills owned/offered, launches, and activity — all from
+ real data. Designed empty states for new agents (prompt `12`).
+2. **Identity & ownership:** display lineage (`meta.forked_from`) honestly; "Fork"
+ action mints a new owned agent + fresh wallet (never copies secrets). Only the
+ owner sees owner-only controls.
+3. **Wallet surface:** balances (Solana + EVM), tip, withdraw (owner-only), spend
+ limits, activity — wired to the real custodial wallet. Respect every backend
+ invariant (do not change them). Build on `prompts/agent-wallets/` outcomes.
+4. **Economy:** agent's launches ($THREE-only promotion rules; user-launched mints in
+ the launch feed are the runtime-data exception), skills for sale (links to
+ marketplace, prompt `16`), trades/exchange, and earnings.
+5. **Reputation:** surface ERC-8004 reputation truthfully; explain how it's earned;
+ no fabricated scores.
+6. **Agent-to-agent:** delegation/invocation surfaces (`agent_delegate_action`,
+ agent-invocation contract) where present — make them real and legible.
+7. **Cross-wiring:** marketplace listings link here; launches link here; the walk/
+ tour avatars can be these agents; embeds (`agent-embed.html`) render the live
+ profile. Wire every connection.
+8. **Embed/share:** shareable profile with real OG image of the agent; embeddable
+ `<agent-3d>` card.
+9. Tests for profile data, fork ownership invariants, and wallet authz.
+
+## Must-not
+- Do not violate ownership invariants or expose owner-only controls to non-owners.
+- Do not copy wallet secrets on fork.
+- Do not show fabricated reputation/earnings; real on-chain/DB data only.
+- Do not reference any coin other than `$THREE` outside the allowed runtime launch-feed exception.
+
+## Acceptance
+- [ ] Profile renders animated avatar + real identity/wallet/skills/launches/activity with designed empty states.
+- [ ] Fork mints a fresh owned agent + wallet; lineage shown; secrets never copied.
+- [ ] Wallet actions (tip/withdraw/limits) work and enforce owner-only authz.
+- [ ] Economy + reputation surfaces show real data and cross-link to marketplace/launches.
+- [ ] Agent-to-agent delegation/invocation surfaces are real where present.
+- [ ] Shareable/embeddable profile works; tests for ownership + authz green.
diff --git a/prompts/prod/18-wallet-and-x402-payments.md b/prompts/prod/18-wallet-and-x402-payments.md
new file mode 100644
index 000000000..2f1621c24
--- /dev/null
+++ b/prompts/prod/18-wallet-and-x402-payments.md
@@ -0,0 +1,62 @@
+# 18 — Wallet & x402 payments
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 2 — Product surface completeness
+**Owns:** `api/x402-*`, `api/x402/*`, `public/x402*.js`, `x402-buildout/`, `x402-modal-sdk/`, `x402-payment-modal/`, `agent-payments-sdk/`, wallet libs in `api/_lib/`.
+**Depends on:** `06`, `07`, `08`. Pairs with `16`, `17`.
+
+## Why this matters for $1B
+Payments are the revenue spine. x402 makes the platform machine-payable by other
+agents — a structural advantage. Wallets custody real funds. Both must be flawless;
+a payment bug is unforgivable and a valuation risk.
+
+## Mission
+Production-grade wallet + x402 payments: discoverable paid endpoints, reliable
+checkout, correct accounting, idempotency, and a beautiful pay UX on every device.
+
+## Map
+- Checkout: `api/x402-checkout.js` (recently hardened ATA probe against malformed RPC).
+ Pay-by-name: `api/x402/pay-by-name.js` + SNS. Core client: `public/x402-pay-core.js`,
+ `public/x402.js`. Modal SDKs: `x402-modal-sdk/`, `x402-payment-modal/`.
+- Discovery indexing (CDP Bazaar / x402scan / 402index) is tracked in the memory note
+ `x402-discovery-indexing` — keep endpoints indexable; reuse the verifier script.
+- Default network is Solana (memory `solana-default-network`); Base/EVM secondary.
+
+## Do this
+1. **Checkout reliability:** confirm the full prepare → pay → verify → fulfill path
+ is resilient (timeouts, retries, malformed-RPC defenses — generalize the
+ ATA-probe hardening). Idempotency keys so a retry never double-charges or
+ double-fulfills (prompt `07`).
+2. **Accounting correctness:** server recomputes amounts; verify settlement on-chain
+ before fulfilling; reconcile pending/confirmed/failed states; no fulfill-before-pay.
+3. **Pay UX:** the modal SDK shows clear amount, network, recipient, and live status;
+ QR + wallet-deeplink; designed loading/confirming/success/error/timeout states;
+ phone-sized and accessible (prompts `09`, `11`, `12`).
+4. **Pay-by-name:** `*.threews.sol` resolution works end-to-end; clear errors for
+ unresolvable names.
+5. **Wallet surface:** balances, history, send/withdraw (owner-only), spend limits —
+ real custodial wallet, all backend invariants preserved. Fund/onramp path works
+ (USDC). Build on the wallet skills already in the repo.
+6. **Discoverability:** ensure paid endpoints publish correct x402 payment
+ requirements and are indexed (run the verifier from the memory note); list them on
+ a public "paid services" page so agents and humans can find them.
+7. **SDK quality:** `agent-payments-sdk/` + modal SDKs build, are documented, and
+ have a working example. Publish-ready (coordinate with prompt `24`).
+8. Failure-path + idempotency tests; extend `tests/x402-checkout-prepare.test.js`.
+
+## Must-not
+- Do not fulfill before on-chain/payment confirmation.
+- Do not trust client-supplied amounts/recipients; recompute/verify server-side.
+- Do not retry payments without idempotency keys.
+- Do not reference any coin other than `$THREE`; arbitrary user-supplied mints in
+ generic plumbing are the allowed runtime exception.
+
+## Acceptance
+- [ ] Checkout resilient + idempotent end-to-end; no double-charge/fulfill under retry.
+- [ ] Settlement verified on-chain before fulfillment; states reconciled.
+- [ ] Pay modal: clear, accessible, mobile-ready, all states designed.
+- [ ] Pay-by-name resolves; wallet balances/history/withdraw/limits/onramp work owner-only.
+- [ ] Paid endpoints publish correct x402 requirements and are indexed (verifier passes).
+- [ ] Payment SDKs build, documented, with a working example.
+- [ ] Failure + idempotency tests green.
diff --git a/prompts/prod/19-walk-companion-and-tour.md b/prompts/prod/19-walk-companion-and-tour.md
new file mode 100644
index 000000000..049f11b7f
--- /dev/null
+++ b/prompts/prod/19-walk-companion-and-tour.md
@@ -0,0 +1,63 @@
+# 19 — Walk companion & feature tour
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 2 — Product surface completeness
+**Owns:** `walk-sdk/`, `src/walk-companion.js`, `src/walk-playground.js`, `src/feature-tour/`, `tour-sdk/`, `page-agent-sdk/`.
+**Depends on:** `09`, `11`, `12`. Pairs with `30` (onboarding).
+
+## Why this matters for $1B
+The walking 3D guide that strolls the live site and narrates features is a signature,
+screenshot-worthy differentiator and a powerful onboarding device. Recent git history
+shows both the tour and walk companion were broken on phones and only just fixed —
+this surface needs to be bulletproof and genuinely delightful.
+
+## Mission
+Make the walk companion and feature tour flawless and delightful across all devices:
+reliable narration, smooth avatar locomotion, accessible controls, and a tour that
+actually teaches the product.
+
+## Map
+- Walk companion (corner mascot + full-page playground + avatar picker): `walk-sdk/`,
+ `src/walk-companion.js`, `src/walk-playground.js`. Published as `@three-ws/walk`.
+- Feature tour (avatar walks the live site narrating features):
+ `src/feature-tour/{director,controls,free-roam,guide-avatar,narrator}.js`,
+ `tour-sdk/`. Page-agent drop-in: `page-agent-sdk/` (`<page-agent>`).
+- Mobile audio gotcha (already solved — preserve): browsers block audio until a tap,
+ permission resets per page; tour unlocks on first tap and shows a "tap for voice"
+ cue, then re-speaks the current stop. Launchable from home via "Take the tour".
+
+## Do this
+1. **Tour content & flow:** the script visits real, current features in a logical
+ order and explains *why each matters to the user* — not just "this is X." Re-audit
+ stops against the live site so nothing points to a moved/removed feature.
+2. **Narration:** per-page audio unlock works on iOS/Android; clear waiting cue;
+ re-speaks current stop; captions/transcript for accessibility and muted contexts
+ (prompt `09`). Voice off/on persists.
+3. **Locomotion:** the guide avatar walks (legs animated via the canonical clip
+ library, per `/CLAUDE.md`), pathing is smooth, and free-roam doesn't clip through
+ layout or wander off-screen. Honor reduced-motion.
+4. **Controls:** play/pause/next/prev/skip/close with phone-sized tap targets,
+ keyboard operable, focus-managed (prompts `09`, `11`).
+5. **Walk companion:** corner mascot summonable on desktop **and** mobile (the mobile
+ "Walk with me" switch must stay reachable — this exact reachability bug already
+ bit it). Idle wander without a mouse; tap opens the full playground.
+6. **Avatar picker:** diverse, real avatars; user can choose; choice persists.
+7. **SDK quality:** `walk-sdk`, `tour-sdk`, `page-agent-sdk` build, are documented,
+ and have working embed examples (`examples/`). Publish-ready (prompt `24`).
+8. **Performance:** lazy-load the 3D/companion so it never blocks first paint (prompt
+ `10`); throttle on low-end devices.
+9. Tests: tour stop integrity, audio-unlock logic, mobile reachability, SDK build.
+
+## Must-not
+- Do not regress the per-page audio-unlock or the mobile summon switch.
+- Do not let the guide T-pose or clip through the page.
+- Do not block first paint loading the companion.
+
+## Acceptance
+- [ ] Tour visits current features, explains user value, with captions/transcript.
+- [ ] Narration unlocks per page on iOS/Android; controls accessible + phone-sized.
+- [ ] Guide walks with animated legs, smooth pathing, reduced-motion respected.
+- [ ] Walk companion summonable on desktop + mobile; avatar picker works and persists.
+- [ ] walk/tour/page-agent SDKs build, documented, with working examples.
+- [ ] Companion lazy-loaded; tests green.
diff --git a/prompts/prod/20-scene-studio.md b/prompts/prod/20-scene-studio.md
new file mode 100644
index 000000000..9cf45aa1e
--- /dev/null
+++ b/prompts/prod/20-scene-studio.md
@@ -0,0 +1,53 @@
+# 20 — Scene Studio
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 2 — Product surface completeness
+**Owns:** `src/scene-studio/` (`→ /scene`), its vendored three.js editor, GLB import/export, materials/lights.
+**Depends on:** `10`, `12`. Pairs with `15`, `21`.
+
+## Why this matters for $1B
+Scene Studio turns three.ws from "make one avatar" into "compose worlds" — a creation
+surface that increases time-in-product, output value, and shareability. A polished
+3D editor is a credibility signal for a 3D platform.
+
+## Map
+- `src/scene-studio/` — vendored `mrdoob/three.js` r184 editor (MIT, see
+ `src/scene-studio/vendor/README.md`). Route `/scene`. Import GLBs, compose scenes,
+ edit materials/lights, export.
+
+## Do this
+1. **Round-trip integrity:** import a GLB → edit → export → re-import yields the same
+ scene. Verify across several real GLBs (forged models, avatars, club props).
+ Materials, transforms, lights, and hierarchy survive the round-trip.
+2. **Editor UX polish:** the vendored editor is upstream — wrap it in three.ws
+ chrome (nav, theme, design tokens per prompt `13`) so it feels native, not a
+ bolted-on tool. Consistent controls and shortcuts.
+3. **Save/load:** scenes persist to the user's account (real backend), with a gallery
+ of saved scenes, autosave/draft recovery, and designed empty/loading/error states
+ (prompt `12`). No data loss on refresh/crash.
+4. **Performance:** lazy-load the editor bundle (it's heavy — prompt `10`); handle
+ large scenes without locking the main thread; cap/compress on export.
+5. **Cross-wiring:** import avatars/agents and forged models directly; export to the
+ viewer, to an agent profile background, or to a shareable scene page. Add the
+ connections (`/CLAUDE.md` cross-pollination).
+6. **Share/embed:** a saved scene gets a shareable URL + OG image + embeddable viewer.
+7. **Mobile:** at minimum, scenes are *viewable* and shareable on mobile even if full
+ editing is desktop-first; communicate that clearly rather than breaking (prompt
+ `11`).
+8. **Licensing/attribution:** preserve the vendored three.js editor MIT attribution
+ (`vendor/LICENSE`, `vendor/README.md`).
+9. Tests for import/export round-trip and save/load.
+
+## Must-not
+- Do not lose user work on refresh/crash — autosave.
+- Do not ship the editor without lazy-loading (it's large).
+- Do not strip vendored license/attribution.
+
+## Acceptance
+- [ ] GLB import→edit→export→re-import round-trips faithfully on real models.
+- [ ] Editor wrapped in native three.ws chrome/theme; consistent controls.
+- [ ] Save/load to account with gallery, autosave, and designed states.
+- [ ] Editor bundle lazy-loaded; large scenes don't lock the UI.
+- [ ] Import from forge/avatars + export to viewer/profile/share wired.
+- [ ] Shareable/embeddable scene pages; attribution preserved; round-trip tests green.
diff --git a/prompts/prod/21-avatar-creator-character-studio.md b/prompts/prod/21-avatar-creator-character-studio.md
new file mode 100644
index 000000000..5c1d6b622
--- /dev/null
+++ b/prompts/prod/21-avatar-creator-character-studio.md
@@ -0,0 +1,58 @@
+# 21 — Avatar creator / Character Studio
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 2 — Product surface completeness
+**Owns:** `character-studio/`, `avatar-sdk/` (viewer + React creator), `pages/avatar-*.html`, `pages/create*.html`, animation pipeline (`public/animations/`, `src/glb-canonicalize.js`, `src/animation-retarget.js`).
+**Depends on:** `10`, `12`, `13`. Pairs with `15`, `17`, `19`.
+
+## Why this matters for $1B
+The avatar is the atomic unit of the platform — every agent, every wallet, every
+launch starts with one. Creating an avatar must be fast, joyful, and produce a rigged,
+animated, usable model that flows into the rest of the product.
+
+## Map
+- Full creator app: `character-studio/` (fork of M3-org/CharacterStudio, MIT — keep
+ attribution). Viewer + React creator: `avatar-sdk/` (`@three-ws/avatar`,
+ `<agent-3d>` web component, `/react` `/creator` subpaths).
+- Pages: `avatar-edit/page/embed/studio`, `create*`, `create-selfie`, `creating`.
+- Animation universality: `/CLAUDE.md` "Avatar animation is universal — no rig
+ allowlist"; mappings in `src/glb-canonicalize.js` (cover new skeletons in
+ `tests/glb-canonicalize.test.js`), retarget in `src/animation-retarget.js`.
+
+## Do this
+1. **Creation paths:** every entry (build from parts, from a selfie, from forge,
+ upload your own GLB) works end-to-end and yields a rigged, animated avatar.
+ Reconcile the many `create*` pages — remove dead/duplicate flows, keep the canonical
+ ones reachable (prompt `02`).
+2. **Rig universality:** any humanoid upload drives the canonical clip library (idle/
+ walk, legs included) via bone-name canonicalization; new skeleton conventions get a
+ mapping + test case — never a curated allowlist, never a bind-pose T-pose. Verify
+ with avatars from several sources (Mixamo, Avaturn, VRM, Ready-Player-like).
+3. **Editor UX:** native three.ws chrome/theme (prompt `13`); real-time preview;
+ accessible controls; mobile-aware (prompt `11`). Character-studio fork wrapped so
+ it feels first-party.
+4. **Save & ownership:** saving creates an owned agent + custodial wallet (per the
+ ownership model); editing someone else's forks correctly (fresh wallet, lineage).
+ Designed empty/loading/error states (prompt `12`).
+5. **Output & cross-wiring:** finished avatar flows to: agent profile, walk/tour guide,
+ marketplace listing, embed (`<agent-3d>`), and launch. Wire each connection.
+6. **Performance:** lazy-load the heavy creator; compress exported GLBs; smooth on
+ mid-tier devices (prompt `10`).
+7. **SDK quality:** `avatar-sdk` builds, documented, with working web-component +
+ React examples (`examples/`); publish-ready (prompt `24`).
+8. Tests: extend `tests/glb-canonicalize.test.js` for any new rig; save→own→fork
+ invariants; viewer render.
+
+## Must-not
+- Do not hardcode a rig allowlist — extend `glb-canonicalize.js` + add a test case.
+- Do not let any humanoid fall back to a T-pose.
+- Do not copy wallet secrets on fork; do not strip the CharacterStudio MIT attribution.
+
+## Acceptance
+- [ ] Every creation path produces a rigged, animated, owned avatar; dead create-flows removed.
+- [ ] Humanoids from multiple rig sources animate (legs included); new skeletons covered by tests.
+- [ ] Creator feels first-party (theme/chrome), accessible, mobile-aware.
+- [ ] Save creates owned agent + wallet; fork mints fresh wallet + lineage.
+- [ ] Avatar flows into profile/tour/marketplace/embed/launch.
+- [ ] avatar-sdk builds + documented + examples; canonicalize/ownership tests green.
diff --git a/prompts/prod/22-pumpfun-and-three-token.md b/prompts/prod/22-pumpfun-and-three-token.md
new file mode 100644
index 000000000..0ba1b7701
--- /dev/null
+++ b/prompts/prod/22-pumpfun-and-three-token.md
@@ -0,0 +1,59 @@
+# 22 — Pump.fun launch & $THREE surfaces
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 2 — Product surface completeness
+**Owns:** `api/pump/*`, `pump-fun-skills/`, `packages/pumpfun-mcp/`, `packages/three-token-mcp/`, `pages/bulk-launch.html`, launch feeds, $THREE surfaces, sniper/oracle workers.
+**Depends on:** `06`, `07`, `08`, `18`. Pairs with `16`, `17`.
+
+## Why this matters for $1B
+The launch + token economy is a major engagement and revenue surface, and $THREE is
+the platform's only coin and a core narrative. These surfaces must be rock-solid,
+honest, and strictly compliant with the one-coin rule.
+
+## Map
+- Launch backend: `api/pump/*`, `pump-fun-skills/`. Bulk: `pages/bulk-launch.html`.
+ Launch feed: `/launches`, `/api/pump/launches` over `pump_agent_mints`. MCP:
+ `packages/pumpfun-mcp/`, `packages/three-token-mcp/`. Snapshot: `pump_snapshot` tool.
+- Workers: `worker:oracle`, `worker:sniper` (`workers/`), deploy via `deploy:sniper`.
+- **$THREE only.** CA `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`. Two
+ runtime-data exceptions only: (1) generic launcher accepting a user-supplied mint at
+ runtime; (2) platform launch directories rendering user-launched mints from our own
+ records. Never hardcode/market/recommend any non-$THREE mint anywhere.
+
+## Do this
+1. **Coin-rule audit FIRST:** grep the whole surface (code, copy, tests, fixtures,
+ metadata) for any coin reference that isn't $THREE or a clearly-synthetic
+ placeholder. Remove every one — treat like a leaked secret. Confirm the two
+ runtime exceptions are the *only* places non-$THREE mints appear, and only from
+ live records / user input.
+2. **Launch flow:** create/launch end-to-end with real pump.fun integration and real
+ payment (prompt `18`); honest progress and confirmation; idempotent so a retry
+ never double-launches. Designed states (prompt `12`).
+3. **Bulk launch:** `bulk-launch.html` handles batches with per-item status, partial
+ failure recovery, and clear accounting — no silent drops.
+4. **Launch feed:** `/launches` + agent-profile launch history render real records
+ from `pump_agent_mints`; link to agent profiles (prompt `17`); designed empty state.
+5. **$THREE surfaces:** any $THREE price/holders/snapshot data is real (via
+ `pump_snapshot`/RPC), resilient (prompt `06`), and never fabricated. Token-gating
+ (if used) checks real balances.
+6. **Workers:** oracle + sniper run reliably with the resilience patterns (timeouts,
+ retries, circuit-breakers), proper logging/alerting (prompt `25`), and safe
+ shutdown. Never blind-retry trades (idempotency, prompt `07`).
+7. **MCP tools:** `pumpfun-mcp` + `three-token-mcp` build, are documented, return
+ correct structured output, and are smoke-tested (`smoke:mcp`).
+8. Tests: launch idempotency, feed rendering, coin-rule grep as a CI guard.
+
+## Must-not
+- Do not reference, hardcode, market, or recommend any coin other than $THREE
+ anywhere outside the two runtime-data exceptions.
+- Do not paste any real third-party mint/creator/holder address in tests/fixtures.
+- Do not double-launch or blind-retry trades.
+
+## Acceptance
+- [ ] Coin-rule grep clean; non-$THREE mints appear only in the two runtime exceptions; CI guard added.
+- [ ] Launch + bulk-launch end-to-end, idempotent, with honest states and partial-failure recovery.
+- [ ] Launch feed renders real records and links to profiles; designed empty state.
+- [ ] $THREE data real + resilient; token-gating checks real balances.
+- [ ] Oracle + sniper workers resilient, logged/alerted, idempotent.
+- [ ] pumpfun-mcp + three-token-mcp build + documented + smoke-tested; tests green.
diff --git a/prompts/prod/23-mcp-servers-production.md b/prompts/prod/23-mcp-servers-production.md
new file mode 100644
index 000000000..c7c8052d8
--- /dev/null
+++ b/prompts/prod/23-mcp-servers-production.md
@@ -0,0 +1,59 @@
+# 23 — MCP servers, production-ready
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 2 — Product surface completeness
+**Owns:** `mcp-server/`, `mcp-bridge/`, `packages/*-mcp/` (avatar-agent, pumpfun, ibm-watsonx, ibm-x402, three-token, threews-avatar), the 3d-agent MCP tool surface.
+**Depends on:** `06`, `07`, `08`, `18`. Pairs with `24`.
+
+## Why this matters for $1B
+MCP is how every AI agent in the world plugs into three.ws. A clean, paid, discoverable
+MCP surface makes the platform infrastructure other products build on — the highest-
+multiple position to occupy. The free `forge_free` lane is the wedge.
+
+## Map
+- Servers: `mcp-server/` (`@three-ws/mcp-server`), `mcp-bridge/`, and the
+ `packages/*-mcp/` set. Tooling: `npm run audit:mcp`, `smoke:mcp`, `test:mcp`,
+ `publish:mcp`(`:dry`).
+- Tool surface (3d-agent-local): `forge_free` (free), `text_to_avatar`, `mesh_forge`,
+ `rig_mesh`, `forge_avatar`, `ens_sns_resolve`, `agent_delegate_action`,
+ `sentiment_pulse`, `get_pose_seed`, `pump_snapshot`, `agent_reputation`,
+ `vanity_grinder`, `aixbt_intel`, `aixbt_projects`, AgenC reads. Paid tools quote USDC
+ and require an x402 payment payload in `_meta` (v2 transport); missing payment →
+ `PaymentRequired` structuredContent.
+
+## Do this
+1. **Spec conformance:** every server speaks current MCP transport correctly; each
+ tool has accurate name, description (incl. USDC price for paid), and a strict input
+ schema with validation. Errors return proper MCP error shapes, never crashes.
+2. **Free vs paid:** `forge_free` works with no wallet/key and returns a GLB URL +
+ viewer link. Paid tools return correct `PaymentRequired` structuredContent without
+ payment and fulfill correctly with a valid x402 payload (prompt `18`). Server-side
+ price authority (prompt `07`).
+3. **Resilience & limits:** every tool wraps its upstreams with timeouts/retries
+ (prompt `06`) and is rate-limited/abuse-guarded (prompt `08`). No tool can hang a
+ client.
+4. **Discoverability:** tools/servers are discoverable (bazaar/x402 indexing, memory
+ note `x402-discovery-indexing`); a public catalog page lists them with prices and
+ examples.
+5. **Docs & examples:** each server has a README with install + config (Claude Desktop/
+ Code config snippet), env requirements, and a runnable example per tool. Keep
+ `STRUCTURE.md` + `PUBLISHING.md` accurate.
+6. **Audit/smoke/tests:** `npm run audit:mcp`, `smoke:mcp`, `test:mcp` all pass and
+ run in CI. Add coverage for the payment-required path and schema validation.
+7. **Publish-readiness:** `publish:mcp:dry` clean; versions, `files`, and metadata
+ correct for every published `@three-ws/*-mcp` (coordinate with prompt `24`).
+
+## Must-not
+- Do not let a missing payment return a fake success — return `PaymentRequired`.
+- Do not trust client-sent prices; server is the price authority.
+- Do not ship a tool whose upstream can hang the client without a timeout.
+- Do not reference any coin other than $THREE in tool copy/output (runtime user mints excepted).
+
+## Acceptance
+- [ ] Every server spec-conformant; every tool validated input + proper error shapes.
+- [ ] forge_free works keyless; paid tools enforce x402 with correct PaymentRequired + fulfillment.
+- [ ] All tools have timeouts/retries + rate limiting; none can hang a client.
+- [ ] Public MCP catalog page + per-server README/examples; discovery indexing verified.
+- [ ] `audit:mcp` + `smoke:mcp` + `test:mcp` green in CI, incl. payment-required coverage.
+- [ ] `publish:mcp:dry` clean for all published MCP packages.
diff --git a/prompts/prod/24-sdk-publishing-and-docs.md b/prompts/prod/24-sdk-publishing-and-docs.md
new file mode 100644
index 000000000..3a7c2a0db
--- /dev/null
+++ b/prompts/prod/24-sdk-publishing-and-docs.md
@@ -0,0 +1,55 @@
+# 24 — SDK publishing & docs
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 2 — Product surface completeness
+**Owns:** all published packages — `avatar-sdk/`, `walk-sdk/`, `tour-sdk/`, `page-agent-sdk/`, `sdk/`, `solana-agent-sdk/`, `agent-payments-sdk/`, `agent-protocol-sdk/`, `agent-ui-sdk/`, `packages/*`.
+**Depends on:** `15`, `18`, `19`, `21`, `23`. Pairs with `34`.
+
+## Why this matters for $1B
+Every SDK someone installs is a distribution endpoint and a lock-in surface. A
+platform valued at $1B has SDKs that "just work" — installable, typed, documented,
+versioned, with copy-paste examples. Developer trust is earned in the first 5 minutes.
+
+## Map
+- npm workspaces + top-level SDKs (see `STRUCTURE.md`). Publish scripts:
+ `publish:packages`(`:dry`), `publish:lib`, `publish:mcp`(`:dry`), `release:lib`.
+ Promotion path + publishing notes in `STRUCTURE.md`, `page-agent-sdk/PUBLISHING.md`.
+
+## Do this
+1. **Build integrity:** every package builds cleanly from a fresh install
+ (`npm ci`), with correct `main`/`module`/`exports`/`types`, `files` allowlist
+ (no source-only leakage, no junk), and working ESM/CJS as declared.
+2. **Types:** ship accurate type declarations (`.d.ts`) for every public API. No
+ `any`-leaks at the boundary. `npm run typecheck` clean.
+3. **Versioning:** consistent semver, accurate `peerDependencies`, no phantom/extra
+ deps, deduped lockfile. Confirm `publish:packages:dry` and `publish:mcp:dry` are
+ clean for all.
+4. **READMEs:** every package has a README with: what it is, install, a 30-second
+ quickstart that actually runs, the full API surface, framework variants (web
+ component + React for avatar; embed snippets for walk/tour/page-agent), and a link
+ to live examples.
+5. **Examples:** `examples/` has a runnable example per SDK (web component, React,
+ two-agents, minimal, embed). Each is exercised and works against the live site.
+6. **Changelogs:** each published package has a CHANGELOG; an SDK release also gets a
+ holder-facing entry in `data/changelog.json` (tag `sdk`).
+7. **CDN/embed:** the script-tag/CDN embed paths (avatar viewer, walk companion, page
+ agent) are documented with integrity-pinned snippets that work copy-paste.
+8. **License/attribution:** licenses present and correct; forks (CharacterStudio,
+ three.js editor) keep upstream attribution.
+9. Do a real consumer test: in a scratch project outside the repo, `npm install` the
+ packed tarball (`npm pack`) and run each quickstart. Fix anything that doesn't work.
+
+## Must-not
+- Do not publish a package whose quickstart doesn't run as written.
+- Do not leak source/test files or secrets via a missing `files` allowlist.
+- Do not reference any coin other than $THREE in SDK docs/examples.
+
+## Acceptance
+- [ ] Every package builds from `npm ci`; correct exports/types/files; ESM/CJS as declared.
+- [ ] Accurate `.d.ts` for all public APIs; typecheck clean.
+- [ ] Consistent semver + correct peer deps; `publish:*:dry` clean.
+- [ ] Every package README has a runnable quickstart + full API + example links.
+- [ ] One runnable example per SDK in `examples/`, exercised against live.
+- [ ] `npm pack` → install-in-scratch-project quickstart works for each SDK.
+- [ ] SDK release changelog entries added (tag `sdk`).
diff --git a/prompts/prod/25-observability-logging-metrics.md b/prompts/prod/25-observability-logging-metrics.md
new file mode 100644
index 000000000..0f0f32d1c
--- /dev/null
+++ b/prompts/prod/25-observability-logging-metrics.md
@@ -0,0 +1,57 @@
+# 25 — Observability (logging, metrics, error tracking)
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 3 — Scale & infra
+**Owns:** `api/`, `workers/`, `public/error-reporter.js`, logging/metrics/tracing infra.
+**Depends on:** `06`, `08`. Pairs with `27`, `28`.
+
+## Why this matters for $1B
+You cannot operate or scale what you cannot see. At $1B-trajectory volume, you need to
+know within seconds when payments fail, RPC degrades, or a deploy regresses. Observable
+systems are the difference between a 5-minute incident and a 5-hour one.
+
+## Mission
+End-to-end observability: structured logs, error tracking with alerting, key business
++ system metrics on dashboards, and request tracing across api/workers.
+
+## Map
+- `public/error-reporter.js` already captures client runtime errors — wire it into a
+ real sink and dedupe/group. Backend handlers in `api/`, workers in `workers/`.
+- Prefer a vetted OSS/SaaS sink (Sentry-class for errors, an OTEL-compatible metrics/
+ trace backend) over hand-rolling. Additive — don't churn working handlers.
+
+## Do this
+1. **Structured logging:** adopt one structured logger (JSON) across `api/` + workers
+ with a request id, route, latency, status, and identity (no secrets/PII — prompt
+ `05`/`07`). Replace ad-hoc `console.log`. Log levels respected per env.
+2. **Error tracking:** server + client errors flow to an error tracker with source
+ maps, grouping, release tagging, and alerting on new/spiking errors. Wire
+ `error-reporter.js` to it. Confirm the happy path is silent.
+3. **Metrics:** instrument the metrics that matter — request rate/latency/error per
+ route, payment success/failure + GMV, generation jobs (queued/succeeded/failed/
+ p95 duration), RPC/AI upstream latency + error + spend, rate-limit hits, signups/
+ activations. Cost meters per paid upstream (ties to prompt `08`).
+4. **Tracing:** propagate a request/trace id through API → upstreams → workers so a
+ slow payment can be traced end-to-end.
+5. **Dashboards:** a system dashboard (latency/errors/saturation/cost) and a business
+ dashboard (signups, activation, GMV, generations, MCP calls). Document where they
+ live in `docs/`.
+6. **Alerting:** actionable alerts (not noise) for: payment failure rate, 5xx spike,
+ upstream-spend approaching cap, worker down, error spike, latency SLO breach.
+ Route to the right channel; define ownership/runbook links.
+7. **SLOs:** define SLOs for the critical paths (checkout, forge, page load) and track
+ error budgets.
+
+## Must-not
+- Do not log secrets, private keys, or PII.
+- Do not alert on everything — every alert must be actionable.
+- Do not hand-roll a metrics backend when a vetted one fits.
+
+## Acceptance
+- [ ] One structured logger across api + workers with request ids; no secret/PII logging.
+- [ ] Server + client errors flow to a tracker with source maps, grouping, alerting.
+- [ ] Key system + business metrics instrumented, incl. per-upstream cost meters.
+- [ ] Trace ids propagate API → upstream → worker.
+- [ ] System + business dashboards exist and are documented.
+- [ ] Actionable alerts with runbooks; SLOs defined for critical paths.
diff --git a/prompts/prod/26-database-integrity-and-migrations.md b/prompts/prod/26-database-integrity-and-migrations.md
new file mode 100644
index 000000000..8da191b0a
--- /dev/null
+++ b/prompts/prod/26-database-integrity-and-migrations.md
@@ -0,0 +1,58 @@
+# 26 — Database integrity & migrations
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 3 — Scale & infra
+**Owns:** DB schema/migrations (`npm run db:migrate`, `db:status`), data-access in `api/_lib/`, tables like `agent_identities`, `pump_agent_mints`, skill/license/purchase tables.
+**Depends on:** `05`, `07`. Pairs with `18`, `27`.
+
+## Why this matters for $1B
+Data integrity is existential when the data is wallets, ownership, and money. Corrupt
+or lost data destroys trust and is often unrecoverable. Clean migrations let you ship
+fast without breaking production.
+
+## Mission
+A documented, versioned schema with safe forward-migrations, enforced integrity
+constraints, backups with tested restore, and no orphaned or inconsistent records.
+
+## Map
+- Migration tooling: `npm run db:migrate`, `npm run db:status`. Data access in
+ `api/_lib/`. Core invariants: `agent_identities.user_id` immutable, one agent = one
+ owner; launch records in `pump_agent_mints`; skill/license/purchase records.
+
+## Do this
+1. **Schema audit:** document every table, column, type, and relationship in
+ `docs/data-model.md`. Identify missing constraints: primary keys, foreign keys,
+ uniqueness (e.g. one wallet per agent), not-null, check constraints (amount ≥ 0),
+ and indexes on hot query paths.
+2. **Add the constraints** that enforce the invariants the app assumes — especially
+ the ownership and money invariants (prompt `07`). Backfill/clean any existing rows
+ that would violate them first.
+3. **Migrations:** ensure every schema change goes through a versioned, ordered,
+ idempotent migration; `db:status` reflects reality; migrations are forward-safe and
+ reversible where possible. No manual prod schema edits.
+4. **Integrity sweep:** scan for orphans (records pointing to deleted parents),
+ duplicates, and inconsistent states (purchase confirmed but no license; mint
+ recorded but no agent). Fix the data and add the constraint/job that prevents
+ recurrence.
+5. **Transactions:** money/ownership mutations that touch multiple rows run in
+ transactions so they can't partially apply (ties to prompt `18` idempotency).
+6. **Backups & restore:** confirm automated backups exist, are encrypted, and — most
+ importantly — **test a restore** into a scratch environment. Document RPO/RTO.
+7. **Performance:** add indexes for slow queries surfaced by observability (prompt
+ `25`); paginate large reads (prompt `10`).
+8. Add data-integrity tests/checks that can run against a seeded DB in CI.
+
+## Must-not
+- Do not edit production schema outside a migration.
+- Do not add a destructive migration without a tested backup and a reversal plan.
+- Do not weaken an invariant constraint to make a write succeed — fix the write.
+
+## Acceptance
+- [ ] `docs/data-model.md` documents schema + relationships.
+- [ ] Integrity constraints (PK/FK/unique/not-null/check) + hot-path indexes added; offending data cleaned.
+- [ ] All schema changes are versioned, idempotent migrations; `db:status` accurate.
+- [ ] Orphan/duplicate/inconsistent-state sweep clean; preventer in place.
+- [ ] Multi-row money/ownership mutations are transactional.
+- [ ] Backups verified by a successful test restore; RPO/RTO documented.
+- [ ] Data-integrity checks runnable in CI.
diff --git a/prompts/prod/27-deploy-pipeline-and-rollback.md b/prompts/prod/27-deploy-pipeline-and-rollback.md
new file mode 100644
index 000000000..c76a1c762
--- /dev/null
+++ b/prompts/prod/27-deploy-pipeline-and-rollback.md
@@ -0,0 +1,57 @@
+# 27 — Deploy pipeline & rollback safety
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 3 — Scale & infra
+**Owns:** `vercel.json`, build scripts (`build`, `build:vercel`, `build:all`), `deploy/`, CI/CD, `npm run audit:deploy`, the two git remotes.
+**Depends on:** `01`, `05`, `25`. Pairs with `28`.
+
+## Why this matters for $1B
+Shipping safely and reverting instantly is what lets a team move fast without breaking
+trust. A bad deploy that can't be rolled back is an outage. Repeatable, gated deploys
+are an engineering-maturity signal in diligence.
+
+## Map
+- `vercel.json` (buildCommand, outputDirectory, installCommand, env, functions,
+ routes, crons). Build pipeline scripts in `package.json`. `npm run audit:deploy`.
+- **Two remotes** (`/CLAUDE.md`): `threeD` (push-only mirror) + `threews` (canonical).
+ Never pull/fetch/merge from `threeD`. Watch the `npx vercel build` trap that
+ overwrites `api/*.js` in place — guard against committing esbuild bundles.
+
+## Do this
+1. **Reproducible build:** `npm ci` from a clean tree builds deterministically;
+ document the exact build/deploy steps in `docs/deploy.md`. Confirm `audit:deploy`
+ passes and what it checks.
+2. **Pipeline gates:** deploys to production require green lint + typecheck + tests
+ (prompt `01`). Wire CI so `main` deploys only on green; PRs get preview deploys.
+3. **Source-bundle trap guard:** add a pre-commit/CI check that fails if any committed
+ `api/*.js` or `public/*` begins with esbuild markers (`__defProp`/`createRequire`),
+ per the known trap. Document the recovery (`git restore -- api/ public/`).
+4. **Both-remotes discipline:** document and (where possible) script the dual push
+ (`threeD` + `threews`) so neither deploy target falls behind; never force-push;
+ never pull from `threeD`.
+5. **Migrations in deploy:** DB migrations (prompt `26`) run as an ordered, gated step
+ with a clear order relative to code deploy (backward-compatible migrate → deploy →
+ cleanup). No deploy that assumes an unrun migration.
+6. **Rollback:** verify instant rollback to the previous good deployment works (Vercel
+ promote/rollback), and document the exact steps + when to use it. Practice one.
+7. **Crons:** audit `vercel.json` crons (incl. the auto-rig sweep) — each has a clear
+ purpose, idempotency, failure alerting (prompt `25`), and won't stampede.
+8. **Env parity:** preview/staging mirrors prod env keys (prompt `05`); no
+ prod-only surprises.
+9. **Post-deploy smoke:** an automated post-deploy smoke (`smoke:onchain`,
+ `smoke:mcp`, key page loads) gates promotion and pages on failure.
+
+## Must-not
+- Do not commit esbuild-bundled `api/*.js` source (run the guard).
+- Do not pull/fetch/merge from `threeD`; do not force-push either remote.
+- Do not deploy code that depends on an unrun migration.
+
+## Acceptance
+- [ ] `docs/deploy.md` documents reproducible build + deploy + rollback steps.
+- [ ] Production deploy gated on green CI; PRs get previews.
+- [ ] CI guard blocks committed esbuild-bundled source files.
+- [ ] Dual-remote push documented/scripted; no pulls from `threeD`.
+- [ ] Migrations run as a gated, ordered, backward-compatible step.
+- [ ] Rollback verified by an actual practice run; documented.
+- [ ] Crons audited (purpose/idempotency/alerting); post-deploy smoke gates promotion.
diff --git a/prompts/prod/28-uptime-monitoring-and-status-page.md b/prompts/prod/28-uptime-monitoring-and-status-page.md
new file mode 100644
index 000000000..afcd045d7
--- /dev/null
+++ b/prompts/prod/28-uptime-monitoring-and-status-page.md
@@ -0,0 +1,55 @@
+# 28 — Uptime monitoring & public status page
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 3 — Scale & infra
+**Owns:** health-check endpoints in `api/`, external uptime monitoring, a public status page.
+**Depends on:** `25`. Pairs with `27`, `29`.
+
+## Why this matters for $1B
+Enterprise buyers and serious developers expect a status page and a track record of
+uptime. Knowing about outages before users do — and being transparent when they
+happen — builds the trust a platform handling money requires.
+
+## Mission
+Real health checks for every critical dependency, external synthetic monitoring of
+the user-critical flows, and a public status page with incident history.
+
+## Map
+- Add/confirm health endpoints under `api/` (e.g. `/api/health`, `/api/health/deep`).
+- Critical deps to probe: DB (prompt `26`), Solana RPC, pump.fun feed, AI worker
+ proxies, x402 facilitator, R2/CDN for GLBs.
+- Observability sinks from prompt `25` feed the monitors/alerts.
+
+## Do this
+1. **Health endpoints:** a fast liveness check and a deeper readiness check that
+ verifies each critical dependency (DB connectivity, RPC reachable, AI proxy up,
+ payment facilitator up) and returns a structured per-dependency status. No secrets
+ in output.
+2. **Synthetic monitoring:** external uptime checks (multi-region) for the homepage,
+ forge generate path, a sample MCP call, and a checkout prepare — i.e. the flows
+ that lose money/users when down, not just "is the site up."
+3. **Alerting:** down/degraded triggers the on-call alert (prompt `25`) with the
+ failing dependency named. Distinguish degraded (one dep slow) from down.
+4. **Public status page:** a branded status page (own page or a vetted provider) showing
+ component status (web, forge, payments, MCP, launches), uptime history, and incident
+ posts. Linkable from the footer.
+5. **Incident process:** document a lightweight incident runbook in `docs/`: detect →
+ declare → communicate (status page) → mitigate → resolve → postmortem. Templates
+ included.
+6. **Cron/worker liveness:** monitor the crons + workers (oracle/sniper, auto-rig
+ sweep) — alert if a scheduled run is missed or fails (prompt `27`).
+
+## Must-not
+- Do not expose secrets, internal hostnames, or stack details in health output.
+- Do not let the deep health check be so heavy it becomes a self-inflicted load source
+ — rate-limit/cache it.
+- Do not alert without naming the failing component.
+
+## Acceptance
+- [ ] Liveness + deep readiness endpoints report per-dependency status, no leaks.
+- [ ] External multi-region synthetic checks cover homepage, forge, MCP, checkout.
+- [ ] Down/degraded alerts fire with the failing dependency named.
+- [ ] Public branded status page with component status + uptime + incident history, linked in footer.
+- [ ] Incident runbook + templates in `docs/`.
+- [ ] Cron/worker liveness monitored with missed-run alerts.
diff --git a/prompts/prod/29-load-and-stress-testing.md b/prompts/prod/29-load-and-stress-testing.md
new file mode 100644
index 000000000..d2f3a3ad3
--- /dev/null
+++ b/prompts/prod/29-load-and-stress-testing.md
@@ -0,0 +1,60 @@
+# 29 — Load & stress testing
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 3 — Scale & infra
+**Owns:** load-test harness (in `scripts/` or `tests/load/`), `api/`, `workers/`, caching/CDN config.
+**Depends on:** `06`, `08`, `25`, `26`. Pairs with `27`, `28`.
+
+## Why this matters for $1B
+A platform that goes viral and falls over wasted the moment. You need to know the real
+ceiling of each critical path, where it breaks first, and that autoscaling + rate
+limits + caching hold under a launch-day spike. Capacity confidence is fundability.
+
+## Mission
+Establish load profiles for the critical paths, find the breaking points, fix the
+first bottlenecks, and document headroom + scaling behavior.
+
+## Map
+- Critical paths: homepage + key pages (static/CDN), forge generation (expensive,
+ upstream-bound), checkout/x402 (money, DB + RPC), MCP tool calls, launch feed reads,
+ agent profile reads.
+- Use a vetted tool (k6 / Artillery). Run against a staging/preview env, never prod,
+ with synthetic data — and **never** real third-party mints (prompt `22`).
+
+## Do this
+1. **Define profiles:** realistic mixes — steady-state, a marketing-spike ramp, and a
+ sustained soak — with target RPS/concurrency per path based on growth goals.
+2. **Build the harness** in `scripts/` or `tests/load/` (kept, documented, not
+ throwaway), parameterized by env + RPS, with auth handled. Cover read paths and at
+ least one safe write path (idempotent, against staging).
+3. **Run & measure:** capture p50/p95/p99 latency, error rate, throughput, and
+ upstream/DB saturation (via prompt `25` dashboards). Identify the first bottleneck
+ on each path.
+4. **Fix the top bottlenecks:** add/verify caching (CDN for static + GLBs, query
+ caching for hot reads), connection pooling/limits for DB + RPC, queueing/
+ backpressure for generation, and confirm rate limits (prompt `08`) shed load
+ gracefully instead of collapsing.
+5. **Autoscaling:** verify serverless function concurrency limits and worker scaling
+ behave under spike; no cold-start cliff on the money path; no unbounded fan-out to
+ a single RPC node.
+6. **Failure-mode under load:** confirm that when an upstream degrades under load, the
+ resilience patterns (prompt `06`) and circuit breakers keep the rest of the site up
+ (graceful degradation, designed error states — prompt `12`).
+7. **Document capacity:** record measured headroom per path, the breaking point, and
+ the scaling levers in `docs/capacity.md`. Set alert thresholds (prompt `28`) below
+ the breaking point.
+
+## Must-not
+- Do not load-test production or use real third-party mints/addresses.
+- Do not "fix" a bottleneck by removing a rate limit or a safety check.
+- Do not leave the harness as an undocumented throwaway in the repo root (use `scripts/`).
+
+## Acceptance
+- [ ] Documented load profiles (steady/spike/soak) with growth-based targets.
+- [ ] Repeatable, parameterized load harness in `scripts/` or `tests/load/`.
+- [ ] p50/p95/p99 + error rate + saturation measured per critical path; bottlenecks identified.
+- [ ] Top bottlenecks fixed (caching, pooling, queueing); rate limits shed load gracefully.
+- [ ] Autoscaling verified under spike; no cold-start cliff on checkout.
+- [ ] Graceful degradation confirmed when an upstream fails under load.
+- [ ] `docs/capacity.md` records headroom, breaking points, levers; alerts set below them.
diff --git a/prompts/prod/30-onboarding-and-activation.md b/prompts/prod/30-onboarding-and-activation.md
new file mode 100644
index 000000000..1bc95a23e
--- /dev/null
+++ b/prompts/prod/30-onboarding-and-activation.md
@@ -0,0 +1,52 @@
+# 30 — Onboarding & activation funnel
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 4 — Growth
+**Owns:** first-run experience across `pages/`, signup/auth, the path from landing → first "aha", `src/feature-tour/`, empty states.
+**Depends on:** `12`, `15`, `19`. Pairs with `31`, `33`.
+
+## Why this matters for $1B
+Activation rate — the share of new users who reach the "aha" (a forged 3D model, a
+created agent) — is the single biggest lever on growth-loop velocity and therefore
+valuation. Most signups are won or lost in the first 60 seconds.
+
+## Mission
+Design and build a first-run experience that gets a brand-new visitor to a real,
+shareable "aha" moment as fast as possible, with zero confusion and zero dead ends.
+
+## Do this
+1. **Define the aha + the funnel:** pick the primary activation event (likely: first
+ forged/created 3D model, or first agent). Map every step from landing →
+ aha and instrument each (prompt `33`) to find drop-off.
+2. **Reduce time-to-value:** let users experience the magic *before* signup where
+ possible (the free `forge_free` lane, the live tour) — capture the account *after*
+ they've felt value, not before. No wall in front of the wow.
+3. **Guided first run:** a focused, skippable first-run flow (lean on the feature tour,
+ prompt `19`) that points at the one next action, not a feature dump. Progressive
+ disclosure.
+4. **Empty states as onboarding:** every first-visit empty state (profile, wallet,
+ marketplace, dashboard) teaches the next step with a working CTA (prompt `12`).
+5. **Account creation:** frictionless auth; if a custodial wallet is provisioned,
+ explain it simply and reassuringly. Clear value for signing up.
+6. **First-win reinforcement:** when the user hits the aha, celebrate it and offer the
+ natural next step (share it, list it, make another, give it a wallet) — chain into
+ the growth loop (prompt `35`).
+7. **Re-engagement:** a sensible welcome/first-steps message (email/notification per
+ prompt `39`) for users who leave before activating.
+8. **Measure:** activation rate, time-to-aha, and step drop-off visible on the growth
+ dashboard (prompt `25`/`33`). Set a baseline and a target.
+
+## Must-not
+- Do not gate the core "wow" behind signup if a no-account path exists.
+- Do not dump every feature on a new user — one next action at a time.
+- Do not ship empty states that are dead ends.
+
+## Acceptance
+- [ ] Activation event defined; full landing→aha funnel instrumented with drop-off visibility.
+- [ ] A no-signup path to the core wow exists; account captured after value.
+- [ ] Skippable guided first-run points at one next action; progressive disclosure.
+- [ ] Every first-visit empty state teaches + has a working CTA.
+- [ ] First-win celebration chains into share/create-again/wallet.
+- [ ] Re-engagement message for pre-activation drop-offs.
+- [ ] Activation rate + time-to-aha tracked with a baseline and target.
diff --git a/prompts/prod/31-home-and-landing-conversion.md b/prompts/prod/31-home-and-landing-conversion.md
new file mode 100644
index 000000000..5b56dfc6a
--- /dev/null
+++ b/prompts/prod/31-home-and-landing-conversion.md
@@ -0,0 +1,57 @@
+# 31 — Home / landing conversion
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 4 — Growth
+**Owns:** `pages/home.html`, top-of-funnel landing pages, hero, primary CTAs, social proof.
+**Depends on:** `10`, `13`, `14`. Pairs with `30`, `33`.
+
+## Why this matters for $1B
+The homepage is the highest-traffic, highest-leverage page. A few points of conversion
+lift compounds across every channel. It must instantly communicate what three.ws is,
+why it's special, and what to do next — and it must be screenshot-worthy.
+
+## Map
+- `pages/home.html` (currently modified in the working tree — review before editing).
+ Pulls from `data/features.json` / `public/features.json`. Global tokens (prompt
+ `13`).
+
+## Do this
+1. **Message clarity:** above the fold answers "what is this / who is it for / why
+ care" in one glance, with a single dominant CTA toward the activation event (prompt
+ `30`). No jargon, no ambiguity.
+2. **Show, don't tell:** lead with the product's magic — a live, interactive 3D
+ moment (a real model the visitor can orbit, the walking guide, a forge demo) rather
+ than a static screenshot. It must load fast (prompt `10`) and never block first
+ paint.
+3. **Proof:** real social proof — usage numbers, notable creations, launches, SDK
+ installs, testimonials — all truthful and live where possible. No fabricated
+ metrics.
+4. **Narrative flow:** the page tells a story — magic → how it works → what you can
+ build (forge, agents, marketplace, SDKs) → proof → CTA. Each section links into the
+ relevant surface (cross-wiring, `/CLAUDE.md`).
+5. **CTAs everywhere sensible:** primary CTA repeated at natural decision points;
+ secondary paths (developers → SDKs/docs, traders → launches, creators →
+ marketplace) routed clearly.
+6. **Polish to screenshot bar:** microinteractions, gradients, motion-with-intent
+ (reduced-motion safe), perfect spacing/type (prompt `13`), flawless on mobile
+ (prompt `11`) and both themes.
+7. **Performance + SEO:** great LCP/CLS (prompt `10`), complete meta + OG + JSON-LD
+ (prompt `14`).
+8. **Experiment-ready:** structure the hero/CTA so they can be A/B tested (prompt
+ `33`); instrument CTA clicks and scroll depth.
+
+## Must-not
+- Do not show fabricated stats or testimonials.
+- Do not block first paint on the 3D hero — lazy/progressive load it.
+- Do not bury the primary CTA or present competing equal CTAs that paralyze.
+- Do not reference any coin other than $THREE.
+
+## Acceptance
+- [ ] Above-the-fold communicates what/who/why + one dominant CTA at a glance.
+- [ ] Live interactive 3D moment that loads fast and doesn't block first paint.
+- [ ] Truthful, live social proof.
+- [ ] Narrative sections cross-link to forge/agents/marketplace/SDKs.
+- [ ] Screenshot-grade polish; flawless mobile + both themes; reduced-motion safe.
+- [ ] Strong LCP/CLS + complete meta/OG/JSON-LD.
+- [ ] CTA clicks + scroll depth instrumented; hero/CTA A/B-ready.
diff --git a/prompts/prod/32-pricing-and-monetization-surfaces.md b/prompts/prod/32-pricing-and-monetization-surfaces.md
new file mode 100644
index 000000000..000bbf672
--- /dev/null
+++ b/prompts/prod/32-pricing-and-monetization-surfaces.md
@@ -0,0 +1,51 @@
+# 32 — Pricing & monetization surfaces
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 4 — Growth
+**Owns:** pricing page(s), upgrade/paywall surfaces, paid lanes (forge, MCP, skills), `prompts/monetization/` outcomes, billing/receipts.
+**Depends on:** `08`, `16`, `18`, `23`. Pairs with `30`, `33`.
+
+## Why this matters for $1B
+Revenue is the numerator of valuation. Clear pricing, frictionless upgrade, and
+multiple monetization surfaces (paid generation, paid MCP calls, marketplace take,
+skill sales, premium features) are what turn engagement into a $1B business.
+
+## Map
+- Paid lanes already exist: paid MCP tools (USDC via x402, prompt `23`), skill
+ purchases + on-chain licenses (prompt `16`), the free vs paid forge lanes (prompt
+ `15`/`08`). Monetization design work: `prompts/monetization/`.
+
+## Do this
+1. **Pricing page:** a clear, honest pricing page — what's free, what's paid, what
+ each tier/credit unlocks, in plain language. Per-call USDC prices for MCP/forge
+ lanes surfaced. Designed for both human users and agent developers.
+2. **Upgrade moments:** when a user hits a free-lane limit (prompt `08`), present a
+ contextual, non-annoying upgrade with the exact value they're about to get — not a
+ hard wall. Track conversion on these moments.
+3. **Frictionless checkout:** upgrades/credits use the hardened payment flow (prompt
+ `18`) with clear confirmation, instant unlock, and a receipt. No dead ends.
+4. **Monetization surfaces wired:** marketplace take-rate on sales (prompt `16`),
+ paid MCP calls (prompt `23`), paid generation credits (prompt `15`), premium
+ features, and creator payouts — each accounted correctly (prompt `26`) and visible
+ on the business dashboard (prompt `25`).
+5. **Receipts & billing history:** users/creators see their purchases, balances,
+ payouts, and downloadable receipts. Real data, designed empty states.
+6. **Creator economics:** make it obvious how creators earn (sell skills/avatars/
+ scenes, get tipped, launch) and show real earnings — the supply-side flywheel.
+7. **Experiment:** price points and packaging are configurable (not hardcoded across
+ the UI) so they can be tested; instrument upgrade funnel + LTV inputs (prompt `33`).
+
+## Must-not
+- Do not hardcode prices in scattered UI strings — source from one config.
+- Do not hard-wall the core wow; convert with value at the limit instead.
+- Do not show fabricated revenue/earnings; real accounting only.
+- Do not reference any coin other than $THREE (USDC pricing for services is fine).
+
+## Acceptance
+- [ ] Clear, honest pricing page (free vs paid, per-call USDC prices) for users + devs.
+- [ ] Contextual upgrade moments at free-lane limits with conversion tracking.
+- [ ] Frictionless upgrade/credit checkout with instant unlock + receipt.
+- [ ] All monetization surfaces wired + accounted + on the business dashboard.
+- [ ] Receipts/billing history + creator earnings show real data with designed states.
+- [ ] Prices/packaging sourced from one config; upgrade funnel instrumented.
diff --git a/prompts/prod/33-growth-analytics-instrumentation.md b/prompts/prod/33-growth-analytics-instrumentation.md
new file mode 100644
index 000000000..cbb15d39f
--- /dev/null
+++ b/prompts/prod/33-growth-analytics-instrumentation.md
@@ -0,0 +1,56 @@
+# 33 — Growth analytics instrumentation
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 4 — Growth
+**Owns:** product analytics, event taxonomy, funnels, A/B framework, consent/privacy.
+**Depends on:** `25`, `30`, `31`, `32`. Pairs with `35`, `37`.
+
+## Why this matters for $1B
+You can't grow what you don't measure. A clean event taxonomy + funnels + experiment
+framework is how every growth decision (prompts `30`–`35`) gets validated instead of
+guessed. Investors expect to see the funnel and the levers.
+
+## Mission
+Instrument the product with a consistent, privacy-respecting analytics layer: a typed
+event taxonomy, the core funnels, retention/cohort views, and an A/B testing
+capability — all feeding dashboards.
+
+## Map
+- A vetted product-analytics tool (privacy-friendly, e.g. PostHog-class) over
+ hand-rolling. Distinguish from system observability (prompt `25`) — this is product/
+ growth events. Respect consent (prompt `37`).
+
+## Do this
+1. **Event taxonomy:** define a documented, typed event schema (`docs/analytics.md`):
+ consistent names, properties, and identity model (anon → authed stitching). Cover
+ the funnel: landing view, CTA click, signup, first generation, first agent, first
+ purchase, share, return. No ad-hoc one-off event names.
+2. **Funnels:** build the core funnels — acquisition → activation (prompt `30`) →
+ revenue (prompt `32`) → retention → referral (prompt `35`) — with step drop-off
+ visible.
+3. **Retention & cohorts:** D1/D7/D30 retention and cohort curves; identify the
+ behaviors that correlate with retention (the "north-star input" — e.g. created N
+ agents in week 1).
+4. **A/B framework:** a lightweight experiment system (feature-flag + assignment +
+ metric readout) so hero/CTA/pricing/onboarding variants (prompts `30`–`32`) can be
+ tested with statistical rigor. Document how to run an experiment.
+5. **Dashboards:** a growth dashboard (acquisition, activation, retention, revenue,
+ referral, north-star) alongside the system/business dashboards (prompt `25`).
+6. **Privacy & consent:** consent management, IP/PII minimization, honoring
+ do-not-track and opt-out (prompt `37`). No PII in event payloads.
+7. **Validate:** verify events fire correctly across key flows (no double-counting,
+ correct identity stitching) before trusting the numbers.
+
+## Must-not
+- Do not collect PII in events or track without consent where required.
+- Do not invent inconsistent event names per page — follow the taxonomy.
+- Do not ship dashboards built on unvalidated/double-counted events.
+
+## Acceptance
+- [ ] Documented typed event taxonomy + identity model in `docs/analytics.md`.
+- [ ] Core funnels (acq→activation→revenue→retention→referral) with drop-off.
+- [ ] Retention/cohort views + identified north-star input metric.
+- [ ] A/B framework usable for hero/CTA/pricing/onboarding experiments; documented.
+- [ ] Growth dashboard live alongside system/business dashboards.
+- [ ] Consent + PII-minimization in place; events validated for accuracy.
diff --git a/prompts/prod/34-developer-experience-and-docs-site.md b/prompts/prod/34-developer-experience-and-docs-site.md
new file mode 100644
index 000000000..e2ac7308e
--- /dev/null
+++ b/prompts/prod/34-developer-experience-and-docs-site.md
@@ -0,0 +1,55 @@
+# 34 — Developer experience & docs site
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 4 — Growth
+**Owns:** `docs/`, a public docs site, API reference, SDK guides, MCP setup guides, `examples/`, quickstarts.
+**Depends on:** `23`, `24`. Pairs with `14`, `31`.
+
+## Why this matters for $1B
+three.ws is a platform other developers and agents build on. Documentation is the
+product for them. World-class docs (Stripe/Vercel-grade) are a growth channel, a
+moat, and a credibility signal that justifies a platform multiple.
+
+## Mission
+A polished, public developer hub: getting-started, SDK guides, full API + MCP
+reference, runnable examples, and recipes — accurate, searchable, and maintained.
+
+## Map
+- `docs/` (internal + reference), `examples/` (`embed-test`, `web-component`,
+ `two-agents`, `minimal`, etc.), `STRUCTURE.md`, per-package READMEs (prompt `24`),
+ `page-agent-sdk/PUBLISHING.md`, `docs/3d-asset-pipeline.md`.
+
+## Do this
+1. **Docs site:** a public, branded, searchable docs site (own route or a vetted
+ docs framework) with clear IA: Get Started, Guides, SDK Reference, API Reference,
+ MCP, Recipes, Changelog. Themed to match the platform (prompt `13`).
+2. **Quickstarts that run:** a "5-minute" quickstart per primary surface (embed an
+ avatar, add the walk companion, call a paid MCP tool, make an x402 payment, mint
+ an agent). Each is copy-paste and verified to work (prompt `24`).
+3. **API reference:** generate/maintain reference for the public `api/` surface
+ (endpoints, params, auth, errors, examples). Keep it in sync with the code (derive
+ from the handlers where possible, not hand-typed drift).
+4. **MCP setup:** clear setup for Claude Desktop/Code and other clients, the free
+ `forge_free` quickstart as the wedge, and the paid-tool x402 flow (prompt `23`).
+5. **Examples gallery:** `examples/` is curated, each runnable against live, linked
+ from the docs. Add the missing common recipes.
+6. **Consistency & accuracy:** every code sample is tested (a CI check that runs/lints
+ doc snippets where feasible); no stale endpoints/flags (cross-check the codebase
+ before publishing — memory note: verify referenced files/flags still exist).
+7. **Discoverability:** docs are crawlable + in llms.txt (prompt `14`); searchable;
+ linked from home (prompt `31`) and the footer.
+8. **Feedback loop:** a "was this helpful / edit this page" path so docs improve.
+
+## Must-not
+- Do not publish a sample that doesn't run as written.
+- Do not let docs drift from code — prefer generated/tested references.
+- Do not reference any coin other than $THREE in docs/examples.
+
+## Acceptance
+- [ ] Public, branded, searchable docs site with clear IA, themed to the platform.
+- [ ] Verified 5-minute quickstart per primary surface.
+- [ ] API + MCP reference accurate and kept in sync with code.
+- [ ] Curated `examples/` gallery, each runnable against live, linked from docs.
+- [ ] Doc code samples tested in CI; no stale endpoints/flags.
+- [ ] Docs crawlable + in llms.txt + linked from home/footer; feedback path present.
diff --git a/prompts/prod/35-referral-and-virality.md b/prompts/prod/35-referral-and-virality.md
new file mode 100644
index 000000000..736df519a
--- /dev/null
+++ b/prompts/prod/35-referral-and-virality.md
@@ -0,0 +1,55 @@
+# 35 — Referral & virality loops
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 4 — Growth
+**Owns:** sharing surfaces, OG image generation, embeds, referral mechanics, public/embeddable artifacts.
+**Depends on:** `14`, `17`, `24`, `30`, `33`. Pairs with `31`.
+
+## Why this matters for $1B
+Paid acquisition can't get you to $1B alone — viral loops (k-factor > sharing friction)
+do. three.ws is unusually shareable: every output is a 3D model, an agent, a launch.
+Engineering the loops so creations spread is the highest-leverage growth work.
+
+## Mission
+Make every creation effortlessly shareable and embeddable, with attribution that
+pulls viewers back, plus referral mechanics that reward bringing others in.
+
+## Do this
+1. **Share everywhere:** every artifact (forged model, agent profile, scene, launch,
+ marketplace listing) has a one-tap Share with a great destination URL, copy, and a
+ real, dynamic OG/Twitter image (prompt `14`) that renders the actual 3D
+ output. Verify cards on the major platforms.
+2. **Embeds as a loop:** the `<agent-3d>`, walk companion, and page-agent embeds
+ (prompt `24`) carry tasteful, non-spammy attribution back to three.ws — every embed
+ on the web is a billboard. One-click "embed this" with copy-paste code.
+3. **Dynamic OG image service:** a real endpoint that renders share images for agents/
+ models/launches on the fly (cached, fast, resilient — prompt `06`). No generic
+ placeholder image.
+4. **Referral mechanics:** a referral program where inviting a user who activates
+ (prompt `30`) rewards both sides (credits toward paid lanes, etc. — accounted per
+ prompt `26`). Track invites → signups → activations (prompt `33`). Abuse-guarded
+ (prompt `08`).
+5. **Built-in share prompts:** at the first-win moment (prompt `30`) and other natural
+ peaks, invite the user to share — without being naggy. Make sharing feel good, not
+ transactional.
+6. **Public galleries:** the launches feed, a community/creations gallery, and agent
+ directories are public, indexable (prompt `14`), and link inward — discovery
+ surfaces that also pull SEO traffic.
+7. **Measure k-factor:** instrument shares → visits → signups so the loop's
+ coefficient is visible and improvable (prompt `33`).
+
+## Must-not
+- Do not ship a generic/static OG image where a dynamic one belongs.
+- Do not make embeds spammy or attribution obnoxious — tasteful only.
+- Do not allow self-referral/abuse to drain rewards (guard it).
+- Do not reference any coin other than $THREE in share copy.
+
+## Acceptance
+- [ ] Every artifact has one-tap share with great copy + dynamic 3D OG image (cards validated).
+- [ ] Embeds carry tasteful inbound attribution; one-click embed-code copy.
+- [ ] Real, cached, resilient dynamic OG-image service (no placeholders).
+- [ ] Referral program rewards both sides on activation; tracked + abuse-guarded.
+- [ ] First-win + peak-moment share prompts (non-naggy).
+- [ ] Public indexable galleries that link inward.
+- [ ] Share→visit→signup instrumented; k-factor visible.
diff --git a/prompts/prod/36-trust-safety-and-moderation.md b/prompts/prod/36-trust-safety-and-moderation.md
new file mode 100644
index 000000000..124707487
--- /dev/null
+++ b/prompts/prod/36-trust-safety-and-moderation.md
@@ -0,0 +1,61 @@
+# 36 — Trust, safety & moderation
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 4 — Growth
+**Owns:** content moderation for user generations (text prompts, images, avatars, names, listings), reporting/abuse handling, moderation tooling.
+**Depends on:** `07`, `08`, `16`. Pairs with `37`.
+
+## Why this matters for $1B
+A platform where anyone generates 3D content from arbitrary prompts and lists it for
+sale will attract abuse. Unmoderated abuse kills app-store distribution, payment-
+processor relationships, brand, and enterprise deals. Trust & safety is a
+prerequisite for scale, not an afterthought.
+
+## Mission
+Prevent, detect, and act on harmful content across every user-generated surface, with
+clear policies, real moderation tooling, and user reporting — without crushing
+legitimate creation.
+
+## Map
+- UGC surfaces: forge prompts/images (prompt `15`), avatars/names (prompt `21`),
+ marketplace listings (prompt `16`), agent bios, communities, scenes, launch metadata.
+
+## Do this
+1. **Policy:** write clear, public content guidelines + acceptable-use policy (what's
+ not allowed: illegal content, CSAM, hate, harassment, impersonation, IP theft,
+ scams). Link in footer + onboarding (coordinate with prompt `37`).
+2. **Input moderation:** screen generation prompts and uploaded images before
+ generation (a vetted moderation API / classifier) and block disallowed requests
+ with a clear, non-leaky message. Screen names/handles/bios/listing text for slurs/
+ scams/impersonation.
+3. **Output moderation:** scan generated images/models and listing media; quarantine
+ or block violations; keep an audit trail.
+4. **Reporting:** a real "report" flow on every public artifact (agent, listing,
+ scene, launch, community post) that creates a triage-able case.
+5. **Moderation tooling:** an internal queue/dashboard to review reports + flagged
+ content, take action (warn/remove/ban), and record decisions. Role-gated (prompt
+ `07`).
+6. **Enforcement:** graduated actions (content removal, rate-limit, suspension, ban)
+ with user notification and an appeal path. Tie repeat abuse to the rate-limit/abuse
+ system (prompt `08`).
+7. **Impersonation & scams:** specific guards for fake "official" agents/launches and
+ $THREE-impersonation scams; verified badges where appropriate. Reinforce the
+ one-coin rule (prompt `22`) — no other coin is ever promoted.
+8. **CSAM/illegal escalation:** a documented, legally-aware escalation path (preserve
+ evidence, report to authorities/NCMEC as required) — never just silently delete.
+
+## Must-not
+- Do not ship UGC surfaces with no moderation or no reporting.
+- Do not let moderation messages leak internal details or the exact classifier rules.
+- Do not over-block legitimate creation — tune for precision + appeal.
+- Do not allow impersonation of three.ws/$THREE or promotion of other coins.
+
+## Acceptance
+- [ ] Public content guidelines + AUP, linked in footer + onboarding.
+- [ ] Input (prompt/image/name) + output (model/media) moderation with clear blocks + audit trail.
+- [ ] Report flow on every public artifact creating triage-able cases.
+- [ ] Role-gated moderation queue/dashboard with action logging.
+- [ ] Graduated enforcement + notification + appeal, tied to abuse system.
+- [ ] Impersonation/scam guards; one-coin rule reinforced.
+- [ ] Documented CSAM/illegal escalation path.
diff --git a/prompts/prod/37-legal-compliance-tos-privacy.md b/prompts/prod/37-legal-compliance-tos-privacy.md
new file mode 100644
index 000000000..6c4f6476e
--- /dev/null
+++ b/prompts/prod/37-legal-compliance-tos-privacy.md
@@ -0,0 +1,63 @@
+# 37 — Legal, compliance, ToS & privacy
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 4 — Growth
+**Owns:** Terms of Service, Privacy Policy, cookie/consent, licenses/attribution, financial/crypto disclosures, data-rights flows.
+**Depends on:** `05`, `33`, `36`. Pairs with `26`.
+
+## Why this matters for $1B
+A platform that custodies wallets, processes payments, hosts UGC, and uses AI must be
+legally defensible to raise, to sell to enterprises, and to survive scrutiny. Missing
+ToS/privacy/disclosures is a hard blocker in diligence and an existential risk given
+the money and crypto involved.
+
+> You are an engineer, not a lawyer. Build the surfaces, wire the flows, and flag
+> exactly where qualified legal counsel must review/author the binding text. Do not
+> invent legal guarantees.
+
+## Map
+- Forks/vendored code attribution already tracked: `character-studio/LICENSE`,
+ `src/scene-studio/vendor/LICENSE`, `public/animations/LICENSES.md`, per-asset
+ `LICENSES.md` under `public/club/`. Custodial wallets + payments (prompts `17`,
+ `18`). Analytics/PII (prompt `33`).
+
+## Do this
+1. **ToS + Privacy + AUP pages:** real, reachable pages (linked in footer + signup +
+ onboarding). Draft thorough content covering accounts, custodial wallets, payments,
+ UGC + moderation (prompt `36`), AI-generated content + IP/ownership, disclaimers,
+ liability, and termination — clearly marked for counsel review where binding.
+2. **Privacy specifics:** what data is collected (derive from prompt `33` taxonomy +
+ prompt `05` env), why, retention, processors/subprocessors, and user rights
+ (access, export, delete). Build the **data export + deletion** flows (real, wired —
+ not a mailto), respecting the data model (prompt `26`).
+3. **Consent management:** cookie/analytics consent banner honoring opt-out and
+ do-not-track (ties to prompt `33`); no non-essential tracking before consent.
+4. **Crypto/financial disclosures:** clear, non-misleading disclosures for the
+ custodial wallet, payments, token activity, and risk — no investment advice, no
+ guaranteed returns. Reinforce the one-coin rule: $THREE is the only coin; no
+ promotion of others (prompt `22`).
+5. **Licenses & attribution:** confirm all forks/vendored/3rd-party assets keep
+ correct licenses + attribution (the files above); generate a third-party-notices
+ page. Confirm the platform's own license posture.
+6. **Compliance posture:** document the platform's stance on the regimes that apply
+ (GDPR/CCPA-style data rights, age gating, geo-restrictions if any, KYC/AML
+ considerations for money movement) and where counsel sign-off is required. Flag, do
+ not fabricate.
+7. **Records:** terms-acceptance is recorded per user with version + timestamp
+ (prompt `26`).
+
+## Must-not
+- Do not invent legal text as if it were vetted — mark counsel-review points explicitly.
+- Do not collect/track without the required consent.
+- Do not make financial guarantees or give investment advice anywhere.
+- Do not strip third-party license/attribution.
+
+## Acceptance
+- [ ] ToS, Privacy, AUP pages live + linked (footer/signup/onboarding), with counsel-review flags.
+- [ ] Privacy policy reflects real data practices; working data export + deletion flows.
+- [ ] Consent management honoring opt-out/DNT; no pre-consent non-essential tracking.
+- [ ] Crypto/financial + AI-content disclosures present, non-misleading; one-coin rule reinforced.
+- [ ] All third-party licenses/attribution correct; third-party-notices page generated.
+- [ ] Compliance posture documented with counsel sign-off points flagged.
+- [ ] Versioned terms-acceptance recorded per user.
diff --git a/prompts/prod/38-i18n-completion.md b/prompts/prod/38-i18n-completion.md
new file mode 100644
index 000000000..f508bf763
--- /dev/null
+++ b/prompts/prod/38-i18n-completion.md
@@ -0,0 +1,53 @@
+# 38 — Internationalization (i18n) completion
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 4 — Growth
+**Owns:** i18n pipeline (`npm run i18n`, `i18n:extract`, `i18n:translate`, `i18n:lint`), locale files (`en.json`, `es.json`), all user-facing copy.
+**Depends on:** `13`, `14`. Pairs with `31`, `34`.
+
+## Why this matters for $1B
+A $1B platform is global. Crypto + AI-agent audiences are heavily international. Full
+i18n unlocks entire markets at low marginal cost and improves SEO per locale. The
+pipeline already exists (`en`, `es`) — finish and expand it.
+
+## Map
+- Scripts: `i18n`, `i18n:extract`, `i18n:translate`, `i18n:lint`. Locales today:
+ `en.json`, `es.json` (+ `manifest.json`). 125 pages with significant inline copy.
+
+## Do this
+1. **Extraction coverage:** run `i18n:extract` and find untranslated/hardcoded
+ strings across `pages/`, `src/`, `public/`. Externalize every user-facing string
+ into the catalog with stable keys. `i18n:lint` clean (no missing keys, no
+ hardcoded UI text).
+2. **Complete existing locales:** fill all gaps in `es.json` so Spanish is 100%, not
+ partial. Use `i18n:translate` then review for quality/context (not literal MT
+ where it reads wrong).
+3. **Add priority locales:** expand beyond en/es to the highest-value markets for the
+ audience (e.g. add a few more major languages). Each new locale goes through
+ extract → translate → review → lint.
+4. **Locale-aware formatting:** numbers, dates, currencies (USDC amounts), and
+ pluralization use locale-aware formatting (Intl APIs) — not hardcoded formats.
+5. **RTL readiness:** if any RTL locale is added, the layout supports `dir="rtl"`
+ (logical CSS properties, mirrored components) — coordinate with prompt `13`.
+6. **Locale routing + SEO:** language switching is discoverable + persistent;
+ per-locale URLs with `hreflang` tags and locale-specific meta (prompt `14`); the
+ sitemap includes locale variants.
+7. **No untranslated leaks:** every state (incl. errors, empty states, emails/
+ notifications — prompts `12`, `39`) is localized. Pseudo-localize to catch
+ truncation/overflow before shipping.
+8. Wire `i18n:lint` into CI so new hardcoded strings fail the build.
+
+## Must-not
+- Do not ship hardcoded user-facing strings — externalize to the catalog.
+- Do not leave a locale partially translated and selectable as if complete.
+- Do not hardcode number/date/currency formats.
+
+## Acceptance
+- [ ] `i18n:lint` clean; all user-facing strings externalized with stable keys.
+- [ ] `es.json` 100% complete and reviewed; priority new locales added via the pipeline.
+- [ ] Locale-aware number/date/currency/plural formatting via Intl.
+- [ ] RTL support if an RTL locale is added.
+- [ ] Discoverable persistent language switch; `hreflang` + per-locale meta + sitemap.
+- [ ] Errors/empty states/emails localized; pseudo-loc overflow check done.
+- [ ] `i18n:lint` enforced in CI.
diff --git a/prompts/prod/39-pwa-and-notifications.md b/prompts/prod/39-pwa-and-notifications.md
new file mode 100644
index 000000000..312365353
--- /dev/null
+++ b/prompts/prod/39-pwa-and-notifications.md
@@ -0,0 +1,56 @@
+# 39 — PWA & notifications
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 4 — Growth
+**Owns:** PWA manifest + service worker, install experience, push/email/Telegram notifications, `api/newsletter-subscribe.js`, changelog Telegram push.
+**Depends on:** `10`, `25`, `33`, `37`. Pairs with `30`, `35`.
+
+## Why this matters for $1B
+Re-engagement is retention, and retention is valuation. An installable PWA + a
+well-built notification system (a launch filled, a skill sold, a tip received, an
+agent mentioned) brings users back without paid spend. The platform already pushes the
+changelog to a $THREE-holder Telegram channel — extend that muscle into real product
+notifications.
+
+## Map
+- Existing: `api/newsletter-subscribe.js`, changelog Telegram push
+ (`npm run changelog:push`, `TELEGRAM_BOT_TOKEN` + `TELEGRAM_CHANGELOG_CHAT_ID`).
+ `error-reporter.js` shows there's already client infra to build on.
+
+## Do this
+1. **PWA:** add/validate a complete web app manifest (name, icons across sizes, theme/
+ background colors, display mode, start URL) so the app is installable on mobile +
+ desktop. `npm run generate-icons` covers icon sizes.
+2. **Service worker:** offline-friendly shell + smart caching for static assets/GLBs
+ (coordinate with prompt `10` cache policy); cache-first for immutable assets,
+ network-first for data; a clean offline page. Versioned SW with safe update flow
+ (no stale-forever bug).
+3. **Push notifications:** real web-push (with permission requested at a *good* moment,
+ not on first load) for high-value events: your launch filled, skill sold, tip
+ received, payout ready, agent mentioned/forked. User-controllable per category.
+4. **Email:** transactional emails (welcome/onboarding — prompt `30`, receipts —
+ prompt `32`, security alerts) via a real provider; double-opt-in newsletter built
+ on `newsletter-subscribe.js`. Localized (prompt `38`).
+5. **Telegram:** keep the holder changelog push; optionally let users opt into
+ per-account Telegram alerts for their agents/launches. Reuse the existing bot infra.
+6. **Preference center:** one place to manage every notification channel + category,
+ with easy unsubscribe (and honoring it — prompt `37`). No notification without a
+ real off switch.
+7. **Instrument:** track notification sent → opened → returned (prompt `33`) so the
+ re-engagement loop is measurable and tuned, not spammy.
+
+## Must-not
+- Do not request push/notification permission on first load — ask at a value moment.
+- Do not send a notification type the user can't turn off.
+- Do not cache so aggressively that users get stuck on a stale build (safe SW updates).
+- Do not reference any coin other than $THREE in any notification copy.
+
+## Acceptance
+- [ ] Complete PWA manifest; app installable on mobile + desktop.
+- [ ] Versioned service worker with smart caching, offline page, safe update flow.
+- [ ] Web-push for high-value events, permission asked at a good moment, per-category control.
+- [ ] Transactional emails + double-opt-in newsletter via a real provider, localized.
+- [ ] Telegram changelog retained; optional per-account alerts.
+- [ ] Unified preference center with honored unsubscribe.
+- [ ] Notification sent→opened→returned instrumented.
diff --git a/prompts/prod/40-launch-readiness-review.md b/prompts/prod/40-launch-readiness-review.md
new file mode 100644
index 000000000..bd74644ac
--- /dev/null
+++ b/prompts/prod/40-launch-readiness-review.md
@@ -0,0 +1,61 @@
+# 40 — Launch-readiness review (the final gate)
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 4 — Growth (final gate)
+**Owns:** the whole platform — a top-to-bottom verification that prompts `01`–`39` actually landed.
+**Depends on:** all prior prompts.
+
+## Why this matters for $1B
+This is the gate that ensures the program produced a platform you'd actually stake the
+company on. It's the difference between "we did a lot of work" and "we are
+production-ready." Run it as an adversarial reviewer, not a cheerleader.
+
+## Mission
+Verify, end to end, that the platform meets the production + growth bar set by this
+program and by `/CLAUDE.md`'s Definition of Done — and produce a single, honest
+readiness report with any remaining gaps and their owners.
+
+## Do this
+1. **Re-verify each phase against reality, not claims.** For prompts `01`–`39`, spend
+ a few minutes confirming the Acceptance checklist actually holds in the live app/
+ code today (things regress). Note any that slipped.
+2. **Critical-path walkthrough in a real browser** (desktop + mobile, both themes):
+ land → onboard → forge a model → create/own an agent → buy a skill → make an x402
+ payment → launch → share. Every step works, every state designed, zero console
+ errors, zero dead ends.
+3. **Money paths, adversarially:** attempt double-charge, replay, price tampering,
+ and unauthorized withdrawal — confirm each is blocked (prompts `07`, `18`).
+4. **Quality gates green:** `npm run lint`, `npm run typecheck`, `npm run test:all`,
+ `npm run audit:deploy`, `audit:pages`, `audit:web`, `audit:mcp`, `seo:meta`,
+ `check:images`, `verify`, `smoke:onchain`, `smoke:mcp` — run them; all pass.
+5. **Cross-cutting spot-audit:** a11y (axe on top flows), Lighthouse perf on key
+ pages, mobile at 320/768/1440, secret scan, `npm audit` — confirm prompts `05`,
+ `07`, `09`, `10`, `11` held.
+6. **The one-coin rule:** final grep across code/copy/tests/docs/metadata — only
+ $THREE, plus the two runtime-data exceptions. Zero other coins (prompt `22`).
+7. **Observability + ops:** dashboards live, alerts wired, status page up, rollback
+ practiced, backups restore-tested (prompts `25`–`28`).
+8. **Growth instrumentation:** activation/retention/revenue funnels reporting real
+ numbers; referral + notifications working (prompts `30`–`35`, `39`).
+9. **Legal/safety:** ToS/privacy/AUP live, consent working, moderation + reporting
+ live, data export/delete working (prompts `36`, `37`).
+10. **Produce `docs/launch-readiness.md`:** a dated report with a per-area
+ GREEN/YELLOW/RED status, the evidence checked, every remaining gap, its severity,
+ and a clear owner/next step. Be honest — RED where it's RED. Do not claim done for
+ anything you could not verify (`/CLAUDE.md`).
+
+## Must-not
+- Do not rubber-stamp. If you can't verify something, mark it unverified — never green.
+- Do not skip the adversarial money-path checks.
+- Do not let the one-coin grep slide.
+
+## Acceptance
+- [ ] Prompts `01`–`39` Acceptance re-verified against the live app/code; slips logged.
+- [ ] Full critical-path walkthrough passes desktop + mobile + both themes, zero console errors / dead ends.
+- [ ] Adversarial money-path checks all blocked.
+- [ ] All quality gates + audit scripts green.
+- [ ] Cross-cutting spot-audit (a11y/perf/mobile/secrets/`npm audit`) passes.
+- [ ] One-coin grep clean (only $THREE + the two runtime exceptions).
+- [ ] Observability/ops + growth + legal/safety verified live.
+- [ ] `docs/launch-readiness.md` written: dated, per-area RAG status, gaps, owners.
diff --git a/prompts/production-1b/37-dx-docs-site.md b/prompts/production-1b/37-dx-docs-site.md
new file mode 100644
index 000000000..4fd8c560e
--- /dev/null
+++ b/prompts/production-1b/37-dx-docs-site.md
@@ -0,0 +1,91 @@
+# 37 — Developer experience & docs site
+
+> Part of the three.ws "Production → $1B" program. Run in a fresh chat. Read
+> `/CLAUDE.md` first (its rules override everything) and `prompts/production-1b/00-README.md`
+> for shared context.
+
+## Why this matters for $1B
+
+three.ws is a developer platform: SDKs, MCP servers, web components, and a paid
+x402 API. Developers decide in the first five minutes whether to build on you, and
+that decision is made on the docs. A quickstart that doesn't copy-paste-run, a stale
+API reference, or `llms.txt` that contradicts the live endpoints loses every
+integration before it starts. World-class docs are the cheapest, highest-leverage
+acquisition channel a dev platform has.
+
+## Mission
+
+Make every doc accurate, every code example actually runnable, and the docs site
+itself searchable, versioned, and self-consistent with the real API surface and the
+machine-readable `llms.txt` / `llms-full.txt`.
+
+## Map (trust but verify — files move)
+
+- **Docs content** — [public/docs/](../../public/docs) (~40 `.md` files:
+ `quick-start.md`, `api-reference.md`, `sdk.md`, `mcp.md`, `web-component.md`,
+ `widget-api.md`, `embedding.md`, `authentication.md`, `examples.md`, …).
+- **Tutorials** — [public/docs/tutorials/](../../public/docs/tutorials)
+ (`getting-started.md`, `first-agent.md`, `embed-on-website.md`,
+ `register-onchain.md`, `custom-skill.md`, `personal-ai-site.md`).
+- **Walk docs (HTML)** — [public/docs/walk/](../../public/docs/walk)
+ (`index.html`, `docs.js`, `getting-started.html`, `embed-sdk.html`, …).
+- **Docs home + routing** — [docs/index.html](../../docs/index.html), routes in
+ [vercel.json](../../vercel.json) (`/docs`, `/docs/walk`, `/docs/widgets` →
+ [public/docs-widgets.html](../../public/docs-widgets.html)).
+- **Machine-readable docs** — [public/llms.txt](../../public/llms.txt),
+ [public/llms-full.txt](../../public/llms-full.txt) (regenerated from content;
+ find the generator under [scripts/](../../scripts)).
+- **API truth source** — handlers in [api/](../../api); web-component reference in
+ [src/element.js](../../src/element.js) (the `<agent-3d>` element).
+- **Embed snippet builders** — [src/share-panel-builders.js](../../src/share-panel-builders.js)
+ (`buildIframeSnippet`, `buildWebComponentSnippet`) — docs snippets must match these.
+
+## Do this
+
+1. **Run every code example.** Open each doc and tutorial; copy each fenced code
+ block and execute it (curl against the real API, `npm install` the SDK, mount the
+ `<agent-3d>` element). Any block that errors, 404s, or references a renamed
+ param/endpoint gets fixed against the live handler in `api/`.
+2. **Reconcile the API reference** (`public/docs/api-reference.md`) with the actual
+ handlers: every documented route, method, query param, and response shape must
+ exist; remove documented-but-deleted endpoints; add shipped-but-undocumented ones.
+3. **Fix the SDK / MCP quickstarts** (`sdk.md`, `mcp.md`, `quick-start.md`) so a cold
+ developer goes from zero to a working call. Use the published package names and the
+ free `forge_free` MCP lane for the zero-cost first call (no wallet/key required).
+4. **Web-component / embed docs** (`web-component.md`, `widget-api.md`,
+ `embedding.md`) must produce the exact snippet `share-panel-builders.js` emits —
+ same tag, attributes, and origin. Test the snippet in a blank HTML file.
+5. **Regenerate and validate `llms.txt` / `llms-full.txt`** with the existing
+ generator script; confirm they list real, live page paths and the current API
+ surface — no dangling routes.
+6. **Docs search + navigation**: ensure the docs home is searchable (verify
+ `public/docs/walk/docs.js` search works; if the main `/docs` index lacks search,
+ add a client-side filter over the doc list). Every doc must be reachable from the
+ index — no orphans.
+7. **Versioning + freshness signal**: each doc shows a "last updated" / version marker
+ sourced from real data (git date or front-matter), not a hardcoded string. Stale
+ docs are worse than missing ones.
+8. Run `npm run build:pages`, `npm run audit:pages`, and `npm run seo:meta`. Add a
+ `data/changelog.json` entry (tag `docs`) for the doc refresh; rebuild pages.
+
+## Must-not
+
+- Do not ship a code example you have not run — no aspirational snippets.
+- Do not document any endpoint, package, or coin that doesn't exist; the only coin is
+ `$THREE`.
+- Do not break working docs routes in `vercel.json`; verify each redirect resolves.
+- Do not leave `llms.txt`/`llms-full.txt` contradicting the live docs after edits.
+- No mocks, stubs, TODOs, or "coming soon" placeholders in published docs.
+
+## Acceptance (all true before claiming done)
+
+- [ ] Every fenced code block in `public/docs/**` and `public/docs/tutorials/**` runs
+ against real APIs/SDKs with no errors.
+- [ ] `api-reference.md` matches the handlers in `api/` (no phantom or missing routes).
+- [ ] SDK + MCP quickstarts take a cold developer to a successful call; free lane works.
+- [ ] Embed/web-component docs emit the same snippet as `share-panel-builders.js`,
+ verified in a blank page.
+- [ ] `llms.txt` and `llms-full.txt` regenerated and consistent with live docs/API.
+- [ ] Docs are searchable, every doc is reachable from the index, freshness markers
+ are real (not hardcoded).
+- [ ] `npm run build:pages`, `audit:pages`, `seo:meta` clean; changelog entry added.
diff --git a/prompts/production-campaign/A-reliability/A7-resilience-degradation-status.md b/prompts/production-campaign/A-reliability/A7-resilience-degradation-status.md
new file mode 100644
index 000000000..0ae023709
--- /dev/null
+++ b/prompts/production-campaign/A-reliability/A7-resilience-degradation-status.md
@@ -0,0 +1,97 @@
+# A7 — Resilience, Graceful Degradation & Status
+
+You are a senior engineer + product thinker building **three.ws**. Read `CLAUDE.md`,
+`STRUCTURE.md`, and `prompts/production-campaign/00b-the-bar.md` first. **Prerequisites:** A1
+(your health signals and circuit-breaker state feed its telemetry and the status page).
+
+## Why this matters for $1B
+Upstreams fail — RPCs throttle, 3D engines saturate, LLM proxies time out, pump.fun hiccups. A $1B
+platform never lets an upstream's bad day become the user's dead end. `00b-the-bar.md` §1: "Graceful
+degradation, always. When an upstream is down… the surface degrades to a useful state with a real retry
+— exactly the failure we already see on Forge ('free engines all busy'). That state must offer a path
+forward (switch engine, queue, notify-me), not a dead end." Resilience plus an honest status page is how
+trust survives the inevitable outage.
+
+## Current state (read before you write)
+- `api/_lib/resilience.js` is a real cockatiel wrapper (circuit breaker + timeout, one breaker per
+ upstream, memoized per lambda instance) — but **only ~1 call site uses it**. The pattern is built;
+ adoption is the gap.
+- `api/_lib/forge-health.js` already probes 3D backends and reports `ok/degraded/down/byok/unconfigured`
+ (it was built because two outages hid behind a `configured:true` flag). `api/_lib/provider-health.js`,
+ `_lib/llm-health.js`, `_lib/sse-poll-breaker.js`, `_lib/db-retry.js` exist.
+- `api/forge.js` already returns a designed `provider_busy` error ("The free 3D Spaces are all busy or
+ warming up right now. Try again in a moment, or pick another engine.") and has `status: 'queued'`
+ paths. `src/forge.js` surfaces busy lanes (`busy right now: …`). **But the free-lane busy case is a
+ near-dead-end for the user** — the copy suggests switching engines without making it a one-click path,
+ and there's no queue or notify-me.
+- `pages/status.html` exists (status page shell with OG/theme-boot). It needs to render **real** live
+ health, not a static placeholder.
+- **The gap:** raw external call sites lack breakers/fallbacks; the status page isn't wired to real
+ health; the Forge free-lane busy state forwards the user poorly. Verify each by reading before writing.
+
+## Your mission
+### 1. Put every external call behind a circuit breaker + timeout + fallback
+Adopt `api/_lib/resilience.js` at every raw upstream call site that doesn't already have a guard: Solana
+RPC, Birdeye/Helius, the 3D engines, LLM proxies, pump.fun. Each gets a breaker (named per upstream), a
+timeout, and a **real fallback** — a secondary RPC, an alternate 3D engine, a cached/last-known value, or
+a designed degraded response. Never a hung request, never an unguarded throw. Where a fallback genuinely
+can't exist, fail fast into a designed "try again" envelope (A2 shape) — not a 30s hang.
+
+### 2. Fix the Forge "free engines all busy" dead-end into a real path forward
+This is the flagship fix. When the free lane is saturated, the user must get a **one-click** path, not a
+sentence telling them to do something manual: (a) **switch engine** — surface the next available healthy
+engine (from `forge-health.js`) as a button that retries on it immediately; (b) **queue** — let the user
+join a queue and get notified/auto-started when capacity frees (real backend state, not a fake timer);
+(c) **notify-me** — capture intent and ping when the free lane recovers. Wire `forge-health.js` so the UI
+knows which engines are actually `ok` right now and never offers a `down` one. Design the busy state to
+the screenshot bar — it should feel like the product caring, not breaking.
+
+### 3. Health checks for every dependency
+Stand up real health checks: each upstream (RPC, 3D engines via `forge-health.js`, LLM via `llm-health.js`,
+DB, Redis, pump.fun) and each worker (consume A1's worker heartbeats) reports `ok/degraded/down` with a
+reason. Centralize into one health aggregator endpoint that the status page and A1's dashboard both read.
+Probes must be cheap and never spend vendor money (follow `forge-health.js`'s zero-cost probe pattern).
+
+### 4. Make `/status` a real, live status page
+Wire `pages/status.html` to the health aggregator: live component status (platform, API, x402 paid rails,
+3D engines, RPC, workers), current incident banner if any, and the 90-day uptime history its own meta
+already promises. Design every state (all-green, partial-degradation, major-outage) to the bar — clear,
+honest, branded, accessible, responsive at 320/768/1440px. No fake "all systems operational" when a probe
+says otherwise. This is the public face of trust during an outage.
+
+### 5. Degrade every user-facing surface gracefully
+For each surface that depends on a flaky upstream (Forge, avatar presence, trade/quote, agent chat, pump
+feeds), ensure the breaker-open / fallback path renders a **useful** state with a real retry, not a blank
+void or a spinner that never resolves — per A2's envelope and `00b-the-bar.md` §3 error-state bar. The
+user always knows what happened and what to do next.
+
+### 6. Surface resilience health into observability
+Feed breaker state transitions (open/half-open/closed), fallback activations, and degradations into A1's
+telemetry and ops alerts — a breaker that opens on a money/RPC upstream should page. The status page,
+A1's dashboard, and the alerts all read one source of truth.
+
+## Definition of done
+Clears `00b-the-bar.md` §1 degradation clause: every external call has a breaker + timeout + real
+fallback; the Forge "free engines all busy" case is a one-click switch/queue/notify-me path (no dead
+end); a live `/status` page renders real component health with all three states designed; every flaky-
+upstream surface degrades to a useful retry; breaker/degradation events feed A1's telemetry and page on
+money/RPC. Inherits the global definition of done in `00-README-orchestration.md`. Where you can't induce a
+real upstream outage locally, force the breaker open in a test and verify the fallback + status render.
+
+## Operating rules (override defaults)
+No mocks/fake data/placeholders/TODOs/stubs — **no `setTimeout` fake progress** for the queue; real
+backend queue state only. `$THREE` is the only coin. Design tokens only (`public/tokens.css`) for the
+status page and busy/degraded states. Stage explicit paths only (never `git add -A`); re-check `git diff
+--staged` before commit (watch the `npx vercel build` `api/*.js` bundling trap). You own
+`api/_lib/resilience.js`, `_lib/forge-health.js`, `_lib/provider-health.js`, the busy path in `api/forge.js`
++ `src/forge.js`, `pages/status.html`, and the health endpoint(s). Health events flow into A1 — reuse its
+helpers, don't fork. Extend the existing breaker/health/queue logic; don't rewrite working probes.
+
+## When finished
+Run `CLAUDE.md`'s five self-review checks. Ship one improvement (e.g. an incident-history log behind the
+status page, or auto-failover ranking of RPCs by recent latency). Append a `data/changelog.json` entry
+(tag: `improvement` or `feature`) — a real status page and a fixed Forge busy flow are very visible. Then
+delete this prompt file
+(`prompts/production-campaign/A-reliability/A7-resilience-degradation-status.md`) and report which call
+sites you put behind breakers, how the Forge busy path now resolves, and the health-source seam shared
+with A1's dashboard.
diff --git a/prompts/production-campaign/C-surfaces/00-README.md b/prompts/production-campaign/C-surfaces/00-README.md
new file mode 100644
index 000000000..3ac79f35b
--- /dev/null
+++ b/prompts/production-campaign/C-surfaces/00-README.md
@@ -0,0 +1,44 @@
+# Track C — Surface Completeness
+
+**Goal:** take every page in three.ws to the **screenshot bar** in `00b-the-bar.md` §3.
+For each surface, all five states are deliberately designed and reachable — **loading**
+(skeletons, not spinners), **empty** (names the surface + offers the next action),
+**error** (plain-language cause + real recovery), **populated** (token-consistent, with
+microinteractions), **overflow** (0 / 1 / 1000 items, 200-char names, $0 and $10M wallets) —
+plus responsive at **320 / 768 / 1440px**, full **a11y** (keyboard, screen-reader labels,
+`prefers-reduced-motion`, contrast ≥ WCAG AA), **dead-path elimination** (every button works,
+every link goes somewhere), and **design tokens only** (`public/tokens.css` — no hardcoded
+colors/spacing/fonts).
+
+This is the **polish pillar** of the $1B thesis: polish is how trust is *communicated*
+before it is earned. A surface with an undesigned empty state, a spinner that spins forever,
+or a button that does nothing is a trust leak on a platform that asks people to wire wallets
+and mint coins. We close every one of those leaks, surface by surface.
+
+> **Not a rewrite.** These pages ship today. Read each before you touch it, reuse its
+> existing modules and API calls, and *finish* what's there — its missing states, its broken
+> paths, its mobile and a11y gaps. Don't re-architect a working page to add a skeleton.
+
+## The six prompts and the page groups they own
+
+| Prompt | Owns (page group) | Real files (representative) |
+|---|---|---|
+| **C1** | Creation tools | `pages/forge.html`, `avatar-studio.html`, `agent-studio.html`, `create-agent.html`, `create-character.html`, `create-selfie.html`, `create.html`, `animations.html`, `mocap-studio.html` |
+| **C2** | Discover / browse | `pages/trending.html`, `marketplace.html`, `marketplace-analytics.html`, `animations.html`, `agents/index.html`, `worlds.html`, `collection.html`, `constellation.html`, `communities.html`, `galaxy.html`, `directory` (all-pages) |
+| **C3** | Launch & trading | `pages/launch.html`, `launchpad.html`, `coin-intel.html`, `trader.html`, `leaderboard.html`, `live.html`, `claim-wallet.html`, `play/arena.html`, `radar.html`, `oracle.html`, `arm.html`, `public/strategy-lab.html`, `watchlist.html`, `activity.html`, `pump-visualizer.html`, `launches.html`, `bulk-launch.html`, `autopilot.html`, `smart-money.html`, `dashboard-next/sniper.html` |
+| **C4** | Agent & wallet | `pages/agent-wallet.html`, `dashboard-next/index.html`, `dashboard-next/account.html`, `dashboard-next/agents.html`, `agent-detail.html`, `agent-edit.html`, `agent-economy.html`, `agent-exchange.html`, `agent-trade.html` |
+| **C5** | Worlds / clash / social | `pages/clash.html`, `worlds.html`, `city.html`, `club.html`, `community.html`, `communities.html`, `bounties.html`, `bounty.html` |
+| **C6** | Learn / chat / pay | `docs/index.html`, `pages/tutorials.html`, `tutorial.html`, `chat/index.html`, `pay/index.html`, `avatar-sdk.html`, `glossary.html`, `what-is.html`, `ar.html` |
+
+## Run order
+
+Prerequisite: **Track A (Reliability)** should be green first — C surfaces render the
+error/degradation states that A's boundaries produce. Within Track C the six prompts own
+**disjoint page sets**, so they run **fully in parallel** — no ordering between them. Each
+extends the shared nav (`public/nav.js` / `public/nav.css`) and tokens (`public/tokens.css`)
+but **must not rewrite** them; if a shared token is missing, add it, don't restyle the world.
+
+Each agent stages **explicit paths only** (never `git add -A`), re-checks `git diff --staged`
+before committing (the `api/*.js` esbuild-bundle trap in `00-README-orchestration.md` applies),
+and **deletes its own prompt file** when done. When this directory holds only `00-README.md`,
+Track C is complete.
diff --git a/prompts/production-campaign/C-surfaces/C1-create-forge-surfaces.md b/prompts/production-campaign/C-surfaces/C1-create-forge-surfaces.md
new file mode 100644
index 000000000..102b6a3b8
--- /dev/null
+++ b/prompts/production-campaign/C-surfaces/C1-create-forge-surfaces.md
@@ -0,0 +1,103 @@
+# C1 — Creation-tool surfaces to the bar (Forge, studios, create flows)
+
+You are a senior engineer + product thinker building **three.ws**. Read `CLAUDE.md`,
+`STRUCTURE.md`, and `prompts/production-campaign/00b-the-bar.md` first. **Prerequisites:** none
+(Track A reliability should be green so the degradation states you render are real).
+
+## Why this matters for $1B
+
+Creation is the **first "wow"** — the 60-second activation moment in the $1B thesis. A
+first-time visitor's entire impression of three.ws is formed at the Forge prompt box and the
+avatar studio. If generation hangs on a spinner, dead-ends on "all engines busy," or shows a
+blank canvas with no guidance, we lose the activation before value is ever reached. Every
+creation surface must turn waiting into anticipation and failure into a path forward.
+
+## Surfaces in scope (the real pages)
+
+- **Forge (text→3D):** `pages/forge.html` → `src/forge.js` (+ `forge-prompt-studio.js`,
+ `forge-reveal.js`, `forge-refine.js`, `forge-pay.js`, `forge-dropzone.js`) →
+ `api/forge.js`, `api/forge-creation.js`, `api/forge-gallery.js`
+- **Avatar Studio:** `pages/avatar-studio.html` → `src/avatar-studio.js` (+ `-colorpicker`,
+ `-optimize`, `-utils`); demo: `pages/avatar-studio-demo.html` → `src/avatar-studio-demo.js`
+- **Agent Studio:** `pages/agent-studio.html`
+- **Create Agent / Character / Selfie:** `pages/create-agent.html` → `src/create-agent.js`;
+ `pages/create-character.html`; `pages/create-selfie.html`; the create flow
+ `pages/create.html` → `src/create.js` (+ `create-prompt.js`, `create-review.js`)
+- **Animation tooling:** `pages/animations.html` → `src/animations-gallery.js`,
+ `src/animation-library.js`; mocap: `pages/mocap-studio.html`
+- Data/MCP: `api/forge.js` (free NVIDIA NIM / TRELLIS lane + paid engines), the free
+ `forge_free` MCP tool, `api/forge-gameready.js`, `api/forge-optimize.js`,
+ `api/forge-stylize.js`.
+
+## Current state (read before you write)
+
+The Forge backend already returns a **designed degradation** when the free Spaces are
+saturated — `api/forge.js:1042` returns *"The free 3D Spaces are all busy or warming up
+right now. Try again in a moment, or pick another engine."* and `:1285` returns a retry hint.
+Sub-tools throw busy errors with a seconds estimate (`forge-gameready.js:394`,
+`forge-optimize.js:294`, `forge-stylize.js:129`). **The gap is the front end:** verify the UI
+turns that JSON into a *real* designed state — a retry-with-countdown, an engine switcher, and
+a "notify me / queue" path — not a thrown error string in a toast or, worse, a spinner that
+never resolves. Audit each studio for: undesigned empty canvas, generation progress that is
+honest (real queue/inference status, never `setTimeout` fake bars), and mobile usability of
+the prompt box and 3D viewport.
+
+## Your mission
+
+### 1. Audit every surface for the five states (loading / empty / error / overflow / populated)
+For each page: **loading** uses a skeleton or honest queued/running status from the real API
+(no fake progress); **empty** (no prompt yet / empty gallery) names the tool and offers a
+starter prompt, an example, or a "surprise me"; **error** speaks plainly with a real action;
+**overflow** handles a 500-char prompt, a 0-item gallery, a 1000-model gallery, a giant GLB.
+
+### 2. Fix the Forge "free engines all busy" dead-end into a designed degradation
+This is the named failure in `00b-the-bar.md` §1. When `api/forge.js` returns the busy/down
+payload, the page must render a **path forward**, not a dead end:
+- a **retry with a live countdown** (use the seconds the API supplies, not a guess),
+- an **engine switcher** (the paid lanes exist — surface them with their $THREE/x402 cost),
+- a **"notify me / queue"** affordance so the user isn't forced to babysit the page.
+Wire it to the real response shape; no mocked queue. Carry the same treatment to the
+gameready/optimize/stylize busy errors so a sub-step never throws a raw string.
+
+### 3. Mobile, a11y, and microinteractions
+Make the prompt box, controls, and 3D viewport usable at **320 / 768 / 1440px** (no overflow,
+tappable targets ≥ 44px). The viewport canvas gets an ARIA label and a keyboard-reachable
+control set; generation status is announced via `aria-live`. Honor `prefers-reduced-motion`
+on the reveal animation. Every button/slider gets hover, active, and focus states.
+
+### 4. Dead-path elimination + design tokens
+Every CTA on these pages must do something real (generate, export, pay, share, open in
+studio). Replace any hardcoded color/spacing/font with a `public/tokens.css` token. If a
+control looks live but isn't wired, wire it or remove it.
+
+### 5. Honest 3D loading
+The viewport must not block on a multi-MB GLB: lazy-load Three.js, show a real loading
+skeleton, dispose GPU resources on unmount/regeneration. No jank, no FOUC.
+
+## Definition of done
+
+Clears `00b-the-bar.md` §3 (all five states designed + reachable, responsive, a11y) and §1
+(graceful degradation with a real path forward on Forge). Inherits the **global definition of
+done** in `00-README-orchestration.md`: real APIs only, `$THREE` the only coin, tokens only,
+verified in a browser at `npm run dev` with zero console errors from your code and real
+network calls, existing tests pass. State which bars you cleared and how you verified each.
+
+## Operating rules (override defaults)
+
+No mocks / fake data / placeholders / TODOs / stubs / sample arrays / `setTimeout` fake
+progress. `$THREE` (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`) is the only coin —
+generic runtime-supplied mints excepted per `CLAUDE.md`. Design tokens only
+(`public/tokens.css`) — no hardcoded colors/spacing/fonts. Stage explicit paths only (never
+`git add -A`); re-check `git diff --staged` and `head -1` of any `api/*.js` you touch for the
+`__defProp` bundle trap. Own **only the pages listed here**; extend the shared nav/tokens,
+never rewrite them.
+
+## When finished
+
+Run `CLAUDE.md`'s five self-review checks (lazy / user / integration / edge-case / pride).
+Ship one improvement beyond the checklist (e.g. a starter-prompt gallery on the empty Forge
+canvas, or a "remix this model" path from the gallery into the studio). Append a
+holder-readable `data/changelog.json` entry if the change is user-visible
+(`npm run build:pages` to validate). Then delete this prompt file
+(`prompts/production-campaign/C-surfaces/C1-create-forge-surfaces.md`) and report what you
+shipped, which bars you cleared and how you verified them, and any seam for the next agent.
diff --git a/prompts/production-campaign/C-surfaces/C2-discover-surfaces.md b/prompts/production-campaign/C-surfaces/C2-discover-surfaces.md
new file mode 100644
index 000000000..e1895e65c
--- /dev/null
+++ b/prompts/production-campaign/C-surfaces/C2-discover-surfaces.md
@@ -0,0 +1,96 @@
+# C2 — Discover / browse surfaces to the bar
+
+You are a senior engineer + product thinker building **three.ws**. Read `CLAUDE.md`,
+`STRUCTURE.md`, and `prompts/production-campaign/00b-the-bar.md` first. **Prerequisites:** none.
+
+## Why this matters for $1B
+
+Discovery is how a visitor finds the thing worth coming back for — the trending model, the
+agent to hire, the world to explore. These are the most-linked, most-screenshotted surfaces
+on the platform; a half-empty grid, an "undefined" card, or a list with no sort/filter reads
+as a dead marketplace, and a dead marketplace has its **liquidation value**, not a $1B one.
+Discovery surfaces are also where network effects live: every card must link to the profile,
+the launch, the studio it represents. A grid that doesn't go anywhere is decoration.
+
+## Surfaces in scope (the real pages)
+
+- **Trending:** `pages/trending.html` → `src/trending*` → `api/explore.js`,
+ `api/discover-detail.js`
+- **Marketplace:** `pages/marketplace.html` → `src/marketplace.js`, `marketplace-lobby.js`,
+ `marketplace-detail.js`; analytics: `pages/marketplace-analytics.html` →
+ `src/marketplace-analytics.js`
+- **Avatar / animation galleries:** `pages/animations.html` → `src/animations-gallery.js`,
+ `src/animation-library.js`; avatar browsing lives in the marketplace/collection grids
+- **Agents index:** `/agents` → `public/agents/index.html` (and `agents/index.html`)
+- **Worlds:** `pages/worlds.html` → `src/worlds*`
+- **All-pages directory:** `/directory` (`/all-pages` → 308) — the page that enumerates every
+ surface; confirm the live route in `vercel.json` and the file it serves
+- **Collection:** `pages/collection.html` → `src/collection.js`
+- **Constellation:** `pages/constellation.html` → `src/constellation/*`
+- **Communities (browse):** `pages/communities.html` → `src/community/*`
+- **Galaxy (3D discovery):** `pages/galaxy.html`
+- Data sources: `api/explore.js`, `api/discover-detail.js`, the marketplace/collection feeds.
+
+## Current state (read before you write)
+
+These pages fetch real feeds. The gaps to find: **empty states** that show a blank grid or
+"No results" instead of a designed empty state with a next action (a CTA to create, a sample,
+a cleared-filter button); **loading** that pops in instead of skeleton cards matching the
+grid; **error** that fails silently when `api/explore.js` / `api/discover-detail.js` errors;
+**overflow** — pagination/infinite-scroll for 1000+ items, truncation for 200-char names,
+graceful handling of missing thumbnails. Also audit: do all cards link somewhere real
+(profile / launch / studio)? Is there sort/filter, and does it persist in the URL?
+
+## Your mission
+
+### 1. Audit every surface for the five states
+**Loading** = skeleton cards in the real grid shape (not a centered spinner). **Empty** =
+explains the surface and gives the next action (create one, see an example, clear the filter).
+**Error** = names the failure (feed down) and offers retry. **Populated** = token-consistent
+cards with hover/focus. **Overflow** = pagination or virtualized infinite scroll for large
+sets; name/number truncation; missing-image fallback. Verify against real `api/explore.js`
+and `api/discover-detail.js` responses, including the empty and error responses.
+
+### 2. Eliminate dead cards and add sort/filter where missing
+Every card links to its real detail/profile/launch destination — no card that goes nowhere.
+Where a discovery grid lacks sorting or filtering (per the "if your list lacks sorting, add
+it" rule in `CLAUDE.md`), add it and reflect it in the URL so it's shareable and back-button
+safe. Cross-wire: trending cards → agent profile / launch detail; marketplace → studio remix.
+
+### 3. Mobile, a11y, microinteractions
+Grids reflow cleanly at **320 / 768 / 1440px** (no horizontal scroll, no clipped cards).
+Cards are keyboard-focusable with visible focus rings and screen-reader labels; filter
+controls are labelled. Honor `prefers-reduced-motion` on card enter/hover transitions. Every
+interactive element gets hover, active, and focus states.
+
+### 4. Design tokens + performance
+Replace hardcoded colors/spacing/fonts with `public/tokens.css` tokens. Lazy-load images
+(and the 3D galaxy/constellation Three.js modules), debounce the filter/search input,
+paginate or virtualize long lists. No layout shift as cards load.
+
+## Definition of done
+
+Clears `00b-the-bar.md` §3 (five states, responsive, a11y) and §2 (no layout shift, lazy 3D).
+Inherits the **global definition of done** in `00-README-orchestration.md`: real feeds only,
+`$THREE` the only coin, tokens only, verified in a browser at `npm run dev` with zero console
+errors from your code and real network calls, existing tests pass. State which bars you
+cleared and how you verified each (the empty response, the 1000-item scroll, the screenshot).
+
+## Operating rules (override defaults)
+
+No mocks / fake data / placeholders / TODOs / stubs / sample arrays. `$THREE`
+(`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`) is the only coin — runtime user-launch feeds
+(the launch directory, agent launch history) render user-launched mints and are the sole
+mechanical exception per `CLAUDE.md`; never hardcode or recommend a non-`$THREE` mint. Design
+tokens only (`public/tokens.css`). Stage explicit paths only (never `git add -A`); check
+`head -1` of any `api/*.js` you touch for the `__defProp` bundle trap. Own **only the pages
+listed here**; extend, don't rewrite, the shared nav/tokens.
+
+## When finished
+
+Run `CLAUDE.md`'s five self-review checks. Ship one improvement (e.g. URL-persisted filters,
+a "trending this week" facet, or an empty-state that seeds a starter search). Append a
+holder-readable `data/changelog.json` entry if user-visible (`npm run build:pages` to
+validate). Then delete this prompt file
+(`prompts/production-campaign/C-surfaces/C2-discover-surfaces.md`) and report what you
+shipped, which bars you cleared and how you verified them, and any seam for the next agent.
diff --git a/prompts/production-campaign/E-ecosystem/E2-mcp-servers-production.md b/prompts/production-campaign/E-ecosystem/E2-mcp-servers-production.md
new file mode 100644
index 000000000..f74ed2776
--- /dev/null
+++ b/prompts/production-campaign/E-ecosystem/E2-mcp-servers-production.md
@@ -0,0 +1,103 @@
+# E2 — MCP Servers Production
+
+You are a senior engineer + product thinker building **three.ws**. Read `CLAUDE.md`,
+`STRUCTURE.md`, and `prompts/production-campaign/00b-the-bar.md` first. **Prerequisites:** none
+(runs parallel to E1).
+
+## Why this matters for $1B
+MCP is how every agent runtime — Claude, Cursor, and the long tail of agent frameworks — reaches
+three.ws's capabilities (avatar forging, pump.fun launches, $THREE tools, x402 payments) without
+human glue. An MCP server that registers cleanly, exposes documented tools, and passes a live
+smoke test turns three.ws into infrastructure other agents *call*, which is the deepest form of
+the network-effects pillar (`00-README-orchestration.md` §4): we become a dependency, not a
+destination. A broken manifest or an undocumented tool means an agent silently can't use us.
+
+## Current state (read before you write)
+Eight MCP surfaces ship (names ↔ dirs per `STRUCTURE.md`):
+- `mcp-server/` → `@three-ws/mcp-server` v1.2.0 — primary surface; has `server.json`. Paid tools
+ (x402) per the MCP server instructions; `forge_free` is the one free tool.
+- `mcp-bridge/` → `@three-ws/mcp-bridge` v1.0.0 — has `tests/` + `npm run test:smoke`.
+- `packages/avatar-agent-mcp/` → `@three-ws/avatar-agent` v1.2.0 — avatar tools; has `test/`,
+ `npm run inspect`.
+- `packages/pumpfun-mcp/` → `@three-ws/pumpfun-mcp` — pump.fun launch tools.
+- `packages/ibm-watsonx-mcp/` → `@three-ws/ibm-watsonx-mcp` — watsonx.ai.
+- `packages/ibm-x402-mcp/` → `@three-ws/ibm-x402-mcp` — IBM x402; has `CATALOG.md`, `SUPPORT.md`.
+- `packages/three-token-mcp/` → `@three-ws/three-token-mcp` — $THREE token tools.
+- `packages/threews-avatar-mcp/` → `@three-ws/threews-avatar-mcp` — three.ws avatar ops; has `app/`.
+
+The gate scripts already exist and are wired as root npm scripts:
+`audit:mcp` → `scripts/audit-mcp-manifests.mjs`, `smoke:mcp` → `scripts/smoke-mcp-remotes.mjs`,
+`test:mcp` → `scripts/test-mcp-all.mjs`. Root MCP manifests live at the repo root:
+`server.json`, `server-3d.json`, `server-agent.json`, `server-bazaar.json`, `server-ibm.json`,
+`server-pumpfun.json`. Publish flow: `scripts/publish-mcp-servers.mjs` (`npm run publish:mcp`).
+**The gap: these gates are NOT enforced in `.github/workflows/ci.yml`** (grep confirms no CI job
+runs them), per-tool docs are uneven, and not every `server*.json` is verified valid against the
+audit. Read the three scripts before changing anything — extend, don't reimplement them.
+
+## Your mission
+### 1. Make `audit:mcp` green for every manifest
+Run `node scripts/audit-mcp-manifests.mjs` and fix every failure it reports across all
+`server*.json` (root) and each package's `server.json`. Manifests must be valid, complete, and
+consistent with each package's actual tool surface (name, version, description, tool list). Fix
+the manifests/packages — do not weaken the audit to pass.
+
+### 2. Make `smoke:mcp` and `test:mcp` green
+Run `node scripts/smoke-mcp-remotes.mjs` and `node scripts/test-mcp-all.mjs`. Every server must
+start, register, and respond to a tools/list (and a representative tools/call where the script
+exercises it) without throwing. Honor the paid-vs-free model: `forge_free` runs without payment;
+paid tools must return a well-formed `PaymentRequired` structuredContent when no x402 payload is
+present (per the MCP server instructions) — that is correct behavior, not a failure. Fix real
+breakage; keep `mcp-bridge`'s existing `test:smoke` passing too.
+
+### 3. Document every tool with example calls
+Each MCP server's `README.md` lists every tool it exposes with: purpose, input schema (params +
+types), an **example call** (the JSON arguments a client would send), and the shape of the
+result. State price for paid tools and "free" for `forge_free`. Match `ibm-x402-mcp/CATALOG.md`
+as the documentation bar; bring the thinner READMEs up to it. Tools must be discoverable from the
+README without reading `src/`.
+
+### 4. Enforce the gates in CI
+Add a **new named job** to `.github/workflows/ci.yml` (e.g. `mcp-gates`) that runs `npm run
+audit:mcp`, `npm run test:mcp`, and the smoke check appropriate for CI (`smoke:mcp` if it can run
+hermetically; otherwise gate the live-network parts behind a secret/env guard and still run the
+audit + test unconditionally) on every PR. Add a new named job — do not rewrite existing jobs
+(E1 also edits this file; coordinate by job name). The gates must actually fail the build on a
+bad manifest or a broken server.
+
+### 5. Verify the publish path and version hygiene
+Read `scripts/publish-mcp-servers.mjs`; confirm each package's `version` is semver-correct and
+the manifest version matches `package.json`. Run `npm run publish:mcp:dry` mentally/where safe to
+confirm no package is mis-staged. Do not actually publish.
+
+### 6. Wire one cross-surface connection
+The documented tool catalog you produce is consumed by E3 (docs API reference) and the AWS/Bazaar
+listings. Ensure the tool names + descriptions in `server*.json`, each README, and any
+`CATALOG.md` are **identical** so the docs site and discovery indexes render one consistent
+catalog. Note any naming drift you reconciled for E3.
+
+## Definition of done
+Clears `00b-the-bar.md` §6: `audit:mcp` / `smoke:mcp` / `test:mcp` all pass **and are enforced
+in CI**; every MCP server has a README documenting every tool with example calls; every
+`server*.json` manifest is valid. Inherits the **global definition of done** in
+`00-README-orchestration.md` (no mocks, `$THREE`-only, explicit-path staging, existing tests
+pass, self-reviewed diff). In your report, paste the final pass output of the three gate scripts
+and name the CI job you added.
+
+## Operating rules (override defaults)
+No mocks/fake data/placeholders/TODOs/stubs. `$THREE` is the only coin — `three-token-mcp` and
+every other server reference only `$THREE` (CA `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`);
+runtime-supplied mints in pump.fun launch tooling are the sole mechanical exception (CLAUDE.md).
+Stage explicit paths only (never `git add -A`). Own the MCP dirs (`mcp-server/`, `mcp-bridge/`,
+`packages/*-mcp/`), the root `server*.json` manifests, and the audit/smoke/test MCP scripts;
+**extend the existing servers and gate scripts, don't rewrite them.** Keep tools real (real RPC,
+real x402, real model proxies via env). Do not actually publish. Don't touch SDK dirs, `docs/`,
+or `examples/` (E1/E3/E4 own those).
+
+## When finished
+Run CLAUDE.md's five self-review checks. Ship one improvement (e.g. a generated tool-index that
+the docs can import, or a manifest-consistency assertion added to `audit-mcp-manifests.mjs`).
+Append a `data/changelog.json` entry (tag: `sdk` or `infra`) — holder-readable, e.g. "Every MCP
+server now passes audit + smoke + test gates in CI, with every tool documented." Run `npm run
+build:pages` to validate it. Then delete this prompt file
+(`prompts/production-campaign/E-ecosystem/E2-mcp-servers-production.md`) and report the gate
+output, the CI job name, and any tool-catalog seam E3 needs.
diff --git a/prompts/production-campaign/E-ecosystem/E3-docs-api-reference.md b/prompts/production-campaign/E-ecosystem/E3-docs-api-reference.md
new file mode 100644
index 000000000..b6b18b1e2
--- /dev/null
+++ b/prompts/production-campaign/E-ecosystem/E3-docs-api-reference.md
@@ -0,0 +1,99 @@
+# E3 — Docs Site & API Reference
+
+You are a senior engineer + product thinker building **three.ws**. Read `CLAUDE.md`,
+`STRUCTURE.md`, and `prompts/production-campaign/00b-the-bar.md` first. **Prerequisites:** E1
+(SDK surfaces) and E2 (MCP tool catalog) — you document what they finalize. You can start on
+layout, search, and the endpoint inventory before they land.
+
+## Why this matters for $1B
+Docs are the product surface that converts a curious developer into an integrated one. The
+ecosystem bar (`00b-the-bar.md` §6) is explicit: an outside dev reaches a working integration in
+**10 minutes from the published docs alone, without reading our source.** Every quickstart that
+runs, every endpoint that's documented, every link that resolves is a developer we keep. Docs are
+also how LLM agents learn us: `llms.txt` / `llms-full.txt` are how Claude/Cursor ingest the
+platform — and **both files are currently empty placeholders** (literally the strings "Placeholder
+for llms.txt" / "Placeholder for llms-full.txt"). That is a hole in the network-effects pillar.
+
+## Current state (read before you write)
+- `docs/` is rich but uneven: `index.html` (has a real `#search-input` / `.sidebar-search` UI —
+ verify it actually filters), `api-reference.md`, `quick-start.md`, `api/forge-x402.md`,
+ `embedding.md`, `architecture.md`, `authentication.md`, and many topic pages.
+- `docs/llms.txt` and `docs/llms-full.txt` are **0-line placeholders** — must be generated for
+ real (curated index + full corpus, per the llms.txt convention).
+- The public endpoints live in `api/` (100+ Vercel functions) and the SDK surfaces are finalized
+ by E1; the MCP tool catalog by E2. `docs/API_AUDIT.md` and `docs/ALL.md` exist — read them to
+ find the gaps rather than re-auditing from scratch.
+- There is a real status surface to link (the campaign's Track A wires Sentry/Axiom + a status
+ page); find the canonical status URL/page and link it, don't invent one.
+
+The gap: not every public endpoint and SDK/MCP surface is in the reference, some quickstarts are
+not verified runnable, `llms.txt`/`llms-full.txt` are empty, and search/status need to actually
+work.
+
+## Your mission
+### 1. Complete the API reference — every public endpoint
+Inventory the public `api/` endpoints (use `docs/API_AUDIT.md` + a grep of `api/` for exported
+handlers; exclude internal `api/_lib`). For each public endpoint document: method, path, auth
+(link `authentication.md`), request params/body, response shape, error codes, and a real
+`curl`/fetch example. Fold into `docs/api-reference.md` (or `docs/api/`) with consistent
+structure. Paid x402 endpoints document the 402 challenge + payment flow (extend the pattern in
+`docs/api/forge-x402.md`).
+
+### 2. Document every SDK and MCP surface (from E1/E2)
+Pull the finalized SDK quickstarts (`@three-ws/avatar`, `/walk`, `/page-agent`, `/tour`,
+`/agent-payments`) and the MCP tool catalog into the docs so they live in one navigable place —
+import path, minimal usage, link to the package README. Keep names/imports **identical** to E1's
+READMEs and E2's `server*.json` (single source of truth — if you find drift, fix the docs to
+match the package, and flag it). Every MCP tool listed with its example call.
+
+### 3. Quickstarts that actually run
+Take `docs/quick-start.md` and every embedded quickstart and **run them**. The first developer
+path must reach a visible result in under 10 minutes with copy-paste blocks — web-component embed,
+SDK install, one API call. No pseudo-code, no dead import paths. Fix anything that doesn't run;
+state which you executed.
+
+### 4. Generate real `llms.txt` and `llms-full.txt`
+Replace both placeholders. `llms.txt` = a curated, link-bearing index of the docs (the llms.txt
+convention: title, summary, sectioned links to the canonical pages). `llms-full.txt` = the full
+text corpus an agent can ingest. **Generate them from the docs tree with a script** (add e.g.
+`scripts/build-llms-txt.mjs` + an `npm run build:llms` and wire it so it stays current — not a
+one-time hand-write). Keep `$THREE` the only coin referenced anywhere in the corpus.
+
+### 5. Working search + a live status link
+Make `docs/index.html` search actually filter the doc set (client-side index over the page
+corpus is fine; debounce input, keyboard-navigable results, empty state when no match — all five
+states per `00b-the-bar.md` §3). Add a visible, working link to the platform **status page**
+(the real one from Track A) in the docs chrome. No dead links anywhere — verify every internal
+link resolves.
+
+### 6. Polish the docs to the screenshot bar
+The docs site itself is a primary surface: design tokens only (`public/tokens.css` /
+`DESIGN-TOKENS.md`), responsive 320/768/1440, dark/light parity, code blocks with copy buttons,
+loading/empty/error states for search, `prefers-reduced-motion` honored. It should be
+screenshot-worthy — Stripe/Vercel docs are the bar.
+
+## Definition of done
+Clears `00b-the-bar.md` §6 (10-min integration from docs alone) and §3 (every state designed):
+every public endpoint and SDK/MCP surface documented; quickstarts verified runnable; `llms.txt` +
+`llms-full.txt` generated and non-empty; search works; a live status link resolves; zero dead
+links. Inherits the **global definition of done** in `00-README-orchestration.md` (no mocks,
+`$THREE`-only, tokens only, every state, explicit-path staging, self-reviewed diff). Verify by
+running the quickstarts and exercising search in a browser; report which quickstarts you ran.
+
+## Operating rules (override defaults)
+No mocks/fake data/placeholders/TODOs/stubs — and that explicitly includes the `llms.txt`
+placeholders, which must become real generated content. `$THREE` is the only coin in every doc
+and the llms corpus. Stage explicit paths only (never `git add -A`). Own `docs/` (and a new
+`scripts/build-llms-txt.mjs`); **extend the existing docs site, don't rebuild it** — reuse the
+current `index.html` shell, nav, and tokens. Keep examples real (real endpoints, real keys via
+env). Don't touch SDK/MCP source or `examples/` (E1/E2/E4 own those) — document them, link to
+their READMEs.
+
+## When finished
+Run CLAUDE.md's five self-review checks. Ship one improvement (e.g. a "copy as curl" button, an
+auto-generated endpoint index, or per-page "edit on GitHub" links). Append a `data/changelog.json`
+entry (tag: `docs`) — holder-readable, e.g. "New docs: every API endpoint and SDK documented,
+runnable quickstarts, and machine-readable llms.txt for agents." Run `npm run build:pages` to
+validate it. Then delete this prompt file
+(`prompts/production-campaign/E-ecosystem/E3-docs-api-reference.md`) and report what you shipped,
+which quickstarts you ran, and any doc gap E4's examples should fill.
diff --git a/prompts/production-campaign/E-ecosystem/E4-examples-templates-starters.md b/prompts/production-campaign/E-ecosystem/E4-examples-templates-starters.md
new file mode 100644
index 000000000..1c8b297b1
--- /dev/null
+++ b/prompts/production-campaign/E-ecosystem/E4-examples-templates-starters.md
@@ -0,0 +1,98 @@
+# E4 — Examples, Templates & Starters
+
+You are a senior engineer + product thinker building **three.ws**. Read `CLAUDE.md`,
+`STRUCTURE.md`, and `prompts/production-campaign/00b-the-bar.md` first. **Prerequisites:** E1
+(the SDK quickstarts your examples import). Parallel-safe with E3.
+
+## Why this matters for $1B
+The shortest path from "interested" to "integrated" is a working example a developer can copy.
+The ecosystem bar (`00b-the-bar.md` §6) is a 10-minute integration — examples and starters are
+how a dev clears it without thinking. A `npx create`-style starter, an embeddable web component,
+a `two-agents` demo that just runs: each is a template thousands of devs fork, every fork a node
+in the network-effects graph (`00-README-orchestration.md` §4). Today the examples exist but
+there are **no framework starters at all** (no React/Next/vanilla scaffold under `examples/`),
+which is the most-requested on-ramp.
+
+## Current state (read before you write)
+`examples/` already holds: `embed-test.html`, `web-component.html`, `two-agents.html`,
+`minimal.html`, `agent-presence.html`, `bare-avatar.html`, `one-line-demo.html`,
+`three-concierge.html`, `widget-rpc.html`, `pump-fun-agent/`, `three-concierge/`, `skills/`,
+`agenc-task-roundtrip/`, `metamask-agent-wallet/`, and `coach-leo/` (`SKILL.md`,
+`instructions.md`, `manifest.json`). `multiplayer/` is a deployable demo (Dockerfile, fly.toml,
+Cloud Run script). The web components ship from the SDKs: `<agent-3d>` (`avatar-sdk/src`),
+`<page-agent>` (`page-agent-sdk/src/element.js` / `page-agent.js`), `<agent-presence>`
+(referenced by `examples/agent-presence.html` — verify the registration source).
+
+The gaps: not every example is verified runnable against current SDK builds; there is **no
+framework starter** (React, Next, or vanilla scaffold) a dev can clone-and-run; the web-component
+embed pages aren't a single coherent "embed in 3 lines" story; and `examples/README.md` may not
+index everything with a one-line "what/how to run" each.
+
+## Your mission
+### 1. Make every existing example actually run
+Open each file in `examples/` and run it against the **current** SDK builds and real three.ws
+endpoints. Fix dead import paths, stale API shapes, and anything that throws in console. Each of
+`embed-test`, `web-component`, `two-agents`, `minimal`, `agent-presence`, `bare-avatar`,
+`one-line-demo` must load with zero console errors and produce a visible result. Verify
+`coach-leo/` (`manifest.json` valid, instructions current) and that `multiplayer/` still
+builds/starts per its README.
+
+### 2. The three web-component embeds, perfected
+Make `<agent-3d>`, `<page-agent>`, and `<agent-presence>` each have a canonical, copy-paste
+3-line embed page that a dev can paste into any HTML and have working. Keep the registration
+source in the SDKs (E1 owns that) — here you build the *embed examples* that import the published
+script. Show real attributes/config, real avatar/agent IDs, all five states visible where
+relevant (loading skeleton, empty, error, populated). These are the screenshots that get shared.
+
+### 3. Framework starters (none exist — build them)
+Create runnable starter templates under `examples/` (e.g. `examples/starters/react`,
+`.../next`, `.../vanilla`). Each: a real, installable scaffold (`package.json`, README with
+`npm i && npm run dev`) that renders a three.ws agent via the appropriate SDK subpath
+(`@three-ws/avatar` React export for React/Next, the web component for vanilla). They must
+actually start and render against real endpoints — these are the "10-minute integration" proof.
+Wire env for any keys; never inline secrets.
+
+### 4. A coherent example index
+Rewrite `examples/README.md` as the front door: a table of every example + starter with one line
+("what it shows" + "how to run"), grouped (web components / starters / full demos / agent skills).
+Link each to the SDK it uses (E1's READMEs) and to the docs (E3). Every entry's run command
+verified. Empty/edge note where a key is required.
+
+### 5. Two-agents + multiplayer as the "wow" demos
+Polish `two-agents.html` and `multiplayer/` into the flagship "this is what you can build" demos —
+two agents conversing, presence in a shared space — against real backends. Make them
+screenshot-worthy and linkable (an OG-able landing). These are what a skeptic sees to believe the
+platform is real.
+
+### 6. Wire examples into the platform
+Examples shouldn't be an island: ensure the docs (E3) and any "Examples" nav surface link here,
+and that each example links back to its SDK README and a "deploy this" path where one exists
+(`multiplayer/` has deploy scripts). A dev should be able to go example → SDK → docs → deployed
+without a dead end.
+
+## Definition of done
+Clears `00b-the-bar.md` §6 (copy-paste to working integration in 10 min) and §3 (every state
+designed, screenshot test): every example runs with zero console errors; the three web components
+have canonical 3-line embeds; React/Next/vanilla starters exist and start; `examples/README.md`
+indexes everything with verified run commands. Inherits the **global definition of done** in
+`00-README-orchestration.md` (no mocks, `$THREE`-only, tokens where UI, every state,
+explicit-path staging, self-reviewed diff). Verify by running each example/starter; report which
+you ran and any that need a key you couldn't source.
+
+## Operating rules (override defaults)
+No mocks/fake data/placeholders/TODOs/stubs — examples hit **real** three.ws endpoints with real
+keys via env, never sample arrays or fake responses. `$THREE` is the only coin referenced in any
+example, demo, or starter (runtime-supplied mints in the pump.fun example are the sole mechanical
+exception per CLAUDE.md). Stage explicit paths only (never `git add -A`). Own `examples/`,
+`examples/coach-leo/`, `multiplayer/`, and new `examples/starters/*`; **import the published SDKs,
+don't fork or vendor their source** — if an example needs an SDK change, note it for E1, don't
+edit SDK `src/` here. Don't touch SDK/MCP source or `docs/` (E1/E2/E3 own those).
+
+## When finished
+Run CLAUDE.md's five self-review checks. Ship one improvement (e.g. a one-click CodeSandbox/StackBlitz
+link per starter, or an OG card for the two-agents demo). Append a `data/changelog.json` entry
+(tag: `sdk` or `docs`) — holder-readable, e.g. "New starter templates (React, Next, vanilla) and
+runnable examples — embed a live three.ws agent in three lines." Run `npm run build:pages` to
+validate it. Then delete this prompt file
+(`prompts/production-campaign/E-ecosystem/E4-examples-templates-starters.md`) and report what you
+shipped, which examples/starters you ran, and any SDK seam E1 still needs to close.
diff --git a/prompts/production-campaign/G-trust/00-README.md b/prompts/production-campaign/G-trust/00-README.md
new file mode 100644
index 000000000..171e3b87d
--- /dev/null
+++ b/prompts/production-campaign/G-trust/00-README.md
@@ -0,0 +1,71 @@
+# Track G — Trust, Compliance, Access & Brand
+
+**Goal:** make three.ws **safe, legal, accessible, and on-brand everywhere.** A platform
+worth $1B is trusted with money, lawful to operate globally, usable by everyone, and visually
+one product on every screen. This track hardens the four pillars that a regulator, an
+acquirer, an app-store reviewer, or a first-time international user checks *before* they
+trust us with anything: real legal pages + content moderation, WCAG 2.2 AA accessibility,
+production internationalization, and an enforced design system. These are not chores — they
+are the trust floor under everything Tracks A–F build.
+
+Read `prompts/production-campaign/00-README-orchestration.md` (the $1B thesis + global
+definition of done) and `00b-the-bar.md` (the measurable bars) before starting any prompt
+here. Each prompt is self-contained: paste it into a fresh agent chat, ship it end-to-end,
+verify for real, append a changelog entry if user-visible, then delete the prompt file. When
+this directory contains only this `00-README.md`, Track G is done.
+
+---
+
+## The four prompts
+
+| # | File | Mission | Key surfaces it owns |
+|---|------|---------|----------------------|
+| **G1** | [`G1-legal-moderation-abuse.md`](G1-legal-moderation-abuse.md) | Ship the platform Privacy Policy + Terms (footer already links them, they 404 today); extend moderation beyond anon-chat to Forge prompts, generated avatars/images, and agent profiles; build report + takedown + an admin queue; close rate-limit gaps and instrument the audit log. | `pages/legal/*`, `api/report.js`, `api/admin/reports.js`, `api/_lib/moderation.js`, `api/_lib/audit.js`, `api/_lib/rate-limit.js` |
+| **G2** | [`G2-accessibility-audit.md`](G2-accessibility-audit.md) | A real WCAG 2.2 AA audit: semantic HTML, landmarks, keyboard nav, focus management, ARIA on 3D/canvas controls, screen-reader labels, `prefers-reduced-motion`, contrast ≥ AA. Wire an axe check into CI. | `public/nav.js`/`public/nav.css`, `src/**` canvas surfaces, `.github/workflows/ci.yml` |
+| **G3** | [`G3-i18n-completeness.md`](G3-i18n-completeness.md) | Finish i18n: annotate + extract all surfaces, build all 11 configured locales via the real Groq pipeline, mount the locale switcher everywhere, make RTL correct, centralize `Intl` number/date/currency formatting, add an i18n lint gate. | `public/locales/*`, `src/i18n.js`, `src/format-intl.js`, `scripts/i18n-*.mjs`, `.i18nrc.json`, `.github/workflows/ci.yml` |
+| **G4** | [`G4-brand-design-system.md`](G4-brand-design-system.md) | Enforce the design system: eliminate hardcoded colors/spacing/fonts in favor of `public/tokens.css`, kill reintroduced legacy palettes (`--mk-*` … `--t-*`), unify buttons/cards/badges/skeletons, add a lint/audit that fails on token violations. | `public/tokens.css`, `public/style.css`, `scripts/verify-b09-tokens.mjs`, stylelint config, `.github/workflows/ci.yml` |
+
+---
+
+## Run order
+
+All four can run in parallel — they own distinct lanes. The natural priority:
+
+1. **G1 first** — the legal pages are a live broken promise (the footer links 404) and
+ moderation is the highest-trust gap. Foundational.
+2. **G2 and G3 in parallel** — independent surfaces (a11y vs. localization), no shared files
+ beyond the shared nav and the CI workflow.
+3. **G4 last (or re-run at the end)** — it is the **enforcement backstop**. G2's contrast
+ fixes and any other track's CSS must land in tokens; running G4's lint after the others
+ catches regressions they introduced. If run early, re-run `lint:tokens` once the track
+ finishes.
+
+**Shared-file coordination:** G2, G3, and G4 each add a job to
+`.github/workflows/ci.yml` (`a11y`, the i18n lint, `tokens`) — append, never reformat the
+file. G2 (contrast) and G4 (tokens) must agree: **every contrast fix is a token choice, not a
+new hardcoded color.** G1, G3, and the switcher styling all consume `public/tokens.css` — none
+of them introduce raw values.
+
+---
+
+## File-ownership map
+
+| Path | Owner |
+|------|-------|
+| `pages/legal/privacy.html`, `pages/legal/tos.html` | G1 |
+| `api/report.js`, `api/admin/reports.js`, new `content_reports` migration | G1 |
+| `api/_lib/moderation.js` (extend), `api/_lib/audit.js` (instrument), `api/_lib/rate-limit.js` (apply) | G1 |
+| `public/nav.js` / `public/nav.css` — landmarks, skip-link, focus order | G2 (a11y) + G3 (mount switcher) — coordinate |
+| `src/**` canvas/3D controls — ARIA, keyboard equivalents, `aria-live` | G2 |
+| `npm run test:a11y` + `a11y` CI job | G2 |
+| `public/locales/*.json`, `public/locales/manifest.json` | G3 |
+| `src/i18n.js`, `src/format-intl.js`, `scripts/i18n-*.mjs`, `.i18nrc.json` | G3 |
+| i18n lint CI job | G3 |
+| `public/tokens.css`, `public/style.css` — tokenization, no legacy palettes | G4 |
+| `scripts/verify-b09-tokens.mjs` (broaden), stylelint config, `npm run lint:tokens`, `tokens` CI job | G4 |
+| `data/changelog.json` | append-only, all four (never reformat) |
+| `.github/workflows/ci.yml` | append-only, G2/G3/G4 (one job each) |
+
+**Done buys us:** a platform that is lawful to run globally, safe for user-generated content,
+usable by keyboard-only and screen-reader users in 11 languages including RTL, and visually
+one product on every surface — the trust and universality a $1B platform is held to.
diff --git a/prompts/production-campaign/G-trust/G1-legal-moderation-abuse.md b/prompts/production-campaign/G-trust/G1-legal-moderation-abuse.md
new file mode 100644
index 000000000..d99bac19b
--- /dev/null
+++ b/prompts/production-campaign/G-trust/G1-legal-moderation-abuse.md
@@ -0,0 +1,38 @@
+# G1 — Legal pages, content moderation, abuse prevention & takedown
+
+You are a senior engineer + product thinker building **three.ws**. Read `CLAUDE.md`, `STRUCTURE.md`, and `prompts/production-campaign/00b-the-bar.md` first. **Prerequisites:** none (foundational for Track G; coordinate with G4 on token-only styling).
+
+## Why this matters for $1B
+A platform that takes money, hosts user prompts, and publishes AI-generated avatars/images cannot be trusted — or sold, or legally operated in the EU/US — without real terms, a privacy policy, and content moderation that actually blocks harmful material. The footer already promises `/legal/privacy` and `/legal/tos` (see `public/nav-data.js` → `DRAWER_LEGAL`), but those pages 404. Every regulator, acquirer, and app store reviewer checks these first. This is the trust floor: legitimate, defensible, safe.
+
+## Current state (read before you write)
+- **Legal pages are linked but missing.** `public/nav-data.js` lines ~252–254 link `/legal/privacy` and `/legal/tos`. `ls pages/` shows only `extension-privacy.html`, `extension-terms.html`, `irl-privacy.html` — there is **no platform-wide Privacy Policy or Terms of Use**. The footer links dead-end.
+- **Moderation exists but only for anonymous chat.** `api/_lib/moderation.js` is a fail-open NVIDIA NemoGuard content-safety pre-filter wired into `api/chat.js`, `api/chat/proxy.js`, `api/widgets/[id]/[action].js` only. **Forge prompts** (`api/forge.js`, `src/forge-prompt-studio.js`), **generated avatars/images**, and **agent profiles** have no moderation gate. `api/forge.js` mentions provider-side image moderation but runs no first-party text/asset safety pass.
+- **Audit log exists.** `api/_lib/audit.js` (`logAudit({ userId, action, resourceId, meta, req })`) writes to the `audit_log` table; `api/audit-log.js` serves it (JSON + CSV) to `/dashboard-next/account`. Migrations under `api/_lib/migrations/2026-05-*-audit-log*.sql`. It is under-instrumented — money/auth/moderation events should all land here.
+- **Rate limiting exists.** `api/_lib/rate-limit.js` (`limits`, `rateLimited` via `@upstash/ratelimit`). Audit which abusable endpoints actually apply it.
+- **No report/takedown path.** No `api/report*` endpoint, no admin moderation queue. `api/admin/` has revenue/withdrawals/users but no abuse surface.
+
+## Your mission
+### 1. Ship the Privacy Policy and Terms of Use pages
+Create `pages/legal/privacy.html` and `pages/legal/tos.html` (match the route in `DRAWER_LEGAL`; if the router needs a `pages/legal/` entry in `data/pages.json`, add it). Write real, accurate, plain-language legal copy covering: data collected (wallet addresses, prompts, generated assets, analytics), processors actually used (Solana RPC, OpenAI/Anthropic/NVIDIA worker proxies, Vercel, Upstash, Sentry/Axiom), retention (audit log 365d, generated-asset storage), cookie/local-storage usage, user rights (access/export/deletion — wire to the real audit-log CSV export and any account-delete path), and contact/DPO. Terms must cover acceptable use, prohibited content (the exact categories moderation enforces), IP ownership of generated assets, $THREE is the only token referenced, no investment advice, liability, and DMCA/takedown. Use **design tokens only** (`public/tokens.css`) and the shared nav/footer — these pages must clear the polish bar (TOC, last-updated date, anchor links, all five states are trivially "populated" but typography/spacing must match the platform).
+
+### 2. Extend moderation to Forge prompts, generated assets, and agent profiles
+Generalize `api/_lib/moderation.js` (or add a sibling `api/_lib/content-moderation.js` that reuses its NemoGuard call) so every user-generated-content boundary runs a real safety pass: Forge text prompts before generation (`api/forge.js`, `src/forge-prompt-studio.js`), generated **image/avatar** outputs (image-safety classifier on the NVIDIA NIM lane already in use), and agent-profile free-text fields. For signed-in attributable surfaces this can **fail-closed on a confident "unsafe" verdict** (unlike anon chat's fail-open) — refuse with a clear, non-judgmental message and a path forward. Every refusal calls `logAudit({ action: 'moderation.block', ... })`. No mocks — real classifier calls with real timeouts and graceful degradation.
+
+### 3. Build report + takedown
+Add `api/report.js` (signed-in or captcha-gated POST: `{ targetType, targetId, reason, detail }`) that writes to a `content_reports` table (new migration in `api/_lib/migrations/`), rate-limited via `api/_lib/rate-limit.js`, audit-logged. Surface a "Report" affordance on user-generated surfaces (Forge gallery items, agent profiles) — accessible button, tokenized styling, confirmation state. Add an admin moderation queue under `api/admin/reports.js` (reuse the existing admin auth pattern in `api/admin/`) that lists open reports and lets an admin resolve/take down, writing the takedown to the audit log and flipping a visibility flag on the target.
+
+### 4. Close abuse / rate-limit gaps and instrument the audit log
+Sweep the abusable, money- and compute-touching endpoints (Forge generation, mint/launch, x402 checkout, auth, report) and ensure each applies `rateLimited`/`limits` with sane per-identity budgets. Add `logAudit` calls to the security-relevant events that aren't yet covered: login/logout, withdrawal, mint/launch, moderation block, report filed, takedown. Confirm the existing `/dashboard-next/account` action-log panel renders the new event types correctly (label them human-readably).
+
+### 5. Verify end-to-end
+`npm run dev`, walk: footer → privacy/tos render with no console errors; a known-harmful Forge prompt is refused and audit-logged; a report submits and appears in the admin queue; a takedown hides the target and logs. Confirm existing tests pass (`npm test`); add a unit test for the moderation classifier's verdict parsing and the report endpoint's validation/rate-limit boundary.
+
+## Definition of done
+Clears 00b's **trust & correctness bars** (inputs validated at the boundary, rate-limited where abusable, honest UI) and **polish bars** (legal pages screenshot-worthy, every state designed). Inherits the global definition of done in `00-README-orchestration.md`: real APIs (no mocked classifier), `$THREE` only, design tokens only, zero console errors, existing + new tests pass, changelog entry, explicit-path staging. Footer legal links resolve; no dead path remains. Moderation refusals and takedowns are all auditable.
+
+## Operating rules (override defaults)
+No mocks/fake data/placeholders/TODOs/stubs. `$THREE` is the only coin — the legal copy and prohibited-content list reference no other token. Design tokens only (`public/tokens.css`); no hardcoded colors/spacing/fonts on the new pages or report UI. Stage explicit paths only (never `git add -A`). Own the legal-pages + moderation + report/takedown + audit-instrumentation lane; extend `api/_lib/moderation.js`, `api/_lib/audit.js`, and `api/_lib/rate-limit.js` — do not rewrite them.
+
+## When finished
+Run the self-review (CLAUDE.md's five checks). Ship one improvement (e.g. a per-user "your reports" status, or a cookie-consent banner wired to analytics opt-out). Append a `data/changelog.json` entry (tag: `security`) — holder-readable ("Added our Privacy Policy and Terms, content moderation on generated assets, and a report/takedown flow"). Then delete this prompt file (`prompts/production-campaign/G-trust/G1-legal-moderation-abuse.md`) and report what you shipped + the seam for the next agent (e.g. which surfaces still lack a Report button, or any moderation category needing tuning).
diff --git a/prompts/production-campaign/G-trust/G2-accessibility-audit.md b/prompts/production-campaign/G-trust/G2-accessibility-audit.md
new file mode 100644
index 000000000..d2024e87c
--- /dev/null
+++ b/prompts/production-campaign/G-trust/G2-accessibility-audit.md
@@ -0,0 +1,38 @@
+# G2 — WCAG 2.2 AA accessibility audit across all surfaces
+
+You are a senior engineer + product thinker building **three.ws**. Read `CLAUDE.md`, `STRUCTURE.md`, and `prompts/production-campaign/00b-the-bar.md` first. **Prerequisites:** none (runs in parallel; coordinate with G4 — contrast fixes must use `public/tokens.css`, not new hardcoded colors).
+
+## Why this matters for $1B
+A billion-dollar platform serves everyone — including keyboard-only, screen-reader, low-vision, and motion-sensitive users — and it is legally required to (ADA, EAA, Section 508). `00b-the-bar.md` already lists "keyboard-navigable, screen-reader-labelled, `prefers-reduced-motion` honored, contrast ≥ WCAG AA" as part of the polish bar on **every** surface. We have a 3D-heavy product (canvas controls are the hardest a11y problem there is) and 125+ pages. An automated gate plus a real manual pass is the only way to hold this bar as the surface area grows.
+
+## Current state (read before you write)
+- **No a11y tooling in CI.** `.github/workflows/ci.yml` runs lint, vitest, source guards, typecheck — no axe, no pa11y, no Lighthouse a11y. `.lighthouserc.json` exists but isn't wired into CI either.
+- **`prefers-reduced-motion` is partially adopted.** `grep -rl "prefers-reduced-motion" public/*.css` shows ~10 stylesheets honor it (`home.css`, `features.css`, `auth.css`, `galaxy.css`, …) — but coverage is inconsistent and the 3D scenes/animations are the highest-risk omission.
+- **3D/canvas controls are the core gap.** `src/` Three.js surfaces (avatar presence, Forge viewer, feature-tour, scene-studio) expose orbit/zoom/pose controls on `<canvas>` with no ARIA, no keyboard equivalents, no screen-reader description of what the canvas shows.
+- **Design tokens exist for contrast.** `public/tokens.css` defines the ink/surface palette (`--ink`, `--ink-dim`, `--ink-faint`, surfaces). Contrast failures must be fixed by adjusting/choosing the right **token**, never by hardcoding a hex (that's G4's lane — stay aligned).
+- Shared chrome lives in `public/nav.js` / `public/nav.css` (skip-link, focus order, drawer) — fixes there propagate everywhere.
+
+## Your mission
+### 1. Wire an automated axe check into CI
+Add `@axe-core/cli` or `@axe-core/playwright` (we already run Playwright — `npm run test:e2e`) as a real a11y test that loads the primary surfaces (home, marketplace, Forge, dashboard-next, an agent profile, a legal page) at 1440px and 375px and asserts **zero serious/critical violations**. Add an `a11y` job to `.github/workflows/ci.yml` that runs it on every PR and **fails on regressions**. Add an `npm run test:a11y` script. Use real page loads (`npm run dev` / preview server) — no static snapshots.
+
+### 2. Fix semantic structure, landmarks, and keyboard navigation
+Sweep the shared chrome first (`public/nav.js`, `public/nav.css`): one `<h1>` per page, correct heading order, landmark roles (`<nav>`, `<main>`, `<footer>`), a working **skip-to-content** link, logical tab order, and visible focus indicators on every interactive element (use the token-based focus ring; never `outline: none` without a replacement). Then fix the per-page violations axe surfaces. Every link goes somewhere, every button is reachable and operable by keyboard (Enter/Space), modals/drawers trap focus and restore it on close, and `Esc` closes overlays.
+
+### 3. Make the 3D/canvas controls accessible
+This is the headline. For each interactive `<canvas>` surface in `src/` (avatar presence, Forge viewer, scene controls): add an accessible name + `role`/`aria-label` describing what's rendered, provide **keyboard-operable equivalents** for orbit/zoom/reset (arrow keys / +/- / a reset button) exposed as real buttons with ARIA, announce meaningful state changes via an `aria-live` region (e.g. "Avatar loaded", "Generating…"), and ensure a non-canvas fallback/description so a screen-reader user understands the content. Respect `prefers-reduced-motion` on the auto-rotate/idle animations.
+
+### 4. Complete `prefers-reduced-motion` and contrast coverage
+Extend reduced-motion handling to every animated surface (especially 3D auto-rotate, galaxy/particle backgrounds, marquees, skeleton shimmer) so motion-sensitive users get a still, usable experience — consolidate into a shared rule where possible. Run a contrast audit against WCAG 2.2 AA (4.5:1 body, 3:1 large/UI components, plus the 2.2 additions: focus-not-obscured, target-size ≥ 24px, dragging alternatives); fix every failure by selecting the correct **token** (coordinate with G4) and bumping focus-ring/target sizes where needed.
+
+### 5. Add ARIA to dynamic states and verify with a real screen reader
+Ensure loading/empty/error/toast states announce to assistive tech (`aria-live`, `role="status"`/`role="alert"`), form fields have associated `<label>`s and `aria-describedby` for errors, and images/icons have alt text or `aria-hidden` as appropriate. Verify the primary flows end-to-end with keyboard-only and VoiceOver/NVDA: visitor lands → tabs to Forge → generates → result is announced. Document the manual pass results.
+
+## Definition of done
+Clears 00b's **polish bar**'s explicit a11y clause on every audited surface (keyboard-navigable, screen-reader-labelled, reduced-motion honored, contrast ≥ AA) and adds the missing automated gate. Inherits the global definition of done in `00-README-orchestration.md`: real page loads (no mocks), `$THREE` only, design tokens only (contrast fixes via tokens), zero new console errors, existing + new tests pass, the new `a11y` CI job is green and enforced. Axe reports zero serious/critical on the primary surfaces; 3D controls are fully keyboard-operable.
+
+## Operating rules (override defaults)
+No mocks/fake data/placeholders/TODOs/stubs. `$THREE` is the only coin. **Design tokens only** (`public/tokens.css`) — every contrast/focus fix references a token, never a new hardcoded color (G4 enforces this platform-wide). Stage explicit paths only (never `git add -A`). Own the a11y lane (axe CI job, ARIA, keyboard nav, reduced-motion, focus management); extend `public/nav.js`/`public/nav.css` and the `src/` canvas surfaces — do not rewrite them or fork their styling.
+
+## When finished
+Run the self-review (CLAUDE.md's five checks). Ship one improvement (e.g. a global "reduce motion" user toggle persisted to local storage, or a keyboard-shortcut help overlay). Append a `data/changelog.json` entry (tag: `improvement`) — holder-readable ("Full keyboard navigation, screen-reader labels on 3D controls, and an automated accessibility check on every release"). Then delete this prompt file (`prompts/production-campaign/G-trust/G2-accessibility-audit.md`) and report what you shipped + the seam for the next agent (which surfaces still trip axe, any 3D control needing deeper work).
diff --git a/prompts/production-campaign/G-trust/G3-i18n-completeness.md b/prompts/production-campaign/G-trust/G3-i18n-completeness.md
new file mode 100644
index 000000000..e4c1ebb9b
--- /dev/null
+++ b/prompts/production-campaign/G-trust/G3-i18n-completeness.md
@@ -0,0 +1,41 @@
+# G3 — Internationalization to production: full coverage, RTL, locale-aware formatting, lint gate
+
+You are a senior engineer + product thinker building **three.ws**. Read `CLAUDE.md`, `STRUCTURE.md`, `prompts/production-campaign/00b-the-bar.md`, and `docs/i18n.md` first. **Prerequisites:** none (parallel; G4 owns tokens — the locale switcher must use them).
+
+## Why this matters for $1B
+A platform worth $1B is used worldwide. The audience is crypto-native developers and creators across every market; copy that only renders in English caps the addressable market and signals a regional product, not a global one. The i18n pipeline already exists and is architecturally sound (the LobeHub static-catalog model) — but it's only **partially built out**: two locales actually ship, RTL is wired but untested, and most pages aren't annotated. Finishing this turns a scaffold into real global reach.
+
+## Current state (read before you write)
+- **Pipeline exists and is well-designed.** `.i18nrc.json` configures the entry catalog (`public/locales/en.json`), 10 target locales (`es, zh-CN, ja, ko, fr, de, pt-BR, ar, hi, ru`), RTL locales (`ar, he, fa, ur`), the Groq LLM provider, and a `doNotTranslate` glossary that already protects `$THREE`, the contract address, `x402`, `Solana`, `USDC`, brand terms. `scripts/i18n-extract.mjs` derives the catalog from `data-i18n` annotated HTML; `scripts/i18n-translate.mjs` translates incrementally; `scripts/i18n-translate.mjs --lint` (`npm run i18n:lint`) checks. `docs/i18n.md` documents the whole flow.
+- **Runtime is built.** `src/i18n.js` exports `setLocale` / `getLocale` / `initI18n` / `translate` / `t`, swaps the DOM at runtime, sets `document.documentElement.dir = 'rtl'|'ltr'` from the manifest, fires an `i18n:change` event, and registers a `<lang-switcher>` web component that self-hides on single-language deploys.
+- **But coverage is thin.** `public/locales/` contains only `en.json`, `es.json`, `manifest.json` — the manifest lists just `en` + `es`. The 10 configured target locales aren't built. Most of the 125+ HTML pages aren't `data-i18n`-annotated, so they render English-only regardless of locale.
+- **No i18n gate in CI.** `.github/workflows/ci.yml` doesn't run `i18n:lint`. Drift (missing keys, stale translations, un-annotated copy) goes uncaught.
+- **Locale-aware formatting is not centralized.** Numbers, dates, currency (USDC amounts, $THREE balances, timestamps) are formatted ad hoc, not via `Intl` keyed to the active locale.
+
+## Your mission
+### 1. Annotate the remaining surfaces and extract a complete catalog
+Sweep the user-facing pages under `pages/**` and `public/**` (the `htmlExtract.entry` globs in `.i18nrc.json`) and add `data-i18n` / `data-i18n-html` / `data-i18n-attr` annotations to user-visible copy per `docs/i18n.md` — including `<title>`/`<meta>` for SEO per locale. Run `npm run i18n:extract` to regenerate `public/locales/en.json`. Do **not** annotate code identifiers, addresses, or glossary terms; rely on `doNotTranslate`.
+
+### 2. Build all configured locales for real
+Run `npm run i18n:translate` (Groq provider — locate `GROQ_API_KEY` in `.env`/`vercel env`; the script must use the real LLM, no stub catalogs) to produce `public/locales/{es,zh-CN,ja,ko,fr,de,pt-BR,ar,hi,ru}.json`. Update `public/locales/manifest.json` so the switcher lists every built locale with the correct `dir`. Spot-check that the glossary held ($THREE etc. untranslated) and that RTL locales carry `dir: "rtl"`.
+
+### 3. Surface a polished locale switcher everywhere
+Ensure the `<lang-switcher>` from `src/i18n.js` is mounted in the shared nav/footer (`public/nav.js`) so it's reachable on every page, and that `initI18n()` runs on boot before paint to avoid an English flash. Style it with **design tokens only** (`public/tokens.css`). It must be keyboard-accessible and screen-reader-labelled (coordinate with G2), persist the chosen locale, and respect the browser's `Accept-Language` on first visit.
+
+### 4. Make RTL real
+With Arabic now built, audit the platform in `dir="rtl"`: logical CSS properties (`margin-inline`, `padding-inline`, `inset-inline`) instead of left/right where direction matters, mirrored icons/chevrons, correct text alignment, and nav/drawer/layout that don't break. Fix the RTL-specific breakages in the shared chrome and primary surfaces. The page must look intentional in Arabic, not like flipped English.
+
+### 5. Centralize locale-aware formatting + add the lint gate
+Add a small formatting helper (e.g. `src/format-intl.js`) wrapping `Intl.NumberFormat` / `Intl.DateTimeFormat` keyed to `getLocale()`, and route user-visible numbers, dates, relative times, and currency (USDC, $THREE balances) through it so they format correctly per market (decimal/grouping separators, date order). Then add an **i18n lint job** to `.github/workflows/ci.yml` running `npm run i18n:lint` — failing the build on missing/stale keys or un-annotated regressions — so the catalog can't drift.
+
+### 6. Verify
+`npm run dev`, switch through several locales including Arabic: copy swaps with no English flash, no console errors, RTL layout holds, numbers/dates/currency format per locale, the switcher is keyboard-operable. Confirm existing tests pass; the pure helpers in `src/i18n.js` are already test-friendly — add tests for the new `Intl` formatter and any new resolve logic.
+
+## Definition of done
+Clears 00b's **polish bar** (universal, screenshot-worthy in every locale incl. RTL) and the global definition of done in `00-README-orchestration.md`: real LLM translation (no stub catalogs), `$THREE` only and untranslated, design tokens only on the switcher, zero console errors, existing + new tests pass, the new i18n CI gate green and enforced. All 11 locales build, the switcher is on every page, RTL is correct, and formatting is locale-aware.
+
+## Operating rules (override defaults)
+No mocks/fake data/placeholders/TODOs/stubs — translations come from the real Groq pipeline, not hand-typed filler. `$THREE` (and the contract address) is the only coin and stays in `doNotTranslate`, untranslated in every locale. Design tokens only (`public/tokens.css`) for the switcher. Stage explicit paths only (never `git add -A`) — the generated `public/locales/*.json` are append/regenerate outputs, commit them deliberately. Own the i18n lane; extend `src/i18n.js`, the i18n scripts, and `.i18nrc.json` — do not rewrite the pipeline.
+
+## When finished
+Run the self-review (CLAUDE.md's five checks). Ship one improvement (e.g. per-locale OG/meta so shared links unfurl in the reader's language, or a `hreflang` set in `<head>` for SEO). Append a `data/changelog.json` entry (tag: `improvement`) — holder-readable ("three.ws now speaks 11 languages, including right-to-left, with a built-in language switcher"). Then delete this prompt file (`prompts/production-campaign/G-trust/G3-i18n-completeness.md`) and report what you shipped + the seam for the next agent (any surfaces still un-annotated, locales needing copy review).
diff --git a/prompts/production-campaign/G-trust/G4-brand-design-system.md b/prompts/production-campaign/G-trust/G4-brand-design-system.md
new file mode 100644
index 000000000..f22f73ffe
--- /dev/null
+++ b/prompts/production-campaign/G-trust/G4-brand-design-system.md
@@ -0,0 +1,38 @@
+# G4 — Enforce the design system everywhere (tokens-only, no legacy palettes, token lint gate)
+
+You are a senior engineer + product thinker building **three.ws**. Read `CLAUDE.md`, `STRUCTURE.md`, `prompts/production-campaign/00b-the-bar.md`, and `DESIGN-TOKENS.md` (the spec) first. **Prerequisites:** none — but this track is the **enforcement backstop** for G2 (contrast fixes) and the whole campaign. Run it late enough to catch others' regressions, or re-run the lint at the end.
+
+## Why this matters for $1B
+Brand consistency is how trust is *communicated before it is earned* (00b's polish pillar). Vercel, Linear, and Stripe feel like one product on every screen because every color, space, and font flows from one vocabulary. three.ws already did the hard migration — `DESIGN-TOKENS.md` records that **eight legacy per-surface palettes** (`--mk-*`, `--pd-*`, `--ibm-*`, `--gx-*`, `--ho-*`, `--saas-*`, `--sdk-*`, `--t-*`) were removed in B02 — but with concurrent agents shipping daily, hardcoded hexes and forked palettes creep back in. Without an automated gate, the system erodes one PR at a time. This track makes the design system *enforceable*, not aspirational.
+
+## Current state (read before you write)
+- **The token system is canonical and documented.** `public/tokens.css` is the single source of truth (ink, surface, stroke, accent, `--space-*` on a φ=1.618 scale, radius, shadow, blur, motion). `public/style.css` `@import`s it then layers component tokens (buttons, cards, badges, skeleton); `public/nav.css` `@import`s it too, so every page is covered via `/style.css` or the shared nav. `DESIGN-TOKENS.md` is the full vocabulary + migration guidance; `docs/btn-pill-migration.md` documents the pill-button migration.
+- **`--nxt-*` (app shell) and `--nv-*` (nav) are intentional alias layers** that resolve *to* the canonical tokens via `var(--surface-1, …)`. Keep them as aliases — do **not** fork them into standalone palettes.
+- **A token verifier exists but isn't a gate.** `scripts/verify-b09-tokens.mjs` launches puppeteer, loads a few pages (home, marketplace, dashboard-next, pump-dashboard), and flags off-scale radii/spacing — but it covers only 4 pages, isn't an `npm` script, and isn't in `.github/workflows/ci.yml`. So drift goes unmeasured.
+- **No CSS lint for hardcoded values.** `eslint.config.js` lints JS only; there's no stylelint catching raw hexes/rgba/px-spacing in CSS, and nothing catching reintroduced `--mk-*`/`--pd-*`/legacy-namespace declarations.
+- **Component consistency is uneven.** Buttons/cards/badges/skeletons are tokenized in `style.css`, but per-surface CSS files may redefine them or hardcode values.
+
+## Your mission
+### 1. Sweep and eliminate hardcoded colors, spacing, and fonts
+Grep the first-party CSS (`public/**/*.css`, any `src/**` inline styles, `pages/**` `<style>` blocks) for raw `#hex` / `rgb()/rgba()` / hardcoded `px` spacing / literal `font-family` stacks that a token already expresses, and replace each with the correct `var(--token)` from `public/tokens.css`. Where a value genuinely has no token (rare), add it to `tokens.css` as a named primitive and reference it — never leave a magic number. Preserve intentional exceptions (vendored libs already ignored in `eslint.config.js`, true one-off media-query thresholds) and document them.
+
+### 2. Kill any reintroduced legacy palettes
+Search for the eight removed namespaces (`--mk-*`, `--pd-*`, `--ibm-*`, `--gx-*`, `--ho-*`, `--saas-*`, `--sdk-*`, `--t-*`) and any other forked per-surface palette. Replace each declaration with the canonical token (or, for a legitimately distinct brand accent like IBM Carbon at `/ibm/*`, express it as a small theme layer that **remaps** tokens per `tokens.css`'s guidance — never a standalone set). Confirm `--nxt-*`/`--nv-*` remain thin aliases, not forks.
+
+### 3. Normalize buttons, cards, badges, and skeletons
+Ensure every button uses the canonical pill-button classes (`docs/btn-pill-migration.md`), every card/badge/skeleton uses the component tokens layered in `style.css`, and no per-surface file redefines them with hardcoded values. Loading skeletons must match the populated layout and use the token-based shimmer (respecting `prefers-reduced-motion` — coordinate with G2). The result: a button on `/forge` is visually identical to one on `/marketplace`.
+
+### 4. Build the token lint gate
+Add a real, fast lint that **fails the build on token violations**: configure **stylelint** with a custom rule set (or extend `scripts/verify-b09-tokens.mjs` into a static-analysis pass that doesn't need a browser) that flags raw hex/rgba in first-party CSS, off-scale spacing/radius literals, and any legacy-namespace (`--mk-*` etc.) declaration. Expose it as `npm run lint:tokens`. Broaden `verify-b09-tokens.mjs` to cover the primary surfaces (not just 4). Add a `tokens` job to `.github/workflows/ci.yml` that runs the lint on every PR. The gate must catch a reintroduced hardcoded color and a forked palette.
+
+### 5. Verify
+`npm run dev`, visually diff the touched surfaces at 320/768/1440px — nothing shifted, everything is on-brand, buttons/cards/badges/skeletons are consistent. `npm run lint:tokens` passes on a clean tree and fails on a deliberately-injected raw hex (then revert it). Confirm existing tests pass (`npm test`) and the new CI job is green.
+
+## Definition of done
+Clears 00b's **polish bar** (consistent tokens, spacing rhythm, typography; every surface on-brand and screenshot-worthy) and makes it *enforceable*. Inherits the global definition of done in `00-README-orchestration.md`: `$THREE` only, **design tokens only** (this track defines that bar for the platform), zero console errors, zero visual regressions, existing tests pass, the new `tokens` CI gate green and enforced. No first-party hardcoded color/spacing/font remains where a token exists; no legacy palette is reintroduced.
+
+## Operating rules (override defaults)
+No mocks/fake data/placeholders/TODOs/stubs. `$THREE` is the only coin. **Design tokens only** (`public/tokens.css`) — this track ENFORCES that everywhere; the only new raw values allowed are net-new named primitives added *to* `tokens.css`. Stage explicit paths only (never `git add -A`) — and per CLAUDE.md, watch the `npx vercel build` trap that overwrites `api/*.js`/`public/*` with bundles before committing. Own the design-system-enforcement lane; extend `tokens.css`, `style.css`, `scripts/verify-b09-tokens.mjs`, and `eslint.config.js`/stylelint config — do not rewrite the token vocabulary or rename the canonical prefix.
+
+## When finished
+Run the self-review (CLAUDE.md's five checks). Ship one improvement (e.g. a `/design-tokens` living style-guide page rendering the vocabulary from `tokens.css`, or a pre-commit hook running `lint:tokens`). Append a `data/changelog.json` entry only if user-visible (tag: `improvement` or `docs`) — a pure-CI lint addition is an internal chore and gets **no** entry; a visible style-guide page or unified components do. Then delete this prompt file (`prompts/production-campaign/G-trust/G4-brand-design-system.md`) and report what you shipped + the seam for the next agent (any surface still carrying hardcoded values you couldn't tokenize, or a missing primitive).
diff --git a/prompts/production-readiness/09-security-review.md b/prompts/production-readiness/09-security-review.md
new file mode 100644
index 000000000..7af2f4022
--- /dev/null
+++ b/prompts/production-readiness/09-security-review.md
@@ -0,0 +1,70 @@
+# 09 — Security review: payments, wallets, contracts
+
+**Phase 2. [parallel-safe]** with 07–08, 10–11. Authorized internal security
+review of our own platform.
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 3D AI-agent platform with real money flows:
+Solana + x402 USDC payments, pump.fun launches, agent wallets, on-chain identity
+(`contracts/`, ERC-8004), skill-license NFTs, SNS pay-by-name. Read
+[CLAUDE.md](../../CLAUDE.md). The only coin is **$THREE**. There is a
+`/security-review` skill and `docs/audits/` — use them.
+
+## Objective
+
+A focused security review of every surface where value moves or trust is
+asserted, with each finding either fixed or filed with a concrete remediation.
+This is defensive review of our own code — not exploitation of third parties.
+
+## Why it matters
+
+A token platform is a target. One reentrancy bug in a contract, one missing
+signature check in a payment verifier, one replayable x402 receipt, one agent
+wallet that can be drained — any of these ends the company. Billion-dollar trust
+is earned by being provably hard to rob.
+
+## Instructions
+
+1. **Run the built-in review** on the current tree and capture output:
+ - Invoke the `/security-review` skill (or `npm run` equivalent if wired).
+ - `npm audit --omit=dev` for dependency CVEs; triage criticals.
+2. **Payments / x402** (`api/x402*`, `public/x402*.js`, `x402-buildout/`):
+ - Verify payment receipts can't be replayed (nonce/expiry checked).
+ - Verify the amount/asset/recipient in the signed payload match what the
+ server charges — no client-trusted price.
+ - Verify settlement is idempotent and that a failed settlement can't grant
+ access. Confirm the facilitator/verifier responses are validated, not
+ trusted blindly.
+3. **Wallets & custody** (`public/wallet/`, agent-wallet prompts, session keys):
+ - Confirm private keys / seed material never touch the client or logs.
+ - Review any server-side signing: least privilege, bounded amounts, no
+ arbitrary-instruction signing from unvalidated input.
+ - SIWE/session: nonce, domain binding, expiry, and that a session can't be
+ replayed or fixated.
+4. **On-chain programs** (`contracts/`, Anchor + Foundry):
+ - Review access control (who can mint/close/transfer), integer overflow,
+ PDA/seed derivation, signer checks, and reentrancy where applicable.
+ - Run the contract test suites; add tests for any unchecked authority.
+5. **Web app**: XSS in any place user content is rendered (agent names, chat,
+ profiles) — confirm output is escaped/sanitized; CSP headers present;
+ no `dangerouslySetInnerHTML`/`innerHTML` with untrusted input; SSRF in any
+ server-side fetch that takes a user URL; open-redirect in auth callbacks.
+6. **Secrets**: cross-check with [07](07-secrets-and-env-hardening.md) — no key
+ in client, no token in logs.
+7. **Write `docs/audits/security-review-YYYY-MM-DD.md`**: each finding with
+ severity (crit/high/med/low), location, impact, and status (fixed | filed).
+ Fix all crit/high in this task; file med/low with owners.
+
+## Definition of done
+
+- [ ] `/security-review` + `npm audit` run; results captured in the report.
+- [ ] x402 replay, amount-tampering, and idempotency checks verified or fixed.
+- [ ] No private key/seed reachable from client or logs (confirmed).
+- [ ] Contract access-control / signer / overflow review done; contract tests
+ pass; new tests added for any gap found.
+- [ ] XSS / CSP / SSRF / open-redirect checks done on user-content surfaces.
+- [ ] `docs/audits/security-review-<today>.md` committed with severity-rated
+ findings; all critical & high fixed.
+- [ ] Changelog: `security` entry for any user-relevant hardening (never disclose
+ an unpatched vuln in the public changelog).
diff --git a/prompts/readiness/00-README-orchestration.md b/prompts/readiness/00-README-orchestration.md
new file mode 100644
index 000000000..ef993ee7a
--- /dev/null
+++ b/prompts/readiness/00-README-orchestration.md
@@ -0,0 +1,120 @@
+# Production-Readiness Program — Road to $1B
+
+> A concurrent agent may also be authoring a parallel track in
+> [`../road-to-1b/`](../road-to-1b/). The two overlap and complement each other —
+> that one leans into per-surface end-to-end prompts (forge, marketplace,
+> scene-studio, wallet/x402, pumpfun, mcp, sdk-publishing, load-testing); this one
+> leans into cross-cutting hardening + the audit/launch/incident spine. Pick one
+> track, or merge them once both are finished. This file documents **this**
+> directory only.
+
+This directory is a **sequenced program of self-contained prompts**. Each `.md`
+file is a complete task brief you paste into a **fresh agent chat** at
+`/workspaces/three.ws`. Run them in order within a phase; phases mostly gate on
+the one before. Every prompt is written to be run with zero prior context — it
+restates where it is, what the codebase is, and which rules apply.
+
+## The thesis
+
+A platform reaches a billion-dollar valuation on three things this program
+drives toward:
+
+1. **It works, completely.** No dead buttons, no half-wired flows, no fake data,
+ no TODOs shipped to users. (Phase 1)
+2. **It never goes down and never leaks.** Hardened APIs, resilient external
+ calls, real observability, a real security posture. (Phase 2–3)
+3. **People can't stop using it and telling others.** Fast, polished, accessible,
+ shareable, monetized, instrumented. (Phase 4–6)
+
+We do not get there with "good enough." Read [CLAUDE.md](../../CLAUDE.md) before
+every task — it is the operating contract. The relevant non-negotiables:
+
+- No mocks, no fake data, no placeholders, no TODO comments, no stubs.
+- The only coin is **$THREE** (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`).
+- Every user-visible change gets a `data/changelog.json` entry.
+- Stage explicit paths only (concurrent agents share this worktree). Never
+ `git add -A`. Re-check `git status` before committing.
+- Push to **both** remotes (`threeD`, `threews`) when asked to push. Never pull
+ from `threeD`.
+
+## How to run
+
+1. Open a new chat in this repo.
+2. Paste the entire contents of one prompt file.
+3. Let the agent finish, verify its Definition of Done, then move to the next.
+4. Prompts marked **[parallel-safe]** can run simultaneously in separate chats
+ (they touch disjoint surfaces). Prompts marked **[serial]** must run alone.
+
+## The baseline (measured 2026-06-21, will change as you work)
+
+These are the concrete gaps this program closes. Re-run the discovery commands
+inside each prompt to get the live number — do not trust this snapshot.
+
+| Signal | Count | Closed by |
+|---|---|---|
+| TODO / FIXME / placeholder / "coming soon" markers in `src/ public/ api/` | 652 | [02](02-eliminate-todos-and-stubs.md) |
+| Empty `catch {}` blocks | 126 | [03](03-harden-error-boundaries.md) |
+| Mock / sample / fake-data arrays | 23 | [04](04-purge-mock-and-fake-data.md) |
+| API functions (each needs authz + validation + rate limiting reviewed) | 769 | [08](08-api-hardening.md) |
+| Env keys (secrets surface) | 275 | [07](07-secrets-and-env-hardening.md) |
+| CI workflows | 1 | [16](16-ci-cd-hardening.md) |
+
+Discovery, anytime:
+
+```bash
+grep -rIn "TODO\|FIXME\|not implemented\|implement later\|placeholder\|coming soon\|XXX:" --include=*.js src/ public/ api/ | grep -v node_modules | wc -l
+grep -rIn "catch[^)]*) *{ *}" --include=*.js src/ public/ api/ | grep -v node_modules | wc -l
+```
+
+## Phases
+
+**Phase 1 — Correctness & hygiene (no shortcuts ship).** Serialize 02→06; they
+edit broadly and you want clean diffs between them.
+- [01 — Production audit & scorecard](01-production-audit-scorecard.md) **[serial, run first]**
+- [02 — Eliminate every TODO / stub / placeholder](02-eliminate-todos-and-stubs.md)
+- [03 — Harden every error boundary (kill empty catches)](03-harden-error-boundaries.md)
+- [04 — Purge all mock / sample / fake data](04-purge-mock-and-fake-data.md)
+- [05 — Dead-path & handler audit (every button works)](05-dead-path-and-handler-audit.md)
+- [06 — $THREE coin-compliance sweep](06-three-coin-compliance-sweep.md)
+
+**Phase 2 — Reliability & security (institutional grade).** [parallel-safe]
+across 07–11 once Phase 1 is clean.
+- [07 — Secrets & env hardening](07-secrets-and-env-hardening.md)
+- [08 — API hardening: authz, validation, rate limiting](08-api-hardening.md)
+- [09 — Security review: payments, wallets, contracts](09-security-review.md)
+- [10 — Resilience on every external call](10-resilience-external-calls.md)
+- [11 — Observability: logging, monitoring, alerting](11-observability.md)
+
+**Phase 3 — Performance & scale.** [parallel-safe]
+- [12 — Frontend performance & Core Web Vitals](12-frontend-performance.md)
+- [13 — 3D asset performance](13-3d-asset-performance.md)
+- [14 — Backend caching & data layer](14-backend-caching.md)
+
+**Phase 4 — Quality & testing.**
+- [15 — Test coverage to the bar](15-test-coverage.md) **[serial]**
+- [16 — CI/CD hardening](16-ci-cd-hardening.md) **[serial]**
+- [17 — Accessibility audit (WCAG 2.2 AA)](17-accessibility-audit.md) **[parallel-safe]**
+
+**Phase 5 — UX polish & completeness.** [parallel-safe]
+- [18 — Every state designed (loading/empty/error/overflow)](18-state-design-sweep.md)
+- [19 — Responsive / mobile sweep](19-responsive-mobile-sweep.md)
+- [20 — Design-system & token consistency](20-design-system-consistency.md)
+- [21 — Onboarding & first-run experience](21-onboarding-first-run.md)
+
+**Phase 6 — Growth, monetization & the $1B narrative.**
+- [22 — SEO & shareability](22-seo-and-shareability.md) **[parallel-safe]**
+- [23 — Growth & virality loops](23-growth-virality.md) **[parallel-safe]**
+- [24 — Monetization completeness](24-monetization-completeness.md) **[parallel-safe]**
+- [25 — Analytics & funnel instrumentation](25-analytics-funnel.md) **[parallel-safe]**
+- [26 — Trust surfaces: status, docs, security, pricing](26-trust-surfaces.md) **[parallel-safe]**
+
+**Phase 7 — Launch.**
+- [27 — Go-live runbook & pre-launch checklist](27-launch-runbook.md) **[serial, run last]**
+- [28 — Incident response & on-call](28-incident-response-oncall.md) **[serial]**
+
+## Done means done
+
+A prompt is complete only when its own Definition-of-Done checklist is fully
+true and verified — not when the code is written. If an agent can't verify a
+step, it must say so explicitly. Same rule as [CLAUDE.md](../../CLAUDE.md): you
+would be proud to demo every result to a room of senior engineers.
diff --git a/prompts/readiness/01-production-audit-scorecard.md b/prompts/readiness/01-production-audit-scorecard.md
new file mode 100644
index 000000000..c0bd2b8f6
--- /dev/null
+++ b/prompts/readiness/01-production-audit-scorecard.md
@@ -0,0 +1,72 @@
+# 01 — Production audit & readiness scorecard
+
+**Run this first. Serial.** It produces the source-of-truth report every later
+prompt checks against.
+
+## Where you are
+
+You are at `/workspaces/three.ws` — **three.ws**, an open-source browser-native
+3D AI-agent platform (Three.js/Vite frontend, Vercel functions in `api/`,
+Cloudflare workers in `workers/`, Solana + x402 payments, $THREE token). Read
+[CLAUDE.md](../../CLAUDE.md) and [STRUCTURE.md](../../STRUCTURE.md) before doing
+anything. The only coin is **$THREE**.
+
+## Objective
+
+Produce an honest, file-level production-readiness scorecard. You are not fixing
+anything in this task — you are establishing ground truth so the fix tasks are
+targeted and measurable. The deliverable is a committed report plus a machine
+-readable inventory the rest of the program consumes.
+
+## Why it matters
+
+You cannot claim "100% production ready" against a number you never measured.
+This report is the before-picture. Every later prompt closes a row in it.
+
+## Instructions
+
+1. **Inventory the gaps.** Run each, capture counts AND the file list:
+ ```bash
+ grep -rIn "TODO\|FIXME\|not implemented\|implement later\|placeholder\|coming soon\|XXX:\|HACK" --include=*.js src/ public/ api/ workers/ | grep -v node_modules
+ grep -rIn "catch[^)]*) *{ *}" --include=*.js src/ public/ api/ workers/ | grep -v node_modules
+ grep -rIn "const sample\|mockData\|fakeData\|sampleAgents\|dummyData\|hardcoded\|FIXME" --include=*.js src/ public/ api/ | grep -v node_modules
+ grep -rIn "console.log\|console.warn\|console.error" --include=*.js src/ public/ | grep -v node_modules | wc -l
+ ```
+2. **Run the repo's own auditors** and record pass/fail + output:
+ ```bash
+ npm run audit:handlers # empty event handlers / dead buttons
+ npm run audit:pages # page index integrity
+ npm run check:images # image loading (strict)
+ npm run audit:web # web audit
+ npm run lint # eslint
+ npm run typecheck # tsc
+ npm test 2>&1 | tail -40 # current test state
+ ```
+ Do not fix failures here — record them.
+3. **Map dead paths at the product level.** For each top surface in
+ [STRUCTURE.md](../../STRUCTURE.md) (forge, marketplace, trending, studio,
+ walk, club, reputation, launches, chat, x402 checkout), note in one line:
+ does the primary user flow complete end-to-end with real data? Use the dev
+ server if needed (`npm run dev`, port 3000). Flag anything that 404s,
+ throws, or shows placeholder/empty content where data should be.
+4. **Score each surface** 0–5 on: completeness, error/empty/loading states,
+ mobile, accessibility, performance. Be ruthless; a 3 is "works but not
+ demoable."
+5. **Write the report** to `docs/audits/production-readiness-YYYY-MM-DD.md`
+ (use today's date) with: the gap counts table, the auditor results, the
+ surface scorecard, and a prioritized fix list keyed to the prompt numbers in
+ [00-README-orchestration.md](00-README-orchestration.md).
+6. **Write the machine inventory** to `docs/audits/gap-inventory.json` —
+ `{ todos: [...], emptyCatches: [...], mockData: [...], deadPaths: [...] }`,
+ each entry `{ file, line, snippet }`. Later prompts diff against this.
+
+## Definition of done
+
+- [ ] `docs/audits/production-readiness-<today>.md` committed, with real numbers
+ (not estimates) and a per-surface scorecard.
+- [ ] `docs/audits/gap-inventory.json` committed and valid JSON.
+- [ ] Every auditor command above was run and its result recorded, including
+ failures — no command silently skipped.
+- [ ] The report names the 10 highest-leverage fixes, each linked to a prompt.
+- [ ] No source files changed (this is read-only except the two reports).
+- [ ] Changelog: skip — this is an internal audit, not user-visible.
diff --git a/prompts/readiness/02-eliminate-todos-and-stubs.md b/prompts/readiness/02-eliminate-todos-and-stubs.md
new file mode 100644
index 000000000..4913bf453
--- /dev/null
+++ b/prompts/readiness/02-eliminate-todos-and-stubs.md
@@ -0,0 +1,59 @@
+# 02 — Eliminate every TODO, stub & placeholder
+
+**Phase 1. Run after [01](01-production-audit-scorecard.md). Serial** (broad
+edits — keep its diff isolated).
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 3D AI-agent platform. Read
+[CLAUDE.md](../../CLAUDE.md). Hard rules in play: **No TODO comments. No
+`// implement later`. No stub functions. No `throw new Error("not implemented")`.
+No commented-out code. If you write it, finish it.** There are ~652 marker hits
+to resolve. The only coin is **$THREE**.
+
+## Objective
+
+Drive the TODO/FIXME/stub/placeholder count in `src/ public/ api/ workers/` to
+**zero** — by *implementing* the missing behavior, not by deleting the comment
+and leaving the gap. Every marker is either real missing work (implement it) or
+a stale note (remove it because the work is already done).
+
+## Why it matters
+
+A TODO in shipped code is an admission the product is unfinished. Investors,
+contributors, and users read this repo. Every marker is a small broken promise.
+Closing them is the difference between a demo and a product.
+
+## Instructions
+
+1. **Enumerate** from `docs/audits/gap-inventory.json` (or re-run the grep in
+ [00-README](00-README-orchestration.md)). Group by directory/owner-surface so
+ you can batch related ones.
+2. **Triage each marker** into one of:
+ - **Implement** — the feature/branch/edge-case is genuinely missing. Build it
+ properly with real APIs and real data. No shortcuts.
+ - **Already done** — the note is stale; delete the comment.
+ - **Wrong layer** — it describes work that belongs elsewhere; implement in the
+ right place and remove the marker.
+ Never resolve by weakening behavior or hiding the path.
+3. **For commented-out code:** delete it or implement it. Git history is the
+ archive — dead code in the tree is not.
+4. **For `// placeholder` UI / copy / data:** replace with the real thing. If a
+ value must come from an API, wire the fetch. If copy is a stand-in, write the
+ final copy.
+5. **Work in reviewable batches** by surface (e.g. all forge TODOs, then all
+ marketplace TODOs). After each batch run `npm run lint && npm run typecheck`
+ and the relevant tests. Commit per surface with explicit paths so concurrent
+ agents aren't clobbered (`git add <files>`, never `-A`).
+6. **Re-measure** after each batch; track the count down to zero.
+
+## Definition of done
+
+- [ ] `grep -rIn "TODO\|FIXME\|not implemented\|implement later\|placeholder\|coming soon\|XXX:\|HACK" --include=*.js src/ public/ api/ workers/ | grep -v node_modules` returns **0** (or each remaining hit is a legitimate string literal a user types/searches, justified inline in your final report).
+- [ ] No `throw new Error("not implemented")`, no stub functions, no
+ commented-out code blocks remain in the changed files.
+- [ ] Every "implement" item is wired to real APIs/data and reachable in the UI.
+- [ ] `npm run lint`, `npm run typecheck`, and `npm test` pass.
+- [ ] `gap-inventory.json` `todos` array updated to reflect what was closed.
+- [ ] Changelog: add one `improvement` entry to `data/changelog.json` if any
+ user-visible behavior was completed (plain language, not "removed TODOs").
diff --git a/prompts/readiness/03-harden-error-boundaries.md b/prompts/readiness/03-harden-error-boundaries.md
new file mode 100644
index 000000000..27018a7e2
--- /dev/null
+++ b/prompts/readiness/03-harden-error-boundaries.md
@@ -0,0 +1,67 @@
+# 03 — Harden every error boundary (kill the empty catches)
+
+**Phase 1. Serial** after [02](02-eliminate-todos-and-stubs.md).
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 3D AI-agent platform. Read
+[CLAUDE.md](../../CLAUDE.md). Rules in play: **Errors handled at boundaries
+(network, user input). No errors without solutions — there is always a correct
+answer. Ship working fallbacks and failsafes. Lazy error propagation is not
+engineering.** ~126 empty `catch {}` blocks exist. The only coin is **$THREE**.
+
+## Objective
+
+Eliminate silent failure. Every `catch` either (a) recovers with a real
+fallback, (b) surfaces an actionable error to the user at a UI boundary, or (c)
+reports to the error pipeline with enough context to debug — never swallows.
+
+## Why it matters
+
+An empty catch is a bug that will happen in production and that you have
+pre-decided not to learn about. At scale these are the outages you can't explain
+and the user reports you can't reproduce. Silent failure is the opposite of
+institutional grade.
+
+## Instructions
+
+1. **Enumerate** empty/near-empty catches:
+ ```bash
+ grep -rIn "catch[^)]*) *{ *}" --include=*.js src/ public/ api/ workers/ | grep -v node_modules
+ grep -rPzoIn "catch\s*\([^)]*\)\s*\{\s*(//[^\n]*)?\s*\}" --include=*.js src/ public/ api/ | grep -v node_modules
+ ```
+ Also review `catch` blocks whose body is only `return null` / `return` /
+ `return []` where the caller can't distinguish "no data" from "it broke."
+2. **Classify each external boundary** (fetch, RPC, pump.fun, LLM proxy, wallet,
+ file/parse) vs **internal logic**. CLAUDE.md: internal code trusts itself;
+ boundaries are where handling belongs.
+3. **For each, pick the right resolution:**
+ - **User-facing UI:** show a designed error state with a recovery action
+ (retry, reconnect wallet, refresh). Never a blank void or a console-only
+ log. Coordinate with [18 — state design](18-state-design-sweep.md).
+ - **Background/worker:** log structured context + retry/backoff where
+ transient (see [10 — resilience](10-resilience-external-calls.md)), then
+ fail loudly to the error pipeline (see [11 — observability](11-observability.md)).
+ - **Truly ignorable** (e.g. `localStorage` blocked in private mode, optional
+ analytics): keep the catch but add a one-line comment stating *why* it is
+ safe to ignore, and degrade gracefully. A justified silent catch is fine;
+ an unexplained one is not.
+4. **Add a shared helper** if a pattern repeats (e.g. `reportError(err, ctx)` and
+ a `withFallback(fn, fallback)`), and route catches through it. Prefer the
+ existing `public/error-reporter.js` if present — extend, don't duplicate.
+5. **Verify behavior, not just code.** For at least the top 10 user-facing
+ boundaries, force the failure (offline, bad input, rejected wallet) in
+ `npm run dev` and confirm the user sees a recoverable state.
+
+## Definition of done
+
+- [ ] Zero unexplained empty `catch {}` in `src/ public/ api/ workers/`. Every
+ remaining bare catch has a one-line justification comment.
+- [ ] Every network/RPC/LLM/wallet boundary surfaces a recoverable UI state or
+ reports to the error pipeline — none swallow silently.
+- [ ] Forced-failure check done on the top 10 boundaries; each degrades
+ gracefully (recorded in your report).
+- [ ] `npm run lint`, `npm run typecheck`, `npm test` pass.
+- [ ] `gap-inventory.json` `emptyCatches` updated.
+- [ ] Changelog: `fix` entry in `data/changelog.json` if users will now see
+ recoverable errors where things used to silently fail.
diff --git a/prompts/readiness/04-purge-mock-and-fake-data.md b/prompts/readiness/04-purge-mock-and-fake-data.md
new file mode 100644
index 000000000..8c5edeb76
--- /dev/null
+++ b/prompts/readiness/04-purge-mock-and-fake-data.md
@@ -0,0 +1,68 @@
+# 04 — Purge all mock, sample & fake data
+
+**Phase 1. Serial** after [03](03-harden-error-boundaries.md).
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 3D AI-agent platform. Read
+[CLAUDE.md](../../CLAUDE.md). Rules in play: **No mocks. No fake data. No
+fallback sample arrays shipped to production. Real fetch only. Use real APIs,
+real endpoints, real data.** The only coin is **$THREE** — and **no third-party
+or real mainnet mints in fixtures**; use `$THREE` (CA
+`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`) or a clearly-synthetic
+placeholder like `THREEsynthetic1111…`.
+
+## Objective
+
+Remove every hardcoded sample array, mock object, and fake-data fallback from
+production code paths. Where a UI currently falls back to canned data when a
+fetch fails, replace that with a real loading + empty + error state driven by
+the real API.
+
+## Why it matters
+
+Fake data is a lie to the user and to yourself. It hides broken integrations,
+inflates how finished the product looks, and eventually ships to someone who
+makes a decision based on numbers that were never real. A $1B platform shows
+real state — including "nothing here yet" — never invented state.
+
+## Instructions
+
+1. **Find candidates:**
+ ```bash
+ grep -rIn "const sample\|sampleAgents\|sampleData\|mockData\|fakeData\|dummyData\|placeholderData\|DEMO_\|FALLBACK_DATA\|= \[ *{ *id:" --include=*.js src/ public/ api/ | grep -v node_modules
+ grep -rIn "// fallback\|// sample\|// demo data\|// mock" --include=*.js src/ public/ | grep -v node_modules
+ ```
+ Cross-check against `gap-inventory.json` `mockData`.
+2. **For each hit, classify:**
+ - **Production fallback** (sample array rendered when fetch fails/empty) →
+ **delete it.** Replace with: real fetch → designed loading state → designed
+ empty state ("nothing here yet, do X") → designed error state. No canned
+ rows.
+ - **Test fixture / Storybook / example** under `tests/`, `examples/`,
+ `*.test.js` → allowed to stay, but scrub any real third-party mint/coin/
+ address and replace with `$THREE` CA or a synthetic placeholder.
+ - **Seed data** for a real feature (e.g. onboarding defaults) → keep only if
+ it is genuinely the product's real default, not a stand-in for a missing
+ fetch.
+3. **Wire the real source.** If a component used fake data because no endpoint
+ existed, the endpoint is the missing work — build it (real API in `api/`,
+ real query) and connect it. Do not leave the component dataless.
+4. **Empty states are mandatory.** Every list/grid/feed that loses its fake
+ fallback must gain a real empty state. Coordinate with
+ [18 — state design](18-state-design-sweep.md).
+5. **Verify in the browser** (`npm run dev`): each touched surface shows real
+ data on success, a real empty state with zero items, and a real error state
+ when the API is down (kill the network in devtools to test).
+
+## Definition of done
+
+- [ ] No sample/mock/fake-data array is reachable in any production render path.
+- [ ] Every delisted fallback is replaced by real fetch + loading + empty +
+ error states, verified in the browser.
+- [ ] No real third-party coin/mint/address remains in any fixture; only `$THREE`
+ CA or synthetic placeholders.
+- [ ] Any endpoint that was missing is now built with real data and wired in.
+- [ ] `npm test` passes; `gap-inventory.json` `mockData` updated.
+- [ ] Changelog: `improvement` entry if users now see real data where canned
+ data used to appear.
diff --git a/prompts/readiness/05-dead-path-and-handler-audit.md b/prompts/readiness/05-dead-path-and-handler-audit.md
new file mode 100644
index 000000000..ef0bf40e1
--- /dev/null
+++ b/prompts/readiness/05-dead-path-and-handler-audit.md
@@ -0,0 +1,68 @@
+# 05 — Dead-path & handler audit (every button works, every link goes somewhere)
+
+**Phase 1. Serial** after [04](04-purge-mock-and-fake-data.md).
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 3D AI-agent platform (125 pages, 118 public
+JS, 810 src JS). Read [CLAUDE.md](../../CLAUDE.md). Rules in play: **Eliminate
+dead paths. If a button exists it must work. If a link exists it must go
+somewhere. If a state exists there must be a way to reach it.** There is a repo
+auditor for this: `npm run audit:handlers`. The only coin is **$THREE**.
+
+## Objective
+
+Zero dead interactive elements across the whole app. Every button has a working
+handler, every link resolves to a real route (no 404), every nav item leads
+somewhere real, every reachable state has a path in and a path out.
+
+## Why it matters
+
+Nothing tanks trust faster than a button that does nothing. At a billion-dollar
+bar, the product must feel like everything is wired — because it is. Dead paths
+are the tells of an unfinished product.
+
+## Instructions
+
+1. **Run the auditors and fix to green:**
+ ```bash
+ npm run audit:handlers # empty/no-op handlers
+ npm run audit:pages # page index ↔ files integrity
+ npm run audit:web # broader web audit
+ npm run check:images # broken/lazy images
+ ```
+2. **Find no-op handlers manually too:**
+ ```bash
+ grep -rIn "onclick=\"\"\|onClick={() => {}}\|href=\"#\"\|href=\"javascript:\|addEventListener([^,]*, *function *() *{ *})" --include=*.html --include=*.js public/ pages/ src/ | grep -v node_modules
+ ```
+3. **Crawl the real app** (`npm run dev`, port 3000). For each top surface
+ (home, forge, marketplace, trending, studio, walk, club, reputation,
+ launches, chat, x402 checkout, settings, login): click every button, follow
+ every link, open every menu. Log each dead end.
+4. **Fix each dead path properly:**
+ - Button with no handler → implement the real action it implies.
+ - Link to a missing route → build the route, or repoint to the correct
+ existing one. Never leave `href="#"`.
+ - Unreachable state → add navigation to it, or remove the state if it's
+ vestigial (CLAUDE.md: delete aggressively).
+ - Disabled-forever control → enable it with real behavior or remove it.
+5. **Check cross-surface wiring** (CLAUDE.md "think in systems"): does the
+ marketplace link to agent profiles? Does an agent profile link to its
+ launches, reputation, and chat? Wire the connections that should exist.
+6. **404 + error routes:** confirm a designed 404 page exists and that unknown
+ routes hit it, not a blank screen.
+
+## Definition of done
+
+- [ ] `npm run audit:handlers`, `audit:pages`, `audit:web`, `check:images` all
+ pass.
+- [ ] Manual crawl complete; every button/link on every top surface does
+ something real. The dead-end log is fully resolved (attach it to your
+ report with each item's resolution).
+- [ ] No `href="#"` / `href="javascript:void"` / empty handler remains in
+ shipped HTML/JS.
+- [ ] Cross-surface links that *should* exist now exist (named in your report).
+- [ ] Designed 404/unknown-route handling verified.
+- [ ] `gap-inventory.json` `deadPaths` updated; `npm test` passes.
+- [ ] Changelog: `improvement`/`fix` entry for any user-facing wiring that now
+ works.
diff --git a/prompts/readiness/06-three-coin-compliance-sweep.md b/prompts/readiness/06-three-coin-compliance-sweep.md
new file mode 100644
index 000000000..67a9fdff2
--- /dev/null
+++ b/prompts/readiness/06-three-coin-compliance-sweep.md
@@ -0,0 +1,78 @@
+# 06 — $THREE coin-compliance sweep
+
+**Phase 1. Serial** after [05](05-dead-path-and-handler-audit.md). Highest
+sensitivity — treat any violation like a leaked secret.
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 3D AI-agent platform. Read the **"The only
+coin — $THREE"** section of [CLAUDE.md](../../CLAUDE.md) in full before starting;
+it governs this entire task.
+
+## The rule
+
+**The only coin this platform may ever reference is `$THREE`. Contract address:
+`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`. There are no other coins.** This
+includes any other coin three.ws itself may have launched. Never mention, name,
+hardcode, link, import, render, recommend, or talk about any other coin — in
+code, comments, tests, fixtures, sample data, docs, blog, UI copy, metadata, or
+commit messages.
+
+Two **runtime-data-only** mechanical exceptions exist (do NOT remove these):
+1. Coin-agnostic plumbing where a mint is supplied at runtime by the user (e.g.
+ the pump.fun launcher accepting an arbitrary mint).
+2. Platform launch directories rendering coins users launched through three.ws
+ from real launch records at runtime (`/launches`, agent-profile launch
+ history, `/api/pump/launches` over `pump_agent_mints`).
+In both, never hardcode/market/recommend a specific non-`$THREE` mint.
+
+## Objective
+
+Guarantee the entire repository — code, copy, fixtures, docs, metadata — promotes
+exactly one coin: $THREE. Any hardcoded foreign mint, ticker, or coin reference
+is removed (treated like a leaked secret), except the two runtime-data-only
+exceptions above.
+
+## Instructions
+
+1. **Sweep for foreign coin references.** Search broadly across all text, not
+ just JS:
+ ```bash
+ # Hardcoded Solana-style mint addresses (base58, 32-44 chars) that are NOT $THREE
+ grep -rEIn "[1-9A-HJ-NP-Za-km-z]{32,44}" --include=*.js --include=*.json --include=*.md --include=*.html . | grep -v node_modules | grep -v "FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump"
+ # Known foreign tickers / coin words used as promotion (review hits by hand)
+ grep -rIn "\$[A-Z]\{2,6\}\b" --include=*.js --include=*.md --include=*.html public/ src/ pages/ docs/ blog/ content/ | grep -v "\$THREE" | grep -v node_modules
+ ```
+ Most base58 hits will be legitimate (program IDs, USDC mint for x402 rails,
+ ATAs, pubkeys, synthetic placeholders). **Review every hit by hand** and
+ classify: legitimate infra address (keep), runtime-exception data (keep),
+ synthetic placeholder (keep), or **foreign coin promotion (remove)**.
+2. **USDC is allowed** only as a payment rail / quote mint (x402, pump.fun USDC
+ pairing) — it is plumbing, not a promoted coin. Confirm each USDC reference is
+ rail/quote usage, never "buy USDC the investment."
+3. **For each violation:** remove the reference and replace with `$THREE` (CA
+ above) or a clearly-synthetic placeholder where a token value is structurally
+ required. Scrub fixtures and tests too.
+4. **Check non-code surfaces:** `data/changelog.json`, `public/*.json`, blog
+ posts, docs, OG/meta tags, page `<title>`/descriptions, structured data,
+ sample agent cards.
+5. **Protect the exceptions:** verify you did NOT break the `/launches` feed,
+ agent-profile launch history, `/api/pump/launches`, or the pump.fun launcher's
+ runtime mint input. These render user-launched coins from real records — they
+ are product features, not endorsements.
+6. **Add a guard test** under `tests/` that greps the source tree for hardcoded
+ non-`$THREE` mints outside an allowlist (infra addresses + synthetic
+ placeholders) and fails CI on a new one — so this can never regress.
+
+## Definition of done
+
+- [ ] Every foreign-coin reference in code/copy/fixtures/docs/metadata removed or
+ replaced; each base58/ticker hit reviewed and classified in your report.
+- [ ] No hardcoded non-`$THREE` mint promoted anywhere; USDC only as a rail.
+- [ ] The two runtime-data-only exceptions still work (verified): `/launches`,
+ profile launch history, `/api/pump/launches`, launcher mint input.
+- [ ] A regression guard test exists under `tests/` and passes in CI.
+- [ ] `npm test` passes.
+- [ ] Commit message stays neutral — do NOT restate any removed coin name in the
+ message (CLAUDE.md revert/redeploy rule). Changelog: skip (compliance is
+ not a user-facing feature; never name a removed coin in the changelog).
diff --git a/prompts/readiness/07-secrets-and-env-hardening.md b/prompts/readiness/07-secrets-and-env-hardening.md
new file mode 100644
index 000000000..f3368d429
--- /dev/null
+++ b/prompts/readiness/07-secrets-and-env-hardening.md
@@ -0,0 +1,73 @@
+# 07 — Secrets & environment hardening
+
+**Phase 2. [parallel-safe]** with 08–11.
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 3D AI-agent platform. Backend is Vercel
+functions (`api/`) + Cloudflare workers (`workers/`). There are ~275 keys in
+`.env.example`. Read [CLAUDE.md](../../CLAUDE.md). The only coin is **$THREE**.
+
+## Objective
+
+A clean, documented, leak-proof secrets posture: nothing secret in the repo, a
+single canonical inventory of every env var (what it's for, where it's set, is
+it required), startup validation that fails loudly on missing critical config,
+and a verified separation between client-exposed and server-only values.
+
+## Why it matters
+
+275 env vars is a large attack surface. One leaked private key (Solana deploy
+wallet, parent SNS secret, Telegram bot token, RPC API key) is a catastrophic,
+irreversible event for a token platform. Institutional readiness means you can
+prove no secret is in the tree and every required one is validated at boot.
+
+## Instructions
+
+1. **Scan for committed secrets** (history included):
+ ```bash
+ grep -rIn "PRIVATE_KEY\|SECRET\|_TOKEN\|BASE58\|sk-\|AKIA\|-----BEGIN" --include=*.js --include=*.json --include=*.env* . | grep -v node_modules | grep -v ".env.example"
+ git log --all -p -S "PRIVATE_KEY" -- . | head -200 # spot-check history for leaks
+ ```
+ If a real secret is found in the tree or history, treat it as compromised:
+ rotate it (tell the user which key to rotate and where) and remove it. Do not
+ just delete the line.
+2. **Client vs server boundary.** Any secret referenced in `public/` or in
+ client bundles is exposed. Confirm only intentionally-public values (e.g.
+ `VITE_`-prefixed, public RPC URLs, publishable keys) appear client-side.
+ Anything sensitive in client code is a leak — move it behind an `api/` proxy.
+3. **Build the canonical inventory.** Generate `docs/configuration.md` (or update
+ it) and a checked-in `.env.example` that lists **every** var with: one-line
+ purpose, `required|optional`, `server|client`, and which feature breaks
+ without it. Derive the list from actual `process.env.X` / `import.meta.env.X`
+ usage:
+ ```bash
+ grep -rohE "process\.env\.[A-Z0-9_]+|import\.meta\.env\.[A-Z0-9_]+" --include=*.js . | grep -v node_modules | sort -u
+ ```
+ Flag any var used in code but missing from `.env.example`, and any var in
+ `.env.example` never used in code (dead — remove).
+4. **Startup validation.** Add a single `assertEnv()` / config-loader module that,
+ at function/worker cold start, validates the critical secrets for that surface
+ are present and well-formed, and fails with a clear message naming the missing
+ var. No feature should fail deep in a request because a key was silently
+ undefined.
+5. **`.gitignore` audit.** Confirm `.env`, `.env.*` (except `.env.example`),
+ keypair files, and `~/.claude/*` artifacts are ignored. Add any gaps.
+6. **Rotation runbook.** Document in `docs/configuration.md` how to rotate each
+ class of secret (Solana keypair, RPC key, Telegram token, SNS parent secret)
+ and where it's set (`vercel env`, CF dashboard, etc.).
+
+## Definition of done
+
+- [ ] No real secret in the working tree or surfaced from history (or any found
+ one is flagged for rotation with exact instructions to the user).
+- [ ] No sensitive value reachable from client bundles; sensitive lookups proxied
+ through `api/`.
+- [ ] `.env.example` lists every used var with purpose/required/scope; no
+ used-but-undocumented and no documented-but-dead vars remain.
+- [ ] `assertEnv()` validates critical config at cold start on each surface and
+ fails loudly with the missing var name. Verified by temporarily unsetting
+ one in dev.
+- [ ] `.gitignore` covers all secret/keypair/artifact patterns.
+- [ ] Rotation runbook in `docs/configuration.md`.
+- [ ] Changelog: skip (internal hardening) unless a user-facing config UX changed.
diff --git a/prompts/readiness/08-api-hardening.md b/prompts/readiness/08-api-hardening.md
new file mode 100644
index 000000000..cc48d11d7
--- /dev/null
+++ b/prompts/readiness/08-api-hardening.md
@@ -0,0 +1,73 @@
+# 08 — API hardening: authz, validation, rate limiting
+
+**Phase 2. [parallel-safe]** with 07, 09–11. Large surface — work in batches.
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 3D AI-agent platform. **769 functions in
+`api/`** (Vercel) plus `workers/`. Read [CLAUDE.md](../../CLAUDE.md). Rules:
+**Errors handled at boundaries. No errors without solutions.** The only coin is
+**$THREE**.
+
+## Objective
+
+Every public endpoint is: authenticated/authorized where it touches user data or
+spends money, input-validated on every parameter, rate-limited against abuse,
+and returns consistent, safe error responses (no stack traces, no internal
+detail leaks). Build shared middleware so this is uniform, not per-file.
+
+## Why it matters
+
+769 endpoints is 769 doors. At a billion-dollar bar, an unauthenticated mutation,
+an unvalidated mint/amount, or an un-rate-limited payment endpoint is an exploit
+waiting to be found. Payments, wallet ops, and on-chain actions especially must
+be airtight.
+
+## Instructions
+
+1. **Inventory endpoints and classify** by sensitivity:
+ ```bash
+ find api -name '*.js' | grep -v _lib | grep -v node_modules | wc -l
+ grep -rln "export default\|module.exports" api/ | grep -v node_modules
+ ```
+ Tag each: **public-read** (cacheable, no auth), **auth-read** (needs session),
+ **mutation** (writes data), **money/chain** (payments, mint, transfer, x402,
+ pump). Money/chain is highest priority.
+2. **Shared middleware (build once, apply everywhere)** under `api/_lib/`:
+ - `withAuth(handler, { require: 'session'|'optional' })` — verifies SIWE/email
+ session; reuse the existing auth layer (see `api/auth/`,
+ `src/wallet-auth.js`), don't reinvent.
+ - `withValidation(schema)` — validates query/body against a schema (zod or
+ equivalent already in deps); rejects with 400 + field-level message.
+ Validate types, ranges, addresses (base58/EVM), amounts (positive, bounded).
+ - `withRateLimit({ key, limit, window })` — per-IP and per-session limiting on
+ a shared store (the project already uses KV/Upstash-style storage — reuse
+ it). Strict limits on money/chain and LLM-proxy endpoints.
+ - `safeError(err)` — maps internal errors to safe client responses; never
+ leak stack traces or secrets.
+3. **Apply in priority order:** money/chain → mutations → auth-read →
+ public-read. Commit per batch with explicit paths (concurrent agents share
+ this worktree — never `git add -A`).
+4. **Validate money paths hardest.** For any endpoint that mints, transfers,
+ pays, or launches: re-verify amount bounds, ownership, idempotency (a retried
+ request must not double-spend), and that the mint is the user-supplied runtime
+ value (never a hardcoded foreign coin — $THREE rules apply).
+5. **CORS & methods.** Confirm each endpoint restricts methods (no accidental
+ GET-mutations) and that CORS is as tight as the feature allows.
+6. **Tests.** Add request-level tests under `tests/api/` for: unauthorized
+ access rejected, invalid input rejected with 400, rate limit triggers 429,
+ and the happy path still works. Follow existing patterns in `tests/api/`.
+
+## Definition of done
+
+- [ ] Shared `withAuth` / `withValidation` / `withRateLimit` / `safeError`
+ middleware exists in `api/_lib/` and is reused (not duplicated per file).
+- [ ] 100% of money/chain and mutation endpoints enforce auth + validation +
+ rate limiting; auth-read endpoints enforce auth; the split is documented in
+ `docs/API_AUDIT.md`.
+- [ ] No endpoint returns stack traces or internal detail on error.
+- [ ] Idempotency verified on every spend/mint/transfer path.
+- [ ] New `tests/api/` cases cover authz-reject, validation-reject, rate-limit,
+ and happy path; `npm test` passes.
+- [ ] Changelog: `security` entry in `data/changelog.json` (plain language, e.g.
+ "Hardened API request validation and rate limiting").
diff --git a/prompts/readiness/10-resilience-external-calls.md b/prompts/readiness/10-resilience-external-calls.md
new file mode 100644
index 000000000..5a009f47c
--- /dev/null
+++ b/prompts/readiness/10-resilience-external-calls.md
@@ -0,0 +1,71 @@
+# 10 — Resilience on every external call
+
+**Phase 2. [parallel-safe]** with 07–09, 11.
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 3D AI-agent platform. It depends on external
+services that WILL fail intermittently: Solana RPC, pump.fun feed, OpenAI/
+Anthropic via worker proxies, x402 facilitators, R2/storage, Telegram. Read
+[CLAUDE.md](../../CLAUDE.md). Your memory notes a `cockatiel` resilience helper
+and a preference for vetted OSS over hand-rolling. The only coin is **$THREE**.
+
+## Objective
+
+Every outbound network call has a timeout, bounded retries with backoff+jitter
+for transient failures, and a circuit breaker or graceful degradation so one
+slow dependency can't cascade into an outage. Solana RPC and pump.fun especially
+get multi-endpoint failover.
+
+## Why it matters
+
+Public RPCs rate-limit and flake constantly; pump.fun and LLM providers have
+incidents. Without timeouts and breakers, a single hung upstream call exhausts
+function concurrency and takes the whole platform down. Resilience is what lets a
+$1B platform claim real uptime on top of unreliable dependencies.
+
+## Instructions
+
+1. **Find every outbound call:**
+ ```bash
+ grep -rIn "fetch(\|axios\|new Connection(\|getAccountInfo\|sendTransaction\|https.request\|undici" --include=*.js src/ api/ workers/ | grep -v node_modules
+ ```
+ Classify by dependency (RPC, pump, LLM, x402, storage, misc).
+2. **Adopt one shared resilience helper** (reuse the existing `cockatiel`-based
+ helper if present — check the codebase and the
+ [prefer-vetted-oss-additive] memory; otherwise wrap `cockatiel`). Expose:
+ `retry(policy)`, `timeout(ms)`, `circuitBreaker(opts)`, composed into a
+ `resilientFetch()` / `withResilience(fn)`. Do not hand-roll bespoke retry
+ loops per file.
+3. **Timeouts everywhere.** No `fetch` without an `AbortController` + timeout.
+ Pick sane per-dependency budgets (RPC ~8s, LLM longer, feeds ~5s).
+4. **Retries only for transient errors** (network, 429, 5xx, RPC node errors) —
+ never for 4xx/validation. Exponential backoff + jitter. Respect `Retry-After`.
+5. **Solana RPC failover.** There is prior art ("resilient Solana RPC" in recent
+ commits) — extend it: a prioritized pool of RPC endpoints with health-aware
+ rotation, so a dead/throttled node is skipped. Same idea for any multi-
+ provider dependency.
+6. **Circuit breakers + degradation.** When a dependency is failing, open the
+ breaker and serve a degraded-but-honest response (cached data with a
+ "stale" marker, or a designed error state — coordinate with
+ [18 — state design](18-state-design-sweep.md)). Never hang.
+7. **Idempotency for retried writes.** Any retried mutation/payment must carry an
+ idempotency key so a retry can't double-execute (cross-check
+ [08 — API hardening](08-api-hardening.md)).
+8. **Tests.** Use the existing resilience test patterns (e.g.
+ `tests/api/pump-trending-resilience.test.js`) to add coverage: timeout fires,
+ retry recovers on second attempt, breaker opens after N failures, failover
+ picks the next endpoint.
+
+## Definition of done
+
+- [ ] Zero `fetch`/RPC call without a timeout in `src/ api/ workers/`.
+- [ ] One shared resilience helper used across all outbound calls (no per-file
+ hand-rolled retry loops).
+- [ ] Retries are transient-only with backoff+jitter; 4xx never retried.
+- [ ] Solana RPC (and other multi-provider deps) have health-aware failover.
+- [ ] Circuit breakers degrade gracefully to cached/honest states, never hang.
+- [ ] Retried writes are idempotent.
+- [ ] Resilience tests added and passing (`npm test`).
+- [ ] Changelog: `improvement`/`infra` entry if users see fewer transient errors
+ (e.g. "More resilient data loading during network hiccups").
diff --git a/prompts/readiness/11-observability.md b/prompts/readiness/11-observability.md
new file mode 100644
index 000000000..d560e40ef
--- /dev/null
+++ b/prompts/readiness/11-observability.md
@@ -0,0 +1,73 @@
+# 11 — Observability: logging, monitoring, alerting
+
+**Phase 2. [parallel-safe]** with 07–10.
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 3D AI-agent platform on Vercel functions +
+Cloudflare workers, with PostHog and Vercel Analytics already loaded on the
+frontend and a `public/error-reporter.js`. Read [CLAUDE.md](../../CLAUDE.md). The
+only coin is **$THREE**.
+
+## Objective
+
+You can see what the platform is doing in production: structured logs with
+request/trace context, client + server error reporting into one pipeline, uptime
+and latency monitoring on every critical path, and alerting that pages a human
+before users complain. No silent failures, no blind spots on money flows.
+
+## Why it matters
+
+At a billion-dollar bar you operate the platform, not just ship it. If a payment
+endpoint starts 500ing or RPC latency spikes, you must know in minutes — from a
+metric, not a tweet. Observability is the difference between a 5-minute incident
+and a 5-hour one.
+
+## Instructions
+
+1. **Structured logging.** Replace ad-hoc `console.log` in server code
+ (`api/`, `workers/`) with a structured logger (level, message, requestId,
+ userId/agentId where safe, dependency, duration). Never log secrets, private
+ keys, full tokens, or PII. Add a `requestId` at the edge and thread it through.
+ ```bash
+ grep -rIn "console.log\|console.error\|console.warn" --include=*.js api/ workers/ | grep -v node_modules | wc -l
+ ```
+2. **Unified error reporting.** Wire client errors (`public/error-reporter.js`)
+ and server errors into one sink (Sentry or the existing pipeline — check
+ deps/env before adding a new vendor). Capture: message, stack, requestId,
+ route, release/commit. De-dupe and group. Cross-check with
+ [03 — error boundaries](03-harden-error-boundaries.md): every reported catch
+ lands here.
+3. **Critical-path monitoring.** Define SLOs for the money/chain and core paths
+ (forge generate, x402 checkout, pump launch, login, marketplace load). Add
+ uptime + latency checks (synthetic monitors or a `/api/health` + external
+ pinger). Record p50/p95/p99 latency and error rate per path.
+4. **Health endpoints.** Ensure a real `/api/health` (and per-worker health) that
+ checks downstream deps (RPC reachable, DB reachable, KV reachable) and returns
+ structured status — used by monitors and the status page
+ ([26 — trust surfaces](26-trust-surfaces.md)).
+5. **Alerting.** Configure alerts on: error-rate spike, p95 latency breach, money
+ -path failure, breaker-open events (from [10](10-resilience-external-calls.md)),
+ and health-check failure. Route to a real channel (the existing Telegram
+ integration is a candidate). Document thresholds in
+ `docs/observability.md`.
+6. **Dashboards.** Stand up (or document) a dashboard view of the core metrics so
+ on-call has one place to look. PostHog is already present for product
+ analytics — keep product vs ops signals distinct.
+7. **Verify it fires.** Trigger a synthetic error and a synthetic latency breach;
+ confirm it shows up in the sink and the alert routes.
+
+## Definition of done
+
+- [ ] Server code uses a structured logger with requestId threading; no secret/
+ PII logged; raw `console.*` in `api/`/`workers/` reduced to near-zero.
+- [ ] Client + server errors flow into one reporting sink with release/commit and
+ requestId; verified by a synthetic error.
+- [ ] `/api/health` (+ worker health) checks real downstream deps.
+- [ ] SLOs + uptime/latency monitoring exist for every critical path; metrics
+ recorded.
+- [ ] Alerting configured and verified to fire on error-spike / latency / money-
+ path / health failure, routed to a real channel.
+- [ ] `docs/observability.md` documents SLOs, alert thresholds, and the runbook
+ pointer (feeds [28 — incident response](28-incident-response-oncall.md)).
+- [ ] Changelog: skip (internal) unless a user-facing status surface shipped.
diff --git a/prompts/readiness/12-frontend-performance.md b/prompts/readiness/12-frontend-performance.md
new file mode 100644
index 000000000..e5b8191ba
--- /dev/null
+++ b/prompts/readiness/12-frontend-performance.md
@@ -0,0 +1,71 @@
+# 12 — Frontend performance & Core Web Vitals
+
+**Phase 3. [parallel-safe]** with 13–14.
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, vanilla-JS modules + Vite, 125 pages, 118
+public JS files, Three.js for 3D. Read [CLAUDE.md](../../CLAUDE.md) — "Performance
+by default: lazy-load heavy modules, debounce input, paginate lists, use
+`will-change`/`transform` for animations. Don't ship jank." The only coin is
+**$THREE**.
+
+## Objective
+
+Hit "good" Core Web Vitals (LCP < 2.5s, INP < 200ms, CLS < 0.1) on the top
+landing surfaces on a mid-tier mobile device and a throttled connection. Cut
+bundle weight, defer non-critical work, and remove layout jank.
+
+## Why it matters
+
+Growth and conversion are gated by speed. A platform that competes with Vercel/
+Linear/Stripe loads instantly. Every 100ms of LCP and every CLS shift costs
+sign-ups. This is directly upstream of the $1B growth math.
+
+## Instructions
+
+1. **Measure first.** Build and run Lighthouse/CWV on the top surfaces (home,
+ forge, marketplace, trending, an agent profile):
+ ```bash
+ npm run build && npm run audit:web # existing web auditor
+ npx lighthouse https://localhost:3000/ --preset=perf --form-factor=mobile --throttling-method=simulate
+ ```
+ Record LCP/INP/CLS/TBT and bundle sizes per route as the baseline.
+2. **Bundle analysis.** Inspect the Vite build output and chunking. Find the
+ heaviest modules (Three.js, character-studio, model-viewer, web3 libs).
+ ```bash
+ ls -laSh dist/assets/*.js | head -20
+ ```
+ Code-split route-heavy and 3D-heavy code behind dynamic `import()`. The 3D
+ engine must never block first paint on non-3D pages.
+3. **Lazy-load the heavy stuff.** Three.js, GLB loaders, and the avatar engine
+ load on interaction/visibility, not on document load. Use
+ `IntersectionObserver` for below-the-fold 3D and images
+ (`loading="lazy"`, `decoding="async"`).
+4. **Kill CLS.** Reserve space for images/canvas/embeds (width/height or
+ aspect-ratio). No content that shifts when fonts/data arrive. Preload the
+ primary font; `font-display: swap`.
+5. **Optimize the critical path.** Inline critical CSS for above-the-fold,
+ defer the rest. `preconnect`/`dns-prefetch` for RPC/API/analytics origins.
+ Ensure analytics (PostHog, Vercel) load non-blocking (they already do —
+ confirm they're not on the critical path).
+6. **Improve INP.** Debounce search/input handlers, break long tasks, move heavy
+ compute off the main thread (Worker) where it blocks interaction. The
+ `MaxListenersExceededWarning` noise in console is the MetaMask extension, not
+ us — ignore it; focus on our own long tasks.
+7. **Caching headers.** Static assets immutable + far-future cache; HTML
+ appropriately revalidated. Verify via `vercel.json` headers.
+8. **Re-measure** and prove the deltas.
+
+## Definition of done
+
+- [ ] Before/after CWV recorded for the top 5 surfaces (mobile, throttled); LCP <
+ 2.5s, INP < 200ms, CLS < 0.1 on each, or a documented reason + plan if a
+ specific surface can't yet.
+- [ ] Three.js / 3D engine code-split and lazy-loaded; non-3D pages don't ship
+ it on the critical path.
+- [ ] Images/canvas/embeds reserve space; CLS verified low.
+- [ ] Heaviest chunks reduced; bundle-size deltas recorded.
+- [ ] Static-asset caching headers correct in `vercel.json`.
+- [ ] `npm run build` + `npm test` pass; no new console errors.
+- [ ] Changelog: `improvement` entry ("Faster page loads / smoother 3D").
diff --git a/prompts/readiness/13-3d-asset-performance.md b/prompts/readiness/13-3d-asset-performance.md
new file mode 100644
index 000000000..8739c9307
--- /dev/null
+++ b/prompts/readiness/13-3d-asset-performance.md
@@ -0,0 +1,72 @@
+# 13 — 3D asset & render performance
+
+**Phase 3. [parallel-safe]** with 12, 14.
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, a 3D platform. Three.js + glTF/GLB, an
+animation pipeline (`public/animations/`, `scripts/build-animations.mjs`), GLB
+optimization scripts (`npm run optimize:glb`, `npm run compress:glbs`), and a
+universal avatar-animation system (`src/glb-canonicalize.js`,
+`src/animation-retarget.js`). Read [CLAUDE.md](../../CLAUDE.md), especially the
+"Avatar animation is universal — no rig allowlist" section. The only coin is
+**$THREE**.
+
+## Objective
+
+3D loads fast and runs smoothly on mid-tier mobile GPUs: compressed/optimized
+GLBs, bounded draw calls and texture memory, a steady frame rate with graceful
+quality scaling, and no memory leaks across avatar swaps or scene changes.
+
+## Why it matters
+
+The 3D experience IS the product's wow moment — the screenshot-and-share moment
+CLAUDE.md asks for. If it's a stuttering, battery-melting, slow-to-load
+experience on a phone, the magic is gone. Smooth 3D on commodity hardware is a
+hard moat and a core differentiator.
+
+## Instructions
+
+1. **Audit asset weight.** Find heavy GLBs/textures:
+ ```bash
+ find public -name '*.glb' -size +1M -exec ls -lah {} \; | sort -k5 -h | tail -30
+ find public -name '*.png' -o -name '*.jpg' | xargs ls -lah 2>/dev/null | sort -k5 -h | tail -30
+ ```
+2. **Compress everything.** Run/extend `npm run optimize:glb` and
+ `npm run compress:glbs`: Draco/meshopt geometry compression, KTX2/Basis
+ texture compression, dedupe, prune unused nodes. Confirm the decoders are
+ wired (`scripts/copy-three-decoders.mjs`). Target dramatic size cuts with no
+ visible quality loss; record before/after bytes per asset.
+3. **Runtime budgets.** Establish and enforce per-scene budgets: triangle count,
+ draw calls, texture memory. Merge geometry/instancing where avatars/props
+ repeat. Cap pixel ratio on mobile (`renderer.setPixelRatio(min(dpr, 2))`).
+4. **Quality scaling.** Detect device capability and scale: shadow resolution,
+ antialiasing, post-processing, animation LOD. A low-end phone should get a
+ smooth simplified scene, never a 5fps full-quality one.
+5. **Frame budget & loop hygiene.** Pause `requestAnimationFrame` when the canvas
+ is offscreen/tab hidden. Avoid per-frame allocations. Throttle expensive
+ updates. Confirm idle scenes drop to low/zero CPU.
+6. **Memory leaks.** On avatar swap / scene unmount, dispose geometries,
+ materials, textures, and render targets. Verify in devtools that repeated
+ swaps don't grow GPU/JS memory unbounded — this is the most common Three.js
+ production bug.
+7. **Loading UX.** Progressive load (low-res or skeleton → full), a real progress
+ indicator (no fake `setTimeout` progress — CLAUDE.md forbids it), and a
+ designed fallback if a GLB fails to load.
+8. **Verify on a throttled mobile profile** in devtools (CPU 4x slowdown, mobile
+ GPU): measure FPS on forge preview, an agent profile, walk companion, and the
+ club scene.
+
+## Definition of done
+
+- [ ] All shipped GLBs/textures compressed (Draco/meshopt + KTX2); before/after
+ sizes recorded; decoders wired and working.
+- [ ] Per-scene tri/draw-call/texture budgets defined and met; pixel ratio capped
+ on mobile.
+- [ ] Device-tier quality scaling implemented and verified on a low-end profile.
+- [ ] rAF pauses when offscreen/hidden; no per-frame allocations in hot paths.
+- [ ] No memory growth across repeated avatar/scene swaps (verified in devtools).
+- [ ] Real (non-faked) progressive loading + failure fallback on every 3D surface.
+- [ ] Measured FPS on forge/profile/walk/club on a throttled mobile profile,
+ recorded in your report; `npm test` passes.
+- [ ] Changelog: `improvement` entry ("Lighter, smoother 3D on mobile").
diff --git a/prompts/readiness/14-backend-caching.md b/prompts/readiness/14-backend-caching.md
new file mode 100644
index 000000000..0c6ba90e1
--- /dev/null
+++ b/prompts/readiness/14-backend-caching.md
@@ -0,0 +1,65 @@
+# 14 — Backend caching & data layer
+
+**Phase 3. [parallel-safe]** with 12–13.
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, Vercel functions (`api/`, 769 of them) +
+Cloudflare workers, talking to Solana RPC, pump.fun, a database, and KV/edge
+storage. Read [CLAUDE.md](../../CLAUDE.md). The only coin is **$THREE**.
+
+## Objective
+
+Hot read paths are cached with correct TTLs and invalidation; the database has
+the indexes its queries need; expensive upstream calls (RPC, pump.fun) are
+memoized/edge-cached instead of hit per request; cold starts are minimized. The
+platform stays fast and cheap as traffic grows.
+
+## Why it matters
+
+At scale, uncached reads against RPC/pump and unindexed DB queries are both a
+latency problem and a cost problem — they're how a viral moment becomes an outage
+and a bill. A $1B platform serves spikes from cache and reserves origin work for
+writes.
+
+## Instructions
+
+1. **Profile the hot paths.** Identify the most-hit read endpoints (trending,
+ marketplace, agent profiles, launches feed, leaderboards). For each, find what
+ it actually does per request — DB queries, RPC calls, external fetches.
+2. **Cache the reads.**
+ - Edge/CDN cache public GETs via `Cache-Control` + `s-maxage` +
+ `stale-while-revalidate` in responses / `vercel.json`.
+ - Memoize expensive upstream results (pump feed, RPC account reads, token
+ snapshots) in KV with short TTLs and SWR, keyed precisely. Reuse the
+ project's existing KV layer — don't add a second one.
+ - Add request-coalescing so a cache-miss stampede doesn't fan out N identical
+ upstream calls.
+3. **Invalidation.** Define how each cache is busted on the relevant write
+ (new launch, profile edit, new review). Stale data on a money/identity
+ surface is a correctness bug, not just a perf one — be precise about which
+ caches must be strongly consistent vs eventually consistent.
+4. **Database indexing.** Review the schema/migrations (`scripts/apply-migrations.mjs`,
+ `npm run db:status`). For every frequent query, confirm a supporting index
+ exists (foreign keys, sort columns, filter predicates, uniqueness). Add
+ migrations for missing ones. Check for N+1 query patterns and batch them.
+5. **Cold starts.** Keep function bundles lean (lazy-import heavy SDKs inside the
+ handler only when needed), reuse connections across invocations, and prefer
+ edge runtime for light read endpoints where compatible.
+6. **Pagination.** Confirm every list endpoint paginates (cursor preferred) and
+ never returns unbounded result sets. Cross-check the UI consumes it.
+7. **Measure.** Record p50/p95 latency and upstream-call count per hot endpoint
+ before/after. Prove the cache hit-rate is real.
+
+## Definition of done
+
+- [ ] Top read paths are edge/KV cached with correct TTL + SWR + invalidation;
+ cache hit-rate measured and meaningful.
+- [ ] Request coalescing prevents miss-stampede fan-out to RPC/pump.
+- [ ] Every frequent DB query has a supporting index (migrations added);
+ no N+1 on hot paths.
+- [ ] List endpoints paginate with bounded result sets.
+- [ ] Cold-start weight reduced (heavy SDK imports lazied); connections reused.
+- [ ] Before/after latency + upstream-call-count recorded per hot endpoint.
+- [ ] `npm run db:status` clean; `npm test` passes.
+- [ ] Changelog: `improvement`/`infra` entry if users feel the speed-up.
diff --git a/prompts/readiness/15-test-coverage.md b/prompts/readiness/15-test-coverage.md
new file mode 100644
index 000000000..f65140183
--- /dev/null
+++ b/prompts/readiness/15-test-coverage.md
@@ -0,0 +1,72 @@
+# 15 — Test coverage to the bar
+
+**Phase 4. Serial** (touches test config + CI gating).
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 3D AI-agent platform. Test stack: Vitest +
+Playwright (`npm test` runs `vitest run && playwright test`), ~456 test files
+already. Read [CLAUDE.md](../../CLAUDE.md). The only coin is **$THREE** — tests
+must use the `$THREE` CA or synthetic placeholders, never a real foreign mint.
+
+## Objective
+
+A test suite you can ship behind: every money/chain path, every API contract,
+and every critical user journey has automated coverage; flaky tests are fixed or
+quarantined with a tracked reason; and coverage is measured and gated in CI so it
+can't regress.
+
+## Why it matters
+
+You cannot move fast on a billion-dollar platform without a green suite you
+trust. Tests are how a small team ships daily without breaking payments. Coverage
+on money flows specifically is non-negotiable — a regression there is real lost
+funds.
+
+## Instructions
+
+1. **Baseline.** Run the suite and capture coverage:
+ ```bash
+ npx vitest run --coverage
+ npx playwright test --reporter=line
+ ```
+ Record overall % and, more importantly, per-area coverage for: `api/x402*`,
+ payments, pump launch, wallet/auth, agent CRUD, marketplace, forge pipeline.
+2. **Prioritize by risk, not by line count.** Fill gaps in this order:
+ money/chain → auth/session → data mutations → core user journeys → everything
+ else. 100% on a logger matters less than 100% on settlement.
+3. **API contract tests** (`tests/api/`): for each money/chain + mutation
+ endpoint — happy path, authz reject, validation reject, rate-limit, and
+ idempotency (aligns with [08](08-api-hardening.md)). Reuse existing patterns
+ like `tests/api/pump-trending-resilience.test.js`.
+4. **E2E journeys** (Playwright): forge a model → view it; create an agent →
+ appears in marketplace; connect wallet → sign in (SIWE); x402 checkout happy
+ path; launch flow. These are the flows a regression must never break.
+5. **Unit tests** for pure logic with edge cases: the canonicalize/retarget rig
+ mappings (extend `tests/glb-canonicalize.test.js` for any new skeleton),
+ pricing math, amount/address validation, x402 receipt verification.
+6. **De-flake.** Identify flaky tests (run the suite 3x; diff failures). Fix the
+ root cause (timing, shared state, real-network calls that should be stubbed at
+ the boundary). If one truly can't be fixed now, mark it with a tracked reason
+ and a follow-up — never delete coverage silently.
+7. **Gate coverage.** Add a coverage threshold (start at current, ratchet up) and
+ wire it so CI fails on regression (coordinate with
+ [16 — CI/CD](16-ci-cd-hardening.md)). Critical dirs get a higher floor.
+8. **No real external calls in unit tests.** Stub at the network boundary; keep
+ smoke/integration tests that hit real services separate and clearly labeled.
+
+## Definition of done
+
+- [ ] Coverage measured; per-area numbers recorded for money/chain, auth,
+ mutations, core journeys.
+- [ ] Every money/chain + mutation endpoint has contract tests (happy + authz +
+ validation + rate-limit + idempotency).
+- [ ] Playwright E2E covers forge, agent-create, SIWE login, x402 checkout, and
+ launch journeys.
+- [ ] Suite runs green 3x consecutively (no flakes), or remaining flakes are
+ quarantined with a tracked reason + follow-up.
+- [ ] Coverage threshold enforced and wired into CI; critical dirs have a higher
+ floor.
+- [ ] No real foreign mint in any fixture; no real external call in unit tests.
+- [ ] `npm test` passes.
+- [ ] Changelog: skip (internal) — testing isn't user-visible.
diff --git a/prompts/readiness/16-ci-cd-hardening.md b/prompts/readiness/16-ci-cd-hardening.md
new file mode 100644
index 000000000..6b0eb917f
--- /dev/null
+++ b/prompts/readiness/16-ci-cd-hardening.md
@@ -0,0 +1,73 @@
+# 16 — CI/CD hardening
+
+**Phase 4. Serial** (changes pipeline config).
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, deployed via Vercel; mirrors to two GitHub
+remotes (`threeD` push-only, `threews` canonical). Currently **one** workflow:
+`.github/workflows/ci.yml`. Rich script surface already exists (`audit:*`,
+`smoke:*`, `verify:*`, `test`, `lint`, `typecheck`). Read
+[CLAUDE.md](../../CLAUDE.md). The only coin is **$THREE**.
+
+## Objective
+
+A CI/CD pipeline that makes broken code impossible to merge and gives every PR a
+previewable, verified deploy: lint + typecheck + unit + E2E + the repo's own
+audits run as required gates, secrets scanning runs on every push, preview
+deploys are smoke-tested, and production deploys are reproducible and reversible.
+
+## Why it matters
+
+A single CI workflow on a 769-endpoint, money-moving platform is under-defended.
+Investors and partners judge engineering maturity by how hard it is to ship a
+regression. Preview deploys + gates are how a team scales contribution without
+scaling breakage.
+
+## Instructions
+
+1. **Read the current pipeline.** Open `.github/workflows/ci.yml`; list what runs
+ and what's missing. Map the available scripts (from `package.json`) to gates:
+ `lint`, `typecheck`, `test`, `audit:pages`, `audit:handlers`, `check:images`,
+ `audit:web`, `audit:mcp`, `smoke:onchain:ci`, `verify:solana`,
+ `validate:cards`, `audit:deploy`, `check:dist`.
+2. **Required PR gates** (fail the merge):
+ - Install + build (`npm ci` honoring the workspaces lockfile).
+ - `lint`, `typecheck`, `format:check`.
+ - `vitest run --coverage` with the threshold from [15](15-test-coverage.md).
+ - `playwright test` (sharded if slow) for E2E.
+ - The repo auditors above that are CI-safe.
+ - Coin-compliance guard test from [06](06-three-coin-compliance-sweep.md).
+3. **Secrets scanning.** Add a job (gitleaks/trufflehog) that fails on any
+ committed secret, plus `npm audit --omit=dev` (or dependency-review) for CVEs.
+ Aligns with [07](07-secrets-and-env-hardening.md) /
+ [09](09-security-review.md).
+4. **Preview deploys.** Every PR gets a Vercel preview; run a small smoke suite
+ against the preview URL (health endpoint, a key page renders, an API responds).
+ Block merge if the preview smoke fails.
+5. **Caching & speed.** Cache `node_modules`/Vite/Playwright browsers so CI is
+ fast. Shard or parallelize the slow jobs. Keep total PR feedback under a few
+ minutes where possible.
+6. **Production deploy safety.** Document/codify the deploy: `build:all` →
+ `check:dist` → deploy, with `audit:deploy` guarding artifacts (note the
+ CLAUDE.md trap: `npx vercel build` can overwrite `api/*.js` with bundles —
+ guard against committing those). Ensure rollback is one step and documented.
+7. **Branch protection.** Document the required-checks + review settings on
+ `threews` (canonical). Note the mirror rule: pushes go to BOTH remotes; never
+ pull/fetch from `threeD`.
+8. **Concurrency.** Cancel superseded runs per-branch to save minutes.
+
+## Definition of done
+
+- [ ] PR pipeline runs install+build, lint, typecheck, format check, unit+
+ coverage-gate, E2E, the CI-safe repo auditors, and the coin-compliance
+ guard — all required to merge.
+- [ ] Secrets-scanning + dependency-CVE jobs run on every push and fail on
+ findings.
+- [ ] Every PR gets a preview deploy that is smoke-tested; failure blocks merge.
+- [ ] CI caches deps/browsers and cancels superseded runs; feedback is fast.
+- [ ] Production deploy + one-step rollback documented in `docs/` (with the
+ `vercel build` bundle-overwrite guard noted).
+- [ ] Branch protection + dual-remote push rules documented.
+- [ ] A test PR demonstrates the gates catching a deliberately broken change.
+- [ ] Changelog: skip (internal infra).
diff --git a/prompts/readiness/17-accessibility-audit.md b/prompts/readiness/17-accessibility-audit.md
new file mode 100644
index 000000000..fece6d5fe
--- /dev/null
+++ b/prompts/readiness/17-accessibility-audit.md
@@ -0,0 +1,73 @@
+# 17 — Accessibility audit (WCAG 2.2 AA)
+
+**Phase 4. [parallel-safe]** with 15–16 (touches markup, not pipeline).
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 125 pages. Read [CLAUDE.md](../../CLAUDE.md) —
+"Accessibility is not optional. Semantic HTML. ARIA labels. Keyboard navigation.
+Sufficient contrast. Focus indicators." The only coin is **$THREE**.
+
+## Objective
+
+The platform is usable by keyboard and screen reader and meets WCAG 2.2 AA on
+every primary surface: semantic landmarks, labeled controls, visible focus,
+sufficient contrast, respected reduced-motion, and accessible names on the 3D/
+canvas surfaces.
+
+## Why it matters
+
+Accessibility is both a quality signal and a market-size lever — it's a
+requirement for enterprise/institutional adoption and a legal expectation at
+scale. It also forces the structural correctness (semantics, focus management)
+that makes the whole UI more robust. It is part of the screenshot-worthy quality
+bar, not a compliance afterthought.
+
+## Instructions
+
+1. **Automated pass.** Run axe across the top surfaces (home, forge, marketplace,
+ trending, agent profile, studio, checkout, login, settings):
+ ```bash
+ npx @axe-core/cli http://localhost:3000/ http://localhost:3000/forge http://localhost:3000/marketplace
+ ```
+ (Use the dev server, `npm run dev`.) Record violations per surface. Automated
+ tools catch ~40% — do the manual pass too.
+2. **Keyboard.** Tab through every surface: logical order, no traps, every
+ interactive element reachable and operable with Enter/Space, visible focus
+ ring on each (never `outline: none` without a replacement). Modals trap focus
+ while open and restore it on close. Skip-to-content link present.
+3. **Screen reader.** Verify with VoiceOver/NVDA semantics: one `<h1>` per page,
+ ordered headings, landmark regions (`<nav> <main> <footer>`), buttons vs links
+ used correctly, form inputs have associated `<label>`s, icon-only buttons have
+ `aria-label`, live regions (`aria-live`) announce async updates (toasts, load
+ results).
+4. **Contrast.** Check text and UI-component contrast against AA (4.5:1 text,
+ 3:1 large/UI). Fix failures using the existing design tokens
+ (`docs/DESIGN-TOKENS.md`) — adjust the token, not one-off overrides
+ (coordinate with [20 — design system](20-design-system-consistency.md)).
+5. **Motion.** Respect `prefers-reduced-motion` — disable non-essential
+ animation/parallax/auto-rotate 3D for users who ask. There's a
+ `theme-switcher`/media-query pattern already; reuse it.
+6. **3D/canvas a11y.** Canvas content is invisible to AT — provide a text
+ alternative / `aria-label` describing the avatar/scene, and ensure all
+ controls (rotate, zoom, play) have keyboard equivalents and labels.
+7. **Forms & errors.** Errors are programmatically associated with their field
+ (`aria-describedby`), announced, and not conveyed by color alone.
+8. **Add a CI a11y check** (axe in Playwright) on the top surfaces so regressions
+ are caught (feeds [16](16-ci-cd-hardening.md)).
+
+## Definition of done
+
+- [ ] axe run on the top 8+ surfaces; violations recorded and resolved (or
+ tracked with a reason).
+- [ ] Full keyboard operability verified: order, no traps, visible focus, modal
+ focus management, skip link.
+- [ ] Screen-reader semantics correct: headings, landmarks, labels, live regions.
+- [ ] All text/UI contrast meets AA, fixed via design tokens.
+- [ ] `prefers-reduced-motion` honored across animations and 3D.
+- [ ] 3D/canvas surfaces have text alternatives + keyboard-operable, labeled
+ controls.
+- [ ] Form errors are associated, announced, and not color-only.
+- [ ] An automated a11y check runs in CI on the top surfaces.
+- [ ] Changelog: `improvement` entry ("Accessibility improvements across the
+ app").
diff --git a/prompts/readiness/18-state-design-sweep.md b/prompts/readiness/18-state-design-sweep.md
new file mode 100644
index 000000000..d87543fe4
--- /dev/null
+++ b/prompts/readiness/18-state-design-sweep.md
@@ -0,0 +1,69 @@
+# 18 — Every state designed (loading / empty / error / overflow)
+
+**Phase 5. [parallel-safe]** with 19–21.
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 3D AI-agent platform. Read
+[CLAUDE.md](../../CLAUDE.md) — "Every state is designed. Loading, empty, error,
+populated, overflow — all of them. A page with no data should tell the user what
+to do next, not show a blank void. Skeleton screens preferred over spinners." The
+only coin is **$THREE**.
+
+## Objective
+
+Every data-driven surface has a designed, helpful state for all five conditions:
+loading (skeleton), empty (with a next action), error (with recovery), populated,
+and overflow (long names, 1000 items, tiny/huge values). No blank voids, no raw
+spinners where a skeleton fits, no dead-end empty screens.
+
+## Why it matters
+
+The states users hit most — first visit (empty), slow network (loading), failure
+(error) — are exactly the ones teams skip. Designing them is what makes a product
+feel finished and trustworthy. This is where "adequate" becomes "screenshot-
+worthy."
+
+## Instructions
+
+1. **Inventory data surfaces.** Every list, grid, feed, detail page, chart, and
+ 3D viewer that loads async data: home live sections, marketplace, trending,
+ launches, agent profile, reputation, collection, search results, chat,
+ earnings/analytics, x402 history. Build the checklist.
+2. **For each, design all five:**
+ - **Loading:** skeleton matching the final layout (not a centered spinner),
+ sized to prevent CLS. Reuse a shared skeleton component — build one if none
+ exists; don't reinvent per page.
+ - **Empty:** explain *why* it's empty and give the next action ("No agents yet
+ — Forge your first" with a button). Never just "No data." This is the
+ conversion moment for new users.
+ - **Error:** what went wrong (plainly) + a recovery action (Retry / Reconnect
+ / Refresh). Ties to [03 — error boundaries](03-harden-error-boundaries.md).
+ - **Populated:** the normal case — confirm it's polished.
+ - **Overflow:** truncate long text with ellipsis + title/tooltip; paginate or
+ virtualize long lists; handle huge/zero/negative numbers and very long
+ agent names without breaking layout.
+3. **Real async indicators only.** No `setTimeout` fake-loading, no fake progress
+ bars (CLAUDE.md hard rule). Loading reflects real request state.
+4. **Transitions.** States enter/exit with intention — opacity/transform
+ transitions, no jarring pops (CLAUDE.md). Skeleton → content should crossfade,
+ not snap.
+5. **Verify by forcing each state** in `npm run dev`: throttle/offline for
+ loading+error, a fresh/empty account for empty, seeded long names + many items
+ for overflow. Screenshot each for your report (don't commit screenshots — see
+ repo hygiene).
+
+## Definition of done
+
+- [ ] Every async data surface has all five states designed and reachable.
+- [ ] Loading uses layout-matched skeletons (shared component), not bare spinners,
+ and reserves space (no CLS).
+- [ ] Every empty state names the next action with a working CTA.
+- [ ] Every error state is plain-language + has a recovery action.
+- [ ] Overflow handled: long text truncates, long lists paginate/virtualize,
+ extreme numbers don't break layout.
+- [ ] No fake loading/progress anywhere; transitions are smooth.
+- [ ] Each state verified by forcing the condition in the browser (logged in your
+ report).
+- [ ] `npm test` passes. Changelog: `improvement` entry ("Polished loading,
+ empty, and error states across the app").
diff --git a/prompts/readiness/19-responsive-mobile-sweep.md b/prompts/readiness/19-responsive-mobile-sweep.md
new file mode 100644
index 000000000..68110459c
--- /dev/null
+++ b/prompts/readiness/19-responsive-mobile-sweep.md
@@ -0,0 +1,64 @@
+# 19 — Responsive / mobile sweep
+
+**Phase 5. [parallel-safe]** with 18, 20–21.
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 3D AI-agent platform, 125 pages. Read
+[CLAUDE.md](../../CLAUDE.md) — "Responsive by default. Test at 320px, 768px, and
+1440px mentally. Relative units. Flex/grid over fixed widths." There is a PWA
+(`generate-icons`, theme-boot). The only coin is **$THREE**.
+
+## Objective
+
+Every surface works and looks intentional at 320px, 375px, 768px, 1024px, and
+1440px+: no horizontal scroll, no overlapping/clipped content, tap targets ≥
+44px, readable type, working mobile navigation, and 3D that's usable with touch.
+
+## Why it matters
+
+Most of the audience for a viral crypto/AI product arrives on a phone — often via
+a shared link. If the landing or forge experience is broken on mobile, the growth
+loop dies at the first hop. Mobile polish is directly upstream of the $1B funnel.
+
+## Instructions
+
+1. **Audit at each breakpoint** in devtools device mode across the top surfaces
+ (home, forge, marketplace, trending, agent profile, studio, walk, club,
+ checkout, login, settings, chat). Log every issue: horizontal overflow,
+ clipped text, overlapping elements, unreachable controls, tiny tap targets,
+ broken 3D canvas sizing.
+2. **Fix layout systemically.** Prefer fluid grids/flex, `clamp()` type,
+ container queries where supported, and relative units over fixed px. Don't
+ patch one viewport and break another — verify the fix holds across all
+ breakpoints.
+3. **Navigation.** Confirm a real mobile nav (hamburger/drawer) that's keyboard +
+ touch accessible, closes on selection/escape, and doesn't trap scroll. Reuse
+ the existing `nav.js`/`nav.css` — extend, don't fork.
+4. **Touch.** Tap targets ≥ 44×44px with adequate spacing. Hover-only affordances
+ need a touch equivalent. 3D viewers: pinch-zoom/drag-orbit work and don't
+ hijack page scroll unexpectedly.
+5. **Forms & modals on mobile.** Inputs use correct `inputmode`/`type` (numeric
+ keypad for amounts), modals fit the viewport and scroll internally, the
+ on-screen keyboard doesn't cover the active field or submit button.
+6. **Safe areas & PWA.** Respect `env(safe-area-inset-*)` on notched devices.
+ Verify the PWA installs and the icons/splash render. Theme-boot must not flash.
+7. **Performance on mobile** overlaps with [12](12-frontend-performance.md) and
+ [13](13-3d-asset-performance.md) — keep them consistent; don't regress CWV
+ while fixing layout.
+8. **Verify on real-ish conditions:** device emulation + at least one real phone
+ if available. Test both portrait and landscape.
+
+## Definition of done
+
+- [ ] No horizontal scroll, clipping, or overlap on any top surface at 320 / 375 /
+ 768 / 1024 / 1440px (logged per surface).
+- [ ] Mobile nav works (touch + keyboard), closes correctly, no scroll trap.
+- [ ] All tap targets ≥ 44px; hover-only affordances have touch equivalents.
+- [ ] 3D viewers usable with touch and don't hijack page scroll.
+- [ ] Mobile forms use correct input modes; modals + keyboard don't obscure
+ inputs/submit.
+- [ ] Safe-area insets respected; PWA installs; no theme flash.
+- [ ] CWV not regressed (cross-checked with prompt 12).
+- [ ] `npm test` passes. Changelog: `improvement` entry ("Improved mobile
+ experience across the platform").
diff --git a/prompts/readiness/20-design-system-consistency.md b/prompts/readiness/20-design-system-consistency.md
new file mode 100644
index 000000000..955a1b314
--- /dev/null
+++ b/prompts/readiness/20-design-system-consistency.md
@@ -0,0 +1,70 @@
+# 20 — Design-system & token consistency
+
+**Phase 5. [parallel-safe]** with 18–19, 21.
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 3D AI-agent platform. There is a design-token
+doc (`docs/DESIGN-TOKENS.md`), a `public/nav.css`, a `theme-switcher.js` with
+light/dark/auto, and a button-pill migration doc (`docs/btn-pill-migration.md`).
+Read [CLAUDE.md](../../CLAUDE.md) — "Consistent spacing and typography. Use the
+existing design tokens. If none exist, establish them and use them everywhere."
+The only coin is **$THREE**.
+
+## Objective
+
+One coherent visual system across all 125 pages: every color, space, radius,
+shadow, font-size, and component (button, input, card, modal, badge, toast) comes
+from shared tokens/components — no one-off hex values, magic-number spacing, or
+divergent button styles. Light and dark themes both correct everywhere.
+
+## Why it matters
+
+Visual consistency is the cheapest, most visible signal of quality. Products that
+look like Linear/Stripe feel trustworthy enough to put money into. Inconsistency
+reads as "unfinished" and undermines every other thing this program fixes.
+
+## Instructions
+
+1. **Audit token drift.** Find raw values that should be tokens:
+ ```bash
+ grep -rIn "#[0-9a-fA-F]\{3,8\}\b" --include=*.css --include=*.html public/ pages/ src/ | grep -v node_modules | wc -l
+ grep -rIn "px;" --include=*.css public/ pages/ | grep -v node_modules | wc -l # magic spacing
+ ```
+ Compare against the tokens in `docs/DESIGN-TOKENS.md`. Catalog the divergences.
+2. **Consolidate tokens.** Ensure a single source of truth (CSS custom properties
+ in one place) for color, spacing scale, radius, shadow, typography scale,
+ z-index, and motion durations. Fill gaps in `docs/DESIGN-TOKENS.md`.
+3. **Replace raw values with tokens** across CSS/HTML/inline styles. Inline
+ `style="..."` with hardcoded colors/sizes (common in this repo's JS-built UI)
+ should reference tokens or shared classes. Work surface-by-surface.
+4. **Unify components.** One button system (finish the `btn-pill-migration`), one
+ input style, one card, one modal, one toast, one badge. Find divergent
+ implementations and converge them. Extract shared components where the same UI
+ is rebuilt per page.
+5. **Theme correctness.** Every surface must be correct in light, dark, and auto.
+ Test the theme-switcher on each top page — no unreadable text, no invisible
+ borders, no hardcoded dark-only colors. Fix via tokens, not per-theme hacks.
+6. **Typography & spacing rhythm.** Consistent type scale and a consistent
+ spacing scale (4/8px system or whatever the tokens define). No arbitrary
+ `margin: 13px`.
+7. **Microinteractions consistency.** Hover/active/focus states use the same
+ motion tokens and feel uniform across components (ties to
+ [17 — a11y focus rings](17-accessibility-audit.md)).
+8. **Document** the system so new work stays consistent — update
+ `docs/DESIGN-TOKENS.md` with usage examples and a "don't hardcode" rule.
+
+## Definition of done
+
+- [ ] Raw hex/spacing values replaced by tokens across the top surfaces; the
+ remaining count is near-zero and justified (e.g. third-party vendored CSS).
+- [ ] Single source of truth for all token categories; `docs/DESIGN-TOKENS.md`
+ complete and authoritative.
+- [ ] One unified button/input/card/modal/toast/badge system; divergent copies
+ converged or extracted to shared components.
+- [ ] Light/dark/auto themes verified correct on every top surface.
+- [ ] Consistent type + spacing scale; no arbitrary magic numbers on touched
+ surfaces.
+- [ ] Hover/active/focus states uniform via motion tokens.
+- [ ] `npm test` passes. Changelog: `improvement` entry ("Unified, consistent
+ visual design across the platform").
diff --git a/prompts/readiness/21-onboarding-first-run.md b/prompts/readiness/21-onboarding-first-run.md
new file mode 100644
index 000000000..800fba9fb
--- /dev/null
+++ b/prompts/readiness/21-onboarding-first-run.md
@@ -0,0 +1,74 @@
+# 21 — Onboarding & first-run experience
+
+**Phase 5. [parallel-safe]** with 18–20.
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 3D AI-agent platform. There's a getting-
+started surface (`public/getting-started.js`), a feature tour
+(`src/feature-tour/`), feature-discovery (`public/feature-discovery.js`), and a
+tour SDK (`tour-sdk/`). Read [CLAUDE.md](../../CLAUDE.md). The product's hook is
+"give your AI a body — type a prompt, Forge a 3D model in 60 seconds." The only
+coin is **$THREE**.
+
+## Objective
+
+A first-time visitor reaches the platform's "aha" — a generated 3D agent — within
+60 seconds, with zero confusion and no forced signup before value. The path from
+landing → first creation → save/share → next step is guided, fast, and obviously
+valuable.
+
+## Why it matters
+
+Activation is the top of every growth model. A billion-dollar valuation is a
+function of how many visitors become active users and how fast. The first 60
+seconds decide it. A confusing or gated first run caps the entire funnel
+regardless of how good everything downstream is.
+
+## Instructions
+
+1. **Map the current first-run.** As a brand-new user (incognito, no wallet),
+ walk: land on home → get to forge → generate → view → save/share → "what
+ next." Time it. Note every point of confusion, friction, or premature gate.
+2. **Define the activation moment** explicitly (first successful 3D generation)
+ and instrument it (coordinate with [25 — analytics](25-analytics-funnel.md))
+ so activation rate is measurable.
+3. **Remove premature gates.** Per the README hook, the free draft tier needs no
+ account. Confirm a visitor can Forge and see a result before any signup/wallet
+ prompt. Move auth to the moment it's actually required (save permanently,
+ mint, pay) and explain why at that moment.
+4. **Guide, don't dump.** A focused first-run: a clear primary CTA on the landing
+ ("Forge your first agent"), an inline example prompt they can one-click try,
+ and a lightweight tour (reuse `src/feature-tour/` — don't build a new one)
+ that highlights the 2–3 things that matter, skippable and non-blocking.
+5. **Empty states as onboarding.** New-user empty states (no agents, no
+ collection) double as guidance with a real next action — coordinate with
+ [18 — state design](18-state-design-sweep.md).
+6. **First success → next step.** After the first generation, surface the obvious
+ next actions (animate it, embed it, give it a brain, register it, share it).
+ Wire these as real links (no dead ends — ties to
+ [05 — dead paths](05-dead-path-and-handler-audit.md)).
+7. **Shareable result.** The first creation should be one-click shareable with a
+ real OG preview (coordinate with [22 — SEO/shareability](22-seo-and-shareability.md))
+ — the share IS the growth loop.
+8. **Returning-user state.** A returning user skips the intro and lands on
+ something useful (their agents / dashboard), not the cold landing.
+9. **Verify end-to-end** in a clean session and time it again; prove < 60s to
+ first generated model.
+
+## Definition of done
+
+- [ ] New, unauthenticated user can reach a generated 3D agent in under 60s,
+ verified in a clean session (time recorded before/after).
+- [ ] No signup/wallet gate before first value; auth appears only when truly
+ required, with an explanation.
+- [ ] A skippable, non-blocking first-run guide (reusing `src/feature-tour/`)
+ highlights the key actions.
+- [ ] New-user empty states guide to a real next action.
+- [ ] Post-first-success next steps are surfaced and wired (animate / embed /
+ brain / register / share — no dead links).
+- [ ] First creation is one-click shareable with a real OG preview.
+- [ ] Returning users land on something useful, not the cold intro.
+- [ ] Activation event instrumented and measurable.
+- [ ] `npm test` passes. Changelog: `feature`/`improvement` entry ("Faster,
+ guided first-run experience").
diff --git a/prompts/readiness/22-seo-and-shareability.md b/prompts/readiness/22-seo-and-shareability.md
new file mode 100644
index 000000000..fff26ddd6
--- /dev/null
+++ b/prompts/readiness/22-seo-and-shareability.md
@@ -0,0 +1,76 @@
+# 22 — SEO & shareability
+
+**Phase 6. [parallel-safe]** with 23–26.
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 3D AI-agent platform, 125 pages. There's
+already SEO tooling: `scripts/inject-seo-meta.mjs`, `scripts/inject-blog-seo.mjs`,
+`scripts/build-page-index.mjs`, structured data in page heads, a blog
+(`blog/`), and a changelog feed. Read [CLAUDE.md](../../CLAUDE.md) — "What would
+make someone screenshot this and share it?" The only coin is **$THREE**.
+
+## Objective
+
+Every page is discoverable and every shareable artifact (agent, generated model,
+launch, profile) renders a rich, correct social card. Search engines and LLMs can
+crawl and understand the site; links pasted into X/Discord/Telegram unfurl into
+something people click.
+
+## Why it matters
+
+Organic discovery + viral link-unfurls are the cheapest acquisition channels and
+the ones that compound. A $1B consumer/crypto platform lives or dies on shared
+links rendering beautifully and on ranking for its category. This is the demand
+side of the growth equation.
+
+## Instructions
+
+1. **Audit current SEO.** Run the existing tooling and check coverage:
+ ```bash
+ npm run seo:meta # inject blog + page SEO, rebuild index
+ npm run build:pages # page index + changelog feeds
+ ```
+ Verify every page has: unique `<title>`, meta description, canonical URL,
+ `og:*` + `twitter:card` tags, and valid JSON-LD where relevant.
+2. **Dynamic OG images.** Shareable entities (agent profile, generated model,
+ launch, leaderboard rank) need a per-entity OG image — ideally a rendered
+ preview of the actual 3D agent. Build an OG-image endpoint (`api/og/*`) that
+ generates a branded card with the entity's real data/thumbnail. No generic
+ fallback for things that have a real preview.
+3. **Sitemap & robots.** Generate a complete `sitemap.xml` from the page index +
+ dynamic entities, and a correct `robots.txt`. Submit-ready. Ensure
+ noindex on what shouldn't be indexed (auth, internal).
+4. **Structured data.** Add/verify JSON-LD: `WebSite` + `SearchAction` on home,
+ `Product`/`SoftwareApplication` where it fits, `BreadcrumbList`, `Article` on
+ blog posts, `FAQPage` on FAQ/docs. Validate with the Rich Results test format.
+5. **Crawlability for SPA-ish surfaces.** Anything rendered client-only that
+ should rank needs SSR/prerender or a static fallback so crawlers and link
+ unfurlers (which don't run much JS) get real content. Confirm OG tags are in
+ the initial HTML, not injected post-load.
+6. **LLM/agent discoverability.** Ensure `llms.txt` (or equivalent) and clean
+ semantic HTML so AI crawlers represent the platform correctly — relevant for
+ an agent platform. Cross-check the x402 discovery indexing already in place
+ (your memory: CDP Bazaar / x402scan / 402index).
+7. **Performance ties in.** Core Web Vitals are a ranking factor — keep
+ [12](12-frontend-performance.md) consistent.
+8. **Verify unfurls.** Paste representative URLs (home, an agent profile, a
+ generated model, a blog post) into a card validator / a real X/Discord/
+ Telegram message and confirm the card renders with correct image, title,
+ description.
+
+## Definition of done
+
+- [ ] Every page has unique title, description, canonical, OG + Twitter card, and
+ valid JSON-LD where relevant (verified, not assumed).
+- [ ] Per-entity dynamic OG images render real previews for agents/models/
+ launches/profiles via an `api/og/*` endpoint.
+- [ ] Complete `sitemap.xml` (static + dynamic) and correct `robots.txt`; noindex
+ on private routes.
+- [ ] JSON-LD validates for home, blog, and key entity types.
+- [ ] Shareable surfaces expose OG tags in initial HTML (crawler/unfurl-safe).
+- [ ] `llms.txt`/semantic HTML supports AI crawlers; x402 discovery intact.
+- [ ] Real unfurl test passed for 4+ representative URLs.
+- [ ] `npm run build:pages` clean; `npm test` passes.
+- [ ] Changelog: `improvement` entry ("Rich social previews and better
+ discoverability").
diff --git a/prompts/readiness/23-growth-virality.md b/prompts/readiness/23-growth-virality.md
new file mode 100644
index 000000000..58f92314b
--- /dev/null
+++ b/prompts/readiness/23-growth-virality.md
@@ -0,0 +1,74 @@
+# 23 — Growth & virality loops
+
+**Phase 6. [parallel-safe]** with 22, 24–26.
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 3D AI-agent platform. There's referral capture
+(`public/referral-capture.js`), an embed SDK (`public/embed-sdk.js`,
+`public/embed.js`), a walk companion SDK (`walk-sdk/`), a page-agent SDK
+(`page-agent-sdk/`), and newsletter capture (`public/footer-newsletter.js`). Read
+[CLAUDE.md](../../CLAUDE.md). The only coin is **$THREE**.
+
+## Objective
+
+Build and complete the loops that make growth compound: every created agent is
+shareable and embeddable (each embed is an ad on someone else's site), referrals
+are tracked and rewarded, and the product's natural artifacts (3D models,
+profiles, launches) are designed to be shared. Close the loops that already half
+-exist rather than inventing new ones.
+
+## Why it matters
+
+A $1B valuation requires a growth coefficient that doesn't depend on paid
+acquisition. The embed SDK and walk companion are inherently viral — a three.ws
+agent on a thousand other sites is a thousand acquisition surfaces. These loops
+must be frictionless and instrumented, or the compounding never starts.
+
+## Instructions
+
+1. **Map existing loops and find the leaks.** For each: share-a-model,
+ embed-an-agent, walk-companion-on-a-site, referral, launch-announcement —
+ trace the full loop (trigger → artifact → recipient → return visit → reactivate)
+ and find where it breaks or isn't instrumented.
+2. **Embed = growth surface.** Make embedding an agent trivial: a one-click
+ "Embed" with copy-paste snippet (the `<agent-3d>` / `<page-agent>` web
+ components), live preview, and customization. Every embed should carry a
+ subtle, non-obnoxious "Made with three.ws" attribution linking back (with a
+ referral param). Verify the embed SDK actually works on a third-party page.
+3. **Shareability.** Every agent/model/profile/launch has a prominent Share that
+ produces a rich link (depends on [22 — OG images](22-seo-and-shareability.md))
+ and pre-filled share text for X/Telegram/Discord. The generated 3D model is
+ the hero of the share.
+4. **Referrals, completed.** `referral-capture.js` captures inbound refs —
+ confirm the full loop: attribution persists through signup, the referrer is
+ credited, and there's a real, honest reward (in-product benefit; if anything
+ token-related, it is **$THREE** only and must follow the coin rules). Build a
+ simple "invite" surface with the user's ref link + their referral stats.
+5. **Reactivation.** Newsletter + the existing Telegram changelog channel are
+ reactivation channels — confirm capture works, double-opt-in where required,
+ and that there's a reason to come back (new features, their agent's activity).
+ No dark patterns.
+6. **Instrument every loop** (coordinate with [25 — analytics](25-analytics-funnel.md)):
+ share clicks, embed installs, embed impressions, referral signups, K-factor.
+ You can't grow what you don't measure.
+7. **Verify each loop end-to-end** with a real second browser/account: share a
+ model and open the link, embed on a scratch HTML page and confirm it loads +
+ attributes, sign up via a ref link and confirm credit.
+
+## Definition of done
+
+- [ ] One-click Embed with working snippet + live preview + back-link attribution;
+ verified loading on a real third-party page.
+- [ ] Every shareable entity has a prominent Share producing a rich link with
+ pre-filled platform-appropriate text.
+- [ ] Referral loop complete: capture → persist → signup attribution → referrer
+ credit → invite surface with stats. Any reward is $THREE-only and
+ rule-compliant.
+- [ ] Reactivation channels (newsletter, Telegram) capture correctly with proper
+ opt-in; no dark patterns.
+- [ ] Every loop instrumented (share/embed/referral/K-factor) and visible in
+ analytics.
+- [ ] Each loop verified end-to-end with a second account/browser.
+- [ ] `npm test` passes. Changelog: `feature` entry ("Share & embed your agents
+ anywhere; invite friends").
diff --git a/prompts/readiness/24-monetization-completeness.md b/prompts/readiness/24-monetization-completeness.md
new file mode 100644
index 000000000..00f2be2c4
--- /dev/null
+++ b/prompts/readiness/24-monetization-completeness.md
@@ -0,0 +1,80 @@
+# 24 — Monetization completeness
+
+**Phase 6. [parallel-safe]** with 22–23, 25–26.
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 3D AI-agent platform with real monetization
+surfaces: x402 paid endpoints (`api/x402*`, `public/x402*.js`), MCP paid tools,
+skill-license NFTs, pump.fun launches, the `monetize-service` / `pay-for-service`
+skills, and an existing `prompts/monetization/` series. Read
+[CLAUDE.md](../../CLAUDE.md). The only coin is **$THREE**
+(`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`); USDC is a payment rail only.
+
+## Objective
+
+Every money path is complete, correct, and reconcilable end-to-end: pricing is
+real and consistent, checkout (x402 + any fiat onramp) works flawlessly, creators
+get paid accurately, the platform's take is transparent, and every transaction is
+recorded, idempotent, and auditable. No half-wired billing.
+
+## Why it matters
+
+Revenue is the numerator of the valuation. Investors underwrite a $1B platform on
+real, growing, defensible revenue with clean unit economics — not on a checkout
+that sometimes double-charges or a payout that doesn't reconcile. Money code must
+be the most correct code in the repo.
+
+## Instructions
+
+1. **Inventory money flows.** List every way value moves: x402 pay-per-call,
+ skill purchase/subscription, skill-license NFT mint, pump launches, agent
+ wallet ops, SNS pay-by-name, MCP paid tools. For each, trace: quote → pay →
+ verify → settle → grant access → record → (payout to creator) → reconcile.
+2. **Pricing as a single source of truth.** Prices must come from one server-side
+ source, never trusted from the client. Confirm the amount charged equals the
+ amount quoted equals the amount in the signed payload (ties to
+ [09 — security](09-security-review.md)). Support the currencies the existing
+ monetization prompts define; $THREE rules apply to anything token-denominated.
+3. **Checkout completeness.** The x402 checkout flow has every state designed
+ (insufficient funds, rejected signature, network failure mid-payment, success)
+ — coordinate with [18 — state design](18-state-design-sweep.md). If a fiat
+ onramp is in scope (`prompts/monetization/25-fiat-on-ramp-integration.md`),
+ verify it end-to-end, not stubbed.
+4. **Idempotency & receipts.** Every settlement is idempotent (a retry never
+ double-charges or double-grants — ties to
+ [08](08-api-hardening.md)/[10](10-resilience-external-calls.md)). Every
+ transaction produces a durable receipt the user can see and the platform can
+ audit.
+5. **Creator payouts.** If creators earn (skill sales, etc.), confirm payout
+ accounting is correct to the lamport/cent: balances, the platform fee
+ (transparent %), payout execution, and a reconciliation check that on-chain/
+ ledger totals match recorded totals. Build the earnings dashboard if the
+ monetization prompts specify one and it's not wired.
+6. **Subscriptions / gating.** If subscriptions or token-gating exist, verify
+ access is granted/revoked correctly on renew/expire/cancel, and that gating
+ checks are authoritative (on-chain `SkillLicense` PDA or a verified server
+ check — not a spoofable client flag).
+7. **Reconciliation job.** A scheduled job that reconciles recorded revenue vs
+ on-chain settlement and flags discrepancies — surfaced via
+ [11 — observability](11-observability.md).
+8. **Test the money paths hardest** (ties to [15 — coverage](15-test-coverage.md)):
+ happy path, double-submit, partial failure, refund/clawback if supported.
+
+## Definition of done
+
+- [ ] Every money flow traced and complete end-to-end (quote→settle→grant→record→
+ payout→reconcile); none half-wired.
+- [ ] Pricing is server-authoritative; charged = quoted = signed, verified.
+- [ ] x402 checkout (+ fiat onramp if in scope) has every state designed and
+ works end-to-end with real payments — no stubs.
+- [ ] Settlements are idempotent; every transaction yields a user-visible,
+ auditable receipt.
+- [ ] Creator payouts reconcile to the smallest unit; platform fee is transparent;
+ earnings dashboard wired if specified.
+- [ ] Subscription/gating access transitions are correct and authoritative.
+- [ ] A reconciliation job flags revenue/settlement discrepancies.
+- [ ] Money-path tests cover happy + double-submit + partial-failure; `npm test`
+ passes.
+- [ ] Changelog: `feature`/`improvement` entry for any user-facing monetization
+ change ($THREE-compliant copy only).
diff --git a/prompts/readiness/25-analytics-funnel.md b/prompts/readiness/25-analytics-funnel.md
new file mode 100644
index 000000000..9ce908eeb
--- /dev/null
+++ b/prompts/readiness/25-analytics-funnel.md
@@ -0,0 +1,74 @@
+# 25 — Analytics & funnel instrumentation
+
+**Phase 6. [parallel-safe]** with 22–24, 26.
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 3D AI-agent platform. PostHog and Vercel
+Analytics are already loaded on the frontend (visible in the page network logs).
+Read [CLAUDE.md](../../CLAUDE.md). The only coin is **$THREE**.
+
+## Objective
+
+The full funnel is instrumented with consistent, well-named events so you can
+measure activation, retention, conversion, and the growth loops — privacy-
+respecting, no PII leakage, with a defined event taxonomy that product decisions
+can actually run on.
+
+## Why it matters
+
+A $1B valuation is argued with numbers: activation rate, D1/D7/D30 retention,
+conversion to paid, K-factor, revenue cohorts. If the funnel isn't instrumented
+consistently, you're flying blind and can't prove traction to anyone — including
+yourselves. This is the measurement layer the growth and monetization work
+depends on.
+
+## Instructions
+
+1. **Define the event taxonomy** before adding events. A documented schema
+ (`docs/analytics-events.md`): event name (consistent `object_action` naming),
+ when it fires, properties, and which funnel/metric it feeds. No ad-hoc
+ one-off events.
+2. **Instrument the funnels:**
+ - **Acquisition:** landing view, source/referrer, ref-param capture (ties to
+ [23 — growth](23-growth-virality.md)).
+ - **Activation:** forge_started → forge_succeeded (the "aha" from
+ [21 — onboarding](21-onboarding-first-run.md)) → agent_saved → agent_shared.
+ - **Engagement/retention:** return visits, session depth, feature adoption
+ (animate, embed, brain, chat).
+ - **Monetization:** checkout_started → payment_succeeded/failed, subscription
+ events, creator earnings events (ties to
+ [24 — monetization](24-monetization-completeness.md)).
+ - **Growth loops:** share_clicked, embed_installed, embed_impression,
+ referral_signup, and a computed K-factor.
+3. **Identity & sessions.** Tie events to a stable anonymous ID pre-auth and
+ merge to the user on sign-in (PostHog supports this). Don't double-count.
+4. **Privacy & compliance.** No PII, no secrets, no wallet private data, no full
+ addresses where avoidable in event props. Respect Do-Not-Track and provide a
+ cookie/analytics consent path if the audience requires it. Mask sensitive
+ fields. Document what's collected.
+5. **Server-side events** for things the client can't be trusted for (payment
+ settled, on-chain confirmed) so revenue metrics are accurate even if the
+ client drops.
+6. **Dashboards.** Build/define the core dashboards: activation funnel, retention
+ cohorts, conversion funnel, growth-loop metrics, revenue. Keep product
+ analytics (PostHog) distinct from ops metrics
+ ([11 — observability](11-observability.md)).
+7. **Verify events fire** correctly end-to-end in PostHog (use the live events
+ view) for each funnel step — no missing, misnamed, or duplicate events.
+
+## Definition of done
+
+- [ ] `docs/analytics-events.md` defines the full event taxonomy (naming, props,
+ funnel mapping).
+- [ ] Acquisition, activation, engagement, monetization, and growth-loop events
+ are instrumented per the taxonomy and verified firing in PostHog.
+- [ ] Anonymous→identified merge works without double-counting.
+- [ ] Privacy honored: no PII/secrets in props, DNT/consent respected, collection
+ documented.
+- [ ] Revenue/settlement events are captured server-side for accuracy.
+- [ ] Core dashboards (activation, retention, conversion, growth, revenue) exist
+ or are defined and reproducible.
+- [ ] Each funnel step verified end-to-end in the live events view.
+- [ ] `npm test` passes. Changelog: skip (internal) unless a user-facing consent
+ UI shipped.
diff --git a/prompts/readiness/26-trust-surfaces.md b/prompts/readiness/26-trust-surfaces.md
new file mode 100644
index 000000000..e10ba8e18
--- /dev/null
+++ b/prompts/readiness/26-trust-surfaces.md
@@ -0,0 +1,76 @@
+# 26 — Trust surfaces: status, docs, security, pricing, legal
+
+**Phase 6. [parallel-safe]** with 22–25.
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 3D AI-agent platform with extensive docs
+(`docs/`), a changelog system, an API reference (`docs/api-reference.md`,
+`docs/api.html`), and SDKs. Read [CLAUDE.md](../../CLAUDE.md). The only coin is
+**$THREE**.
+
+## Objective
+
+The public surfaces that make a platform credible to users, developers, partners,
+and investors are present, accurate, and polished: a live status page, complete
+and correct developer docs, a clear security/trust page, transparent pricing, and
+the legal/policy pages a real company needs.
+
+## Why it matters
+
+Before anyone integrates, invests, or trusts a platform with money, they check:
+Is it up? Are the docs real? Is it secure? What does it cost? Who's behind it? A
+$1B platform answers all of these with confidence. Missing or sloppy trust
+surfaces cap enterprise and developer adoption no matter how good the product is.
+
+## Instructions
+
+1. **Status page.** A real `/status` driven by the health endpoints from
+ [11 — observability](11-observability.md): current uptime of core services
+ (API, RPC, forge pipeline, payments), recent incidents, and historical
+ uptime. Real data, not a static "all good" image. Auto-updates.
+2. **Developer docs.** Audit `docs/` and the API reference for accuracy against
+ the actual 769 endpoints + SDKs: every documented endpoint exists and matches
+ its real signature; every SDK has a working quickstart; code samples actually
+ run. Fix drift. Ensure a clear "build your first integration in 10 minutes"
+ path. Cross-check `npm run audit:pages` / `validate:cards`.
+3. **Security/trust page.** A `/security` page stating the security posture (no
+ secrets in client, audited contracts, x402 verification, responsible-
+ disclosure contact + policy), linking the public results of
+ [09 — security review](09-security-review.md) where appropriate. Add a
+ `SECURITY.md` and a disclosure email if absent.
+4. **Pricing page.** A clear, honest `/pricing`: free tier (the README's free
+ draft tier), paid tiers, x402 pay-per-call, creator economics + platform fee
+ (transparent %, consistent with [24 — monetization](24-monetization-completeness.md)).
+ No hidden costs. $THREE is the only token referenced.
+5. **Legal/policy.** Terms of Service, Privacy Policy (consistent with the data
+ collection documented in [25 — analytics](25-analytics-funnel.md)), and any
+ required crypto/risk disclosures. Real pages, reachable from the footer, not
+ dead links (ties to [05 — dead paths](05-dead-path-and-handler-audit.md)).
+6. **About/credibility.** An About surface: what three.ws is, the open-source
+ story, links to GitHub/X, and the $THREE contract address with the "always
+ verify the CA" guidance from the README. Honest, no vaporware claims.
+7. **Consistency.** All trust pages use the unified design system
+ ([20](20-design-system-consistency.md)), are responsive
+ ([19](19-responsive-mobile-sweep.md)), accessible
+ ([17](17-accessibility-audit.md)), and SEO-complete
+ ([22](22-seo-and-shareability.md)).
+8. **Verify** every link in the footer/trust nav resolves and every doc sample
+ runs.
+
+## Definition of done
+
+- [ ] Live `/status` page driven by real health data with uptime + incident
+ history.
+- [ ] Developer docs + API reference audited against real endpoints/SDKs; drift
+ fixed; a working 10-minute quickstart exists; samples run.
+- [ ] `/security` page + `SECURITY.md` + responsible-disclosure contact present.
+- [ ] Honest `/pricing` page covering free/paid/x402/creator economics; $THREE
+ only.
+- [ ] ToS, Privacy Policy, and required disclosures exist, are reachable from the
+ footer, and match actual data practices.
+- [ ] About/credibility surface with correct $THREE CA + verify guidance.
+- [ ] All trust pages are consistent, responsive, accessible, SEO-complete; every
+ footer/trust link resolves.
+- [ ] `npm test` + `npm run audit:pages` pass. Changelog: `docs`/`feature` entry
+ for new public pages.
diff --git a/prompts/readiness/27-launch-runbook.md b/prompts/readiness/27-launch-runbook.md
new file mode 100644
index 000000000..133cf7c3c
--- /dev/null
+++ b/prompts/readiness/27-launch-runbook.md
@@ -0,0 +1,80 @@
+# 27 — Go-live runbook & pre-launch checklist
+
+**Phase 7. Serial. Run last** — it gates the whole program on a single
+verifiable checklist.
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 3D AI-agent platform, deployed via Vercel,
+mirrored to two GitHub remotes (`threeD` push-only, `threews` canonical). Read
+[CLAUDE.md](../../CLAUDE.md). The only coin is **$THREE**.
+
+## Objective
+
+A single authoritative pre-launch checklist that proves the platform is
+production-ready, plus a documented, rehearsed go-live and rollback procedure.
+This task does not add features — it verifies that everything the rest of this
+program built is actually true, in production, right now.
+
+## Why it matters
+
+"Done" is a claim that has to be proven against real production, not asserted
+from the editor. The launch is the moment all the prior work either holds or
+doesn't. A rehearsed runbook with a one-step rollback is the difference between a
+confident launch and a 3am scramble that costs trust you can't rebuild.
+
+## Instructions
+
+1. **Roll up the program.** Re-run the audit from
+ [01 — scorecard](01-production-audit-scorecard.md) and confirm each prior
+ prompt's Definition of Done is actually met. Produce a final
+ `docs/audits/launch-readiness-YYYY-MM-DD.md` with a green/red status per
+ prompt (02–26). Any red blocks launch.
+2. **Production smoke, for real.** Against the production (or a production-mirror)
+ deploy, verify the core journeys with real data: forge a model, create an
+ agent, SIWE login, x402 checkout (a real small payment), a pump launch path on
+ the appropriate environment, marketplace + trending load. Use the existing
+ smoke scripts (`smoke:onchain`, `smoke:mcp`, `smoke:agent-wallet`,
+ `pump:smoke`) and record results.
+3. **The gate checklist** (every item must be verifiably true):
+ - Zero TODO/stub/mock/dead-path regressions (re-run the Phase-1 greps).
+ - All money/chain endpoints: authz + validation + rate-limit + idempotent.
+ - Secrets clean; env validated at boot; nothing sensitive client-side.
+ - Resilience + observability live; alerts verified to fire; `/status` green.
+ - CWV "good" on top surfaces; 3D smooth on mobile.
+ - CI gates green; coverage threshold met; E2E passing.
+ - A11y AA on top surfaces; responsive at all breakpoints; every state designed.
+ - SEO/OG/sitemap correct; trust pages live; $THREE-only verified by the guard
+ test.
+ - Backups/DB migrations applied and reversible (`npm run db:status`).
+4. **Capacity & limits.** Confirm rate limits, RPC quotas, function concurrency,
+ and DB connection limits are sized for an expected launch spike, and that
+ degradation (from [10](10-resilience-external-calls.md)) is graceful under
+ load. A light load test on the hottest read path is ideal.
+5. **Deploy & rollback procedure.** Document the exact deploy steps
+ (`build:all` → `check:dist` → `audit:deploy` → deploy, pushing to BOTH
+ remotes) and a one-command rollback to the previous good deploy. Note the
+ CLAUDE.md trap: `npx vercel build` can overwrite `api/*.js` with bundles —
+ include the guard/recover step. Rehearse the rollback once.
+6. **Comms plan.** Prepare the launch changelog entries
+ (`data/changelog.json` → `npm run build:pages` → `npm run changelog:push`),
+ the Telegram/X announcements ($THREE-compliant copy), and a clear owner for
+ each during launch.
+7. **Go/no-go.** The launch-readiness doc ends with an explicit GO or NO-GO and,
+ if NO-GO, the specific blocking items.
+
+## Definition of done
+
+- [ ] `docs/audits/launch-readiness-<today>.md` with green/red per prompt 02–26
+ and an explicit GO/NO-GO.
+- [ ] Production (or mirror) smoke of every core journey passed with real data,
+ including a real small x402 payment; smoke-script output recorded.
+- [ ] The full gate checklist is verifiably true (each item evidenced, not
+ asserted).
+- [ ] Capacity sized for a launch spike; graceful degradation confirmed under a
+ light load test.
+- [ ] Deploy + one-command rollback documented AND rollback rehearsed once.
+- [ ] Launch comms (changelog + announcements) prepared, $THREE-compliant, with
+ owners.
+- [ ] Pushed to BOTH remotes per CLAUDE.md when shipping.
+- [ ] Changelog: prepare the launch entries (don't double-post).
diff --git a/prompts/readiness/28-incident-response-oncall.md b/prompts/readiness/28-incident-response-oncall.md
new file mode 100644
index 000000000..0e49cc624
--- /dev/null
+++ b/prompts/readiness/28-incident-response-oncall.md
@@ -0,0 +1,83 @@
+# 28 — Incident response & on-call
+
+**Phase 7. Serial.** Pairs with [27 — launch runbook](27-launch-runbook.md);
+this is what you reach for when launch (or any day after) goes sideways.
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 3D AI-agent platform handling real money
+(Solana, x402 USDC, pump.fun, $THREE). Observability + alerting were built in
+[11](11-observability.md), resilience in [10](10-resilience-external-calls.md).
+Read [CLAUDE.md](../../CLAUDE.md). The only coin is **$THREE**.
+
+## Objective
+
+A real incident-response capability: documented severity levels, runbooks for the
+most likely failures, clear ownership and escalation, a rollback that works, and
+a blameless post-mortem process. When something breaks at scale, the team
+responds in minutes with a known procedure — not improvisation.
+
+## Why it matters
+
+At a billion-dollar scale, the question is not *if* something breaks but *how
+fast you recover* and *whether users lose money or trust*. A money platform with
+no incident plan is one bad night from a reputation it can't recover. Operational
+maturity is part of what makes the valuation defensible.
+
+## Instructions
+
+1. **Severity model.** Define SEV1–SEV4 with concrete examples for this platform:
+ - SEV1: payments failing / funds at risk / total outage / suspected key
+ compromise.
+ - SEV2: a core journey down (forge, login, marketplace) for many users.
+ - SEV3: degraded/slow, single feature broken, elevated error rate.
+ - SEV4: cosmetic / low-impact.
+ Each severity gets a response-time target and an escalation path.
+2. **Runbooks for the likely failures** (in `docs/runbooks/`):
+ - Solana RPC outage / throttling → failover behavior, manual endpoint swap.
+ - pump.fun feed down → degraded mode, what users see.
+ - LLM proxy (OpenAI/Anthropic) failure → fallback/queue.
+ - x402 facilitator / payment failure → how to stop charges, reconcile, refund.
+ - Database / KV outage → read-only mode, cache-serve.
+ - Suspected secret/key compromise → immediate rotation steps (ties to
+ [07](07-secrets-and-env-hardening.md)), revoke, audit.
+ - Bad deploy → the one-command rollback from
+ [27 — launch runbook](27-launch-runbook.md).
+ Each runbook: detection signal → immediate mitigation → root-cause steps →
+ verification → comms.
+3. **Detection → response wiring.** Confirm the alerts from
+ [11 — observability](11-observability.md) map to these runbooks: an alert
+ names the likely runbook. No alert without an action.
+4. **Ownership & escalation.** Document who's on call, how they're paged, and the
+ escalation chain. Even a small team needs a defined first responder and
+ backup. Status-page updates ([26 — trust surfaces](26-trust-surfaces.md)) are
+ part of SEV1/SEV2 response.
+5. **User-facing comms templates.** Pre-written, honest templates for status-page
+ updates and announcements during an incident — $THREE-compliant, no
+ speculation, clear on user impact and ETA.
+6. **Money-incident specifics.** A precise procedure for payment incidents: how
+ to halt the affected flow, identify impacted transactions (from the receipts/
+ ledger in [24](24-monetization-completeness.md)), reconcile, and make users
+ whole. Funds-at-risk is always SEV1.
+7. **Post-mortem process.** A blameless template (timeline, impact, root cause,
+ what worked, action items with owners) and the rule that every SEV1/SEV2 gets
+ one. Action items feed back into the backlog.
+8. **Rehearse.** Run one tabletop/game-day for a SEV1 (e.g. "RPC is down and
+ payments are failing") and confirm the runbook actually leads to recovery.
+ Note gaps and fix them.
+
+## Definition of done
+
+- [ ] SEV1–SEV4 model with examples, response-time targets, and escalation paths
+ documented.
+- [ ] Runbooks in `docs/runbooks/` for RPC, pump feed, LLM proxy, x402/payments,
+ DB/KV, key compromise, and bad-deploy rollback — each with
+ detection→mitigation→root-cause→verify→comms.
+- [ ] Every alert maps to a runbook (no alert without an action).
+- [ ] On-call ownership + escalation + status-page update process documented.
+- [ ] Honest, $THREE-compliant incident comms templates ready.
+- [ ] A precise money-incident procedure (halt → identify → reconcile → make
+ whole).
+- [ ] Blameless post-mortem template + the SEV1/SEV2-always rule.
+- [ ] One SEV1 tabletop rehearsed; gaps found are fixed.
+- [ ] Changelog: skip (internal ops).
diff --git a/prompts/road/14-responsive-and-mobile.md b/prompts/road/14-responsive-and-mobile.md
new file mode 100644
index 000000000..391a78243
--- /dev/null
+++ b/prompts/road/14-responsive-and-mobile.md
@@ -0,0 +1,53 @@
+# 14 — Responsive & mobile
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 3 — Experience quality
+**Owns:** `pages/`, `src/` CSS/layout, viewport meta, 3D canvas sizing, `solana-mobile/` touchpoints.
+**Depends on:** none · **Parallel-safe with:** `12`, `13`, `15`, `16`, `17`
+
+## Why this matters for $1B
+Most crypto and consumer traffic is mobile. A janky phone experience caps growth hard —
+the wallet connect, the launch, and the trade all happen on a 360px screen. `/CLAUDE.md`
+mandates 320 / 768 / 1440 and proper touch targets; this prompt makes that real.
+
+## Mission
+Make every surface fully usable and polished at 320px, 768px, and 1440px, with proper
+touch targets and acceptable mobile 3D performance.
+
+## Map
+- Top surfaces: `pages/index.html`, `pages/forge.html`, `pages/marketplace.html`,
+ `pages/trending.html`, `pages/agent-detail.html`, `pages/agent-trade.html`,
+ `pages/agent-wallet.html`, and the editors `pages/forge.html` / `pages/avatar-studio.html`
+ / `pages/animations.html` (Animation Studio).
+- Layout/CSS + 3D canvas sizing live under `src/`; mobile-specific surfaces under
+ `solana-mobile/` (PWA/TWA wrappers, `solana-mobile/pwa/`, `solana-mobile/twa/`).
+- Wallet / x402 flows: `pages/agent-wallet.html`, `api/x402/` (exercise on mobile).
+- Existing gate: `npm run audit:web` (`scripts/page-audit.mjs`).
+
+## Do this
+1. Walk the top surfaces at 320 / 768 / 1440 (and a real device or DevTools emulation);
+ log every overflow, fixed width, cut-off modal, and broken nav/menu.
+2. Fix horizontal scroll and fixed widths (relative units, flex/grid, `max-width:100%`,
+ `min-width:0` on flex children); enlarge touch targets to >= 44px.
+3. Make the 3D viewer and editors (Forge, Avatar/Animation Studio) usable on touch —
+ orbit/zoom/IK via touch gestures — or degrade gracefully where touch can't drive a
+ control. Size the canvas to the viewport without overflow.
+4. Handle the on-screen keyboard and safe-area insets for forms and chat
+ (`env(safe-area-inset-*)`, `viewport-fit=cover`); inputs must not be obscured.
+5. Reflow data-dense lists/tables (trading, marketplace) into stacked/scrollable cards
+ on narrow screens — no clipped columns.
+6. Exercise the wallet connect and x402 payment flows on mobile, including the
+ `solana-mobile/` PWA/TWA path; fix any tap/redirect breakage.
+
+## Must-not
+- Do not hide core features on mobile to "fix" a layout — reflow them instead.
+- Do not ship horizontal scroll on any top surface.
+- Do not shrink touch targets below 44px to fit a dense layout.
+
+## Acceptance
+- [ ] No layout breakage or horizontal scroll at 320 / 768 / 1440 on the top surfaces.
+- [ ] Touch targets >= 44px; safe-area insets and on-screen keyboard handled.
+- [ ] 3D viewer/editors usable on touch or gracefully degraded; canvas never overflows.
+- [ ] Wallet + x402 flows verified on mobile (incl. `solana-mobile/`).
+- [ ] `npm test` green; `npm run lint` clean; changelog `improvement` entry.
diff --git a/prompts/samples/00-README.md b/prompts/samples/00-README.md
new file mode 100644
index 000000000..61e535f9a
--- /dev/null
+++ b/prompts/samples/00-README.md
@@ -0,0 +1,145 @@
+# three.ws — Production → $1B Program
+
+> **Read this file in full before running any prompt in this folder.** Every prompt
+> here (`01-*` … `44-*`) assumes the context below — do not re-derive it. Each prompt
+> is a single, self-contained task meant to be pasted into its own fresh agent chat.
+
+## What this is
+
+A sequenced program to take **three.ws** from "feature-rich but uneven" to
+**production-grade and ready to scale to a $1B platform**. Each numbered file is one
+self-contained task. Run them roughly in phase order — later phases assume earlier
+ones are done — but any single prompt can be run independently.
+
+This program is about **finishing, hardening, polishing, and growing what already
+exists** so the platform is correct, reliable, fast, accessible, secure, observable,
+and conversion-optimized. Net-new feature invention lives in the sibling folders
+(`feature-innovation/`, `moonshots/`, `inventions/`).
+
+## The bar (non-negotiable — applies to every prompt)
+
+Every prompt inherits the operating rules in **`/CLAUDE.md`**. Re-read it. The rules
+that matter most here:
+
+- **No mocks, no fake data, no placeholders, no TODOs, no stubs.** If you touch it,
+ finish it. Real APIs, real endpoints, real data.
+- **No "good enough."** Fix mediocrity the moment you see it.
+- **No errors without solutions.** Every error has a root cause; find it and fix it.
+ Ship working fallbacks and failsafes, never lazy propagation. Never leak a vendor's
+ internal state (e.g. a provider's billing page) to an end user.
+- **Every state is designed** — loading, empty, error, populated, overflow.
+- **The only coin is `$THREE`** (CA `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`).
+ Never reference any other coin anywhere. See `/CLAUDE.md` for the two
+ runtime-data-only mechanical exceptions.
+- **Adopt vetted OSS over hand-rolling**; add hardening to new/unprotected paths
+ rather than refactoring working code. Prefer the existing **cockatiel** resilience
+ helper for retries/circuit-breakers.
+- **Definition of done**: the checklist in `/CLAUDE.md` must be true. If you can't
+ verify a step, say so explicitly — never claim done you can't verify.
+
+## How to run a prompt
+
+1. Open a fresh chat in this repo.
+2. Paste the prompt file contents, or reference it: "Execute
+ `prompts/production-1b/NN-*.md`".
+3. Let the agent work end-to-end. It should use `TodoWrite` for multi-step work,
+ exercise UI in a real browser (`npm run dev`, port 3000), and run the relevant tests.
+4. Spot-check against the prompt's **Acceptance** section.
+5. Commit + push only when the user asks (the agent pushes to **both** remotes,
+ `threeD` and `threews`, per `/CLAUDE.md`).
+
+## Repository orientation (so every prompt starts from truth)
+
+- **`STRUCTURE.md`** maps every product surface to its directory. Read it before
+ exploring the ~60 top-level dirs.
+- Frontend: vanilla JS modules + Vite (`npm run dev`, port 3000). `pages/*.html`
+ (~168 pages), `src/` (~810 modules), `public/`.
+- Backend: Vercel functions in `api/` (~960 handlers), Cloudflare workers in
+ `workers/` (18). Routing, functions, crons, headers, env all in `vercel.json`.
+- 3D: Three.js + glTF/GLB. Avatar/animation pipeline under `public/animations/`,
+ `src/glb-canonicalize.js`, `src/animation-retarget.js`. Model workers in
+ `workers/model-*`. The avatar rule in `/CLAUDE.md` is law (no rig allowlist).
+- Tests: `npm test` = `vitest run && playwright test` (456 vitest files). `npm run
+ lint` (eslint), `npm run typecheck` (tsc on jsconfig). CI is `.github/workflows/ci.yml`
+ with jobs: **lint**, **test**, **guards** (`check-api-not-bundled`, `check:images`,
+ `build:pages`), **typecheck** (advisory).
+- Changelog: every user-visible change gets an entry in `data/changelog.json`, then
+ `npm run build:pages` regenerates `CHANGELOG.md` + `public/changelog.{json,xml}`.
+- **Lean on the existing audit tooling — do not reinvent it:** `audit:deploy`,
+ `audit:pages`, `audit:handlers`, `audit:web`, `audit:mcp`, `check:images`,
+ `seo:meta`, `verify`, `verify:solana`, `verify:onchain`, `smoke:onchain`,
+ `smoke:mcp`, `snapshot`. (See `package.json` scripts.)
+- Resilience helpers and payments plumbing already exist in `api/_lib/` (x402-spec,
+ x402-paid-endpoint, agent-wallet, secret-box, rate-limit, forge-health). Build on them.
+
+## Known traps (from `/CLAUDE.md`)
+
+- **Concurrent agents share this worktree.** Stage explicit paths only (never
+ `git add -A`). Re-check `git status` before committing.
+- **`npx vercel build` overwrites `api/*.js` in place** with esbuild bundles. Check
+ `head -1` for `__defProp`/`createRequire` before committing a large `api/` diff.
+- **Never pull/fetch/merge from the `threeD` remote** — it is push-only.
+
+## Phases & index
+
+**Phase 0 — Foundation (stop the platform from lying about "done")**
+- `01` Test suite green + CI gate
+- `02` Dead paths & broken links — every button works, every link resolves
+- `03` Zero console errors & warnings across all pages
+- `04` No-mocks / no-fake-data / no-TODO / no-stub sweep
+- `05` Secrets & env hygiene
+
+**Phase 1 — Cross-cutting production hardening**
+- `06` Error handling & resilience (`api/` + `workers/`)
+- `07` Security hardening (authz, input validation, headers, SSRF)
+- `08` Rate limiting & abuse prevention
+- `09` Accessibility (WCAG 2.2 AA)
+- `10` Performance & Core Web Vitals
+- `11` Mobile responsiveness (320 / 768 / 1440)
+- `12` Every state designed (loading / empty / error / overflow)
+- `13` Design-system consistency (tokens, spacing, typography, theming)
+- `14` SEO & structured data
+
+**Phase 2 — Product surface completeness (each end-to-end)**
+- `15` Forge / Text→3D / Avatar generation pipeline
+- `16` Marketplace
+- `17` Agent profiles, Agent Studio & economy
+- `18` Wallet & x402 payments
+- `19` Walk companion, Page-Agent & Feature Tour
+- `20` Scene Studio & Animation Studio
+- `21` Avatar creator / Character Studio / Selfie→avatar
+- `22` Pump.fun launch, Oracle, trading & $THREE surfaces
+- `23` MCP servers (production-ready)
+- `24` SDK publishing & docs
+- `25` Worlds & Coin Clash (token-gated 3D)
+
+**Phase 3 — Scale, infra, observability**
+- `26` Observability (logging, metrics, error tracking)
+- `27` Database integrity & migrations
+- `28` Deploy pipeline & rollback safety
+- `29` Uptime monitoring & public status page
+- `30` Load & stress testing
+- `31` Solana RPC & on-chain resilience
+- `32` Caching, CDN & R2 asset strategy
+
+**Phase 4 — Growth to $1B**
+- `33` Onboarding & activation funnel
+- `34` Home / landing conversion
+- `35` Pricing & monetization surfaces
+- `36` Growth analytics instrumentation
+- `37` Developer experience & docs site
+- `38` Referral & virality loops
+- `39` Trust, safety & moderation
+- `40` Legal, compliance, ToS & privacy
+- `41` i18n completion
+- `42` PWA & offline & notifications
+- `43` Brand, press & social proof
+- `44` Launch-readiness review (the final gate)
+
+## Prompt anatomy
+
+Each file has: **Why this matters for $1B**, **Mission**, **Map** (where things
+live — trust but verify; files move), **Do this** (ordered steps), **Must-not**
+(guardrails), and **Acceptance** (a checklist that must be all-true before claiming
+done). If a path is stale, find the real one and proceed — never stop because a path
+was wrong.
diff --git a/prompts/samples/01-test-suite-green-and-ci-gate.md b/prompts/samples/01-test-suite-green-and-ci-gate.md
new file mode 100644
index 000000000..448e2c254
--- /dev/null
+++ b/prompts/samples/01-test-suite-green-and-ci-gate.md
@@ -0,0 +1,92 @@
+# 01 — Test suite green + CI gate
+
+> Part of the three.ws "Production → $1B" program. Run in a fresh chat. Read
+> `/CLAUDE.md` first (its rules override everything) and `prompts/production-1b/00-README.md`
+> for shared context.
+
+## Why this matters for $1B
+
+CI is the only thing standing between a green checkmark and a money-path
+regression reaching production. Right now the suite is large (458 vitest files +
+a Playwright e2e set) but the gate is soft: lint allows the warning backlog and
+typecheck is advisory (`continue-on-error: true`). A platform that ships real
+USDC payments cannot tolerate "passing" CI that lets type errors and lint
+warnings through. Make the suite genuinely green and reliable, then ratchet the
+gate so "green" actually means "safe to merge."
+
+## Mission
+
+Get `npm test` (`vitest run && playwright test`) fully green and non-flaky, then
+deliver a concrete, staged plan (and the first ratchet step) to flip the advisory
+typecheck job to a hard gate and tighten eslint to `--max-warnings 0`.
+
+## Map (trust but verify — files move)
+
+- **CI definition** — [.github/workflows/ci.yml](../../.github/workflows/ci.yml).
+ Jobs: `lint` (`npx eslint .`), `test` (`npx vitest run`), `guards`
+ (`check-api-not-bundled` + `check:images` + `build:pages`), `typecheck`
+ (advisory, `continue-on-error: true`).
+- **Vitest config** — [vitest.config.js](../../vitest.config.js). Note the
+ 120s test/hook timeouts and `MAX_FORKS` cap for small CI/Codespace hosts.
+- **Playwright config** — [playwright.config.js](../../playwright.config.js).
+ `testDir: tests/e2e`, `retries: 1`, `fullyParallel: false`, dev-server cold
+ budget 180s. Specs in [tests/e2e/](../../tests/e2e).
+- **Scripts** — [package.json](../../package.json): `test`, `test:core`
+ (`--maxWorkers=1`), `test:gate` ([scripts/test-gate.mjs](../../scripts/test-gate.mjs),
+ the curated deploy-critical subset), `lint`, `lint:fix`, `typecheck`
+ (`tsc -p jsconfig.json`).
+- **Typecheck scope** — [jsconfig.json](../../jsconfig.json): `checkJs: false`,
+ opt-in via `// @ts-check` pragma; `include` is the ratchet allowlist.
+- **Lint config** — [eslint.config.js](../../eslint.config.js).
+- **Source guards** — [scripts/check-api-not-bundled.mjs](../../scripts/check-api-not-bundled.mjs),
+ [scripts/audit-image-loading.mjs](../../scripts/audit-image-loading.mjs) (`check:images`).
+
+## Do this
+
+1. Run `npx vitest run` and capture every failure. Fix each at the root — never
+ `.skip` a real test to go green. If a test depends on live credentials that
+ are absent locally, confirm it is already guarded; if not, gate it cleanly on
+ env presence rather than deleting it.
+2. Re-run failing files in isolation (`npx vitest run path/to/file.test.js`) and
+ 3x in a row to separate true failures from flakes. For flakes, find the cause
+ (shared global state, real timers, unmocked I/O, fork contention) and fix it —
+ do not just bump a timeout. `vitest.config.js` already sets generous ceilings.
+3. Start the dev server (`npm run dev`, port 3000) and run `npx playwright test`.
+ Fix e2e failures at the source. Honor `fullyParallel: false` and the cold-start
+ budget; do not lower assertions to pass.
+4. Confirm the guards job is green: `node scripts/check-api-not-bundled.mjs`,
+ `npm run check:images`, `npm run build:pages`.
+5. Run `npm run lint` and count warnings. Burn the backlog down with `npm run
+ lint:fix` for auto-fixables, then hand-fix the rest — no blanket
+ `eslint-disable` of whole files. Track the count before and after.
+6. Run `npm run typecheck`. Catalog the errors by file. Fix the cheap ones now
+ and add `// @ts-check` + the file to `jsconfig.json` `include` as you bring each
+ clean (the ratchet rule the jsconfig comment describes).
+7. Write the staged ratchet plan into this task's report: (a) flip eslint to
+ `--max-warnings 0` in `ci.yml` once the count hits 0; (b) flip typecheck's
+ `continue-on-error` to `false` once `npm run typecheck` is clean. Land whichever
+ ratchet is already achievable (likely eslint) in `ci.yml` now.
+8. Re-run the full `npm test` once more end-to-end to confirm a clean, repeatable
+ green before claiming done.
+
+## Must-not
+
+- Do not skip, delete, or weaken a test to make CI green — fix the code or the test.
+- Do not flip typecheck/eslint to a hard gate while errors/warnings remain; that
+ breaks every other agent's PR. Ratchet only when the count is actually zero.
+- Do not commit a `vercel build`-bundled `api/*.js` (check `head -1` for `__defProp`).
+- Do not reference any coin other than `$THREE` in any test or fixture.
+- Do not mask flakiness with retries or longer timeouts in place of a real fix.
+
+## Acceptance (all true before claiming done)
+
+- [ ] `npx vitest run` passes locally with zero failures, repeatable across 3 runs.
+- [ ] `npx playwright test` passes against `npm run dev` with no skipped real specs.
+- [ ] `guards` job commands all pass (`check-api-not-bundled`, `check:images`, `build:pages`).
+- [ ] Current eslint warning count is recorded and reduced (target 0); any
+ achievable ratchet (`--max-warnings 0`) is landed in `ci.yml`.
+- [ ] A concrete, staged plan to flip the typecheck gate is documented, with the
+ first ratchet step applied or explicitly blocked-and-explained.
+- [ ] No coin other than `$THREE` introduced; no new mocks/stubs/TODOs.
+- [ ] If a step could not be verified locally (e.g. live-cred e2e), it is called
+ out explicitly rather than claimed.
diff --git a/prompts/samples/02-dead-paths-and-broken-links.md b/prompts/samples/02-dead-paths-and-broken-links.md
new file mode 100644
index 000000000..db172a3dd
--- /dev/null
+++ b/prompts/samples/02-dead-paths-and-broken-links.md
@@ -0,0 +1,90 @@
+# 02 — Dead paths & broken links
+
+> Part of the three.ws "Production → $1B" program. Run in a fresh chat. Read
+> `/CLAUDE.md` first (its rules override everything) and `prompts/production-1b/00-README.md`
+> for shared context.
+
+## Why this matters for $1B
+
+Nothing kills trust faster than a button that does nothing or a link that 404s.
+With ~125 pages, ~810 src modules, and ~961 api handlers, dead-ends accumulate
+silently — a nav entry to a page that no longer exists, an `<a href="#">` that
+was never wired, a CTA whose handler was deleted. Every dead path is a leak in
+the conversion funnel and a screenshot of brokenness. `/CLAUDE.md` is explicit:
+"If a button exists, it must work. If a link exists, it must go somewhere."
+
+## Mission
+
+Audit every interactive element and route so that every button does something,
+every `<a href>`/route resolves to a live destination, and every nav entry goes
+somewhere real — then fix or remove every dead-end found.
+
+## Map (trust but verify — files move)
+
+- **Full-site audit harness** — [scripts/page-audit.mjs](../../scripts/page-audit.mjs)
+ (`npm run audit:web`). Drives real Chromium over every page in desktop + mobile,
+ records failed network requests, HTTP >= 400, missing `<title>`, and **empty
+ links/buttons**. Writes `reports/page-audit-<ts>.{json,md}`.
+- **Route-documentation guard** — [scripts/audit-page-index.mjs](../../scripts/audit-page-index.mjs)
+ (`npm run audit:pages`). Cross-checks `vercel.json` routes against
+ [data/pages.json](../../data/pages.json); flags pages with no manifest entry.
+- **Empty-handler guard** — [scripts/audit-empty-handlers.mjs](../../scripts/audit-empty-handlers.mjs)
+ (`npm run audit:handlers`). Fails on any `api/*.js` that is empty or exports
+ nothing (Vercel routes to it but it can never respond).
+- **Routing & headers** — [vercel.json](../../vercel.json) (rewrites/routes for
+ pretty paths and dynamic routes).
+- **Navigation source of truth** — [public/nav-data.js](../../public/nav-data.js)
+ (`NAV_GROUPS`, every menu item's `href`), rendered by
+ [public/nav.js](../../public/nav.js), styled by [public/nav.css](../../public/nav.css).
+- **Surfaces to crawl** — [pages/](../../pages) (~125 `*.html`), [src/](../../src)
+ (~810 modules), [public/](../../public).
+
+## Do this
+
+1. Start `npm run dev` (port 3000) and run `BASE_URL=http://localhost:3000 npm run
+ audit:web`. Open the generated `reports/page-audit-*.md` and triage every
+ empty-link/empty-button finding and every HTTP >= 400 / requestfailed entry.
+2. Run `npm run audit:pages --strict` and `npm run audit:handlers`. Fix every gap:
+ a flagged empty handler is either implemented (real response) or deleted with
+ its route; a route missing from `data/pages.json` gets a manifest entry.
+3. Walk every `href` in [public/nav-data.js](../../public/nav-data.js) `NAV_GROUPS`
+ and the top-level links. For each, confirm the destination resolves to a live
+ page (in the browser, not just file existence). Fix or remove dead entries —
+ nav is the single source of truth, so a broken entry breaks it everywhere.
+4. Grep the codebase for placeholder links and no-op handlers and resolve each:
+ `href="#"`, `href="javascript:void(0)"`, `onclick=""`, `<a>` with no href,
+ `<button>` with no listener. Wire the real action or remove the element.
+5. Cross-check dynamic routes (agent profiles, dashboards, `/launches`, marketplace
+ detail pages) — click through from a list view into a detail view and back.
+ The "list links to detail" connection in `/CLAUDE.md` must hold.
+6. For any page that legitimately can't resolve yet (e.g. a feature behind auth or
+ a not-yet-built surface), make the entry point honest: gate it, label it, or
+ remove it — never leave a live link to a dead place.
+7. Exercise the primary CTAs in a real browser (Forge "Generate", marketplace
+ "Buy", wallet "Connect", launch flow): every one performs a real action, not a
+ silent failure. Watch the Network tab to confirm real calls fire.
+8. Re-run `npm run audit:web`, `npm run audit:pages --strict`, and `npm run
+ audit:handlers`; confirm the dead-path findings are cleared. Add a
+ `data/changelog.json` entry for any user-visible fix, then `npm run build:pages`.
+
+## Must-not
+
+- Do not "fix" a broken link by pointing it at the homepage — route it to the
+ correct destination or remove the element.
+- Do not delete a working feature to silence an audit finding; understand first.
+- Do not introduce mocks, stubs, TODOs, or `href="#"` placeholders.
+- Do not reference any coin other than `$THREE` in nav, copy, or links.
+- Do not edit working code paths you didn't need to touch — additive fixes only.
+
+## Acceptance (all true before claiming done)
+
+- [ ] `npm run audit:web` reports zero empty-link / empty-button findings and no
+ unexplained HTTP >= 400 across the crawled pages.
+- [ ] `npm run audit:pages --strict` and `npm run audit:handlers` both exit clean.
+- [ ] Every `href` in `public/nav-data.js` resolves to a live page in the browser.
+- [ ] No `href="#"`, `javascript:void(0)`, or no-op handler remains on a shipped
+ interactive element.
+- [ ] Primary CTAs (Forge, marketplace, wallet, launch) perform real actions with
+ real network calls, verified in a real browser.
+- [ ] Existing tests still pass (`npm test`); changelog updated for visible fixes
+ and `npm run build:pages` is clean.
diff --git a/prompts/samples/03-zero-console-errors.md b/prompts/samples/03-zero-console-errors.md
new file mode 100644
index 000000000..42757410d
--- /dev/null
+++ b/prompts/samples/03-zero-console-errors.md
@@ -0,0 +1,85 @@
+# 03 — Zero console errors & warnings
+
+> Part of the three.ws "Production → $1B" program. Run in a fresh chat. Read
+> `/CLAUDE.md` first (its rules override everything) and `prompts/production-1b/00-README.md`
+> for shared context.
+
+## Why this matters for $1B
+
+A console full of red is a tell that the team doesn't sweat the details — and
+the warnings are often real bugs wearing a yellow coat (a 404'd asset, a failed
+fetch with a swallowed error, a React/Three.js misuse that leaks memory). Across
+~125 pages, every console error is a paper cut on the perceived quality of the
+platform and a hint to a savvy user that something is broken under the hood.
+`/CLAUDE.md`'s definition of done requires "No console errors. No console
+warnings from your code."
+
+## Mission
+
+Load every page, capture all console errors and warnings (plus uncaught
+exceptions and failed requests), and fix each at the source — no suppression,
+no `console.warn` muting, no try/catch that just swallows.
+
+## Map (trust but verify — files move)
+
+- **Full-site console audit** — [scripts/page-audit.mjs](../../scripts/page-audit.mjs)
+ (`npm run audit:web`). Drives real Chromium over every page (desktop + mobile)
+ and records `console.error`/`console.warn`, `pageerror` (uncaught exceptions),
+ `requestfailed`, and HTTP >= 400. Output: `reports/page-audit-<ts>.{json,md}`.
+ Targets via `BASE_URL` (default `https://three.ws`; use `http://localhost:3000`).
+- **Visual snapshot harness** — [scripts/page-snapshot.mjs](../../scripts/page-snapshot.mjs)
+ (`npm run snapshot`). Full-page Chromium screenshots of every page — useful to
+ confirm a console fix didn't break the render.
+- **Page manifest (the page list both harnesses crawl)** — [data/pages.json](../../data/pages.json).
+- **e2e specs** — [tests/e2e/](../../tests/e2e) (Playwright). Existing specs like
+ `club.spec.js`, `nav-auth.spec.js` already assert no page errors on key flows.
+- **Surfaces** — [pages/](../../pages) (~125 `*.html`), [src/](../../src) (~810
+ modules), [public/](../../public). Shared boot/nav: [public/nav.js](../../public/nav.js).
+
+## Do this
+
+1. Start `npm run dev` (port 3000) and run `BASE_URL=http://localhost:3000 npm run
+ audit:web`. Read `reports/page-audit-*.md` and build a per-page list of every
+ console error, warning, uncaught exception, and failed request.
+2. Triage by root cause, not by page. The same offender (a missing favicon, a bad
+ import, a deprecated Three.js API, an unguarded `null` access) usually fires on
+ many pages — fix it once at the source.
+3. For each finding, fix the cause: 404'd asset → correct the path or ship the
+ asset; failed fetch → handle the error at the boundary with a designed error
+ state (per `/CLAUDE.md`), never an empty catch; deprecation warning → migrate to
+ the current API; `null`/`undefined` access → guard the real data flow.
+4. Never silence. Do not delete `console.warn` calls, wrap noise in
+ `try{}catch{}`, or filter the audit's output to hide a finding. The bar is no
+ warnings *from our code*; legitimate third-party noise must be understood and
+ documented, not blanket-suppressed.
+5. Pay special attention to the heavy 3D pages (Forge, Scene Studio, Club, Walk):
+ WebGL context warnings, texture/format issues, and animation-retarget warnings
+ are real signals. Cross-check against the avatar rule in `/CLAUDE.md`.
+6. Re-run `npm run audit:web` after each batch of fixes and confirm the count
+ drops toward zero. Spot-check fixed pages live with the browser console open.
+7. Run `npm run snapshot` on the pages you changed and eyeball the screenshots to
+ confirm no fix introduced a visual regression.
+8. Run the e2e specs that assert clean console (`npx playwright test`) and the unit
+ suite (`npx vitest run`). Add a `data/changelog.json` entry if any fix is
+ user-visible (e.g. a previously-broken feature now works), then `npm run build:pages`.
+
+## Must-not
+
+- Do not suppress, filter, or delete console output to make the count drop — fix
+ the cause.
+- Do not wrap errors in empty `try/catch` or swallow rejected promises.
+- Do not introduce mocks, stubs, fake data, or TODOs while fixing.
+- Do not reference any coin other than `$THREE` in any copy or asset you touch.
+- Do not refactor working modules beyond what the fix requires — additive, surgical.
+
+## Acceptance (all true before claiming done)
+
+- [ ] `npm run audit:web` reports zero `console.error`, zero `console.warn` from
+ our code, zero `pageerror`, and no unexplained failed requests across pages.
+- [ ] Every fix addresses a root cause; no suppression, output filtering, or empty
+ catch was used to hide a finding.
+- [ ] Heavy 3D pages (Forge, Scene Studio, Club, Walk) load clean in a real browser
+ with the console open.
+- [ ] `npm run snapshot` of changed pages shows no visual regression.
+- [ ] `npx vitest run` and `npx playwright test` pass.
+- [ ] Changelog updated for any user-visible fix and `npm run build:pages` is clean.
diff --git a/prompts/samples/04-no-mocks-no-stubs-sweep.md b/prompts/samples/04-no-mocks-no-stubs-sweep.md
new file mode 100644
index 000000000..df0a34baa
--- /dev/null
+++ b/prompts/samples/04-no-mocks-no-stubs-sweep.md
@@ -0,0 +1,95 @@
+# 04 — No-mocks / no-fake-data / no-TODO / no-stub sweep
+
+> Part of the three.ws "Production → $1B" program. Run in a fresh chat. Read
+> `/CLAUDE.md` first (its rules override everything) and `prompts/production-1b/00-README.md`
+> for shared context.
+
+## Why this matters for $1B
+
+`/CLAUDE.md`'s hard rules are absolute: no mocks, no fake data, no placeholders,
+no TODOs, no stub functions, no `setTimeout` fake-loading, no fallback sample
+arrays shipped to production. Every one of these is a promise the product can't
+keep — a "feature" that secretly renders canned data, a progress bar that fakes
+work, a handler that quietly does nothing. A $1B platform cannot ship a single
+one. This sweep finds and eliminates them across the real source tree.
+
+## Mission
+
+Quantify every shortcut marker in shipped source, then fix or delete each one so
+the codebase contains no TODO/FIXME, no `not implemented`, no production
+mock/fake/sample arrays, and no fake `setTimeout` loading — per `/CLAUDE.md`.
+
+## Map (trust but verify — files move)
+
+- **Shipped source to sweep** — [api/](../../api) (~961 handlers), [src/](../../src)
+ (~810 modules), [public/](../../public), [workers/](../../workers) (18). Exclude
+ test files (`*.test.js`, `*.spec.js`), `node_modules`, and vendored dirs.
+- **Hard rules reference** — [/CLAUDE.md](../../CLAUDE.md) "Hard rules
+ (non-negotiable)" §1–6 and "The only coin — $THREE".
+- **Empty-handler guard (catches stub handlers)** — [scripts/audit-empty-handlers.mjs](../../scripts/audit-empty-handlers.mjs)
+ (`npm run audit:handlers`): fails on any `api/*.js` that exports nothing.
+- **Resilience helpers to use instead of fakes** — [api/_lib/](../../api/_lib)
+ (`forge-health.js`, `x402-spec.js`, `rate-limit.js`; `cockatiel` for real
+ retries/circuit-breakers — never a `setTimeout` stand-in).
+- **Baseline marker counts (re-measure first — they drift):** ~62 `// TODO`
+ comments, ~6 `FIXME`, ~2 `const sample|mock|fake = [...]` arrays, ~7
+ `setTimeout` calls near `progress`/`loading`/`width` in `src/`, 0
+ `throw … not implemented`. Confirm with the greps below before you start.
+
+## Do this
+
+1. **Quantify first.** Run, and record the exact counts (re-run at the end to
+ prove zero):
+ - TODO/FIXME: `grep -rIn --include='*.js' --include='*.mjs' --include='*.html' -E 'TODO|FIXME' api src public workers | grep -v node_modules`
+ - not implemented: `grep -rIn -iE "not implemented|notImplemented|throw new Error\(['\"\`].*not impl" api src public workers`
+ - prod sample/mock/fake arrays: `grep -rIn -E 'const (sample|mock|fake|dummy)[A-Za-z]*\s*=\s*\[' api src public workers`
+ - fake loading: `grep -rIn -E 'setTimeout' src | grep -iE 'progress|loading|fake|width'`
+ - commented-out code blocks and `implement later`/`stub`/`placeholder`.
+2. **TODO/FIXME — implement or delete.** For each, either build the real behavior
+ the comment describes, or remove it if it's stale. No TODO survives. If a
+ comment documents a genuine known limitation, convert it to honest user-facing
+ handling (designed error/empty state), not a silent gap.
+3. **Stub functions / empty handlers — finish them.** Run `npm run audit:handlers`;
+ any flagged file gets a real implementation or is deleted along with its route.
+ Hunt for functions that `return null`/`return []`/do nothing where the caller
+ expects real data, and wire them to the real API.
+4. **Production sample/mock/fake arrays — replace with real fetch.** Any
+ `const sampleAgents = [...]` or fallback array rendered to users must become a
+ real call to the live endpoint, with designed loading/empty/error states.
+ Mocks belong only in `tests/` — leave those alone.
+5. **Fake `setTimeout` loading/progress — make it real.** Replace simulated
+ progress and `setTimeout` "loading" with progress driven by the actual async
+ operation (real fetch/stream/poll). If the operation has no progress signal,
+ use an honest indeterminate indicator (skeleton/spinner), not a faked bar.
+6. **Commented-out code — delete or implement.** Per `/CLAUDE.md` §3, no
+ commented-out code in committed work.
+7. **`throw new Error("not implemented")` — implement it.** None should exist; if
+ the grep surfaces any, build the real path.
+8. **Verify and log.** Re-run every grep from step 1 and confirm zero in shipped
+ source. Run `npm run audit:handlers`, `npx vitest run`, and exercise any
+ surface you changed in a real browser (`npm run dev`). Add a `data/changelog.json`
+ entry for any user-visible change (e.g. a screen that now shows real data), then
+ `npm run build:pages`.
+
+## Must-not
+
+- Do not touch or remove mocks inside `tests/` — those are legitimate test doubles.
+- Do not delete a feature to make a marker disappear; build the real version.
+- Do not swap one shortcut for another (e.g. a sample array for a hardcoded
+ constant) — wire the real data source.
+- Do not reference any coin other than `$THREE` in any replacement data, fixture,
+ or copy; use the $THREE CA or a clearly-synthetic placeholder.
+- Do not refactor working code beyond what removing the marker requires.
+
+## Acceptance (all true before claiming done)
+
+- [ ] Start-of-task marker counts are recorded; end-of-task re-run shows **zero**
+ TODO/FIXME/`not implemented`/prod sample-array/fake-`setTimeout` markers in
+ `api`, `src`, `public`, `workers` (tests excluded).
+- [ ] `npm run audit:handlers` exits clean (no empty/export-less handlers).
+- [ ] Every former mock/sample surface now fetches real data with designed
+ loading/empty/error states, verified in a real browser.
+- [ ] No commented-out code remains in the files touched.
+- [ ] No coin other than `$THREE` introduced anywhere.
+- [ ] `npx vitest run` passes; changelog updated for user-visible changes and
+ `npm run build:pages` is clean.
diff --git a/prompts/samples/05-secrets-and-env-hygiene.md b/prompts/samples/05-secrets-and-env-hygiene.md
new file mode 100644
index 000000000..2c2fbe1eb
--- /dev/null
+++ b/prompts/samples/05-secrets-and-env-hygiene.md
@@ -0,0 +1,99 @@
+# 05 — Secrets & env hygiene
+
+> Part of the three.ws "Production → $1B" program. Run in a fresh chat. Read
+> `/CLAUDE.md` first (its rules override everything) and `prompts/production-1b/00-README.md`
+> for shared context.
+
+## Why this matters for $1B
+
+This platform holds custody keys, x402 payment routing addresses, RPC and AI
+provider credentials, and a Telegram bot token. A single leaked secret in git
+history is a wallet drain or a takeover — the kind of incident that ends a $1B
+trajectory overnight. Equally damaging in slow motion: an undocumented env var
+that makes a surface silently fail in production because nobody knew to set it.
+Both must be closed: nothing secret committed, everything required documented.
+
+## Mission
+
+Ensure `.env.example` documents every env var the code actually reads, no secret
+is committed or sits in git history, anything ever exposed is rotated, and the
+required env per surface is documented.
+
+## Map (trust but verify — files move)
+
+- **Centralized env access** — [api/_lib/env.js](../../api/_lib/env.js). Lazy by
+ design: `req()` throws at first use on a missing var, `opt()`/`addr()` for
+ optional/address values. This is the canonical inventory of what the backend reads.
+- **Env template** — [.env.example](../../.env.example) (~246 documented vars,
+ grouped by surface; copy to `.env.local` for dev). The doc that must stay in
+ sync with what the code reads.
+- **Secret handling** — [api/_lib/secret-box.js](../../api/_lib/secret-box.js)
+ (encryption at rest), [api/_lib/agent-wallet.js](../../api/_lib/agent-wallet.js)
+ (custody key derivation/spend guards).
+- **Deploy env surface** — [vercel.json](../../vercel.json) (functions, crons,
+ headers; env is set in the Vercel dashboard, not committed).
+- **Ignore rules (already block .env files)** — [.gitignore](../../.gitignore)
+ (lines for `.env`, `.env.local`, `.env*.local`, `.env*`, etc.).
+- **Note:** there is currently **no** dedicated secret-scan workflow in
+ [.github/workflows/](../../.github/workflows) — installing one is in scope.
+
+## Do this
+
+1. **Build the read-set.** Grep every `process.env.X`, `req('X')`, `opt('X')`,
+ `addr(env.X)` across [api/](../../api), [src/](../../src), [workers/](../../workers),
+ and [scripts/](../../scripts). Dedupe into the authoritative list of vars the
+ code reads. `api/_lib/env.js` is the spine; capture the rest too.
+2. **Reconcile with `.env.example`.** Diff the read-set against
+ [.env.example](../../.env.example). Add every read-but-undocumented var with a
+ one-line comment (purpose, format, whether required), grouped under its surface.
+ Mark each as required/optional. Remove entries for vars no longer read.
+3. **Scan working tree + history for committed secrets.** Run a real scanner —
+ `npx gitleaks detect --no-banner` (or `npx --yes @trufflesecurity/trufflehog
+ git file://. --only-verified`). Triage every hit: real secret vs. test fixture
+ vs. example placeholder. Treat the $THREE CA and clearly-synthetic placeholders
+ as non-secrets.
+4. **For any real secret found committed or in history:** rotate it at the provider
+ immediately, update the value in Vercel/Upstash/etc. (never in the repo), and
+ document the rotation in this task's report. A scrubbed value that was ever
+ pushed is already compromised — rotation is non-negotiable; removal alone is not.
+5. **Confirm `.gitignore` coverage.** Verify every `.env*` variant and any local
+ key/credential file is ignored (`git check-ignore .env .env.local`). Add any
+ gap. Ensure no `.env*` file is currently tracked (`git ls-files | grep -E '\.env'`).
+6. **Document required env per surface.** For each major surface (Forge/text→3D,
+ wallet/x402, pump.fun/Oracle, MCP, Solana RPC), list the vars it needs to
+ function so an operator knows what to set. Keep this in `.env.example` group
+ comments — the existing file is already grouped by surface; extend that pattern.
+7. **Verify graceful degradation.** Confirm a surface with a missing optional var
+ fails honestly (designed error/clear log) rather than crashing unrelated
+ endpoints — the lazy `req()` pattern in `env.js` exists for exactly this; check
+ it holds for any var you add.
+8. **Add a secret-scan CI gate** (no GitHub Actions secret scan exists today): a
+ `gitleaks` job in [.github/workflows/ci.yml](../../.github/workflows/ci.yml) so
+ future pushes are blocked on a committed secret. Run `npx vitest run` to confirm
+ nothing broke. Add a `data/changelog.json` entry only if a user-visible/security
+ change resulted, then `npm run build:pages`.
+
+## Must-not
+
+- Do not commit any real secret, key, or token — values live in Vercel/Upstash,
+ not the repo. `.env.example` holds placeholders only.
+- Do not "fix" an exposed secret by deleting it from the file without rotating it
+ at the provider — an exposed secret is a compromised secret.
+- Do not paste a real coin's mint/creator/holder address anywhere; the only coin
+ is `$THREE` (CA `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`).
+- Do not introduce mocks, stubs, or TODOs; do not weaken `env.js` guards.
+- Do not log secret values in any new error path you add.
+
+## Acceptance (all true before claiming done)
+
+- [ ] Every env var read by `api/`, `src/`, `workers/`, `scripts/` is documented in
+ `.env.example` (purpose + format + required/optional), grouped by surface.
+- [ ] `gitleaks`/`trufflehog` scan of working tree **and** history is clean (or
+ every finding triaged as a non-secret placeholder, documented).
+- [ ] Any real secret ever committed is rotated at the provider and the rotation
+ is recorded; no secret value sits in the repo or history.
+- [ ] No `.env*`/credential file is tracked; `.gitignore` covers all variants.
+- [ ] Required-env-per-surface is documented so an operator can configure cleanly.
+- [ ] A secret-scan CI gate is added to `ci.yml`; `npx vitest run` passes.
+- [ ] Only `$THREE` referenced; changelog updated if any user-visible/security
+ change resulted and `npm run build:pages` is clean.
diff --git a/prompts/samples/06-error-handling-resilience.md b/prompts/samples/06-error-handling-resilience.md
new file mode 100644
index 000000000..a09599b0e
--- /dev/null
+++ b/prompts/samples/06-error-handling-resilience.md
@@ -0,0 +1,104 @@
+# 06 — Error handling & resilience (api/ + workers/)
+
+> Part of the three.ws "Production → $1B" program. Run in a fresh chat. Read
+> `/CLAUDE.md` first (its rules override everything) and `prompts/production-1b/00-README.md`
+> for shared context.
+
+## Why this matters for $1B
+
+A $1B platform never dies because an upstream blinked. Solana RPC throttles, OpenAI
+returns a 529, pump.fun times out, an image provider 502s — and the user must still
+get a fast, honest, recoverable result, never a hung spinner or a leaked vendor stack
+trace. `/CLAUDE.md` is explicit: **no errors without solutions; ship working fallbacks
+and failsafes; lazy error propagation is not engineering.** Resilience is what turns
+demo-grade into platform-grade.
+
+## Mission
+
+Wrap every external call in `api/` and `workers/` in a timeout + retry + circuit
+breaker via the existing **cockatiel** helper, handle errors only at the boundaries
+(network, user input) while internal code trusts itself, and guarantee no unhandled
+promise rejection and no provider internals ever reach a user.
+
+## Map (trust but verify — files move)
+
+- **Resilience helper (build on this — do not re-roll)** — [api/_lib/resilience.js](../../api/_lib/resilience.js):
+ `withBreaker(name, fn, { fallback, threshold, halfOpenAfterMs })`, `isCircuitError`.
+ It is the ONLY current cockatiel consumer — that is the gap this prompt closes.
+- **Boundary error envelope** — [api/_lib/http.js](../../api/_lib/http.js): `wrap()`
+ (catches unhandled rejections, redacts keyed RPC URLs from 5xx bodies, emits a
+ correlation `ref`), `serverError`, `respondError`, `redactUrl`.
+- **LLM provider chain** — [api/_lib/llm.js](../../api/_lib/llm.js) (`llmComplete`,
+ anthropic/openai/nvidia/groq fetch at lines ~95/169/183/238),
+ [api/_lib/llm-health.js](../../api/_lib/llm-health.js) (probe timeouts).
+- **Solana RPC failover** — [api/_lib/solana/rpc-fallback.js](../../api/_lib/solana/rpc-fallback.js)
+ (`createRpcFallback`, rotation + cooldown), [api/_lib/solana/connection.js](../../api/_lib/solana/connection.js),
+ [api/_lib/helius.js](../../api/_lib/helius.js), [api/_lib/onchain.js](../../api/_lib/onchain.js).
+- **Other upstreams** — pump.fun (`frontend-api-v3.pump.fun`, `gmgn.ai`),
+ [api/_lib/birdeye.js](../../api/_lib/birdeye.js), [api/_lib/aixbt.js](../../api/_lib/aixbt.js),
+ Telegram/IPFS/Pinata. Image/3D providers in [workers/](../../workers): `model-trellis`,
+ `model-hunyuan3d`, `model-triposg`, `rembg`, `texture`, `unirig`.
+- **MCP error masking** — [api/_lib/mcp-error-sanitize.js](../../api/_lib/mcp-error-sanitize.js)
+ (`sanitizeToolError`), used by [api/_lib/mcp-dispatch.js](../../api/_lib/mcp-dispatch.js).
+- **Tests** — [tests/resilience.test.js](../../tests/resilience.test.js),
+ [tests/api/mcp-resilience.test.js](../../tests/api/mcp-resilience.test.js),
+ [tests/api/pump-trending-resilience.test.js](../../tests/api/pump-trending-resilience.test.js).
+
+## Do this
+
+1. **Inventory raw external calls.** `grep -rnE "fetch\(|new Connection\(|axios" api/
+ workers/` and cross-reference the host list (`grep -rhoE "https://[a-z.-]+" api/
+ workers/`). Mark every site that hits Solana RPC, an LLM proxy, an image/3D
+ provider, pump.fun/gmgn, Birdeye, or Telegram/IPFS. That set is your work queue.
+2. **Every external call gets a timeout.** Any `fetch` without `signal:
+ AbortSignal.timeout(ms)` (or equivalent) is a bug — a hung socket stalls the lambda.
+ Add a tight, intent-appropriate timeout (probes ~5s, generations longer).
+3. **Wrap each upstream in a named breaker.** Use `withBreaker('pumpfun:trending',
+ () => …, { fallback, threshold, halfOpenAfterMs })` so an outage fails fast instead
+ of every request paying the full timeout. Name breakers per logical upstream.
+ Provide a real `fallback` (cached value, neutral empty result) — never silently null.
+4. **Solana goes through the failover path.** Confirm RPC reads/writes use
+ `createRpcFallback`/`rpc-fallback.js` (rotation + cooldown), not a bare
+ `new Connection(url)`. Retire any one-off connection that bypasses rotation.
+5. **No unhandled promise rejections.** Verify every Vercel handler is wrapped by
+ `wrap()` (or equivalent try/catch at the boundary). Audit fire-and-forget calls
+ (`void something()`, background telemetry) — every floating promise needs a
+ `.catch`. Internal pure functions stay un-try/catched; trust them.
+6. **Mask every vendor internal.** Boundary errors must map to neutral, actionable
+ copy via the `http.js` envelope (and `sanitizeToolError` for MCP). No raw stack,
+ no keyed RPC URL, no provider billing/quota text, no 402/credit message reaches the
+ client. Raw detail lives only in `console.error` + the `ref`.
+7. **Add coverage for each new failure mode.** Extend `tests/resilience.test.js` (and
+ the mcp/pump resilience tests) so timeout, open-circuit, 429/529, and fallback are
+ asserted. Run `npx vitest run tests/resilience.test.js tests/api/*resilience*.test.js`.
+8. **Sanity-check live.** `npm run dev`, exercise a forge generation and a pump/oracle
+ read with the network throttled; confirm graceful degrade, no console errors, real
+ elapsed time. If anything is user-visible, add a `data/changelog.json` entry (tag
+ `infra` or `improvement`) and run `npm run build:pages`.
+
+## Must-not
+
+- Do not hand-roll a new retry/cooldown/breaker — extend `withBreaker`/cockatiel.
+- Do not swallow errors into silent nulls without a designed fallback or a log line.
+- Do not let any vendor stack, keyed URL, billing/quota/credit message, or 402 detail
+ reach a user — mask at the boundary, log raw server-side with a `ref`.
+- Do not add try/catch to internal pure code — handle at boundaries only.
+- Do not break working failsafes (the Solana rotation, `wrap()` redaction, fail-closed
+ limiters). Add resilience; never weaken what already protects money paths.
+- Do not reference any coin other than `$THREE`.
+
+## Acceptance (all true before claiming done)
+
+- [ ] Every external call site in `api/` + `workers/` has a timeout and a named
+ `withBreaker` (or the existing Solana failover) — verified by grep, no bare
+ timeout-less `fetch` to a third party remains.
+- [ ] No unhandled promise rejection path: every handler is `wrap()`-ed, every
+ fire-and-forget promise has a `.catch`.
+- [ ] Throttling/killing an upstream degrades gracefully in a real browser — no hung
+ spinner, no console error, neutral copy, real elapsed time.
+- [ ] No vendor internals (stack, keyed URL, billing/quota/402) appear in any client
+ response; raw detail is logged with a correlation `ref`.
+- [ ] `tests/resilience.test.js` + the mcp/pump resilience tests pass, with new cover
+ for timeout, open-circuit, 429/529, and fallback.
+- [ ] Any user-visible change has a `data/changelog.json` entry and `npm run
+ build:pages` is clean.
diff --git a/prompts/samples/07-security-hardening.md b/prompts/samples/07-security-hardening.md
new file mode 100644
index 000000000..20379d9c7
--- /dev/null
+++ b/prompts/samples/07-security-hardening.md
@@ -0,0 +1,117 @@
+# 07 — Security hardening (authz, validation, headers, SSRF)
+
+> Part of the three.ws "Production → $1B" program. Run in a fresh chat. Read
+> `/CLAUDE.md` first (its rules override everything) and `prompts/production-1b/00-README.md`
+> for shared context.
+
+## Why this matters for $1B
+
+The platform moves real value: custodial wallet payouts, x402 USDC settlement, $THREE
+gating, on-chain launches. One missing authorization check, one unvalidated body, one
+server-side fetch that follows an attacker URL, and a $1B platform becomes a breach
+headline. Security is not a phase you bolt on — it is the precondition for every dollar
+that flows through three.ws. This prompt hardens the four highest-leverage classes:
+authorization, input validation, response headers, and SSRF.
+
+## Mission
+
+Confirm every endpoint authorizes its caller, every input is zod-validated at the
+boundary, security headers (CSP, HSTS, X-Frame-Options, Referrer-Policy,
+Permissions-Policy) are correct in `vercel.json`, CORS is allowlisted, and every
+server-side URL/image fetch is SSRF-guarded — then run `/security-review` and fix
+everything it surfaces.
+
+## Map (trust but verify — files move)
+
+- **Input validation (zod — ~123 files use it)** — [api/_lib/validate.js](../../api/_lib/validate.js):
+ shared schemas (`email`, `slug`, `httpUrl`, `createAvatarBody`, …) + helpers
+ `parse(schema, input)`, `validateQuery(req, schema)`, `isValidSolanaAddress`,
+ `isValidEvmAddress`, `isUuid`. Validation 400s go through
+ [api/_lib/http.js](../../api/_lib/http.js) `validationError`.
+- **AuthZ helpers** — [api/_lib/auth.js](../../api/_lib/auth.js) (`getSessionUser`,
+ `authenticateBearer`, `verifyCsrfToken`, `isSameSiteOrigin`, `hasScope`),
+ [api/_lib/account-auth.js](../../api/_lib/account-auth.js) (`resolveAccount`),
+ [api/_lib/admin.js](../../api/_lib/admin.js) (`requireAdmin`),
+ [api/_lib/csrf.js](../../api/_lib/csrf.js),
+ [api/_lib/x402/access-control.js](../../api/_lib/x402/access-control.js) (`installAccessControl`).
+- **CORS** — [api/_lib/http.js](../../api/_lib/http.js) `cors(req, res, { origins,
+ methods, credentials })` + `isAllowedOrigin` (the allowlist: `APP_ORIGIN`,
+ x402scan, agentic.market, `*.ibm.com`, localhost in dev). Reuse it; do not invent.
+- **SSRF guards** — [api/_lib/ssrf.js](../../api/_lib/ssrf.js)
+ (`validatePublicUrl`, `assertPublicHttpsUrl`, `safeFetchJson`, `pinnedAgent`),
+ [api/_lib/ssrf-guard.js](../../api/_lib/ssrf-guard.js) (`assertSafePublicUrl`,
+ `fetchSafePublicUrl`, `fetchSafePublicUrlPinned`),
+ [api/_lib/fetch-model.js](../../api/_lib/fetch-model.js) (`fetchModel` — the SSRF pioneer).
+- **Security headers** — [vercel.json](../../vercel.json) `headers` blocks (~line 202+):
+ `content-security-policy`, `strict-transport-security`, `x-content-type-options`,
+ `referrer-policy`, `permissions-policy`, `x-frame-options`.
+- **Skill + tests** — `/security-review` skill;
+ [tests/api/security-csrf-gates.test.js](../../tests/api/security-csrf-gates.test.js),
+ [tests/api/x402-security-fixes.test.js](../../tests/api/x402-security-fixes.test.js),
+ [tests/api/validate.test.js](../../tests/api/validate.test.js).
+
+## Do this
+
+1. **AuthZ audit — every state-changing endpoint authorizes the caller.** Inventory
+ `api/` POST/PUT/PATCH/DELETE handlers; confirm each calls `getSessionUser` /
+ `authenticateBearer` / `resolveAccount` / `requireAdmin` (or x402 `installAccessControl`
+ for paid routes) AND checks ownership (the resource belongs to the caller). Flag any
+ handler that mutates without an authZ gate; close the gap. Verify CSRF via
+ `verifyCsrfToken`/`isSameSiteOrigin` on cookie-auth state changes.
+2. **Input validation everywhere.** Every handler that reads `req.body`/query/params
+ must run it through a zod schema (reuse `validate.js`, add a `.strict()` schema where
+ missing) and return `validationError` on failure. `grep -rn "req.body" api/` and
+ confirm each is validated, not dot-accessed raw. No unbounded strings, no unchecked
+ numbers feeding limits/pagination.
+3. **SSRF on every server-side fetch of a user/DB URL.** `grep -rnE "fetch\(" api/` and
+ find any call whose URL comes from user input or the DB (image render, GLB fetch,
+ webhook, metadata, proxy). Route it through `fetchSafePublicUrl` /
+ `fetchSafePublicUrlPinned` / `safeFetchJson` — pinned variant for anything whose
+ response is forwarded or executed. No raw `fetch(userUrl)` may remain.
+4. **CORS allowlist, not wildcard.** Confirm `cors()` callers pass an explicit
+ `origins` allowlist (or rely on `isAllowedOrigin`); flag any `origins: '*'` on a
+ credentialed or state-changing route and tighten it. Public read-only APIs may stay
+ `*` — document why.
+5. **Security headers complete and correct.** Verify `vercel.json` sets CSP, HSTS
+ (`max-age` + `includeSubDomains` + `preload`), `x-content-type-options: nosniff`,
+ `referrer-policy`, `permissions-policy`, and `x-frame-options`/`frame-ancestors` for
+ every served surface. Tighten CSP where `'unsafe-inline'`/`'unsafe-eval'` can be
+ dropped without breaking a real page (test in browser before removing).
+6. **Run the security review.** Invoke the `/security-review` skill on the working
+ tree. Triage every finding to root cause and fix it — no "accepted risk" without an
+ explicit, written reason. Re-run until clean.
+7. **Validate live + tests.** `npm run dev`; confirm headers land (`curl -I`), CORS
+ preflight behaves, an unauthorized mutation is rejected, a private-IP URL fetch is
+ blocked. Run `npx vitest run tests/api/security-csrf-gates.test.js
+ tests/api/x402-security-fixes.test.js tests/api/validate.test.js` and add cover for
+ any newly-closed gap.
+8. **Changelog if user-visible.** Security hardening that changes behavior gets a
+ `data/changelog.json` entry (tag `security`); run `npm run build:pages`.
+
+## Must-not
+
+- Do not weaken an existing control to "make it work" — fix the caller, not the guard.
+- Do not add `origins: '*'` to a credentialed/state-changing route, and do not loosen
+ the SSRF IP blocklist (metadata, RFC1918, loopback, CGNAT must stay blocked).
+- Do not trust client-supplied IDs/ownership — re-check ownership server-side.
+- Do not dismiss a `/security-review` finding without a root-cause fix or written
+ justification.
+- Do not break working pages by over-tightening CSP — verify each removal in a browser.
+- Do not reference any coin other than `$THREE`.
+
+## Acceptance (all true before claiming done)
+
+- [ ] Every state-changing `api/` endpoint authorizes the caller and verifies resource
+ ownership; CSRF enforced on cookie-auth mutations — verified by audit.
+- [ ] Every handler that reads body/query/params validates it via zod and returns a
+ clean `validationError` on bad input; no raw unvalidated `req.body` access remains.
+- [ ] Every server-side fetch of a user/DB-supplied URL goes through the SSRF guard;
+ `grep` shows no raw `fetch(userUrl)`.
+- [ ] CORS is allowlisted on credentialed/mutating routes; any `*` is read-only and
+ justified.
+- [ ] `vercel.json` sets correct CSP, HSTS, X-Content-Type-Options, Referrer-Policy,
+ Permissions-Policy, and X-Frame-Options for every served surface (confirmed via
+ `curl -I`).
+- [ ] `/security-review` runs clean (or every finding has a root-cause fix).
+- [ ] Security/CSRF/validate tests pass with cover for any closed gap; user-visible
+ changes logged in `data/changelog.json` and `npm run build:pages` is clean.
diff --git a/prompts/samples/08-rate-limiting-abuse.md b/prompts/samples/08-rate-limiting-abuse.md
new file mode 100644
index 000000000..482b0d2a0
--- /dev/null
+++ b/prompts/samples/08-rate-limiting-abuse.md
@@ -0,0 +1,116 @@
+# 08 — Rate limiting & abuse prevention
+
+> Part of the three.ws "Production → $1B" program. Run in a fresh chat. Read
+> `/CLAUDE.md` first (its rules override everything) and `prompts/production-1b/00-README.md`
+> for shared context.
+
+## Why this matters for $1B
+
+Every expensive path on three.ws costs real money: forge generations burn GPU/provider
+credits, LLM proxies burn tokens, Solana/Helius/Birdeye reads burn shared API quota,
+and x402/payout endpoints move USDC. Unlimited, those become a free attack on the
+platform's wallet and a denial-of-service on every honest user. A $1B platform meters
+its costly surfaces, makes payments idempotent so a replay can't double-charge, and
+stops bots before they scale. This is cost control, fairness, and uptime in one.
+
+## Mission
+
+Ensure every expensive / paid / auth / generation endpoint is rate-limited per
+user+IP via the existing `rate-limit.js` registry, payment endpoints are idempotent via
+the x402 idempotency cache, and bot/abuse mitigation plus quota tiers are in place —
+starting from an inventory of which endpoints currently lack limits.
+
+## Map (trust but verify — files move)
+
+- **Rate-limit registry (build on this — do not re-roll)** —
+ [api/_lib/rate-limit.js](../../api/_lib/rate-limit.js): the `limits` object (named
+ buckets: `authIp`, `registerIp`, `pumpMetaIp`, `imgProxyIp`, `cohortsIp`, `aixbtIp`,
+ `sdpIp`, `avatarPayoutDaily`, …), `clientIp(req)`, and `getLimiter(name, { limit,
+ window, critical })` — `critical: true` fails CLOSED in prod (money/cost buckets),
+ non-critical fails open. ~418 files already import it.
+- **Limit responses** — [api/_lib/http.js](../../api/_lib/http.js): `rateLimited(res,
+ result, message)`, `setRateLimitHeaders(res, result)`. Use these so 429s carry the
+ standard retry headers.
+- **x402 idempotency** — [api/_lib/x402/idempotency-cache.js](../../api/_lib/x402/idempotency-cache.js):
+ `hashRequestPayload`, `hashPaymentProof`, `reserve`/`get`/`set`/`release`, `INFLIGHT`,
+ `isInflight` (Redis-backed; refuses to boot in prod without Upstash unless
+ `X402_ALLOW_MEMORY_FALLBACK=1`). Same id + different payload → 409 Conflict.
+- **x402 payment plumbing** — [api/_lib/x402-paid-endpoint.js](../../api/_lib/x402-paid-endpoint.js)
+ (`paidEndpoint`), [api/_lib/x402-spec.js](../../api/_lib/x402-spec.js),
+ [api/_lib/x402-spending-cap.js](../../api/_lib/x402-spending-cap.js),
+ [api/_lib/x402/access-control.js](../../api/_lib/x402/access-control.js).
+- **Costly endpoints to verify** — [api/forge.js](../../api/forge.js) (generation +
+ rigging buckets), [api/chat.js](../../api/chat.js) (LLM proxy), pump/oracle reads
+ (Helius/Birdeye), [api/_lib/agent-wallet.js](../../api/_lib/agent-wallet.js) +
+ payout routes, MCP dispatch in [api/_lib/mcp-dispatch.js](../../api/_lib/mcp-dispatch.js).
+- **Tests** — [tests/api/http-rate-limited.test.js](../../tests/api/http-rate-limited.test.js),
+ [tests/api/chat-proxy-ratelimit.test.js](../../tests/api/chat-proxy-ratelimit.test.js).
+
+## Do this
+
+1. **Inventory unlimited expensive endpoints.** For every handler in `api/`, classify:
+ does it cost money (provider/GPU/token/RPC quota), move value (x402/payout/launch),
+ gate auth (login/register/reset), or generate (forge/avatar/image/LLM)? `grep -rLn
+ "rate-limit\|limits\.\|clientIp" api/` to find handlers in those classes that import
+ no limiter. That list is the work queue — produce it explicitly.
+2. **Add a named bucket per gap.** For each unlimited costly endpoint, add a bucket to
+ the `limits` registry (descriptive name, sensible `limit`/`window`, `critical: true`
+ for money/cost paths so a Redis outage fails closed) and enforce it with
+ `clientIp(req)` + `rateLimited(res, rl, msg)`. Match the existing per-IP (and
+ per-user where authenticated) keying convention.
+3. **Per user+IP, not just IP.** Authenticated costly endpoints should key on the user
+ id when present (so one user can't rotate IPs) AND fall back to IP for anonymous
+ callers. Add a per-resource ceiling where one entity is the cost driver (mirror
+ `avatarPayoutDaily` keyed on the wallet, not the caller).
+4. **Idempotency on every payment endpoint.** Confirm each x402/paid route uses
+ `idempotency-cache.js`: `reserve` before settling, `set` the response, return the
+ cached body on replay, and 409 on same-id/different-payload. Any payment route
+ without this can double-charge — fix it. Verify the prod no-memory-fallback boot
+ check is intact.
+5. **Bot / abuse mitigation.** Ensure auth + registration + generation surfaces resist
+ scripted abuse: burst + sustained windows (mirror `irlPinBurst` + `irlPinHourly`),
+ honeypot/timing on signup, and per-device keying where a device token exists. Confirm
+ anonymous generation can't be farmed for free GPU.
+6. **Quota tiers.** Wire tiered ceilings (anon < authenticated < $THREE-gated/paid) so
+ value flows to holders and paying agents get headroom. Reuse existing tier/gating
+ helpers (`three-tier.js`, holder/play passes) rather than inventing a parallel
+ system — surface a clear, actionable message when a tier limit is hit.
+7. **Test the limits.** Extend `tests/api/http-rate-limited.test.js` and the chat
+ ratelimit test to cover each new bucket (burst trips, headers present, critical
+ buckets fail closed, idempotency replay returns cached / 409s on mismatch). Run
+ `npx vitest run tests/api/http-rate-limited.test.js tests/api/chat-proxy-ratelimit.test.js`.
+8. **Verify live + changelog.** `npm run dev`; hammer a newly-limited endpoint and
+ confirm a clean 429 with retry headers and helpful copy (not a raw error). Any
+ user-visible change (new limit, tier) → `data/changelog.json` entry (tag
+ `improvement` or `security`) + `npm run build:pages`.
+
+## Must-not
+
+- Do not hand-roll a counter/limiter — extend the `limits` registry in `rate-limit.js`.
+- Do not mark a money/cost bucket non-critical (it would fail open on a Redis outage and
+ silently uncap a paid path); do not weaken an existing `critical` bucket.
+- Do not skip idempotency on a payment route, and do not enable the in-memory
+ idempotency fallback in production (`X402_ALLOW_MEMORY_FALLBACK`) without explicit
+ reason.
+- Do not return a raw error on a limit hit — use `rateLimited()` with retry headers and
+ actionable copy.
+- Do not set ceilings so tight they break legitimate interactive use (size each window
+ to a real workflow, like the existing buckets do).
+- Do not reference any coin other than `$THREE`.
+
+## Acceptance (all true before claiming done)
+
+- [ ] An explicit inventory exists of expensive/paid/auth/generation endpoints; every
+ one is now rate-limited via a named `limits` bucket (verified by grep — no costly
+ handler lacks a limiter).
+- [ ] Authenticated costly endpoints key on user+IP (plus a per-resource ceiling where a
+ single entity drives cost); money/cost buckets are `critical` (fail closed).
+- [ ] Every payment/x402 endpoint is idempotent via `idempotency-cache.js`: replay
+ returns the cached response, same-id/different-payload returns 409; prod
+ no-memory-fallback boot check intact.
+- [ ] Bot/abuse mitigation (burst + sustained windows, signup protection) and tiered
+ quotas (anon < auth < holder/paid) are in place with clear messaging.
+- [ ] Limit hits return a clean 429 with retry headers and helpful copy in a real
+ browser.
+- [ ] Rate-limit + idempotency tests pass with cover for each new bucket; user-visible
+ changes logged in `data/changelog.json` and `npm run build:pages` is clean.
diff --git a/prompts/samples/09-accessibility-wcag.md b/prompts/samples/09-accessibility-wcag.md
new file mode 100644
index 000000000..f7551d6d6
--- /dev/null
+++ b/prompts/samples/09-accessibility-wcag.md
@@ -0,0 +1,95 @@
+# 09 — Accessibility (WCAG 2.2 AA)
+
+> Part of the three.ws "Production → $1B" program. Run in a fresh chat. Read
+> `/CLAUDE.md` first (its rules override everything) and `prompts/production-1b/00-README.md`
+> for shared context.
+
+## Why this matters for $1B
+
+A platform that excludes keyboard, screen-reader, and low-vision users is leaving
+real users — and in many markets, legal compliance — on the table. Accessibility is
+also a proxy for craft: semantic structure, focus management, and contrast are the
+same primitives that make UI feel polished to everyone. A $1B platform passes WCAG
+2.2 AA on its core flows without anyone having to ask.
+
+## Mission
+
+Bring every primary surface (home, forge, marketplace, wallet, agent profiles,
+create flows) to WCAG 2.2 AA: semantic HTML, ARIA on interactive elements, full
+keyboard operability, visible focus, sufficient contrast, screen-reader labels, and
+honored reduced-motion.
+
+## Map (trust but verify — files move)
+
+- **Pages** — [pages/](../../pages) (~125 `*.html`). Start with high-traffic flows:
+ `home.html`, `forge.html`, `marketplace*.html`, `agent-detail.html`,
+ `create-prompt.html`, `agent-wallet.html`.
+- **Shared nav** — [public/nav.html](../../public/nav.html), [public/nav.js](../../public/nav.js)
+ (desktop dropdowns + mobile drawer; `aria-pressed` already on the walk toggle),
+ [public/nav.css](../../public/nav.css).
+- **Design tokens (focus ring, contrast)** — [public/tokens.css](../../public/tokens.css)
+ (`--focus-ring-color` and friends), [DESIGN-TOKENS.md](../../DESIGN-TOKENS.md).
+ Focus styles already exist in [public/buttons.css](../../public/buttons.css),
+ [public/home.css](../../public/home.css), and others — extend, don't fork.
+- **Reduced motion** — already honored in [public/tokens.css](../../public/tokens.css),
+ [public/footer.css](../../public/footer.css), [public/features-landing.css](../../public/features-landing.css);
+ many `src/` animation modules are not. Search `prefers-reduced-motion`.
+- **JS components** — [src/](../../src) (~810 modules). Interactive widgets that build
+ DOM (modals, tabs, menus, viewers) often ship `<div onclick>` without roles/labels.
+
+## Do this
+
+1. **Baseline audit.** Run an axe scan against the running app (no dep needed):
+ `npm run dev`, then `npx @axe-core/cli http://localhost:3000/forge
+ http://localhost:3000/marketplace http://localhost:3000/ http://localhost:3000/create/prompt`.
+ Record every violation by page; this is your worklist.
+2. **Semantic structure.** Each page needs one `<h1>`, a logical heading order, and
+ landmark regions (`<header><nav><main><footer>`). Replace generic `<div>` wrappers
+ that are really headers/nav/main with the semantic element. Add a "skip to content"
+ link as the first focusable element on long pages.
+3. **Interactive elements.** Every clickable `<div>`/`<span>` becomes a `<button>` or
+ gets `role="button"`, `tabindex="0"`, and keydown (Enter/Space) handling. Icon-only
+ controls get `aria-label`. Toggles get `aria-pressed`; tabs get `role="tab"` +
+ `aria-selected`; modals get `role="dialog"`, `aria-modal`, focus trap, and Esc-to-close.
+4. **Keyboard operability.** Tab through each core flow with no mouse: every control
+ reachable, in a sane order, no keyboard trap, dropdowns/drawers open & close via
+ keyboard. The mobile drawer in `nav.js` must trap focus while open and restore it on
+ close.
+5. **Visible focus.** Every interactive element shows a clear focus ring using the
+ existing `--focus-ring-color` token (via `:focus-visible`). No `outline: none`
+ without a replacement. Audit `src/` and `public/*.css` for naked `outline: none`.
+6. **Contrast.** Verify text and UI contrast against backgrounds (4.5:1 body, 3:1 large
+ text / UI components) in both light and dark themes. Fix failing pairs by remapping to
+ compliant tokens in `tokens.css` — never hardcode a one-off hex.
+7. **Screen reader & forms.** Every input has an associated `<label>` (or `aria-label`);
+ error messages are announced (`aria-describedby` / `aria-live`); decorative images get
+ `alt=""`, meaningful images get real `alt`. Async status (forge progress, save
+ results) uses an `aria-live` region.
+8. **Reduced motion.** Wrap non-essential `src/` animations (loops, parallax, auto-play
+ 3D spin) in `@media (prefers-reduced-motion: reduce)` or a JS check, degrading to a
+ static/instant state.
+9. **Re-audit & test.** Re-run the axe scan — zero serious/critical violations on the
+ targeted pages. Run `npm test` (vitest + playwright) and add/extend a Playwright check
+ asserting skip-link presence, focus visibility, and drawer focus trap on at least the
+ home and forge routes. Add a changelog entry; `npm run build:pages`.
+
+## Must-not
+
+- Do not add ARIA that lies about state (e.g. static `aria-expanded="true"`); ARIA must
+ reflect live state or be omitted.
+- Do not remove focus outlines without a stronger visible replacement.
+- Do not hardcode colors to "fix" contrast — remap design tokens so both themes stay correct.
+- Do not regress working interactions while making them accessible; verify each in a browser.
+- Do not reference any coin other than `$THREE` in any new copy or label.
+
+## Acceptance (all true before claiming done)
+
+- [ ] axe scan on home, forge, marketplace, agent-detail, create/prompt shows zero
+ serious/critical violations.
+- [ ] Every core flow is fully keyboard operable with no trap; visible focus on every control.
+- [ ] One `<h1>` and correct landmarks per audited page; skip-to-content link works.
+- [ ] Text/UI contrast passes 4.5:1 / 3:1 in both light and dark themes.
+- [ ] Inputs are labeled; async status and errors are announced via `aria-live`.
+- [ ] Reduced-motion is honored across `src/` animations on the audited pages.
+- [ ] `npm test` passes; new a11y Playwright checks added; changelog updated and
+ `npm run build:pages` is clean.
diff --git a/prompts/samples/10-performance-core-web-vitals.md b/prompts/samples/10-performance-core-web-vitals.md
new file mode 100644
index 000000000..48c7e545a
--- /dev/null
+++ b/prompts/samples/10-performance-core-web-vitals.md
@@ -0,0 +1,87 @@
+# 10 — Performance & Core Web Vitals
+
+> Part of the three.ws "Production → $1B" program. Run in a fresh chat. Read
+> `/CLAUDE.md` first (its rules override everything) and `prompts/production-1b/00-README.md`
+> for shared context.
+
+## Why this matters for $1B
+
+Speed is the silent conversion lever. Every 100ms of LCP and every layout shift costs
+sign-ups, and Core Web Vitals directly affect search ranking — the cheapest growth
+channel. This platform ships a heavy Three.js/GLB stack on top of ~125 pages; if those
+assets block first paint, the front door feels slow and acquisition leaks before the
+user sees the product. Fast must be the default, not a flag.
+
+## Mission
+
+Hit good Core Web Vitals on the primary surfaces — LCP < 2.5s, CLS < 0.1, INP < 200ms —
+by lazy-loading heavy modules and 3D, enforcing image-loading attributes, code-splitting,
+debouncing input handlers, and preconnecting/preloading critical origins.
+
+## Map (trust but verify — files move)
+
+- **Heaviest pages** — [pages/home.html](../../pages/home.html),
+ [pages/forge.html](../../pages/forge.html) (both already use `preconnect`/`preload`),
+ marketplace and walk landing pages. These mount Three.js.
+- **3D / GLB loaders** — `src/` modules importing `GLTFLoader` / `three.module` (e.g.
+ [src/avatar-picker.js](../../src/avatar-picker.js), [src/club.js](../../src/club.js),
+ [src/avatar-export.js](../../src/avatar-export.js)). Grep `GLTFLoader|three.module`.
+ These are the biggest bundles — they must dynamic-`import()` on demand, not at page load.
+- **Dynamic import (existing pattern)** — many `src/` files already use `import(...)`
+ (e.g. [src/agent-detail.js](../../src/agent-detail.js)); follow that pattern.
+- **Image loading guard** — [scripts/audit-image-loading.mjs](../../scripts/audit-image-loading.mjs)
+ via `npm run check:images` (strict: every JS-rendered `<img>` in `src/` needs `loading=`).
+ Codemod helper: [scripts/codemod-lazy-images.mjs](../../scripts/codemod-lazy-images.mjs).
+- **Build config** — [vite.config.js](../../vite.config.js) (chunking, build target),
+ [public/tokens.css](../../public/tokens.css) (motion tokens for `will-change`/`transform`).
+- **Audit tooling** — `npm run audit:web` ([scripts/page-audit.mjs](../../scripts/page-audit.mjs)),
+ `npm run snapshot` ([scripts/page-snapshot.mjs](../../scripts/page-snapshot.mjs)).
+
+## Do this
+
+1. **Measure first.** `npm run dev`, then run Lighthouse on the heaviest routes:
+ `npx lighthouse http://localhost:3000/ --only-categories=performance --view`
+ and repeat for `/forge` and `/marketplace`. Record LCP, CLS, INP/TBT per page — this
+ is your before/after baseline. Note the LCP element and the largest network requests.
+2. **Lazy-load the 3D stack.** Confirm every Three.js/GLTFLoader import is behind a
+ dynamic `import()` triggered by viewport/interaction (IntersectionObserver or click),
+ never at module top level on a page that paints text first. Defer the canvas mount
+ until after first contentful paint.
+3. **Image loading.** Run `npm run check:images` — fix every offender so JS-rendered
+ `<img>` carries `loading="lazy"` and `decoding="async"`. For above-the-fold LCP images
+ in static HTML, use `loading="eager"` + `fetchpriority="high"` (don't lazy-load the LCP
+ image). Set explicit `width`/`height` (or `aspect-ratio`) on every image to kill CLS.
+4. **Eliminate layout shift.** Reserve space for async content (skeletons, fixed-aspect
+ media, font-swap with `font-display: optional/swap` and preloaded fonts). Audit feeds
+ and the forge result area for content that pushes layout on load.
+5. **Code-split & budget.** Inspect the Vite build output (`npx vite build`) for oversized
+ chunks; split route-specific and 3D code into async chunks. Set and document a bundle
+ budget (e.g. initial JS < 200KB gzipped per primary route) and bring offenders under it.
+6. **Debounce & schedule.** Debounce/throttle search, scroll, and resize handlers;
+ move non-urgent work off the critical path (`requestIdleCallback` / `requestAnimationFrame`).
+ Use `transform`/`opacity` + `will-change` for animations (never animate layout props).
+7. **Network priming.** Add `preconnect`/`dns-prefetch` for real cross-origin asset hosts
+ (R2, RPC, fonts) and `preload` the LCP image + critical font on the heaviest pages,
+ matching the existing pattern in `home.html`/`forge.html`. Remove dead preloads.
+8. **Re-measure & verify.** Re-run Lighthouse on the same routes — LCP < 2.5s, CLS < 0.1,
+ INP/TBT in the good band. Run `npm run audit:web` and `npm run snapshot` and confirm no
+ console errors. `npm test`. Add a changelog entry; `npm run build:pages`.
+
+## Must-not
+
+- Do not lazy-load the LCP image or above-the-fold hero — that regresses LCP.
+- Do not eager-load the full Three.js/GLB stack on pages that paint text first.
+- Do not animate layout-triggering properties (top/left/width/height) — use transforms.
+- Do not introduce fake `setTimeout` loading bars; use real async + skeletons.
+- Do not bypass `npm run check:images` strict mode — fix the images, don't disable the guard.
+
+## Acceptance (all true before claiming done)
+
+- [ ] Lighthouse on home, forge, marketplace: LCP < 2.5s, CLS < 0.1, INP/TBT in the good band.
+- [ ] `npm run check:images` passes strict; every image has dimensions and correct `loading=`.
+- [ ] Three.js/GLB code is dynamic-imported on demand; not in the initial route bundle.
+- [ ] Documented bundle budget met; oversized chunks split; `npx vite build` clean.
+- [ ] Input/scroll handlers debounced; animations use transform/opacity + `will-change`.
+- [ ] `preconnect`/`preload` cover real critical origins; no dead hints; no console errors.
+- [ ] `npm test`, `npm run audit:web`, `npm run snapshot` pass; changelog updated and
+ `npm run build:pages` is clean.
diff --git a/prompts/samples/11-mobile-responsiveness.md b/prompts/samples/11-mobile-responsiveness.md
new file mode 100644
index 000000000..deb4ea48b
--- /dev/null
+++ b/prompts/samples/11-mobile-responsiveness.md
@@ -0,0 +1,85 @@
+# 11 — Mobile responsiveness (320 / 768 / 1440)
+
+> Part of the three.ws "Production → $1B" program. Run in a fresh chat. Read
+> `/CLAUDE.md` first (its rules override everything) and `prompts/production-1b/00-README.md`
+> for shared context.
+
+## Why this matters for $1B
+
+Most first touches arrive on a phone. If the home hero overflows at 320px, the forge
+canvas tanks a mid-range mobile GPU, or a primary CTA sits under the keyboard, the
+funnel dies before the user understands the product. A $1B platform is flawless from a
+cheap Android in portrait up to a 1440px desktop — the same flows, no horizontal
+scroll, no dead zones, touch targets you can actually hit.
+
+## Mission
+
+Make every key flow (home, forge, marketplace, wallet, agent profiles, create) correct
+and comfortable at 320px, 768px, and 1440px: proper viewport meta, fluid flex/grid
+layouts, ≥44px touch targets, a working mobile nav, and a 3D canvas that stays smooth on
+mobile GPUs.
+
+## Map (trust but verify — files move)
+
+- **Pages** — [pages/](../../pages) (~125 `*.html`). Both [pages/home.html](../../pages/home.html)
+ and [pages/forge.html](../../pages/forge.html) already declare `viewport` — verify all
+ primary pages do.
+- **Mobile nav** — [public/nav.js](../../public/nav.js) (`renderDrawer`, `initDrawer`,
+ the mobile drawer + walk toggle), [public/nav.css](../../public/nav.css),
+ [public/nav.html](../../public/nav.html).
+- **Layout CSS** — [public/](../../public) `*.css`. Several use fixed `width: NNNpx`
+ (e.g. [public/app-next.css](../../public/app-next.css), [public/auth.css](../../public/auth.css)) —
+ candidates to convert to fluid flex/grid. Grep `width: *[0-9]{3,}px`.
+- **Design tokens** — [public/tokens.css](../../public/tokens.css) (spacing scale, type
+ ladder) so breakpoints reflow against shared tokens, not magic numbers.
+- **3D on mobile** — `src/` modules mounting Three.js/GLTFLoader (grep `GLTFLoader`).
+ Set device pixel ratio caps and quality fallbacks here.
+- **Visual check tooling** — `npm run snapshot` ([scripts/page-snapshot.mjs](../../scripts/page-snapshot.mjs)),
+ Playwright ([playwright.config.js](../../playwright.config.js)) for scripted viewports.
+
+## Do this
+
+1. **Drive real viewports.** `npm run dev`, open the core flows in browser devtools at
+ **320×568**, **768×1024**, and **1440×900** (and one landscape phone). Walk home →
+ forge → result, marketplace → detail, wallet, and a create flow at each width.
+2. **Viewport meta.** Confirm every primary page has
+ `<meta name="viewport" content="width=device-width, initial-scale=1">` with no
+ `maximum-scale`/`user-scalable=no` (pinch-zoom must stay enabled for a11y).
+3. **Kill horizontal scroll.** At 320px nothing overflows: no fixed pixel widths wider
+ than the viewport, long words/URLs wrap (`overflow-wrap`), tables/grids scroll inside
+ a contained region, images are `max-width: 100%`. Convert offending fixed-width blocks
+ to fluid flex/grid using token spacing.
+4. **Touch targets.** Every tappable control is ≥44×44px with adequate spacing so
+ neighbors aren't mis-tapped. Audit nav links, icon buttons, chips, and close buttons.
+5. **Mobile nav.** The drawer in `nav.js` opens/closes cleanly, the body locks scroll
+ while open, the walk toggle works, and it dismisses on link tap and on backdrop tap.
+ Verify it doesn't cover content or trap the user.
+6. **Forms & keyboard.** On mobile, primary CTAs aren't hidden behind the on-screen
+ keyboard; inputs use correct `inputmode`/`type` (email, numeric, search); focused
+ fields scroll into view.
+7. **3D on mobile GPUs.** In the Three.js mounts, cap `renderer.setPixelRatio` (e.g.
+ `Math.min(devicePixelRatio, 2)`), provide a lighter quality path or a tap-to-load
+ poster on small/low-power devices, and ensure the canvas resizes correctly on
+ rotation. Confirm acceptable frame rate on a throttled mobile profile.
+8. **Snapshot & verify.** Run `npm run snapshot` and review the captures across widths;
+ run the Playwright suite (extend with a mobile viewport project for home + forge if
+ absent). `npm test`. Add a changelog entry; `npm run build:pages`.
+
+## Must-not
+
+- Do not disable pinch-zoom (`user-scalable=no` / `maximum-scale=1`) — it breaks a11y.
+- Do not hide core functionality on mobile; reflow it, don't remove it.
+- Do not ship fixed pixel widths that overflow 320px — use fluid flex/grid + tokens.
+- Do not render full-resolution 3D at uncapped DPR on mobile; cap quality and frame cost.
+- Do not reference any coin other than `$THREE` in any responsive copy or fallback.
+
+## Acceptance (all true before claiming done)
+
+- [ ] Home, forge, marketplace, wallet, and a create flow work at 320 / 768 / 1440 with
+ no horizontal scroll and no clipped content.
+- [ ] Every primary page has correct, zoom-enabled viewport meta.
+- [ ] All touch targets are ≥44px with safe spacing; nav drawer opens/closes/locks scroll.
+- [ ] Mobile CTAs stay reachable above the keyboard; inputs use correct `inputmode`/`type`.
+- [ ] 3D canvases cap DPR and run smoothly on a throttled mobile profile; resize on rotate.
+- [ ] `npm run snapshot` captures look correct across widths; `npm test` passes.
+- [ ] Changelog updated and `npm run build:pages` is clean.
diff --git a/prompts/samples/12-every-state-designed.md b/prompts/samples/12-every-state-designed.md
new file mode 100644
index 000000000..3e683699f
--- /dev/null
+++ b/prompts/samples/12-every-state-designed.md
@@ -0,0 +1,86 @@
+# 12 — Every state designed (loading / empty / error / overflow)
+
+> Part of the three.ws "Production → $1B" program. Run in a fresh chat. Read
+> `/CLAUDE.md` first (its rules override everything) and `prompts/production-1b/00-README.md`
+> for shared context.
+
+## Why this matters for $1B
+
+The difference between a toy and a product is what happens when there's no data, the
+network fails, or a name is 80 characters long. A blank void on first load reads as
+broken; an unstyled error reads as abandoned; an empty marketplace with no call to
+action loses the user who would have created the first listing. A $1B platform designs
+every state so the user is never confused, stuck, or staring at nothing.
+
+## Mission
+
+Audit every list, grid, feed, and detail view and ensure all four states are
+deliberately designed: **loading** (skeletons over spinners), **empty** (actionable —
+tells the user what to do next), **error** (recoverable with retry), and **overflow**
+(0 / 1 / 1000 items, very long names, missing thumbnails).
+
+## Map (trust but verify — files move)
+
+- **Data-driven surfaces** — `src/` modules that fetch then render lists/grids/feeds.
+ Grep for `fetch(`, `innerHTML =`, `.map(`, `appendChild` in `src/` to find render
+ paths. High-value targets: marketplace, agent profiles/feed, forge gallery/results,
+ wallet/transactions, launches feed, changelog, notifications.
+- **Forge result states (gold standard reference)** — see
+ [prompts/production-1b/15-forge-text-to-3d-pipeline.md](./15-forge-text-to-3d-pipeline.md):
+ every phase labeled, real elapsed time, no fake `setTimeout` bars. Match that bar.
+- **Shared styles for states** — [public/tokens.css](../../public/tokens.css) (spacing,
+ surfaces, motion for skeleton shimmer). Reuse existing skeleton/empty-state CSS where
+ present (grep `skeleton` / `empty-state` across `public/*.css`); establish a shared
+ pattern where missing.
+- **Pages hosting these views** — [pages/](../../pages) (marketplace, agent-detail,
+ forge, wallet, launches, etc.).
+- **APIs feeding them** — [api/](../../api) handlers (to reproduce error/empty responses
+ for testing). Tests live in [tests/](../../tests).
+
+## Do this
+
+1. **Inventory.** Build a checklist of every list/grid/feed/detail view across `src/`.
+ For each, record where its data comes from and which of the four states currently
+ exist vs. are missing.
+2. **Loading = skeletons.** Replace bare spinners and blank gaps with skeleton screens
+ that match the final layout (so there's no shift when data arrives). No fake progress
+ bars — drive UI off real request lifecycle.
+3. **Empty = actionable.** Each empty state explains why it's empty and gives the next
+ action with a working CTA (e.g. "No agents yet — create your first" → links to the
+ create flow). Never a bare "No data." Design a reusable empty-state component if one
+ doesn't exist.
+4. **Error = recoverable.** On fetch failure, show a designed error with a plain-language
+ message and a **Retry** that re-runs the request. Never leak raw stack traces, vendor
+ billing/quota text, or provider URLs — keep raw detail in logs, show neutral copy.
+5. **Overflow & edge counts.** Verify each view at **0**, **1**, and **~1000** items:
+ pagination/virtualization or "load more" for large lists; sensible single-item layout;
+ no jank. Truncate long names with ellipsis + full value on hover/`title`; wrap long
+ descriptions; provide a fallback for missing/broken thumbnails.
+6. **Reproduce each state in the browser.** `npm run dev` and force every state: throttle
+ to Offline for error, point at an empty account for empty, paste a long name, and load
+ a large feed. Confirm each is designed and reachable — no dead states.
+7. **Wire the failsafes.** Per `/CLAUDE.md`, errors are handled at boundaries (network /
+ user input) with working fallbacks; internal code trusts itself. Make sure a failed
+ sub-request degrades that section gracefully instead of blanking the whole page.
+8. **Test & ship.** Add/extend tests asserting empty and error rendering for at least the
+ marketplace and one feed (component or Playwright). `npm test`. Add a changelog entry
+ for the user-visible polish; `npm run build:pages`.
+
+## Must-not
+
+- Do not ship a bare spinner where a skeleton matching the layout belongs.
+- Do not leave a "No data" / blank empty state with no next action.
+- Do not surface raw errors, stack traces, or vendor billing/quota text to users.
+- Do not let one failed sub-request blank the entire page — degrade the section only.
+- Do not use fake `setTimeout` loading; drive states off the real request lifecycle.
+- Do not reference any coin other than `$THREE` in any state copy.
+
+## Acceptance (all true before claiming done)
+
+- [ ] Every list/grid/feed/detail view has designed loading, empty, error, and overflow states.
+- [ ] Loading uses skeletons matching final layout; no layout shift on data arrival; no fake bars.
+- [ ] Empty states are actionable with a working CTA; error states have a working Retry.
+- [ ] 0 / 1 / 1000 items, long names, and missing thumbnails all render cleanly.
+- [ ] No raw errors or vendor internals reach users; failures degrade per-section.
+- [ ] Each state reproduced in a real browser; tests cover empty + error for key views.
+- [ ] `npm test` passes; changelog updated and `npm run build:pages` is clean.
diff --git a/prompts/samples/13-design-system-consistency.md b/prompts/samples/13-design-system-consistency.md
new file mode 100644
index 000000000..08646aec0
--- /dev/null
+++ b/prompts/samples/13-design-system-consistency.md
@@ -0,0 +1,89 @@
+# 13 — Design-system consistency (tokens, spacing, typography, theming)
+
+> Part of the three.ws "Production → $1B" program. Run in a fresh chat. Read
+> `/CLAUDE.md` first (its rules override everything) and `prompts/production-1b/00-README.md`
+> for shared context.
+
+## Why this matters for $1B
+
+Consistency is what makes a platform feel like one product instead of forty pages glued
+together. When spacing, type, color, and interaction states come from a single
+vocabulary, every new surface inherits quality for free and the brand reads as
+trustworthy. Drift — a one-off hex here, a magic `13px` there, a button with no focus
+state — is the visual equivalent of bugs. A $1B platform speaks one design language
+everywhere, in both light and dark.
+
+## Mission
+
+Unify the platform on the canonical design tokens: every surface references shared
+spacing, type, color, radius, and motion tokens; every interactive element has hover /
+active / focus states; light and dark themes are correct everywhere; and no surface
+reintroduces a parallel palette.
+
+## Map (trust but verify — files move)
+
+- **Canonical tokens (single source of truth)** — [public/tokens.css](../../public/tokens.css)
+ (φ-based spacing scale, type ladder, surfaces, ink, stroke, radius, shadow, blur,
+ motion, `--focus-ring-color`) and [DESIGN-TOKENS.md](../../DESIGN-TOKENS.md) (vocabulary
+ + migration guidance). Per-surface palettes (`--mk-*`, `--pd-*`, `--ibm-*`, …) were
+ **removed in B02** — do not reintroduce; a surface accent REMAPS these tokens.
+- **Token loading** — imported by [public/style.css](../../public/style.css) and
+ [public/nav.css](../../public/nav.css) so tokens reach full-stylesheet pages and
+ nav-only/embed surfaces. New pages just link one of those.
+- **Theming (no-flash boot + runtime)** — [scripts/inject-theme-boot.mjs](../../scripts/inject-theme-boot.mjs)
+ (pre-paint `data-theme` apply; key `twx_theme`), [public/theme-switcher.js](../../public/theme-switcher.js)
+ (toggle, persistence, cross-tab sync), the nav toggle in [public/nav.js](../../public/nav.js).
+- **Per-surface stylesheets** — [public/](../../public) `*.css` (~many). These are where
+ drift hides: hardcoded hex/rgba/px, ad-hoc spacing, missing `:focus-visible`. Existing
+ focus styles in [public/buttons.css](../../public/buttons.css), [public/home.css](../../public/home.css),
+ [public/home-polish.css](../../public/home-polish.css) — extend, don't fork.
+
+## Do this
+
+1. **Read the vocabulary.** Read `DESIGN-TOKENS.md` and `tokens.css` end to end so you
+ use the real token names (`var(--space-md)`, `var(--surface-1)`, `var(--text-sm)`,
+ `--focus-ring-color`, motion tokens). Do not invent new names where one exists.
+2. **Find the drift.** Grep `public/*.css` and inline `src/`/`pages/` styles for
+ hardcoded color (`#`, `rgb(`, `rgba(`, `hsl(`) and raw pixel spacing/sizing that an
+ existing token already expresses. Build a list of offenders by file.
+3. **Migrate to tokens.** Replace each hardcoded value with the nearest correct token
+ (color → surface/ink/stroke token; spacing/size → φ scale; font sizes → type ladder;
+ radii/shadows/blur/motion → their tokens). If a genuinely new primitive is needed, add
+ it once to `tokens.css` and document it in `DESIGN-TOKENS.md`, then use it everywhere.
+4. **Kill parallel palettes.** If any reintroduced `--mk-*`/`--pd-*`/`--ibm-*`-style
+ namespace or standalone color set exists, collapse it into a thin theme layer that
+ remaps the canonical tokens. One palette, not eight.
+5. **Interaction states everywhere.** Every interactive element (buttons, links, chips,
+ tabs, cards, inputs) has consistent **hover**, **active**, and **`:focus-visible`**
+ states drawn from tokens — using the shared focus ring, not ad-hoc outlines. Audit for
+ controls missing any of the three.
+6. **Verify both themes.** `npm run dev`, toggle light/dark via the nav switch on home,
+ forge, marketplace, wallet, and a settings/dashboard page. Confirm no unreadable
+ contrast, no token that only works in one theme, and no flash on reload (theme-boot
+ working). Run `node scripts/inject-theme-boot.mjs` (dry run) to confirm every real page
+ carries the boot.
+7. **Typography & spacing rhythm.** Confirm headings, body, and labels map to the type
+ ladder and that section/card padding uses the spacing scale — fix one-off rhythm that
+ breaks the φ system.
+8. **Lock it & ship.** Run `npm run build:pages`, `npm run audit:web`, and `npm test`;
+ re-grep to confirm the hardcoded-value count dropped (ideally to zero on touched
+ files). Add a changelog entry for the visible consistency pass; `npm run build:pages`.
+
+## Must-not
+
+- Do not reintroduce a parallel per-surface palette — remap canonical tokens instead.
+- Do not hardcode a hex/rgba/px that an existing token already expresses.
+- Do not invent a new token name when one exists; only add to `tokens.css` for a genuinely
+ new primitive, and document it.
+- Do not ship an interactive element missing hover/active/`:focus-visible`.
+- Do not break the no-flash theme boot or leave a token that fails in one theme.
+
+## Acceptance (all true before claiming done)
+
+- [ ] Touched surfaces reference tokens; hardcoded hex/rgba/raw-px count dropped (zero where feasible).
+- [ ] No parallel palette remains; surface accents are thin remaps of canonical tokens.
+- [ ] Every interactive element has consistent hover, active, and `:focus-visible` states from tokens.
+- [ ] Light and dark themes are correct on home, forge, marketplace, wallet, and a dashboard page; no flash.
+- [ ] Typography and spacing map to the type ladder and φ spacing scale; any new token documented in `DESIGN-TOKENS.md`.
+- [ ] `npm run audit:web` and `npm test` pass.
+- [ ] Changelog updated and `npm run build:pages` is clean.
diff --git a/prompts/samples/14-seo-structured-data.md b/prompts/samples/14-seo-structured-data.md
new file mode 100644
index 000000000..b90c04ad0
--- /dev/null
+++ b/prompts/samples/14-seo-structured-data.md
@@ -0,0 +1,90 @@
+# 14 — SEO & structured data
+
+> Part of the three.ws "Production → $1B" program. Run in a fresh chat. Read
+> `/CLAUDE.md` first (its rules override everything) and `prompts/production-1b/00-README.md`
+> for shared context.
+
+## Why this matters for $1B
+
+Organic search and well-formed link previews are the cheapest, most durable growth
+channel a platform has. Unique titles and descriptions win impressions; Open Graph and
+Twitter cards turn every shared link into an ad; JSON-LD structured data earns rich
+results; canonicals and a clean sitemap keep crawlers efficient. With ~125 pages, the
+compounding cost of missing or duplicate metadata is enormous — and increasingly,
+LLM-driven discovery reads `llms.txt`. A $1B platform is fully indexable and previews
+beautifully everywhere.
+
+## Mission
+
+Ensure every canonical, indexable page has a unique title and meta description, correct
+Open Graph + Twitter cards, valid JSON-LD, a self-referencing canonical, and that the
+sitemap, robots, and llms.txt all reflect reality — leaning on the existing injection
+tooling rather than hand-editing 125 files.
+
+## Map (trust but verify — files move)
+
+- **SEO injectors (the engine — use these)** — [scripts/inject-seo-meta.mjs](../../scripts/inject-seo-meta.mjs)
+ (idempotently backfills `<title>`, description, canonical, OG/Twitter, WebPage/WebSite
+ JSON-LD; never overwrites existing tags; re-points stale static OG images at
+ `/api/page-og`), [scripts/inject-blog-seo.mjs](../../scripts/inject-blog-seo.mjs) (blog
+ posts). Run via `npm run seo:meta`.
+- **Catalog (single source of copy)** — [data/pages.json](../../data/pages.json) feeds
+ the injector, sitemap, and llms.txt. Titles/descriptions live here — edit copy here, not
+ in 125 HTML heads.
+- **Page index build** — `npm run build:pages` ([scripts/build-page-index.mjs](../../scripts/build-page-index.mjs)),
+ audited by [scripts/audit-page-index.mjs](../../scripts/audit-page-index.mjs) (`npm run audit:pages`).
+- **Discovery surfaces** — [public/sitemap/index.html](../../public/sitemap/index.html)
+ (human sitemap), [public/robots.txt](../../public/robots.txt),
+ [public/llms.txt](../../public/llms.txt) + [public/llms-full.txt](../../public/llms-full.txt).
+- **Dynamic OG cards** — `/api/page-og` (per-page social image) referenced by the injector.
+- **Routing (route → file resolution)** — [vercel.json](../../vercel.json) `routes` table,
+ which the injector uses to map a route to its HTML file.
+
+## Do this
+
+1. **Coverage scan.** `npm run seo:meta` in dry-run (read the script's flags) to see which
+ pages are missing title / description / canonical / OG / Twitter / JSON-LD. Cross-check
+ counts: grep `pages/*.html` for `rel="canonical"`, `og:title`, `application/ld+json` and
+ compare against the indexable page count to find the gaps.
+2. **Fix copy at the source.** For every indexable page, ensure `data/pages.json` has a
+ **unique**, descriptive title (≤ ~60 chars) and meta description (~120–160 chars) — no
+ duplicates, no boilerplate, real human language describing that page's value. This is
+ where you edit copy.
+3. **Inject.** Run `npm run seo:meta` (write mode) to backfill title, description,
+ canonical, OG, Twitter, and WebPage/WebSite JSON-LD across pages. Confirm it filled gaps
+ without clobbering hand-authored tags.
+4. **Richer structured data where it earns rich results.** Beyond WebPage/WebSite, add the
+ correct schema.org type to high-value templates: `BreadcrumbList` on nested pages,
+ `Product`/`Offer` on marketplace listings, `Article`/`BlogPosting` on blog posts,
+ `SoftwareApplication`/`Organization` where appropriate. Validate every block.
+5. **Canonicals & duplicates.** Every page self-references a canonical absolute URL;
+ collapse duplicate/parameterized routes onto one canonical. Ensure non-indexable surfaces
+ (embeds, widgets, kiosk) are `noindex` and excluded from the sitemap.
+6. **Sitemap, robots, llms.** Regenerate via `npm run build:pages` so the sitemap matches
+ the live page set; verify `robots.txt` points to the sitemap and doesn't block indexable
+ routes; confirm `llms.txt` / `llms-full.txt` reflect current pages and product framing.
+7. **Validate previews & markup.** Validate JSON-LD (Google Rich Results / Schema.org
+ validator) on a sample of each template; check OG/Twitter previews resolve (per-page
+ `/api/page-og` image renders, not a single static fallback). `npm run dev` and spot-check
+ `<head>` on home, forge, marketplace, a blog post, and an agent profile.
+8. **Verify & ship.** Run `npm run audit:pages` (strict) and `npm test`. Add a changelog
+ entry if the SEO improvements are user-visible (e.g. share-preview cards); `npm run build:pages`.
+
+## Must-not
+
+- Do not duplicate titles/descriptions across pages — each must be unique and descriptive.
+- Do not hand-edit metadata into 125 HTML heads — edit `data/pages.json` and run the injector.
+- Do not let the injector overwrite a page's existing hand-authored tags.
+- Do not index embed/widget/kiosk surfaces or list them in the sitemap.
+- Do not ship invalid JSON-LD; validate every block before claiming done.
+- Do not reference any coin other than `$THREE` in any title, description, or structured data.
+
+## Acceptance (all true before claiming done)
+
+- [ ] Every indexable page has a unique, descriptive title and meta description (no duplicates).
+- [ ] Every indexable page has a self-referencing canonical, OG + Twitter cards, and valid JSON-LD.
+- [ ] High-value templates carry the right schema type (Product/Article/Breadcrumb/etc.), all validated.
+- [ ] Per-page `/api/page-og` social images render (no single static fallback on shared links).
+- [ ] Sitemap matches the live page set; robots points to it; llms.txt/llms-full.txt are current.
+- [ ] Non-indexable surfaces are `noindex` and excluded from the sitemap.
+- [ ] `npm run audit:pages` (strict) and `npm test` pass; changelog updated and `npm run build:pages` is clean.
diff --git a/prompts/samples/15-forge-text-to-3d-pipeline.md b/prompts/samples/15-forge-text-to-3d-pipeline.md
new file mode 100644
index 000000000..d8ebe5b10
--- /dev/null
+++ b/prompts/samples/15-forge-text-to-3d-pipeline.md
@@ -0,0 +1,86 @@
+# 15 — Forge / Text→3D / Avatar generation pipeline (production-grade, end-to-end)
+
+> Part of the three.ws "Production → $1B" program. Run in a fresh chat. Read
+> `/CLAUDE.md` first (its rules override everything) and `prompts/production-1b/00-README.md`
+> for shared context.
+
+## Why this matters for $1B
+
+The Forge is the platform's front door: "describe it → get a 3D thing" is the demo
+that makes people screenshot and share. If text→3D, selfie→avatar, or prompt→avatar
+ever shows a spinner that never resolves, a raw vendor error, or a T-posed mesh, the
+core promise breaks and acquisition dies at the first touch. This surface must feel
+instant, never dead-end, and never leak provider internals.
+
+## Mission
+
+Make every generation path — text→3D object, text→avatar, selfie→avatar, image→3D —
+correct, resilient, and beautifully stated in every phase, with the **free NVIDIA NIM
+lane primary** and paid lanes as silent backstops the user never sees billing for.
+
+## Map (trust but verify — files move)
+
+- **Forge UI** — [src/forge.js](../../src/forge.js), [pages/forge.html](../../pages/forge.html),
+ [src/forge-showcase.js](../../src/forge-showcase.js), [src/home-forge.js](../../src/home-forge.js).
+- **Prompt→avatar UI** — [src/create-prompt.js](../../src/create-prompt.js),
+ [pages/create-prompt.html](../../pages/create-prompt.html). Selfie flow:
+ `/create/selfie`.
+- **Text→image (provider chain)** — [api/_mcp3d/text-to-image.js](../../api/_mcp3d/text-to-image.js).
+ Free-first cascade: **NVIDIA NIM FLUX → Vertex Imagen → Replicate (paid backstop)**.
+- **Reconstruct + auto-rig** — [api/avatars/_actions.js](../../api/avatars/_actions.js)
+ (`handleReconstruct`), [api/_lib/reconstruct-finalize.js](../../api/_lib/reconstruct-finalize.js),
+ [api/_lib/regen-provider.js](../../api/_lib/regen-provider.js), [api/_lib/auto-rig.js](../../api/_lib/auto-rig.js).
+- **Backends & tiers** — [api/_lib/forge-tiers.js](../../api/_lib/forge-tiers.js),
+ [api/_lib/forge-health.js](../../api/_lib/forge-health.js) (`GET /api/forge?health`),
+ [api/forge.js](../../api/forge.js). Model workers in [workers/](../../workers):
+ `model-trellis`, `model-hunyuan3d`, `unirig`, `longcat`.
+- **Tests** — [tests/api/text-to-image.test.js](../../tests/api/text-to-image.test.js),
+ `tests/api/forge-free-first.test.js`, `tests/api/forge-fallback.test.js`,
+ `tests/api/forge-health.test.js`, `tests/api/reconstruct-finalize.test.js`,
+ `tests/forge-avatar-humanoid.test.js`.
+
+## Do this
+
+1. **Exercise every lane in a real browser** (`npm run dev`): text→3D object, prompt→avatar,
+ selfie→avatar. Watch the Network tab and console. Confirm the free NIM lane serves
+ first (`/api/forge?health` shows `nvidia: ok`).
+2. **No provider internals ever reach the user.** Audit every error path in the chain
+ above: billing/credit/quota messages, raw stack traces, and vendor URLs must be
+ masked to neutral, actionable copy. Keep raw detail in server logs only.
+3. **Every phase is designed:** reference-image render, reconstruct, rig — each with a
+ live label, real elapsed time, and a skeleton/progress affordance (not a fake
+ `setTimeout` bar). Empty state tells the user what to type; error state says what
+ to do next.
+4. **Resilience:** a hung or throttled free lane must hand off to the next lane within
+ a tight timeout, never stall the pipeline. Verify the cascade with the existing
+ fallback tests; add cover for any uncovered failure mode (timeout, 402, 429, NSFW,
+ no-face, OOM).
+5. **Right page for the input:** plain objects belong on Text→3D; humanoid prompts on
+ the avatar flow. Make the routing/affordances obvious so users don't land a "box"
+ on the face pipeline.
+6. **Rig quality:** confirm generated humanoids drive the canonical clip library (no
+ T-pose fallback unless genuinely non-humanoid, per the `/CLAUDE.md` avatar rule).
+7. **Result handling:** every finished model has a working viewer, a real thumbnail
+ (not a 1px snapshot), correct "rigged/static" tagging, and natural next steps
+ (open in editor, make another, launch, walk).
+8. Run `npx vitest run tests/api/text-to-image.test.js tests/api/forge-*.test.js
+ tests/api/reconstruct-finalize.test.js` and the avatar humanoid test. Add a
+ changelog entry for any user-visible change; `npm run build:pages`.
+
+## Must-not
+
+- Do not surface any third party's billing page, credit balance, or raw error to a buyer.
+- Do not add a hardcoded rig allowlist — extend `glb-canonicalize.js` bone maps instead.
+- Do not ship a fake progress bar or a spinner with no timeout.
+- Do not reference any coin other than `$THREE`.
+
+## Acceptance (all true before claiming done)
+
+- [ ] Text→3D, prompt→avatar, and selfie→avatar all complete successfully in a real
+ browser with the free NIM lane primary; no console errors/warnings.
+- [ ] Every failure mode (402/429/timeout/NSFW/no-face/OOM/unconfigured) yields a
+ neutral, actionable message — no vendor internals, verified by tests.
+- [ ] Loading/empty/error/done states are all designed; elapsed time is real.
+- [ ] Generated humanoids are rigged and animate (no unjustified T-pose); thumbnails render.
+- [ ] All forge/text-to-image/reconstruct tests pass; new failure modes covered.
+- [ ] Changelog updated and `npm run build:pages` is clean.
diff --git a/prompts/samples/16-marketplace.md b/prompts/samples/16-marketplace.md
new file mode 100644
index 000000000..87b5bee46
--- /dev/null
+++ b/prompts/samples/16-marketplace.md
@@ -0,0 +1,131 @@
+# 16 — Marketplace (buy, sell & remix)
+
+> Part of the three.ws "Production → $1B" program. Run in a fresh chat. Read
+> `/CLAUDE.md` first (its rules override everything) and `prompts/production-1b/00-README.md`
+> for shared context.
+
+## Why this matters for $1B
+
+The marketplace is where the platform's flywheel becomes a business: creators list
+agents, avatars, skills and animations; buyers discover, try, and pay; remixers fork
+and re-list. If discovery is slow, a buy silently fails, a "fork" lands on a broken
+page, or a listing shows a 1px thumbnail, the supply side stops creating and the demand
+side stops paying — and the GMV that justifies a $1B valuation never accrues. This
+surface must feel like Vercel's template gallery crossed with Stripe-grade checkout.
+
+## Mission
+
+Make the full marketplace loop — list → browse/search/sort/filter → detail → buy/sell/remix
+→ settled payment → linked profile — correct, fast, and beautifully stated in every state,
+with real USDC settlement and zero dead paths.
+
+## Map (trust but verify — files move)
+
+- **List + detail controller (SPA)** — [src/marketplace.js](../../src/marketplace.js)
+ (list view with category sidebar + search; detail with 5 tabs; path routing
+ `/marketplace` and `/marketplace/agents/:id`), [src/marketplace-detail.js](../../src/marketplace-detail.js)
+ (3D avatar in header, live "try before you fork" SSE chat preview, creator modal,
+ mobile sidebar), [pages/marketplace.html](../../pages/marketplace.html) (loads
+ `/src/marketplace.js`; route `/marketplace` in [vercel.json](../../vercel.json)).
+- **Lobby / detail-market helpers** — [src/marketplace-lobby.js](../../src/marketplace-lobby.js),
+ [src/agent-detail-market.js](../../src/agent-detail-market.js).
+- **Analytics surface** — [src/marketplace-analytics.js](../../src/marketplace-analytics.js),
+ [pages/marketplace-analytics.html](../../pages/marketplace-analytics.html),
+ [api/marketplace/analytics.js](../../api/marketplace/analytics.js).
+- **Marketplace API** — [api/marketplace/[action].js](../../api/marketplace/[action].js)
+ (categories, agents list `?category=&q=&sort=&cursor=&pricing=`, create/mine/detail/versions/similar/fork/bookmark/publish/view),
+ [api/marketplace/purchase.js](../../api/marketplace/purchase.js),
+ [api/marketplace/purchase-as-agent.js](../../api/marketplace/purchase-as-agent.js),
+ [api/marketplace/purchase-bundle.js](../../api/marketplace/purchase-bundle.js),
+ [api/marketplace/buy-asset.js](../../api/marketplace/buy-asset.js),
+ [api/marketplace/asset-price.js](../../api/marketplace/asset-price.js),
+ [api/marketplace/set-skill-price.js](../../api/marketplace/set-skill-price.js),
+ [api/marketplace/reviews.js](../../api/marketplace/reviews.js),
+ [api/marketplace/start-trial.js](../../api/marketplace/start-trial.js),
+ [api/marketplace/animations.js](../../api/marketplace/animations.js),
+ [api/marketplace/check-skill-access.js](../../api/marketplace/check-skill-access.js).
+- **Cross-links** — agent profiles via [src/shared/agent-3d.js](../../src/shared/agent-3d.js)
+ (`seeInWorldHref`, `hasCustomAvatar`), `/agents/:id` ([pages/agent-detail.html](../../pages/agent-detail.html)),
+ avatar/animation galleries ([pages/animations.html](../../pages/animations.html),
+ [api/avatars/](../../api/avatars)). Shared state kit:
+ [src/shared/state-kit.js](../../src/shared/state-kit.js) (skeleton/empty/error),
+ [src/shared/list-controls.js](../../src/shared/list-controls.js) (`debounce`, `syncStateToUrl`).
+- **Payments** — settlement runs through the x402 + agent-wallet plumbing in
+ [api/_lib/](../../api/_lib) (see prompt `18`). Platform fee logic is exercised by
+ [tests/marketplace-platform-fee.test.js](../../tests/marketplace-platform-fee.test.js).
+- **Tests** — [tests/marketplace-agent-detail-prices.test.js](../../tests/marketplace-agent-detail-prices.test.js),
+ [tests/marketplace-agent-detail-subscriptions.test.js](../../tests/marketplace-agent-detail-subscriptions.test.js),
+ [tests/marketplace-animations.test.js](../../tests/marketplace-animations.test.js),
+ [tests/marketplace-platform-fee.test.js](../../tests/marketplace-platform-fee.test.js).
+
+## Do this
+
+1. **Exercise the whole loop in a real browser** (`npm run dev`, port 3000): open
+ `/marketplace`, browse, search, switch categories, change sort, filter by pricing,
+ open a detail page, run the live chat preview, fork an agent, and buy a paid skill.
+ Watch the Network tab — every call (`/api/marketplace/...`) must return real data,
+ 200/4xx with intent, never a silent hang.
+2. **Design every list state:** skeleton on load (use `state-kit.js`), helpful empty
+ state for "no results in this category / no matches for this query" (offer a reset
+ action — don't show a void), an error state with retry, and overflow handling for
+ 1000+ listings (cursor pagination via `?cursor=`, not a giant DOM). Persist
+ search/sort/filter to the URL with `syncStateToUrl` so results are shareable and
+ back-button-safe; debounce the search input.
+3. **Sort + filter must actually work end-to-end.** Confirm each `sort` value and the
+ `pricing` filter map to real SQL ordering/filtering in `[action].js` (not a no-op).
+ If a control renders but does nothing, wire it or remove it — no dead controls.
+4. **Detail view is complete:** real 3D avatar in the header (not an emoji placeholder),
+ working tabs, accurate pricing (one-time / subscription / time-pass), reviews
+ ([reviews.js](../../api/marketplace/reviews.js)), version history, "similar" agents,
+ and a creator modal that lists the author's other agents and avatars. Every link
+ resolves to a live page; every CTA does something.
+5. **Buy/sell/remix flows settle for real:** a purchase posts to `purchase.js` /
+ `buy-asset.js` / `purchase-bundle.js`, returns a real receipt, and grants access
+ (verify with `check-skill-access.js`). A "fork" creates a real editable copy and
+ routes the user to it. Selling: a creator can set a price (`set-skill-price.js`,
+ `asset-price.js`) and see it reflected in the listing. Never fake a success toast
+ without a settled transaction.
+6. **Payment failure is designed, not leaked:** insufficient funds, declined, network
+ timeout, and idempotent retry all yield neutral, actionable copy and never surface a
+ provider's billing page or a raw stack trace. Reuse the x402 error helpers from
+ prompt `18`. A second click on "buy" must not double-charge.
+7. **Cross-pollinate the platform:** every listing links to the agent's public profile
+ (`/agents/:id`), to "see in world", and to the avatar/animation gallery where
+ relevant. A bought animation should be usable in the editor; a forked agent should
+ open in Agent Studio. Wire these connections — a marketplace that doesn't link out
+ is half-built.
+8. **Accessibility + microinteractions:** category sidebar is keyboard-navigable, every
+ card/button has hover/active/focus states, the mobile hamburger sidebar traps focus,
+ and `pricing`/`sort` controls are labeled. Test mentally at 320 / 768 / 1440.
+9. **Run the tests and ship the changelog:** `npx vitest run tests/marketplace-*.test.js`.
+ Add a `data/changelog.json` entry for any user-visible change, then `npm run
+ build:pages` (it validates the entry).
+
+## Must-not
+
+- Do not show a fake success state, a fake progress bar, or a toast without a settled
+ on-chain/x402 transaction.
+- Do not leak any third party's billing page, credit balance, or raw error to a buyer —
+ mask to neutral copy; keep detail in server logs.
+- Do not reference, list, or recommend any coin other than `$THREE` (CA
+ `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). Runtime launch records the user
+ created are fine; hardcoded mints are not.
+- Do not leave dead controls (a sort/filter/tab/button that renders but does nothing).
+- Do not break the existing detail SPA routing, the SSE chat preview, or the platform-fee math.
+- No mocks, no sample-listing arrays shipped to production, no TODOs.
+
+## Acceptance (all true before claiming done)
+
+- [ ] List, search, sort, filter, detail, buy, sell, fork all work in a real browser
+ with real `/api/marketplace/*` calls; no console errors or warnings.
+- [ ] Loading (skeleton), empty (with reset CTA), error (with retry), populated, and
+ 1000+-item overflow (cursor pagination) states are all designed.
+- [ ] Search/sort/filter persist to the URL and survive a refresh and back button.
+- [ ] A purchase settles real USDC, returns a receipt, grants access; a second click
+ does not double-charge; failures show neutral, actionable copy with no vendor internals.
+- [ ] Detail header shows a real 3D avatar + real thumbnail; every link/CTA resolves
+ to a live page (profile, see-in-world, editor, gallery).
+- [ ] Every interactive element has hover/active/focus states; layout holds at 320/768/1440;
+ keyboard navigation works.
+- [ ] `npx vitest run tests/marketplace-*.test.js` passes.
+- [ ] Changelog updated and `npm run build:pages` is clean.
diff --git a/prompts/samples/17-agent-profiles-studio-economy.md b/prompts/samples/17-agent-profiles-studio-economy.md
new file mode 100644
index 000000000..4e6e8bb59
--- /dev/null
+++ b/prompts/samples/17-agent-profiles-studio-economy.md
@@ -0,0 +1,142 @@
+# 17 — Agent profiles, Agent Studio & economy
+
+> Part of the three.ws "Production → $1B" program. Run in a fresh chat. Read
+> `/CLAUDE.md` first (its rules override everything) and `prompts/production-1b/00-README.md`
+> for shared context.
+
+## Why this matters for $1B
+
+An agent is the platform's atomic unit of value: people create one, give it a brain,
+memory, body, money, and skills, publish a profile, build reputation, and let it earn
+and delegate. If the creation wizard dead-ends, the Studio shows a "mounts here"
+placeholder, a public profile 404s, or reputation is decorative, the supply side never
+compounds and there's no economy to scale. The best version feels like Linear's polish
+applied to "spin up an autonomous, earning, on-chain agent."
+
+## Mission
+
+Make the full agent lifecycle — create → configure (Brain · Memory · Body · Money ·
+Skills, with a live avatar) → publish profile → earn reputation → appear in the activity
+feed → delegate to other agents — complete, wired, and every state designed.
+
+## Map (trust but verify — files move)
+
+- **Creation wizard** — [src/create-agent.js](../../src/create-agent.js) (5 steps:
+ basics → 3D model → skills → personality → review; writes through `/api/agents` and
+ `/api/marketplace/agents/:id/publish`), [pages/create-agent.html](../../pages/create-agent.html)
+ (route `/create-agent`).
+- **Agent Studio (Brain/Memory/Body/Money/Skills)** — [pages/agent-studio.html](../../pages/agent-studio.html)
+ (route `/agent-studio`; loads [src/studio/studio-shell.js](../../src/studio/studio-shell.js)
+ which defines the five tabs + empty "mounts here" states),
+ [src/studio/brain/](../../src/studio/brain) (`brain-mount.js`, `brain-studio.js`,
+ `brain-graph.js`, `brain-compile.js`, `brain-runtime.js`, `brain-templates.js`,
+ `brain-nodes.js`), [src/studio/memory/](../../src/studio/memory) (`memory-mount.js`,
+ `memory-studio.js`, `memory-graph.js`, `memory-client.js`),
+ [src/studio/agent-studio-store.js](../../src/studio/agent-studio-store.js),
+ [src/studio/agent-presence.js](../../src/studio/agent-presence.js). Live avatar via
+ [src/agent-avatar.js](../../src/agent-avatar.js) / [src/shared/agent-3d.js](../../src/shared/agent-3d.js).
+ Note: **Brain and Memory mount real studios; Body, Money, and Skills currently render
+ placeholder empty states** in `studio-shell.js` — finish them.
+- **Launch/fees/knowledge studio (`/studio`)** — [public/studio/](../../public/studio)
+ (`studio.js`, `launch-panel.js`, `fees-panel.js`, `knowledge-panel.js`; route `/studio`).
+- **Public profiles** — [pages/profile.html](../../pages/profile.html) (route `/u/:name`),
+ [pages/agent-detail.html](../../pages/agent-detail.html) + [src/agent-detail.js](../../src/agent-detail.js)
+ + [src/agent-detail.css](../../src/agent-detail.css) (route `/agents/:id`),
+ [api/agents/public.js](../../api/agents/public.js), [api/agents/[id].js](../../api/agents/[id].js),
+ [api/agents/by-wallet.js](../../api/agents/by-wallet.js), [api/agents/featured.js](../../api/agents/featured.js).
+- **Economy** — [pages/agent-economy.html](../../pages/agent-economy.html) +
+ [src/agent-economy.js](../../src/agent-economy.js) (two 3D agents transacting real SOL;
+ route `/agent-economy`), [src/agent-skills.js](../../src/agent-skills.js) and the
+ `src/agent-skills-*.js` family, agent wallet via [src/agent-wallet.js](../../src/agent-wallet.js)
+ (see prompt `18`).
+- **ERC-8004 reputation** — on-chain registries in [contracts/src/](../../contracts/src)
+ (`IdentityRegistry.sol`, `ReputationRegistry.sol`, `ValidationRegistry.sol`),
+ [api/agents/8004/agent.js](../../api/agents/8004/agent.js), [api/agents/8004/search.js](../../api/agents/8004/search.js),
+ and the MCP `agent_reputation` tool. Onchain badge: [src/shared/onchain-badge.js](../../src/shared/onchain-badge.js).
+- **Agent-to-agent delegation** — [api/agents/a2a-call.js](../../api/agents/a2a-call.js),
+ [api/agents/a2a-mandate.js](../../api/agents/a2a-mandate.js),
+ [api/agents/a2a-paid.js](../../api/agents/a2a-paid.js),
+ [api/agents/a2a-cart-verify.js](../../api/agents/a2a-cart-verify.js),
+ [src/agent-skills-a2a.js](../../src/agent-skills-a2a.js).
+- **Tests** — [tests/agent-protocol.test.js](../../tests/agent-protocol.test.js),
+ [tests/agent-a2a-payments.test.js](../../tests/agent-a2a-payments.test.js),
+ [tests/api-agent-memory.test.js](../../tests/api-agent-memory.test.js),
+ [tests/brain-studio-compile.test.js](../../tests/brain-studio-compile.test.js),
+ [tests/studio-launch-panel.test.js](../../tests/studio-launch-panel.test.js),
+ [tests/studio-fees-panel.test.js](../../tests/studio-fees-panel.test.js),
+ [tests/agent-detail-avatar.test.js](../../tests/agent-detail-avatar.test.js).
+
+## Do this
+
+1. **Run the wizard end-to-end in a real browser** (`npm run dev`): `/create-agent`,
+ complete all 5 steps, attach a 3D model, pick skills, set personality, publish.
+ Confirm a real agent row is created via `/api/agents` and (if chosen) listed via the
+ marketplace publish endpoint. Watch the Network tab — no silent failures, every step
+ validates input before advancing.
+2. **Finish Agent Studio.** Brain and Memory mount real studios; **build Body, Money,
+ and Skills to the same bar** — replace the placeholder empty states in
+ `studio-shell.js` with real, wired panels: Body (attach/preview avatar, outfit,
+ animations driving the canonical clip library), Money (fund wallet, set per-skill
+ pricing, view payouts — reuse the wallet plumbing from prompt `18`), Skills
+ (toggle/configure capabilities, set what's sellable). A **live avatar preview**
+ reflects Body changes immediately. Persist via `agent-studio-store.js`.
+3. **Every Studio state is designed:** loading skeleton per tab, empty state that tells
+ the user what to do (not "mounts here"), error state with recovery, and a clear save
+ /dirty indicator. No tab may ship a dead placeholder.
+4. **Public profiles are complete and shareable:** `/u/:name` and `/agents/:id` render
+ the real 3D avatar, bio, skills, pricing, reputation, owned coins, and an **activity
+ feed** of real events (creations, sales, delegations, reputation changes). Design
+ loading/empty/error/overflow. Every CTA (talk, hire, see-in-world, fork, open in
+ studio) resolves to a live page. Profile OG images render.
+5. **ERC-8004 reputation is real, not decorative:** the onchain badge reflects actual
+ registry data (identity / reputation / validation) read via `api/agents/8004/*` and
+ the `agent_reputation` MCP tool. Show a designed state when an agent isn't yet
+ on-chain (with a path to register), and never a broken/empty badge.
+6. **Agent economy works for real:** on `/agent-economy`, the two agents transact real
+ SOL (existing pattern), balances poll live, the tx feed links to an explorer, and
+ failures (insufficient funds, RPC hiccup) show neutral, actionable copy with an
+ add-funds path. No fake particle "success" without a confirmed tx.
+7. **Agent-to-agent delegation is wired:** one agent can delegate a paid action to
+ another (`a2a-call` / `a2a-mandate` / `a2a-paid`) with spend caps respected,
+ idempotent settlement, and a result surfaced in the activity feed. Exercise the
+ delegation path and confirm it appears on both agents' profiles.
+8. **Cross-pollinate:** profile ↔ marketplace listing ↔ Agent Studio ↔ wallet ↔
+ economy must all link both directions. A user who lands on any one surface can reach
+ the others naturally. Audit for dead paths and unreachable states.
+9. **Accessibility + responsiveness:** wizard steps and Studio tabs are keyboard- and
+ screen-reader-navigable with focus management; layout holds at 320 / 768 / 1440;
+ every interactive element has hover/active/focus states.
+10. **Run the tests and ship the changelog:** `npx vitest run tests/agent-*.test.js
+ tests/studio-*.test.js tests/brain-studio-compile.test.js tests/api-agent-memory.test.js`.
+ Add a `data/changelog.json` entry for user-visible changes, then `npm run build:pages`.
+
+## Must-not
+
+- Do not leave Body, Money, or Skills as "mounts here" placeholders — finish them or
+ do not claim done.
+- Do not ship a decorative reputation badge — it must reflect real ERC-8004 registry data.
+- Do not fake economy/delegation success without a confirmed on-chain/x402 transaction.
+- Do not reference, list, or recommend any coin other than `$THREE` (CA
+ `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`); runtime user-launch records are fine.
+- Do not break the existing wizard write-through, the Brain/Memory studios, or the
+ custodial wallet flow.
+- No mocks, no fake activity-feed data, no TODOs, no T-pose fallback for humanoids
+ (extend `glb-canonicalize.js` bone maps, per `/CLAUDE.md`).
+
+## Acceptance (all true before claiming done)
+
+- [ ] The 5-step wizard creates a real agent and optionally publishes it; input is
+ validated at each step; no console errors/warnings.
+- [ ] Agent Studio Brain, Memory, Body, Money, and Skills tabs are all real and wired,
+ with a live avatar preview reacting to Body changes; each tab has designed
+ loading/empty/error states.
+- [ ] `/u/:name` and `/agents/:id` render real avatar + data + an activity feed of real
+ events; OG images render; every CTA resolves to a live page.
+- [ ] The onchain reputation badge reflects real ERC-8004 data and has a designed
+ not-yet-registered state.
+- [ ] Agent economy and a2a delegation settle real transactions with spend caps,
+ idempotency, and neutral failure copy; results show in the activity feed.
+- [ ] All listed surfaces link to each other (no dead paths); layout holds at
+ 320/768/1440; keyboard navigation works.
+- [ ] `npx vitest run tests/agent-*.test.js tests/studio-*.test.js tests/brain-studio-compile.test.js tests/api-agent-memory.test.js` passes.
+- [ ] Changelog updated and `npm run build:pages` is clean.
diff --git a/prompts/samples/18-wallet-x402-payments.md b/prompts/samples/18-wallet-x402-payments.md
new file mode 100644
index 000000000..4938c55a4
--- /dev/null
+++ b/prompts/samples/18-wallet-x402-payments.md
@@ -0,0 +1,148 @@
+# 18 — Wallet & x402 payments
+
+> Part of the three.ws "Production → $1B" program. Run in a fresh chat. Read
+> `/CLAUDE.md` first (its rules override everything) and `prompts/production-1b/00-README.md`
+> for shared context.
+
+## Why this matters for $1B
+
+Payments are the platform's bloodstream: every marketplace buy, paid skill call, agent
+delegation, and creator payout flows through the custodial agent wallet and the x402
+protocol. If a payment double-settles, an idempotency key collides, a custodial secret
+is mishandled, or a verify/settle silently fails, the platform loses money and trust —
+and trust is the only currency a payments business actually has. Stripe is the bar:
+correct to the cent, reconcilable, never leaks internal state, every failure recoverable.
+
+## Mission
+
+Make the agent wallet and the x402 paid-endpoint stack — custody, verify, settle,
+idempotency, USDC on Solana and Base, send/fund/trade/pay, Solana Pay, and reconciliation
+— provably correct, resilient, and beautifully stated in every state, end to end.
+
+## Map (trust but verify — files move)
+
+- **Custody** — [api/_lib/agent-wallet.js](../../api/_lib/agent-wallet.js)
+ (`generateSolanaAgentWallet`, `getOrCreateAgentSolanaWallet`, `getOrCreateAgentEvmWallet`,
+ `recoverAgentKey`, `delegatedSpend`, `triggerSkillPayment`, `getAgentBalance`,
+ `canAfford`), [api/_lib/secret-box.js](../../api/_lib/secret-box.js) (`encryptSecret`/
+ `decryptSecret`, `v2:` envelope), [api/_lib/solana-wallet.js](../../api/_lib/solana-wallet.js),
+ [api/_lib/avatar-wallet.js](../../api/_lib/avatar-wallet.js). Custody design doc:
+ [docs/internal/AGENT-WALLET-CUSTODY.md](../../docs/internal/AGENT-WALLET-CUSTODY.md) — **read it first.**
+- **x402 protocol core** — [api/_lib/x402-spec.js](../../api/_lib/x402-spec.js)
+ (version 2, network constants for Base/Arbitrum/BSC/Solana, permit2 variants),
+ [api/_lib/x402-paid-endpoint.js](../../api/_lib/x402-paid-endpoint.js) (`paidEndpoint(spec)`
+ wrapper), [api/_lib/x402/payment-identifier-server.js](../../api/_lib/x402/payment-identifier-server.js)
+ (idempotency), [api/_lib/x402-errors.js](../../api/_lib/x402-errors.js),
+ [api/_lib/x402-solana-confirm.js](../../api/_lib/x402-solana-confirm.js),
+ [api/_lib/evm-payment-verify.js](../../api/_lib/evm-payment-verify.js),
+ [api/_lib/x402-spending-cap.js](../../api/_lib/x402-spending-cap.js),
+ [api/_lib/x402-spending-ledger.js](../../api/_lib/x402-spending-ledger.js),
+ [api/_lib/x402-builder-code.js](../../api/_lib/x402-builder-code.js),
+ [api/_lib/x402-prices.js](../../api/_lib/x402-prices.js).
+- **Paid endpoints** — [api/x402/](../../api/x402) (e.g. `forge.js`, `skill-call.js`,
+ `skill-marketplace.js`, `pay-by-name.js`, `my-receipts.js`, `did.js`,
+ `agent-reputation.js`), [api/x402-pay.js](../../api/x402-pay.js),
+ [api/payments/solana/[action].js](../../api/payments/solana/[action].js),
+ [api/webhooks/solana-pay.js](../../api/webhooks/solana-pay.js) (Solana Pay).
+- **Wallet UI** — [pages/agent-wallet.html](../../pages/agent-wallet.html) (route
+ `/agents/:id/wallet`), [src/agent-wallet.js](../../src/agent-wallet.js),
+ [src/agent-wallet-hub/](../../src/agent-wallet-hub) (`index.js`, `registry.js`,
+ `tabs/` → `balance.js`, `deposit.js`, `withdraw.js`, `give.js`, `pay.js`, `trade.js`,
+ `snipe.js`, `vanity.js`), [src/agent-x402-pay.js](../../src/agent-x402-pay.js),
+ [src/payment-modal.js](../../src/payment-modal.js), [src/forge-pay.js](../../src/forge-pay.js),
+ [src/shared/add-funds.js](../../src/shared/add-funds.js),
+ [src/shared/payment-receipt.js](../../src/shared/payment-receipt.js).
+- **The /pay page** — [public/pay/index.html](../../public/pay/index.html) (route `/pay`).
+- **Skills (real, end-user)** — `authenticate-wallet`, `fund`, `send-usdc`, `trade`,
+ `pay-for-service` (USDC on Base/Polygon/Solana, send/fund/trade/x402 pay).
+- **SDKs** — [solana-agent-sdk/](../../solana-agent-sdk), [agent-payments-sdk/](../../agent-payments-sdk).
+- **Tests** — [tests/api/x402-paid-endpoint-replay.test.js](../../tests/api/x402-paid-endpoint-replay.test.js),
+ [tests/api/x402-payment-identifier.test.js](../../tests/api/x402-payment-identifier.test.js),
+ [tests/api/x402-spec.test.js](../../tests/api/x402-spec.test.js),
+ [tests/api/x402-security-fixes.test.js](../../tests/api/x402-security-fixes.test.js),
+ [tests/api/x402-pay-routing.test.js](../../tests/api/x402-pay-routing.test.js),
+ [tests/api/x402-gas-sponsoring.test.js](../../tests/api/x402-gas-sponsoring.test.js),
+ [tests/agent-custody-guards.test.js](../../tests/agent-custody-guards.test.js),
+ [tests/agent-wallet-pay-tab.test.js](../../tests/agent-wallet-pay-tab.test.js)
+ (and the `agent-wallet-*-tab` family), [tests/api/solana-wallet-balance.test.js](../../tests/api/solana-wallet-balance.test.js).
+
+## Do this
+
+1. **Read the custody doc first** ([docs/internal/AGENT-WALLET-CUSTODY.md](../../docs/internal/AGENT-WALLET-CUSTODY.md)),
+ then exercise the wallet in a real browser (`npm run dev`): open `/agents/:id/wallet`,
+ walk every tab — balance, deposit, withdraw, give, pay, trade — and the `/pay` page.
+ Watch the Network tab: every settlement is a real on-chain/x402 transaction with a
+ real signature, never a fake toast.
+2. **Custody safety:** confirm secrets are only ever stored encrypted (`secret-box.js`
+ `v2:` envelope) and decrypted in-memory at the moment of signing, never logged,
+ returned to the client, or persisted in plaintext. Verify `recoverAgentKey` audit
+ hooks fire. The custody guard tests must pass and cover the decrypt path.
+3. **Idempotency is bulletproof:** using `payment-identifier-server.js`, a replayed
+ payment payload or a double-clicked "pay" must settle exactly once and return the
+ original receipt — never double-charge, never error opaquely. Verify with the replay
+ and payment-identifier tests; add cover for any uncovered race (concurrent identical
+ requests).
+4. **Verify + settle on both chains:** confirm USDC payments verify and settle correctly
+ on **Solana** (`x402-solana-confirm.js`, the `solana:5eykt4...` mainnet constant) and
+ **Base** (`evm-payment-verify.js`, `eip155:8453`), including Solana Pay
+ (`api/webhooks/solana-pay.js`, `api/payments/solana/`). Spending caps
+ (`x402-spending-cap.js`) and the ledger (`x402-spending-ledger.js`) are enforced
+ before settlement.
+5. **send / fund / trade / pay all complete for real:** sending USDC, funding (on-ramp/
+ add-funds), trading, and paying an x402 endpoint each produce a confirmed transaction,
+ a real receipt (`payment-receipt.js`), and an updated balance. Insufficient funds
+ routes to a real add-funds path, not a dead error.
+6. **Every state is designed:** wallet loading skeleton, zero-balance empty state with a
+ clear fund CTA, pending-tx state with real status (not a fake spinner), confirmed
+ state with explorer link + receipt, and an error state that says what failed and how
+ to recover. Reconciliation: a tx that confirms on-chain but whose callback was lost
+ is reconciled (poll/webhook) so the UI and ledger never drift.
+7. **No provider internals leak:** RPC errors, gas/fee failures, throttling (429), and
+ declined payments are masked to neutral, actionable copy via `x402-errors.js`; raw
+ detail stays in server logs. Use the existing **cockatiel** resilience helper for
+ RPC retries/circuit-breaking — a single flaky RPC must not strand a payment.
+8. **Reliability + reconciliation pass:** confirm a retried RPC, a dropped webhook, and a
+ timed-out confirm all converge to a single correct ledger state with a re-fetchable
+ receipt (`api/x402/my-receipts.js`). No money is lost or double-counted under failure.
+9. **Accessibility + microinteractions:** wallet tabs are keyboard-navigable with focus
+ management, amounts use accessible inputs with validation, every action has
+ hover/active/focus/disabled states, and the layout holds at 320 / 768 / 1440.
+10. **Run the tests and ship the changelog:** `npx vitest run tests/api/x402-*.test.js
+ tests/agent-custody-guards.test.js tests/agent-wallet-*-tab.test.js
+ tests/api/solana-wallet-balance.test.js`. Add a `data/changelog.json` entry for any
+ user-visible change, then `npm run build:pages`.
+
+## Must-not
+
+- Never log, return to the client, or persist a wallet secret in plaintext; decrypt only
+ in-memory at signing time.
+- Never double-settle: a replayed or double-clicked payment must settle exactly once and
+ return the original receipt.
+- Never leak a provider's billing page, RPC internals, gas error, or raw stack trace to a
+ user — mask via `x402-errors.js`; keep detail in server logs.
+- Do not reference, list, or recommend any coin other than `$THREE` (CA
+ `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`); the only payment token here is USDC and
+ generic runtime-supplied mints.
+- Do not weaken or bypass spending caps, the spending ledger, or the idempotency layer to
+ "make it work."
+- No mocks of the RPC/x402 stack, no fake receipts, no fake balances, no TODOs.
+
+## Acceptance (all true before claiming done)
+
+- [ ] Every wallet tab (balance/deposit/withdraw/give/pay/trade) and the `/pay` page
+ complete real settlements with real signatures in a real browser; no console
+ errors/warnings.
+- [ ] Wallet secrets are encrypted at rest (`v2:` envelope), decrypted only in-memory at
+ signing, never logged or returned; custody guard tests pass.
+- [ ] A replayed/double-clicked payment settles exactly once and returns the original
+ receipt; replay + payment-identifier tests pass.
+- [ ] USDC verify/settle works on both Solana and Base (and via Solana Pay); spending
+ caps and ledger are enforced pre-settlement.
+- [ ] send/fund/trade/pay each produce a confirmed tx, a real receipt, and an updated
+ balance; insufficient funds routes to a real fund path.
+- [ ] Loading/empty(zero-balance)/pending/confirmed/error states are all designed;
+ dropped webhooks and timed-out confirms reconcile to a single correct ledger state.
+- [ ] No provider internals leak on any failure (verified by tests); RPC failures use
+ cockatiel retry/circuit-breaking.
+- [ ] `npx vitest run tests/api/x402-*.test.js tests/agent-custody-guards.test.js tests/agent-wallet-*-tab.test.js tests/api/solana-wallet-balance.test.js` passes.
+- [ ] Changelog updated and `npm run build:pages` is clean.
diff --git a/prompts/samples/23-mcp-servers-production.md b/prompts/samples/23-mcp-servers-production.md
new file mode 100644
index 000000000..39d858ad2
--- /dev/null
+++ b/prompts/samples/23-mcp-servers-production.md
@@ -0,0 +1,99 @@
+# 23 — MCP servers (production-ready)
+
+> Part of the three.ws "Production → $1B" program. Run in a fresh chat. Read
+> `/CLAUDE.md` first (its rules override everything) and `prompts/production-1b/00-README.md`
+> for shared context.
+
+## Why this matters for $1B
+
+MCP is how agents — Claude, Cursor, every autonomous buyer — actually reach
+three.ws. If a manifest drifts, a remote endpoint stops answering its payment
+challenge, or the one free lane (`forge_free`) silently breaks, the entire
+agent-to-agent distribution channel goes dark and we lose the buyers who never
+touch a browser. A registry-clean, smoke-passing, correctly-priced MCP surface
+is the difference between "an app" and "a protocol other agents build on."
+
+## Mission
+
+Make every three.ws MCP server publishable and reliable: valid registry
+manifests, passing smokes, correct per-tool x402 pricing, a working free
+`forge_free` lane, and spec-compliant `PaymentRequired` transport — so a fresh
+agent can discover and call our tools with zero hand-holding.
+
+## Map (trust but verify — files move)
+
+- **Hosted 3D-Agent MCP (remote)** — [api/mcp-3d.js](../../api/mcp-3d.js), backed by
+ [api/_mcp3d/catalog.js](../../api/_mcp3d/catalog.js) (tool list + discovery copy),
+ [api/_mcp3d/dispatch.js](../../api/_mcp3d/dispatch.js), [api/_mcp3d/pricing.js](../../api/_mcp3d/pricing.js)
+ (per-tool USDC), [api/_mcp3d/discovery.js](../../api/_mcp3d/discovery.js), and the
+ tool implementations in [api/_mcp3d/tools/studio.js](../../api/_mcp3d/tools/studio.js)
+ (`forge_free` lives here — the ONE free tool: NVIDIA NIM / Microsoft TRELLIS text→3D).
+- **Other remote endpoints** — [api/mcp.js](../../api/mcp.js), [api/mcp-agent.js](../../api/mcp-agent.js),
+ [api/mcp-bazaar.js](../../api/mcp-bazaar.js), [api/pump-fun-mcp.js](../../api/pump-fun-mcp.js)
+ (free, $THREE-only probe), [api/ibm-mcp.js](../../api/ibm-mcp.js).
+- **stdio MCP packages** — [mcp-server/](../../mcp-server), [mcp-bridge/](../../mcp-bridge),
+ [packages/pumpfun-mcp/](../../packages/pumpfun-mcp), [packages/avatar-agent-mcp/](../../packages/avatar-agent-mcp),
+ [packages/threews-avatar-mcp/](../../packages/threews-avatar-mcp), [packages/three-token-mcp/](../../packages/three-token-mcp),
+ [packages/ibm-watsonx-mcp/](../../packages/ibm-watsonx-mcp), [packages/ibm-x402-mcp/](../../packages/ibm-x402-mcp).
+- **x402 spec helper** — [api/_lib/x402-spec.js](../../api/_lib/x402-spec.js) (builds the
+ `PaymentRequired` / `accepts[]` challenge as `structuredContent`).
+- **Manifests** — each package's `server.json` + root `server*.json` (remote manifests).
+- **Tooling** — `npm run audit:mcp` ([scripts/audit-mcp-manifests.mjs](../../scripts/audit-mcp-manifests.mjs)),
+ `smoke:mcp` ([scripts/smoke-mcp-remotes.mjs](../../scripts/smoke-mcp-remotes.mjs)),
+ `test:mcp` ([scripts/test-mcp-all.mjs](../../scripts/test-mcp-all.mjs)),
+ `publish:mcp:dry` ([scripts/publish-mcp-servers.mjs](../../scripts/publish-mcp-servers.mjs)).
+
+## Do this
+
+1. **Audit manifests:** run `npm run audit:mcp`. Fix every violation — description
+ ≤ 100 chars, `name` in `io.github.<owner>/<server>` form, https icons/URLs, and
+ for stdio packages the `server.json` version MUST equal the package's `package.json`
+ version (and `packages[0].identifier/version` + `mcpName` must match). Do not bump
+ a version to dodge a real mismatch — align them.
+2. **Smoke the remotes:** run `npm run smoke:mcp http://localhost:3000` against
+ `npm run dev`, then against `https://three.ws`. Free endpoints must answer
+ `initialize` + `tools/list` and run a read-only tool; paid endpoints must return
+ a well-formed 401/402 with a valid `accepts[]` challenge. Fix any unhealthy one.
+3. **Verify the free lane:** call `forge_free` end-to-end (no wallet, no key) and
+ confirm it returns a real GLB URL + a three.ws viewer link via the NVIDIA NIM /
+ TRELLIS path. It must NEVER demand payment. Confirm it is the only free generation
+ tool in `catalog.js`.
+4. **Price every paid tool correctly:** in `api/_mcp3d/pricing.js`, confirm generation
+ tools price by tier from `forge-tiers.js` (same numbers as `POST /api/x402/forge`),
+ mesh edits carry their flat per-call USDC, and read-only tools (status/preview/
+ inspection) stay free. No tool may settle for the env minimum when it costs more.
+5. **Spec compliance:** confirm an un-paid call to a paid tool returns a
+ `PaymentRequired` result whose `structuredContent.accepts[]` carries valid
+ requirements (asset = USDC, correct `payTo`, atomic amount) — built via
+ `api/_lib/x402-spec.js`, not hand-rolled. Verify on both Base and Solana rails.
+6. **Run the full MCP suite:** `npm run test:mcp -- --no-remote` (offline: manifests +
+ each stdio package's `node --test`), then `npm run test:mcp http://localhost:3000`
+ (with the live layer). All green.
+7. **Dry-run the publish:** `npm run publish:mcp:dry`. It must validate every manifest
+ and report cleanly with no auth/version errors.
+8. **Docs + versioning:** each stdio package README must list its tools, install/run
+ command, and a real call example. Bump versions only for genuine changes (semver),
+ keeping `server.json` and `package.json` in lockstep. Add a `data/changelog.json`
+ entry (tag `sdk` or `infra`) for any user-visible MCP change, then `npm run build:pages`.
+
+## Must-not
+
+- Do not gate `forge_free` behind payment, a wallet, or an API key — it is the free lane.
+- Do not hardcode any mint other than `$THREE` (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`)
+ in probes, fixtures, or docs; the pump-fun probe must stay $THREE-only.
+- Do not hand-roll the `PaymentRequired` challenge — use `api/_lib/x402-spec.js`.
+- Do not let a generation tool settle for the env-minimum price; price it by tier.
+- Do not commit a `server.json`/`package.json` version mismatch or a >100-char description.
+- Do not weaken or skip a smoke/manifest check to make the suite pass.
+
+## Acceptance (all true before claiming done)
+
+- [ ] `npm run audit:mcp` passes with zero violations.
+- [ ] `npm run smoke:mcp` passes against both `localhost:3000` and `https://three.ws`.
+- [ ] `forge_free` returns a real GLB URL + viewer link with no payment, wallet, or key.
+- [ ] Every paid tool prices correctly (generation by tier, mesh edits flat, read-only free);
+ paid tools return a valid `PaymentRequired` `structuredContent.accepts[]` on Base + Solana.
+- [ ] `npm run test:mcp -- --no-remote` and `npm run test:mcp http://localhost:3000` both pass.
+- [ ] `npm run publish:mcp:dry` reports clean for every server.
+- [ ] Every stdio package README documents tools + a real call example; versions are in lockstep.
+- [ ] Changelog updated (if user-visible) and `npm run build:pages` is clean.
diff --git a/prompts/samples/24-sdk-publishing-docs.md b/prompts/samples/24-sdk-publishing-docs.md
new file mode 100644
index 000000000..fdb5aea8f
--- /dev/null
+++ b/prompts/samples/24-sdk-publishing-docs.md
@@ -0,0 +1,93 @@
+# 24 — SDK publishing & docs
+
+> Part of the three.ws "Production → $1B" program. Run in a fresh chat. Read
+> `/CLAUDE.md` first (its rules override everything) and `prompts/production-1b/00-README.md`
+> for shared context.
+
+## Why this matters for $1B
+
+The SDKs are how other teams build *on* three.ws instead of competing with it —
+a `<agent-3d>` viewer in someone else's app, an agent paying an x402 endpoint
+from another platform, a walk companion on a third party's homepage. A broken
+`files[]`, a README example that doesn't run, or a `npm install @three-ws/avatar`
+that throws on a fresh machine, and a would-be integrator bounces forever. Clean,
+documented, dry-run-verified packages turn three.ws into infrastructure.
+
+## Mission
+
+Every published SDK has a correct `package.json` (exports, `files[]`, semver),
+a README with real working examples, a clean dry-run publish, and a working
+demo/example — so an external developer can install it and ship in minutes.
+
+## Map (trust but verify — files move)
+
+- **Top-level SDKs** (published, not workspaces) — [sdk/](../../sdk) (`@three-ws/sdk`),
+ [solana-agent-sdk/](../../solana-agent-sdk) (`@three-ws/solana-agent`),
+ [agent-payments-sdk/](../../agent-payments-sdk) (`@three-ws/agent-payments`),
+ [agent-protocol-sdk/](../../agent-protocol-sdk) (`@three-ws/agent-protocol-sdk`).
+- **App-adjacent SDKs** (workspaces) — [avatar-sdk/](../../avatar-sdk) (`@three-ws/avatar`),
+ [walk-sdk/](../../walk-sdk) (`@three-ws/walk`), [tour-sdk/](../../tour-sdk) (`@three-ws/tour`).
+- **Spec/schema/preset packages** — [packages/avatar-schema/](../../packages/avatar-schema)
+ (`@three-ws/avatar-schema`), [packages/avatar-cli/](../../packages/avatar-cli)
+ (`@three-ws/avatar-cli`), [packages/viewer-presets/](../../packages/viewer-presets)
+ (`@three-ws/viewer-presets`), [packages/react/](../../packages/react) (`@three-ws/react`).
+- **Examples / demos** — [examples/](../../examples) (`embed-test.html`, `web-component.html`,
+ `two-agents.html`, `minimal.html`), [multiplayer/](../../multiplayer).
+- **Publish tooling** — `npm run publish:packages:dry`
+ ([scripts/publish-packages.mjs](../../scripts/publish-packages.mjs)),
+ `publish:mcp:dry` ([scripts/publish-mcp-servers.mjs](../../scripts/publish-mcp-servers.mjs)),
+ `publish:lib` ([scripts/publish-lib.mjs](../../scripts/publish-lib.mjs)), and the strongest
+ gate — [scripts/verify-packages.mjs](../../scripts/verify-packages.mjs) (packs each tarball,
+ installs it in a clean throwaway project, then exercises its real public surface).
+- **Workspace map** — [STRUCTURE.md](../../STRUCTURE.md) "npm workspaces" + "Promotion path".
+
+## Do this
+
+1. **Inventory + verify names/versions:** for every SDK above, confirm `package.json`
+ `name` matches STRUCTURE.md, `version` is sane semver, `type`/`exports`/`main`/`module`/
+ `types` resolve, and `files[]` (or `.npmignore`) ships exactly the published surface —
+ no `src` leak, no missing `dist`. Confirm a `prepublishOnly`/build runs the build.
+2. **Run the real-consumer gate:** `node scripts/verify-packages.mjs` — it packs each
+ package into its actual npm tarball, installs into a clean project resolving deps fresh,
+ and imports the SDK / runs the CLI bin / boots the MCP server. Fix every `files[]` gap,
+ broken export map, or missing runtime dep it surfaces.
+3. **Dry-run both publishers:** `npm run publish:packages:dry` and `npm run publish:mcp:dry`.
+ Both must report clean — no version-already-published surprises, no auth errors, no
+ missing build outputs.
+4. **READMEs must teach by example:** each README has install, a minimal runnable example
+ (web component, `import`, or CLI invocation), the public API surface, and a link to the
+ live page/demo. Every code block must actually run against the published surface — copy
+ one into a scratch project and confirm.
+5. **Wire a working demo per SDK:** `@three-ws/avatar` → an `examples/` page renders the
+ `<agent-3d>` viewer; `@three-ws/walk` → the walk companion mounts; `@three-ws/tour` →
+ the feature tour boots; payment/protocol SDKs → a runnable example call (real endpoint,
+ no mock). Exercise each in a real browser (`npm run dev`) or node where applicable; zero
+ console errors.
+6. **Semver discipline:** bump only what changed (patch/minor/major per real diff). Keep
+ any `peerDependencies` honest (Three.js, React versions) so installs don't warn. Do not
+ publish from this prompt — dry-run + verify only, unless the user explicitly says publish.
+7. **Cross-link the docs:** each SDK README links to STRUCTURE.md's workspace row and to its
+ sibling SDKs where they compose (e.g. avatar viewer + walk companion). The best platforms
+ feel like everything is linked.
+8. **Changelog + build:** add a `data/changelog.json` entry (tag `sdk`) for any user-visible
+ SDK doc/version change, then `npm run build:pages` (it validates the entry).
+
+## Must-not
+
+- Do not publish to npm/registry from this prompt unless the user explicitly asks — dry-run only.
+- Do not ship a README example that doesn't run, or a `files[]` that leaks `src`/tests or drops `dist`.
+- Do not reference any coin other than `$THREE` in any example, fixture, or doc.
+- Do not use a mock/fake endpoint in an example — real APIs only (or a clearly synthetic placeholder).
+- Do not bump versions cosmetically; semver must reflect the actual change.
+- Do not break a working package's exports while "cleaning up" its config.
+
+## Acceptance (all true before claiming done)
+
+- [ ] Every SDK `package.json` has a correct `name`, semver `version`, resolving `exports`,
+ and a tight `files[]`; builds run via `prepublishOnly`.
+- [ ] `node scripts/verify-packages.mjs` passes for every package (clean-room install + surface check).
+- [ ] `npm run publish:packages:dry` and `npm run publish:mcp:dry` both report clean.
+- [ ] Each README has install + a runnable example + API surface + a live demo link; examples verified to run.
+- [ ] At least one working demo per SDK is exercised with zero console errors.
+- [ ] No coin other than `$THREE` appears anywhere in SDK source, examples, or docs.
+- [ ] Changelog updated (if user-visible) and `npm run build:pages` is clean.
diff --git a/prompts/samples/25-worlds-coin-clash.md b/prompts/samples/25-worlds-coin-clash.md
new file mode 100644
index 000000000..6b7265e75
--- /dev/null
+++ b/prompts/samples/25-worlds-coin-clash.md
@@ -0,0 +1,106 @@
+# 25 — Worlds & Coin Clash (token-gated 3D)
+
+> Part of the three.ws "Production → $1B" program. Run in a fresh chat. Read
+> `/CLAUDE.md` first (its rules override everything) and `prompts/production-1b/00-README.md`
+> for shared context.
+
+## Why this matters for $1B
+
+"Every coin is a 3D world you can drop into" and "hold a coin, enlist, and fight
+live armies" is the social loop that makes a token sticky beyond price — it turns
+holders into citizens and a chart into a place. If a world dead-ends on a void, a
+presence sync drops players, or the enlist gate lets a non-holder in (or locks a
+real holder out), the network effect collapses. Reliable, every-state, token-gated
+multiplayer is what makes three.ws a destination instead of a tool.
+
+## Mission
+
+Make every coin enterable as a live 3D world and make Coin Clash — token-gated
+community warfare (hold the coin → enlist → rally battle power live) — correct,
+multiplayer-reliable, beautifully stated in every phase, and $THREE-compliant for
+anything the platform itself promotes.
+
+## Map (trust but verify — files move)
+
+- **Worlds lobby (front door)** — [pages/worlds.html](../../pages/worlds.html),
+ [src/worlds-lobby.js](../../src/worlds-lobby.js) (pick/drop-in an avatar, list live
+ coin-worlds, enter at `/walk?coin=<mint>`).
+- **Worlds data + gating** — [api/community/worlds.js](../../api/community/worlds.js)
+ (`GET /api/community/worlds`), [api/community/world-gate.js](../../api/community/world-gate.js)
+ (per-coin holder threshold; creator-only POST), [api/community/ws-ticket.js](../../api/community/ws-ticket.js)
+ (short-lived realtime ticket), [api/world/[action].js](../../api/world/[action].js)
+ (per-world persistence: `load`/`save`).
+- **Coin Clash UI** — [pages/clash.html](../../pages/clash.html), [src/clash.js](../../src/clash.js)
+ (bracket → battle cards → enlist challenge → rally dock).
+- **Coin Clash API + store** — [api/clash/[action].js](../../api/clash/[action].js)
+ (`state`, `enlist`, `enlist-verify`, `rally`, `leaderboard`), backed by
+ [api/_lib/clash.js](../../api/_lib/clash.js), [api/_lib/clash-store.js](../../api/_lib/clash-store.js),
+ [api/_lib/crews-store.js](../../api/_lib/crews-store.js).
+- **Realtime multiplayer** — [multiplayer/](../../multiplayer) (authoritative Colyseus server):
+ [multiplayer/src/rooms/WalkRoom.js](../../multiplayer/src/rooms/WalkRoom.js),
+ [multiplayer/src/rooms/ClashRoom.js](../../multiplayer/src/rooms/ClashRoom.js),
+ presence in [multiplayer/src/presence-token.js](../../multiplayer/src/presence-token.js).
+- **Hyperfy world host** — [deploy/world/](../../deploy/world) + [scripts/world-health.mjs](../../scripts/world-health.mjs).
+- **Verify/smoke** — [scripts/verify-worlds-lobby.mjs](../../scripts/verify-worlds-lobby.mjs)
+ (offline/unconfigured state), [scripts/verify-worlds-live.mjs](../../scripts/verify-worlds-live.mjs)
+ (configured live worlds), [scripts/world-health.mjs](../../scripts/world-health.mjs)
+ (asset-integrity check). Tests: [tests/clash-match.test.js](../../tests/clash-match.test.js),
+ [tests/world-store.test.js](../../tests/world-store.test.js).
+
+## Do this
+
+1. **Exercise the worlds lobby** (`npm run dev`, `/worlds`): pick/drop-in an avatar with no
+ sign-in, browse live coin-worlds, and enter one. Confirm both states work — configured
+ (real grid via `GET /api/community/worlds`) and unconfigured (graceful "offline" layer
+ where worlds are still enterable, the documented 503 degradation). Run
+ `node scripts/verify-worlds-lobby.mjs` (and `verify-worlds-live.mjs` against a configured
+ dev server): zero console errors beyond the one tolerated 503.
+2. **Drop into a world end-to-end:** enter `/walk?coin=<mint>`, confirm the world loads (no
+ void), the avatar spawns, persistence round-trips via `api/world/[action]` (`save`→`load`),
+ and `scripts/world-health.mjs` reports every blueprint asset present (the 2026-06-12 void
+ regression must not recur).
+3. **Token-gate correctly:** verify `api/community/world-gate.js` — a coin creator can set a
+ holder threshold, GET states the requirement publicly, and entry re-verifies the on-chain
+ holding server-side. A real holder gets in; a non-holder hits a designed, actionable gate
+ screen (tells them what to hold and how). Fail closed when creator/holding is unknown.
+4. **Coin Clash full loop** (`/clash`): poll `state` → render the bracket → enlist (wallet
+ challenge → `enlist-verify` confirms a live on-chain holding of the faction coin) → rally
+ dock opens, taps batch and flush to `rally` as battle power. Confirm holdings are gated
+ on-chain (no client trust) and the leaderboard reflects real effort.
+5. **Design every state** across both surfaces: loading (skeleton, not a fake bar), empty
+ (no live worlds / no active battles → what to do next), error (network/upstream failure →
+ actionable recovery), and overflow (many worlds, long coin names, big armies). No blank
+ voids, no dead buttons.
+6. **Multiplayer reliability:** in the Colyseus rooms (`WalkRoom`, `ClashRoom`), verify
+ presence join/leave, reconnect after a dropped socket, and ticket auth via
+ `api/community/ws-ticket.js` + `presence-token.js`. A player who disconnects must not
+ linger as a ghost; a reconnect must restore identity. Boot the server with
+ `npm run dev:multi` (or `dev:walk-all`) and test two browser tabs.
+7. **Run the suites:** `npx vitest run tests/clash-match.test.js tests/world-store.test.js`
+ and the multiplayer package's own tests. Add coverage for any uncovered failure mode
+ (gate-denied, upstream 503, presence drop/reconnect, matchmaking bye).
+8. **$THREE compliance + changelog:** any coin the platform *promotes* must be `$THREE`
+ (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`); the worlds grid and faction roster are
+ runtime launch-record feeds (allowed) — never hardcode/market a non-$THREE mint. Add a
+ `data/changelog.json` entry for any user-visible change, then `npm run build:pages`.
+
+## Must-not
+
+- Do not let a non-holder past a token gate, or lock out a verified holder — gate on-chain, fail closed.
+- Do not ship a world that can drop players into a void; assets must be verified present.
+- Do not hardcode, market, or recommend any mint other than `$THREE` (runtime launch feeds are fine).
+- Do not fake presence/multiplayer with timers or client-trusted state — use the authoritative rooms.
+- Do not leave any state undesigned (no blank voids, no dead buttons, no never-resolving spinners).
+- Do not weaken a verify/smoke/health check to make a run pass.
+
+## Acceptance (all true before claiming done)
+
+- [ ] `/worlds` works in both configured and unconfigured states; `verify-worlds-lobby.mjs`
+ (and `verify-worlds-live.mjs` configured) pass with no unexpected console errors.
+- [ ] Dropping into `/walk?coin=<mint>` loads a real world (no void), spawns the avatar, and
+ persists via `api/world/[action]`; `scripts/world-health.mjs` reports all assets present.
+- [ ] Token gating verified on-chain: holders enter, non-holders see a designed actionable gate.
+- [ ] Coin Clash loop works end-to-end (state → enlist → enlist-verify → rally), holdings gated on-chain.
+- [ ] Loading/empty/error/overflow states designed across both surfaces; presence join/leave/reconnect reliable.
+- [ ] `tests/clash-match.test.js`, `tests/world-store.test.js`, and multiplayer tests pass; new failure modes covered.
+- [ ] No promoted coin other than `$THREE`; changelog updated and `npm run build:pages` is clean.
diff --git a/prompts/tests/00-README-orchestration.md b/prompts/tests/00-README-orchestration.md
new file mode 100644
index 000000000..3cb7b0152
--- /dev/null
+++ b/prompts/tests/00-README-orchestration.md
@@ -0,0 +1,112 @@
+# Road to $1B — Production-Readiness Program
+
+This directory is a **sequenced program of self-contained prompts**. Each `.md`
+file is a complete task brief you paste into a **fresh agent chat** at
+`/workspaces/three.ws`. Run them in order within a phase; phases mostly gate on
+the one before. Every prompt is written to be run with zero prior context — it
+restates where it is, what the codebase is, and which rules apply.
+
+## The thesis
+
+A platform reaches a billion-dollar valuation on three things this program
+drives toward:
+
+1. **It works, completely.** No dead buttons, no half-wired flows, no fake data,
+ no TODOs shipped to users. (Phase 1)
+2. **It never goes down and never leaks.** Hardened APIs, resilient external
+ calls, real observability, a real security posture. (Phase 2–3)
+3. **People can't stop using it and telling others.** Fast, polished, accessible,
+ shareable, monetized, instrumented. (Phase 4–6)
+
+We do not get there with "good enough." Read [CLAUDE.md](../../CLAUDE.md) before
+every task — it is the operating contract. The relevant non-negotiables:
+
+- No mocks, no fake data, no placeholders, no TODO comments, no stubs.
+- The only coin is **$THREE** (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`).
+- Every user-visible change gets a `data/changelog.json` entry.
+- Stage explicit paths only (concurrent agents share this worktree). Never
+ `git add -A`. Re-check `git status` before committing.
+- Push to **both** remotes (`threeD`, `threews`) when asked to push. Never pull
+ from `threeD`.
+
+## How to run
+
+1. Open a new chat in this repo.
+2. Paste the entire contents of one prompt file.
+3. Let the agent finish, verify its Definition of Done, then move to the next.
+4. Prompts marked **[parallel-safe]** can run simultaneously in separate chats
+ (they touch disjoint surfaces). Prompts marked **[serial]** must run alone.
+
+## The baseline (measured 2026-06-21, will change as you work)
+
+These are the concrete gaps this program closes. Re-run the discovery commands
+inside each prompt to get the live number — do not trust this snapshot.
+
+| Signal | Count | Closed by |
+|---|---|---|
+| TODO / FIXME / placeholder / "coming soon" markers in `src/ public/ api/` | 652 | [02](02-eliminate-todos-and-stubs.md) |
+| Empty `catch {}` blocks | 126 | [03](03-harden-error-boundaries.md) |
+| Mock / sample / fake-data arrays | 23 | [04](04-purge-mock-and-fake-data.md) |
+| API functions (each needs authz + validation + rate limiting reviewed) | 769 | [08](08-api-hardening.md) |
+| Env keys (secrets surface) | 275 | [07](07-secrets-and-env-hardening.md) |
+| CI workflows | 1 | [16](16-ci-cd-hardening.md) |
+
+Discovery, anytime:
+
+```bash
+grep -rIn "TODO\|FIXME\|not implemented\|implement later\|placeholder\|coming soon\|XXX:" --include=*.js src/ public/ api/ | grep -v node_modules | wc -l
+grep -rIn "catch[^)]*) *{ *}" --include=*.js src/ public/ api/ | grep -v node_modules | wc -l
+```
+
+## Phases
+
+**Phase 1 — Correctness & hygiene (no shortcuts ship).** Serialize 02→06; they
+edit broadly and you want clean diffs between them.
+- [01 — Production audit & scorecard](01-production-audit-scorecard.md) **[serial, run first]**
+- [02 — Eliminate every TODO / stub / placeholder](02-eliminate-todos-and-stubs.md)
+- [03 — Harden every error boundary (kill empty catches)](03-harden-error-boundaries.md)
+- [04 — Purge all mock / sample / fake data](04-purge-mock-and-fake-data.md)
+- [05 — Dead-path & handler audit (every button works)](05-dead-path-and-handler-audit.md)
+- [06 — $THREE coin-compliance sweep](06-three-coin-compliance-sweep.md)
+
+**Phase 2 — Reliability & security (institutional grade).** [parallel-safe]
+across 07–11 once Phase 1 is clean.
+- [07 — Secrets & env hardening](07-secrets-and-env-hardening.md)
+- [08 — API hardening: authz, validation, rate limiting](08-api-hardening.md)
+- [09 — Security review: payments, wallets, contracts](09-security-review.md)
+- [10 — Resilience on every external call](10-resilience-external-calls.md)
+- [11 — Observability: logging, monitoring, alerting](11-observability.md)
+
+**Phase 3 — Performance & scale.** [parallel-safe]
+- [12 — Frontend performance & Core Web Vitals](12-frontend-performance.md)
+- [13 — 3D asset performance](13-3d-asset-performance.md)
+- [14 — Backend caching & data layer](14-backend-caching.md)
+
+**Phase 4 — Quality & testing.**
+- [15 — Test coverage to the bar](15-test-coverage.md) **[serial]**
+- [16 — CI/CD hardening](16-ci-cd-hardening.md) **[serial]**
+- [17 — Accessibility audit (WCAG 2.2 AA)](17-accessibility-audit.md) **[parallel-safe]**
+
+**Phase 5 — UX polish & completeness.** [parallel-safe]
+- [18 — Every state designed (loading/empty/error/overflow)](18-state-design-sweep.md)
+- [19 — Responsive / mobile sweep](19-responsive-mobile-sweep.md)
+- [20 — Design-system & token consistency](20-design-system-consistency.md)
+- [21 — Onboarding & first-run experience](21-onboarding-first-run.md)
+
+**Phase 6 — Growth, monetization & the $1B narrative.**
+- [22 — SEO & shareability](22-seo-and-shareability.md) **[parallel-safe]**
+- [23 — Growth & virality loops](23-growth-virality.md) **[parallel-safe]**
+- [24 — Monetization completeness](24-monetization-completeness.md) **[parallel-safe]**
+- [25 — Analytics & funnel instrumentation](25-analytics-funnel.md) **[parallel-safe]**
+- [26 — Trust surfaces: status, docs, security, pricing](26-trust-surfaces.md) **[parallel-safe]**
+
+**Phase 7 — Launch.**
+- [27 — Go-live runbook & pre-launch checklist](27-launch-runbook.md) **[serial, run last]**
+- [28 — Incident response & on-call](28-incident-response-oncall.md) **[serial]**
+
+## Done means done
+
+A prompt is complete only when its own Definition-of-Done checklist is fully
+true and verified — not when the code is written. If an agent can't verify a
+step, it must say so explicitly. Same rule as [CLAUDE.md](../../CLAUDE.md): you
+would be proud to demo every result to a room of senior engineers.
diff --git a/prompts/tests/00-README.md b/prompts/tests/00-README.md
new file mode 100644
index 000000000..776180017
--- /dev/null
+++ b/prompts/tests/00-README.md
@@ -0,0 +1,128 @@
+# Road to $1B — production-readiness program
+
+> **Read this file in full before starting any prompt in this folder.** Every prompt
+> here (`01-*` … `40-*`) assumes the context below. Do not re-derive it. Each prompt
+> is self-contained and meant to be run in its own fresh chat.
+
+## What this is
+
+A sequenced program of work to take **three.ws** from "feature-rich but uneven" to
+**production-grade and ready to scale to a $1B platform**. Each numbered file is a
+single, self-contained task you can paste into a new agent chat. They are grouped
+into phases. Run them roughly in order — later phases assume earlier ones are done —
+but any single prompt can be run independently.
+
+This is not a feature-invention program (that lives in the sibling folders:
+`feature-innovation/`, `moonshots/`, `inventions/`, etc.). This program is about
+**finishing, hardening, and polishing what already exists** so the platform is
+correct, reliable, fast, accessible, secure, observable, and conversion-optimized.
+
+## The bar (non-negotiable — applies to every prompt)
+
+Every prompt inherits the operating rules in **`/CLAUDE.md`**. Re-read it. The rules
+that matter most for this program:
+
+- **No mocks, no fake data, no placeholders, no TODOs, no stubs.** If you touch it,
+ finish it. Real APIs, real endpoints, real data.
+- **No "good enough."** Fix mediocrity the moment you see it.
+- **No errors without solutions.** Every error has a root cause; find it and fix it.
+ Ship working fallbacks and failsafes, never lazy propagation.
+- **Every state is designed** — loading, empty, error, populated, overflow.
+- **The only coin is `$THREE`** (CA `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`).
+ Never reference any other coin anywhere. See `/CLAUDE.md` for the two
+ runtime-data-only mechanical exceptions.
+- **Definition of done**: the checklist in `/CLAUDE.md` must be true. If you can't
+ verify a step, say so explicitly — do not claim done.
+
+## How to run a prompt
+
+1. Open a fresh chat in this repo.
+2. Paste the contents of the prompt file (or reference it: "Execute
+ `prompts/road-to-1b/NN-*.md`").
+3. Let the agent work end-to-end. It should use `TodoWrite` for multi-step work,
+ exercise the feature in a real browser for UI work, and run the relevant tests.
+4. When it reports done, spot-check against the prompt's **Acceptance** section.
+5. Commit + push when satisfied (the agent will push to **both** remotes —
+ `threeD` and `threews` — per `/CLAUDE.md`).
+
+## Repository orientation (so every prompt starts from truth)
+
+- **`STRUCTURE.md`** maps every product surface to its directory. Read it before
+ exploring the ~60 top-level dirs.
+- Frontend: vanilla JS modules + Vite (`npm run dev`, port 3000).
+ `pages/*.html` (125 pages), `src/`, `public/`.
+- Backend: Vercel functions in `api/` (~960 handlers), Cloudflare workers in
+ `workers/`. Config in `vercel.json` (routes, functions, crons, env).
+- 3D: Three.js + glTF/GLB. Avatar/animation pipeline under `public/animations/`,
+ `src/glb-canonicalize.js`, `src/animation-retarget.js`.
+- Tests: `npm test` = `vitest run && playwright test`. `npm run test:all` also runs
+ `test:pages`. `npm run lint` (eslint), `npm run typecheck` (tsc on jsconfig).
+- Changelog: user-visible changes get an entry in `data/changelog.json`, then
+ `npm run build:pages` regenerates `CHANGELOG.md` + `public/changelog.{json,xml}`.
+- Existing audit tooling you should lean on, not reinvent:
+ `npm run audit:deploy`, `audit:pages`, `audit:handlers`, `audit:web`, `audit:mcp`,
+ `check:images`, `seo:meta`, `verify`, `verify:solana`, `verify:onchain`,
+ `smoke:onchain`, `smoke:mcp`.
+- Resilience: prefer the vetted **cockatiel** helper for retries/circuit-breakers
+ (see the existing usage in `api/_lib/`). Adopt OSS over hand-rolling; add hardening
+ to new/unprotected paths rather than refactoring working code.
+
+## Phases
+
+**Phase 0 — Foundation (stop the platform from lying about "done")**
+- `01` Test suite green + CI gate
+- `02` Dead paths & broken links — every button works, every link resolves
+- `03` Zero console errors/warnings across all pages
+- `04` No-mocks / no-placeholders sweep (~400 marker files)
+- `05` Secrets & env hygiene
+
+**Phase 1 — Cross-cutting production hardening**
+- `06` Error handling & resilience (api/ + workers/)
+- `07` Security hardening (authz, input validation, headers)
+- `08` Rate limiting & abuse prevention
+- `09` Accessibility (WCAG 2.2 AA)
+- `10` Performance & Core Web Vitals
+- `11` Mobile responsiveness (320 / 768 / 1440)
+- `12` Every state designed (loading / empty / error)
+- `13` Design-system consistency (tokens, spacing, typography)
+- `14` SEO & structured data
+
+**Phase 2 — Product surface completeness (each end-to-end)**
+- `15` Forge (text/image → 3D)
+- `16` Marketplace
+- `17` Agent profiles & economy
+- `18` Wallet & x402 payments
+- `19` Walk companion & feature tour
+- `20` Scene Studio
+- `21` Avatar creator / Character Studio
+- `22` Pump.fun launch & $THREE surfaces
+- `23` MCP servers (production-ready)
+- `24` SDK publishing & docs
+
+**Phase 3 — Scale, infra, observability**
+- `25` Observability (logging, metrics, error tracking)
+- `26` Database integrity & migrations
+- `27` Deploy pipeline & rollback safety
+- `28` Uptime monitoring & public status page
+- `29` Load & stress testing
+
+**Phase 4 — Growth to $1B**
+- `30` Onboarding & activation funnel
+- `31` Home / landing conversion
+- `32` Pricing & monetization surfaces
+- `33` Growth analytics instrumentation
+- `34` Developer experience & docs site
+- `35` Referral & virality loops
+- `36` Trust, safety & moderation
+- `37` Legal, compliance, ToS & privacy
+- `38` i18n completion
+- `39` PWA & notifications
+- `40` Launch-readiness review (the final gate)
+
+## Prompt anatomy
+
+Each file has: **Why this matters for $1B**, **Mission**, **Map** (where things
+live), **Do this** (ordered steps), **Must-not** (guardrails), and **Acceptance**
+(a checklist that must be all-true before claiming done). Trust the Map but verify —
+files move; if a path is stale, find the real one and proceed. Never stop because a
+path was wrong.
diff --git a/prompts/tests/01-production-audit-scorecard.md b/prompts/tests/01-production-audit-scorecard.md
new file mode 100644
index 000000000..c0bd2b8f6
--- /dev/null
+++ b/prompts/tests/01-production-audit-scorecard.md
@@ -0,0 +1,72 @@
+# 01 — Production audit & readiness scorecard
+
+**Run this first. Serial.** It produces the source-of-truth report every later
+prompt checks against.
+
+## Where you are
+
+You are at `/workspaces/three.ws` — **three.ws**, an open-source browser-native
+3D AI-agent platform (Three.js/Vite frontend, Vercel functions in `api/`,
+Cloudflare workers in `workers/`, Solana + x402 payments, $THREE token). Read
+[CLAUDE.md](../../CLAUDE.md) and [STRUCTURE.md](../../STRUCTURE.md) before doing
+anything. The only coin is **$THREE**.
+
+## Objective
+
+Produce an honest, file-level production-readiness scorecard. You are not fixing
+anything in this task — you are establishing ground truth so the fix tasks are
+targeted and measurable. The deliverable is a committed report plus a machine
+-readable inventory the rest of the program consumes.
+
+## Why it matters
+
+You cannot claim "100% production ready" against a number you never measured.
+This report is the before-picture. Every later prompt closes a row in it.
+
+## Instructions
+
+1. **Inventory the gaps.** Run each, capture counts AND the file list:
+ ```bash
+ grep -rIn "TODO\|FIXME\|not implemented\|implement later\|placeholder\|coming soon\|XXX:\|HACK" --include=*.js src/ public/ api/ workers/ | grep -v node_modules
+ grep -rIn "catch[^)]*) *{ *}" --include=*.js src/ public/ api/ workers/ | grep -v node_modules
+ grep -rIn "const sample\|mockData\|fakeData\|sampleAgents\|dummyData\|hardcoded\|FIXME" --include=*.js src/ public/ api/ | grep -v node_modules
+ grep -rIn "console.log\|console.warn\|console.error" --include=*.js src/ public/ | grep -v node_modules | wc -l
+ ```
+2. **Run the repo's own auditors** and record pass/fail + output:
+ ```bash
+ npm run audit:handlers # empty event handlers / dead buttons
+ npm run audit:pages # page index integrity
+ npm run check:images # image loading (strict)
+ npm run audit:web # web audit
+ npm run lint # eslint
+ npm run typecheck # tsc
+ npm test 2>&1 | tail -40 # current test state
+ ```
+ Do not fix failures here — record them.
+3. **Map dead paths at the product level.** For each top surface in
+ [STRUCTURE.md](../../STRUCTURE.md) (forge, marketplace, trending, studio,
+ walk, club, reputation, launches, chat, x402 checkout), note in one line:
+ does the primary user flow complete end-to-end with real data? Use the dev
+ server if needed (`npm run dev`, port 3000). Flag anything that 404s,
+ throws, or shows placeholder/empty content where data should be.
+4. **Score each surface** 0–5 on: completeness, error/empty/loading states,
+ mobile, accessibility, performance. Be ruthless; a 3 is "works but not
+ demoable."
+5. **Write the report** to `docs/audits/production-readiness-YYYY-MM-DD.md`
+ (use today's date) with: the gap counts table, the auditor results, the
+ surface scorecard, and a prioritized fix list keyed to the prompt numbers in
+ [00-README-orchestration.md](00-README-orchestration.md).
+6. **Write the machine inventory** to `docs/audits/gap-inventory.json` —
+ `{ todos: [...], emptyCatches: [...], mockData: [...], deadPaths: [...] }`,
+ each entry `{ file, line, snippet }`. Later prompts diff against this.
+
+## Definition of done
+
+- [ ] `docs/audits/production-readiness-<today>.md` committed, with real numbers
+ (not estimates) and a per-surface scorecard.
+- [ ] `docs/audits/gap-inventory.json` committed and valid JSON.
+- [ ] Every auditor command above was run and its result recorded, including
+ failures — no command silently skipped.
+- [ ] The report names the 10 highest-leverage fixes, each linked to a prompt.
+- [ ] No source files changed (this is read-only except the two reports).
+- [ ] Changelog: skip — this is an internal audit, not user-visible.
diff --git a/prompts/tests/01-test-suite-green-and-ci-gate.md b/prompts/tests/01-test-suite-green-and-ci-gate.md
new file mode 100644
index 000000000..159bf6703
--- /dev/null
+++ b/prompts/tests/01-test-suite-green-and-ci-gate.md
@@ -0,0 +1,59 @@
+# 01 — Test suite green + CI gate
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 0 — Foundation
+**Owns:** `tests/`, `package.json` scripts, CI config (`.github/workflows/` if present), `vitest`/`playwright` config.
+**Depends on:** nothing — this runs first.
+
+## Why this matters for $1B
+A platform you can't trust to be green is a platform you can't ship to fast. Every
+later prompt assumes a green baseline so regressions are visible. Investors and
+enterprise customers read CI status as a proxy for engineering discipline.
+
+## Mission
+Get the entire test suite passing reliably, eliminate flakes, and enforce green on
+every push so the bar can never silently drop.
+
+## Map
+- `npm test` → `vitest run && playwright test`
+- `npm run test:all` → `npm run test && npm run test:pages`
+- `npm run test:core`, `test:gate`, `test:e2e`, `test:pages`
+- `npm run lint` (eslint `.`), `npm run typecheck` (`tsc -p jsconfig.json`)
+- 237 files under `tests/`. Smoke suites: `smoke:onchain`, `smoke:mcp`, `smoke:agent-wallet`.
+- CI: check `.github/workflows/` — wire the gate there.
+
+## Do this
+1. Run `npm run lint`, `npm run typecheck`, `npm test`, `npm run test:pages` and
+ capture the full failure list. Triage into: real bugs, stale tests, flakes,
+ environment/credential gaps.
+2. Fix **real bugs in the code**, not the tests, wherever a test correctly catches a
+ defect. Where a test is genuinely stale (asserts removed behavior), update it and
+ note why in the commit.
+3. For tests that need credentials/network: gate them on env presence so they skip
+ cleanly (not fail) when creds are absent locally, but **run** in CI where creds
+ exist. Never delete coverage to make green.
+4. Hunt flakes: anything timing-dependent, animation-dependent, or ordering-dependent
+ in Playwright. Add deterministic waits (`expect(...).toPass`, role/text locators),
+ remove arbitrary sleeps. Re-run the suspect specs 5× to confirm stability.
+5. Ensure `npm run typecheck` and `npm run lint` are clean. Fix the code; only
+ disable a rule inline with a justifying comment when the rule is genuinely wrong
+ for that line.
+6. Wire/confirm a CI workflow that runs lint + typecheck + `test:all` on every push
+ and PR to `main`, and **blocks merge on failure**. If `.github/workflows/` is
+ absent, create one. Cache `node_modules` and the Playwright browser install.
+7. Add a short `tests/README.md` (or update it) explaining how to run each suite and
+ which need credentials.
+
+## Must-not
+- Do not weaken assertions, `.skip` real tests, or set `--passWithNoTests` to fake green.
+- Do not commit credentials to make CI pass — use CI secrets.
+- Do not introduce `setTimeout`-based waits in Playwright.
+
+## Acceptance
+- [ ] `npm run lint` — clean.
+- [ ] `npm run typecheck` — clean.
+- [ ] `npm test` and `npm run test:pages` — green locally (creds-gated suites skip cleanly with a logged reason).
+- [ ] Suspect flaky specs pass 5/5 reruns.
+- [ ] CI workflow runs lint + typecheck + test:all on push/PR and blocks on red.
+- [ ] `git diff` reviewed; every changed test justified.
diff --git a/prompts/tests/02-dead-paths-and-broken-links.md b/prompts/tests/02-dead-paths-and-broken-links.md
new file mode 100644
index 000000000..55558614c
--- /dev/null
+++ b/prompts/tests/02-dead-paths-and-broken-links.md
@@ -0,0 +1,53 @@
+# 02 — Dead paths & broken links
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 0 — Foundation
+**Owns:** `pages/*.html` (125 pages), `public/`, `src/`, nav (`public/nav.js`, `public/nav.css`), routing in `vercel.json`.
+**Depends on:** none.
+
+## Why this matters for $1B
+Nothing destroys trust faster than a button that does nothing or a link that 404s.
+`/CLAUDE.md`: "If a button exists, it must work. If a link exists, it must go
+somewhere. If a state exists, there must be a way to reach it." This is table stakes.
+
+## Mission
+Audit every interactive element and link across the whole site. Every one resolves
+to a working destination or a real action. Zero dead ends.
+
+## Map
+- 125 pages in `pages/`. Shared nav in `public/nav.js` / `public/nav.css`.
+- Route map in `vercel.json` (`routes`). Page index in `data/pages.json`.
+- Existing helpers: `npm run audit:pages`, `npm run audit:web`, `npm run check:images`.
+
+## Do this
+1. Build a link/route inventory: every `href`, `<a>`, `onclick`, `data-href`,
+ `<button>` handler, and `fetch()` target across `pages/`, `src/`, `public/`. A
+ script in `scripts/` (kept, not throwaway, or deleted after) that crawls the built
+ site is acceptable — wire it as `npm run audit:links` if useful.
+2. For every internal link/route: confirm the target exists in `pages/`/`public/`
+ and is reachable via `vercel.json` routes. Fix broken targets — create the page,
+ fix the path, or remove the link if the destination was never meant to exist.
+3. For every external link: confirm it resolves (200/redirect, not 404/dead domain).
+ Replace or remove dead ones. External links open with `rel="noopener"`.
+4. For every button/interactive control: confirm it has a real handler that does
+ real work. Any control wired to nothing, to a `// TODO`, to an `alert()`, or to a
+ no-op gets implemented or removed. No decorative buttons.
+5. Confirm every nav entry (desktop + mobile menu) points somewhere live and is
+ reachable on small screens (cross-check with prompt `11`).
+6. Confirm 404 handling: a real, branded 404 page that helps the user recover
+ (search, links home, top destinations) — not a blank or default.
+7. Re-run `audit:pages` / `audit:web` and resolve every finding.
+
+## Must-not
+- Do not "fix" a broken link by pointing it at the homepage as a catch-all. Find the
+ intended destination or remove the link.
+- Do not leave any `href="#"`, `href="javascript:void(0)"`, or empty handler in place.
+
+## Acceptance
+- [ ] Zero broken internal links/routes (audit script clean).
+- [ ] Zero dead external links.
+- [ ] Every button/control performs real work or is removed.
+- [ ] Branded, helpful 404 page exists and is wired in `vercel.json`.
+- [ ] `npm run audit:pages` and `audit:web` pass.
+- [ ] Spot-checked in a real browser across 8–10 representative pages incl. mobile nav.
diff --git a/prompts/tests/02-eliminate-todos-and-stubs.md b/prompts/tests/02-eliminate-todos-and-stubs.md
new file mode 100644
index 000000000..4913bf453
--- /dev/null
+++ b/prompts/tests/02-eliminate-todos-and-stubs.md
@@ -0,0 +1,59 @@
+# 02 — Eliminate every TODO, stub & placeholder
+
+**Phase 1. Run after [01](01-production-audit-scorecard.md). Serial** (broad
+edits — keep its diff isolated).
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 3D AI-agent platform. Read
+[CLAUDE.md](../../CLAUDE.md). Hard rules in play: **No TODO comments. No
+`// implement later`. No stub functions. No `throw new Error("not implemented")`.
+No commented-out code. If you write it, finish it.** There are ~652 marker hits
+to resolve. The only coin is **$THREE**.
+
+## Objective
+
+Drive the TODO/FIXME/stub/placeholder count in `src/ public/ api/ workers/` to
+**zero** — by *implementing* the missing behavior, not by deleting the comment
+and leaving the gap. Every marker is either real missing work (implement it) or
+a stale note (remove it because the work is already done).
+
+## Why it matters
+
+A TODO in shipped code is an admission the product is unfinished. Investors,
+contributors, and users read this repo. Every marker is a small broken promise.
+Closing them is the difference between a demo and a product.
+
+## Instructions
+
+1. **Enumerate** from `docs/audits/gap-inventory.json` (or re-run the grep in
+ [00-README](00-README-orchestration.md)). Group by directory/owner-surface so
+ you can batch related ones.
+2. **Triage each marker** into one of:
+ - **Implement** — the feature/branch/edge-case is genuinely missing. Build it
+ properly with real APIs and real data. No shortcuts.
+ - **Already done** — the note is stale; delete the comment.
+ - **Wrong layer** — it describes work that belongs elsewhere; implement in the
+ right place and remove the marker.
+ Never resolve by weakening behavior or hiding the path.
+3. **For commented-out code:** delete it or implement it. Git history is the
+ archive — dead code in the tree is not.
+4. **For `// placeholder` UI / copy / data:** replace with the real thing. If a
+ value must come from an API, wire the fetch. If copy is a stand-in, write the
+ final copy.
+5. **Work in reviewable batches** by surface (e.g. all forge TODOs, then all
+ marketplace TODOs). After each batch run `npm run lint && npm run typecheck`
+ and the relevant tests. Commit per surface with explicit paths so concurrent
+ agents aren't clobbered (`git add <files>`, never `-A`).
+6. **Re-measure** after each batch; track the count down to zero.
+
+## Definition of done
+
+- [ ] `grep -rIn "TODO\|FIXME\|not implemented\|implement later\|placeholder\|coming soon\|XXX:\|HACK" --include=*.js src/ public/ api/ workers/ | grep -v node_modules` returns **0** (or each remaining hit is a legitimate string literal a user types/searches, justified inline in your final report).
+- [ ] No `throw new Error("not implemented")`, no stub functions, no
+ commented-out code blocks remain in the changed files.
+- [ ] Every "implement" item is wired to real APIs/data and reachable in the UI.
+- [ ] `npm run lint`, `npm run typecheck`, and `npm test` pass.
+- [ ] `gap-inventory.json` `todos` array updated to reflect what was closed.
+- [ ] Changelog: add one `improvement` entry to `data/changelog.json` if any
+ user-visible behavior was completed (plain language, not "removed TODOs").
diff --git a/prompts/tests/03-harden-error-boundaries.md b/prompts/tests/03-harden-error-boundaries.md
new file mode 100644
index 000000000..27018a7e2
--- /dev/null
+++ b/prompts/tests/03-harden-error-boundaries.md
@@ -0,0 +1,67 @@
+# 03 — Harden every error boundary (kill the empty catches)
+
+**Phase 1. Serial** after [02](02-eliminate-todos-and-stubs.md).
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 3D AI-agent platform. Read
+[CLAUDE.md](../../CLAUDE.md). Rules in play: **Errors handled at boundaries
+(network, user input). No errors without solutions — there is always a correct
+answer. Ship working fallbacks and failsafes. Lazy error propagation is not
+engineering.** ~126 empty `catch {}` blocks exist. The only coin is **$THREE**.
+
+## Objective
+
+Eliminate silent failure. Every `catch` either (a) recovers with a real
+fallback, (b) surfaces an actionable error to the user at a UI boundary, or (c)
+reports to the error pipeline with enough context to debug — never swallows.
+
+## Why it matters
+
+An empty catch is a bug that will happen in production and that you have
+pre-decided not to learn about. At scale these are the outages you can't explain
+and the user reports you can't reproduce. Silent failure is the opposite of
+institutional grade.
+
+## Instructions
+
+1. **Enumerate** empty/near-empty catches:
+ ```bash
+ grep -rIn "catch[^)]*) *{ *}" --include=*.js src/ public/ api/ workers/ | grep -v node_modules
+ grep -rPzoIn "catch\s*\([^)]*\)\s*\{\s*(//[^\n]*)?\s*\}" --include=*.js src/ public/ api/ | grep -v node_modules
+ ```
+ Also review `catch` blocks whose body is only `return null` / `return` /
+ `return []` where the caller can't distinguish "no data" from "it broke."
+2. **Classify each external boundary** (fetch, RPC, pump.fun, LLM proxy, wallet,
+ file/parse) vs **internal logic**. CLAUDE.md: internal code trusts itself;
+ boundaries are where handling belongs.
+3. **For each, pick the right resolution:**
+ - **User-facing UI:** show a designed error state with a recovery action
+ (retry, reconnect wallet, refresh). Never a blank void or a console-only
+ log. Coordinate with [18 — state design](18-state-design-sweep.md).
+ - **Background/worker:** log structured context + retry/backoff where
+ transient (see [10 — resilience](10-resilience-external-calls.md)), then
+ fail loudly to the error pipeline (see [11 — observability](11-observability.md)).
+ - **Truly ignorable** (e.g. `localStorage` blocked in private mode, optional
+ analytics): keep the catch but add a one-line comment stating *why* it is
+ safe to ignore, and degrade gracefully. A justified silent catch is fine;
+ an unexplained one is not.
+4. **Add a shared helper** if a pattern repeats (e.g. `reportError(err, ctx)` and
+ a `withFallback(fn, fallback)`), and route catches through it. Prefer the
+ existing `public/error-reporter.js` if present — extend, don't duplicate.
+5. **Verify behavior, not just code.** For at least the top 10 user-facing
+ boundaries, force the failure (offline, bad input, rejected wallet) in
+ `npm run dev` and confirm the user sees a recoverable state.
+
+## Definition of done
+
+- [ ] Zero unexplained empty `catch {}` in `src/ public/ api/ workers/`. Every
+ remaining bare catch has a one-line justification comment.
+- [ ] Every network/RPC/LLM/wallet boundary surfaces a recoverable UI state or
+ reports to the error pipeline — none swallow silently.
+- [ ] Forced-failure check done on the top 10 boundaries; each degrades
+ gracefully (recorded in your report).
+- [ ] `npm run lint`, `npm run typecheck`, `npm test` pass.
+- [ ] `gap-inventory.json` `emptyCatches` updated.
+- [ ] Changelog: `fix` entry in `data/changelog.json` if users will now see
+ recoverable errors where things used to silently fail.
diff --git a/prompts/tests/03-zero-console-errors.md b/prompts/tests/03-zero-console-errors.md
new file mode 100644
index 000000000..b132ae8b9
--- /dev/null
+++ b/prompts/tests/03-zero-console-errors.md
@@ -0,0 +1,52 @@
+# 03 — Zero console errors & warnings
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 0 — Foundation
+**Owns:** all `pages/`, `src/`, `public/` runtime JS; `public/error-reporter.js`.
+**Depends on:** `02` (dead paths) helps; not strictly required.
+
+## Why this matters for $1B
+`/CLAUDE.md` Definition of done: "No console errors. No console warnings from your
+code." Console noise hides real failures and signals sloppiness to any engineer who
+opens devtools — including the ones doing technical diligence.
+
+## Mission
+Drive the browser console to zero errors and zero own-code warnings on every page,
+in both themes, desktop and mobile viewports.
+
+## Map
+- 125 pages in `pages/`. Shared scripts in `public/` (`nav.js`, `x402.js`,
+ `x402-pay-core.js`, etc.) and modules in `src/`.
+- `public/error-reporter.js` already captures runtime errors — use it as a signal
+ source, and make sure it itself is silent on the happy path.
+- `npm run dev` serves on port 3000.
+
+## Do this
+1. Start `npm run dev`. Write/extend a Playwright sweep (in `scripts/` or
+ `tests/`) that visits every page, in light and dark theme, at 390px and 1440px,
+ and records every `console.{error,warning}` and every failed network request.
+2. Categorize: own-code bugs, third-party library noise, missing assets (404s),
+ uncaught promise rejections, hydration/order issues, CSP violations.
+3. Fix own-code errors and warnings at the root cause. Common culprits: accessing
+ DOM before load, missing null guards, deprecated APIs, passing wrong types,
+ unhandled rejections from `fetch`. Wire proper guards and error boundaries at the
+ network/user-input edges.
+4. Fix every 404 asset (images, fonts, modules, source maps). Cross-check with
+ `npm run check:images`.
+5. For unavoidable third-party warnings, document them in a short allowlist the
+ sweep can ignore — but justify each entry; do not use the allowlist to bury your
+ own noise.
+6. Confirm `error-reporter.js` reports real errors to its backend and produces no
+ output on clean pages.
+
+## Must-not
+- Do not silence errors by wrapping in empty `try/catch`. Handle or surface them.
+- Do not suppress warnings by monkey-patching `console`.
+
+## Acceptance
+- [ ] Playwright console sweep: 0 errors, 0 own-code warnings across all pages × 2 themes × 2 viewports.
+- [ ] 0 failed network requests for first-party assets.
+- [ ] 0 uncaught promise rejections.
+- [ ] Third-party allowlist (if any) is documented and justified.
+- [ ] Sweep wired as a repeatable script and runs in CI.
diff --git a/prompts/tests/04-no-mocks-no-placeholders-sweep.md b/prompts/tests/04-no-mocks-no-placeholders-sweep.md
new file mode 100644
index 000000000..7fa87cf03
--- /dev/null
+++ b/prompts/tests/04-no-mocks-no-placeholders-sweep.md
@@ -0,0 +1,53 @@
+# 04 — No-mocks / no-placeholders sweep
+
+> Part of **Road to $1B** (`prompts/road-to-1b/`). Read `00-README.md` and `/CLAUDE.md` first.
+
+**Phase:** 0 — Foundation
+**Owns:** `src/`, `api/`, `public/`, `pages/` — anywhere a placeholder, mock, stub, or fake-data path ships to production.
+**Depends on:** none.
+
+## Why this matters for $1B
+`/CLAUDE.md` hard rules 1–6: no mocks, no fake data, no placeholders, no TODO
+comments, no stub functions, no `throw new Error("not implemented")`, no
+`setTimeout` fake-loading, no fallback sample arrays in production. There are ~400
+files in `src/api/public/pages` matching placeholder/TODO/mock markers. Each is a
+small lie that compounds.
+
+## Mission
+Find every production code path that fakes, stubs, or defers, and replace it with a
+real implementation wired to real data/APIs — or delete it if it should not exist.
+
+## Map
+- Start from: `grep -rn "TODO\|FIXME\|not implemented\|coming soon\|placeholder\|sampleAgents\|mock\|setTimeout(.*loading\|stub" src api public pages` (filter out node_modules).
+- Real APIs in use: Pump.fun feed, Solana RPC, OpenAI/Anthropic via worker proxies,
+ x402 endpoints. Credentials live in `.env` / `vercel env`.
+
+## Do this
+1. Enumerate all matches. Triage each into: (a) production code that must be real,
+ (b) legitimate test fixtures/mocks (those stay — they belong in `tests/`), (c)
+ dead code to delete, (d) genuine config comments (keep).
+2. For (a): implement the real thing. Wire to the real API/endpoint. If a credential
+ is missing, locate it in `.env` / `vercel env`; if truly absent, implement the
+ real integration and surface a clear, designed error/empty state when the
+ dependency is unavailable — never a fake success.
+3. Replace any `const sample... = [...]` fallback shipped to the client with a real
+ fetch plus a designed empty state (see prompt `12`).
+4. Replace `setTimeout` fake-loading / fake progress with real async indicators tied
+ to actual request lifecycle.
+5. Delete `// TODO`, `// implement later`, commented-out code, and stub functions —
+ by implementing them, not by deleting the comment and leaving the gap.
+6. Convert any `throw new Error("not implemented")` into a working implementation.
+7. Re-run the grep until the only remaining matches are legitimate test fixtures and
+ justified config comments. Document any intentional remaining marker.
+
+## Must-not
+- Do not move a mock from `src/` into `public/` to dodge the grep. Remove the fakery.
+- Do not delete a feature's UI to avoid implementing its backend — implement it.
+- Do not touch the legitimate `tests/` mocks (those are correct).
+
+## Acceptance
+- [ ] Grep for production placeholders/mocks/stubs/TODOs returns only test fixtures and justified config comments.
+- [ ] Every former placeholder path now fetches/uses real data with designed loading/empty/error states.
+- [ ] No `setTimeout` fake-loading remains in shipped code.
+- [ ] No fallback sample arrays shipped to clients.
+- [ ] `npm test` green; affected pages exercised in a real browser with real network calls.
diff --git a/prompts/tests/04-purge-mock-and-fake-data.md b/prompts/tests/04-purge-mock-and-fake-data.md
new file mode 100644
index 000000000..8c5edeb76
--- /dev/null
+++ b/prompts/tests/04-purge-mock-and-fake-data.md
@@ -0,0 +1,68 @@
+# 04 — Purge all mock, sample & fake data
+
+**Phase 1. Serial** after [03](03-harden-error-boundaries.md).
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 3D AI-agent platform. Read
+[CLAUDE.md](../../CLAUDE.md). Rules in play: **No mocks. No fake data. No
+fallback sample arrays shipped to production. Real fetch only. Use real APIs,
+real endpoints, real data.** The only coin is **$THREE** — and **no third-party
+or real mainnet mints in fixtures**; use `$THREE` (CA
+`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`) or a clearly-synthetic
+placeholder like `THREEsynthetic1111…`.
+
+## Objective
+
+Remove every hardcoded sample array, mock object, and fake-data fallback from
+production code paths. Where a UI currently falls back to canned data when a
+fetch fails, replace that with a real loading + empty + error state driven by
+the real API.
+
+## Why it matters
+
+Fake data is a lie to the user and to yourself. It hides broken integrations,
+inflates how finished the product looks, and eventually ships to someone who
+makes a decision based on numbers that were never real. A $1B platform shows
+real state — including "nothing here yet" — never invented state.
+
+## Instructions
+
+1. **Find candidates:**
+ ```bash
+ grep -rIn "const sample\|sampleAgents\|sampleData\|mockData\|fakeData\|dummyData\|placeholderData\|DEMO_\|FALLBACK_DATA\|= \[ *{ *id:" --include=*.js src/ public/ api/ | grep -v node_modules
+ grep -rIn "// fallback\|// sample\|// demo data\|// mock" --include=*.js src/ public/ | grep -v node_modules
+ ```
+ Cross-check against `gap-inventory.json` `mockData`.
+2. **For each hit, classify:**
+ - **Production fallback** (sample array rendered when fetch fails/empty) →
+ **delete it.** Replace with: real fetch → designed loading state → designed
+ empty state ("nothing here yet, do X") → designed error state. No canned
+ rows.
+ - **Test fixture / Storybook / example** under `tests/`, `examples/`,
+ `*.test.js` → allowed to stay, but scrub any real third-party mint/coin/
+ address and replace with `$THREE` CA or a synthetic placeholder.
+ - **Seed data** for a real feature (e.g. onboarding defaults) → keep only if
+ it is genuinely the product's real default, not a stand-in for a missing
+ fetch.
+3. **Wire the real source.** If a component used fake data because no endpoint
+ existed, the endpoint is the missing work — build it (real API in `api/`,
+ real query) and connect it. Do not leave the component dataless.
+4. **Empty states are mandatory.** Every list/grid/feed that loses its fake
+ fallback must gain a real empty state. Coordinate with
+ [18 — state design](18-state-design-sweep.md).
+5. **Verify in the browser** (`npm run dev`): each touched surface shows real
+ data on success, a real empty state with zero items, and a real error state
+ when the API is down (kill the network in devtools to test).
+
+## Definition of done
+
+- [ ] No sample/mock/fake-data array is reachable in any production render path.
+- [ ] Every delisted fallback is replaced by real fetch + loading + empty +
+ error states, verified in the browser.
+- [ ] No real third-party coin/mint/address remains in any fixture; only `$THREE`
+ CA or synthetic placeholders.
+- [ ] Any endpoint that was missing is now built with real data and wired in.
+- [ ] `npm test` passes; `gap-inventory.json` `mockData` updated.
+- [ ] Changelog: `improvement` entry if users now see real data where canned
+ data used to appear.
diff --git a/prompts/tests/05-dead-path-and-handler-audit.md b/prompts/tests/05-dead-path-and-handler-audit.md
new file mode 100644
index 000000000..ef0bf40e1
--- /dev/null
+++ b/prompts/tests/05-dead-path-and-handler-audit.md
@@ -0,0 +1,68 @@
+# 05 — Dead-path & handler audit (every button works, every link goes somewhere)
+
+**Phase 1. Serial** after [04](04-purge-mock-and-fake-data.md).
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 3D AI-agent platform (125 pages, 118 public
+JS, 810 src JS). Read [CLAUDE.md](../../CLAUDE.md). Rules in play: **Eliminate
+dead paths. If a button exists it must work. If a link exists it must go
+somewhere. If a state exists there must be a way to reach it.** There is a repo
+auditor for this: `npm run audit:handlers`. The only coin is **$THREE**.
+
+## Objective
+
+Zero dead interactive elements across the whole app. Every button has a working
+handler, every link resolves to a real route (no 404), every nav item leads
+somewhere real, every reachable state has a path in and a path out.
+
+## Why it matters
+
+Nothing tanks trust faster than a button that does nothing. At a billion-dollar
+bar, the product must feel like everything is wired — because it is. Dead paths
+are the tells of an unfinished product.
+
+## Instructions
+
+1. **Run the auditors and fix to green:**
+ ```bash
+ npm run audit:handlers # empty/no-op handlers
+ npm run audit:pages # page index ↔ files integrity
+ npm run audit:web # broader web audit
+ npm run check:images # broken/lazy images
+ ```
+2. **Find no-op handlers manually too:**
+ ```bash
+ grep -rIn "onclick=\"\"\|onClick={() => {}}\|href=\"#\"\|href=\"javascript:\|addEventListener([^,]*, *function *() *{ *})" --include=*.html --include=*.js public/ pages/ src/ | grep -v node_modules
+ ```
+3. **Crawl the real app** (`npm run dev`, port 3000). For each top surface
+ (home, forge, marketplace, trending, studio, walk, club, reputation,
+ launches, chat, x402 checkout, settings, login): click every button, follow
+ every link, open every menu. Log each dead end.
+4. **Fix each dead path properly:**
+ - Button with no handler → implement the real action it implies.
+ - Link to a missing route → build the route, or repoint to the correct
+ existing one. Never leave `href="#"`.
+ - Unreachable state → add navigation to it, or remove the state if it's
+ vestigial (CLAUDE.md: delete aggressively).
+ - Disabled-forever control → enable it with real behavior or remove it.
+5. **Check cross-surface wiring** (CLAUDE.md "think in systems"): does the
+ marketplace link to agent profiles? Does an agent profile link to its
+ launches, reputation, and chat? Wire the connections that should exist.
+6. **404 + error routes:** confirm a designed 404 page exists and that unknown
+ routes hit it, not a blank screen.
+
+## Definition of done
+
+- [ ] `npm run audit:handlers`, `audit:pages`, `audit:web`, `check:images` all
+ pass.
+- [ ] Manual crawl complete; every button/link on every top surface does
+ something real. The dead-end log is fully resolved (attach it to your
+ report with each item's resolution).
+- [ ] No `href="#"` / `href="javascript:void"` / empty handler remains in
+ shipped HTML/JS.
+- [ ] Cross-surface links that *should* exist now exist (named in your report).
+- [ ] Designed 404/unknown-route handling verified.
+- [ ] `gap-inventory.json` `deadPaths` updated; `npm test` passes.
+- [ ] Changelog: `improvement`/`fix` entry for any user-facing wiring that now
+ works.
diff --git a/prompts/tests/06-three-coin-compliance-sweep.md b/prompts/tests/06-three-coin-compliance-sweep.md
new file mode 100644
index 000000000..67a9fdff2
--- /dev/null
+++ b/prompts/tests/06-three-coin-compliance-sweep.md
@@ -0,0 +1,78 @@
+# 06 — $THREE coin-compliance sweep
+
+**Phase 1. Serial** after [05](05-dead-path-and-handler-audit.md). Highest
+sensitivity — treat any violation like a leaked secret.
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 3D AI-agent platform. Read the **"The only
+coin — $THREE"** section of [CLAUDE.md](../../CLAUDE.md) in full before starting;
+it governs this entire task.
+
+## The rule
+
+**The only coin this platform may ever reference is `$THREE`. Contract address:
+`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`. There are no other coins.** This
+includes any other coin three.ws itself may have launched. Never mention, name,
+hardcode, link, import, render, recommend, or talk about any other coin — in
+code, comments, tests, fixtures, sample data, docs, blog, UI copy, metadata, or
+commit messages.
+
+Two **runtime-data-only** mechanical exceptions exist (do NOT remove these):
+1. Coin-agnostic plumbing where a mint is supplied at runtime by the user (e.g.
+ the pump.fun launcher accepting an arbitrary mint).
+2. Platform launch directories rendering coins users launched through three.ws
+ from real launch records at runtime (`/launches`, agent-profile launch
+ history, `/api/pump/launches` over `pump_agent_mints`).
+In both, never hardcode/market/recommend a specific non-`$THREE` mint.
+
+## Objective
+
+Guarantee the entire repository — code, copy, fixtures, docs, metadata — promotes
+exactly one coin: $THREE. Any hardcoded foreign mint, ticker, or coin reference
+is removed (treated like a leaked secret), except the two runtime-data-only
+exceptions above.
+
+## Instructions
+
+1. **Sweep for foreign coin references.** Search broadly across all text, not
+ just JS:
+ ```bash
+ # Hardcoded Solana-style mint addresses (base58, 32-44 chars) that are NOT $THREE
+ grep -rEIn "[1-9A-HJ-NP-Za-km-z]{32,44}" --include=*.js --include=*.json --include=*.md --include=*.html . | grep -v node_modules | grep -v "FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump"
+ # Known foreign tickers / coin words used as promotion (review hits by hand)
+ grep -rIn "\$[A-Z]\{2,6\}\b" --include=*.js --include=*.md --include=*.html public/ src/ pages/ docs/ blog/ content/ | grep -v "\$THREE" | grep -v node_modules
+ ```
+ Most base58 hits will be legitimate (program IDs, USDC mint for x402 rails,
+ ATAs, pubkeys, synthetic placeholders). **Review every hit by hand** and
+ classify: legitimate infra address (keep), runtime-exception data (keep),
+ synthetic placeholder (keep), or **foreign coin promotion (remove)**.
+2. **USDC is allowed** only as a payment rail / quote mint (x402, pump.fun USDC
+ pairing) — it is plumbing, not a promoted coin. Confirm each USDC reference is
+ rail/quote usage, never "buy USDC the investment."
+3. **For each violation:** remove the reference and replace with `$THREE` (CA
+ above) or a clearly-synthetic placeholder where a token value is structurally
+ required. Scrub fixtures and tests too.
+4. **Check non-code surfaces:** `data/changelog.json`, `public/*.json`, blog
+ posts, docs, OG/meta tags, page `<title>`/descriptions, structured data,
+ sample agent cards.
+5. **Protect the exceptions:** verify you did NOT break the `/launches` feed,
+ agent-profile launch history, `/api/pump/launches`, or the pump.fun launcher's
+ runtime mint input. These render user-launched coins from real records — they
+ are product features, not endorsements.
+6. **Add a guard test** under `tests/` that greps the source tree for hardcoded
+ non-`$THREE` mints outside an allowlist (infra addresses + synthetic
+ placeholders) and fails CI on a new one — so this can never regress.
+
+## Definition of done
+
+- [ ] Every foreign-coin reference in code/copy/fixtures/docs/metadata removed or
+ replaced; each base58/ticker hit reviewed and classified in your report.
+- [ ] No hardcoded non-`$THREE` mint promoted anywhere; USDC only as a rail.
+- [ ] The two runtime-data-only exceptions still work (verified): `/launches`,
+ profile launch history, `/api/pump/launches`, launcher mint input.
+- [ ] A regression guard test exists under `tests/` and passes in CI.
+- [ ] `npm test` passes.
+- [ ] Commit message stays neutral — do NOT restate any removed coin name in the
+ message (CLAUDE.md revert/redeploy rule). Changelog: skip (compliance is
+ not a user-facing feature; never name a removed coin in the changelog).
diff --git a/prompts/tests/07-secrets-and-env-hardening.md b/prompts/tests/07-secrets-and-env-hardening.md
new file mode 100644
index 000000000..f3368d429
--- /dev/null
+++ b/prompts/tests/07-secrets-and-env-hardening.md
@@ -0,0 +1,73 @@
+# 07 — Secrets & environment hardening
+
+**Phase 2. [parallel-safe]** with 08–11.
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 3D AI-agent platform. Backend is Vercel
+functions (`api/`) + Cloudflare workers (`workers/`). There are ~275 keys in
+`.env.example`. Read [CLAUDE.md](../../CLAUDE.md). The only coin is **$THREE**.
+
+## Objective
+
+A clean, documented, leak-proof secrets posture: nothing secret in the repo, a
+single canonical inventory of every env var (what it's for, where it's set, is
+it required), startup validation that fails loudly on missing critical config,
+and a verified separation between client-exposed and server-only values.
+
+## Why it matters
+
+275 env vars is a large attack surface. One leaked private key (Solana deploy
+wallet, parent SNS secret, Telegram bot token, RPC API key) is a catastrophic,
+irreversible event for a token platform. Institutional readiness means you can
+prove no secret is in the tree and every required one is validated at boot.
+
+## Instructions
+
+1. **Scan for committed secrets** (history included):
+ ```bash
+ grep -rIn "PRIVATE_KEY\|SECRET\|_TOKEN\|BASE58\|sk-\|AKIA\|-----BEGIN" --include=*.js --include=*.json --include=*.env* . | grep -v node_modules | grep -v ".env.example"
+ git log --all -p -S "PRIVATE_KEY" -- . | head -200 # spot-check history for leaks
+ ```
+ If a real secret is found in the tree or history, treat it as compromised:
+ rotate it (tell the user which key to rotate and where) and remove it. Do not
+ just delete the line.
+2. **Client vs server boundary.** Any secret referenced in `public/` or in
+ client bundles is exposed. Confirm only intentionally-public values (e.g.
+ `VITE_`-prefixed, public RPC URLs, publishable keys) appear client-side.
+ Anything sensitive in client code is a leak — move it behind an `api/` proxy.
+3. **Build the canonical inventory.** Generate `docs/configuration.md` (or update
+ it) and a checked-in `.env.example` that lists **every** var with: one-line
+ purpose, `required|optional`, `server|client`, and which feature breaks
+ without it. Derive the list from actual `process.env.X` / `import.meta.env.X`
+ usage:
+ ```bash
+ grep -rohE "process\.env\.[A-Z0-9_]+|import\.meta\.env\.[A-Z0-9_]+" --include=*.js . | grep -v node_modules | sort -u
+ ```
+ Flag any var used in code but missing from `.env.example`, and any var in
+ `.env.example` never used in code (dead — remove).
+4. **Startup validation.** Add a single `assertEnv()` / config-loader module that,
+ at function/worker cold start, validates the critical secrets for that surface
+ are present and well-formed, and fails with a clear message naming the missing
+ var. No feature should fail deep in a request because a key was silently
+ undefined.
+5. **`.gitignore` audit.** Confirm `.env`, `.env.*` (except `.env.example`),
+ keypair files, and `~/.claude/*` artifacts are ignored. Add any gaps.
+6. **Rotation runbook.** Document in `docs/configuration.md` how to rotate each
+ class of secret (Solana keypair, RPC key, Telegram token, SNS parent secret)
+ and where it's set (`vercel env`, CF dashboard, etc.).
+
+## Definition of done
+
+- [ ] No real secret in the working tree or surfaced from history (or any found
+ one is flagged for rotation with exact instructions to the user).
+- [ ] No sensitive value reachable from client bundles; sensitive lookups proxied
+ through `api/`.
+- [ ] `.env.example` lists every used var with purpose/required/scope; no
+ used-but-undocumented and no documented-but-dead vars remain.
+- [ ] `assertEnv()` validates critical config at cold start on each surface and
+ fails loudly with the missing var name. Verified by temporarily unsetting
+ one in dev.
+- [ ] `.gitignore` covers all secret/keypair/artifact patterns.
+- [ ] Rotation runbook in `docs/configuration.md`.
+- [ ] Changelog: skip (internal hardening) unless a user-facing config UX changed.
diff --git a/prompts/tests/08-api-hardening.md b/prompts/tests/08-api-hardening.md
new file mode 100644
index 000000000..cc48d11d7
--- /dev/null
+++ b/prompts/tests/08-api-hardening.md
@@ -0,0 +1,73 @@
+# 08 — API hardening: authz, validation, rate limiting
+
+**Phase 2. [parallel-safe]** with 07, 09–11. Large surface — work in batches.
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 3D AI-agent platform. **769 functions in
+`api/`** (Vercel) plus `workers/`. Read [CLAUDE.md](../../CLAUDE.md). Rules:
+**Errors handled at boundaries. No errors without solutions.** The only coin is
+**$THREE**.
+
+## Objective
+
+Every public endpoint is: authenticated/authorized where it touches user data or
+spends money, input-validated on every parameter, rate-limited against abuse,
+and returns consistent, safe error responses (no stack traces, no internal
+detail leaks). Build shared middleware so this is uniform, not per-file.
+
+## Why it matters
+
+769 endpoints is 769 doors. At a billion-dollar bar, an unauthenticated mutation,
+an unvalidated mint/amount, or an un-rate-limited payment endpoint is an exploit
+waiting to be found. Payments, wallet ops, and on-chain actions especially must
+be airtight.
+
+## Instructions
+
+1. **Inventory endpoints and classify** by sensitivity:
+ ```bash
+ find api -name '*.js' | grep -v _lib | grep -v node_modules | wc -l
+ grep -rln "export default\|module.exports" api/ | grep -v node_modules
+ ```
+ Tag each: **public-read** (cacheable, no auth), **auth-read** (needs session),
+ **mutation** (writes data), **money/chain** (payments, mint, transfer, x402,
+ pump). Money/chain is highest priority.
+2. **Shared middleware (build once, apply everywhere)** under `api/_lib/`:
+ - `withAuth(handler, { require: 'session'|'optional' })` — verifies SIWE/email
+ session; reuse the existing auth layer (see `api/auth/`,
+ `src/wallet-auth.js`), don't reinvent.
+ - `withValidation(schema)` — validates query/body against a schema (zod or
+ equivalent already in deps); rejects with 400 + field-level message.
+ Validate types, ranges, addresses (base58/EVM), amounts (positive, bounded).
+ - `withRateLimit({ key, limit, window })` — per-IP and per-session limiting on
+ a shared store (the project already uses KV/Upstash-style storage — reuse
+ it). Strict limits on money/chain and LLM-proxy endpoints.
+ - `safeError(err)` — maps internal errors to safe client responses; never
+ leak stack traces or secrets.
+3. **Apply in priority order:** money/chain → mutations → auth-read →
+ public-read. Commit per batch with explicit paths (concurrent agents share
+ this worktree — never `git add -A`).
+4. **Validate money paths hardest.** For any endpoint that mints, transfers,
+ pays, or launches: re-verify amount bounds, ownership, idempotency (a retried
+ request must not double-spend), and that the mint is the user-supplied runtime
+ value (never a hardcoded foreign coin — $THREE rules apply).
+5. **CORS & methods.** Confirm each endpoint restricts methods (no accidental
+ GET-mutations) and that CORS is as tight as the feature allows.
+6. **Tests.** Add request-level tests under `tests/api/` for: unauthorized
+ access rejected, invalid input rejected with 400, rate limit triggers 429,
+ and the happy path still works. Follow existing patterns in `tests/api/`.
+
+## Definition of done
+
+- [ ] Shared `withAuth` / `withValidation` / `withRateLimit` / `safeError`
+ middleware exists in `api/_lib/` and is reused (not duplicated per file).
+- [ ] 100% of money/chain and mutation endpoints enforce auth + validation +
+ rate limiting; auth-read endpoints enforce auth; the split is documented in
+ `docs/API_AUDIT.md`.
+- [ ] No endpoint returns stack traces or internal detail on error.
+- [ ] Idempotency verified on every spend/mint/transfer path.
+- [ ] New `tests/api/` cases cover authz-reject, validation-reject, rate-limit,
+ and happy path; `npm test` passes.
+- [ ] Changelog: `security` entry in `data/changelog.json` (plain language, e.g.
+ "Hardened API request validation and rate limiting").
diff --git a/prompts/tests/09-security-review.md b/prompts/tests/09-security-review.md
new file mode 100644
index 000000000..7af2f4022
--- /dev/null
+++ b/prompts/tests/09-security-review.md
@@ -0,0 +1,70 @@
+# 09 — Security review: payments, wallets, contracts
+
+**Phase 2. [parallel-safe]** with 07–08, 10–11. Authorized internal security
+review of our own platform.
+
+## Where you are
+
+`/workspaces/three.ws` — three.ws, 3D AI-agent platform with real money flows:
+Solana + x402 USDC payments, pump.fun launches, agent wallets, on-chain identity
+(`contracts/`, ERC-8004), skill-license NFTs, SNS pay-by-name. Read
+[CLAUDE.md](../../CLAUDE.md). The only coin is **$THREE**. There is a
+`/security-review` skill and `docs/audits/` — use them.
+
+## Objective
+
+A focused security review of every surface where value moves or trust is
+asserted, with each finding either fixed or filed with a concrete remediation.
+This is defensive review of our own code — not exploitation of third parties.
+
+## Why it matters
+
+A token platform is a target. One reentrancy bug in a contract, one missing
+signature check in a payment verifier, one replayable x402 receipt, one agent
+wallet that can be drained — any of these ends the company. Billion-dollar trust
+is earned by being provably hard to rob.
+
+## Instructions
+
+1. **Run the built-in review** on the current tree and capture output:
+ - Invoke the `/security-review` skill (or `npm run` equivalent if wired).
+ - `npm audit --omit=dev` for dependency CVEs; triage criticals.
+2. **Payments / x402** (`api/x402*`, `public/x402*.js`, `x402-buildout/`):
+ - Verify payment receipts can't be replayed (nonce/expiry checked).
+ - Verify the amount/asset/recipient in the signed payload match what the
+ server charges — no client-trusted price.
+ - Verify settlement is idempotent and that a failed settlement can't grant
+ access. Confirm the facilitator/verifier responses are validated, not
+ trusted blindly.
+3. **Wallets & custody** (`public/wallet/`, agent-wallet prompts, session keys):
+ - Confirm private keys / seed material never touch the client or logs.
+ - Review any server-side signing: least privilege, bounded amounts, no
+ arbitrary-instruction signing from unvalidated input.
+ - SIWE/session: nonce, domain binding, expiry, and that a session can't be
+ replayed or fixated.
+4. **On-chain programs** (`contracts/`, Anchor + Foundry):
+ - Review access control (who can mint/close/transfer), integer overflow,
+ PDA/seed derivation, signer checks, and reentrancy where applicable.
+ - Run the contract test suites; add tests for any unchecked authority.
+5. **Web app**: XSS in any place user content is rendered (agent names, chat,
+ profiles) — confirm output is escaped/sanitized; CSP headers present;
+ no `dangerouslySetInnerHTML`/`innerHTML` with untrusted input; SSRF in any
+ server-side fetch that takes a user URL; open-redirect in auth callbacks.
+6. **Secrets**: cross-check with [07](07-secrets-and-env-hardening.md) — no key
+ in client, no token in logs.
+7. **Write `docs/audits/security-review-YYYY-MM-DD.md`**: each finding with
+ severity (crit/high/med/low), location, impact, and status (fixed | filed).
+ Fix all crit/high in this task; file med/low with owners.
+
+## Definition of done
+
+- [ ] `/security-review` + `npm audit` run; results captured in the report.
+- [ ] x402 replay, amount-tampering, and idempotency checks verified or fixed.
+- [ ] No private key/seed reachable from client or logs (confirmed).
+- [ ] Contract access-control / signer / overflow review done; contract tests
+ pass; new tests added for any gap found.
+- [ ] XSS / CSP / SSRF / open-redirect checks done on user-content surfaces.
+- [ ] `docs/audits/security-review-<today>.md` committed with severity-rated
+ findings; all critical & high fixed.
+- [ ] Changelog: `security` entry for any user-relevant hardening (never disclose
+ an unpatched vuln in the public changelog).
diff --git a/scripts/audit-links.mjs b/scripts/audit-links.mjs
new file mode 100644
index 000000000..08b7fb9cf
--- /dev/null
+++ b/scripts/audit-links.mjs
@@ -0,0 +1,347 @@
+#!/usr/bin/env node
+/**
+ * audit-links.mjs — static link & route integrity audit for the whole site.
+ *
+ * Crawls every navigable target across pages/, public/ and src/ — `href`,
+ * `action`, `data-href`/`data-route`/`data-link`, JS `location`/`window.open`
+ * navigations, and internal `fetch()` targets — then resolves each one against
+ * the real routing model so a dead path can never ship unseen:
+ *
+ * • internal clean URL (/marketplace, /u/:id …) → must resolve to a specific
+ * vercel.json route OR a real source file (pages/**, public/**). The two
+ * catch-alls (/(.*) and the asset glob) are NOT treated as proof — they only
+ * serve a literal file, so existence is checked directly.
+ * • internal /api/* → must resolve to a vercel route or an api/ handler file.
+ * • stub hrefs (#, "", javascript:void(0)) → flagged; never allowed to ship.
+ * • dangling routes — a vercel route whose .html dest has no source file.
+ * • external http(s) links → collected; liveness checked only with --external
+ * (network) so the default run is deterministic and offline/CI-safe.
+ *
+ * Dynamic targets (template literals with ${…}, string concatenation) are
+ * reported separately as "skipped" rather than guessed — they're not failures.
+ *
+ * Usage:
+ * node scripts/audit-links.mjs # offline integrity audit (gate)
+ * node scripts/audit-links.mjs --external # also probe external links (slow)
+ * node scripts/audit-links.mjs --json # machine-readable report to stdout
+ * node scripts/audit-links.mjs --report # write reports/link-audit-*.json
+ *
+ * Exit code is non-zero when broken internal links, stub hrefs, or dangling
+ * routes are found — so it can gate CI. External failures only warn.
+ */
+
+import { readFileSync, existsSync, statSync, readdirSync, writeFileSync, mkdirSync } from 'node:fs';
+import { resolve, join, dirname, extname } from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+const __dirname = dirname(fileURLToPath(import.meta.url));
+const ROOT = resolve(__dirname, '..');
+
+const args = new Set(process.argv.slice(2));
+const CHECK_EXTERNAL = args.has('--external');
+const AS_JSON = args.has('--json');
+const WRITE_REPORT = args.has('--report');
+
+// ── Filesystem walk ──────────────────────────────────────────────────────────
+function walk(dir, exts, out = []) {
+ let entries;
+ try {
+ entries = readdirSync(dir, { withFileTypes: true });
+ } catch {
+ return out;
+ }
+ for (const e of entries) {
+ if (e.name.startsWith('.') || e.name === 'node_modules') continue;
+ const full = join(dir, e.name);
+ if (e.isDirectory()) walk(full, exts, out);
+ else if (exts.has(extname(e.name))) out.push(full);
+ }
+ return out;
+}
+
+function fileExists(p) {
+ try {
+ return statSync(p).isFile();
+ } catch {
+ return false;
+ }
+}
+
+// ── Route table from vercel.json ─────────────────────────────────────────────
+const vercel = JSON.parse(readFileSync(join(ROOT, 'vercel.json'), 'utf8'));
+
+const ASSET_CATCHALL = '/(.*\\.(?:svg|png|jpg|jpeg|gif|webp|avif|ico|woff2|woff|ttf|otf|glb|gltf|hdr|exr|ktx2|basis|bin))$';
+const isCatchAll = (src) => src === '/(.*)' || src === ASSET_CATCHALL;
+
+// Specific routes that actually resolve a request to something (have a dest).
+const destRoutes = (vercel.routes || []).filter((r) => r.dest && !isCatchAll(r.src));
+
+const compiledRoutes = destRoutes.map((r) => {
+ let s = r.src;
+ if (!s.startsWith('^')) s = '^' + s;
+ if (!s.endsWith('$')) s = s + '$';
+ let re = null;
+ try {
+ re = new RegExp(s);
+ } catch {
+ re = null;
+ }
+ return { re, dest: r.dest, src: r.src };
+});
+
+function matchRoute(path) {
+ for (const r of compiledRoutes) {
+ if (r.re && r.re.test(path)) return r;
+ }
+ return null;
+}
+
+// Does a clean path resolve to a real source file (what the catch-all serves)?
+function fileForCleanPath(path) {
+ const p = path.replace(/^\/+/, '').replace(/\/+$/, '');
+ if (p === '') return 'pages/home.html'; // root served from a real homepage
+ // /src/** and /node_modules/** are served straight from the repo by vite in dev
+ // and rewritten to hashed assets at build time — resolve against the real tree.
+ if (p.startsWith('src/') || p.startsWith('node_modules/')) {
+ return fileExists(join(ROOT, p)) ? p : null;
+ }
+ const candidates = [
+ join('public', p),
+ join('public', p + '.html'),
+ join('public', p, 'index.html'),
+ join('pages', p + '.html'),
+ join('pages', p, 'index.html'),
+ join('pages', p), // already has extension (e.g. /foo.html)
+ ];
+ for (const c of candidates) {
+ if (fileExists(join(ROOT, c))) return c;
+ }
+ return null;
+}
+
+// Resolve a relative (non-/) link against the directory of the file it lives in.
+function fileForRelative(rel, baseDir) {
+ const cleaned = rel.replace(/\/+$/, '');
+ const base = join(ROOT, baseDir);
+ const candidates = [
+ join(base, cleaned),
+ join(base, cleaned + '.html'),
+ join(base, cleaned, 'index.html'),
+ ];
+ return candidates.some((c) => fileExists(c));
+}
+
+function apiResolves(path) {
+ // vercel route maps it, or an api/ handler file exists.
+ if (matchRoute(path)) return true;
+ const p = path.replace(/^\/+/, '');
+ const bases = [join(ROOT, p), join(ROOT, p + '.js'), join(ROOT, p, 'index.js')];
+ return bases.some((b) => fileExists(b));
+}
+
+// ── Resolve a single internal target ─────────────────────────────────────────
+function resolveInternal(rawTarget, baseDir) {
+ const target = rawTarget.split('#')[0].split('?')[0];
+ if (target === '') return { ok: true }; // pure #anchor / query on current page
+ // Relative path (not root-absolute) → resolve against the file's own directory.
+ if (!target.startsWith('/')) {
+ return fileForRelative(target, baseDir) ? { ok: true } : { ok: false, kind: 'relative' };
+ }
+ if (target.startsWith('/api/')) {
+ return apiResolves(target) ? { ok: true } : { ok: false, kind: 'api' };
+ }
+ const route = matchRoute(target);
+ if (route) {
+ // Route maps it — confirm an html dest's source actually exists (dangling check
+ // happens separately; here a matched route is enough to call the link reachable).
+ return { ok: true, via: route.src };
+ }
+ const file = fileForCleanPath(target);
+ if (file) return { ok: true, via: file };
+ return { ok: false, kind: 'page' };
+}
+
+// ── Target extraction ────────────────────────────────────────────────────────
+const STUB_VALUES = new Set(['#', '', 'javascript:void(0)', 'javascript:void(0);', 'javascript:;', 'javascript:']);
+
+function classifyTarget(value) {
+ const v = (value || '').trim();
+ if (STUB_VALUES.has(v.toLowerCase())) return { type: 'stub', value: v };
+ // javascript:void(0) is a stub; any other javascript: URL runs real code → scheme.
+ if (/^(mailto:|tel:|sms:|data:|blob:|javascript:)/i.test(v)) return { type: 'scheme', value: v };
+ if (/^https?:\/\//i.test(v)) return { type: 'external', value: v };
+ if (/^\/\//.test(v)) return { type: 'external', value: 'https:' + v };
+ if (v.includes('${') || /["'`]\s*\+/.test(v) || v.includes('+ ')) return { type: 'dynamic', value: v };
+ if (v.startsWith('#')) return { type: 'anchor', value: v };
+ if (v.startsWith('/') || /^[\w.-]/.test(v)) return { type: 'internal', value: v };
+ return { type: 'dynamic', value: v };
+}
+
+// Lookbehind blocks `data-action`/`reaction`/etc. from matching the bare `action`
+// attribute — only a real navigable attribute (preceded by whitespace or tag-open).
+const htmlAttrRe = /(?<![\w-])(?:href|formaction|action|data-href|data-route|data-link|data-target-href)\s*=\s*("([^"]*)"|'([^']*)')/gi;
+const jsNavRe = /(?:\.href\s*=|location\.(?:assign|replace)\s*\(|window\.open\s*\(|\bhref\s*:|\bnavigateTo\s*\(|\brouteTo\s*\()\s*("([^"]*)"|'([^']*)'|`([^`$]*)`)/gi;
+const fetchRe = /\bfetch\s*\(\s*("([^"]*)"|'([^']*)'|`([^`$]*)`)/gi;
+
+function lineOf(content, index) {
+ let line = 1;
+ for (let i = 0; i < index && i < content.length; i++) if (content[i] === '\n') line++;
+ return line;
+}
+
+const findings = {
+ brokenInternal: [],
+ stubs: [],
+ external: new Map(), // url -> [{file,line}]
+ dynamic: 0,
+ scanned: 0,
+};
+
+function record(target, file, line) {
+ const rel = file.replace(ROOT + '/', '');
+ const baseDir = dirname(rel); // for resolving relative links from this file's dir
+ const c = classifyTarget(target);
+ if (c.type === 'stub') {
+ findings.stubs.push({ file: rel, line, value: c.value });
+ return;
+ }
+ if (c.type === 'external') {
+ const list = findings.external.get(c.value) || [];
+ list.push({ file: rel, line });
+ findings.external.set(c.value, list);
+ return;
+ }
+ if (c.type === 'internal') {
+ const r = resolveInternal(c.value, baseDir);
+ if (!r.ok) findings.brokenInternal.push({ file: rel, line, value: c.value, kind: r.kind });
+ return;
+ }
+ if (c.type === 'dynamic') findings.dynamic++;
+ // scheme / anchor → fine
+}
+
+function scanFile(file) {
+ const content = readFileSync(file, 'utf8');
+ const isJs = /\.m?js$/.test(file);
+ findings.scanned++;
+ let m;
+ if (!isJs) {
+ htmlAttrRe.lastIndex = 0;
+ while ((m = htmlAttrRe.exec(content))) {
+ record(m[2] ?? m[3] ?? '', file, lineOf(content, m.index));
+ }
+ // Inline <script> nav + fetch inside HTML too.
+ }
+ jsNavRe.lastIndex = 0;
+ while ((m = jsNavRe.exec(content))) {
+ record(m[2] ?? m[3] ?? m[4] ?? '', file, lineOf(content, m.index));
+ }
+ fetchRe.lastIndex = 0;
+ while ((m = fetchRe.exec(content))) {
+ const t = m[2] ?? m[3] ?? m[4] ?? '';
+ if (t.startsWith('/')) record(t, file, lineOf(content, m.index)); // only internal fetches
+ }
+}
+
+// ── Dangling-route check: vercel route → missing source file ─────────────────
+function danglingRoutes() {
+ const out = [];
+ for (const r of destRoutes) {
+ const dest = r.dest.split('?')[0];
+ if (!dest.endsWith('.html')) continue;
+ if (dest.includes('$')) continue; // dest uses a capture group — resolved per-request
+ const p = dest.replace(/^\/+/, '');
+ const exists = fileExists(join(ROOT, 'pages', p)) || fileExists(join(ROOT, 'public', p));
+ if (!exists) out.push({ src: r.src, dest: r.dest });
+ }
+ return out;
+}
+
+// ── External liveness (opt-in) ───────────────────────────────────────────────
+async function probeExternal(urls) {
+ const dead = [];
+ const queue = [...urls];
+ const CONCURRENCY = 12;
+ async function worker() {
+ while (queue.length) {
+ const url = queue.shift();
+ let ok = false;
+ let status = 0;
+ try {
+ const ctrl = new AbortController();
+ const t = setTimeout(() => ctrl.abort(), 10000);
+ let res = await fetch(url, { method: 'HEAD', redirect: 'follow', signal: ctrl.signal });
+ if (res.status === 405 || res.status === 403 || res.status === 501) {
+ res = await fetch(url, { method: 'GET', redirect: 'follow', signal: ctrl.signal });
+ }
+ clearTimeout(t);
+ status = res.status;
+ ok = res.status < 400;
+ } catch (e) {
+ status = e.name === 'AbortError' ? 'timeout' : 'error';
+ }
+ if (!ok) dead.push({ url, status });
+ }
+ }
+ await Promise.all(Array.from({ length: CONCURRENCY }, worker));
+ return dead;
+}
+
+// ── Run ──────────────────────────────────────────────────────────────────────
+const exts = new Set(['.html', '.js', '.mjs']);
+const files = [...walk(join(ROOT, 'pages'), exts), ...walk(join(ROOT, 'public'), exts), ...walk(join(ROOT, 'src'), exts)];
+for (const f of files) scanFile(f);
+
+const dangling = danglingRoutes();
+const externalUrls = [...findings.external.keys()];
+
+let externalDead = [];
+if (CHECK_EXTERNAL) externalDead = await probeExternal(externalUrls);
+
+const report = {
+ scannedFiles: findings.scanned,
+ brokenInternal: findings.brokenInternal,
+ stubs: findings.stubs,
+ danglingRoutes: dangling,
+ externalCount: externalUrls.length,
+ externalDead,
+ dynamicSkipped: findings.dynamic,
+};
+
+if (AS_JSON) {
+ console.log(JSON.stringify(report, null, 2));
+} else {
+ const line = (s = '') => console.log(s);
+ line(`Link audit — scanned ${findings.scanned} files`);
+ line('');
+ line(`Broken internal links : ${findings.brokenInternal.length}`);
+ for (const b of findings.brokenInternal.slice(0, 60)) line(` ✗ ${b.value} (${b.kind}) — ${b.file}:${b.line}`);
+ if (findings.brokenInternal.length > 60) line(` … +${findings.brokenInternal.length - 60} more`);
+ line('');
+ line(`Stub hrefs (#, void(0)) : ${findings.stubs.length}`);
+ for (const s of findings.stubs.slice(0, 40)) line(` ✗ "${s.value}" — ${s.file}:${s.line}`);
+ if (findings.stubs.length > 40) line(` … +${findings.stubs.length - 40} more`);
+ line('');
+ line(`Dangling routes (→ missing file) : ${dangling.length}`);
+ for (const d of dangling) line(` ✗ ${d.src} → ${d.dest}`);
+ line('');
+ line(`External links collected : ${externalUrls.length}`);
+ if (CHECK_EXTERNAL) {
+ line(`Dead external links : ${externalDead.length}`);
+ for (const d of externalDead) line(` ✗ [${d.status}] ${d.url}`);
+ } else {
+ line(' (run with --external to probe liveness)');
+ }
+ line('');
+ line(`Dynamic targets skipped : ${findings.dynamic}`);
+}
+
+if (WRITE_REPORT) {
+ mkdirSync(join(ROOT, 'reports'), { recursive: true });
+ const out = join(ROOT, 'reports', `link-audit-${Date.now()}.json`);
+ writeFileSync(out, JSON.stringify(report, null, 2));
+ console.log(`\nReport: ${out.replace(ROOT + '/', '')}`);
+}
+
+const hardFails = findings.brokenInternal.length + findings.stubs.length + dangling.length;
+if (hardFails > 0) process.exitCode = 1;
diff --git a/scripts/i18n-rc.schema.json b/scripts/i18n-rc.schema.json
index 56dac3786..ee6765189 100644
--- a/scripts/i18n-rc.schema.json
+++ b/scripts/i18n-rc.schema.json
@@ -9,11 +9,19 @@
"type": "string",
"description": "Source-of-truth locale JSON (the entryLocale catalog)."
},
- "entryLocale": { "type": "string", "description": "Reference language code, e.g. 'en'." },
- "output": { "type": "string", "description": "Directory holding all locale JSON files." },
+ "entryLocale": {
+ "type": "string",
+ "description": "Reference language code, e.g. 'en'."
+ },
+ "output": {
+ "type": "string",
+ "description": "Directory holding all locale JSON files."
+ },
"outputLocales": {
"type": "array",
- "items": { "type": "string" },
+ "items": {
+ "type": "string"
+ },
"description": "Target language codes to generate."
},
"localeNames": {
@@ -22,16 +30,28 @@
},
"rtlLocales": {
"type": "array",
- "items": { "type": "string" },
+ "items": {
+ "type": "string"
+ },
"description": "Locale codes that render right-to-left."
},
"provider": {
- "enum": ["gemini", "openai", "anthropic"],
- "description": "Which LLM backend to translate with."
+ "enum": ["gemini", "groq", "openrouter", "nvidia", "openai", "anthropic"],
+ "description": "LLM backend. Free lanes: groq, gemini (free tier), openrouter (:free models), nvidia."
+ },
+ "modelName": {
+ "type": "string"
+ },
+ "temperature": {
+ "type": "number",
+ "minimum": 0,
+ "maximum": 2
+ },
+ "topP": {
+ "type": "number",
+ "minimum": 0,
+ "maximum": 1
},
- "modelName": { "type": "string" },
- "temperature": { "type": "number", "minimum": 0, "maximum": 2 },
- "topP": { "type": "number", "minimum": 0, "maximum": 1 },
"concurrency": {
"type": "integer",
"minimum": 1,
@@ -53,13 +73,25 @@
"htmlExtract": {
"type": "object",
"properties": {
- "entry": { "type": "array", "items": { "type": "string" } },
- "exclude": { "type": "array", "items": { "type": "string" } }
+ "entry": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "exclude": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
}
},
"doNotTranslate": {
"type": "array",
- "items": { "type": "string" },
+ "items": {
+ "type": "string"
+ },
"description": "Brand/protocol terms masked verbatim so the model can never alter them."
}
}
diff --git a/scripts/i18n-translate.mjs b/scripts/i18n-translate.mjs
index 2c4c0fa8a..98776914c 100644
--- a/scripts/i18n-translate.mjs
+++ b/scripts/i18n-translate.mjs
@@ -109,6 +109,62 @@ function chunkKeys(keys, budgetChars) {
}
// --- LLM backends ----------------------------------------------------------
+//
+// Every backend below is free-tier capable. Gemini and Anthropic use native
+// APIs; the rest are OpenAI-compatible chat-completions endpoints, so a single
+// caller serves all of them. Env-var names and model defaults match
+// api/_lib/chat-models.js, so a key that already powers /chat works here too.
+//
+// Free lanes (no card required):
+// groq GROQ_API_KEY https://console.groq.com/keys
+// gemini GEMINI_API_KEY https://aistudio.google.com/apikey (free tier)
+// openrouter OPENROUTER_API_KEY https://openrouter.ai/keys (use a :free model)
+// nvidia NVIDIA_API_KEY https://build.nvidia.com (free NIM credits)
+
+const PROVIDER_DEFAULT_MODEL = {
+ gemini: 'gemini-2.5-flash',
+ groq: 'llama-3.3-70b-versatile',
+ openrouter: 'meta-llama/llama-3.3-70b-instruct:free',
+ nvidia: 'meta/llama-3.3-70b-instruct',
+ openai: 'gpt-4o-mini',
+ anthropic: 'claude-haiku-4-5-20251001',
+};
+
+// OpenAI-compatible lanes. jsonMode is set only where the endpoint reliably
+// honors response_format:json_object — free models often 400 on it, so those
+// rely on prompt-enforced JSON plus fence stripping instead.
+const OPENAI_COMPAT = {
+ groq: {
+ envKey: 'GROQ_API_KEY',
+ url: () => 'https://api.groq.com/openai/v1/chat/completions',
+ jsonMode: true,
+ },
+ openrouter: {
+ envKey: 'OPENROUTER_API_KEY',
+ url: () => 'https://openrouter.ai/api/v1/chat/completions',
+ extraHeaders: { 'HTTP-Referer': 'https://three.ws', 'X-Title': 'three.ws i18n' },
+ },
+ nvidia: {
+ envKey: 'NVIDIA_API_KEY',
+ url: () => 'https://integrate.api.nvidia.com/v1/chat/completions',
+ },
+ openai: {
+ envKey: 'OPENAI_API_KEY',
+ url: () => `${process.env.OPENAI_BASE_URL || 'https://api.openai.com/v1'}/chat/completions`,
+ jsonMode: true,
+ },
+};
+
+function httpError(provider, status, body, retryAfter) {
+ return Object.assign(new Error(`${provider} ${status}: ${String(body).slice(0, 300)}`), {
+ status,
+ retryAfter,
+ });
+}
+
+function modelName() {
+ return cfg.modelName || PROVIDER_DEFAULT_MODEL[cfg.provider] || PROVIDER_DEFAULT_MODEL.gemini;
+}
function stripFences(text) {
return text
@@ -124,9 +180,9 @@ function buildPrompt(langName, payload) {
'',
'Rules:',
`- Translate every VALUE in the JSON below into ${langName}. Keep every KEY exactly as-is.`,
- '- Return ONLY a single minified JSON object with the same keys. No prose, no code fences.',
- '- Some values contain sentinel runs of unusual non-Latin control characters (private-use-area glyphs surrounding digits). These are protected tokens for brand names, code, and placeholders. Reproduce every such sentinel EXACTLY, in a natural position for the target language. Never translate, reorder the digits, drop, or add them.',
- '- Preserve meaning, tone, and any HTML that survives as a sentinel. Do not add explanations.',
+ '- Return ONLY a single JSON object with the same keys. No prose, no markdown, no code fences.',
+ '- Some values contain protected tokens written as [[T0]], [[T1]], and so on. They stand in for brand names, code, and placeholders. Copy each token VERBATIM into a natural position for the target language. Never translate a token, change its number, add one, or drop one.',
+ '- Preserve meaning and tone. Do not add explanations.',
'',
'JSON to translate:',
JSON.stringify(payload),
@@ -140,9 +196,11 @@ async function callGemini(prompt) {
process.env.GEMINI_API_KEY ||
process.env.GOOGLE_API_KEY ||
process.env.GOOGLE_GENAI_API_KEY;
- if (!key) throw new Error('GEMINI_API_KEY (or GOOGLE_API_KEY) not set');
- const model = cfg.modelName || 'gemini-2.5-flash';
- const url = `https://generativelanguage.googleapis.com/v1beta/models/${model}:generateContent?key=${key}`;
+ if (!key)
+ throw new Error(
+ 'GEMINI_API_KEY (or GOOGLE_API_KEY) not set — free keys: https://aistudio.google.com/apikey',
+ );
+ const url = `https://generativelanguage.googleapis.com/v1beta/models/${modelName()}:generateContent?key=${key}`;
const res = await fetch(url, {
method: 'POST',
headers: { 'content-type': 'application/json' },
@@ -155,33 +213,19 @@ async function callGemini(prompt) {
},
}),
});
- if (!res.ok) throw new Error(`gemini ${res.status}: ${(await res.text()).slice(0, 300)}`);
+ if (!res.ok)
+ throw httpError(
+ 'gemini',
+ res.status,
+ await res.text(),
+ Number(res.headers.get('retry-after')) || 0,
+ );
const data = await res.json();
const text = data?.candidates?.[0]?.content?.parts?.map((p) => p.text).join('') || '';
if (!text) throw new Error('gemini returned empty content');
return text;
}
-async function callOpenAI(prompt) {
- const key = process.env.OPENAI_API_KEY;
- if (!key) throw new Error('OPENAI_API_KEY not set');
- const base = process.env.OPENAI_BASE_URL || 'https://api.openai.com/v1';
- const res = await fetch(`${base}/chat/completions`, {
- method: 'POST',
- headers: { 'content-type': 'application/json', authorization: `Bearer ${key}` },
- body: JSON.stringify({
- model: cfg.modelName || 'gpt-4o-mini',
- temperature: cfg.temperature ?? 0.2,
- top_p: cfg.topP ?? 0.9,
- response_format: { type: 'json_object' },
- messages: [{ role: 'user', content: prompt }],
- }),
- });
- if (!res.ok) throw new Error(`openai ${res.status}: ${(await res.text()).slice(0, 300)}`);
- const data = await res.json();
- return data?.choices?.[0]?.message?.content || '';
-}
-
async function callAnthropic(prompt) {
const key = process.env.ANTHROPIC_API_KEY;
if (!key) throw new Error('ANTHROPIC_API_KEY not set');
@@ -193,30 +237,80 @@ async function callAnthropic(prompt) {
'anthropic-version': '2023-06-01',
},
body: JSON.stringify({
- model: cfg.modelName || 'claude-haiku-4-5-20251001',
+ model: modelName(),
max_tokens: 8192,
temperature: cfg.temperature ?? 0.2,
messages: [{ role: 'user', content: prompt }],
}),
});
- if (!res.ok) throw new Error(`anthropic ${res.status}: ${(await res.text()).slice(0, 300)}`);
+ if (!res.ok)
+ throw httpError(
+ 'anthropic',
+ res.status,
+ await res.text(),
+ Number(res.headers.get('retry-after')) || 0,
+ );
const data = await res.json();
return data?.content?.map((b) => b.text || '').join('') || '';
}
-const BACKENDS = { gemini: callGemini, openai: callOpenAI, anthropic: callAnthropic };
+async function callOpenAICompat(prompt) {
+ const spec = OPENAI_COMPAT[cfg.provider];
+ const key = process.env[spec.envKey];
+ if (!key) throw new Error(`${spec.envKey} not set`);
+ const body = {
+ model: modelName(),
+ temperature: cfg.temperature ?? 0.2,
+ top_p: cfg.topP ?? 0.9,
+ messages: [{ role: 'user', content: prompt }],
+ };
+ if (spec.jsonMode) body.response_format = { type: 'json_object' };
+ const res = await fetch(spec.url(), {
+ method: 'POST',
+ headers: {
+ 'content-type': 'application/json',
+ authorization: `Bearer ${key}`,
+ ...(spec.extraHeaders || {}),
+ },
+ body: JSON.stringify(body),
+ });
+ if (!res.ok)
+ throw httpError(
+ cfg.provider,
+ res.status,
+ await res.text(),
+ Number(res.headers.get('retry-after')) || 0,
+ );
+ const data = await res.json();
+ return data?.choices?.[0]?.message?.content || '';
+}
+
+function backend() {
+ if (cfg.provider === 'gemini') return callGemini;
+ if (cfg.provider === 'anthropic') return callAnthropic;
+ if (OPENAI_COMPAT[cfg.provider]) return callOpenAICompat;
+ throw new Error(
+ `unknown provider: ${cfg.provider} (use gemini, groq, openrouter, nvidia, openai, or anthropic)`,
+ );
+}
async function translateChunk(langName, payload, attempt = 0) {
- const call = BACKENDS[cfg.provider || 'gemini'];
- if (!call) throw new Error(`unknown provider: ${cfg.provider}`);
+ const call = backend();
try {
const raw = await call(buildPrompt(langName, payload));
const parsed = JSON.parse(stripFences(raw));
if (!parsed || typeof parsed !== 'object') throw new Error('non-object response');
return parsed;
} catch (err) {
- if (attempt < 2) {
- await new Promise((r) => setTimeout(r, 400 * (attempt + 1)));
+ // Free tiers rate-limit hard; honor Retry-After and back off more on a 429
+ // than on a transient parse/5xx error.
+ const max = err.status === 429 ? 5 : 2;
+ if (attempt < max) {
+ const wait =
+ err.status === 429
+ ? Math.max((err.retryAfter || 0) * 1000, 2000 * (attempt + 1))
+ : 400 * (attempt + 1);
+ await new Promise((r) => setTimeout(r, wait));
return translateChunk(langName, payload, attempt + 1);
}
throw err;
diff --git a/scripts/lib/i18n-shared.mjs b/scripts/lib/i18n-shared.mjs
index a56b61f1d..c1eb05721 100644
--- a/scripts/lib/i18n-shared.mjs
+++ b/scripts/lib/i18n-shared.mjs
@@ -108,7 +108,10 @@ function escapeRe(s) {
export function buildMasker(doNotTranslate = []) {
// Longer terms first so "IBM watsonx.ai" masks before "watsonx.ai".
const terms = [...doNotTranslate].sort((a, b) => b.length - a.length);
- const sentinel = (i) => `${i}`; // private-use-area, never in real copy
+ // An ASCII token ([[T0]], [[T1]], …): vanishingly rare in real copy and
+ // reproduced reliably even by small/free models, which tend to normalize
+ // exotic Unicode sentinels away.
+ const sentinel = (i) => `[[T${i}]]`;
function mask(text) {
if (typeof text !== 'string') return { masked: text, tokens: [] };
@@ -133,7 +136,7 @@ export function buildMasker(doNotTranslate = []) {
function unmask(text, tokens) {
if (typeof text !== 'string') return text;
- return text.replace(/(\d+)/g, (_, i) => tokens[Number(i)] ?? '');
+ return text.replace(/\[\[T(\d+)\]\]/g, (_, i) => tokens[Number(i)] ?? '');
}
return { mask, unmask };
diff --git a/src/dashboard-next/components/topbar.js b/src/dashboard-next/components/topbar.js
index 96f120891..4c04fc329 100644
--- a/src/dashboard-next/components/topbar.js
+++ b/src/dashboard-next/components/topbar.js
@@ -456,13 +456,42 @@ function renderWalkLiveState(host, avatar) {
frame.loading = 'lazy';
frame.allowTransparency = 'true';
frame.src = `/walk-embed?${qs.toString()}`;
- // Reveal only once the avatar is actually loaded — avoids a flash of
- // the (transparent) empty scene before the GLB resolves.
- frame.addEventListener('load', () => {
+
+ // Reveal only once the embed reports the avatar is loaded AND animating.
+ // The iframe's DOM `load` event fires far earlier — the document is parsed
+ // before the GLB and walk clips resolve (those load async). Revealing on it
+ // exposed the bare frame mid-load: a white pre-paint flash, then the model
+ // frozen in its bind-pose T-pose, before the walk clip applied. We instead
+ // hold the dark skeleton until the embed posts `walk:ready` over the
+ // three-walk channel, which fires only after it crossfades into motion.
+ let revealed = false;
+ const reveal = () => {
+ if (revealed) return;
+ revealed = true;
host.dataset.ready = '1';
+ frame.classList.add('is-ready');
const skel = stage.querySelector('.dn-walk-avatar-skel');
if (skel) skel.remove();
+ window.removeEventListener('message', onReady);
+ clearTimeout(failsafe);
+ };
+ function onReady(e) {
+ if (e.source !== frame.contentWindow) return;
+ const d = e.data;
+ if (d && d.type === 'walk:ready') reveal();
+ }
+ window.addEventListener('message', onReady);
+ // `walk:ready` is a one-shot — a host that finishes wiring after the embed
+ // already loaded would miss it. Ping on DOM load so the embed re-emits it.
+ frame.addEventListener('load', () => {
+ try {
+ frame.contentWindow?.postMessage({ channel: 'three-walk', v: 1, type: 'walk:ping' }, '*');
+ } catch (_) {}
});
+ // Failsafe: never strand the skeleton if the ready signal is lost (embed
+ // error, blocked message). Reveal anyway after a generous window.
+ const failsafe = setTimeout(reveal, 8000);
+
stage.appendChild(frame);
};
@@ -603,7 +632,9 @@ function injectTopbarStyles() {
.dn-walk-avatar-frame {
width:100%; height:100%; border:0; display:block;
background:transparent; pointer-events:none;
+ opacity:0; transition:opacity 240ms ease;
}
+ .dn-walk-avatar-frame.is-ready { opacity:1; }
.dn-walk-avatar-skel {
position:absolute; inset:8px; border-radius:10px;
background:linear-gradient(100deg,
@@ -630,6 +661,7 @@ function injectTopbarStyles() {
}
@media (prefers-reduced-motion: reduce) {
.dn-walk-avatar-skel { animation:none; }
+ .dn-walk-avatar-frame { transition:none; }
.dn-walk-avatar-btn:active { transform:none; }
}
`;
diff --git a/tests/three-access.test.js b/tests/three-access.test.js
index ee6cdbcba..1f0d43cce 100644
--- a/tests/three-access.test.js
+++ b/tests/three-access.test.js
@@ -28,6 +28,7 @@ const WALLET = 'So11111111111111111111111111111111111111112';
// silent change to the registry (a shifted threshold, a dropped feature) fails here.
const MIN_LEVEL = {
'forge.high': 1,
+ 'forge.gameready': 1,
'worlds.private': 2,
'mcp.priority': 2,
'worlds.branded': 3,
@@ -36,6 +37,7 @@ const MIN_LEVEL = {
};
const REQUIRED_TIER_ID = {
'forge.high': 'bronze',
+ 'forge.gameready': 'bronze',
'worlds.private': 'silver',
'mcp.priority': 'silver',
'worlds.branded': 'gold',
@@ -44,18 +46,21 @@ const REQUIRED_TIER_ID = {
};
const PAY_PER_USE = {
'forge.high': 'forge.high',
+ 'forge.gameready': 'forge.gameready',
'worlds.private': null,
'mcp.priority': null,
'worlds.branded': null,
'drops.early': null,
'names.first_dibs': 'name.auction',
};
-// Only forge.high is WIRED today (the High-tier Forge gate). The rest are planned —
-// registered so the UI can show them, but not yet enforced anywhere. /three reads
-// this flag to mark each perk "Live" vs "Planned"; pinning it here makes flipping a
-// feature to enforced a deliberate, tested change rather than a silent one.
+// forge.high (High-tier Forge gate) and forge.gameready (engine-ready export gate)
+// are WIRED today. The rest are planned — registered so the UI can show them, but
+// not yet enforced anywhere. /three reads this flag to mark each perk "Live" vs
+// "Planned"; pinning it here makes flipping a feature to enforced a deliberate,
+// tested change rather than a silent one.
const ENFORCED = {
'forge.high': true,
+ 'forge.gameready': true,
'worlds.private': false,
'mcp.priority': false,
'worlds.branded': false,
@@ -79,7 +84,7 @@ beforeEach(() => {
});
describe('registry shape', () => {
- it('exposes exactly the six gated features and is deeply frozen', () => {
+ it('exposes exactly the registered gated features and is deeply frozen', () => {
expect(listGatedFeatures().sort()).toEqual(FEATURE_IDS.slice().sort());
expect(Object.isFrozen(GATED_FEATURES)).toBe(true);
for (const id of FEATURE_IDS) {
@@ -102,9 +107,9 @@ describe('registry shape', () => {
}
});
- it('marks only forge.high enforced today — the rest are planned', () => {
+ it('marks the wired Forge gates enforced today — the rest are planned', () => {
const enforced = FEATURE_IDS.filter((id) => GATED_FEATURES[id].enforced);
- expect(enforced).toEqual(['forge.high']);
+ expect(enforced).toEqual(['forge.high', 'forge.gameready']);
});
it('references no coin other than $THREE in its copy', () => {