postgres-expert

Manage PostgreSQL and Supabase schema design, migrations, RLS policies, query optimization, and PgTAP testing.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/darraghh1/my-claude-setup --skill postgres-expert-darraghh1
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-expert
Source: https://github.com/darraghh1/my-claude-setup/tree/main/.claude/skills/postgres-expert
Command: npx skills add https://github.com/darraghh1/my-claude-setup --skill postgres-expert-darraghh1

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you create, review, optimize, and test PostgreSQL and Supabase database code, ensuring data integrity, security, and performance in your multi-tenant SaaS application.

Core Features & Use Cases

  • Schema Design & Migrations: Create and manage database schemas and migrations safely.
  • RLS Policies: Implement robust Row-Level Security for data isolation.
  • Query Optimization: Analyze and improve the performance of your SQL queries.
  • Testing: Write comprehensive tests using PgTAP.
  • Use Case: When asked to 'create a migration', 'write RLS policies', 'design the schema', 'add a table', 'review this SQL', 'optimize this query', or 'write database tests'.

Quick Start

Use the postgres-expert skill to create a new migration file for adding a 'users' table with 'id', 'email', and 'created_at' columns.

Frequently Asked Questions about postgres-expert

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

FAQPage Schema
How do I write Row-Level Security policies in Supabase for multi-tenant data isolation?

To write Row-Level Security policies for multi-tenant data isolation, you define access rules directly in PostgreSQL using Supabase. This approach enforces data security by restricting row access based on tenant context.

What is the best way to manage PostgreSQL schema migrations for a SaaS application?

Managing PostgreSQL schema migrations involves creating structured SQL scripts to safely add tables and columns. This process maintains data integrity across multi-tenant SaaS applications by adhering to established database patterns.

How do I optimize slow SQL queries in a PostgreSQL database?

To optimize slow SQL queries in a PostgreSQL database, you analyze and review the query structure against established performance patterns. This improves database execution speed and overall application responsiveness.

Can I use PgTAP to write database tests for Supabase migrations?

Yes, you can use PgTAP to write comprehensive database tests for Supabase migrations. This testing framework validates your SQL schema changes and RLS policies, ensuring data security and integrity before deployment.

When do I need to review my PostgreSQL database code for performance?

You need to review PostgreSQL database code for performance when designing schemas, writing migration scripts, or implementing RLS policies. Regular reviews ensure your multi-tenant SaaS application maintains optimal query execution.