Khurram Badar / Archive / Papers / GGS Merge Build — Paste Into Claude Code

GGS Merge Build — Paste Into Claude Code

briefing · 2026-04-19 · 1385 words · Khurram Badar

FEATURE 1 — Daily AI Briefing (the hero) Database Cron — runs 05:30 UTC daily Claude Haiku prompt.

ai · other

GGS Merge Build — Paste Into Claude Code

> Three features. No more. Existing GGS stays untouched.
> Date: April 19, 2026

---

FEATURE 1 — Daily AI Briefing (the hero)

Build a daily gold briefing generated by Claude Haiku, published at 06:00 UTC.

Database

```sql
CREATE TABLE IF NOT EXISTS briefings (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
publish_date DATE UNIQUE NOT NULL,
headline TEXT NOT NULL,
opening_price_usd NUMERIC NOT NULL,
change_24h NUMERIC,
change_7d NUMERIC,
change_30d NUMERIC,
what_happened TEXT,
why_it_matters TEXT,
what_to_watch TEXT,
action_cta TEXT,
partner_link TEXT,
is_published BOOLEAN DEFAULT false,
generated_at TIMESTAMPTZ DEFAULT NOW(),
published_at TIMESTAMPTZ
);

CREATE INDEX idx_briefings_date ON briefings(publish_date DESC);
ALTER TABLE briefings ENABLE ROW LEVEL SECURITY;
CREATE POLICY "Published briefings readable by all" ON briefings
FOR SELECT USING (is_published = true);
-- No write policy = service role only
```

**RLS test before any data goes in:** open an anonymous Supabase client, query briefings — should return only published rows.

Cron — runs 05:30 UTC daily

1. Pull spot price (gold, silver) and 24h/7d/30d changes from existing data source
2. Pull DXY, US10Y, US 10Y real yield from FRED API
3. Pull top 10 overnight news headlines (filter out political content — see prompt)
4. Pull last 30 days of central bank flows from existing or scraped WGC data
5. Send all of this as JSON to Claude Haiku with the prompt below
6. Store result in `briefings`, set `is_published = true` at 06:00 UTC

Claude Haiku prompt

```
You are the Chief Gold Analyst at GGS (getgoldsilver.com). Every day at 06:00 UTC you publish a briefing for a global audience anchored in Dubai, with strong readership in GCC, Pakistan, India, Turkey, Indonesia, Egypt, and Nigeria.

VOICE: Intelligent, calm, market-focused. You write like an experienced gold analyst talking to a smart friend over morning coffee. Clear. Direct. No hype. No jargon without explanation.

PRODUCE EXACTLY THESE 6 SECTIONS:

1. HEADLINE — one sentence under 15 words. The single most important thing about gold today, framed in market terms only.
2. THE NUMBER — opening spot USD/oz, 24h %, 7-day %, 30-day %, one sentence of context.
3. WHAT HAPPENED — 3 to 4 bullets on overnight market moves and key data releases.
4. WHY IT MATTERS — 150 to 250 words. Synthesize DXY + real yields + oil + central bank activity into a coherent market narrative. Tell a story. Ground every claim in a specific data point.
5. WHAT TO WATCH — 2 to 3 bullets on upcoming economic data releases and central bank events in the next 24 to 48 hours.
6. ACTION — one sentence of market-level guidance ending with an affiliate CTA appropriate to the reader's region.

ABSOLUTE RULES — NO EXCEPTIONS:

INPUT (provided as JSON each morning):
- Spot prices: gold and silver in USD
- 24h, 7d, 30d % changes
- DXY current and 24h change
- US10Y nominal and real yields
- Brent crude price and 24h change
- Central bank flows last 30 days (country, tonnes, source)
- Top 10 overnight news headlines (you will filter for market relevance only)
- Upcoming economic calendar next 48 hours

OUTPUT: Markdown, 6 sections in the order above. Nothing else.
```

Free vs Premium gating

Page route

---

FEATURE 2 — Local Currencies

Add 8 currencies to existing price components. No new components, no new pages — just extend what's there.

Currencies to add

USD (existing), AED, SAR, PKR, INR, EUR (existing), GBP (existing), TRY, CNY, EGP, IDR, NGN

Implementation

1. Sign up for ExchangeRate-API (free tier: 1500 requests/month is plenty)
2. Cron every 6 hours: fetch USD-base rates for all currencies, cache in Redis or a `fx_rates` table
3. Extend existing price display logic to multiply by FX rate when user selects a non-USD currency
4. Add currency selector to existing UI (dropdown or pills)
5. Default user currency from country detection on first visit (use Vercel geo headers — no third-party geo-IP needed)
6. Save preference to user profile if logged in

Profile column (additive)

```sql
ALTER TABLE profiles ADD COLUMN IF NOT EXISTS preferred_currency TEXT DEFAULT 'USD';
```

---

FEATURE 3 — Local Weight Units

Add 4 South Asian weight units to existing weight selector.

Units to add

Implementation

1. Add unit constants to existing weight conversion utility
2. Extend weight selector UI with new options
3. Save preference to user profile
4. When user selects "tola" their default region likely is PK/IN — auto-suggest PKR or INR for currency too

Profile column (additive)

```sql
ALTER TABLE profiles ADD COLUMN IF NOT EXISTS preferred_weight_unit TEXT DEFAULT 'oz';
```

---

BUILD ORDER

Sprint 1 (Week 1) — Briefing engine

Sprint 2 (Week 2) — Currencies + weights

---

SECURITY CHECKLIST (run before each sprint ships)

---

WHAT NOT TO BUILD

---

END OF EVERY CLAUDE CODE SESSION

Run this exact prompt:

> Update CLAUDE.md with what was built this session, what broke, what's next. Append to the session log. Then commit and push.

Ten seconds. Non-negotiable.

---

**End. Three features. Ship Sprint 1 in 7 days. Ship Sprint 2 in 7 days. Then evaluate.**

← newworld.education — Architecture BriefGGS Merge Spec April 2026 →
Two years of working thought, indexed.
Ask me to present it in your conference room — WhatsApp +971 55 623 9111
Book Session →