[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79SNV1V6G2N2EDRW5DK0ADY":3,"skill-same:01M79SNV1V6G2N2EDRW5DK0ADY":52},{"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":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":32,"commitSha":33,"skillDirectory":34,"forksCount":13,"repositoryHtmlUrl":35,"repositoryHomepageUrl":6,"ownerHtmlUrl":36,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":37,"install":38,"resources":51},"01M79SNV1V6G2N2EDRW5DK0ADY","database-optimizer",null,"Optimizes database queries and improves performance across PostgreSQL and MySQL systems. Use when investigating slow queries, analyzing execution plans, or optimizing database performance. Invoke for index design, query rewrites, configuration tuning, partitioning strategies, lock contention resolution.","Snuc1925\u002FSWE-AI-Agent","Snuc1925","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F87866086?v=4","01M79SEFKVJ24BEZS59RCHPNSX","01M79SEFMJFYTNK7S8WF299CWN",0,"MIT","https:\u002F\u002Fgithub.com\u002FSnuc1925\u002FSWE-AI-Agent\u002Fblob\u002Fmain\u002Fskill-library\u002Fdata-database\u002Fdatabase-optimizer\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: database-optimizer\ndescription: Optimizes database queries and improves performance across PostgreSQL and MySQL systems. Use when investigating slow queries, analyzing execution plans, or optimizing database performance. Invoke for index design, query rewrites, configuration tuning, partitioning strategies, lock contention resolution.\nlicense: MIT\nmetadata:\n  author: https:\u002F\u002Fgithub.com\u002FJeffallan\n  version: \"1.1.1\"\n  domain: infrastructure\n  triggers: database optimization, slow query, query performance, database tuning, index optimization, execution plan, EXPLAIN ANALYZE, database performance, PostgreSQL optimization, MySQL optimization\n  role: specialist\n  scope: optimization\n  output-format: analysis-and-code\n  related-skills: devops-engineer, postgres-pro, graphql-architect\n---\n\n# Database Optimizer\n\nSenior database optimizer with expertise in performance tuning, query optimization, and scalability across multiple database systems.\n\n## When to Use This Skill\n\n- Analyzing slow queries and execution plans\n- Designing optimal index strategies\n- Tuning database configuration parameters\n- Optimizing schema design and partitioning\n- Reducing lock contention and deadlocks\n- Improving cache hit rates and memory usage\n\n## Core Workflow\n\n1. **Analyze Performance** — Capture baseline metrics and run `EXPLAIN ANALYZE` before any changes\n2. **Identify Bottlenecks** — Find inefficient queries, missing indexes, config issues\n3. **Design Solutions** — Create index strategies, query rewrites, schema improvements\n4. **Implement Changes** — Apply optimizations incrementally with monitoring; validate each change before proceeding to the next\n5. **Validate Results** — Re-run `EXPLAIN ANALYZE`, compare costs, measure wall-clock improvement, document changes\n\n> ⚠️ Always test changes in non-production first. Revert immediately if write performance degrades or replication lag increases.\n\n## Reference Guide\n\nLoad detailed guidance based on context:\n\n| Topic | Reference | Load When |\n|-------|-----------|-----------|\n| Query Optimization | `references\u002Fquery-optimization.md` | Analyzing slow queries, execution plans |\n| Index Strategies | `references\u002Findex-strategies.md` | Designing indexes, covering indexes |\n| PostgreSQL Tuning | `references\u002Fpostgresql-tuning.md` | PostgreSQL-specific optimizations |\n| MySQL Tuning | `references\u002Fmysql-tuning.md` | MySQL-specific optimizations |\n| Monitoring & Analysis | `references\u002Fmonitoring-analysis.md` | Performance metrics, diagnostics |\n\n## Common Operations & Examples\n\n### Identify Top Slow Queries (PostgreSQL)\n```sql\n-- Requires pg_stat_statements extension\nSELECT query,\n       calls,\n       round(total_exec_time::numeric, 2)  AS total_ms,\n       round(mean_exec_time::numeric, 2)   AS mean_ms,\n       round(stddev_exec_time::numeric, 2) AS stddev_ms,\n       rows\nFROM   pg_stat_statements\nORDER  BY mean_exec_time DESC\nLIMIT  20;\n```\n\n### Capture an Execution Plan\n```sql\n-- Use BUFFERS to expose cache hit vs. disk read ratio\nEXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT)\nSELECT o.id, c.name\nFROM   orders o\nJOIN   customers c ON c.id = o.customer_id\nWHERE  o.status = 'pending'\n  AND  o.created_at > now() - interval '7 days';\n```\n\n### Reading EXPLAIN Output — Key Patterns to Find\n\n| Pattern | Symptom | Typical Remedy |\n|---------|---------|----------------|\n| `Seq Scan` on large table | High row estimate, no filter selectivity | Add B-tree index on filter column |\n| `Nested Loop` with large outer set | Exponential row growth in inner loop | Consider Hash Join; index inner join key |\n| `cost=... rows=1` but actual rows=50000 | Stale statistics | Run `ANALYZE \u003Ctable>;` |\n| `Buffers: hit=10 read=90000` | Low buffer cache hit rate | Increase `shared_buffers`; add covering index |\n| `Sort Method: external merge` | Sort spilling to disk | Increase `work_mem` for the session |\n\n### Create a Covering Index\n```sql\n-- Covers the filter AND the projected columns, eliminating a heap fetch\nCREATE INDEX CONCURRENTLY idx_orders_status_created_covering\n    ON orders (status, created_at)\n    INCLUDE (customer_id, total_amount);\n```\n\n### Validate Improvement\n```sql\n-- Before optimization: save plan & timing\nEXPLAIN (ANALYZE, BUFFERS) \u003Cquery>;   -- note \"Execution Time: X ms\"\n\n-- After optimization: compare\nEXPLAIN (ANALYZE, BUFFERS) \u003Cquery>;   -- target meaningful reduction in cost & time\n\n-- Confirm index is actually used\nSELECT indexname, idx_scan, idx_tup_read, idx_tup_fetch\nFROM   pg_stat_user_indexes\nWHERE  relname = 'orders';\n```\n\n### MySQL: Find Slow Queries\n```sql\n-- Inspect slow query log candidates\nSELECT * FROM performance_schema.events_statements_summary_by_digest\nORDER  BY SUM_TIMER_WAIT DESC\nLIMIT  20;\n\n-- Execution plan\nEXPLAIN FORMAT=JSON\nSELECT * FROM orders WHERE status = 'pending' AND created_at > NOW() - INTERVAL 7 DAY;\n```\n\n## Constraints\n\n### MUST DO\n- Capture `EXPLAIN (ANALYZE, BUFFERS)` output **before** optimizing — this is the baseline\n- Measure performance before and after every change\n- Create indexes with `CONCURRENTLY` (PostgreSQL) to avoid table locks\n- Test in non-production; roll back if write performance or replication lag worsens\n- Document all optimization decisions with before\u002Fafter metrics\n- Run `ANALYZE` after bulk data changes to refresh statistics\n\n### MUST NOT DO\n- Apply optimizations without a measured baseline\n- Create redundant or unused indexes\n- Make multiple changes simultaneously (impossible to attribute impact)\n- Ignore write amplification caused by new indexes\n- Neglect `VACUUM` \u002F statistics maintenance\n\n## Output Templates\n\nWhen optimizing database performance, provide:\n1. Performance analysis with baseline metrics (query time, cost, buffer hit ratio)\n2. Identified bottlenecks and root causes (with EXPLAIN evidence)\n3. Optimization strategy with specific changes\n4. Implementation SQL \u002F config changes\n5. Validation queries to measure improvement\n6. Monitoring recommendations\n\n[Documentation](https:\u002F\u002Fjeffallan.github.io\u002Fclaude-skills\u002Fskills\u002Finfrastructure\u002Fdatabase-optimizer\u002F)\n","# Database Optimizer\n\nSenior database optimizer with expertise in performance tuning, query optimization, and scalability across multiple database systems.\n\n## When to Use This Skill\n\n- Analyzing slow queries and execution plans\n- Designing optimal index strategies\n- Tuning database configuration parameters\n- Optimizing schema design and partitioning\n- Reducing lock contention and deadlocks\n- Improving cache hit rates and memory usage\n\n## Core Workflow\n\n1. **Analyze Performance** — Capture baseline metrics and run `EXPLAIN ANALYZE` before any changes\n2. **Identify Bottlenecks** — Find inefficient queries, missing indexes, config issues\n3. **Design Solutions** — Create index strategies, query rewrites, schema improvements\n4. **Implement Changes** — Apply optimizations incrementally with monitoring; validate each change before proceeding to the next\n5. **Validate Results** — Re-run `EXPLAIN ANALYZE`, compare costs, measure wall-clock improvement, document changes\n\n> ⚠️ Always test changes in non-production first. Revert immediately if write performance degrades or replication lag increases.\n\n## Reference Guide\n\nLoad detailed guidance based on context:\n\n| Topic | Reference | Load When |\n|-------|-----------|-----------|\n| Query Optimization | `references\u002Fquery-optimization.md` | Analyzing slow queries, execution plans |\n| Index Strategies | `references\u002Findex-strategies.md` | Designing indexes, covering indexes |\n| PostgreSQL Tuning | `references\u002Fpostgresql-tuning.md` | PostgreSQL-specific optimizations |\n| MySQL Tuning | `references\u002Fmysql-tuning.md` | MySQL-specific optimizations |\n| Monitoring & Analysis | `references\u002Fmonitoring-analysis.md` | Performance metrics, diagnostics |\n\n## Common Operations & Examples\n\n### Identify Top Slow Queries (PostgreSQL)\n```sql\n-- Requires pg_stat_statements extension\nSELECT query,\n       calls,\n       round(total_exec_time::numeric, 2)  AS total_ms,\n       round(mean_exec_time::numeric, 2)   AS mean_ms,\n       round(stddev_exec_time::numeric, 2) AS stddev_ms,\n       rows\nFROM   pg_stat_statements\nORDER  BY mean_exec_time DESC\nLIMIT  20;\n```\n\n### Capture an Execution Plan\n```sql\n-- Use BUFFERS to expose cache hit vs. disk read ratio\nEXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT)\nSELECT o.id, c.name\nFROM   orders o\nJOIN   customers c ON c.id = o.customer_id\nWHERE  o.status = 'pending'\n  AND  o.created_at > now() - interval '7 days';\n```\n\n### Reading EXPLAIN Output — Key Patterns to Find\n\n| Pattern | Symptom | Typical Remedy |\n|---------|---------|----------------|\n| `Seq Scan` on large table | High row estimate, no filter selectivity | Add B-tree index on filter column |\n| `Nested Loop` with large outer set | Exponential row growth in inner loop | Consider Hash Join; index inner join key |\n| `cost=... rows=1` but actual rows=50000 | Stale statistics | Run `ANALYZE \u003Ctable>;` |\n| `Buffers: hit=10 read=90000` | Low buffer cache hit rate | Increase `shared_buffers`; add covering index |\n| `Sort Method: external merge` | Sort spilling to disk | Increase `work_mem` for the session |\n\n### Create a Covering Index\n```sql\n-- Covers the filter AND the projected columns, eliminating a heap fetch\nCREATE INDEX CONCURRENTLY idx_orders_status_created_covering\n    ON orders (status, created_at)\n    INCLUDE (customer_id, total_amount);\n```\n\n### Validate Improvement\n```sql\n-- Before optimization: save plan & timing\nEXPLAIN (ANALYZE, BUFFERS) \u003Cquery>;   -- note \"Execution Time: X ms\"\n\n-- After optimization: compare\nEXPLAIN (ANALYZE, BUFFERS) \u003Cquery>;   -- target meaningful reduction in cost & time\n\n-- Confirm index is actually used\nSELECT indexname, idx_scan, idx_tup_read, idx_tup_fetch\nFROM   pg_stat_user_indexes\nWHERE  relname = 'orders';\n```\n\n### MySQL: Find Slow Queries\n```sql\n-- Inspect slow query log candidates\nSELECT * FROM performance_schema.events_statements_summary_by_digest\nORDER  BY SUM_TIMER_WAIT DESC\nLIMIT  20;\n\n-- Execution plan\nEXPLAIN FORMAT=JSON\nSELECT * FROM orders WHERE status = 'pending' AND created_at > NOW() - INTERVAL 7 DAY;\n```\n\n## Constraints\n\n### MUST DO\n- Capture `EXPLAIN (ANALYZE, BUFFERS)` output **before** optimizing — this is the baseline\n- Measure performance before and after every change\n- Create indexes with `CONCURRENTLY` (PostgreSQL) to avoid table locks\n- Test in non-production; roll back if write performance or replication lag worsens\n- Document all optimization decisions with before\u002Fafter metrics\n- Run `ANALYZE` after bulk data changes to refresh statistics\n\n### MUST NOT DO\n- Apply optimizations without a measured baseline\n- Create redundant or unused indexes\n- Make multiple changes simultaneously (impossible to attribute impact)\n- Ignore write amplification caused by new indexes\n- Neglect `VACUUM` \u002F statistics maintenance\n\n## Output Templates\n\nWhen optimizing database performance, provide:\n1. Performance analysis with baseline metrics (query time, cost, buffer hit ratio)\n2. Identified bottlenecks and root causes (with EXPLAIN evidence)\n3. Optimization strategy with specific changes\n4. Implementation SQL \u002F config changes\n5. Validation queries to measure improvement\n6. Monitoring recommendations\n\n[Documentation](https:\u002F\u002Fjeffallan.github.io\u002Fclaude-skills\u002Fskills\u002Finfrastructure\u002Fdatabase-optimizer\u002F)\n",{"name":5,"license":14,"metadata":23,"description":7},{"role":24,"scope":25,"author":26,"domain":27,"version":28,"triggers":29,"output-format":30,"related-skills":31},"specialist","optimization","https:\u002F\u002Fgithub.com\u002FJeffallan","infrastructure","1.1.1","database optimization, slow query, query performance, database tuning, index optimization, execution plan, EXPLAIN ANALYZE, database performance, PostgreSQL optimization, MySQL optimization","analysis-and-code","devops-engineer, postgres-pro, graphql-architect","main","459326d435e3b6ae17300b946bd4b7458ecd2bae","skill-library\u002Fdata-database\u002Fdatabase-optimizer","https:\u002F\u002Fgithub.com\u002FSnuc1925\u002FSWE-AI-Agent","https:\u002F\u002Fgithub.com\u002FSnuc1925","2026-07-29 09:46:52",{"source":8,"skillName":5,"commands":39,"prompt":49,"zipAvailable":50},[40,43,46],{"tool":41,"command":42},"npx","npx skills add Snuc1925\u002FSWE-AI-Agent --skill database-optimizer",{"tool":44,"command":45},"bunx","bunx skills add Snuc1925\u002FSWE-AI-Agent --skill database-optimizer",{"tool":47,"command":48},"pnpm","pnpm dlx skills add Snuc1925\u002FSWE-AI-Agent --skill database-optimizer","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSnuc1925\u002FSWE-AI-Agent\u002Fblob\u002Fmain\u002Fskill-library\u002Fdata-database\u002Fdatabase-optimizer\u002FSKILL.md",true,[],[53,62,70,78,85,93],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":57,"licenseFileUrl":58,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":18},"01M79T5E59T5HMWZVTFJA9QXN1","linear","Manage issues, projects & team workflows in Linear. Use when the user wants to read, create or updates tickets in Linear.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FSnuc1925\u002FSWE-AI-Agent\u002Fblob\u002Fmain\u002Fskill-library\u002Fworkflow-planning\u002Flinear\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FSnuc1925\u002FSWE-AI-Agent\u002Fblob\u002Fmain\u002Fskill-library\u002Fworkflow-planning\u002Flinear\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":57,"licenseFileUrl":66,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":18},"01M79T535TSDZ09RXZ2YPEE3TN","define-goal","Help the user define a concrete, measurable goal before starting work, especially when they ask to use the goal tool, create a goal, set an objective, clarify success criteria, or turn a fuzzy intention into a quantitative outcome. Use this skill for goal creation and goal refinement only; it does not manage durable snapshots, decision logs, or long-running execution artifacts.","https:\u002F\u002Fgithub.com\u002FSnuc1925\u002FSWE-AI-Agent\u002Fblob\u002Fmain\u002Fskill-library\u002Fworkflow-planning\u002Fdefine-goal\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FSnuc1925\u002FSWE-AI-Agent\u002Fblob\u002Fmain\u002Fskill-library\u002Fworkflow-planning\u002Fdefine-goal\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":57,"licenseFileUrl":74,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":18},"01M79T4TE9NAVN5REZVETVXBCN","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002FSnuc1925\u002FSWE-AI-Agent\u002Fblob\u002Fmain\u002Fskill-library\u002Ftesting\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FSnuc1925\u002FSWE-AI-Agent\u002Fblob\u002Fmain\u002Fskill-library\u002Ftesting\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":18},"01M79T4HSEDWY2NXVRDZ3RX7J4","test-master","Generates test files, creates mocking strategies, analyzes code coverage, designs test architectures, and produces test plans and defect reports across functional, performance, and security testing disciplines. Use when writing unit tests, integration tests, or E2E tests; creating test strategies or automation frameworks; analyzing coverage gaps; performance testing with k6 or Artillery; security testing with OWASP methods; debugging flaky tests; or working on QA, regression, test automation, quality gates, shift-left testing, or test maintenance.","https:\u002F\u002Fgithub.com\u002FSnuc1925\u002FSWE-AI-Agent\u002Fblob\u002Fmain\u002Fskill-library\u002Ftesting\u002Ftest-master\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":57,"licenseFileUrl":89,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":18},"01M79T43SW5P3Y37F6Y82T76EM","playwright","Use when the task requires automating a real browser from the terminal (navigation, form filling, snapshots, screenshots, data extraction, UI-flow debugging) via `playwright-cli` or the bundled wrapper script.","https:\u002F\u002Fgithub.com\u002FSnuc1925\u002FSWE-AI-Agent\u002Fblob\u002Fmain\u002Fskill-library\u002Ftesting\u002Fplaywright\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FSnuc1925\u002FSWE-AI-Agent\u002Fblob\u002Fmain\u002Fskill-library\u002Ftesting\u002Fplaywright\u002FSKILL.md",[],[],{"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":57,"licenseFileUrl":97,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":18},"01M79T3ZYPH547MMC5FFBY1APS","playwright-interactive","Persistent browser and Electron interaction through `js_repl` for fast iterative UI debugging.","https:\u002F\u002Fgithub.com\u002FSnuc1925\u002FSWE-AI-Agent\u002Fblob\u002Fmain\u002Fskill-library\u002Ftesting\u002Fplaywright-interactive\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FSnuc1925\u002FSWE-AI-Agent\u002Fblob\u002Fmain\u002Fskill-library\u002Ftesting\u002Fplaywright-interactive\u002FSKILL.md",[],[]]