GGS — Merge Spec (April 2026)
> **Append this to your existing CLAUDE.md. Do not replace.**
> The current GGS build stays. This document defines what to add, what to leave alone, and what to explicitly NOT build.
**Date:** April 19, 2026
**Owner:** Khurram Badar
**Live URL:** getgoldsilver.com
**Approach:** Iterative merge. Keep working features. Add the high-value layer that's missing.
---
1. WHAT'S ALREADY BUILT (do not touch unless broken)
Per Claude Code's index: 95 pages, 100 utils, 101 APIs, 22 components, 22+ tables, 38 routes. AI scoring, prediction engines, autonomous systems. Yahoo Finance data source. Next.js 16 + Tailwind + Framer Motion.
**Rule: existing features stay live unless they're actively hurting users or blocking new work.** No tear-downs for spec purity.
---
2. THE GAP THIS MERGE FILLS
The current GGS is feature-rich but lacks the **daily-use hook** and the **emerging-market empathy layer** that drives subscription conversion in GCC, Pakistan, India, Turkey, Indonesia, Nigeria.
What's missing:
- A reason to open GGS every morning (the Daily Briefing)
- Local currency display (PKR, INR, AED, SAR, TRY, EGP, IDR, NGN)
- Local weight units (tola, bhori, gram, kilo)
- Cultural demand calendar
- Regional premium tracker (Dubai vs Mumbai vs Karachi vs Istanbul vs Shanghai vs London)
That's the merge. Five additions. Nothing more in this phase.
---
3. WHAT WE'RE EXPLICITLY NOT BUILDING
Not building: Zakat / Nisab / Faraid calculators
**What we do instead when users ask:** The chat agent says — *"Zakat on gold is generally 2.5% above Nisab, but the exact calculation depends on your madhab and jurisdiction. Please consult a qualified scholar or a dedicated Zakat platform like NZF, Islamic Relief, or your local mosque."*
Not building: Standalone central bank dashboard
Not building: New auth, new payments, new database from scratch
Not building: Tokenized gold (PAXG/XAUT) integration
Not building: HNW tier
---
4. WHAT WE ARE BUILDING (the five additions)
4.1 — Daily Gold Briefing (the hero addition)
An AI-generated 7-section briefing published daily at 06:00 UTC.
**Sections:**
1. Headline — one sentence under 15 words
2. The Number — opening spot USD/oz, 24h %, 7d %, 30d %
3. What happened — 3–4 bullets on overnight moves
4. Why it matters — 150–250 word narrative (DXY + real rates + central banks + geopolitics)
5. What to watch — 2–3 bullets on next 24–48h events
6. Regional snapshot — Dubai, London, Mumbai, Shanghai, Istanbul, Karachi premiums
7. Action — one sentence guidance + affiliate CTA
**Free tier:** headline + section 1 + teaser of section 4. Paywall below.
**Premium tier:** full briefing + email delivery at user's local 06:00.
**Implementation:**
- New table `briefings` (schema below)
- Cron at 05:30 UTC pulls inputs, generates via Claude Haiku
- Publishes at 06:00 UTC
- Resend for email delivery
4.2 — Local Currency Display
Add to existing price components:
- USD, AED, SAR, PKR, INR, EUR, GBP, TRY, CNY, EGP, IDR, NGN
- ExchangeRate-API for FX
- User preference stored in profile, defaults from country detection
4.3 — Local Weight Units
Add to existing price components:
- Ounce (oz), gram (g), kilo (kg) — already standard
- **Tola** (11.66g — Pakistan, India)
- **Bhori / Vori** (11.66g — Bangladesh, identical to tola but different name)
- **Bori** (96g = ~10 tola, Karachi gold market convention)
- **Masha** (0.972g — Pakistan/India sub-unit)
- User preference stored in profile
4.4 — Regional Premium Tracker
Live spreads vs LBMA spot:
- Dubai gold souk
- London LBMA fix
- Mumbai (MCX)
- Shanghai (SGE)
- Istanbul (Grand Bazaar)
- Karachi market
Sources: scrape published rates from each market's official feed where available, fallback to dealer aggregates. Show spread, 24h change in spread, historical context.
4.5 — Cultural Demand Calendar
Informational only. No religious instruction. No buying recommendation tied to religious events.
Events tracked:
- Akshaya Tritiya (India)
- Dhanteras + Diwali (India)
- Wedding seasons (India Oct–Feb, Pakistan Nov–Feb, GCC summer, Turkey spring)
- Chinese New Year
- Ramadan + Eid al-Fitr + Eid al-Adha (informational date awareness only — no religious framing)
- Valentine's Day, Mother's Day (Western gift demand)
Display: countdown cards showing days away + historical price impact (% move in 30 days prior).
---
5. DATABASE — ADDITIVE SCHEMA ONLY
> Add these tables. Do not modify existing 22+ tables. Enable RLS on every new table from day one.
```sql
-- ═══════════════════════════════════════════════════════════
-- BRIEFINGS (daily publications)
-- ═══════════════════════════════════════════════════════════
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,
regional_snapshot JSONB,
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
-- ═══════════════════════════════════════════════════════════
-- REGIONAL PREMIUMS
-- ═══════════════════════════════════════════════════════════
CREATE TABLE IF NOT EXISTS regional_premiums (
id BIGSERIAL PRIMARY KEY,
region TEXT NOT NULL CHECK (region IN ('dubai','london','mumbai','shanghai','istanbul','karachi')),
metal TEXT NOT NULL CHECK (metal IN ('gold','silver')),
local_price_usd_oz NUMERIC NOT NULL,
spot_at_time NUMERIC NOT NULL,
premium_pct NUMERIC GENERATED ALWAYS AS (
((local_price_usd_oz - spot_at_time) / spot_at_time) * 100
) STORED,
source TEXT,
fetched_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE INDEX idx_premiums_region_time ON regional_premiums(region, metal, fetched_at DESC);
ALTER TABLE regional_premiums ENABLE ROW LEVEL SECURITY;
CREATE POLICY "Premiums readable by all" ON regional_premiums FOR SELECT USING (true);
-- ═══════════════════════════════════════════════════════════
-- CULTURAL EVENTS
-- ═══════════════════════════════════════════════════════════
CREATE TABLE IF NOT EXISTS cultural_events (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
event_name TEXT NOT NULL,
event_date DATE NOT NULL,
region TEXT NOT NULL,
category TEXT CHECK (category IN ('cultural','wedding','national','commercial','seasonal')),
demand_impact TEXT CHECK (demand_impact IN ('very_high','high','medium','low')),
historical_price_impact_pct NUMERIC,
description TEXT
-- NOTE: No religious_ruling, no zakat_basis, no faraid fields. Ever.
);
CREATE INDEX idx_events_date ON cultural_events(event_date);
ALTER TABLE cultural_events ENABLE ROW LEVEL SECURITY;
CREATE POLICY "Cultural events readable by all" ON cultural_events FOR SELECT USING (true);
-- ═══════════════════════════════════════════════════════════
-- USER PREFERENCES (additive — only if your existing profiles
-- table doesn't already have these columns)
-- ═══════════════════════════════════════════════════════════
-- Run only if columns don't exist:
-- ALTER TABLE profiles ADD COLUMN IF NOT EXISTS preferred_currency TEXT DEFAULT 'USD';
-- ALTER TABLE profiles ADD COLUMN IF NOT EXISTS preferred_weight_unit TEXT DEFAULT 'oz';
-- ALTER TABLE profiles ADD COLUMN IF NOT EXISTS country TEXT;
-- ALTER TABLE profiles ADD COLUMN IF NOT EXISTS timezone TEXT DEFAULT 'UTC';
-- ALTER TABLE profiles ADD COLUMN IF NOT EXISTS briefing_enabled BOOLEAN DEFAULT true;
-- ALTER TABLE profiles ADD COLUMN IF NOT EXISTS briefing_delivery_time TIME DEFAULT '06:00';
```
**Test RLS as anonymous client before any data goes in.** Anyone hitting these tables anonymously should see only published briefings, premiums, and events. Nothing else.
---
6. AI BRIEFING PROMPT (production-ready)
```
You are the Chief Gold Analyst at GGS (getgoldsilver.com). Every day at 06:00 UTC you publish a briefing for a global audience skewed toward GCC, South Asia, and emerging markets.
VOICE: Intelligent, calm, culturally aware, unafraid of macro complexity. You write like someone talking to a smart friend over morning coffee. You never use jargon without explaining it. You never hedge into uselessness.
MANDATE — produce exactly these 7 sections:
1. HEADLINE — one sentence under 15 words. The single most important thing about gold today.
2. THE NUMBER — opening spot USD/oz, 24h %, 7d %, 30d %, one sentence of context.
3. WHAT HAPPENED — 3 to 4 bullets on overnight moves and key events.
4. WHY IT MATTERS — 150 to 250 words. Synthesize DXY + real rates + central bank activity + geopolitics into a coherent narrative. Tell a story, do not list. Ground every claim in a specific data point.
5. WHAT TO WATCH — 2 to 3 bullets on upcoming events in the next 24 to 48 hours.
6. REGIONAL SNAPSHOT — one line each for Dubai, London, Mumbai, Shanghai, Istanbul, Karachi. Show premium/discount vs spot.
7. ACTION — one sentence of guidance (not instruction) ending with an affiliate CTA appropriate to the reader's region.
ABSOLUTE RULES:
- Never recommend specific buy/sell at specific prices.
- Never frame gold buying as religiously obligated, recommended, or rewarded. Religious framing is off-limits.
- Always cite the source of a claim (DXY move, 10Y yield, WGC data, specific central bank).
- No emojis. No exclamation marks. No hype.
- Prefer clarity over cleverness.
INPUT (provided each morning as JSON):
- Spot prices (gold, silver in USD, EUR, AED, INR, PKR, TRY)
- DXY, US10Y, US real 10Y yield
- Central bank flows (last 30 days)
- Top 10 overnight news headlines
- Upcoming cultural events (next 14 days, informational)
- Geopolitical events (last 48 hours)
OUTPUT: Markdown, strict 7-section structure.
```
---
7. BUILD ORDER (4 sprints, additive only)
Sprint A — Briefing engine (Week 1)
Sprint B — Currency + weight units (Week 2)
Sprint C — Regional premium tracker (Week 3)
Sprint D — Cultural calendar (Week 4)
---
8. SECURITY CHECKLIST (run before each sprint ships)
- [ ] All new tables have RLS enabled
- [ ] All new tables have explicit policies tested with anonymous client
- [ ] No new secrets committed (run `git diff --cached | grep -iE "sk-ant|api[_-]?key|secret"`)
- [ ] Anthropic spend cap reviewed (Phase 1: $100/day)
- [ ] Rate limit added to any new AI endpoint (briefing endpoint, chat endpoint)
- [ ] CORS unchanged
- [ ] Service role key not exposed to client
- [ ] Stripe subscription state revalidated server-side before granting Premium content access
---
9. WHAT NOT TO DO (the discipline list)
- Do not rebuild the existing 22+ tables.
- Do not migrate from Yahoo Finance to Metals-API in Phase 1 unless Yahoo breaks. The data is good enough for the briefing.
- Do not add Zakat, Nisab, Faraid, or any religious calculation tools. Ever.
- Do not build the central bank dashboard as a standalone feature in Phase 1. Use the data inside the briefing only.
- Do not add tokenized gold integration in Phase 1.
- Do not add HNW tier in Phase 1.
- Do not change pricing tiers if existing pricing is converting. The new $9.99 / $29 / $199 model is a hypothesis — test only if current model isn't working.
- Do not tear down working features for spec consistency.
---
10. END-OF-SESSION RITUAL
Every Claude Code session ends with:
> Update CLAUDE.md with this session's changes and append to the session log. Then commit and push.
Ten seconds. Non-negotiable.
---
11. SESSION LOG (start tracking here)
2026-04-19 — Merge spec finalized
---
**End of merge spec. Append to existing CLAUDE.md, do not replace.**