home / skills / jeremylongshore / claude-code-plugins-plus-skills / supabase-schema-from-requirements

This skill generates a Supabase database schema from natural language requirements to accelerate project initialization and migrations.

npx playbooks add skill jeremylongshore/claude-code-plugins-plus-skills --skill supabase-schema-from-requirements

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
1.7 KB
---
name: supabase-schema-from-requirements
description: |
  Execute Supabase primary workflow: Schema from Requirements.
  Use when Starting a new project with defined data requirements,
  Refactoring an existing schema based on new features, or Creating migrations from specification documents.
  Trigger with phrases like "supabase schema from requirements",
  "generate database schema with supabase".
allowed-tools: Read, Write, Edit, Bash(npm:*), Grep
version: 1.0.0
license: MIT
author: Jeremy Longshore <[email protected]>
---

# Supabase Schema from Requirements

## Overview
Generate Supabase database schema from natural language requirements.
This is the primary workflow for starting new Supabase projects.


## Prerequisites
- Completed `supabase-install-auth` setup
- Understanding of Supabase core concepts
- Valid API credentials configured

## Instructions

### Step 1: Initialize
```typescript
// Step 1 implementation
```

### Step 2: Execute
```typescript
// Step 2 implementation
```

### Step 3: Finalize
```typescript
// Step 3 implementation
```

## Output
- Completed Schema from Requirements execution
- Expected results from Supabase API
- Success confirmation or error details

## Error Handling
| Error | Cause | Solution |
|-------|-------|----------|
| Error 1 | Cause | Solution |
| Error 2 | Cause | Solution |

## Examples

### Complete Workflow
```typescript
// Complete workflow example
```

### Common Variations
- Variation 1: Description
- Variation 2: Description

## Resources
- [Supabase Documentation](https://supabase.com/docs)
- [Supabase API Reference](https://supabase.com/docs/api)

## Next Steps
For secondary workflow, see `supabase-auth-storage-realtime-core`.

Overview

This skill generates a Supabase database schema from natural-language requirements and drives the primary workflow for new projects. It converts product or feature specs into tables, columns, constraints, and migration-ready SQL tailored for Supabase. Use it to bootstrap schemas, refactor existing models, or produce migration artifacts from spec documents.

How this skill works

The skill parses user-provided requirements and maps entities, fields, relationships, and constraints to Supabase/Postgres constructs. It then constructs a schema model and produces SQL or migration scripts compatible with Supabase APIs and CLI tooling. It validates consistency, checks for common errors, and returns success confirmation or actionable error details.

When to use it

  • Starting a new Supabase project with formalized data requirements
  • Refactoring an existing database schema to support new features
  • Creating migration scripts from product spec or technical documents
  • Rapidly prototyping data models during design iterations
  • Ensuring consistent schema generation across teams or repos

Best practices

  • Provide clear, entity-focused requirements with sample fields and relationships
  • Include desired constraints (unique, not null, foreign keys) and indexing needs up front
  • Run the skill in a staging environment before applying to production
  • Review generated SQL for naming conventions and access control policies
  • Keep API credentials and Supabase project IDs secure and follow least-privilege rules

Example use cases

  • Turn a product spec describing users, projects, and comments into a Supabase schema and migration file
  • Refactor a denormalized table into normalized entities with foreign keys and indexes
  • Generate migrations to add audit columns and role-based access policies
  • Produce a starting schema for a new SaaS app that includes auth-linked user profiles
  • Create consistent schemas for multi-tenant projects with shared and tenant-specific tables

FAQ

What prerequisites are required?

You need an initialized Supabase project or valid API credentials, completed auth setup, and basic knowledge of Supabase concepts.

Can it modify an existing production database directly?

The skill produces migration scripts and API calls; applying them to production should be done manually or via CI after review.