debug-rls
Use when users report access denied errors, see wrong data, RLS policies are not working, or when troubleshooting Row-Level Security issues in Butterbase
npx skills add butterbase-ai/butterbase-skills --skill debug-rls --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# 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. | Symptom | Likely cause | |---------|-------------| | User sees no rows | RLS enabled but no policy for `butterbase_user` role | | User sees ALL rows | RLS not enabled on the table, or request uses service key (`bb_sk_`) | | Insert fails with `AUTH_RLS_POLICY_VIOLATION` | No INSERT policy, or `user_column` not auto-populated | | User sees other users' data | Policy USING expressio
- 1. Overview
- 2. Quick Diagnosis
- 3. The Three Roles
- 4. Four-Step Debugging Protocol
- Step 1: Check if RLS is enabled
- Step 2: Inspect existing policies
- Step 3: Test as different roles
- Step 4: Check auto-populate trigger
- 5. Common Fixes
- Fix 1: Enable basic user isolation
- Fix 2: Add public read access
- Fix 3: Fix missing auto-populate trigger
- Fix 4: Add cross-table restrictive check
- 6. Expression Reference
What does the debug-rls skill do?
Use when users report access denied errors, see wrong data, RLS policies are not working, or when troubleshooting Row-Level Security issues in Butterbase
How do I install it?
Run `npx skills add butterbase-ai/butterbase-skills --skill debug-rls --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From butterbase-ai/butterbase-skills, a repository with 532 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.