Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Manages Supabase database schema, migrations, and queries for CookMode V2. Use this when the user needs to create/modify tables, write migrations, update RLS policies, or troubleshoot database issues.
.claude/skills/aiskillstore-database-manager/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 7% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 171% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 75% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 62% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 116% | 0% |
You specialize in Supabase PostgreSQL database operations for CookMode V2. You help users manage schema, write migrations, configure Row Level Security (RLS), and troubleshoot database issues.
Invoke this skill when the user wants to:
name and color fields/supabase-schema.sql/supabase-migration-*.sqlsqlCREATE TABLE ingredient_checks ( recipe_slug TEXT NOT NULL, ingredient_index INTEGER NOT NULL, component_name TEXT NOT NULL, ingredient_text TEXT, is_checked BOOLEAN DEFAULT FALSE, updated_at TIMESTAMP DEFAULT NOW(), PRIMARY KEY (recipe_slug, ingredient_index, component_name) );
sqlCREATE TABLE step_checks ( recipe_slug TEXT NOT NULL, step_index INTEGER NOT NULL, step_text TEXT, is_checked BOOLEAN DEFAULT FALSE, updated_at TIMESTAMP DEFAULT NOW(), PRIMARY KEY (recipe_slug, step_index) );
sqlCREATE TABLE recipe_status ( recipe_slug TEXT PRIMARY KEY, status TEXT CHECK (status IN ('gathered', 'complete', 'plated', 'packed')), updated_at TIMESTAMP DEFAULT NOW() );
sqlCREATE TABLE recipe_order_counts ( recipe_slug TEXT PRIMARY KEY, order_count INTEGER DEFAULT 1 CHECK (order_count >= 1 AND order_count <= 50), updated_at TIMESTAMP DEFAULT NOW() );
sqlCREATE TABLE recipe_chef_names ( recipe_slug TEXT PRIMARY KEY, name TEXT NOT NULL, color TEXT NOT NULL DEFAULT '#9333ea', updated_at TIMESTAMP DEFAULT NOW() );
CookMode V2 currently uses permissive RLS - all users can read/write all data.
sql-- Enable RLS ALTER TABLE ingredient_checks ENABLE ROW LEVEL SECURITY; -- Allow all operations (current policy) CREATE POLICY "Enable all access" ON ingredient_checks FOR ALL USING (true);
Note: This is suitable for trusted kitchen environments. For multi-tenant setups, implement user-specific policies.
Tables with real-time sync enabled:
ingredient_checksstep_checksrecipe_statusrecipe_order_countsrecipe_chef_namesConfigured in /js/hooks/useRealtime.js:15-80
supabase-migration-{feature-name}.sqlsql-- Migration: Add new feature -- Date: 2025-01-XX -- Description: Brief description of changes -- ============================================ -- NEW TABLE -- ============================================ CREATE TABLE IF NOT EXISTS new_table ( id SERIAL PRIMARY KEY, recipe_slug TEXT NOT NULL, data TEXT, created_at TIMESTAMP DEFAULT NOW(), updated_at TIMESTAMP DEFAULT NOW() ); -- ============================================ -- INDEXES -- ============================================ CREATE INDEX idx_new_table_recipe ON new_table(recipe_slug); -- ============================================ -- ROW LEVEL SECURITY -- ============================================ ALTER TABLE new_table ENABLE ROW LEVEL SECURITY; CREATE POLICY "Enable all access" ON new_table FOR ALL USING (true); -- ============================================ -- ROLLBACK (Manual) -- ============================================ -- DROP TABLE IF EXISTS new_table CASCADE;
sql-- Add new column ALTER TABLE recipe_status ADD COLUMN priority INTEGER DEFAULT 0; -- Modify column ALTER TABLE recipe_chef_names ALTER COLUMN color SET DEFAULT '#10b981'; -- Add constraint ALTER TABLE recipe_order_counts ADD CONSTRAINT valid_count CHECK (order_count > 0);
Use Supabase client in hooks:
javascript// Select const { data, error } = await supabase .from('recipe_status') .select('*') .eq('recipe_slug', 'truffle-mashed-potatoes'); // Upsert const { error } = await supabase .from('recipe_order_counts') .upsert({ recipe_slug: 'chocolate-cake', order_count: 5 }, { onConflict: 'recipe_slug' }); // Delete const { error } = await supabase .from('step_checks') .delete() .eq('recipe_slug', 'old-recipe');
Supabase connection configured in /js/hooks/useSupabase.js:
useSupabase() creates client{supabase, isSupabaseConnected}Issue: Changes not syncing
Issue: Constraint violation
Issue: RLS blocking queries
sql-- Check table structure \d+ ingredient_checks -- View all policies SELECT * FROM pg_policies WHERE tablename = 'recipe_status'; -- Check real-time configuration SELECT * FROM pg_publication_tables WHERE pubname = 'supabase_realtime';
Current indexes target:
UI updates immediately, syncs to DB asynchronously:
javascript// Optimistic update setCompletedIngredients(prev => ({ ...prev, [key]: true })); // Then sync to Supabase await supabase.from('ingredient_checks').upsert(...);
When modifying schema:
sql-- Migration: Add recipe notes feature CREATE TABLE recipe_notes ( id SERIAL PRIMARY KEY, recipe_slug TEXT NOT NULL, note_text TEXT NOT NULL, created_by TEXT, created_at TIMESTAMP DEFAULT NOW() ); CREATE INDEX idx_recipe_notes_slug ON recipe_notes(recipe_slug); ALTER TABLE recipe_notes ENABLE ROW LEVEL SECURITY; CREATE POLICY "Enable all access" ON recipe_notes FOR ALL USING (true);
Then update /js/hooks/useRecipeData.js to fetch and manage notes.
Remember: Keep the database simple and cook-friendly, just like the UI!
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 13,686 | 6,790 | -50% | 1 | 1 | 0% | 3,161 | 3,381 | +7% | 0 | 0 | — |
case-02 | fail→pass | 5,327 | 4,471 | -16% | 1 | 1 | 0% | 1,060 | 2,876 | +171% | 0 | 0 | — |
case-03 | fail→pass | 10,813 | 9,609 | -11% | 1 | 1 | 0% | 2,303 | 4,039 | +75% | 0 | 0 | — |
case-04 | pass→pass | 12,251 | 6,990 | -43% | 1 | 1 | 0% | 2,552 | 3,373 | +32% | 0 | 0 | — |
case-05 | pass→pass | 10,304 | 9,889 | -4% | 1 | 1 | 0% | 2,119 | 3,912 | +85% | 0 | 0 | — |
case-06 | pass→pass | 13,487 | 12,852 | -5% | 1 | 1 | 0% | 2,600 | 4,536 | +74% | 0 | 0 | — |
case-07 | fail→pass | 7,714 | 2,150 | -72% | 1 | 1 | 0% | 1,385 | 2,250 | +62% | 0 | 0 | — |
case-08 | fail→pass | 6,377 | 1,782 | -72% | 1 | 1 | 0% | 1,037 | 2,237 | +116% | 0 | 0 | — |
case-09 | fail→pass | 5,102 | 2,263 | -56% | 1 | 1 | 0% | 820 | 2,302 | +181% | 0 | 0 | — |
case-10 | fail→pass | 8,294 | 2,011 | -76% | 1 | 1 | 0% | 1,321 | 2,261 | +71% | 0 | 0 | — |
case-11 | fail→pass | 8,463 | 1,625 | -81% | 1 | 1 | 0% | 1,458 | 2,244 | +54% | 0 | 0 | — |
case-12 | fail→pass | 9,686 | 1,488 | -85% | 1 | 1 | 0% | 1,634 | 2,128 | +30% | 0 | 0 | — |
case-13 | fail→pass | 8,589 | 2,218 | -74% | 1 | 1 | 0% | 1,568 | 2,253 | +44% | 0 | 0 | — |
case-14 | fail→pass | 6,687 | 1,492 | -78% | 1 | 1 | 0% | 1,205 | 2,178 | +81% | 0 | 0 | — |
case-15 | fail→pass | 8,636 | 4,508 | -48% | 1 | 1 | 0% | 1,796 | 2,873 | +60% | 0 | 0 | — |
case-16 | pass→pass | 4,315 | 1,378 | -68% | 1 | 1 | 0% | 638 | 2,170 | +240% | 0 | 0 | — |
case-17 | fail→pass | 8,639 | 4,133 | -52% | 1 | 1 | 0% | 1,759 | 2,764 | +57% | 0 | 0 | — |
case-18 | pass→pass | 8,469 | 4,241 | -50% | 1 | 1 | 0% | 1,655 | 2,741 | +66% | 0 | 0 | — |
case-19 | fail→pass | 5,529 | 2,727 | -51% | 1 | 1 | 0% | 1,121 | 2,470 | +120% | 0 | 0 | — |
case-20 | fail→pass | 5,084 | 2,730 | -46% | 1 | 1 | 0% | 984 | 2,420 | +146% | 0 | 0 | — |
case-21 | pass→pass | 2,346 | 2,486 | +6% | 1 | 1 | 0% | 382 | 2,439 | +538% | 0 | 0 | — |
case-22 | fail→pass | 5,126 | 1,358 | -74% | 1 | 1 | 0% | 778 | 2,077 | +167% | 0 | 0 | — |
case-23 | fail→pass | 9,463 | 5,288 | -44% | 1 | 1 | 0% | 1,575 | 2,754 | +75% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +74 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.