[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M796GSBG32TA219PDRBJTTZW":3,"skill-same:01M796GSBG32TA219PDRBJTTZW":60},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":37,"commitSha":38,"skillDirectory":39,"forksCount":40,"repositoryHtmlUrl":41,"repositoryHomepageUrl":6,"ownerHtmlUrl":42,"ownerBlogUrl":43,"ownerDescription":44,"updatedAt":45,"install":46,"resources":59},"01M796GSBG32TA219PDRBJTTZW","supabase-policy-guardrails",null,"Enforce organizational governance for Supabase projects: shared RLS policy\nlibrary with reusable templates, table and column naming conventions,\nmigration review process with CI checks, cost alert thresholds,\nand security audit scripts scanning for common misconfigurations.\nUse when establishing Supabase standards across teams, creating RLS\npolicy templates, setting up migration review workflows, or auditing\nexisting projects for security and cost issues.\nTrigger with phrases like \"supabase governance\", \"supabase policy library\",\n\"supabase naming convention\", \"supabase migration review\",\n\"supabase cost alert\", \"supabase security audit\", \"supabase RLS template\".","jukeyman\u002Fjukeyman-skills","jukeyman","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F142960420?v=4","01M78FR4Y3DHMMCBCC0GXXNB3F","RICK JEFFERSON","01M78FR4Z8RVQRAD31Y5J7V6EB",1,"MIT","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsaas-packs--supabase-pack--supabase-policy-guardrails\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: supabase-policy-guardrails\ndescription: |\n  Enforce organizational governance for Supabase projects: shared RLS policy\n  library with reusable templates, table and column naming conventions,\n  migration review process with CI checks, cost alert thresholds,\n  and security audit scripts scanning for common misconfigurations.\n  Use when establishing Supabase standards across teams, creating RLS\n  policy templates, setting up migration review workflows, or auditing\n  existing projects for security and cost issues.\n  Trigger with phrases like \"supabase governance\", \"supabase policy library\",\n  \"supabase naming convention\", \"supabase migration review\",\n  \"supabase cost alert\", \"supabase security audit\", \"supabase RLS template\".\nallowed-tools: Read, Write, Edit, Bash(supabase:*), Bash(psql:*), Bash(npx:*), Grep\nversion: 1.0.0\nlicense: MIT\nauthor: Jeremy Longshore \u003Cjeremy@intentsolutions.io>\ncompatible-with: claude-code, codex, openclaw\ntags: [saas, supabase, governance, security, rls, naming-conventions, cost-management]\n---\n\n# Supabase Policy Guardrails\n\n## Overview\n\nOrganizational governance for Supabase at scale: a **shared RLS policy library** (reusable templates for common access patterns), **naming conventions** (tables, columns, functions, policies), **migration review process** (CI checks ensuring RLS, preventing destructive operations, enforcing naming), **cost alert configuration** (billing thresholds and usage monitoring), and **security audit scripts** (scanning for exposed keys, missing RLS, overly permissive policies). All patterns use real `createClient` from `@supabase\u002Fsupabase-js` and Supabase CLI commands.\n\n## Prerequisites\n\n- Supabase project with `supabase` CLI installed and linked\n- `@supabase\u002Fsupabase-js` v2+ installed\n- CI\u002FCD pipeline (GitHub Actions recommended)\n- Database access via `psql` or Supabase SQL Editor\n- Pro plan recommended for cost alerts and usage API\n\n## Step 1 — Shared RLS Policy Library and Naming Conventions\n\n### RLS Policy Templates\n\nCreate reusable RLS policy templates that teams apply to new tables. This prevents each developer from writing ad-hoc policies and ensures consistent access control.\n\n```sql\n-- supabase\u002Fmigrations\u002F00000000000000_rls_policy_library.sql\n-- Shared RLS policy library — apply these templates to new tables\n\n-- ============================================================\n-- Template 1: Owner-only access (user owns the row)\n-- Usage: tables with a user_id column (todos, profiles, settings)\n-- ============================================================\nCREATE OR REPLACE FUNCTION public.rls_owner_only(table_name text, user_column text DEFAULT 'user_id')\nRETURNS void AS $$\nBEGIN\n  EXECUTE format('ALTER TABLE public.%I ENABLE ROW LEVEL SECURITY', table_name);\n\n  EXECUTE format(\n    'CREATE POLICY \"owner_select\" ON public.%I FOR SELECT USING (%I = auth.uid())',\n    table_name, user_column\n  );\n  EXECUTE format(\n    'CREATE POLICY \"owner_insert\" ON public.%I FOR INSERT WITH CHECK (%I = auth.uid())',\n    table_name, user_column\n  );\n  EXECUTE format(\n    'CREATE POLICY \"owner_update\" ON public.%I FOR UPDATE USING (%I = auth.uid())',\n    table_name, user_column\n  );\n  EXECUTE format(\n    'CREATE POLICY \"owner_delete\" ON public.%I FOR DELETE USING (%I = auth.uid())',\n    table_name, user_column\n  );\nEND;\n$$ LANGUAGE plpgsql;\n\n-- ============================================================\n-- Template 2: Organization-scoped access (user is member of org)\n-- Usage: tables with org_id referencing org_members\n-- ============================================================\nCREATE OR REPLACE FUNCTION public.rls_org_scoped(\n  table_name text,\n  org_column text DEFAULT 'org_id',\n  allow_delete boolean DEFAULT false\n)\nRETURNS void AS $$\nBEGIN\n  EXECUTE format('ALTER TABLE public.%I ENABLE ROW LEVEL SECURITY', table_name);\n\n  EXECUTE format(\n    'CREATE POLICY \"org_select\" ON public.%I FOR SELECT USING (\n      %I IN (SELECT org_id FROM public.org_members WHERE user_id = auth.uid())\n    )', table_name, org_column\n  );\n  EXECUTE format(\n    'CREATE POLICY \"org_insert\" ON public.%I FOR INSERT WITH CHECK (\n      %I IN (SELECT org_id FROM public.org_members WHERE user_id = auth.uid())\n    )', table_name, org_column\n  );\n  EXECUTE format(\n    'CREATE POLICY \"org_update\" ON public.%I FOR UPDATE USING (\n      %I IN (SELECT org_id FROM public.org_members WHERE user_id = auth.uid() AND role IN (''admin'', ''editor''))\n    )', table_name, org_column\n  );\n\n  IF allow_delete THEN\n    EXECUTE format(\n      'CREATE POLICY \"org_delete\" ON public.%I FOR DELETE USING (\n        %I IN (SELECT org_id FROM public.org_members WHERE user_id = auth.uid() AND role = ''admin'')\n      )', table_name, org_column\n    );\n  END IF;\nEND;\n$$ LANGUAGE plpgsql;\n\n-- ============================================================\n-- Template 3: Public read, authenticated write\n-- Usage: blog posts, product listings, public content\n-- ============================================================\nCREATE OR REPLACE FUNCTION public.rls_public_read_auth_write(\n  table_name text,\n  owner_column text DEFAULT 'created_by'\n)\nRETURNS void AS $$\nBEGIN\n  EXECUTE format('ALTER TABLE public.%I ENABLE ROW LEVEL SECURITY', table_name);\n\n  EXECUTE format(\n    'CREATE POLICY \"public_select\" ON public.%I FOR SELECT USING (true)',\n    table_name\n  );\n  EXECUTE format(\n    'CREATE POLICY \"auth_insert\" ON public.%I FOR INSERT WITH CHECK (auth.uid() IS NOT NULL)',\n    table_name\n  );\n  EXECUTE format(\n    'CREATE POLICY \"owner_update\" ON public.%I FOR UPDATE USING (%I = auth.uid())',\n    table_name, owner_column\n  );\n  EXECUTE format(\n    'CREATE POLICY \"owner_delete\" ON public.%I FOR DELETE USING (%I = auth.uid())',\n    table_name, owner_column\n  );\nEND;\n$$ LANGUAGE plpgsql;\n\n-- Apply templates to tables:\n-- SELECT public.rls_owner_only('todos');\n-- SELECT public.rls_org_scoped('projects', 'org_id', true);\n-- SELECT public.rls_public_read_auth_write('blog_posts', 'author_id');\n```\n\n### Naming Conventions\n\n```sql\n-- supabase\u002Fmigrations\u002F00000000000001_naming_convention_check.sql\n-- Validation function that checks naming conventions at migration time\n\nCREATE OR REPLACE FUNCTION public.validate_naming_conventions()\nRETURNS TABLE(issue text, object_name text, suggestion text) AS $$\nBEGIN\n  -- Tables must be snake_case, plural\n  RETURN QUERY\n  SELECT\n    'Table name should be plural snake_case'::text,\n    t.tablename::text,\n    regexp_replace(t.tablename, '([A-Z])', '_\\1', 'g')::text\n  FROM pg_tables t\n  WHERE t.schemaname = 'public'\n  AND (\n    t.tablename ~ '[A-Z]'           -- contains uppercase\n    OR t.tablename ~ '-'             -- contains hyphens\n    OR t.tablename !~ 's$'           -- not plural (heuristic)\n  )\n  AND t.tablename NOT LIKE '\\_%';   -- skip internal tables\n\n  -- Columns must be snake_case\n  RETURN QUERY\n  SELECT\n    'Column name should be snake_case'::text,\n    (c.table_name || '.' || c.column_name)::text,\n    regexp_replace(c.column_name, '([A-Z])', '_\\1', 'g')::text\n  FROM information_schema.columns c\n  WHERE c.table_schema = 'public'\n  AND (c.column_name ~ '[A-Z]' OR c.column_name ~ '-');\n\n  -- Foreign key columns should end with _id\n  RETURN QUERY\n  SELECT\n    'Foreign key column should end with _id'::text,\n    (tc.table_name || '.' || kcu.column_name)::text,\n    (kcu.column_name || '_id')::text\n  FROM information_schema.table_constraints tc\n  JOIN information_schema.key_column_usage kcu\n    ON tc.constraint_name = kcu.constraint_name\n  WHERE tc.constraint_type = 'FOREIGN KEY'\n  AND tc.table_schema = 'public'\n  AND kcu.column_name NOT LIKE '%_id';\n\n  -- Boolean columns should start with is_ or has_\n  RETURN QUERY\n  SELECT\n    'Boolean column should start with is_ or has_'::text,\n    (c.table_name || '.' || c.column_name)::text,\n    ('is_' || c.column_name)::text\n  FROM information_schema.columns c\n  WHERE c.table_schema = 'public'\n  AND c.data_type = 'boolean'\n  AND c.column_name NOT LIKE 'is_%'\n  AND c.column_name NOT LIKE 'has_%';\nEND;\n$$ LANGUAGE plpgsql;\n\n-- Run: SELECT * FROM public.validate_naming_conventions();\n```\n\n### Naming Convention Reference\n\n| Object | Convention | Example |\n|--------|-----------|---------|\n| Tables | Plural snake_case | `user_profiles`, `order_items` |\n| Columns | snake_case | `created_at`, `full_name` |\n| Foreign keys | `{referenced_table_singular}_id` | `user_id`, `order_id` |\n| Booleans | `is_` or `has_` prefix | `is_active`, `has_verified_email` |\n| Timestamps | `_at` suffix | `created_at`, `updated_at`, `deleted_at` |\n| RLS policies | `{scope}_{operation}` | `owner_select`, `org_insert` |\n| Functions | `verb_noun` | `create_user`, `get_dashboard_metrics` |\n| Indexes | `idx_{table}_{columns}` | `idx_orders_user_id_created_at` |\n| Migrations | `{timestamp}_{verb}_{description}` | `20250322000000_create_orders_table.sql` |\n\n## Step 2 — Migration Review Process with CI Checks\n\nSee [CI checks, cost alerts, and security audits](references\u002Fci-cost-security.md) for GitHub Actions migration guardrails (RLS enforcement, naming checks, destructive operation blocks), pre-commit hooks, cost monitoring with Slack alerts, security audit scripts, and scheduled Edge Function audits.\n\n## Output\n\n- Shared RLS policy library with owner-only, org-scoped, and public-read templates\n- Naming convention validation function checking tables, columns, FKs, and booleans\n- CI pipeline enforcing RLS, naming, and destructive operation controls\n- Pre-commit hook blocking hardcoded secrets and tables without RLS\n- Cost monitoring script with configurable thresholds and Slack alerting\n- Security audit script detecting missing RLS, permissive policies, and missing indexes\n- Scheduled Edge Function for continuous security monitoring\n\n## Error Handling\n\n| Issue | Cause | Solution |\n|-------|-------|----------|\n| CI RLS check fails on new table | Migration missing `ENABLE ROW LEVEL SECURITY` | Add `ALTER TABLE` after `CREATE TABLE` in same migration |\n| Naming convention false positive | Table is intentionally singular (e.g., `config`) | Add to exclusion list in validation function |\n| Cost alert not firing | Missing `SUPABASE_ACCESS_TOKEN` | Generate token at supabase.com\u002Fdashboard\u002Faccount\u002Ftokens |\n| Security audit times out | Too many tables to scan | Run audit on specific schemas or paginate results |\n| Pre-commit blocks legitimate JWT in test | Test fixture contains JWT-like string | Add test file path to exclusion pattern |\n| RLS template function not found | Migration not applied | Run `supabase db reset` or apply migration manually |\n\n## Examples\n\nSee [CI, cost, and security reference](references\u002Fci-cost-security.md) for full examples including applying RLS templates, running security audits, and checking naming conventions.\n\n## Resources\n\n- [Supabase Row Level Security](https:\u002F\u002Fsupabase.com\u002Fdocs\u002Fguides\u002Fdatabase\u002Fpostgres\u002Frow-level-security)\n- [Supabase CLI Migrations](https:\u002F\u002Fsupabase.com\u002Fdocs\u002Fguides\u002Fcli\u002Fmanaging-environments)\n- [Supabase Management API](https:\u002F\u002Fsupabase.com\u002Fdocs\u002Freference\u002Fapi\u002Fintroduction)\n- [Supabase Pricing](https:\u002F\u002Fsupabase.com\u002Fpricing)\n- [PostgreSQL Naming Conventions](https:\u002F\u002Fwww.postgresql.org\u002Fdocs\u002Fcurrent\u002Fsql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS)\n\n## Next Steps\n\nFor architecture patterns across different app types, see `supabase-architecture-variants`.\n","# Supabase Policy Guardrails\n\n## Overview\n\nOrganizational governance for Supabase at scale: a **shared RLS policy library** (reusable templates for common access patterns), **naming conventions** (tables, columns, functions, policies), **migration review process** (CI checks ensuring RLS, preventing destructive operations, enforcing naming), **cost alert configuration** (billing thresholds and usage monitoring), and **security audit scripts** (scanning for exposed keys, missing RLS, overly permissive policies). All patterns use real `createClient` from `@supabase\u002Fsupabase-js` and Supabase CLI commands.\n\n## Prerequisites\n\n- Supabase project with `supabase` CLI installed and linked\n- `@supabase\u002Fsupabase-js` v2+ installed\n- CI\u002FCD pipeline (GitHub Actions recommended)\n- Database access via `psql` or Supabase SQL Editor\n- Pro plan recommended for cost alerts and usage API\n\n## Step 1 — Shared RLS Policy Library and Naming Conventions\n\n### RLS Policy Templates\n\nCreate reusable RLS policy templates that teams apply to new tables. This prevents each developer from writing ad-hoc policies and ensures consistent access control.\n\n```sql\n-- supabase\u002Fmigrations\u002F00000000000000_rls_policy_library.sql\n-- Shared RLS policy library — apply these templates to new tables\n\n-- ============================================================\n-- Template 1: Owner-only access (user owns the row)\n-- Usage: tables with a user_id column (todos, profiles, settings)\n-- ============================================================\nCREATE OR REPLACE FUNCTION public.rls_owner_only(table_name text, user_column text DEFAULT 'user_id')\nRETURNS void AS $$\nBEGIN\n  EXECUTE format('ALTER TABLE public.%I ENABLE ROW LEVEL SECURITY', table_name);\n\n  EXECUTE format(\n    'CREATE POLICY \"owner_select\" ON public.%I FOR SELECT USING (%I = auth.uid())',\n    table_name, user_column\n  );\n  EXECUTE format(\n    'CREATE POLICY \"owner_insert\" ON public.%I FOR INSERT WITH CHECK (%I = auth.uid())',\n    table_name, user_column\n  );\n  EXECUTE format(\n    'CREATE POLICY \"owner_update\" ON public.%I FOR UPDATE USING (%I = auth.uid())',\n    table_name, user_column\n  );\n  EXECUTE format(\n    'CREATE POLICY \"owner_delete\" ON public.%I FOR DELETE USING (%I = auth.uid())',\n    table_name, user_column\n  );\nEND;\n$$ LANGUAGE plpgsql;\n\n-- ============================================================\n-- Template 2: Organization-scoped access (user is member of org)\n-- Usage: tables with org_id referencing org_members\n-- ============================================================\nCREATE OR REPLACE FUNCTION public.rls_org_scoped(\n  table_name text,\n  org_column text DEFAULT 'org_id',\n  allow_delete boolean DEFAULT false\n)\nRETURNS void AS $$\nBEGIN\n  EXECUTE format('ALTER TABLE public.%I ENABLE ROW LEVEL SECURITY', table_name);\n\n  EXECUTE format(\n    'CREATE POLICY \"org_select\" ON public.%I FOR SELECT USING (\n      %I IN (SELECT org_id FROM public.org_members WHERE user_id = auth.uid())\n    )', table_name, org_column\n  );\n  EXECUTE format(\n    'CREATE POLICY \"org_insert\" ON public.%I FOR INSERT WITH CHECK (\n      %I IN (SELECT org_id FROM public.org_members WHERE user_id = auth.uid())\n    )', table_name, org_column\n  );\n  EXECUTE format(\n    'CREATE POLICY \"org_update\" ON public.%I FOR UPDATE USING (\n      %I IN (SELECT org_id FROM public.org_members WHERE user_id = auth.uid() AND role IN (''admin'', ''editor''))\n    )', table_name, org_column\n  );\n\n  IF allow_delete THEN\n    EXECUTE format(\n      'CREATE POLICY \"org_delete\" ON public.%I FOR DELETE USING (\n        %I IN (SELECT org_id FROM public.org_members WHERE user_id = auth.uid() AND role = ''admin'')\n      )', table_name, org_column\n    );\n  END IF;\nEND;\n$$ LANGUAGE plpgsql;\n\n-- ============================================================\n-- Template 3: Public read, authenticated write\n-- Usage: blog posts, product listings, public content\n-- ============================================================\nCREATE OR REPLACE FUNCTION public.rls_public_read_auth_write(\n  table_name text,\n  owner_column text DEFAULT 'created_by'\n)\nRETURNS void AS $$\nBEGIN\n  EXECUTE format('ALTER TABLE public.%I ENABLE ROW LEVEL SECURITY', table_name);\n\n  EXECUTE format(\n    'CREATE POLICY \"public_select\" ON public.%I FOR SELECT USING (true)',\n    table_name\n  );\n  EXECUTE format(\n    'CREATE POLICY \"auth_insert\" ON public.%I FOR INSERT WITH CHECK (auth.uid() IS NOT NULL)',\n    table_name\n  );\n  EXECUTE format(\n    'CREATE POLICY \"owner_update\" ON public.%I FOR UPDATE USING (%I = auth.uid())',\n    table_name, owner_column\n  );\n  EXECUTE format(\n    'CREATE POLICY \"owner_delete\" ON public.%I FOR DELETE USING (%I = auth.uid())',\n    table_name, owner_column\n  );\nEND;\n$$ LANGUAGE plpgsql;\n\n-- Apply templates to tables:\n-- SELECT public.rls_owner_only('todos');\n-- SELECT public.rls_org_scoped('projects', 'org_id', true);\n-- SELECT public.rls_public_read_auth_write('blog_posts', 'author_id');\n```\n\n### Naming Conventions\n\n```sql\n-- supabase\u002Fmigrations\u002F00000000000001_naming_convention_check.sql\n-- Validation function that checks naming conventions at migration time\n\nCREATE OR REPLACE FUNCTION public.validate_naming_conventions()\nRETURNS TABLE(issue text, object_name text, suggestion text) AS $$\nBEGIN\n  -- Tables must be snake_case, plural\n  RETURN QUERY\n  SELECT\n    'Table name should be plural snake_case'::text,\n    t.tablename::text,\n    regexp_replace(t.tablename, '([A-Z])', '_\\1', 'g')::text\n  FROM pg_tables t\n  WHERE t.schemaname = 'public'\n  AND (\n    t.tablename ~ '[A-Z]'           -- contains uppercase\n    OR t.tablename ~ '-'             -- contains hyphens\n    OR t.tablename !~ 's$'           -- not plural (heuristic)\n  )\n  AND t.tablename NOT LIKE '\\_%';   -- skip internal tables\n\n  -- Columns must be snake_case\n  RETURN QUERY\n  SELECT\n    'Column name should be snake_case'::text,\n    (c.table_name || '.' || c.column_name)::text,\n    regexp_replace(c.column_name, '([A-Z])', '_\\1', 'g')::text\n  FROM information_schema.columns c\n  WHERE c.table_schema = 'public'\n  AND (c.column_name ~ '[A-Z]' OR c.column_name ~ '-');\n\n  -- Foreign key columns should end with _id\n  RETURN QUERY\n  SELECT\n    'Foreign key column should end with _id'::text,\n    (tc.table_name || '.' || kcu.column_name)::text,\n    (kcu.column_name || '_id')::text\n  FROM information_schema.table_constraints tc\n  JOIN information_schema.key_column_usage kcu\n    ON tc.constraint_name = kcu.constraint_name\n  WHERE tc.constraint_type = 'FOREIGN KEY'\n  AND tc.table_schema = 'public'\n  AND kcu.column_name NOT LIKE '%_id';\n\n  -- Boolean columns should start with is_ or has_\n  RETURN QUERY\n  SELECT\n    'Boolean column should start with is_ or has_'::text,\n    (c.table_name || '.' || c.column_name)::text,\n    ('is_' || c.column_name)::text\n  FROM information_schema.columns c\n  WHERE c.table_schema = 'public'\n  AND c.data_type = 'boolean'\n  AND c.column_name NOT LIKE 'is_%'\n  AND c.column_name NOT LIKE 'has_%';\nEND;\n$$ LANGUAGE plpgsql;\n\n-- Run: SELECT * FROM public.validate_naming_conventions();\n```\n\n### Naming Convention Reference\n\n| Object | Convention | Example |\n|--------|-----------|---------|\n| Tables | Plural snake_case | `user_profiles`, `order_items` |\n| Columns | snake_case | `created_at`, `full_name` |\n| Foreign keys | `{referenced_table_singular}_id` | `user_id`, `order_id` |\n| Booleans | `is_` or `has_` prefix | `is_active`, `has_verified_email` |\n| Timestamps | `_at` suffix | `created_at`, `updated_at`, `deleted_at` |\n| RLS policies | `{scope}_{operation}` | `owner_select`, `org_insert` |\n| Functions | `verb_noun` | `create_user`, `get_dashboard_metrics` |\n| Indexes | `idx_{table}_{columns}` | `idx_orders_user_id_created_at` |\n| Migrations | `{timestamp}_{verb}_{description}` | `20250322000000_create_orders_table.sql` |\n\n## Step 2 — Migration Review Process with CI Checks\n\nSee [CI checks, cost alerts, and security audits](references\u002Fci-cost-security.md) for GitHub Actions migration guardrails (RLS enforcement, naming checks, destructive operation blocks), pre-commit hooks, cost monitoring with Slack alerts, security audit scripts, and scheduled Edge Function audits.\n\n## Output\n\n- Shared RLS policy library with owner-only, org-scoped, and public-read templates\n- Naming convention validation function checking tables, columns, FKs, and booleans\n- CI pipeline enforcing RLS, naming, and destructive operation controls\n- Pre-commit hook blocking hardcoded secrets and tables without RLS\n- Cost monitoring script with configurable thresholds and Slack alerting\n- Security audit script detecting missing RLS, permissive policies, and missing indexes\n- Scheduled Edge Function for continuous security monitoring\n\n## Error Handling\n\n| Issue | Cause | Solution |\n|-------|-------|----------|\n| CI RLS check fails on new table | Migration missing `ENABLE ROW LEVEL SECURITY` | Add `ALTER TABLE` after `CREATE TABLE` in same migration |\n| Naming convention false positive | Table is intentionally singular (e.g., `config`) | Add to exclusion list in validation function |\n| Cost alert not firing | Missing `SUPABASE_ACCESS_TOKEN` | Generate token at supabase.com\u002Fdashboard\u002Faccount\u002Ftokens |\n| Security audit times out | Too many tables to scan | Run audit on specific schemas or paginate results |\n| Pre-commit blocks legitimate JWT in test | Test fixture contains JWT-like string | Add test file path to exclusion pattern |\n| RLS template function not found | Migration not applied | Run `supabase db reset` or apply migration manually |\n\n## Examples\n\nSee [CI, cost, and security reference](references\u002Fci-cost-security.md) for full examples including applying RLS templates, running security audits, and checking naming conventions.\n\n## Resources\n\n- [Supabase Row Level Security](https:\u002F\u002Fsupabase.com\u002Fdocs\u002Fguides\u002Fdatabase\u002Fpostgres\u002Frow-level-security)\n- [Supabase CLI Migrations](https:\u002F\u002Fsupabase.com\u002Fdocs\u002Fguides\u002Fcli\u002Fmanaging-environments)\n- [Supabase Management API](https:\u002F\u002Fsupabase.com\u002Fdocs\u002Freference\u002Fapi\u002Fintroduction)\n- [Supabase Pricing](https:\u002F\u002Fsupabase.com\u002Fpricing)\n- [PostgreSQL Naming Conventions](https:\u002F\u002Fwww.postgresql.org\u002Fdocs\u002Fcurrent\u002Fsql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS)\n\n## Next Steps\n\nFor architecture patterns across different app types, see `supabase-architecture-variants`.\n",{"name":5,"tags":24,"author":32,"license":15,"version":33,"description":34,"allowed-tools":35,"compatible-with":36},[25,26,27,28,29,30,31],"saas","supabase","governance","security","rls","naming-conventions","cost-management","Jeremy Longshore \u003Cjeremy@intentsolutions.io>","1.0.0","Enforce organizational governance for Supabase projects: shared RLS policy\nlibrary with reusable templates, table and column naming conventions,\nmigration review process with CI checks, cost alert thresholds,\nand security audit scripts scanning for common misconfigurations.\nUse when establishing Supabase standards across teams, creating RLS\npolicy templates, setting up migration review workflows, or auditing\nexisting projects for security and cost issues.\nTrigger with phrases like \"supabase governance\", \"supabase policy library\",\n\"supabase naming convention\", \"supabase migration review\",\n\"supabase cost alert\", \"supabase security audit\", \"supabase RLS template\".\n","Read, Write, Edit, Bash(supabase:*), Bash(psql:*), Bash(npx:*), Grep","claude-code, codex, openclaw","main","99825ad3f3bcc6597ddcc7294a14e6e922f2b67b","skills\u002Fsaas-packs--supabase-pack--supabase-policy-guardrails",0,"https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills","https:\u002F\u002Fgithub.com\u002Fjukeyman","https:\u002F\u002FRJBUSINESSSOLUTIONS.ORG","Credit and Finance Expert | Developer\r\n\r\nI'm Rick Jefferson, a seasoned credit and finance expert with over a decade of experience in financial literacy,","2026-07-13 07:03:29",{"source":8,"skillName":5,"commands":47,"prompt":57,"zipAvailable":58},[48,51,54],{"tool":49,"command":50},"npx","npx skills add jukeyman\u002Fjukeyman-skills --skill supabase-policy-guardrails",{"tool":52,"command":53},"bunx","bunx skills add jukeyman\u002Fjukeyman-skills --skill supabase-policy-guardrails",{"tool":55,"command":56},"pnpm","pnpm dlx skills add jukeyman\u002Fjukeyman-skills --skill supabase-policy-guardrails","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsaas-packs--supabase-pack--supabase-policy-guardrails\u002FSKILL.md",true,[],[61,68,75,82,89,97],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M79ANS2SM329NEP5ZCX106RR","zustand-store-creator","Create zustand store creator operations. Auto-activating skill for Frontend Development.\nTriggers on: zustand store creator, zustand store creator\nPart of the Frontend Development skill category. Use when working with zustand store creator functionality. Trigger with phrases like \"zustand store creator\", \"zustand creator\", \"zustand\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzustand-store-creator\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M79AMZKP4YDEZ7EHG1Y7PP74","zero-trust-config-helper","Configure with zero trust config helper operations. Auto-activating skill for Security Advanced.\nTriggers on: zero trust config helper, zero trust config helper\nPart of the Security Advanced skill category. Use when configuring systems or services. Trigger with phrases like \"zero trust config helper\", \"zero helper\", \"zero\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzero-trust-config-helper\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M79AMJSBCEJQNBTYNAHYN5HM","zapier-integration-helper","Assist with zapier integration helper operations. Auto-activating skill for Business Automation.\nTriggers on: zapier integration helper, zapier integration helper\nPart of the Business Automation skill category. Use when working with APIs or building integrations. Trigger with phrases like \"zapier integration helper\", \"zapier helper\", \"zapier\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzapier-integration-helper\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M79AHJZGVMARS13VFQYRR1MP","yaml-config-validator","Validate yaml config validator operations. Auto-activating skill for DevOps Basics.\nTriggers on: yaml config validator, yaml config validator\nPart of the DevOps Basics skill category. Use when configuring systems or services. Trigger with phrases like \"yaml config validator\", \"yaml validator\", \"yaml\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fyaml-config-validator\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":93,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M79AHGDZRN0020RDQSQDPAM8","xvary-stock-research","Thesis-driven equity analysis from public SEC EDGAR and market data; \u002Fanalyze, \u002Fscore, \u002Fcompare workflows with bundled Python tools (Claude Code, Cursor, Codex).","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxvary-stock-research\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxvary-stock-research\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":19},"01M79AHCYJ9FV9RMHQ24HDRN33","xss-vulnerability-scanner","Scan xss vulnerability scanner operations. Auto-activating skill for Security Fundamentals.\nTriggers on: xss vulnerability scanner, xss vulnerability scanner\nPart of the Security Fundamentals skill category. Use when working with xss vulnerability scanner functionality. Trigger with phrases like \"xss vulnerability scanner\", \"xss scanner\", \"xss\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxss-vulnerability-scanner\u002FSKILL.md",[],[]]