CliftonSites Backend Expert Skill
This skill provides complete, comprehensive expertise on the entire CliftonSites Supabase backend. Use this skill for ANY backend-related task - from simple queries to complex debugging to adding new features.
What This Skill Covers
- 12 Database Tables: Complete schemas, columns, constraints, relationships
- 25 RPC Functions: Full documentation, parameters, usage patterns, what they do
- 5 Database Triggers: What fires when, why, and how they integrate
- Security Architecture: MFA authentication, RLS policies, SECURITY DEFINER functions, API route protection
- RLS Policies: Row-level security for each table, who can access what (RLS enabled on ALL tables)
- 2 Views: v_queue_status, v_identification_progress
- Indexes: All performance optimizations
- Data Flows: How data moves through the system
- Automation Pipeline: VM integration, identification, implementation flows
- Admin Authentication: MFA-protected admin dashboard with TOTP
- API Route Protection: Internal API tokens, session validation
- Supabase MCP Server: Complete operations guide for any database task
Navigation Guide
This skill uses progressive disclosure - start here, then dive into detailed references as needed:
Core References (Read These for Deep Understanding)
./database-tables-reference.md - Complete schemas for all 12 tables
- Full column definitions with types and constraints
- Relationships between tables
- Usage patterns and common queries
./rpc-functions-reference.md - All 25 RPC functions documented
- Function signatures and parameters
- What each function does and when to use it
- Who can execute (permissions) - includes SECURITY DEFINER functions
- Internal logic and table dependencies
./triggers-policies-views.md - Triggers, RLS, views, indexes
- All 5 active triggers: what fires when and why
- Complete RLS policies for each table (RLS enabled on ALL tables)
- 2 views with their definitions
- All indexes for performance
./data-flows-architecture.md - System architecture and integration
- Complete data flow diagrams
- Automation pipeline architecture
- VM integration details
- User journey flows (including authentication)
- Admin dashboard authentication flow
- How everything connects
./security-architecture.md - Complete security documentation
- MFA authentication (TOTP) for admin dashboard
- RLS policies and SECURITY DEFINER functions
- API route protection (internal tokens, session validation)
- Function permission matrix (anon vs service_role)
- Security verification queries
./supabase-mcp-guide.md - Supabase MCP Server operations
- How to query tables
- How to call RPC functions
- How to check policies, triggers, schemas
- How to execute any SQL
- Complete MCP tool reference
./quick-reference.md - Common operations cheat sheet
- Frequently used queries
- Common debugging commands
- Security verification queries
- Quick lookup for routine tasks
When to Use This Skill
Use this skill immediately when you need to:
Understanding the Backend
- "What tables exist in the database?"
- "How does the pipeline_businesses table work?"
- "What's the schema for qualified_businesses?"
- "What RPC functions are available?"
- "How does the automation system work?"
Debugging Issues
- "Why isn't a business showing in the queue?"
- "The outreach trigger isn't firing - why?"
- "What RLS policies affect this query?"
- "Why can't anon role access this table?"
- "What functions query pipeline_businesses?"
Adding Features
- "I need to add a new column to track X"
- "How do I create a new RPC function?"
- "Where should I store this new data?"
- "What's the pattern for adding automation commands?"
- "How do I trigger outreach for a business?"
Working with Data
- "Get all businesses in the queue"
- "Check automation status"
- "Query recent logs"
- "Find businesses by status"
- "Get current identification target"
Reviewing Configurations
- "What triggers exist on qualified_businesses?"
- "What are the RLS policies for automation tables?"
- "What indexes are on pipeline_businesses?"
- "Show me all SECURITY DEFINER functions"
- "What views are available?"
Security Operations
- "How does admin authentication work?"
- "What functions can anon role execute?"
- "Which tables have RLS enabled?"
- "How do internal API tokens work?"
- "What's protected by MFA?"
- "Verify the security configuration"
How to Use This Skill Effectively
Step 1: Identify Your Use Case
Ask yourself: "What am I trying to accomplish?"
- Quick lookup? → Use
./quick-reference.md
- Understanding a table? → Use
./database-tables-reference.md
- Working with functions? → Use
./rpc-functions-reference.md
- Understanding data flow? → Use
./data-flows-architecture.md
- Need to query? → Use
./supabase-mcp-guide.md
Step 2: Use the Right Tool
For Querying Data:
Use Supabase MCP server tools:
- mcp__supabase__execute_sql - Run any SQL query
- mcp__supabase__list_tables - See all tables
For Understanding Schema:
Read ./database-tables-reference.md for complete table schemas
OR use: mcp__supabase__list_tables with project_id
For Calling Functions:
Use: mcp__supabase__execute_sql with SELECT function_name(params)
Reference: ./rpc-functions-reference.md for function signatures
Step 3: Apply the Knowledge
Example Workflow: Adding a New Feature
- Read
./database-tables-reference.md to understand where data should go
- Read
./rpc-functions-reference.md to see what functions already exist
- Read
./data-flows-architecture.md to understand integration points
- Use
./supabase-mcp-guide.md to execute changes
- Check
./triggers-policies-views.md to ensure triggers/policies are correct
Example Workflow: Debugging an Issue
- Use
./quick-reference.md for common debugging queries
- Use Supabase MCP to execute diagnostic queries
- Check
./triggers-policies-views.md if issue relates to permissions or triggers
- Review
./data-flows-architecture.md to understand expected behavior
- Use
./rpc-functions-reference.md to verify function logic
Common Operations Quick Start
Check Current Automation Status
// Use Supabase MCP
mcp__supabase__execute_sql({
project_id: "anmmqjpsahrtmavdzotu",
query: "SELECT * FROM automation_status"
})
Get Queue Statistics
// Call RPC function
mcp__supabase__execute_sql({
project_id: "anmmqjpsahrtmavdzotu",
query: "SELECT * FROM get_queue_statistics()"
})
Find a Business by UUID
mcp__supabase__execute_sql({
project_id: "anmmqjpsahrtmavdzotu",
query: "SELECT * FROM qualified_businesses WHERE uuid = 'abc12345'"
})
Check What Triggers Exist
mcp__supabase__execute_sql({
project_id: "anmmqjpsahrtmavdzotu",
query: `
SELECT tgname, tgrelid::regclass, pg_get_triggerdef(oid)
FROM pg_trigger
WHERE tgisinternal = false
`
})
See All RPC Functions
mcp__supabase__execute_sql({
project_id: "anmmqjpsahrtmavdzotu",
query: `
SELECT proname, pg_get_function_arguments(oid)
FROM pg_proc
WHERE pronamespace = 'public'::regnamespace
ORDER BY proname
`
})
Key Architectural Concepts
Project ID
All Supabase operations use: anmmqjpsahrtmavdzotu
Database Roles
- anon: Public access (used by admin dashboard via browser)
- authenticated: Logged-in users (future state after security hardening)
- service_role: Full access (used by API routes and VM)
Table Relationships
Pipeline Flow:
pipeline_businesses → (VM implementation) → qualified_businesses → (outreach trigger) → Smartlead
Automation Management:
automation_config ← controls → automation_status
automation_commands → processed by VM
automation_runs ← logs runs
automation_logs ← logs details
Payment Flow:
qualified_businesses ← stripe_webhook → stripe_events
→ stripe_idempotency
Security Architecture (Fully Implemented)
The system has comprehensive security hardening:
Admin Authentication (MFA Required)
- All
/admin/* routes require authenticated session with MFA (AAL2)
- Login page:
/admin/login (email/password + TOTP)
- MFA setup page:
/admin/setup-mfa (QR code enrollment)
- Logout button in admin header
- Middleware redirects unauthenticated users to login
Database Security
- RLS enabled on ALL 12 tables
- Dangerous RPC functions revoked from
anon and PUBLIC roles
- Dashboard functions use SECURITY DEFINER to bypass RLS safely
- All functions have
search_path set to prevent SQL injection
API Route Protection
- Admin API routes validate session with MFA
- Internal routes (activate-site, stop-campaign) require
INTERNAL_API_SECRET
- Stripe webhook validates signature
- Supabase trigger uses Bearer token for start-campaign
Function Permissions
- anon CAN execute:
get_queue_statistics(), get_current_identification_target(), get_automation_status() (SECURITY DEFINER)
- anon CANNOT execute:
claim_next_business(), send_automation_command(), update_automation_config(), advance_identification_position(), mark_business_deployed(), reset_stale_started_businesses()
- service_role: Can execute ALL functions (used by VM and API routes)
Integration Points
VM Automation (DigitalOcean 161.35.11.226)
Identification Process:
- Uses
service_role key
- Calls:
advance_identification_position(), get_existing_businesses_for_target()
- Inserts to:
pipeline_businesses
- Logs to:
automation_logs, automation_runs
Implementation Process:
- Uses
service_role key
- Calls:
claim_next_business(), mark_business_deployed()
- Reads from:
pipeline_businesses
- Inserts to:
qualified_businesses
Admin Dashboard (cliftonsites.com/admin)
Authentication Required: MFA (TOTP) verified session
- Login Flow:
/admin/login → email/password → TOTP code → dashboard
- First-time MFA:
/admin/setup-mfa → scan QR code → verify → dashboard
- Uses
anon key in browser for Realtime subscriptions
- RPC calls via SECURITY DEFINER functions:
get_queue_statistics(), get_current_identification_target()
- API routes for commands (require session):
/api/admin/automation/command, /api/admin/automation/config
- Direct table queries via anon RLS policies:
automation_config, automation_status, automation_logs, automation_runs
Outreach System (Smartlead)
- Trigger:
outreach_on_deployed fires on qualified_businesses INSERT/UPDATE
- Calls:
POST /api/outreach/start-campaign with Bearer token
- Webhook:
POST /api/outreach/webhook-events receives events from Smartlead
- Updates:
outreach_* columns in qualified_businesses
Payment System (Stripe)
- Webhook:
POST /api/stripe-webhook with signature verification
- Logs to:
stripe_events, stripe_idempotency
- Updates:
qualified_businesses (claimed, stripe_payment_id, customer_email)
- Triggers: Site activation flow
Best Practices for Using This Skill
Start with the Right Reference
- Don't guess - look it up in the appropriate reference file
- The references are comprehensive - use them
Use Supabase MCP for All Database Operations
- Don't try to use psql or other tools
- The MCP server is your interface to Supabase
- See
./supabase-mcp-guide.md for complete examples
Understand the Data Flow
- Before changing anything, review
./data-flows-architecture.md
- Understand how your change affects the pipeline
- Check if triggers will fire
Check Permissions
- Review
./triggers-policies-views.md for RLS policies
- Understand which role is being used
- Verify access before querying
Reference Function Logic
- Don't assume - check
./rpc-functions-reference.md
- Functions may have SECURITY DEFINER or INVOKER modes
- Some functions query tables that are RLS protected
Troubleshooting Guide
"Permission denied" errors
- Check
./triggers-policies-views.md for RLS policies on that table
- Verify which role you're using (anon vs service_role)
- Check if RLS is enabled on the table
"Function does not exist" errors
- Verify function name in
./rpc-functions-reference.md
- Check schema (should be
public)
- Ensure correct parameter types
"Trigger not firing" issues
- Review
./triggers-policies-views.md for trigger definition
- Check if condition is met (INSERT vs UPDATE)
- Verify trigger is enabled
"Empty query results" issues
- Check if RLS is blocking access
- Verify data exists in table (use service_role if needed)
- Review WHERE clause conditions
Next Steps
Now that you understand how to use this skill:
- Read the reference that matches your task (see Navigation Guide above)
- Use the Supabase MCP guide to execute operations
- Refer back to this SKILL.md if you need to navigate
Remember: This skill contains COMPLETE documentation of the entire backend. Everything you need is here - just navigate to the right reference file.
1---2name: cliftonsites-backend3description: Use this skill when working with the CliftonSites Supabase backend for any task including understanding database schemas, debugging issues, adding features, querying data, managing RPC functions, reviewing triggers/policies, working with the automation pipeline, security architecture (MFA authentication, RLS, SECURITY DEFINER functions, API route protection), or any database operation. Provides complete expertise on all 12 tables, 25 RPC functions, 5 triggers, RLS policies, SECURITY DEFINER functions, admin MFA authentication, internal API token validation, views, indexes, data flows, and Supabase MCP server operations.4---5
6# CliftonSites Backend Expert Skill
7
8This skill provides **complete, comprehensive expertise** on the entire CliftonSites Supabase backend. Use this skill for ANY backend-related task - from simple queries to complex debugging to adding new features.
9
10## What This Skill Covers
11
12- **12 Database Tables**: Complete schemas, columns, constraints, relationships
13- **25 RPC Functions**: Full documentation, parameters, usage patterns, what they do
14- **5 Database Triggers**: What fires when, why, and how they integrate
15- **Security Architecture**: MFA authentication, RLS policies, SECURITY DEFINER functions, API route protection
16- **RLS Policies**: Row-level security for each table, who can access what (RLS enabled on ALL tables)
17- **2 Views**: v_queue_status, v_identification_progress
18- **Indexes**: All performance optimizations
19- **Data Flows**: How data moves through the system
20- **Automation Pipeline**: VM integration, identification, implementation flows
21- **Admin Authentication**: MFA-protected admin dashboard with TOTP
22- **API Route Protection**: Internal API tokens, session validation
23- **Supabase MCP Server**: Complete operations guide for any database task
24
25## Navigation Guide
26
27This skill uses **progressive disclosure** - start here, then dive into detailed references as needed:
28
29### Core References (Read These for Deep Understanding)
30
311. **`./database-tables-reference.md`** - Complete schemas for all 12 tables
32 - Full column definitions with types and constraints
33 - Relationships between tables
34 - Usage patterns and common queries
35
362. **`./rpc-functions-reference.md`** - All 25 RPC functions documented
37 - Function signatures and parameters
38 - What each function does and when to use it
39 - Who can execute (permissions) - includes SECURITY DEFINER functions
40 - Internal logic and table dependencies
41
423. **`./triggers-policies-views.md`** - Triggers, RLS, views, indexes
43 - All 5 active triggers: what fires when and why
44 - Complete RLS policies for each table (RLS enabled on ALL tables)
45 - 2 views with their definitions
46 - All indexes for performance
47
484. **`./data-flows-architecture.md`** - System architecture and integration
49 - Complete data flow diagrams
50 - Automation pipeline architecture
51 - VM integration details
52 - User journey flows (including authentication)
53 - Admin dashboard authentication flow
54 - How everything connects
55
565. **`./security-architecture.md`** - Complete security documentation
57 - MFA authentication (TOTP) for admin dashboard
58 - RLS policies and SECURITY DEFINER functions
59 - API route protection (internal tokens, session validation)
60 - Function permission matrix (anon vs service_role)
61 - Security verification queries
62
636. **`./supabase-mcp-guide.md`** - Supabase MCP Server operations
64 - How to query tables
65 - How to call RPC functions
66 - How to check policies, triggers, schemas
67 - How to execute any SQL
68 - Complete MCP tool reference
69
707. **`./quick-reference.md`** - Common operations cheat sheet
71 - Frequently used queries
72 - Common debugging commands
73 - Security verification queries
74 - Quick lookup for routine tasks
75
76## When to Use This Skill
77
78Use this skill **immediately** when you need to:
79
80### Understanding the Backend
81- "What tables exist in the database?"
82- "How does the pipeline_businesses table work?"
83- "What's the schema for qualified_businesses?"
84- "What RPC functions are available?"
85- "How does the automation system work?"
86
87### Debugging Issues
88- "Why isn't a business showing in the queue?"
89- "The outreach trigger isn't firing - why?"
90- "What RLS policies affect this query?"
91- "Why can't anon role access this table?"
92- "What functions query pipeline_businesses?"
93
94### Adding Features
95- "I need to add a new column to track X"
96- "How do I create a new RPC function?"
97- "Where should I store this new data?"
98- "What's the pattern for adding automation commands?"
99- "How do I trigger outreach for a business?"
100
101### Working with Data
102- "Get all businesses in the queue"
103- "Check automation status"
104- "Query recent logs"
105- "Find businesses by status"
106- "Get current identification target"
107
108### Reviewing Configurations
109- "What triggers exist on qualified_businesses?"
110- "What are the RLS policies for automation tables?"
111- "What indexes are on pipeline_businesses?"
112- "Show me all SECURITY DEFINER functions"
113- "What views are available?"
114
115### Security Operations
116- "How does admin authentication work?"
117- "What functions can anon role execute?"
118- "Which tables have RLS enabled?"
119- "How do internal API tokens work?"
120- "What's protected by MFA?"
121- "Verify the security configuration"
122
123## How to Use This Skill Effectively
124
125### Step 1: Identify Your Use Case
126
127Ask yourself: "What am I trying to accomplish?"
128
129- **Quick lookup?** → Use `./quick-reference.md`
130- **Understanding a table?** → Use `./database-tables-reference.md`
131- **Working with functions?** → Use `./rpc-functions-reference.md`
132- **Understanding data flow?** → Use `./data-flows-architecture.md`
133- **Need to query?** → Use `./supabase-mcp-guide.md`
134
135### Step 2: Use the Right Tool
136
137**For Querying Data:**
138```
139Use Supabase MCP server tools:
140- mcp__supabase__execute_sql - Run any SQL query
141- mcp__supabase__list_tables - See all tables
142```
143
144**For Understanding Schema:**
145```
146Read ./database-tables-reference.md for complete table schemas
147OR use: mcp__supabase__list_tables with project_id
148```
149
150**For Calling Functions:**
151```
152Use: mcp__supabase__execute_sql with SELECT function_name(params)
153Reference: ./rpc-functions-reference.md for function signatures
154```
155
156### Step 3: Apply the Knowledge
157
158**Example Workflow: Adding a New Feature**
159
1601. Read `./database-tables-reference.md` to understand where data should go
1612. Read `./rpc-functions-reference.md` to see what functions already exist
1623. Read `./data-flows-architecture.md` to understand integration points
1634. Use `./supabase-mcp-guide.md` to execute changes
1645. Check `./triggers-policies-views.md` to ensure triggers/policies are correct
165
166**Example Workflow: Debugging an Issue**
167
1681. Use `./quick-reference.md` for common debugging queries
1692. Use Supabase MCP to execute diagnostic queries
1703. Check `./triggers-policies-views.md` if issue relates to permissions or triggers
1714. Review `./data-flows-architecture.md` to understand expected behavior
1725. Use `./rpc-functions-reference.md` to verify function logic
173
174## Common Operations Quick Start
175
176### Check Current Automation Status
177
178```typescript
179// Use Supabase MCP
180mcp__supabase__execute_sql({
181 project_id: "anmmqjpsahrtmavdzotu",
182 query: "SELECT * FROM automation_status"
183})
184```
185
186### Get Queue Statistics
187
188```typescript
189// Call RPC function
190mcp__supabase__execute_sql({
191 project_id: "anmmqjpsahrtmavdzotu",
192 query: "SELECT * FROM get_queue_statistics()"
193})
194```
195
196### Find a Business by UUID
197
198```typescript
199mcp__supabase__execute_sql({
200 project_id: "anmmqjpsahrtmavdzotu",
201 query: "SELECT * FROM qualified_businesses WHERE uuid = 'abc12345'"
202})
203```
204
205### Check What Triggers Exist
206
207```typescript
208mcp__supabase__execute_sql({
209 project_id: "anmmqjpsahrtmavdzotu",
210 query: `
211 SELECT tgname, tgrelid::regclass, pg_get_triggerdef(oid)
212 FROM pg_trigger
213 WHERE tgisinternal = false
214 `
215})
216```
217
218### See All RPC Functions
219
220```typescript
221mcp__supabase__execute_sql({
222 project_id: "anmmqjpsahrtmavdzotu",
223 query: `
224 SELECT proname, pg_get_function_arguments(oid)
225 FROM pg_proc
226 WHERE pronamespace = 'public'::regnamespace
227 ORDER BY proname
228 `
229})
230```
231
232## Key Architectural Concepts
233
234### Project ID
235All Supabase operations use: `anmmqjpsahrtmavdzotu`
236
237### Database Roles
238- **anon**: Public access (used by admin dashboard via browser)
239- **authenticated**: Logged-in users (future state after security hardening)
240- **service_role**: Full access (used by API routes and VM)
241
242### Table Relationships
243
244```
245Pipeline Flow:
246pipeline_businesses → (VM implementation) → qualified_businesses → (outreach trigger) → Smartlead
247
248Automation Management:
249automation_config ← controls → automation_status
250automation_commands → processed by VM
251automation_runs ← logs runs
252automation_logs ← logs details
253
254Payment Flow:
255qualified_businesses ← stripe_webhook → stripe_events
256 → stripe_idempotency
257```
258
259### Security Architecture (Fully Implemented)
260
261**The system has comprehensive security hardening:**
262
263#### Admin Authentication (MFA Required)
264- All `/admin/*` routes require authenticated session with MFA (AAL2)
265- Login page: `/admin/login` (email/password + TOTP)
266- MFA setup page: `/admin/setup-mfa` (QR code enrollment)
267- Logout button in admin header
268- Middleware redirects unauthenticated users to login
269
270#### Database Security
271- **RLS enabled on ALL 12 tables**
272- Dangerous RPC functions revoked from `anon` and `PUBLIC` roles
273- Dashboard functions use SECURITY DEFINER to bypass RLS safely
274- All functions have `search_path` set to prevent SQL injection
275
276#### API Route Protection
277- Admin API routes validate session with MFA
278- Internal routes (activate-site, stop-campaign) require `INTERNAL_API_SECRET`
279- Stripe webhook validates signature
280- Supabase trigger uses Bearer token for start-campaign
281
282#### Function Permissions
283- **anon CAN execute**: `get_queue_statistics()`, `get_current_identification_target()`, `get_automation_status()` (SECURITY DEFINER)
284- **anon CANNOT execute**: `claim_next_business()`, `send_automation_command()`, `update_automation_config()`, `advance_identification_position()`, `mark_business_deployed()`, `reset_stale_started_businesses()`
285- **service_role**: Can execute ALL functions (used by VM and API routes)
286
287## Integration Points
288
289### VM Automation (DigitalOcean 161.35.11.226)
290
291**Identification Process:**
292- Uses `service_role` key
293- Calls: `advance_identification_position()`, `get_existing_businesses_for_target()`
294- Inserts to: `pipeline_businesses`
295- Logs to: `automation_logs`, `automation_runs`
296
297**Implementation Process:**
298- Uses `service_role` key
299- Calls: `claim_next_business()`, `mark_business_deployed()`
300- Reads from: `pipeline_businesses`
301- Inserts to: `qualified_businesses`
302
303### Admin Dashboard (cliftonsites.com/admin)
304
305**Authentication Required:** MFA (TOTP) verified session
306
307- **Login Flow:** `/admin/login` → email/password → TOTP code → dashboard
308- **First-time MFA:** `/admin/setup-mfa` → scan QR code → verify → dashboard
309- Uses `anon` key in browser for Realtime subscriptions
310- RPC calls via SECURITY DEFINER functions: `get_queue_statistics()`, `get_current_identification_target()`
311- API routes for commands (require session): `/api/admin/automation/command`, `/api/admin/automation/config`
312- Direct table queries via anon RLS policies: `automation_config`, `automation_status`, `automation_logs`, `automation_runs`
313
314### Outreach System (Smartlead)
315
316- Trigger: `outreach_on_deployed` fires on `qualified_businesses` INSERT/UPDATE
317- Calls: `POST /api/outreach/start-campaign` with Bearer token
318- Webhook: `POST /api/outreach/webhook-events` receives events from Smartlead
319- Updates: `outreach_*` columns in `qualified_businesses`
320
321### Payment System (Stripe)
322
323- Webhook: `POST /api/stripe-webhook` with signature verification
324- Logs to: `stripe_events`, `stripe_idempotency`
325- Updates: `qualified_businesses` (claimed, stripe_payment_id, customer_email)
326- Triggers: Site activation flow
327
328## Best Practices for Using This Skill
329
3301. **Start with the Right Reference**
331 - Don't guess - look it up in the appropriate reference file
332 - The references are comprehensive - use them
333
3342. **Use Supabase MCP for All Database Operations**
335 - Don't try to use psql or other tools
336 - The MCP server is your interface to Supabase
337 - See `./supabase-mcp-guide.md` for complete examples
338
3393. **Understand the Data Flow**
340 - Before changing anything, review `./data-flows-architecture.md`
341 - Understand how your change affects the pipeline
342 - Check if triggers will fire
343
3444. **Check Permissions**
345 - Review `./triggers-policies-views.md` for RLS policies
346 - Understand which role is being used
347 - Verify access before querying
348
3495. **Reference Function Logic**
350 - Don't assume - check `./rpc-functions-reference.md`
351 - Functions may have SECURITY DEFINER or INVOKER modes
352 - Some functions query tables that are RLS protected
353
354## Troubleshooting Guide
355
356### "Permission denied" errors
3571. Check `./triggers-policies-views.md` for RLS policies on that table
3582. Verify which role you're using (anon vs service_role)
3593. Check if RLS is enabled on the table
360
361### "Function does not exist" errors
3621. Verify function name in `./rpc-functions-reference.md`
3632. Check schema (should be `public`)
3643. Ensure correct parameter types
365
366### "Trigger not firing" issues
3671. Review `./triggers-policies-views.md` for trigger definition
3682. Check if condition is met (INSERT vs UPDATE)
3693. Verify trigger is enabled
370
371### "Empty query results" issues
3721. Check if RLS is blocking access
3732. Verify data exists in table (use service_role if needed)
3743. Review WHERE clause conditions
375
376## Next Steps
377
378Now that you understand how to use this skill:
379
3801. **Read the reference that matches your task** (see Navigation Guide above)
3812. **Use the Supabase MCP guide** to execute operations
3823. **Refer back to this SKILL.md** if you need to navigate
383
384**Remember:** This skill contains COMPLETE documentation of the entire backend. Everything you need is here - just navigate to the right reference file.