supabase-ops
Supabase database operations for BidDeed.AI and Life OS ecosystems. Handles inserts, queries, and data management for tables including insights, historical_auctions, activities, daily_metrics, michael_swim_times, learning_sessions. Use when logging data, querying Supabase, running insert_insight.yml workflows, or managing persistent storage. Database: mocerqjnksmhcjzxrewo.supabase.co
When & Why to Use This Skill
The Supabase Operations skill enables Claude to perform comprehensive database management, including data insertion, complex SQL querying, and persistent storage handling. It is optimized for managing diverse data ecosystems such as real estate auctions, system insights, and personal performance metrics, featuring seamless integration with GitHub Actions for secure and automated workflows.
Use Cases
- Automated System Logging: Streamline the recording of system insights, performance logs, and activity data into a centralized Supabase 'insights' table for cross-ecosystem monitoring.
- Real Estate Analytics: Manage and query historical auction records, property details, and ML-predicted probabilities to generate investment recommendations and outcome reports.
- Operational Usage Tracking: Monitor API costs, token consumption, and daily metrics across different AI models to optimize resource allocation and budget management.
- Specialized Performance Tracking: Maintain and retrieve structured data for specific use cases like athletic swim times or learning sessions to track progress and personal milestones.
| name | supabase-ops |
|---|---|
| description | Supabase database operations for BidDeed.AI and Life OS ecosystems. Handles inserts, queries, and data management for tables including insights, historical_auctions, activities, daily_metrics, michael_swim_times, learning_sessions. Use when logging data, querying Supabase, running insert_insight.yml workflows, or managing persistent storage. Database: mocerqjnksmhcjzxrewo.supabase.co |
Supabase Operations
Connection Details
Host: mocerqjnksmhcjzxrewo.supabase.co
Service Role Key: eyJ... (in GitHub Secrets as SUPABASE_KEY)
IAT: 1764532526
Core Tables
insights
General-purpose logging table for all ecosystems.
CREATE TABLE insights (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
created_at TIMESTAMP DEFAULT NOW(),
source VARCHAR(50), -- 'biddeed', 'life_os', 'michael_swim'
category VARCHAR(50), -- 'learning', 'claude_performance', 'auction'
title VARCHAR(255),
content TEXT,
metadata JSONB
);
Insert Pattern:
def log_insight(source: str, category: str, title: str, content: str, metadata: dict = None):
supabase.table('insights').insert({
'source': source,
'category': category,
'title': title,
'content': content,
'metadata': metadata or {}
}).execute()
historical_auctions
BidDeed.AI auction data (1,393+ rows).
CREATE TABLE historical_auctions (
id UUID PRIMARY KEY,
case_number VARCHAR(50),
property_address TEXT,
plaintiff VARCHAR(255),
judgment_amount DECIMAL,
sale_date DATE,
final_bid DECIMAL,
third_party_won BOOLEAN,
ml_predicted_probability FLOAT,
our_recommendation VARCHAR(10), -- 'BID', 'REVIEW', 'SKIP'
actual_outcome TEXT
);
daily_metrics
Smart Router cost tracking and API usage.
CREATE TABLE daily_metrics (
id UUID PRIMARY KEY,
date DATE,
tier VARCHAR(20),
model VARCHAR(50),
calls INTEGER,
input_tokens INTEGER,
output_tokens INTEGER,
cost_usd DECIMAL(10,4)
);
michael_swim_times
Michael D1 Swimming performance tracking.
CREATE TABLE michael_swim_times (
id UUID PRIMARY KEY,
date DATE,
meet_name VARCHAR(255),
event VARCHAR(50), -- '50 Free', '100 Fly', etc.
time_seconds DECIMAL(6,2),
time_formatted VARCHAR(10), -- '22.45'
course VARCHAR(5), -- 'SCY', 'LCM'
is_pb BOOLEAN,
notes TEXT
);
auction_results
V14.4 lien discovery integration.
CREATE TABLE auction_results (
id UUID PRIMARY KEY,
case_number VARCHAR(50),
run_date DATE,
lien_discovery JSONB, -- AcclaimWeb results
do_not_bid BOOLEAN,
reason TEXT, -- 'Senior mortgage survives'
recommendation VARCHAR(10)
);
GitHub Actions Integration
Both repos use insert_insight.yml workflow:
# .github/workflows/insert_insight.yml
name: Insert Insight
on:
workflow_dispatch:
inputs:
source:
required: true
category:
required: true
title:
required: true
content:
required: true
jobs:
insert:
runs-on: ubuntu-latest
steps:
- name: Insert to Supabase
run: |
curl -X POST '${{ secrets.SUPABASE_URL }}/rest/v1/insights' \
-H "apikey: ${{ secrets.SUPABASE_KEY }}" \
-H "Authorization: Bearer ${{ secrets.SUPABASE_KEY }}" \
-H "Content-Type: application/json" \
-d '{
"source": "${{ inputs.source }}",
"category": "${{ inputs.category }}",
"title": "${{ inputs.title }}",
"content": "${{ inputs.content }}"
}'
Query Patterns
Get Recent Insights
SELECT * FROM insights
WHERE source = 'biddeed'
ORDER BY created_at DESC
LIMIT 10;
Auction Performance Analysis
SELECT
plaintiff,
COUNT(*) as cases,
AVG(CASE WHEN third_party_won THEN 1 ELSE 0 END) as third_party_rate,
AVG(ml_predicted_probability) as avg_prediction
FROM historical_auctions
GROUP BY plaintiff
ORDER BY cases DESC;
Michael Swim Progress
SELECT event, MIN(time_seconds) as best_time, COUNT(*) as races
FROM michael_swim_times
WHERE course = 'SCY'
GROUP BY event;
CRITICAL RULES
- Never use local curl - Always use GitHub Actions workflows
- Never expose service key - Keep in GitHub Secrets only
- Use proper IAT - Key with iat:1764532526 is current
- Log to insights first - Generic logging table for all purposes