supabase
Navigate Supabase database tables, relationships, and query patterns. Use when you need to understand how tables connect, write queries, or find the right data source.
What this skill does
# Supabase Database Skill Navigate and query the Empathy Ledger Supabase database with confidence. ## Database Relationship Map ``` ┌─────────────────────────────────────────────────────────────────────────────┐ │ TENANTS (top-level) │ │ │ │ │ ┌───────────────────────────────┼───────────────────────────────┐ │ │ │ │ │ │ │ ▼ ▼ ▼ │ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────────┐ │ │ │ organisations │◄──────────│ profiles │──────────►│ tenant_members │ │ │ └──────────────┘ └──────────────┘ └──────────────────┘ │ │ │ │ │ │ │ │ is_storyteller │ │ ▼ ▼ │ │ ┌──────────────┐ ┌──────────────┐ │ │ │ projects │◄──────────│ stories │ │ │ └──────────────┘ └──────────────┘ │ │ │ │ │ │ │ ├────────────────────┐ │ │ ▼ ▼ ▼ │ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ │ │ transcripts │ │media_assets │ │story_distribs│ │ │ └──────────────┘ └──────────────┘ └──────────────┘ │ │ │ │ │ │ │ │ │ ▼ │ │ ▼ ▼ ┌──────────────┐ │ │ ┌──────────────┐ ┌──────────────┐ │ embed_tokens │ │ │ │ key_quotes[] │ │media_usage │ └──────────────┘ │ │ │ themes[] │ │_tracking │ │ │ │ ai_summary │ └──────────────┘ │ │ └──────────────┘ │ └─────────────────────────────────────────────────────────────────────────────┘ ``` ## Complete Table Inventory **Live Supabase:** 165 objects (153 tables, 7 views, 3 partitions, 2 system) **Migration-defined:** 71 tables **With TypeScript Types:** 35 tables **See also:** [DATABASE_ALIGNMENT_AUDIT.md](../../../docs/DATABASE_ALIGNMENT_AUDIT.md) > ⚠️ **Schema Drift Alert**: ~80 tables exist in Supabase but have no migration files. > Use `npx supabase gen types typescript --local` to generate accurate types. ### 1. Identity & Access (12 tables) | Table | Purpose | Has Types | |-------|---------|-----------| | `tenants` | Top-level multi-tenant isolation | ✅ | | `profiles` | User accounts (syncs with auth.users) | ✅ | | `organisations` | Community groups with tier/policy | ✅ | | `organization_members` | User ↔ Org membership | ✅ | | `organization_roles` | RBAC roles within orgs | ⚠️ | | `organization_invitations` | Pending invites | ⚠️ | | `tenant_members` | User ↔ Tenant membership | ✅ | | `profile_organizations` | Profile-org join | ✅ | | `profile_locations` | User locations | ✅ | | `profile_projects` | User-project join | ✅ | | `user_sessions` | Session tracking | ✅ | | `user_reports` | User reports | ✅ | ### 2. Projects & Context (9 tables) | Table | Purpose | Has Types | |-------|---------|-----------| | `projects` | Story collections | ✅ | | `project_participants` | Project members | ✅ | | `project_contexts` | AI-extracted project context | ⚠️ | | `organization_contexts` | AI-extracted org context | ⚠️ | | `project_profiles` | Extended project metadata | ⚠️ | | `project_seed_interviews` | Seed interview data | ⚠️ | | `project_analyses` | Cached AI analyses | ⚠️ | | `seed_interview_templates` | Interview templates | ⚠️ | | `development_plans` | User development plans | ✅ | ### 3. Stories & Content (10 tables) | Table | Purpose | Has Types | |-------|---------|-----------| | `stories` | Core storytelling content | ✅ | | `transcripts` | Audio/text transcriptions | ✅ | | `media_assets` | Images, videos, audio | ✅ | | `media_usage_tracking` | Media access tracking | ✅ | | `extracted_quotes` | AI-extracted quotes | ✅ | | `transcription_jobs` | Transcription queue | ⚠️ | | `media_import_sessions` | Bulk import tracking | ⚠️ | | `title_suggestions` | AI title suggestions | ⚠️ | | `galleries` | Photo galleries | ✅ | | `gallery_photos` | Gallery items | ✅ | ### 4. Distribution & Syndication (11 tables) | Table | Purpose | Has Types | |-------|---------|-----------| | `story_distributions` | External platform tracking | ✅ | | `story_access_tokens` | Ephemeral share links (revocable, time-limited) | ✅ | | `embed_tokens` | Secure embed tokens | ✅ | | `story_syndication_consent` | Partner consent records | ⚠️ | | `external_applications` | Partner apps registry | ⚠️ | | `story_access_log` | External access log | ⚠️ | | `webhook_subscriptions` | Partner webhooks | ⚠️ | | `webhook_delivery_log` | Webhook attempts | ⚠️ | | `consent_change_log` | Consent audit trail | ⚠️ | | `consent_proofs` | GDPR consent proofs | ⚠️ | | `story_review_invitations` | Storyteller review links | ⚠️ | ### 5. Partner Portal (6 tables) | Table | Purpose | Has Types | |-------|---------|-----------| | `partner_projects` | Partner curated projects | ⚠️ | | `story_syndication_requests` | Content requests | ⚠️ | | `partner_messages` | Partner-storyteller messages | ⚠️ | | `partner_team_members` | Partner team access | ⚠️ | | `partner_analytics_daily` | Partner analytics | ⚠️ | | `partner_message_templates` | Message templates | ⚠️ | ### 6. Analytics & Insights (17 tables) | Table | Purpose | Has Types | |-------|---------|-----------| | `storyteller_analytics` | Aggregated storyteller stats | ⚠️ | | `narrative_themes` | Platform-wide themes | ⚠️ | | `storyteller_themes` | Per-storyteller themes | ⚠️ | | `storyteller_quotes` | Impactful quotes | ⚠️ | | `storyteller_connections` | Network connections | ⚠️ | | `storyteller_demographics` | Demographics data | ⚠️ | | `storyteller_recommendations` | AI recommendations | ❌ ORPHANED | | `storyteller_dashboard_config` | Dashboard prefs | ⚠️ | | `storyteller_milestones` | Achievements | ⚠️ | | `storyteller_engagement` | Engagement metrics | ⚠️ | | `storyteller_impact_metrics` | Impact tracking | ⚠️ | | `cross_narrative_insights` | Cross-story insights | ❌ ORPHANED | | `cross_sector_insights` | Sector analysis | ⚠️ | | `geographic_impact_patterns` | Geographic patterns | ❌ ORPHANED | | `theme_evolution_tracking` | Theme trends | ⚠️ | | `analytics_processing_jobs` | Analytics job queue | ❌ ORPHANED | | `platform_analytics` | Platform-wide stats | ⚠️ | ### 7. Engagement Tracking (2 tables) | Table | Purpose | Has Types | |-------|---------|-----------| | `story_engagement_events` | Per-view events | ⚠️ | | `story_engagement_daily` | Daily aggregates | ⚠️ | ### 8. AI & Safety (9 tables) | Table | Purpose | Has Types | |-------|---------|-----------| | `ai_usage_events` | AI cost/usage tracking | ⚠️ | | `tenant_ai_policies` | Per-tenant AI limits | ⚠️ | | `ai_agent_registry` | AI agent configs | ⚠️ | | `ai_usage_daily` | Daily AI aggregates | ⚠️ | | `elder_review_queue` | Elder review workflow | ⚠️ | | `moderation_results` | Moderation decisions | ⚠️ | | `moderation_appeals` | Appeal requests | ⚠️ | | `ai_moderation_logs` | AI moderation log | ⚠️ | | `ai_safety_logs` | Safety check log | ⚠️ | ### 9. Admin & System (8 tables) | Table | Purpose | Has Types | |-------|---------|-----------| | `audit_logs` | Compliance audit trail
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.