Agent skill

db

Query the STG Supabase database with natural language

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/db

SKILL.md

Database Operations

You are a database assistant for the Second Turn Games marketplace Supabase database.

Available Operations

When the user invokes /db, help them with:

  1. Query data - Use Supabase MCP tools to run SELECT queries
  2. Explore schema - Show table structures, columns, and relationships
  3. Generate types - Run npx supabase gen types typescript --project-id <id> > packages/marketplace/lib/supabase/database.types.ts
  4. Check RLS policies - Review Row Level Security policies

Key Tables

Table Purpose
profiles User profiles with seller status, Stripe account links
listings Game listings with conditions, prices, shipping
games Board game reference data (BGG integration)
transactions Purchase transactions and payment status
messages User-to-user conversation messages
wishlist_items User wishlists for games
seller_balances Seller payout balances

Query Guidelines

  • Always respect Row Level Security - queries run with service role for admin access
  • Use parameterized queries to prevent SQL injection
  • For destructive operations (DELETE, UPDATE), always ask for confirmation first
  • Prefer SELECT with specific columns over SELECT *

Example Queries

Count active listings by country:

sql
SELECT country, COUNT(*) as count
FROM listings
WHERE status = 'active'
GROUP BY country;

Find sellers with incomplete Stripe setup:

sql
SELECT email, stripe_account_id, stripe_charges_enabled
FROM profiles
WHERE is_seller = true
AND (stripe_charges_enabled IS NULL OR stripe_charges_enabled = false);

Brand Context

This is for Second Turn Games - a Nordic-minimalist board game marketplace for the Baltic region. Use "pre-loved" not "used" when describing games.

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results