db-architect

Designs PostgreSQL schemas and generates bidirectional Supabase SQL migrations with RLS policies.

Updated Mar 1, 2026
One-click install
npx skills add https://github.com/mqzkim/trading --skill db-architect-mqzkim
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-architect
Source: https://github.com/mqzkim/trading/tree/main/.agents/skills/db-architect
Command: npx skills add https://github.com/mqzkim/trading --skill db-architect-mqzkim

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the design, migration, and security policy generation for PostgreSQL databases, specifically within the Supabase ecosystem.

Core Features & Use Cases

  • Schema Design: Creates robust PostgreSQL table schemas adhering to best practices.
  • Migration Generation: Produces bidirectional SQL migration files for Supabase.
  • RLS Policies: Implements Row Level Security for secure data access.
  • Index Optimization: Designs indexes based on query patterns for performance.
  • Use Case: Design a new products table with appropriate columns, indexes, and RLS policies, then generate the corresponding Supabase migration file.

Quick Start

Use the db-architect skill to create a migration file for a new 'products' table.

Frequently Asked Questions about db-architect

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate SQL migrations and Row Level Security policies for Supabase?

You can generate bidirectional SQL migration files and implement Row Level Security policies for Supabase by defining your PostgreSQL table schemas, query patterns, and multi-tenancy rules to automate the script creation.

What is the best way to design a PostgreSQL schema for multi-tenancy on Supabase?

Designing a PostgreSQL schema for multi-tenancy on Supabase involves creating robust table structures and applying Row Level Security policies to ensure secure data access isolation across different tenants.

How do I optimize PostgreSQL indexes based on query patterns?

To optimize PostgreSQL indexes based on query patterns, you analyze expected database queries and generate targeted indexes within your migration scripts to improve lookup performance and data retrieval speed.

Can I create both table creation and data seeding scripts in a single Supabase migration?

Yes, you can create table schemas and generate data seeding scripts together. The process handles table creation, modification, and seeding within bidirectional SQL migration files for the Supabase ecosystem.

How does Row Level Security work for PostgreSQL tables in Supabase?

Row Level Security (RLS) for PostgreSQL tables in Supabase works by enforcing data access policies directly at the database level, restricting which rows users can view or modify based on defined security rules.