[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EPS86EP5YREV3Z2GYE3GK2":3,"skill-same:01M6EPS86EP5YREV3Z2GYE3GK2":83},{"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":31,"linkOnly":32,"markdownContent":33,"markdownBody":34,"frontMatter":35,"refName":36,"commitSha":37,"skillDirectory":38,"forksCount":39,"repositoryHtmlUrl":40,"repositoryHomepageUrl":41,"ownerHtmlUrl":42,"ownerBlogUrl":6,"ownerDescription":43,"updatedAt":44,"install":45,"resources":58},"01M6EPS86EP5YREV3Z2GYE3GK2","supabase-patterns",null,"Generic Supabase best practices for Row Level Security, realtime subscriptions, storage, and edge functions. Framework-agnostic.","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",66,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fconsiliency\u002Fsupabase-patterns\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30],"supabase","patterns","supabase patterns","security","storage","realtime","best practices","framework","edge","edge functions","functions","subscriptions","2026-11-10 10:12:30",false,"---\nname: supabase-patterns\ndescription: \"Generic Supabase best practices for Row Level Security, realtime subscriptions, storage, and edge functions. Framework-agnostic.\"\n---\n\n# Supabase Patterns Skill\n\nUniversal patterns for working with Supabase in any project. Covers RLS policies, realtime, storage, edge functions, and migrations.\n\n## Design Principle\n\nThis skill is **framework-generic**. It provides universal Supabase patterns:\n- NOT tailored to Book-Vetting, ocr-service, or any specific project\n- Covers common patterns applicable across all Supabase projects\n- Project-specific configurations go in project-specific skills\n\n## Variables\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| SUPABASE_DIR | supabase | Directory for Supabase config |\n| ENFORCE_RLS | true | Require RLS on all tables |\n| REALTIME_ENABLED | auto | Auto-detect realtime tables |\n\n## Instructions\n\n**MANDATORY** - Follow the Workflow steps below in order.\n\n1. Check Supabase project configuration\n2. Review existing RLS policies\n3. Follow security-first patterns\n4. Keep migrations organized\n\n## Red Flags - STOP and Reconsider\n\nIf you're about to:\n- Create a table without RLS policies\n- Use service role key in client-side code\n- Skip migrations for schema changes\n- Expose sensitive data in realtime\n\n**STOP** -> Add RLS policies -> Use appropriate keys -> Then proceed\n\n## Cookbook\n\n### RLS Policies\n- IF: Creating or modifying RLS policies\n- THEN: Read and execute `.\u002Fcookbook\u002Frls-policies.md`\n\n### Realtime Subscriptions\n- IF: Setting up realtime features\n- THEN: Read and execute `.\u002Fcookbook\u002Frealtime-subscriptions.md`\n\n### Storage Patterns\n- IF: Working with Supabase Storage\n- THEN: Read and execute `.\u002Fcookbook\u002Fstorage-patterns.md`\n\n## Quick Reference\n\n### Project Structure\n\n```\nsupabase\u002F\n├── config.toml           # Project config\n├── migrations\u002F           # SQL migrations\n│   ├── 20231201000000_initial.sql\n│   └── 20231202000000_add_users.sql\n├── seed.sql             # Seed data\n└── functions\u002F           # Edge functions\n    └── hello\u002F\n        └── index.ts\n```\n\n### Key Commands\n\n```bash\n# Initialize project\nsupabase init\n\n# Start local development\nsupabase start\n\n# Generate migration\nsupabase migration new my_migration\n\n# Push to remote\nsupabase db push\n\n# Generate types\nsupabase gen types typescript --local > types\u002Fsupabase.ts\n```\n\n### RLS Policy Patterns\n\n```sql\n-- Enable RLS\nALTER TABLE posts ENABLE ROW LEVEL SECURITY;\n\n-- User owns row\nCREATE POLICY \"Users can view own posts\"\n  ON posts FOR SELECT\n  USING (auth.uid() = user_id);\n\n-- User can insert own\nCREATE POLICY \"Users can create posts\"\n  ON posts FOR INSERT\n  WITH CHECK (auth.uid() = user_id);\n\n-- Public read\nCREATE POLICY \"Public read\"\n  ON posts FOR SELECT\n  USING (is_public = true);\n```\n\n### Client Patterns\n\n```typescript\n\u002F\u002F Initialize client\nimport { createClient } from '@supabase\u002Fsupabase-js';\nimport type { Database } from '.\u002Ftypes\u002Fsupabase';\n\nconst supabase = createClient\u003CDatabase>(\n  process.env.SUPABASE_URL!,\n  process.env.SUPABASE_ANON_KEY!\n);\n\n\u002F\u002F Query with types\nconst { data, error } = await supabase\n  .from('posts')\n  .select('*')\n  .eq('user_id', userId);\n\n\u002F\u002F Insert\nconst { data, error } = await supabase\n  .from('posts')\n  .insert({ title, content, user_id: userId })\n  .select()\n  .single();\n```\n\n### Realtime Pattern\n\n```typescript\n\u002F\u002F Subscribe to changes\nconst subscription = supabase\n  .channel('posts')\n  .on(\n    'postgres_changes',\n    { event: '*', schema: 'public', table: 'posts' },\n    (payload) => {\n      console.log('Change:', payload);\n    }\n  )\n  .subscribe();\n\n\u002F\u002F Cleanup\nsubscription.unsubscribe();\n```\n\n### Storage Pattern\n\n```typescript\n\u002F\u002F Upload file\nconst { data, error } = await supabase.storage\n  .from('avatars')\n  .upload(`${userId}\u002Favatar.png`, file, {\n    upsert: true,\n    contentType: 'image\u002Fpng'\n  });\n\n\u002F\u002F Get public URL\nconst { data: { publicUrl } } = supabase.storage\n  .from('avatars')\n  .getPublicUrl(`${userId}\u002Favatar.png`);\n```\n\n## Security Checklist\n\n### Before Production\n\n- [ ] RLS enabled on ALL tables\n- [ ] Service role key NOT in client code\n- [ ] Anon key for public operations only\n- [ ] Storage buckets have policies\n- [ ] Sensitive columns excluded from realtime\n- [ ] API rate limiting configured\n- [ ] CORS properly configured\n\n### RLS Checklist\n\n- [ ] Every table has RLS enabled\n- [ ] SELECT policies defined\n- [ ] INSERT\u002FUPDATE\u002FDELETE policies defined\n- [ ] Policies tested with different roles\n- [ ] No overly permissive policies\n\n## Integration\n\n### With Schema Alignment\n\nSupabase migrations should align with ORM models:\n\n```sql\n-- supabase\u002Fmigrations\u002F20231201000000_users.sql\nCREATE TABLE users (\n  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),\n  email TEXT UNIQUE NOT NULL,\n  name TEXT,\n  created_at TIMESTAMPTZ DEFAULT now()\n);\n```\n\nShould match:\n\n```python\n# SQLAlchemy model\nclass User(Base):\n    id: Mapped[uuid.UUID] = mapped_column(primary_key=True, default=uuid.uuid4)\n    email: Mapped[str] = mapped_column(unique=True)\n    name: Mapped[str | None]\n    created_at: Mapped[datetime] = mapped_column(server_default=func.now())\n```\n\n### Type Generation\n\n```bash\n# Generate TypeScript types from local schema\nsupabase gen types typescript --local > types\u002Fsupabase.ts\n\n# Use in client\nimport type { Database } from '.\u002Ftypes\u002Fsupabase';\ntype Post = Database['public']['Tables']['posts']['Row'];\n```\n\n## Best Practices\n\n1. **RLS first**: Always add RLS policies when creating tables\n2. **Migrations for everything**: Never modify schema directly\n3. **Type safety**: Generate and use TypeScript types\n4. **Key hygiene**: Use anon key client-side, service key server-side only\n5. **Test policies**: Test RLS with actual user contexts\n6. **Realtime carefully**: Only enable for tables that need it\n","# Supabase Patterns Skill\n\nUniversal patterns for working with Supabase in any project. Covers RLS policies, realtime, storage, edge functions, and migrations.\n\n## Design Principle\n\nThis skill is **framework-generic**. It provides universal Supabase patterns:\n- NOT tailored to Book-Vetting, ocr-service, or any specific project\n- Covers common patterns applicable across all Supabase projects\n- Project-specific configurations go in project-specific skills\n\n## Variables\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| SUPABASE_DIR | supabase | Directory for Supabase config |\n| ENFORCE_RLS | true | Require RLS on all tables |\n| REALTIME_ENABLED | auto | Auto-detect realtime tables |\n\n## Instructions\n\n**MANDATORY** - Follow the Workflow steps below in order.\n\n1. Check Supabase project configuration\n2. Review existing RLS policies\n3. Follow security-first patterns\n4. Keep migrations organized\n\n## Red Flags - STOP and Reconsider\n\nIf you're about to:\n- Create a table without RLS policies\n- Use service role key in client-side code\n- Skip migrations for schema changes\n- Expose sensitive data in realtime\n\n**STOP** -> Add RLS policies -> Use appropriate keys -> Then proceed\n\n## Cookbook\n\n### RLS Policies\n- IF: Creating or modifying RLS policies\n- THEN: Read and execute `.\u002Fcookbook\u002Frls-policies.md`\n\n### Realtime Subscriptions\n- IF: Setting up realtime features\n- THEN: Read and execute `.\u002Fcookbook\u002Frealtime-subscriptions.md`\n\n### Storage Patterns\n- IF: Working with Supabase Storage\n- THEN: Read and execute `.\u002Fcookbook\u002Fstorage-patterns.md`\n\n## Quick Reference\n\n### Project Structure\n\n```\nsupabase\u002F\n├── config.toml           # Project config\n├── migrations\u002F           # SQL migrations\n│   ├── 20231201000000_initial.sql\n│   └── 20231202000000_add_users.sql\n├── seed.sql             # Seed data\n└── functions\u002F           # Edge functions\n    └── hello\u002F\n        └── index.ts\n```\n\n### Key Commands\n\n```bash\n# Initialize project\nsupabase init\n\n# Start local development\nsupabase start\n\n# Generate migration\nsupabase migration new my_migration\n\n# Push to remote\nsupabase db push\n\n# Generate types\nsupabase gen types typescript --local > types\u002Fsupabase.ts\n```\n\n### RLS Policy Patterns\n\n```sql\n-- Enable RLS\nALTER TABLE posts ENABLE ROW LEVEL SECURITY;\n\n-- User owns row\nCREATE POLICY \"Users can view own posts\"\n  ON posts FOR SELECT\n  USING (auth.uid() = user_id);\n\n-- User can insert own\nCREATE POLICY \"Users can create posts\"\n  ON posts FOR INSERT\n  WITH CHECK (auth.uid() = user_id);\n\n-- Public read\nCREATE POLICY \"Public read\"\n  ON posts FOR SELECT\n  USING (is_public = true);\n```\n\n### Client Patterns\n\n```typescript\n\u002F\u002F Initialize client\nimport { createClient } from '@supabase\u002Fsupabase-js';\nimport type { Database } from '.\u002Ftypes\u002Fsupabase';\n\nconst supabase = createClient\u003CDatabase>(\n  process.env.SUPABASE_URL!,\n  process.env.SUPABASE_ANON_KEY!\n);\n\n\u002F\u002F Query with types\nconst { data, error } = await supabase\n  .from('posts')\n  .select('*')\n  .eq('user_id', userId);\n\n\u002F\u002F Insert\nconst { data, error } = await supabase\n  .from('posts')\n  .insert({ title, content, user_id: userId })\n  .select()\n  .single();\n```\n\n### Realtime Pattern\n\n```typescript\n\u002F\u002F Subscribe to changes\nconst subscription = supabase\n  .channel('posts')\n  .on(\n    'postgres_changes',\n    { event: '*', schema: 'public', table: 'posts' },\n    (payload) => {\n      console.log('Change:', payload);\n    }\n  )\n  .subscribe();\n\n\u002F\u002F Cleanup\nsubscription.unsubscribe();\n```\n\n### Storage Pattern\n\n```typescript\n\u002F\u002F Upload file\nconst { data, error } = await supabase.storage\n  .from('avatars')\n  .upload(`${userId}\u002Favatar.png`, file, {\n    upsert: true,\n    contentType: 'image\u002Fpng'\n  });\n\n\u002F\u002F Get public URL\nconst { data: { publicUrl } } = supabase.storage\n  .from('avatars')\n  .getPublicUrl(`${userId}\u002Favatar.png`);\n```\n\n## Security Checklist\n\n### Before Production\n\n- [ ] RLS enabled on ALL tables\n- [ ] Service role key NOT in client code\n- [ ] Anon key for public operations only\n- [ ] Storage buckets have policies\n- [ ] Sensitive columns excluded from realtime\n- [ ] API rate limiting configured\n- [ ] CORS properly configured\n\n### RLS Checklist\n\n- [ ] Every table has RLS enabled\n- [ ] SELECT policies defined\n- [ ] INSERT\u002FUPDATE\u002FDELETE policies defined\n- [ ] Policies tested with different roles\n- [ ] No overly permissive policies\n\n## Integration\n\n### With Schema Alignment\n\nSupabase migrations should align with ORM models:\n\n```sql\n-- supabase\u002Fmigrations\u002F20231201000000_users.sql\nCREATE TABLE users (\n  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),\n  email TEXT UNIQUE NOT NULL,\n  name TEXT,\n  created_at TIMESTAMPTZ DEFAULT now()\n);\n```\n\nShould match:\n\n```python\n# SQLAlchemy model\nclass User(Base):\n    id: Mapped[uuid.UUID] = mapped_column(primary_key=True, default=uuid.uuid4)\n    email: Mapped[str] = mapped_column(unique=True)\n    name: Mapped[str | None]\n    created_at: Mapped[datetime] = mapped_column(server_default=func.now())\n```\n\n### Type Generation\n\n```bash\n# Generate TypeScript types from local schema\nsupabase gen types typescript --local > types\u002Fsupabase.ts\n\n# Use in client\nimport type { Database } from '.\u002Ftypes\u002Fsupabase';\ntype Post = Database['public']['Tables']['posts']['Row'];\n```\n\n## Best Practices\n\n1. **RLS first**: Always add RLS policies when creating tables\n2. **Migrations for everything**: Never modify schema directly\n3. **Type safety**: Generate and use TypeScript types\n4. **Key hygiene**: Use anon key client-side, service key server-side only\n5. **Test policies**: Test RLS with actual user contexts\n6. **Realtime carefully**: Only enable for tables that need it\n",{"name":5,"description":7},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Faiskillstore\u002Fmarketplace\u002Fconsiliency\u002Fsupabase-patterns",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":46,"prompt":56,"zipAvailable":57},[47,50,53],{"tool":48,"command":49},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill supabase-patterns",{"tool":51,"command":52},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill supabase-patterns",{"tool":54,"command":55},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill supabase-patterns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fconsiliency\u002Fsupabase-patterns\u002FSKILL.md",true,[59,65,71,75,79],{"path":60,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":63,"sourceHtmlUrl":64},"assets\u002Fdocumentation-template.md","ASSET","资产文件",2887,"https:\u002F\u002Fgithub.com\u002FTorchiaHub\u002FSkills\u002Fblob\u002Fmaster\u002F01-Inbox\u002Fdownloads\u002Fgithub-awesome-copilot\u002F20260429T123413Z\u002Fsource\u002Fskills\u002Foo-component-documentation\u002Fassets\u002Fdocumentation-template.md",{"path":66,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":69,"sourceHtmlUrl":70},"cookbook\u002Frls-policies.md","REFERENCE","参考文档",6171,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fconsiliency\u002Fsupabase-patterns\u002Fcookbook\u002Frls-policies.md",{"path":72,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":73,"sourceHtmlUrl":74},"references\u002Fcreate-mode.md",1929,"https:\u002F\u002Fgithub.com\u002FTorchiaHub\u002FSkills\u002Fblob\u002Fmaster\u002F01-Inbox\u002Fdownloads\u002Fgithub-awesome-copilot\u002F20260429T123413Z\u002Fsource\u002Fskills\u002Foo-component-documentation\u002Freferences\u002Fcreate-mode.md",{"path":76,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":77,"sourceHtmlUrl":78},"references\u002Fupdate-mode.md",2047,"https:\u002F\u002Fgithub.com\u002FTorchiaHub\u002FSkills\u002Fblob\u002Fmaster\u002F01-Inbox\u002Fdownloads\u002Fgithub-awesome-copilot\u002F20260429T123413Z\u002Fsource\u002Fskills\u002Foo-component-documentation\u002Freferences\u002Fupdate-mode.md",{"path":80,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":81,"sourceHtmlUrl":82},"skill-report.json",16387,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fconsiliency\u002Fsupabase-patterns\u002Fskill-report.json",[84,98,108,117,123,130],{"skillNo":85,"name":86,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":94,"publishedAt":31},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[89],{"categoryNo":90,"categoryName":91,"taxonomyType":92,"taxonomyTypeDesc":93},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[95,96,97],"model","model hierarchy","model hierarchy skill",{"skillNo":99,"name":100,"nameZh":6,"description":6,"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":104,"publishedAt":31},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[103],{"categoryNo":90,"categoryName":91,"taxonomyType":92,"taxonomyTypeDesc":93},[105,106,107],"MCP","zoom","zoom mcp",{"skillNo":109,"name":110,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":31},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[114,115,116,106],"sdk","zoom apps sdk","apps",{"skillNo":118,"name":119,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":120,"categories":121,"keywords":122,"publishedAt":31},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[119],{"skillNo":124,"name":125,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":126,"categories":127,"keywords":129,"publishedAt":31},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[128],{"categoryNo":90,"categoryName":91,"taxonomyType":92,"taxonomyTypeDesc":93},[125],{"skillNo":131,"name":132,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":133,"categories":134,"keywords":135,"publishedAt":31},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[132]]