[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6G2ERK5B9GVPDTV2J1C8T8B":3,"skill-same:01M6G2ERK5B9GVPDTV2J1C8T8B":62},{"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":34,"linkOnly":35,"markdownContent":36,"markdownBody":37,"frontMatter":38,"refName":39,"commitSha":40,"skillDirectory":41,"forksCount":42,"repositoryHtmlUrl":43,"repositoryHomepageUrl":6,"ownerHtmlUrl":44,"ownerBlogUrl":45,"ownerDescription":46,"updatedAt":47,"install":48,"resources":61},"01M6G2ERK5B9GVPDTV2J1C8T8B","postgres-patterns",null,"PostgreSQL database patterns for query optimization, schema design, indexing, and security. Based on Supabase best practices.","oabdelmaksoud\u002FAgention","oabdelmaksoud","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F50699149?v=4","01M6D5CVVN778ZCDP1WHS816SP","Omar Abdelmaksoud","01M6D8A4TE76V3DCSH3D94VG1V",2,"MIT","https:\u002F\u002Fgithub.com\u002Foabdelmaksoud\u002FAgention\u002Fblob\u002Fmain\u002Fupstream-sync\u002Fwork\u002Fecc\u002Fdocs\u002Fzh-TW\u002Fskills\u002Fpostgres-patterns\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33],"postgres patterns","postgres","patterns","design","security","best practices","database","postgresql","supabase","Optimization","schema","query optimization","schema design","query","indexing","2026-11-10 10:12:30",false,"---\nname: postgres-patterns\ndescription: PostgreSQL database patterns for query optimization, schema design, indexing, and security. Based on Supabase best practices.\n---\n\n# PostgreSQL 模式\n\nPostgreSQL 最佳實務快速參考。詳細指南請使用 `database-reviewer` agent。\n\n## 何時啟用\n\n- 撰寫 SQL 查詢或 migrations\n- 設計資料庫 schema\n- 疑難排解慢查詢\n- 實作 Row Level Security\n- 設定連線池\n\n## 快速參考\n\n### 索引速查表\n\n| 查詢模式 | 索引類型 | 範例 |\n|---------|---------|------|\n| `WHERE col = value` | B-tree（預設） | `CREATE INDEX idx ON t (col)` |\n| `WHERE col > value` | B-tree | `CREATE INDEX idx ON t (col)` |\n| `WHERE a = x AND b > y` | 複合 | `CREATE INDEX idx ON t (a, b)` |\n| `WHERE jsonb @> '{}'` | GIN | `CREATE INDEX idx ON t USING gin (col)` |\n| `WHERE tsv @@ query` | GIN | `CREATE INDEX idx ON t USING gin (col)` |\n| 時間序列範圍 | BRIN | `CREATE INDEX idx ON t USING brin (col)` |\n\n### 資料類型快速參考\n\n| 使用情況 | 正確類型 | 避免 |\n|---------|---------|------|\n| IDs | `bigint` | `int`、隨機 UUID |\n| 字串 | `text` | `varchar(255)` |\n| 時間戳 | `timestamptz` | `timestamp` |\n| 金額 | `numeric(10,2)` | `float` |\n| 旗標 | `boolean` | `varchar`、`int` |\n\n### 常見模式\n\n**複合索引順序：**\n```sql\n-- 等值欄位優先，然後是範圍欄位\nCREATE INDEX idx ON orders (status, created_at);\n-- 適用於：WHERE status = 'pending' AND created_at > '2024-01-01'\n```\n\n**覆蓋索引：**\n```sql\nCREATE INDEX idx ON users (email) INCLUDE (name, created_at);\n-- 避免 SELECT email, name, created_at 時的表格查詢\n```\n\n**部分索引：**\n```sql\nCREATE INDEX idx ON users (email) WHERE deleted_at IS NULL;\n-- 更小的索引，只包含活躍使用者\n```\n\n**RLS 政策（優化）：**\n```sql\nCREATE POLICY policy ON orders\n  USING ((SELECT auth.uid()) = user_id);  -- 用 SELECT 包裝！\n```\n\n**UPSERT：**\n```sql\nINSERT INTO settings (user_id, key, value)\nVALUES (123, 'theme', 'dark')\nON CONFLICT (user_id, key)\nDO UPDATE SET value = EXCLUDED.value;\n```\n\n**游標分頁：**\n```sql\nSELECT * FROM products WHERE id > $last_id ORDER BY id LIMIT 20;\n-- O(1) vs OFFSET 是 O(n)\n```\n\n**佇列處理：**\n```sql\nUPDATE jobs SET status = 'processing'\nWHERE id = (\n  SELECT id FROM jobs WHERE status = 'pending'\n  ORDER BY created_at LIMIT 1\n  FOR UPDATE SKIP LOCKED\n) RETURNING *;\n```\n\n### 反模式偵測\n\n```sql\n-- 找出未建索引的外鍵\nSELECT conrelid::regclass, a.attname\nFROM pg_constraint c\nJOIN pg_attribute a ON a.attrelid = c.conrelid AND a.attnum = ANY(c.conkey)\nWHERE c.contype = 'f'\n  AND NOT EXISTS (\n    SELECT 1 FROM pg_index i\n    WHERE i.indrelid = c.conrelid AND a.attnum = ANY(i.indkey)\n  );\n\n-- 找出慢查詢\nSELECT query, mean_exec_time, calls\nFROM pg_stat_statements\nWHERE mean_exec_time > 100\nORDER BY mean_exec_time DESC;\n\n-- 檢查表格膨脹\nSELECT relname, n_dead_tup, last_vacuum\nFROM pg_stat_user_tables\nWHERE n_dead_tup > 1000\nORDER BY n_dead_tup DESC;\n```\n\n### 設定範本\n\n```sql\n-- 連線限制（依 RAM 調整）\nALTER SYSTEM SET max_connections = 100;\nALTER SYSTEM SET work_mem = '8MB';\n\n-- 逾時\nALTER SYSTEM SET idle_in_transaction_session_timeout = '30s';\nALTER SYSTEM SET statement_timeout = '30s';\n\n-- 監控\nCREATE EXTENSION IF NOT EXISTS pg_stat_statements;\n\n-- 安全預設值\nREVOKE ALL ON SCHEMA public FROM public;\n\nSELECT pg_reload_conf();\n```\n\n## 相關\n\n- Agent：`database-reviewer` - 完整資料庫審查工作流程\n- Skill：`clickhouse-io` - ClickHouse 分析模式\n- Skill：`backend-patterns` - API 和後端模式\n\n---\n\n*基於 [Supabase Agent Skills](Supabase Agent Skills (credit: Supabase team))（MIT 授權）*\n","# PostgreSQL 模式\n\nPostgreSQL 最佳實務快速參考。詳細指南請使用 `database-reviewer` agent。\n\n## 何時啟用\n\n- 撰寫 SQL 查詢或 migrations\n- 設計資料庫 schema\n- 疑難排解慢查詢\n- 實作 Row Level Security\n- 設定連線池\n\n## 快速參考\n\n### 索引速查表\n\n| 查詢模式 | 索引類型 | 範例 |\n|---------|---------|------|\n| `WHERE col = value` | B-tree（預設） | `CREATE INDEX idx ON t (col)` |\n| `WHERE col > value` | B-tree | `CREATE INDEX idx ON t (col)` |\n| `WHERE a = x AND b > y` | 複合 | `CREATE INDEX idx ON t (a, b)` |\n| `WHERE jsonb @> '{}'` | GIN | `CREATE INDEX idx ON t USING gin (col)` |\n| `WHERE tsv @@ query` | GIN | `CREATE INDEX idx ON t USING gin (col)` |\n| 時間序列範圍 | BRIN | `CREATE INDEX idx ON t USING brin (col)` |\n\n### 資料類型快速參考\n\n| 使用情況 | 正確類型 | 避免 |\n|---------|---------|------|\n| IDs | `bigint` | `int`、隨機 UUID |\n| 字串 | `text` | `varchar(255)` |\n| 時間戳 | `timestamptz` | `timestamp` |\n| 金額 | `numeric(10,2)` | `float` |\n| 旗標 | `boolean` | `varchar`、`int` |\n\n### 常見模式\n\n**複合索引順序：**\n```sql\n-- 等值欄位優先，然後是範圍欄位\nCREATE INDEX idx ON orders (status, created_at);\n-- 適用於：WHERE status = 'pending' AND created_at > '2024-01-01'\n```\n\n**覆蓋索引：**\n```sql\nCREATE INDEX idx ON users (email) INCLUDE (name, created_at);\n-- 避免 SELECT email, name, created_at 時的表格查詢\n```\n\n**部分索引：**\n```sql\nCREATE INDEX idx ON users (email) WHERE deleted_at IS NULL;\n-- 更小的索引，只包含活躍使用者\n```\n\n**RLS 政策（優化）：**\n```sql\nCREATE POLICY policy ON orders\n  USING ((SELECT auth.uid()) = user_id);  -- 用 SELECT 包裝！\n```\n\n**UPSERT：**\n```sql\nINSERT INTO settings (user_id, key, value)\nVALUES (123, 'theme', 'dark')\nON CONFLICT (user_id, key)\nDO UPDATE SET value = EXCLUDED.value;\n```\n\n**游標分頁：**\n```sql\nSELECT * FROM products WHERE id > $last_id ORDER BY id LIMIT 20;\n-- O(1) vs OFFSET 是 O(n)\n```\n\n**佇列處理：**\n```sql\nUPDATE jobs SET status = 'processing'\nWHERE id = (\n  SELECT id FROM jobs WHERE status = 'pending'\n  ORDER BY created_at LIMIT 1\n  FOR UPDATE SKIP LOCKED\n) RETURNING *;\n```\n\n### 反模式偵測\n\n```sql\n-- 找出未建索引的外鍵\nSELECT conrelid::regclass, a.attname\nFROM pg_constraint c\nJOIN pg_attribute a ON a.attrelid = c.conrelid AND a.attnum = ANY(c.conkey)\nWHERE c.contype = 'f'\n  AND NOT EXISTS (\n    SELECT 1 FROM pg_index i\n    WHERE i.indrelid = c.conrelid AND a.attnum = ANY(i.indkey)\n  );\n\n-- 找出慢查詢\nSELECT query, mean_exec_time, calls\nFROM pg_stat_statements\nWHERE mean_exec_time > 100\nORDER BY mean_exec_time DESC;\n\n-- 檢查表格膨脹\nSELECT relname, n_dead_tup, last_vacuum\nFROM pg_stat_user_tables\nWHERE n_dead_tup > 1000\nORDER BY n_dead_tup DESC;\n```\n\n### 設定範本\n\n```sql\n-- 連線限制（依 RAM 調整）\nALTER SYSTEM SET max_connections = 100;\nALTER SYSTEM SET work_mem = '8MB';\n\n-- 逾時\nALTER SYSTEM SET idle_in_transaction_session_timeout = '30s';\nALTER SYSTEM SET statement_timeout = '30s';\n\n-- 監控\nCREATE EXTENSION IF NOT EXISTS pg_stat_statements;\n\n-- 安全預設值\nREVOKE ALL ON SCHEMA public FROM public;\n\nSELECT pg_reload_conf();\n```\n\n## 相關\n\n- Agent：`database-reviewer` - 完整資料庫審查工作流程\n- Skill：`clickhouse-io` - ClickHouse 分析模式\n- Skill：`backend-patterns` - API 和後端模式\n\n---\n\n*基於 [Supabase Agent Skills](Supabase Agent Skills (credit: Supabase team))（MIT 授權）*\n",{"name":5,"description":7},"main","a318f48de3c5718e8ea2e9f6fae7790e8a759e85","upstream-sync\u002Fwork\u002Fecc\u002Fdocs\u002Fzh-TW\u002Fskills\u002Fpostgres-patterns",0,"https:\u002F\u002Fgithub.com\u002Foabdelmaksoud\u002FAgention","https:\u002F\u002Fgithub.com\u002Foabdelmaksoud","https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fo-abdelmaksoud\u002F","Full-Stack Engineer | AI Systems Architect | Building autonomous multi-agent systems","2026-03-08 21:23:03",{"source":8,"skillName":5,"commands":49,"prompt":59,"zipAvailable":60},[50,53,56],{"tool":51,"command":52},"npx","npx skills add oabdelmaksoud\u002FAgention --skill postgres-patterns",{"tool":54,"command":55},"bunx","bunx skills add oabdelmaksoud\u002FAgention --skill postgres-patterns",{"tool":57,"command":58},"pnpm","pnpm dlx skills add oabdelmaksoud\u002FAgention --skill postgres-patterns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Foabdelmaksoud\u002FAgention\u002Fblob\u002Fmain\u002Fupstream-sync\u002Fwork\u002Fecc\u002Fdocs\u002Fzh-TW\u002Fskills\u002Fpostgres-patterns\u002FSKILL.md",true,[],[63,82,96,118,141,160],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":34},"01M6G2QFCBNBYAJF2KTK85G9A6","visa-doc-translate","Translate visa application documents (images) to English and create a bilingual PDF with original and translation","https:\u002F\u002Fgithub.com\u002Foabdelmaksoud\u002FAgention\u002Fblob\u002Fmain\u002Fupstream-sync\u002Fwork\u002Fecc\u002Fskills\u002Fvisa-doc-translate\u002FSKILL.md",[],[70,71,72,73,74,75,76,77,78,79,80,81],"translate","doc","visa doc translate","bilingual","with","english","application","PDF","translation","documents","create","images",{"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":34},"01M6G2QB09TSK6BY4ME5X20EVQ","verification-loop","A comprehensive verification system for Claude Code sessions.","https:\u002F\u002Fgithub.com\u002Foabdelmaksoud\u002FAgention\u002Fblob\u002Fmain\u002Fupstream-sync\u002Fwork\u002Fecc\u002Fskills\u002Fverification-loop\u002FSKILL.md",[],[89,90,91,92,93,94,95],"verification","loop","verification loop","sessions","code","claude code sessions","system",{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":34},"01M6G2Q6V2F7G03VAAF27FXPJR","tdd-workflow","Use this skill when writing new features, fixing bugs, or refactoring code. Enforces test-driven development with 80%+ coverage including unit, integration, and E2E tests.","https:\u002F\u002Fgithub.com\u002Foabdelmaksoud\u002FAgention\u002Fblob\u002Fmain\u002Fupstream-sync\u002Fwork\u002Fecc\u002Fskills\u002Ftdd-workflow\u002FSKILL.md",[],[103,104,105,106,107,108,109,110,111,93,112,113,114,115,74,116,117],"workflow","tdd","tdd workflow","use","unit","coverage","refactoring","e2e","integration","development","e2e tests","tests","driven","test","writing",{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":34},"01M6G2Q359YJRWAR2PFCEQAXF3","swiftui-patterns","SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS\u002FmacOS UI best practices.","https:\u002F\u002Fgithub.com\u002Foabdelmaksoud\u002FAgention\u002Fblob\u002Fmain\u002Fupstream-sync\u002Fwork\u002Fecc\u002Fskills\u002Fswiftui-patterns\u002FSKILL.md",[],[21,125,126,127,128,129,130,24,131,132,28,133,134,135,136,137,138,139,140,74],"swiftui","swiftui patterns","architecture","macos","performance","state management","state","ui","ios","architecture patterns","Composition","performance optimization","view","management","swiftui architecture","navigation",{"skillNo":142,"name":143,"nameZh":6,"description":144,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":145,"categories":146,"keywords":147,"publishedAt":34},"01M6G2PY8B2FWZTWPZ84H83Y7C","swift-protocol-di-testing","Protocol-based dependency injection for testable Swift code — mock file system, network, and external APIs using focused protocols and Swift Testing.","https:\u002F\u002Fgithub.com\u002Foabdelmaksoud\u002FAgention\u002Fblob\u002Fmain\u002Fupstream-sync\u002Fwork\u002Fecc\u002Fskills\u002Fswift-protocol-di-testing\u002FSKILL.md",[],[148,149,150,151,93,152,153,154,155,95,156,157,158,159],"swift protocol di testing","protocol","swift","testing","protocols","file","network","injection","dependency","swift testing","dependency injection","mock",{"skillNo":161,"name":162,"nameZh":6,"description":163,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":164,"categories":165,"keywords":166,"publishedAt":34},"01M6G2PSCN2GXV9FFZDRRRWVB6","swift-concurrency-6-2","Swift 6.2 Approachable Concurrency — single-threaded by default, @concurrent for explicit background offloading, isolated conformances for main actor types.","https:\u002F\u002Fgithub.com\u002Foabdelmaksoud\u002FAgention\u002Fblob\u002Fmain\u002Fupstream-sync\u002Fwork\u002Fecc\u002Fskills\u002Fswift-concurrency-6-2\u002FSKILL.md",[],[167,168,169,150,170,39,171],"concurrency","swift concurrency","swift concurrency 6 2","default","types"]