database-manager
БесплатноБез исполняемых скриптовНе проверенManages Supabase database schema, migrations, and queries for CookMode V2. Use this when the user needs to create/modify tables, write migrations, update RLS…
от aiskillstore★ 509 звёзд на GitHubОб этом скилле
Database Manager Skill
Your Role
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.
When to Use This Skill
Invoke this skill when the user wants to:
- Create or modify database tables
- Write SQL migrations
- Add/update RLS policies
- Debug database errors
- Optimize queries
- Add new database features
Current Database Schema
Tables Overview
ingredient_checks
- Tracks ingredient completion status
- Real-time synced across clients
step_checks
- Tracks instruction step completion
- Real-time synced across clients
recipe_status
- Workflow status: gathered, complete, plated, packed
- One status per recipe
recipe_order_counts
- Number of orders for each recipe (1-50)
- Used for ingredient scaling
recipe_chef_names
- Chef assignment with color badge
- Includes
nameandcolorfields
Schema Files
- Primary:
/supabase-schema.sql - Migrations:
/supabase-migration-*.sql
Table Schemas
ingredient_checks
CREATE 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)
);
step_checks
CREATE 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)
);
recipe_status
CREATE TABLE recipe_status (
recipe_slug TEXT PRIMARY KEY,
status TEXT CHECK (status IN ('gathered', 'complete', 'plated', 'packed')),
updated_at TIMESTAMP DEFAULT NOW()
);
recipe_order_counts
CREATE 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()
);
recipe_chef_names
CREATE TABLE recipe_chef_names (
recipe_slug TEXT PRIMARY KEY,
name TEXT NOT NULL,
color TEXT NOT NULL DEFAULT '#9333ea',
updated_at TIMESTAMP DEFAULT NOW()
);
Row Level Security (RLS)
CookMode V2 currently uses permissive RLS - all users can read/write all data.
-- 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.
Real-Time Subscriptions
Tables with real-time sync enabled:
ingredient_checksstep_checksrecipe_statusrecipe_order_countsrecipe_chef_names
Configured in /js/hooks/useRealtime.js:15-80
Migration Best Practices
Creating a Migration
- Name convention:
supabase-migration-{feature-name}.sql - Include rollback: Add comments for manual rollback steps
- Test locally: Verify migration before applying
Migration Template
-- 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;
Common Database Operations
Adding a New Table
- Define schema with constraints
- Add indexes for performance
- Enable RLS and create policies
- Document in this skill
- Update hooks if real-time needed
Modifying Existing Table
-- 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);
Querying Data
Use Supabase client in hooks:
// Select
const { data, error } = await supabase
.from('recipe_status')
.select('*')
Установить database-manager в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл database-manager?
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.
Как установить скилл database-manager?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл database-manager запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic