Nathan Romano
Dev toolsFree

Supabase Lead Database

Source-agnostic lead database schema in Supabase (people, companies, send log) deduplicated by email, LinkedIn, and domain.

What it does

Defines a source-agnostic database schema to store people, companies, and a campaign send log in Supabase, deduplicated by email, LinkedIn URL, and domain through a single upsert function. Includes ready-made queries to check duplicates, generate 'not contacted recently' lists, and export CSVs for whichever sending tool you use.

When to use it

Steps

  1. Define the people, companies, and campaign log tables with their dedup keys.
  2. Create the upsert function that deduplicates by email, LinkedIn URL, and domain.
  3. Load data from one source at a time, never inventing missing fields.
  4. Run the duplicate-review query before considering the load finished.
  5. Generate the not-contacted-recently list for the next campaign.
  6. Export the final CSV only after validating the expected record count.

The skill

supabase-lead-database/SKILL.mdDownload SKILL.md
---
name: supabase-lead-database
description: Defines a Supabase lead schema (people, companies, campaign log) deduplicated by email/LinkedIn/domain, with review queries and export.
---

# Supabase Lead Database

## What it does
Creates a central, source-agnostic lead database with people, companies, and a campaign send log tables, automatically deduplicated via an upsert function.

## When to use it
Use it when combining leads from multiple sources (scraping, forms, imports) and you need to avoid duplicates and repeat contacts before sending any campaign.

## Schema
1. People table: identity, email, LinkedIn URL, associated company.
2. Companies table: domain, name, basic firmographic data.
3. Campaign log: which lead received which send and when.

## Deduplication
4. A single upsert function deduplicates by email, LinkedIn URL, and domain on every insert.

## Useful queries
5. Query to review pending duplicates.
6. Query for leads not contacted in the last N days.
7. Filtered CSV export for the sending tool in use.

## GoHighLevel angle
8. The exported CSV can be imported as a contact list in GHL; the Supabase database remains the source of truth to avoid duplicates across campaigns.

## Safety rules
1. Every deliverable (script, email, post, ad, design) is produced as a draft first.
2. Nothing is sent, published, or paid for without explicit human approval.
3. Never invent metrics, testimonials, customer names, or data not present in the provided sources.
4. No credential, API key, or token is ever written or pasted into chat; reference environment variables instead.

For Claude Code, save it as ~/.claude/skills/supabase-lead-database/SKILL.md. In Cursor, ChatGPT or another assistant, paste it as project instructions.

Want to build it together?

Inside PubliExpert AI Guild you get snapshots, live sessions and builders to finish it with.

Join the AI Guild ↗