Claude Skill

supabase

Use this skill when developing applications with Supabase, running the Supabase CLI, designing migrations and RLS policies, testing database behavior, generating client types, deploying the official self-hosted Docker stack, or administering its Postgres, Auth, Storage, Realtime,

LLM Mart · 0 points · 11 views 0 listing impressions 0 install-command copies
Download magnus919-agent-skills-supabase-d0edebb.zip · 35 KB

Install

skills CLI npx skills add https://github.com/magnus919/agent-skills/tree/main/supabase
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install magnus919-agent-skills@llmmart
Git git clone https://github.com/magnus919/agent-skills.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole magnus919/agent-skills collection as a plugin from our marketplace. Git is the plain clone.

README

Supabase skill

Develop, self-host, and operate Supabase without confusing a green container with a working backend or a publishable key with an authorization policy.

Why Install This Skill

Supabase combines Postgres, Auth, PostgREST, Realtime, Storage, Edge Functions, an API gateway, Studio, and connection pooling. The easy path is productive, but failures cross service boundaries: a URL mismatch breaks OAuth, a plausible migration misses DML, a secret key bypasses RLS, and an image-only upgrade can split a tested service set.

This skill gives your agent one evidence-led workflow for managed projects, CLI-based local development, and the official self-hosted Docker stack. It emphasizes reproducible migrations, negative authorization tests, safe key handling, release-set upgrades, and restores that are actually exercised.

What You Get

Resource Purpose
SKILL.md Discovery-first workflow, safety boundaries, routing, and completion checks
references/agent-evals.md The official supabase/evals harness: eval/experiment concepts, the two runtimes, run commands, and scenario-to-workflow mapping
references/architecture-and-boundaries.md Service map, keys, trust boundaries, and environment differences
references/local-development-and-cli.md CLI installation, project layout, local workflow, linking, and deployment
references/database-development-and-testing.md Migrations, declarative schemas, seeds, RLS, pgTAP, and type generation
references/application-services.md Auth, REST, Realtime, Storage, and Edge Functions integration
references/self-hosting-deployment.md Official Docker setup, configuration, TLS, hardening, and smoke testing
references/administration-and-recovery.md Backups, restores, updates, Postgres upgrades, observability, and recovery
references/troubleshooting.md Layered diagnosis for common local and self-hosted failures
references/source-index.md Dated authoritative sources and live validation scope
evals/evals.json Development, security, deployment, and recovery regression scenarios

Quick Start

For a project-local CLI install:

npm install --save-dev supabase
npx supabase init
npx supabase start
npx supabase status

For an official Linux self-hosted installation, inspect the setup script before running it, then follow the generated project's run.sh workflow:

curl -fsSL https://supabase.link/setup.sh -o setup.sh
less setup.sh
sh setup.sh
cd supabase-project
sh run.sh start
sh tests/test-self-hosted.sh http://localhost:8000

Triggers

Use this skill for Supabase CLI projects, schema migrations, generated database types, Auth and RLS design, Storage or Realtime integration, Edge Functions, managed-project linking, official Docker self-hosting, reverse proxies, secrets, backups, restores, upgrades, health checks, or cross-service troubleshooting.

Do not use it for generic PostgreSQL administration that does not involve Supabase services or conventions.

Requirements

Local development requires the Supabase CLI plus a Docker-compatible runtime. The npm-distributed CLI requires Node.js 20 or later. The official self-hosted quick start requires a supported Linux system, Git, Docker Engine, Docker Compose, OpenSSL, and jq; production operation also needs suitable DNS/TLS, protected secrets, backups, and enough host capacity.

Skill manifest

Supabase

Treat Supabase as a Postgres-centered system with multiple independently versioned services, not as one opaque backend. The managed platform, CLI local stack, and official self-hosted Compose stack share concepts but are different operating environments. Identify which one the task targets before choosing commands.

Operating contract

  1. Discover the target and current state before changing it: managed project, CLI local stack, or self-hosted Compose; CLI and service versions; project link; database and migration state; enabled services; public URLs; backup and rollback path.
  2. Confirm target, scope, and rollback path before the first mutation. Read-only discovery may proceed without confirmation. An explicit user directive to deploy or change the named target satisfies this gate.
  3. Keep publishable keys client-side and secret/service-role keys server-side only. Never print, commit, or place secret keys, database passwords, JWT signing material, SMTP credentials, or connection strings containing passwords in reports.
  4. Make database changes through versioned migrations. Review generated diffs as drafts, replay the full chain, test RLS negative cases, and regenerate client types before deployment.
  5. For self-hosting, use the official supabase/supabase Docker directory and its setup.sh, run.sh, update notes, and tests. Do not invent a reduced Compose stack unless the user explicitly wants one and accepts the lost capabilities.
  6. Verify at the delivery boundary: container health is not API health; an API response is not authorization proof; a backup is not recovery evidence.

Choose the path

Need Read first
Understand services, trust boundaries, keys, and environment differences architecture and boundaries
Install/use the CLI, establish a local workflow, or operate managed Functions, secrets, branches, SSL enforcement, CIDR restrictions, and network bans local development and CLI
Create schemas, migrations, seed data, RLS policies, tests, and generated types database development and testing
Build with Auth, REST, Realtime, Storage, and Edge Functions application services
Deploy or harden the official Docker stack self-hosting deployment
Back up, restore, update, upgrade, monitor, or recover a self-hosted instance administration and recovery
Diagnose unhealthy containers, bad URLs, auth failures, drift, or migration failures troubleshooting
Evaluate how well an agent can use Supabase with scored scenarios agent evals harness
Check claim currency or authoritative source coverage source index

First read-only discovery

supabase --version
supabase status --output json       # CLI local project; may fail when stopped
supabase migration list            # linked/local migration comparison when configured
docker compose config --quiet       # self-hosted project directory
docker compose ps --format json

For a managed project, also establish the project reference, linked status, target environment, and whether direct production changes have created drift. For self-hosting, inspect docker/CHANGELOG.md, docker/versions.md, the active COMPOSE_FILE, disk/memory headroom, and backup evidence before updates.

Development loop

Use one schema-authoring mode per project:

# Declarative: edit supabase/schemas/*.sql first
supabase db diff -f change-name

# Imperative: write the generated migration directly
supabase migration new change-name

# Both paths converge on the same checks
supabase db reset
supabase test db
supabase gen types --lang typescript --local > database.types.ts

Review every generated migration. db diff does not capture DML and has known gaps around policy renames, views, and some privileges. db reset is destructive to the local database but is the reproducibility proof: migrations in order, then seed data.

Before a linked deployment:

supabase migration list
supabase db push --dry-run
supabase db push

Never use db reset --linked or db push --include-seed against production. Pass --local or --linked explicitly when ambiguity could hit the wrong database; command defaults differ.

Self-hosted lifecycle

Use the checked-in official helper scripts from the deployment directory:

sh run.sh config
sh run.sh compose-config >/dev/null
docker compose config --quiet
sh run.sh start
sh run.sh status
sh tests/test-self-hosted.sh http://localhost:8000

Production requires real secrets, correct external URLs, TLS termination, WebSocket forwarding, protected database ports, SMTP/provider configuration as needed, backups, and restore tests. The official default stack exposes Kong on 8000, Kong TLS on 8443, and Supavisor on 5432/6543; bind or firewall them deliberately.

Verification matrix

Layer Minimum evidence
Configuration docker compose config --quiet; no placeholder secrets; URLs agree with proxy/auth callbacks
Runtime Every required service is running and healthy; bounded logs show no current failure loop
Database Expected Postgres version; migration history matches; representative query succeeds
API gateway Studio auth boundary, Auth health, REST with correct key role, JWKS endpoint
Authorization Positive and negative RLS tests as anon/authenticated users; service-role bypass never used as proof
Storage Bucket/object upload, download, integrity, signed URL, and cleanup
Realtime WebSocket subscription and database-change delivery, not just an HTTP route
Functions Invoke a real function through /functions/v1; verify auth behavior and logs
Recovery Independent logical/physical backup plus restore into a separate test target

Hard boundaries and gotchas

  • The CLI local stack is development-only: default credentials, no TLS, and no production rate limiting. Do not expose it publicly.
  • RLS must be enabled on every table in an exposed schema. A publishable key is safe in a client only when grants and RLS policies are correct. Test denial paths.
  • Secret/service-role keys bypass RLS. They never belong in browser bundles, mobile apps, logs, examples, or chat output.
  • API_EXTERNAL_URL includes /auth/v1 in the current self-hosted configuration. SITE_URL is the application landing URL, not necessarily the Supabase hostname.
  • Update the Compose configuration as a tested release set. Pulling arbitrary latest images independently can create incompatible service combinations.
  • Postgres 17 is the current default for new self-hosted deployments. Never point it at a Postgres 15 data directory. Preserve both database data and the db-config volume containing the pgsodium root key.
  • docker compose down -v, reset.sh, remote reset, key regeneration, and migration-history repair can destroy data, access, or sessions. Treat them as separate confirmed operations with recovery evidence.
  • Self-hosted feature parity is not managed-platform parity. Backups, availability, upgrades, abuse controls, SMTP, observability, and support are operator responsibilities.

Exit criteria

The task is complete only when the requested artifact or state exists and the relevant boundary has been exercised: a local project replays from migrations and passes tests; a deployment passes configuration, health, and service-level smoke tests; an update has rollback evidence and post-update checks; a backup has been restored into a separate target; and no secret material appears in committed or reported output.

Files (agent-skills)
  • evals
    • evals.json 9.9 KB
      Loading…
  • references
    • administration-and-recovery.md 7.3 KB
      Loading…
    • agent-evals.md 8.3 KB
      Loading…
    • application-services.md 5.1 KB
      Loading…
    • architecture-and-boundaries.md 5.4 KB
      Loading…
    • database-development-and-testing.md 7.5 KB
      Loading…
    • local-development-and-cli.md 7.6 KB
      Loading…
    • self-hosting-deployment.md 6.5 KB
      Loading…
    • source-index.md 4.2 KB
      Loading…
    • troubleshooting.md 6.5 KB
      Loading…
  • README.md 3.4 KB
    # Supabase skill
    
    Develop, self-host, and operate Supabase without confusing a green container with a working backend or a publishable key with an authorization policy.
    
    ## Why Install This Skill
    
    Supabase combines Postgres, Auth, PostgREST, Realtime, Storage, Edge Functions, an API gateway, Studio, and connection pooling. The easy path is productive, but failures cross service boundaries: a URL mismatch breaks OAuth, a plausible migration misses DML, a secret key bypasses RLS, and an image-only upgrade can split a tested service set.
    
    This skill gives your agent one evidence-led workflow for managed projects, CLI-based local development, and the official self-hosted Docker stack. It emphasizes reproducible migrations, negative authorization tests, safe key handling, release-set upgrades, and restores that are actually exercised.
    
    ## What You Get
    
    | Resource | Purpose |
    |---|---|
    | `SKILL.md` | Discovery-first workflow, safety boundaries, routing, and completion checks |
    | `references/agent-evals.md` | The official supabase/evals harness: eval/experiment concepts, the two runtimes, run commands, and scenario-to-workflow mapping |
    | `references/architecture-and-boundaries.md` | Service map, keys, trust boundaries, and environment differences |
    | `references/local-development-and-cli.md` | CLI installation, project layout, local workflow, linking, and deployment |
    | `references/database-development-and-testing.md` | Migrations, declarative schemas, seeds, RLS, pgTAP, and type generation |
    | `references/application-services.md` | Auth, REST, Realtime, Storage, and Edge Functions integration |
    | `references/self-hosting-deployment.md` | Official Docker setup, configuration, TLS, hardening, and smoke testing |
    | `references/administration-and-recovery.md` | Backups, restores, updates, Postgres upgrades, observability, and recovery |
    | `references/troubleshooting.md` | Layered diagnosis for common local and self-hosted failures |
    | `references/source-index.md` | Dated authoritative sources and live validation scope |
    | `evals/evals.json` | Development, security, deployment, and recovery regression scenarios |
    
    ## Quick Start
    
    For a project-local CLI install:
    
    ```sh
    npm install --save-dev supabase
    npx supabase init
    npx supabase start
    npx supabase status
    ```
    
    For an official Linux self-hosted installation, inspect the setup script before running it, then follow the generated project's `run.sh` workflow:
    
    ```sh
    curl -fsSL https://supabase.link/setup.sh -o setup.sh
    less setup.sh
    sh setup.sh
    cd supabase-project
    sh run.sh start
    sh tests/test-self-hosted.sh http://localhost:8000
    ```
    
    ## Triggers
    
    Use this skill for Supabase CLI projects, schema migrations, generated database types, Auth and RLS design, Storage or Realtime integration, Edge Functions, managed-project linking, official Docker self-hosting, reverse proxies, secrets, backups, restores, upgrades, health checks, or cross-service troubleshooting.
    
    Do not use it for generic PostgreSQL administration that does not involve Supabase services or conventions.
    
    ## Requirements
    
    Local development requires the Supabase CLI plus a Docker-compatible runtime. The npm-distributed CLI requires Node.js 20 or later. The official self-hosted quick start requires a supported Linux system, Git, Docker Engine, Docker Compose, OpenSSL, and `jq`; production operation also needs suitable DNS/TLS, protected secrets, backups, and enough host capacity.
    
  • SKILL.md 8.5 KB
    ---
    name: supabase
    description: >-
      Use this skill when developing applications with Supabase, running the Supabase CLI, designing migrations and RLS policies, testing database behavior, generating client types, deploying the official self-hosted Docker stack, or administering its Postgres, Auth, Storage, Realtime, Functions, API gateway, backups, upgrades, and security. Use it for managed and self-hosted projects. Do not use for generic PostgreSQL work with no Supabase services or conventions.
    license: MIT
    compatibility: Requires network access for documentation lookup. Local development requires the Supabase CLI and a Docker-compatible runtime; self-hosting requires Linux, Git, Docker Engine, and Docker Compose.
    metadata:
      source: https://supabase.com/docs
      research_checked: "2026-07-16"
    ---
    
    # Supabase
    
    Treat Supabase as a Postgres-centered system with multiple independently versioned services, not as one opaque backend. The managed platform, CLI local stack, and official self-hosted Compose stack share concepts but are different operating environments. Identify which one the task targets before choosing commands.
    
    ## Operating contract
    
    1. Discover the target and current state before changing it: managed project, CLI local stack, or self-hosted Compose; CLI and service versions; project link; database and migration state; enabled services; public URLs; backup and rollback path.
    2. Confirm target, scope, and rollback path before the first mutation. Read-only discovery may proceed without confirmation. An explicit user directive to deploy or change the named target satisfies this gate.
    3. Keep publishable keys client-side and secret/service-role keys server-side only. Never print, commit, or place secret keys, database passwords, JWT signing material, SMTP credentials, or connection strings containing passwords in reports.
    4. Make database changes through versioned migrations. Review generated diffs as drafts, replay the full chain, test RLS negative cases, and regenerate client types before deployment.
    5. For self-hosting, use the official `supabase/supabase` Docker directory and its `setup.sh`, `run.sh`, update notes, and tests. Do not invent a reduced Compose stack unless the user explicitly wants one and accepts the lost capabilities.
    6. Verify at the delivery boundary: container health is not API health; an API response is not authorization proof; a backup is not recovery evidence.
    
    ## Choose the path
    
    | Need | Read first |
    |---|---|
    | Understand services, trust boundaries, keys, and environment differences | [architecture and boundaries](references/architecture-and-boundaries.md) |
    | Install/use the CLI, establish a local workflow, or operate managed Functions, secrets, branches, SSL enforcement, CIDR restrictions, and network bans | [local development and CLI](references/local-development-and-cli.md) |
    | Create schemas, migrations, seed data, RLS policies, tests, and generated types | [database development and testing](references/database-development-and-testing.md) |
    | Build with Auth, REST, Realtime, Storage, and Edge Functions | [application services](references/application-services.md) |
    | Deploy or harden the official Docker stack | [self-hosting deployment](references/self-hosting-deployment.md) |
    | Back up, restore, update, upgrade, monitor, or recover a self-hosted instance | [administration and recovery](references/administration-and-recovery.md) |
    | Diagnose unhealthy containers, bad URLs, auth failures, drift, or migration failures | [troubleshooting](references/troubleshooting.md) |
    | Evaluate how well an agent can use Supabase with scored scenarios | [agent evals harness](references/agent-evals.md) |
    | Check claim currency or authoritative source coverage | [source index](references/source-index.md) |
    
    ## First read-only discovery
    
    ```sh
    supabase --version
    supabase status --output json       # CLI local project; may fail when stopped
    supabase migration list            # linked/local migration comparison when configured
    docker compose config --quiet       # self-hosted project directory
    docker compose ps --format json
    ```
    
    For a managed project, also establish the project reference, linked status, target environment, and whether direct production changes have created drift. For self-hosting, inspect `docker/CHANGELOG.md`, `docker/versions.md`, the active `COMPOSE_FILE`, disk/memory headroom, and backup evidence before updates.
    
    ## Development loop
    
    Use one schema-authoring mode per project:
    
    ```sh
    # Declarative: edit supabase/schemas/*.sql first
    supabase db diff -f change-name
    
    # Imperative: write the generated migration directly
    supabase migration new change-name
    
    # Both paths converge on the same checks
    supabase db reset
    supabase test db
    supabase gen types --lang typescript --local > database.types.ts
    ```
    
    Review every generated migration. `db diff` does not capture DML and has known gaps around policy renames, views, and some privileges. `db reset` is destructive to the local database but is the reproducibility proof: migrations in order, then seed data.
    
    Before a linked deployment:
    
    ```sh
    supabase migration list
    supabase db push --dry-run
    supabase db push
    ```
    
    Never use `db reset --linked` or `db push --include-seed` against production. Pass `--local` or `--linked` explicitly when ambiguity could hit the wrong database; command defaults differ.
    
    ## Self-hosted lifecycle
    
    Use the checked-in official helper scripts from the deployment directory:
    
    ```sh
    sh run.sh config
    sh run.sh compose-config >/dev/null
    docker compose config --quiet
    sh run.sh start
    sh run.sh status
    sh tests/test-self-hosted.sh http://localhost:8000
    ```
    
    Production requires real secrets, correct external URLs, TLS termination, WebSocket forwarding, protected database ports, SMTP/provider configuration as needed, backups, and restore tests. The official default stack exposes Kong on `8000`, Kong TLS on `8443`, and Supavisor on `5432`/`6543`; bind or firewall them deliberately.
    
    ## Verification matrix
    
    | Layer | Minimum evidence |
    |---|---|
    | Configuration | `docker compose config --quiet`; no placeholder secrets; URLs agree with proxy/auth callbacks |
    | Runtime | Every required service is running and healthy; bounded logs show no current failure loop |
    | Database | Expected Postgres version; migration history matches; representative query succeeds |
    | API gateway | Studio auth boundary, Auth health, REST with correct key role, JWKS endpoint |
    | Authorization | Positive and negative RLS tests as anon/authenticated users; service-role bypass never used as proof |
    | Storage | Bucket/object upload, download, integrity, signed URL, and cleanup |
    | Realtime | WebSocket subscription and database-change delivery, not just an HTTP route |
    | Functions | Invoke a real function through `/functions/v1`; verify auth behavior and logs |
    | Recovery | Independent logical/physical backup plus restore into a separate test target |
    
    ## Hard boundaries and gotchas
    
    - The CLI local stack is development-only: default credentials, no TLS, and no production rate limiting. Do not expose it publicly.
    - RLS must be enabled on every table in an exposed schema. A publishable key is safe in a client only when grants and RLS policies are correct. Test denial paths.
    - Secret/service-role keys bypass RLS. They never belong in browser bundles, mobile apps, logs, examples, or chat output.
    - `API_EXTERNAL_URL` includes `/auth/v1` in the current self-hosted configuration. `SITE_URL` is the application landing URL, not necessarily the Supabase hostname.
    - Update the Compose configuration as a tested release set. Pulling arbitrary `latest` images independently can create incompatible service combinations.
    - Postgres 17 is the current default for new self-hosted deployments. Never point it at a Postgres 15 data directory. Preserve both database data and the `db-config` volume containing the pgsodium root key.
    - `docker compose down -v`, `reset.sh`, remote reset, key regeneration, and migration-history repair can destroy data, access, or sessions. Treat them as separate confirmed operations with recovery evidence.
    - Self-hosted feature parity is not managed-platform parity. Backups, availability, upgrades, abuse controls, SMTP, observability, and support are operator responsibilities.
    
    ## Exit criteria
    
    The task is complete only when the requested artifact or state exists and the relevant boundary has been exercised: a local project replays from migrations and passes tests; a deployment passes configuration, health, and service-level smoke tests; an update has rollback evidence and post-update checks; a backup has been restored into a separate target; and no secret material appears in committed or reported output.
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.