agentleFS
Kastalien-ResearchKastalien-Research/thoughtbox/.agents/skills/supabase/SKILL.md

supabase

Skill64 starsChanged 4 months agoMITView on GitHub

Manage Supabase local and hosted infrastructure. Migrations, schema diff, status, reset, push, and inspection. Wraps the Supabase CLI with project-specific context and gotcha avoidance.

60 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use firebase, vercel and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • xfstudioSkill

    firebase

    Firebase gives you a complete backend in minutes - auth, database, storage, functions, hosting. But the ease of setup hides real complexity. Security rules are your last line of defense, and they're often wrong. Firestore queries are limited, and you learn this after you've designed your data model. This skill covers Firebase Authentication, Firestore, Realtime Database, Cloud Functions, Cloud Storage, and Firebase Hosting. Key insight: Firebase is optimized for read-heavy, denormalized data. I

    Also in 5 projects that use this

  • SentrySkill

    vercel

    Deploy and inspect Vercel apps, assign aliases, delete deployments, investigate logs, and monitor deployment outcomes. Use for Vercel deployment and log requests, not GitHub code changes or other cloud providers.

    Also in 4 projects that use this

  • ffsshhttiikkSkill

    flutter

    Flutter cross-platform framework

    Also in 3 projects that use this

  • VercelSkill

    react-native

    React Native renderer for json-render that turns JSON specs into native mobile UIs. Use when working with @json-render/react-native, building React Native UIs from JSON, creating mobile component catalogs, or rendering AI-generated specs on mobile.

    Also in 3 projects that use this

  • VercelSkill

    vercel-optimize

    Use for Vercel cost and performance optimization on deployed projects, especially Next.js, SvelteKit, Nuxt, and limited Astro apps. Collect Vercel metrics, usage, project config, and code scan results first; investigate only metric-backed candidates; produce ranked recommendations grounded in verified files and version-aware Vercel/framework docs. Trigger for Vercel bill reduction, slow or expensive routes, caching opportunities, Function Invocations, Build Minutes, Fast Data Transfer, Core Web Vitals, Bot Management, Fluid compute, or cost breakdown requests.

    Also in 3 projects that use this

  • wewpellex21Skill

    backend

    Servers, routes, APIs, and backend architecture. Activated when Claude creates server-side code, API routes, or Express/Fastify/Next.js API handlers.

    Also in 3 projects that use this

  • +2 more from vercel-labs

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 0 are common, 3 are distinctive, and 10 are very specific to this project.

  • 0

    Common

    Most of the 58 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run supabase status for local container health

    line 24
  2. Very specific:

    Run supabase migration list to show local vs remote migration drift

    line 25
  3. Very specific:

    Run supabase migration new <name> to create the file

    line 32
  4. Very specific:

    Run supabase db diff to show schema changes not captured in migrations

    line 38
  5. Distinctive:

    If changes exist, offer to create a migration capturing them

    line 39
  6. Distinctive:

    If clean, report "Schema in sync with migrations"

    line 40
  7. Very specific:

    Run supabase migration list to show what will be pushed

    line 44
  8. Very specific:

    Run supabase db push to apply

    line 47
  9. Very specific:

    Run supabase migration list again to confirm sync

    line 48
  10. Very specific:

    Run supabase db pull to generate a migration from remote schema changes

    line 52
  11. Very specific:

    Run supabase db reset to drop and re-apply all migrations

    line 59
  12. Very specific:

    Run supabase services to verify version alignment

    line 80
  13. Distinctive:

    Always end with a one-line status summary:

    line 137

“Common” is measured: kept by at least 6 in 10 of the 58 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Manage Supabase: $ARGUMENTS

Project Context

  • Linked project: Thoughtbox (akjccuoncxlvrrtkvtno, West US Oregon)
  • Local DB URL: postgresql://postgres:postgres@127.0.0.1:54322/postgres
  • Migrations dir: supabase/migrations/
  • Config: supabase/config.toml

Commands

Parse the first word of $ARGUMENTS to determine the command:

status — Show local and hosted state

  1. Run supabase status for local container health
  2. Run supabase migration list to show local vs remote migration drift
  3. Report: which migrations are local-only, remote-only, or synced

migrate — Create a new migration

Parse remaining arguments for the migration name.

  1. Run supabase migration new <name> to create the file
  2. Open the created file path for editing
  3. Remind: after writing SQL, run /supabase diff to verify, then /supabase push to deploy

diff — Diff local schema against migrations

  1. Run supabase db diff to show schema changes not captured in migrations
  2. If changes exist, offer to create a migration capturing them
  3. If clean, report "Schema in sync with migrations"

push — Push migrations to hosted project

  1. Run supabase migration list to show what will be pushed
  2. List the pending migrations and their filenames
  3. Ask for confirmation before proceeding — this modifies the hosted database
  4. Run supabase db push to apply
  5. Run supabase migration list again to confirm sync

pull — Pull remote schema to local migrations

  1. Run supabase db pull to generate a migration from remote schema changes
  2. Show the generated migration file
  3. Remind: review the SQL before committing

reset — Reset local database to migrations

  1. Confirm the user wants to destroy local data
  2. Run supabase db reset to drop and re-apply all migrations
  3. Report success and migration count

inspect — Inspect hosted database

Parse remaining arguments for the inspection type. Default to db-stats.

Available inspections:

  • db-stats — Size, cache hit rates, WAL size
  • table-stats — Table sizes and row counts
  • index-stats — Index usage and bloat
  • outliers — Slowest queries
  • locks — Active locks
  • bloat — Table and index bloat estimates
  • role-stats — Role information

Run: supabase inspect db <type> --linked

link — Link or re-link to hosted project

  1. Run supabase link --project-ref akjccuoncxlvrrtkvtno
  2. Run supabase services to verify version alignment
  3. Report any version mismatches between local and remote

Gotchas (learned from experience)

GotchaDetail
PG version mismatchCLI upgrades can change local PG version (e.g., 15→17). Old volumes fail with "incompatible data directory". Fix: supabase stop --no-backup, remove volume, supabase start.
--linked flag inconsistencySome commands use --linked (e.g., inspect db), others don't support it (e.g., db execute, status). Check --help before assuming.
Migration orderingMigrations sort lexicographically by filename. Use YYYYMMDDHHMMSS_ prefix (supabase CLI does this automatically with migration new).
RLS policiesNew tables have RLS enabled by default. Forgetting policies means zero rows returned, not errors. Always add policies in the same migration that creates the table.
db push is irreversibleThere is no db unpush. Test migrations locally with db reset first.
Service role vs anon keyAdmin operations (user management, bypassing RLS) require the service_role key, not the anon/publishable key. Never expose service_role client-side.
Local vs hosted authLocal auth (GoTrue) has different rate limits and email config than hosted. Test auth flows against hosted before shipping.

Candidate Slash Commands

These are composable building blocks for workflows:

CommandPurposeImplementation
/sb-statusQuick health checksupabase status && supabase migration list
/sb-new-migrationCreate + open migrationsupabase migration new <name> then open file
/sb-sync-checkDrift detectionsupabase migration list + diff analysis
/sb-reset-localClean slate local DBsupabase db reset with confirmation
/sb-pushDeploy migrationssupabase db push with pre-flight check

Candidate Hooks

These can be wired into .Codex/settings.json:

EventHookPurpose
PreToolUse:BashGuard supabase db pushRequire confirmation before pushing to hosted
PostToolUse:WriteAuto-lint on supabase/migrations/*.sqlRun supabase db lint after writing migration files
SessionStartMigration drift checkRun supabase migration list on session start if supabase dir exists
PreToolUse:BashBlock supabase stop --no-backupPrevent accidental data loss without explicit intent

Workflow Compositions

New feature with schema changes

/sb-status → /sb-new-migration → [write SQL] → /sb-reset-local → [test] → /sb-push

Debug hosted schema issues

/supabase inspect db-stats → /supabase inspect outliers → /supabase inspect bloat

Sync after pulling remote changes

git pull → /sb-sync-check → /sb-reset-local (if drifted) → [verify]

Output

Always end with a one-line status summary:

Supabase: [local: running|stopped] [migrations: N local, N remote, N pending] [linked: yes|no]

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.