db-policy-apply

Apply Row Level Security policies to PostgreSQL tables and generate SQL migration files.

3|Updated Feb 7, 2026
One-click install
npx skills add https://github.com/GDSDN/kord-aios --skill db-policy-apply
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-policy-apply
Source: https://github.com/GDSDN/kord-aios/tree/main/src/features/builtin-skills/kord-aios/database/db-policy-apply
Command: npx skills add https://github.com/GDSDN/kord-aios --skill db-policy-apply

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill automates the process of installing Row Level Security (RLS) policies on database tables, ensuring that users can only access the data they are authorized to see.

Core Features & Use Cases

  • Automated Policy Installation: Installs either a simple "KISS" policy or more granular policies for specific operations (SELECT, INSERT, UPDATE, DELETE).
  • Input Validation: Checks if the specified table exists and if the provided mode is valid.
  • Migration Generation: Creates SQL migration files for applying policies, suitable for version control.
  • Use Case: Securely restrict access to user-specific data in a Supabase project by applying RLS policies to tables like 'profiles' or 'user_data'.

Quick Start

Use the db-policy-apply skill to install a KISS RLS policy on the 'users' table.

Frequently Asked Questions about db-policy-apply

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

FAQPage Schema
How do I apply Row Level Security policies to a Supabase database table?

To apply Row Level Security (RLS) policies to a database table, you can automate the process by generating SQL migration files that install either simplified KISS or granular operation-specific access controls, requiring a PostgreSQL-compatible connection and Supabase CLI.

What is the difference between KISS and granular RLS policy modes?

KISS mode installs a simple Row Level Security policy for broad access restriction, while granular mode creates specific SQL policies for individual operations like SELECT, INSERT, UPDATE, and DELETE to tightly control data authorization.

Do I need the Supabase CLI to automate database RLS policy migration?

Yes, applying Row Level Security policies through this automated migration process requires the Supabase CLI to execute the generated SQL migration files against your PostgreSQL-compatible database environment.

Can I validate if a database table exists before generating an RLS policy?

Yes, the RLS policy application process includes input validation to check if the specified database table exists and if the provided policy mode is valid before generating and applying the SQL migration.

How do I test database RLS policies after applying a SQL migration?

After generating and applying your Row Level Security SQL migration files, the process includes dedicated steps for testing and error handling to verify that the database policies correctly restrict unauthorized data access.

What's the best way to restrict user access to specific rows in a Supabase table?

The best way to restrict user access in Supabase is applying Row Level Security policies via SQL migration files, which securely limits data retrieval to user-specific rows based on defined authorization rules.