AgentSkillsCN

supabase

导航 Supabase 数据库表、表间关系及查询模式。Empathy Ledger 的 Schema 参考。

SKILL.md
--- frontmatter
name: supabase
description: Navigate Supabase database tables, relationships, and query patterns. Schema reference for Empathy Ledger.

Supabase Database

Navigate and query the Empathy Ledger Supabase database.

When to Use

  • Understanding table relationships
  • Writing database queries
  • Finding the right data source
  • Checking schema structure

Quick Relationship Map

code
tenants
   └── profiles → storytellers → stories → transcripts
                                    ↓
                        transcript_analysis_results
                                    ↓
                        narrative_themes + extracted_quotes

Core Tables

Storytelling

TablePurpose
storytellersStoryteller personas (canonical)
storiesCore content
transcriptsAudio/text transcriptions

Analysis

TablePurpose
transcript_analysis_resultsVersioned AI analysis
narrative_themesAI-extracted themes
knowledge_chunksRAG embeddings (22k+)

Multi-Tenant

TablePurpose
tenantsTop-level isolation
profilesUser accounts
organisationsCommunity groups

Common Queries

sql
-- Storyteller with story count
SELECT st.*, COUNT(s.id) as story_count
FROM storytellers st
LEFT JOIN stories s ON s.storyteller_id = st.id
GROUP BY st.id;

-- Stories by theme
SELECT * FROM stories
WHERE 'healing' = ANY(cultural_themes);

-- Theme frequency
SELECT unnest(cultural_themes) as theme, COUNT(*)
FROM stories WHERE status = 'published'
GROUP BY theme ORDER BY count DESC;

Reference Files

TopicFile
Full table listrefs/tables.md
Relationship diagramrefs/relationship-diagram.md

Related Skills

  • supabase-connection - Database clients
  • supabase-deployment - Migrations
  • database-navigator - Schema exploration