Complete Supabase CMS integration for Astro websites, including database schema design, RLS policies, content management workflows, and client setup.
Inherits all available tools
Additional assets for this skill
This skill inherits all available tools. When active, it can use any tool Claude has access to.
examples/blog-with-cms-example.mdexamples/media-management-example.mdexamples/multi-tenant-cms-example.mdexamples/realtime-content-updates-example.mdscripts/apply-migration.shscripts/apply-rls-policies.shscripts/generate-supabase-types.shscripts/setup-supabase-cms.shscripts/test-rls-policies.shtemplates/client/supabase-client.tstemplates/queries/content-queries.tstemplates/queries/paginated-queries.tstemplates/realtime/content-subscription.tstemplates/rls/basic-policies.sqltemplates/rls/draft-publish-policies.sqltemplates/rls/multi-tenant-policies.sqltemplates/schemas/blog-schema.sqltemplates/schemas/media-schema.sqltemplates/schemas/pages-schema.sqltemplates/workflows/draft-publish.tsname: supabase-cms description: Supabase CMS integration patterns, schema design, RLS policies, and content management for Astro websites. Use when building CMS systems, setting up Supabase backends, creating content schemas, implementing RLS security, or when user mentions Supabase CMS, headless CMS, content management, database schemas, or Row Level Security. allowed-tools: - Read
Complete Supabase CMS integration for Astro websites, including database schema design, RLS policies, content management workflows, and client setup.
This skill provides comprehensive Supabase CMS support:
Run the setup script to initialize Supabase CMS in an Astro project:
bash scripts/setup-supabase-cms.sh [project-path]
This script:
Use schema templates to design content tables:
Blog/Posts Schema:
# Read template for blog content
Read: templates/schemas/blog-schema.sql
Read: templates/schemas/blog-with-categories.sql
Pages Schema:
# Read template for static pages
Read: templates/schemas/pages-schema.sql
Media/Assets Schema:
# Read template for media management
Read: templates/schemas/media-schema.sql
Multi-tenant Schema:
# Read template for multi-tenant content
Read: templates/schemas/multi-tenant-schema.sql
Apply schema migrations to Supabase:
bash scripts/apply-migration.sh [migration-file]
This script:
Implement Row Level Security policies:
Basic RLS Templates:
Read: templates/rls/basic-policies.sql
Read: templates/rls/multi-tenant-policies.sql
Read: templates/rls/draft-publish-policies.sql
Apply RLS Policies:
bash scripts/apply-rls-policies.sh [table-name] [policy-type]
Policy types:
public-read: Anyone can read, authenticated can writeowner-only: Only owner can read/writedraft-publish: Public reads published, owner manages draftsmulti-tenant: Tenant isolation with RLSUse workflow templates for content operations:
Draft/Publish Workflow:
Read: templates/workflows/draft-publish.ts
Features:
Content Versioning:
Read: templates/workflows/versioning.ts
Features:
Setup Supabase client in Astro:
Client Configuration:
Read: templates/client/supabase-client.ts
Read: templates/client/server-client.ts
Query Patterns:
Read: templates/queries/content-queries.ts
Read: templates/queries/filtered-queries.ts
Read: templates/queries/paginated-queries.ts
Generate types from database schema:
bash scripts/generate-supabase-types.sh [project-path]
This creates:
Enable real-time content updates:
Realtime Templates:
Read: templates/realtime/content-subscription.ts
Read: templates/realtime/live-preview.ts
Features:
created_at, updated_at timestampsslug fields with unique constraintsstatus enum for draft/published statespublished_at for schedulingmetadata JSONB for flexible fields# Use blog schema template
Read: templates/schemas/blog-schema.sql
# Customize for your needs, then apply
bash scripts/apply-migration.sh migrations/001_create_posts.sql
# Apply draft-publish policies
bash scripts/apply-rls-policies.sh posts draft-publish
# Test policies
bash scripts/test-rls-policies.sh posts
// Read query template
Read: templates/queries/content-queries.ts
// Use in Astro page
import { supabase } from '@/lib/supabase'
const { data: posts } = await supabase
.from('posts')
.select('*')
.eq('status', 'published')
.order('published_at', { ascending: false })
// Read realtime template
Read: templates/realtime/content-subscription.ts
// Subscribe to content changes
const subscription = supabase
.channel('content-changes')
.on('postgres_changes'
{ event: '*', schema: 'public', table: 'posts' }
handleContentChange
)
.subscribe()
supabase db lintALTER TABLE posts ENABLE ROW LEVEL SECURITY;auth.uid() for user-specific policiesbash scripts/generate-supabase-types.sh.astro cache directory