.agent/skills/supabase-project/SKILL.md
Project-specific Supabase usage patterns, clients, and migration workflow for this repo.
npx skillsauth add ripgraphics/authorsinfo supabase-projectInstall 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.
This skill documents how to use Supabase in this project with the correct clients, schema-aware patterns, and migration workflow.
supabase db reset).Use the helper that respects cookies and auth sessions:
import { createRouteHandlerClientAsync } from '@/lib/supabase/client-helper'
const supabase = await createRouteHandlerClientAsync()
const { data, error } = await supabase.from('posts').select('*')
Use service-role when a request is unauthenticated and still needs public data:
import { supabaseAdmin } from '@/lib/supabase-admin'
const { data, error } = await supabaseAdmin.from('posts').select('*')
Use the same cookie-aware server client:
import { createServerActionClientAsync } from '@/lib/supabase/client-helper'
const supabase = await createServerActionClientAsync()
Use browser client:
import { createBrowserClient } from '@supabase/ssr'
const supabase = createBrowserClient(
process.env.NEXT_PUBLIC_SUPABASE_URL!,
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!
)
Preferred method: Direct live SQL via psql using environment variables from .env.local.
Example (PowerShell):
$env:PGPASSWORD = "<SUPABASE_DB_PASSWORD>"
& "C:\Program Files\PostgreSQL\17\bin\psql.exe" -h <SUPABASE_DB_HOST> -p <SUPABASE_DB_PORT> -U <SUPABASE_DB_USER> -d <SUPABASE_DB_NAME> -c "SELECT column_name, data_type FROM information_schema.columns WHERE table_name='posts' ORDER BY ordinal_position;"
Fallback method (read-only): use supabaseAdmin to query information_schema if psql is not available.
types/database.ts (authoritative for column names/types)supabase/migrations/*.sqldocs/HOW_TO_READ_FROM_SUPABASE.mdFollow docs/scripts/HOW_TO_RUN_MIGRATIONS.md. Preferred command:
npm run db:migrate supabase/migrations/<file>.sql
Do not run migrations unless explicitly requested.
posts.get_entity_engagement, get_multiple_entities_engagement) for counts.public, friends, followers, private.lib/supabase-admin.tslib/supabase/client-helper.tslib/supabase.ts (admin client with timeout)app/api/* (route handlers using these patterns)tools
Webpack build optimization expert with deep knowledge of configuration patterns, bundle analysis, code splitting, module federation, performance optimization, and plugin/loader ecosystem. Use PROACTIVELY for any Webpack bundling issues including complex optimizations, build performance, custom plugins/loaders, and modern architecture patterns. If a specialized expert is a better fit, I will recommend switching and stop.
development
Web application security expert. OWASP Top 10, XSS, SQLi, CSRF, SSRF, authentication bypass, IDOR. Use for web app security testing.
testing
Vitest testing framework expert for Vite integration, Jest migration, browser mode testing, and performance optimization
tools
Vite build optimization expert with deep knowledge of ESM-first development, HMR optimization, plugin ecosystem, production builds, library mode, and SSR configuration. Use PROACTIVELY for any Vite bundling issues including dev server performance, build optimization, plugin development, and modern ESM patterns. If a specialized expert is a better fit, I will recommend switching and stop.