Agent skill

Supabase Schema From Requirements

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Design Supabase Postgres schema from business requirements with migrations, RLS, and types.

MITAuto-check passedDatabases

Install Supabase Schema From Requirements

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill supabase-schema-from-requirements -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace supabase-schema-from-requirements --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/supabase-schema-from-requirements .claude/skills/supabase-schema-from-requirements && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
supabase-schema-from-requirements
GitHub stars
2.8k
Token cost
~1.8k tokens
SKILL.md length
652 words
Files
4 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Design Supabase Postgres schema from business requirements with migrations, RLS, and types.

  • Works in 3 steps: Parse Requirements and Create Migration → Add Row Level Security Policies → Apply Migration and Generate Types
  • Translating specifications into database tables
  • SKILL.md covers Overview, Prerequisites, Instructions and Output, plus 4 more sections
  • Calls npx, supabase and npm

What it does

Supabase Schema From Requirements is an agent skill from jeremylongshore/tons-of-skills-marketplace. Design Supabase Postgres schema from business requirements with migrations, RLS, and types. Use when translating specifications into database tables, creating migration files, adding Row Level Security policies, or generating TypeScript types from schema. Trigger with phrases like "supabase schema", "design database supabase", "schema from requirements", "supabase migration", "supabase tables from spec".

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `references/rls-policies.md`, `references/typescript-client.md` and `references/worked-schema-examples.md`). Compatibility notes: Designed for Claude Code

It sits in Databases, covering PRD writing, Type safety and Translation. It works with Supabase and PostgreSQL. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Translating specifications into database tables
  • Creating migration files
  • Adding Row Level Security policies
  • Generating TypeScript types from schema

Example prompts

  • “supabase schema”
  • “design database supabase”
  • “schema from requirements”
  • “/supabase-schema-from-requirements”

Requirements

  • Node.js
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Bash(supabase:*), Bash(npx:*)

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Parse Requirements and Create Migration
  2. Add Row Level Security Policies
  3. Apply Migration and Generate Types

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Bash(supabase:*)
    • Bash(npx:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx
    • supabase
    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • supabase.com
    • postgresql.org

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Supabase Schema From Requirements loads about 1.8k tokens when it runs, and up to ~4.3k if it reads all its reference files. Until then it costs about 110 tokens; SKILL.md has 652 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~110
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 652 words, ~1,836 tokens.

Download SKILL.mdSave it as .claude/skills/supabase-schema-from-requirements/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
supabase-schema-from-requirements
description
Design Supabase Postgres schema from business requirements with migrations, RLS, and types. Use when translating specifications into database tables, creating migration files, adding Row Level Security policies, or generating TypeScript types from schema. Trigger with phrases like "supabase schema", "design database supabase", "schema from requirements", "supabase migration", "supabase tables from spec".
allowed-tools
Read, Write, Bash(supabase:*), Bash(npx:*)
compatibility
Designed for Claude Code
version
1.54.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, supabase, database, migration, schema-design, postgres, rls

Supabase Schema from Requirements

Overview

Translate business requirements into a production-ready Postgres schema inside Supabase, covering the full path from specification to applied migration: entity extraction, tables with proper types and constraints, Row Level Security policies, performance indexes, timestamp triggers, and TypeScript type generation. Getting this right early matters because every downstream feature — auth, storage, realtime, edge functions — depends on well-designed tables.

Prerequisites

  • Supabase CLI installed (npm install -g supabase) and project linked (supabase link)
  • @supabase/supabase-js v2+ installed in the project
  • Business requirements, PRD, or specification document identifying entities and access rules
  • Local Supabase running (supabase start) or a linked remote project

Instructions

Step 1: Parse Requirements and Create Migration

Read the requirements document and extract entities, attributes, relationships, and access control rules. Map each entity to a Postgres table.

Entity extraction example (project management app):

EntityKey ColumnsRelationships
Organizationname, slug, planhas many Projects, has many Members
Projectname, description, statusbelongs to Organization, has many Tasks
Tasktitle, priority, status, due_datebelongs to Project, assigned to User
Memberrole (owner/admin/member)junction linking User to Organization

Create the migration file:

bash
npx supabase migration new create_tables
# Creates: supabase/migrations/TIMESTAMP_create_tables.sql

Write the migration SQL using standard Postgres data types (uuid, text, integer, boolean, timestamptz, jsonb): Full worked migration (project-management app — tables, FKs, indexes, moddatetime triggers): references/worked-schema-examples.md.

Data type selection guide:

Use caseTypeNotes
Primary keysuuidAlways with uuid_generate_v4() default
Names, titlestextPrefer over varchar in Postgres
Counts, ranksintegerUse bigint for sequences
FlagsbooleanDefault explicitly to true or false
TimestampstimestamptzNever use timestamp without timezone
Flexible datajsonbQueryable JSON; use for settings, metadata
Liststext[]Postgres arrays for simple tags or labels
Step 2: Add Row Level Security Policies

Every table exposed to the client must have RLS enabled. Write reusable security definer helper functions first, then write per-table policies that call them. The skeleton for one table:

sql
alter table public.organizations enable row level security;

create policy "Users read own orgs"
  on public.organizations for select
  using (public.is_org_member(id));

The full worked policy set — the is_org_member / is_org_admin helper functions and every select/insert/update/delete policy across organizations, members, projects, and tasks — is in references/rls-policies.md. Name policies after who and what action ("Admins manage members", "Assignee updates tasks").

Step 3: Apply Migration and Generate Types
bash
# Apply migration locally
npx supabase db reset

# Or push to a linked remote project
npx supabase db push

# Generate TypeScript types from the live schema
npx supabase gen types typescript --local > types/supabase.ts

Pass the generated Database type as the generic parameter to createClient (see import type { Database } from './types/supabase') for end-to-end type safety on every query. Full typed-client walkthrough — typed inserts, foreign-key joins, nested multi-table joins, and an RLS-enforcement check — is in references/typescript-client.md.

Show full SKILL.md (260 more words)Show less

Output

  • SQL migration file under supabase/migrations/ with all tables, constraints, and indexes
  • RLS policies matching the access control rules from requirements
  • Helper functions (is_org_member, is_org_admin) for reusable authorization checks
  • moddatetime triggers for automatic updated_at management
  • Generated TypeScript types at types/supabase.ts for type-safe client queries
  • Partial indexes on frequently filtered columns (status, due_date)

Error Handling

ErrorCauseSolution
42P07: relation already existsTable name collision in migrationUse create table if not exists or rename the table
23503: foreign key violationInsert references a nonexistent parent rowInsert parent rows first, or check the UUID
42501: insufficient privilegeRLS helper function permissionsAdd security definer to the function definition
42883: function uuid_generate_v4() does not existExtension not enabledAdd create extension if not exists "uuid-ossp"
supabase db push succeeds but tables missingMigration was already recordedCheck supabase_migrations.schema_migrations and repair
PGRST204: column not foundTypeScript types out of syncRe-run npx supabase gen types typescript --local > types/supabase.ts
new row violates row-level securityRLS policy blocks the operationVerify auth.uid() matches expected value; check policy using clause
moddatetime trigger failsExtension not enabledAdd create extension if not exists "moddatetime" at top of migration

Examples

E-commerce schema (different domain, same pattern). The complete e-commerce migration SQL — stores, products, orders, order_items with FKs and indexes — is in references/worked-schema-examples.md, and the matching typed client queries are in references/typescript-client.md.

Resources

Next Steps

For auth integration, file storage, and realtime subscriptions on top of this schema, proceed to supabase-auth-storage-realtime-core.

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (references) in skills/.curated/supabase-schema-from-requirements of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/rls-policies.md
  • references/typescript-client.md
  • references/worked-schema-examples.md

Open the folder on GitHubat commit cfae287

Compare with similar skills

Supabase Schema From Requirements next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Supabase Schema From Requirements compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Supabase Schema From Requirements this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1.8kAutomated safety check: PassMIT
Supabase Postgres Best Practicessupabase/agent-skills2.7k24 repos~808Automated safety check: PassMIT
Expert DatabaseReJeCtAll/ExpertTeam-Codex113—~692Automated safety check: PassMIT
Database Domain Specialistmodu-ai/moai-adk1.2k—~2.8kAutomated safety check: PassApache-2.0
Postgres Patternsaffaan-m/ECC276k—~1kAutomated safety check: PassMIT
Memstack Security Rls Guardiancwinvestments/memstack423—~3.4kAutomated safety check: PassProprietary

Similar skills

  • Official

    Gives the agent Postgres rules to consult before writing or changing tables, queries, indexes, RLS policies or migrations, and when diagnosing slow queries.

    2.7k GitHub starsUsed in 24 repos~808 tokens
    DatabasesAuto-check passed
  • Expert Database

    ReJeCtAll/ExpertTeam-Codex

    数据库优化专家入口。用于 Codex CLI 的 $expert-database 调用. An agent skill from ReJeCtAll/ExpertTeam-Codex.

    113 GitHub stars~692 tokensUpdated 3 mo ago
    DatabasesAuto-check passed
  • Database guidance for PostgreSQL, MongoDB, Redis and Oracle plus Neon, Supabase and Firestore: schema design, indexing, query tuning and cloud database choice.

    1.2k GitHub stars~2.8k tokensUpdated yesterday
    DatabasesAuto-check passed
  • Postgres Patterns

    affaan-m/ECC

    PostgreSQL database patterns for query optimization, schema design, indexing, and security.

    276k GitHub stars~1k tokensUpdated yesterday
    DatabasesAuto-check passed
  • Memstack Security Rls Guardian

    cwinvestments/memstack

    A skill your agent uses when creating or altering database tables in Supabase or PostgreSQL projects.

    423 GitHub stars~3.4k tokensUpdated 14 days ago
    DatabasesAuto-check passed
  • Firebase

    ericrisco/rsc-harness

    A skill your agent uses when building on Firebase — Firestore data modeling, Security Rules, Auth and custom claims, Cloud Functions, Storage, modular Web/Admin SDK imports — including symptoms like…

    180 GitHub stars~3.3k tokensUpdated yesterday
    DatabasesAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Questions about Supabase Schema From Requirements

What does Supabase Schema From Requirements do?

Design Supabase Postgres schema from business requirements with migrations, RLS, and types. Supabase Schema From Requirements is an agent skill from jeremylongshore/tons-of-skills-marketplace. Design Supabase Postgres schema from business requirements with migrations, RLS, and types.

When should I use Supabase Schema From Requirements?

Supabase Schema From Requirements fits situations like: translating specifications into database tables; creating migration files; adding Row Level Security policies; generating TypeScript types from schema.

How do I install Supabase Schema From Requirements in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill supabase-schema-from-requirements -a claude-code`. Or copy the skill folder (skills/.curated/supabase-schema-from-requirements in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/supabase-schema-from-requirements in your project. Claude Code loads it when a task matches its description.

How do I install Supabase Schema From Requirements in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill supabase-schema-from-requirements -a codex`. Or copy the skill folder (skills/.curated/supabase-schema-from-requirements in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/supabase-schema-from-requirements in your project. Codex loads it when a task matches its description.

Can I use Supabase Schema From Requirements in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill supabase-schema-from-requirements -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/supabase-schema-from-requirements, .gemini/skills/supabase-schema-from-requirements, .github/skills/supabase-schema-from-requirements and .opencode/skills/supabase-schema-from-requirements in your project.

What does Supabase Schema From Requirements need to run?

Going by SKILL.md and its folder, Supabase Schema From Requirements needs the command-line tools its instructions call (npx, supabase and npm). Our summary lists: Node.js. Its frontmatter pre-approves these tools: Read, Write, Bash(supabase:*), Bash(npx:*). Compatibility (from SKILL.md): Designed for Claude Code.

Does Supabase Schema From Requirements access the network?

SKILL.md names 2 domains. As links in the text: supabase.com and postgresql.org. This is read from the text; nothing was executed.

Is Supabase Schema From Requirements safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Supabase Schema From Requirements use?

Supabase Schema From Requirements is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Supabase Schema From Requirements use?

About 1.8k tokens (SKILL.md is roughly 7.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.4k tokens, read only when the agent opens those files.

What are the alternatives to Supabase Schema From Requirements?

Skills that share tags, products or a category with Supabase Schema From Requirements: Supabase Postgres Best Practices (supabase/agent-skills, 2.7k stars), Expert Database (ReJeCtAll/ExpertTeam-Codex, 113 stars), Database Domain Specialist (modu-ai/moai-adk, 1.2k stars) and Postgres Patterns (affaan-m/ECC, 276k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Supabase Schema From Requirements?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.