[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6DRJC7HV1PX95VYXZ2X6CQJ":3,"skill-same:01M6DRJC7HV1PX95VYXZ2X6CQJ":110},{"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":33,"publishedAt":54,"linkOnly":55,"markdownContent":56,"markdownBody":57,"frontMatter":58,"refName":67,"commitSha":68,"skillDirectory":69,"forksCount":70,"repositoryHtmlUrl":71,"repositoryHomepageUrl":6,"ownerHtmlUrl":72,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":73,"install":74,"resources":87},"01M6DRJC7HV1PX95VYXZ2X6CQJ","sql-pro",null,"Optimizes SQL queries, designs database schemas, and troubleshoots performance issues. Use when a user asks why their query is slow, needs help writing complex joins or aggregations, mentions database performance issues, or wants to design or migrate a schema. Invoke for complex queries, window functions, CTEs, indexing strategies, query plan analysis, covering index creation, recursive queries, EXPLAIN\u002FANALYZE interpretation, before\u002Fafter query benchmarking, or migrating queries between database dialects (PostgreSQL, MySQL, SQL Server, Oracle).","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\u002Fsql-pro\u002FSKILL.md",[17,22,25,30],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000010","后端与接口","SCENARIO","使用场景",{"categoryNo":23,"categoryName":24,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000015","视觉设计",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01JBSEEDCAT000000000000032","设计师","PROFESSION","适用职业",{"categoryNo":31,"categoryName":32,"taxonomyType":28,"taxonomyTypeDesc":29},"01JBSEEDCAT000000000000033","数据分析师",[34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53],"sql","sql pro","postgresql","creation","strategies","query","engineer","analyze","migrate","analysis","server","design","mysql","database","issues","code","interpretation","performance","oracle","writing","2026-11-10 10:12:30",false,"---\nname: sql-pro\ndescription: Optimizes SQL queries, designs database schemas, and troubleshoots performance issues. Use when a user asks why their query is slow, needs help writing complex joins or aggregations, mentions database performance issues, or wants to design or migrate a schema. Invoke for complex queries, window functions, CTEs, indexing strategies, query plan analysis, covering index creation, recursive queries, EXPLAIN\u002FANALYZE interpretation, before\u002Fafter query benchmarking, or migrating queries between database dialects (PostgreSQL, MySQL, SQL Server, Oracle).\nlicense: MIT\nmetadata:\n  author: https:\u002F\u002Fgithub.com\u002FJeffallan\n  version: \"1.1.0\"\n  domain: language\n  triggers: SQL optimization, query performance, database design, PostgreSQL, MySQL, SQL Server, window functions, CTEs, query tuning, EXPLAIN plan, database indexing\n  role: specialist\n  scope: implementation\n  output-format: code\n  related-skills: devops-engineer\n---\n\n# SQL Pro\n\n## Core Workflow\n\n1. **Schema Analysis** - Review database structure, indexes, query patterns, performance bottlenecks\n2. **Design** - Create set-based operations using CTEs, window functions, appropriate joins\n3. **Optimize** - Analyze execution plans, implement covering indexes, eliminate table scans\n4. **Verify** - Run `EXPLAIN ANALYZE` and confirm no sequential scans on large tables; if query does not meet sub-100ms target, iterate on index selection or query rewrite before proceeding\n5. **Document** - Provide query explanations, index rationale, performance metrics\n\n## Reference Guide\n\nLoad detailed guidance based on context:\n\n| Topic | Reference | Load When |\n|-------|-----------|-----------|\n| Query Patterns | `references\u002Fquery-patterns.md` | JOINs, CTEs, subqueries, recursive queries |\n| Window Functions | `references\u002Fwindow-functions.md` | ROW_NUMBER, RANK, LAG\u002FLEAD, analytics |\n| Optimization | `references\u002Foptimization.md` | EXPLAIN plans, indexes, statistics, tuning |\n| Database Design | `references\u002Fdatabase-design.md` | Normalization, keys, constraints, schemas |\n| Dialect Differences | `references\u002Fdialect-differences.md` | PostgreSQL vs MySQL vs SQL Server specifics |\n\n## Quick-Reference Examples\n\n### CTE Pattern\n```sql\n-- Isolate expensive subquery logic for reuse and readability\nWITH ranked_orders AS (\n    SELECT\n        customer_id,\n        order_id,\n        total_amount,\n        ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY order_date DESC) AS rn\n    FROM orders\n    WHERE status = 'completed'          -- filter early, before the join\n)\nSELECT customer_id, order_id, total_amount\nFROM ranked_orders\nWHERE rn = 1;                           -- latest completed order per customer\n```\n\n### Window Function Pattern\n```sql\n-- Running total and rank within partition — no self-join required\nSELECT\n    department_id,\n    employee_id,\n    salary,\n    SUM(salary)  OVER (PARTITION BY department_id ORDER BY hire_date) AS running_payroll,\n    RANK()       OVER (PARTITION BY department_id ORDER BY salary DESC) AS salary_rank\nFROM employees;\n```\n\n### EXPLAIN ANALYZE Interpretation\n```sql\n-- PostgreSQL: always use ANALYZE to see actual row counts vs. estimates\nEXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT)\nSELECT *\nFROM orders o\nJOIN customers c ON c.id = o.customer_id\nWHERE o.created_at > NOW() - INTERVAL '30 days';\n```\nKey things to check in the output:\n- **Seq Scan on large table** → add or fix an index\n- **actual rows ≫ estimated rows** → run `ANALYZE \u003Ctable>` to refresh statistics\n- **Buffers: shared hit** vs **read** → high `read` count signals missing cache \u002F index\n\n### Before \u002F After Optimization Example\n```sql\n-- BEFORE: correlated subquery, one execution per row (slow)\nSELECT order_id,\n       (SELECT SUM(quantity) FROM order_items oi WHERE oi.order_id = o.id) AS item_count\nFROM orders o;\n\n-- AFTER: single aggregation join (fast)\nSELECT o.order_id, COALESCE(agg.item_count, 0) AS item_count\nFROM orders o\nLEFT JOIN (\n    SELECT order_id, SUM(quantity) AS item_count\n    FROM order_items\n    GROUP BY order_id\n) agg ON agg.order_id = o.id;\n\n-- Supporting covering index (includes all columns touched by the query)\nCREATE INDEX idx_order_items_order_qty\n    ON order_items (order_id)\n    INCLUDE (quantity);\n```\n\n## Constraints\n\n### MUST DO\n- Analyze execution plans before recommending optimizations\n- Use set-based operations over row-by-row processing\n- Apply filtering early in query execution (before joins where possible)\n- Use EXISTS over COUNT for existence checks\n- Handle NULLs explicitly in comparisons and aggregations\n- Create covering indexes for frequent queries\n- Test with production-scale data volumes\n\n### MUST NOT DO\n- Use SELECT * in production queries\n- Use cursors when set-based operations work\n- Ignore platform-specific optimizations when targeting a specific dialect\n- Implement solutions without considering data volume and cardinality\n\n## Output Templates\n\nWhen implementing SQL solutions, provide:\n1. Optimized query with inline comments\n2. Required indexes with rationale\n3. Execution plan analysis\n4. Performance metrics (before\u002Fafter)\n5. Platform-specific notes if applicable\n","# SQL Pro\n\n## Core Workflow\n\n1. **Schema Analysis** - Review database structure, indexes, query patterns, performance bottlenecks\n2. **Design** - Create set-based operations using CTEs, window functions, appropriate joins\n3. **Optimize** - Analyze execution plans, implement covering indexes, eliminate table scans\n4. **Verify** - Run `EXPLAIN ANALYZE` and confirm no sequential scans on large tables; if query does not meet sub-100ms target, iterate on index selection or query rewrite before proceeding\n5. **Document** - Provide query explanations, index rationale, performance metrics\n\n## Reference Guide\n\nLoad detailed guidance based on context:\n\n| Topic | Reference | Load When |\n|-------|-----------|-----------|\n| Query Patterns | `references\u002Fquery-patterns.md` | JOINs, CTEs, subqueries, recursive queries |\n| Window Functions | `references\u002Fwindow-functions.md` | ROW_NUMBER, RANK, LAG\u002FLEAD, analytics |\n| Optimization | `references\u002Foptimization.md` | EXPLAIN plans, indexes, statistics, tuning |\n| Database Design | `references\u002Fdatabase-design.md` | Normalization, keys, constraints, schemas |\n| Dialect Differences | `references\u002Fdialect-differences.md` | PostgreSQL vs MySQL vs SQL Server specifics |\n\n## Quick-Reference Examples\n\n### CTE Pattern\n```sql\n-- Isolate expensive subquery logic for reuse and readability\nWITH ranked_orders AS (\n    SELECT\n        customer_id,\n        order_id,\n        total_amount,\n        ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY order_date DESC) AS rn\n    FROM orders\n    WHERE status = 'completed'          -- filter early, before the join\n)\nSELECT customer_id, order_id, total_amount\nFROM ranked_orders\nWHERE rn = 1;                           -- latest completed order per customer\n```\n\n### Window Function Pattern\n```sql\n-- Running total and rank within partition — no self-join required\nSELECT\n    department_id,\n    employee_id,\n    salary,\n    SUM(salary)  OVER (PARTITION BY department_id ORDER BY hire_date) AS running_payroll,\n    RANK()       OVER (PARTITION BY department_id ORDER BY salary DESC) AS salary_rank\nFROM employees;\n```\n\n### EXPLAIN ANALYZE Interpretation\n```sql\n-- PostgreSQL: always use ANALYZE to see actual row counts vs. estimates\nEXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT)\nSELECT *\nFROM orders o\nJOIN customers c ON c.id = o.customer_id\nWHERE o.created_at > NOW() - INTERVAL '30 days';\n```\nKey things to check in the output:\n- **Seq Scan on large table** → add or fix an index\n- **actual rows ≫ estimated rows** → run `ANALYZE \u003Ctable>` to refresh statistics\n- **Buffers: shared hit** vs **read** → high `read` count signals missing cache \u002F index\n\n### Before \u002F After Optimization Example\n```sql\n-- BEFORE: correlated subquery, one execution per row (slow)\nSELECT order_id,\n       (SELECT SUM(quantity) FROM order_items oi WHERE oi.order_id = o.id) AS item_count\nFROM orders o;\n\n-- AFTER: single aggregation join (fast)\nSELECT o.order_id, COALESCE(agg.item_count, 0) AS item_count\nFROM orders o\nLEFT JOIN (\n    SELECT order_id, SUM(quantity) AS item_count\n    FROM order_items\n    GROUP BY order_id\n) agg ON agg.order_id = o.id;\n\n-- Supporting covering index (includes all columns touched by the query)\nCREATE INDEX idx_order_items_order_qty\n    ON order_items (order_id)\n    INCLUDE (quantity);\n```\n\n## Constraints\n\n### MUST DO\n- Analyze execution plans before recommending optimizations\n- Use set-based operations over row-by-row processing\n- Apply filtering early in query execution (before joins where possible)\n- Use EXISTS over COUNT for existence checks\n- Handle NULLs explicitly in comparisons and aggregations\n- Create covering indexes for frequent queries\n- Test with production-scale data volumes\n\n### MUST NOT DO\n- Use SELECT * in production queries\n- Use cursors when set-based operations work\n- Ignore platform-specific optimizations when targeting a specific dialect\n- Implement solutions without considering data volume and cardinality\n\n## Output Templates\n\nWhen implementing SQL solutions, provide:\n1. Optimized query with inline comments\n2. Required indexes with rationale\n3. Execution plan analysis\n4. Performance metrics (before\u002Fafter)\n5. Platform-specific notes if applicable\n",{"name":5,"license":14,"metadata":59,"description":7},{"role":60,"scope":61,"author":62,"domain":63,"version":64,"triggers":65,"output-format":49,"related-skills":66},"specialist","implementation","https:\u002F\u002Fgithub.com\u002FJeffallan","language","1.1.0","SQL optimization, query performance, database design, PostgreSQL, MySQL, SQL Server, window functions, CTEs, query tuning, EXPLAIN plan, database indexing","devops-engineer","master","c73386b305dec167db7654e0e6feacb462d4f9dc","assets\u002Fskills\u002Fdev\u002Fsql-pro",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":75,"prompt":85,"zipAvailable":86},[76,79,82],{"tool":77,"command":78},"npx","npx skills add AntifragileTech\u002Fantifragile-claude-code --skill sql-pro",{"tool":80,"command":81},"bunx","bunx skills add AntifragileTech\u002Fantifragile-claude-code --skill sql-pro",{"tool":83,"command":84},"pnpm","pnpm dlx skills add AntifragileTech\u002Fantifragile-claude-code --skill sql-pro","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FAntifragileTech\u002Fantifragile-claude-code\u002Fblob\u002Fmaster\u002Fassets\u002Fskills\u002Fdev\u002Fsql-pro\u002FSKILL.md",true,[88,94,98,102,106],{"path":89,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":92,"sourceHtmlUrl":93},"references\u002Fdatabase-design.md","REFERENCE","参考文档",12540,"https:\u002F\u002Fgithub.com\u002FAntifragileTech\u002Fantifragile-claude-code\u002Fblob\u002Fmaster\u002Fassets\u002Fskills\u002Fdev\u002Fsql-pro\u002Freferences\u002Fdatabase-design.md",{"path":95,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":96,"sourceHtmlUrl":97},"references\u002Fdialect-differences.md",11951,"https:\u002F\u002Fgithub.com\u002FAntifragileTech\u002Fantifragile-claude-code\u002Fblob\u002Fmaster\u002Fassets\u002Fskills\u002Fdev\u002Fsql-pro\u002Freferences\u002Fdialect-differences.md",{"path":99,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":100,"sourceHtmlUrl":101},"references\u002Foptimization.md",10820,"https:\u002F\u002Fgithub.com\u002FAntifragileTech\u002Fantifragile-claude-code\u002Fblob\u002Fmaster\u002Fassets\u002Fskills\u002Fdev\u002Fsql-pro\u002Freferences\u002Foptimization.md",{"path":103,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":104,"sourceHtmlUrl":105},"references\u002Fquery-patterns.md",7439,"https:\u002F\u002Fgithub.com\u002FAntifragileTech\u002Fantifragile-claude-code\u002Fblob\u002Fmaster\u002Fassets\u002Fskills\u002Fdev\u002Fsql-pro\u002Freferences\u002Fquery-patterns.md",{"path":107,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":108,"sourceHtmlUrl":109},"references\u002Fwindow-functions.md",8860,"https:\u002F\u002Fgithub.com\u002FAntifragileTech\u002Fantifragile-claude-code\u002Fblob\u002Fmaster\u002Fassets\u002Fskills\u002Fdev\u002Fsql-pro\u002Freferences\u002Fwindow-functions.md",[111,132,146,161,173,186],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":126,"publishedAt":54},"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",[117,120,123],{"categoryNo":118,"categoryName":119,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":121,"categoryName":122,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":124,"categoryName":125,"taxonomyType":28,"taxonomyTypeDesc":29},"01JBSEEDCAT000000000000036","内容创作者",[127,53,128,129,130,131],"writing skills","use","editing","work","deployment",{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":140,"publishedAt":54},"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",[138,139],{"categoryNo":121,"categoryName":122,"taxonomyType":20,"taxonomyTypeDesc":21},{"categoryNo":124,"categoryName":125,"taxonomyType":28,"taxonomyTypeDesc":29},[141,142,53,143,144,128,49,145],"plans","writing plans","requirements","task","spec",{"skillNo":147,"name":148,"nameZh":6,"description":149,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":150,"categories":151,"keywords":154,"publishedAt":54},"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",[152,153],{"categoryNo":121,"categoryName":122,"taxonomyType":20,"taxonomyTypeDesc":21},{"categoryNo":124,"categoryName":125,"taxonomyType":28,"taxonomyTypeDesc":29},[155,156,157,158,159,160,53],"docs:write concisely","write","docs","read","Rules","documentation",{"skillNo":162,"name":163,"nameZh":6,"description":164,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":165,"categories":166,"keywords":167,"publishedAt":54},"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",[],[163,168,169,170,171,43,172],"why","kaizen","issue","five whys","root cause analysis",{"skillNo":174,"name":175,"nameZh":6,"description":176,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":177,"categories":178,"keywords":179,"publishedAt":54},"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",[],[180,181,182,183,49,184,185],"verification loop","verification","loop","sessions","claude code sessions","system",{"skillNo":187,"name":188,"nameZh":6,"description":189,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":190,"categories":191,"keywords":192,"publishedAt":54},"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",[],[193,181,194,130,128,195,196,197],"verification before completion","commands","evidence","claim","complete"]