When your frontend users complain they can't see their data or they're seeing everyone else's data, this is the protocol to follow. It walks through the four-step debugging process: check if RLS is enabled, inspect policy definitions, simulate different roles with `as_role` and `as_user` parameters, and verify auto-populate triggers are firing. The key insight is that MCP tools default to the service key and bypass all RLS, so you have to explicitly pass `as_role: "user"` to reproduce what real users experience. Includes a symptom matcher table and four copy-paste fixes for the most common misconfigurations. Saves you from guessing why a policy that looks correct still blocks legitimate requests.

GitHub stars
532
last updated
Jun 11, 2026

Install

$ npx -y skills add butterbase-ai/butterbase-skills --skill debug-rls --agent claude-code

Installs into .claude/skills of the current project.

Files

debug-rls

Systematic methodology for debugging Row-Level Security issues in Butterbase. Uses role simulation (as_role/as_user parameters) to verify policy behavior without needing real user sessions.


1. Overview

Row-Level Security (RLS) in Butterbase controls which rows each database role can see or modify. When RLS is misconfigured, users may see no data, too much data, or get unexpected errors on insert. This skill walks through a repeatable four-step process to identify and fix the root cause.

Key principle: MCP tools default to the service key (bb_sk_...), which bypasses all RLS. Always use as_role/as_user to simulate the role your frontend actually uses.


2. Quick Diagnosis

Match the symptom your user reports to the most likely cause before diving into the full protocol.

Sponsors

Details

Repository
github.com/butterbase-ai/butterbase-skills
Categories
Frontend Development, Debugging
License
MIT
First seen
Jun 11, 2026

More from butterbase-ai/butterbase-skills

All 39
1butterbase-ai avatarjourney-deploybutterbase-ai/butterbase-skillsUse as the deploy-verification stage of the Butterbase journey, after journey-frontend (or after any build stage if there is no frontend). Smoke-tests the deplo0skills.sh installs
2butterbase-ai avatarjourney-planbutterbase-ai/butterbase-skillsUse as stage 2 of the Butterbase journey, after journey-idea has written 01-idea.md. Translates the idea + capability map into a concrete Butterbase plan — tabl0skills.sh installs
3butterbase-ai avatarjourney-storagebutterbase-ai/butterbase-skillsUse as the storage build stage of the Butterbase journey. Implements the Storage section of 02-plan.md by delegating to the storage skill. Calls manage_storage 0skills.sh installs
4composiohq avatartheme-factorycomposiohq/awesome-claude-pluginsToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fo0skills.sh installs
5daffy0208 avatarFigma Developerdaffy0208/ai-dev-standardsExtract components from Figma, convert designs to React components, sync design tokens, and generate code from designs. Bridge the gap between design and code w0skills.sh installs
6daffy0208 avatarPerformance Optimizerdaffy0208/ai-dev-standardsOptimize application performance and scalability. Use when investigating slow applications, scaling bottlenecks, or improving response times. Covers profiling, 0skills.sh installs