[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6DR96062TK54WS7AZXACBKB":3,"skill-same:01M6DR96062TK54WS7AZXACBKB":66},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":33,"linkOnly":34,"markdownContent":35,"markdownBody":36,"frontMatter":37,"refName":39,"commitSha":40,"skillDirectory":41,"forksCount":42,"repositoryHtmlUrl":43,"repositoryHomepageUrl":6,"ownerHtmlUrl":44,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":45,"install":46,"resources":59},"01M6DR96062TK54WS7AZXACBKB","postgres-patterns",null,"PostgreSQL database patterns for query optimization, schema design, indexing, and security. Based on Supabase best practices.","AntifragileTech\u002Fantifragile-claude-code","AntifragileTech","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F174357194?v=4","01M6DQCYMK4CDSQQAN0ZC72NTV","01M6DQCYS9YPW1WKMQ5TJMPQ43",9,"MIT","https:\u002F\u002Fgithub.com\u002FAntifragileTech\u002Fantifragile-claude-code\u002Fblob\u002Fmaster\u002Fassets\u002Fskills\u002Fdev\u002Fpostgres-patterns\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32],"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.\norigin: ECC\n---\n\n# PostgreSQL Patterns\n\nQuick reference for PostgreSQL best practices. For detailed guidance, use the `database-reviewer` agent.\n\n## When to Activate\n\n- Writing SQL queries or migrations\n- Designing database schemas\n- Troubleshooting slow queries\n- Implementing Row Level Security\n- Setting up connection pooling\n\n## Quick Reference\n\n### Index Cheat Sheet\n\n| Query Pattern | Index Type | Example |\n|--------------|------------|---------|\n| `WHERE col = value` | B-tree (default) | `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` | Composite | `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| Time-series ranges | BRIN | `CREATE INDEX idx ON t USING brin (col)` |\n\n### Data Type Quick Reference\n\n| Use Case | Correct Type | Avoid |\n|----------|-------------|-------|\n| IDs | `bigint` | `int`, random UUID |\n| Strings | `text` | `varchar(255)` |\n| Timestamps | `timestamptz` | `timestamp` |\n| Money | `numeric(10,2)` | `float` |\n| Flags | `boolean` | `varchar`, `int` |\n\n### Common Patterns\n\n**Composite Index Order:**\n```sql\n-- Equality columns first, then range columns\nCREATE INDEX idx ON orders (status, created_at);\n-- Works for: WHERE status = 'pending' AND created_at > '2024-01-01'\n```\n\n**Covering Index:**\n```sql\nCREATE INDEX idx ON users (email) INCLUDE (name, created_at);\n-- Avoids table lookup for SELECT email, name, created_at\n```\n\n**Partial Index:**\n```sql\nCREATE INDEX idx ON users (email) WHERE deleted_at IS NULL;\n-- Smaller index, only includes active users\n```\n\n**RLS Policy (Optimized):**\n```sql\nCREATE POLICY policy ON orders\n  USING ((SELECT auth.uid()) = user_id);  -- Wrap in 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**Cursor Pagination:**\n```sql\nSELECT * FROM products WHERE id > $last_id ORDER BY id LIMIT 20;\n-- O(1) vs OFFSET which is O(n)\n```\n\n**Queue Processing:**\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### Anti-Pattern Detection\n\n```sql\n-- Find unindexed foreign keys\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-- Find slow queries\nSELECT query, mean_exec_time, calls\nFROM pg_stat_statements\nWHERE mean_exec_time > 100\nORDER BY mean_exec_time DESC;\n\n-- Check table bloat\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### Configuration Template\n\n```sql\n-- Connection limits (adjust for RAM)\nALTER SYSTEM SET max_connections = 100;\nALTER SYSTEM SET work_mem = '8MB';\n\n-- Timeouts\nALTER SYSTEM SET idle_in_transaction_session_timeout = '30s';\nALTER SYSTEM SET statement_timeout = '30s';\n\n-- Monitoring\nCREATE EXTENSION IF NOT EXISTS pg_stat_statements;\n\n-- Security defaults\nREVOKE ALL ON SCHEMA public FROM public;\n\nSELECT pg_reload_conf();\n```\n\n## Related\n\n- Agent: `database-reviewer` - Full database review workflow\n- Skill: `clickhouse-io` - ClickHouse analytics patterns\n- Skill: `backend-patterns` - API and backend patterns\n\n---\n\n*Based on Supabase Agent Skills (credit: Supabase team) (MIT License)*\n","# PostgreSQL Patterns\n\nQuick reference for PostgreSQL best practices. For detailed guidance, use the `database-reviewer` agent.\n\n## When to Activate\n\n- Writing SQL queries or migrations\n- Designing database schemas\n- Troubleshooting slow queries\n- Implementing Row Level Security\n- Setting up connection pooling\n\n## Quick Reference\n\n### Index Cheat Sheet\n\n| Query Pattern | Index Type | Example |\n|--------------|------------|---------|\n| `WHERE col = value` | B-tree (default) | `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` | Composite | `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| Time-series ranges | BRIN | `CREATE INDEX idx ON t USING brin (col)` |\n\n### Data Type Quick Reference\n\n| Use Case | Correct Type | Avoid |\n|----------|-------------|-------|\n| IDs | `bigint` | `int`, random UUID |\n| Strings | `text` | `varchar(255)` |\n| Timestamps | `timestamptz` | `timestamp` |\n| Money | `numeric(10,2)` | `float` |\n| Flags | `boolean` | `varchar`, `int` |\n\n### Common Patterns\n\n**Composite Index Order:**\n```sql\n-- Equality columns first, then range columns\nCREATE INDEX idx ON orders (status, created_at);\n-- Works for: WHERE status = 'pending' AND created_at > '2024-01-01'\n```\n\n**Covering Index:**\n```sql\nCREATE INDEX idx ON users (email) INCLUDE (name, created_at);\n-- Avoids table lookup for SELECT email, name, created_at\n```\n\n**Partial Index:**\n```sql\nCREATE INDEX idx ON users (email) WHERE deleted_at IS NULL;\n-- Smaller index, only includes active users\n```\n\n**RLS Policy (Optimized):**\n```sql\nCREATE POLICY policy ON orders\n  USING ((SELECT auth.uid()) = user_id);  -- Wrap in 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**Cursor Pagination:**\n```sql\nSELECT * FROM products WHERE id > $last_id ORDER BY id LIMIT 20;\n-- O(1) vs OFFSET which is O(n)\n```\n\n**Queue Processing:**\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### Anti-Pattern Detection\n\n```sql\n-- Find unindexed foreign keys\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-- Find slow queries\nSELECT query, mean_exec_time, calls\nFROM pg_stat_statements\nWHERE mean_exec_time > 100\nORDER BY mean_exec_time DESC;\n\n-- Check table bloat\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### Configuration Template\n\n```sql\n-- Connection limits (adjust for RAM)\nALTER SYSTEM SET max_connections = 100;\nALTER SYSTEM SET work_mem = '8MB';\n\n-- Timeouts\nALTER SYSTEM SET idle_in_transaction_session_timeout = '30s';\nALTER SYSTEM SET statement_timeout = '30s';\n\n-- Monitoring\nCREATE EXTENSION IF NOT EXISTS pg_stat_statements;\n\n-- Security defaults\nREVOKE ALL ON SCHEMA public FROM public;\n\nSELECT pg_reload_conf();\n```\n\n## Related\n\n- Agent: `database-reviewer` - Full database review workflow\n- Skill: `clickhouse-io` - ClickHouse analytics patterns\n- Skill: `backend-patterns` - API and backend patterns\n\n---\n\n*Based on Supabase Agent Skills (credit: Supabase team) (MIT License)*\n",{"name":5,"origin":38,"description":7},"ECC","master","c73386b305dec167db7654e0e6feacb462d4f9dc","assets\u002Fskills\u002Fdev\u002Fpostgres-patterns",1,"https:\u002F\u002Fgithub.com\u002FAntifragileTech\u002Fantifragile-claude-code","https:\u002F\u002Fgithub.com\u002FAntifragileTech","2026-10-02 14:22:14",{"source":8,"skillName":5,"commands":47,"prompt":57,"zipAvailable":58},[48,51,54],{"tool":49,"command":50},"npx","npx skills add AntifragileTech\u002Fantifragile-claude-code --skill postgres-patterns",{"tool":52,"command":53},"bunx","bunx skills add AntifragileTech\u002Fantifragile-claude-code --skill postgres-patterns",{"tool":55,"command":56},"pnpm","pnpm dlx skills add AntifragileTech\u002Fantifragile-claude-code --skill postgres-patterns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FAntifragileTech\u002Fantifragile-claude-code\u002Fblob\u002Fmaster\u002Fassets\u002Fskills\u002Fdev\u002Fpostgres-patterns\u002FSKILL.md",true,[60],{"path":61,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":64,"sourceHtmlUrl":65},"metadata.json","REFERENCE","参考文档",171,"https:\u002F\u002Fgithub.com\u002FHuuBar\u002Fskill-routing-experiment\u002Fblob\u002Fmain\u002Fdaymade\u002Fi18n-expert\u002Fmetadata.json",[67,93,108,123,136,149],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":86,"publishedAt":33},"01M6DT9Q6VYA615SCXR757TZZ7","writing-skills","Use when creating new skills, editing existing skills, or verifying skills work before deployment","https:\u002F\u002Fgithub.com\u002FAntifragileTech\u002Fantifragile-claude-code\u002Fblob\u002Fmaster\u002Fassets\u002Fskills\u002Fthinking\u002Fwriting-skills\u002FSKILL.md",[73,78,81],{"categoryNo":74,"categoryName":75,"taxonomyType":76,"taxonomyTypeDesc":77},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",{"categoryNo":79,"categoryName":80,"taxonomyType":76,"taxonomyTypeDesc":77},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":82,"categoryName":83,"taxonomyType":84,"taxonomyTypeDesc":85},"01JBSEEDCAT000000000000036","内容创作者","PROFESSION","适用职业",[87,88,89,90,91,92],"writing skills","writing","use","editing","work","deployment",{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":101,"publishedAt":33},"01M6DT9GFHDNY90P41WGAE1TV0","writing-plans","Use when you have a spec or requirements for a multi-step task, before touching code","https:\u002F\u002Fgithub.com\u002FAntifragileTech\u002Fantifragile-claude-code\u002Fblob\u002Fmaster\u002Fassets\u002Fskills\u002Fthinking\u002Fwriting-plans\u002FSKILL.md",[99,100],{"categoryNo":79,"categoryName":80,"taxonomyType":76,"taxonomyTypeDesc":77},{"categoryNo":82,"categoryName":83,"taxonomyType":84,"taxonomyTypeDesc":85},[102,103,88,104,105,89,106,107],"plans","writing plans","requirements","task","code","spec",{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":116,"publishedAt":33},"01M6DT9C6PFGD86WS3HY7YE3XG","docs:write-concisely","Apply writing rules to any documentation that humans will read. Makes your writing clearer, stronger, and more professional.","https:\u002F\u002Fgithub.com\u002FAntifragileTech\u002Fantifragile-claude-code\u002Fblob\u002Fmaster\u002Fassets\u002Fskills\u002Fthinking\u002Fwrite-concisely\u002FSKILL.md",[114,115],{"categoryNo":79,"categoryName":80,"taxonomyType":76,"taxonomyTypeDesc":77},{"categoryNo":82,"categoryName":83,"taxonomyType":84,"taxonomyTypeDesc":85},[117,118,119,120,121,122,88],"docs:write concisely","write","docs","read","Rules","documentation",{"skillNo":124,"name":125,"nameZh":6,"description":126,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":33},"01M6DT98AWQ27P0N1CG97WAG66","kaizen:why","Iterative Five Whys root cause analysis drilling from symptoms to fundamentals","https:\u002F\u002Fgithub.com\u002FAntifragileTech\u002Fantifragile-claude-code\u002Fblob\u002Fmaster\u002Fassets\u002Fskills\u002Fthinking\u002Fwhy\u002FSKILL.md",[],[125,130,131,132,133,134,135],"why","kaizen","issue","five whys","analysis","root cause analysis",{"skillNo":137,"name":138,"nameZh":6,"description":139,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":140,"categories":141,"keywords":142,"publishedAt":33},"01M6DT93EH25NAX19R3WGE1P53","verification-loop","A comprehensive verification system for Claude Code sessions.","https:\u002F\u002Fgithub.com\u002FAntifragileTech\u002Fantifragile-claude-code\u002Fblob\u002Fmaster\u002Fassets\u002Fskills\u002Fthinking\u002Fverification-loop\u002FSKILL.md",[],[143,144,145,146,106,147,148],"verification loop","verification","loop","sessions","claude code sessions","system",{"skillNo":150,"name":151,"nameZh":6,"description":152,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":153,"categories":154,"keywords":155,"publishedAt":33},"01M6DT90GW7Z7VCN98P9DVYSNC","verification-before-completion","Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always","https:\u002F\u002Fgithub.com\u002FAntifragileTech\u002Fantifragile-claude-code\u002Fblob\u002Fmaster\u002Fassets\u002Fskills\u002Fthinking\u002Fverification-before-completion\u002FSKILL.md",[],[156,144,157,91,89,158,159,160],"verification before completion","commands","evidence","claim","complete"]