소스 정보
- 저장소
- amo-tech-ai/medellin-spark
- 최근 소스 활동
- 2025년 10월 26일 09:24
- 감지된 SKILL.md 언어
- 영어
- 스타
- 0
- 포크
- 0
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/amo-tech-ai/medellin-spark --skill supabase-migration명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
Control Chrome browser through MCP for testing, debugging, network analysis, and performance profiling. Use when testing web apps, measuring Core Web Vitals, analyzing network requests, debugging console errors, or when the user mentions Chrome DevTools, performance traces, or browser automation.
Production-ready CopilotKit pitch deck wizard in main application. Use when enhancing AI conversation features, optimizing Edge Function integration, debugging chat interface, or improving pitch deck generation flow. System is PRODUCTION READY (98/100).
Runs pre-commit checks and validates code quality. Use when preparing commits, running pre-deploy checks, or validating code before deployment.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | supabase-migration |
| description | Safe database migration creation and management for Supabase PostgreSQL |
| version | 1.0.0 |
Create, test, and apply database migrations safely following project conventions.
YYYYMMDDHHMMSS_description.sql
Examples:
20251018120000_add_user_preferences.sql
20251018130000_enable_rls_on_comments.sql
/home/sk/template-copilot-kit-py/supabase/migrations/
Always use:
CREATE TABLE IF NOT EXISTSALTER TABLE ... ADD COLUMN IF NOT EXISTS (PostgreSQL 9.6+)DROP TABLE IF EXISTSDO $$ ... END $$; blocks for conditional logicNever use:
CREATE TABLE without IF NOT EXISTSALTER TABLE ADD COLUMN without IF NOT EXISTSEvery new table MUST include:
-- Enable RLS
ALTER TABLE table_name ENABLE ROW LEVEL SECURITY;
-- Basic policy (user owns record)
CREATE POLICY "Users can manage own records"
ON table_name
FOR ALL
TO authenticated
USING (profile_id = auth.uid())
WITH CHECK (profile_id = auth.uid());
Use profile_id, NOT user_id:
-- ✅ Correct
profile_id UUID REFERENCES profiles(id) ON DELETE CASCADE
-- ❌ Wrong
user_id UUID REFERENCES auth.users(id)
-- Migration: <description>
-- Created: YYYY-MM-DD
-- Status: <pending|applied|rolled-back>
BEGIN;
-- =============================================================================
-- TABLE CREATION
-- =============================================================================
CREATE TABLE IF NOT EXISTS table_name (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
profile_id UUID NOT NULL REFERENCES profiles(id) ON DELETE CASCADE,
created_at TIMESTAMPTZ DEFAULT now(),
updated_at TIMESTAMPTZ DEFAULT now(),
-- Additional columns
name TEXT NOT NULL,
status TEXT DEFAULT 'active'
);
-- =============================================================================
-- INDEXES
-- =============================================================================
CREATE INDEX IF NOT EXISTS idx_table_profile
ON table_name(profile_id);
CREATE INDEX IF NOT EXISTS idx_table_created
ON table_name(created_at DESC);
-- =============================================================================
-- RLS POLICIES
-- =============================================================================
ALTER TABLE table_name ENABLE ROW LEVEL SECURITY;
-- Drop existing policies (idempotent)
DROP POLICY IF "policy_name" table_name;
POLICY "Users manage own records"
table_name
authenticated
(profile_id auth.uid())
(profile_id auth.uid());
REPLACE update_updated_at()
$$
NEW.updated_at now();
;
;
$$ plpgsql;
IF trigger_update_updated_at table_name;
trigger_update_updated_at
BEFORE table_name
update_updated_at();
;
# Navigate to migrations folder
cd /home/sk/template-copilot-kit-py/supabase/migrations
# Create new migration (use current timestamp)
touch $(date +%Y%m%d%H%M%S)_description.sql
# Edit with idempotent SQL
nano <filename>.sql
# Option 1: Apply via Supabase CLI
supabase db push
# Option 2: Apply directly via MCP
# Use mcp__supabase__execute_sql with migration content
-- Check table created
SELECT tablename FROM pg_tables
WHERE tablename = 'your_table_name';
-- Verify RLS enabled
SELECT tablename, rowsecurity
FROM pg_tables
WHERE tablename = 'your_table_name';
-- Expected: rowsecurity = true
-- Check policies exist
SELECT schemaname, tablename, policyname
FROM pg_policies
WHERE tablename = 'your_table_name';
-- Test data insertion
INSERT INTO your_table_name (profile_id, name)
VALUES (auth.uid(), 'Test record')
RETURNING *;
# Create rollback migration
touch $(date +%Y%m%d%H%M%S)_rollback_previous_migration.sql
Rollback template:
BEGIN;
DROP TABLE IF EXISTS table_name CASCADE;
-- Remove any other changes
COMMIT;
-- Add column safely
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1 FROM information_schema.columns
WHERE table_name = 'presentations'
AND column_name = 'new_column'
) THEN
ALTER TABLE presentations
ADD COLUMN new_column TEXT;
END IF;
END $$;
CREATE OR REPLACE FUNCTION function_name(param1 TEXT)
RETURNS TABLE (id UUID, name TEXT) AS $$
BEGIN
RETURN QUERY
SELECT t.id, t.name
FROM table_name t
WHERE t.profile_id = auth.uid()
AND t.status = param1;
END;
$$ LANGUAGE plpgsql SECURITY DEFINER;
-- Allow public read access to presentations
CREATE POLICY "Public presentations visible to all"
ON presentations
FOR SELECT
TO anon, authenticated
USING (is_public = true);
profile_id\dt table_nameSELECT rowsecurity FROM pg_tablesSELECT * FROM pg_policies# List applied migrations
supabase migration list
# Check current schema
supabase db diff
Error: "relation already exists"
IF NOT EXISTSIF NOT EXISTS to CREATE statementsError: "column already exists"
information_schema checkError: "violates foreign key constraint"
Error: "permission denied for table"
profile_id = auth.uid()profile_id)cd /home/sk/template-copilot-kit-py/supabase/migrations
touch $(date +%Y%m%d%H%M%S)_description.sql
supabase db push
SELECT tablename, rowsecurity
FROM pg_tables
WHERE schemaname = 'public';
SELECT tablename, policyname, cmd
FROM pg_policies
ORDER BY tablename;
File: 20251018120000_add_comments_table.sql
-- Migration: Add comments table for presentations
-- Created: 2025-10-18
-- Status: pending
BEGIN;
-- Table
CREATE TABLE IF NOT EXISTS comments (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
presentation_id UUID NOT NULL REFERENCES presentations(id) ON DELETE CASCADE,
profile_id UUID NOT NULL REFERENCES profiles(id) ON DELETE CASCADE,
content TEXT NOT NULL,
created_at TIMESTAMPTZ DEFAULT now(),
updated_at TIMESTAMPTZ DEFAULT now()
);
-- Indexes
CREATE INDEX IF NOT EXISTS idx_comments_presentation
ON comments(presentation_id);
CREATE INDEX IF NOT EXISTS idx_comments_profile
ON comments(profile_id);
-- RLS
ALTER TABLE comments ENABLE ROW LEVEL SECURITY;
DROP POLICY IF EXISTS "Users manage own comments" ON comments;
CREATE POLICY "Users manage own comments"
ON comments FOR ALL TO authenticated
USING (profile_id = auth.uid())
WITH CHECK (profile_id = auth.uid());
DROP POLICY IF "Public comments visible" comments;
POLICY "Public comments visible"
comments anon, authenticated
(
(
presentations
id comments.presentation_id
is_public
)
);
;
This skill ensures all migrations are safe, idempotent, and follow project security standards.