templates/skills/modules/supabase/SKILL.md
Use MCP Supabase for database operations, authentication, and storage.
npx skillsauth add hivellm/rulebook SupabaseInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
CRITICAL: Use MCP Supabase for database operations, authentication, and storage.
// Query data
supabase.from('users').select('*')
supabase.from('users').select('id, name, email')
// Insert
supabase.from('users').insert({ name: 'John', email: '[email protected]' })
// Update
supabase.from('users').update({ name: 'Jane' }).eq('id', 1)
// Delete
supabase.from('users').delete().eq('id', 1)
// Filters
supabase.from('users').select('*').eq('status', 'active')
supabase.from('users').select('*').gt('age', 18)
supabase.from('users').select('*').like('name', '%John%')
// Sign up
supabase.auth.signUp({ email, password })
// Sign in
supabase.auth.signInWithPassword({ email, password })
// Sign out
supabase.auth.signOut()
// Get session
supabase.auth.getSession()
// Get user
supabase.auth.getUser()
// Upload file
supabase.storage.from('avatars').upload('path/file.jpg', file)
// Download file
supabase.storage.from('avatars').download('path/file.jpg')
// List files
supabase.storage.from('avatars').list('folder')
// Delete file
supabase.storage.from('avatars').remove(['path/file.jpg'])
// Get public URL
supabase.storage.from('avatars').getPublicUrl('path/file.jpg')
// Subscribe to changes
supabase
.channel('room1')
.on('postgres_changes', {
event: '*',
schema: 'public',
table: 'users'
}, (payload) => {
console.log('Change received!', payload)
})
.subscribe()
// Create
const { data, error } = await supabase
.from('tasks')
.insert({ title: 'New Task', completed: false })
.select()
// Read
const { data, error } = await supabase
.from('tasks')
.select('*')
.eq('completed', false)
// Update
const { data, error } = await supabase
.from('tasks')
.update({ completed: true })
.eq('id', taskId)
// Delete
const { data, error } = await supabase
.from('tasks')
.delete()
.eq('id', taskId)
// 1. Sign up user
const { data: signUpData, error: signUpError } = await supabase.auth.signUp({
email: '[email protected]',
password: 'secure-password'
})
// 2. Sign in
const { data: signInData, error: signInError } = await supabase.auth.signInWithPassword({
email: '[email protected]',
password: 'secure-password'
})
// 3. Check session
const { data: { session } } = await supabase.auth.getSession()
// 4. Sign out
await supabase.auth.signOut()
// 1. Validate file
if (file.size > 5 * 1024 * 1024) {
throw new Error('File too large (max 5MB)')
}
// 2. Upload
const { data, error } = await supabase.storage
.from('uploads')
.upload(`${userId}/${file.name}`, file, {
cacheControl: '3600',
upsert: false
})
// 3. Get public URL
if (!error) {
const { data: { publicUrl } } = supabase.storage
.from('uploads')
.getPublicUrl(`${userId}/${file.name}`)
}
✅ DO:
if (error) throw error).select() after insert/update to get returned data❌ DON'T:
{
"mcpServers": {
"supabase": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-supabase"],
"env": {
"SUPABASE_URL": "https://your-project.supabase.co",
"SUPABASE_ANON_KEY": "your-anon-key",
"SUPABASE_SERVICE_ROLE_KEY": "your-service-role-key"
}
}
}
}
Security:
SUPABASE_ANON_KEY for client-side operationsSUPABASE_SERVICE_ROLE_KEY only server-side// Use test database for development
const supabase = createClient(
process.env.SUPABASE_TEST_URL,
process.env.SUPABASE_TEST_KEY
)
// Clean up after tests
afterEach(async () => {
await supabase.from('test_table').delete().neq('id', 0)
})
# Create migration
supabase migration new add_users_table
# Apply migrations
supabase db push
# Reset database
supabase db reset
<!-- SUPABASE:END -->research
Author a rulebook task spec interactively — research, draft, ask the user clarifying questions, confirm, then create the tasks in rulebook ready for /rulebook-driver. Use when the user wants to plan/spec a feature before implementing.
development
Behavioral guidelines to reduce common LLM coding mistakes — overcomplication, sloppy refactors, hidden assumptions, weak goals. Use when writing, reviewing, or refactoring code. Auto-applies; invoke explicitly via /karpathy-guidelines or 'follow karpathy discipline'.
data-ai
Autonomous AI agent loop for iterative task implementation (@hivehub/rulebook ralph)
data-ai
Use SQL Server for enterprise relational data storage with advanced features, high availability, and Windows integration.