[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EW0VGKCYM7ZK22PHAYCJWB":3,"skill-same:01M7EW0VGKCYM7ZK22PHAYCJWB":47},{"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":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M7EW0VGKCYM7ZK22PHAYCJWB","sql-pro",null,"Expert SQL patterns for complex queries, optimization, and cross-database portability — use when writing, tuning, or debugging SQL.","TanNhatCMS\u002Fjarvis","TanNhatCMS","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F113796420?v=4","01M753MV17KG5CD3152G3WQEQY","KietNT","01M7EKEDYVYQ6PWVJJMZ911VMX",0,"MIT","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-sql-pro\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: sql-pro\ndescription: Expert SQL patterns for complex queries, optimization, and cross-database portability — use when writing, tuning, or debugging SQL.\ncategory: database\n---\n\n## Overview\n\nSQL is the lingua franca of data work, but writing SQL that is both correct and fast\nrequires more than knowing `SELECT`. This skill covers advanced querying techniques,\nportability across dialects (PostgreSQL, MySQL, SQLite, SQL Server), and the\noptimization habits that keep queries quick as data grows.\n\n## When to use\n\n- Writing multi-table joins, subqueries, or window functions\n- Debugging a query that returns wrong results or runs slowly\n- Migrating queries between database dialects (e.g. MySQL → PostgreSQL)\n- Reviewing generated or hand-written SQL for correctness and performance\n- Building reports, aggregations, or data pipelines in SQL\n\n## Core concepts\n\n**Set thinking, not loop thinking.** SQL operates on sets of rows. Prefer set\noperations (`JOIN`, `UNION`, `GROUP BY`) over row-by-row logic. If you find yourself\n\"iterating\" mentally, look for a set-based formulation — it will be both shorter and\nfaster.\n\n**CTEs for readability.** Common table expressions (`WITH ... AS`) turn nested\nsubqueries into named, testable steps. Prefer CTEs over deeply nested subqueries,\nand prefer `EXISTS` over `IN` when testing membership against large sets.\n\n**Window functions.** `ROW_NUMBER()`, `RANK()`, `LAG()`, `LEAD()`, and running\n`SUM() OVER (...)` answer questions like \"top N per group\" or \"change from the\nprevious row\" without self-joins:\n\n```sql\nWITH ranked AS (\n  SELECT customer_id, order_date, total,\n         ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY order_date DESC) AS rn\n  FROM orders\n)\nSELECT * FROM ranked WHERE rn = 1;  -- latest order per customer\n```\n\n**Dialect portability.** String functions, date arithmetic, and quoting differ across\nengines. Stick to standard SQL (`||` or `CONCAT` sparingly, `CAST`, `EXTRACT`) where\nportable, and isolate dialect-specific code (e.g. `DATE_TRUNC` in Postgres,\n`LIMIT` vs `TOP`) behind clearly marked sections when porting.\n\n**Read the execution plan.** `EXPLAIN` \u002F `EXPLAIN ANALYZE` shows how the engine\nexecutes your query. Learn to spot full table scans, unindexed nested loops, and\nmisestimated row counts — these are where 90% of slowdowns come from.\n\n## Practical workflow\n\n1. **Restate the question in plain language** — \"per customer, their most recent\n   order\" maps directly to a window function, not a correlated subquery.\n2. **Write the smallest correct version first.** Verify results on a small sample\n   (`WHERE ... LIMIT 100`) before scaling to full tables.\n3. **Check row counts at each step.** A join that multiplies rows silently is the\n   most common source of wrong aggregates — add `COUNT(*)` probes while building.\n4. **Add filtering early.** Push `WHERE` predicates as deep as possible so the engine\n   filters before joining and aggregating.\n5. **Handle NULLs explicitly.** `NULL = NULL` is false; use `IS NULL` \u002F `COALESCE`\n   deliberately, and know that `NOT IN` with a NULL in the set returns nothing.\n6. **Run EXPLAIN** on the final query; add or reorder indexes only after seeing the\n   actual plan, not by guessing.\n7. **Test edge cases:** empty tables, ties in `ORDER BY` for `TOP 1` patterns,\n   duplicate keys in joins, and timezone-naive vs aware timestamps.\n\n**Quick index checklist:** index foreign keys, columns in `WHERE` equality filters,\nand leading columns of `ORDER BY` in paginated queries. Avoid indexing every\ncolumn — each index costs write speed and disk.\n\n## Common pitfalls\n\n- **`SELECT *` in production queries** — breaks silently when columns are added and\n  drags unnecessary data. List columns explicitly.\n- **Aggregating before deduplicating** — joining one-to-many tables before `SUM()`\n  inflates totals. Aggregate first, join after.\n- **Implicit type casts** — comparing a timestamp column to a string, or an\n  integer column to text, can silently disable index use. Match types exactly.\n- **Correlated subqueries in the SELECT list** — run once per row; rewrite as a\n  single join or window function.\n- **Non-deterministic `LIMIT 1`** without `ORDER BY` — returns an arbitrary row,\n  and different runs can differ.\n- **Forgetting transaction isolation** — long reporting queries on a live database\n  can see inconsistent snapshots; use a read replica or an explicit isolation\n  level when consistency matters.\n","## Overview\n\nSQL is the lingua franca of data work, but writing SQL that is both correct and fast\nrequires more than knowing `SELECT`. This skill covers advanced querying techniques,\nportability across dialects (PostgreSQL, MySQL, SQLite, SQL Server), and the\noptimization habits that keep queries quick as data grows.\n\n## When to use\n\n- Writing multi-table joins, subqueries, or window functions\n- Debugging a query that returns wrong results or runs slowly\n- Migrating queries between database dialects (e.g. MySQL → PostgreSQL)\n- Reviewing generated or hand-written SQL for correctness and performance\n- Building reports, aggregations, or data pipelines in SQL\n\n## Core concepts\n\n**Set thinking, not loop thinking.** SQL operates on sets of rows. Prefer set\noperations (`JOIN`, `UNION`, `GROUP BY`) over row-by-row logic. If you find yourself\n\"iterating\" mentally, look for a set-based formulation — it will be both shorter and\nfaster.\n\n**CTEs for readability.** Common table expressions (`WITH ... AS`) turn nested\nsubqueries into named, testable steps. Prefer CTEs over deeply nested subqueries,\nand prefer `EXISTS` over `IN` when testing membership against large sets.\n\n**Window functions.** `ROW_NUMBER()`, `RANK()`, `LAG()`, `LEAD()`, and running\n`SUM() OVER (...)` answer questions like \"top N per group\" or \"change from the\nprevious row\" without self-joins:\n\n```sql\nWITH ranked AS (\n  SELECT customer_id, order_date, total,\n         ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY order_date DESC) AS rn\n  FROM orders\n)\nSELECT * FROM ranked WHERE rn = 1;  -- latest order per customer\n```\n\n**Dialect portability.** String functions, date arithmetic, and quoting differ across\nengines. Stick to standard SQL (`||` or `CONCAT` sparingly, `CAST`, `EXTRACT`) where\nportable, and isolate dialect-specific code (e.g. `DATE_TRUNC` in Postgres,\n`LIMIT` vs `TOP`) behind clearly marked sections when porting.\n\n**Read the execution plan.** `EXPLAIN` \u002F `EXPLAIN ANALYZE` shows how the engine\nexecutes your query. Learn to spot full table scans, unindexed nested loops, and\nmisestimated row counts — these are where 90% of slowdowns come from.\n\n## Practical workflow\n\n1. **Restate the question in plain language** — \"per customer, their most recent\n   order\" maps directly to a window function, not a correlated subquery.\n2. **Write the smallest correct version first.** Verify results on a small sample\n   (`WHERE ... LIMIT 100`) before scaling to full tables.\n3. **Check row counts at each step.** A join that multiplies rows silently is the\n   most common source of wrong aggregates — add `COUNT(*)` probes while building.\n4. **Add filtering early.** Push `WHERE` predicates as deep as possible so the engine\n   filters before joining and aggregating.\n5. **Handle NULLs explicitly.** `NULL = NULL` is false; use `IS NULL` \u002F `COALESCE`\n   deliberately, and know that `NOT IN` with a NULL in the set returns nothing.\n6. **Run EXPLAIN** on the final query; add or reorder indexes only after seeing the\n   actual plan, not by guessing.\n7. **Test edge cases:** empty tables, ties in `ORDER BY` for `TOP 1` patterns,\n   duplicate keys in joins, and timezone-naive vs aware timestamps.\n\n**Quick index checklist:** index foreign keys, columns in `WHERE` equality filters,\nand leading columns of `ORDER BY` in paginated queries. Avoid indexing every\ncolumn — each index costs write speed and disk.\n\n## Common pitfalls\n\n- **`SELECT *` in production queries** — breaks silently when columns are added and\n  drags unnecessary data. List columns explicitly.\n- **Aggregating before deduplicating** — joining one-to-many tables before `SUM()`\n  inflates totals. Aggregate first, join after.\n- **Implicit type casts** — comparing a timestamp column to a string, or an\n  integer column to text, can silently disable index use. Match types exactly.\n- **Correlated subqueries in the SELECT list** — run once per row; rewrite as a\n  single join or window function.\n- **Non-deterministic `LIMIT 1`** without `ORDER BY` — returns an arbitrary row,\n  and different runs can differ.\n- **Forgetting transaction isolation** — long reporting queries on a live database\n  can see inconsistent snapshots; use a read replica or an explicit isolation\n  level when consistency matters.\n",{"name":5,"category":24,"description":7},"database","main","af388a77c2fe5e0b4fd879cca4300a0ffa9a6579","skills\u002Fams-sql-pro",1,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis","https:\u002F\u002Fgithub.com\u002FTanNhatCMS","https:\u002F\u002Fmrkiet.name.vn","2026-11-07 14:23:08",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add TanNhatCMS\u002Fjarvis --skill sql-pro",{"tool":39,"command":40},"bunx","bunx skills add TanNhatCMS\u002Fjarvis --skill sql-pro",{"tool":42,"command":43},"pnpm","pnpm dlx skills add TanNhatCMS\u002Fjarvis --skill sql-pro","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-sql-pro\u002FSKILL.md",true,[],[48,55,63,70,77,84],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M7EWYJR0J8DARY7E59Z6Y9MV","web-scrape","Turn web pages into LLM-ready markdown via the Firecrawl API (renders JS, anti-bot handling). Use when browser_open\u002Ffetch fails on JS-heavy pages, or when you need clean markdown\u002Fstructured extraction from a site. Requires FIRECRAWL_API_KEY.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fweb-scrape\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":59,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7EWYBN5P6F2AJG3FR24T9BP","design-taste-frontend","tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One Page Love, Awwwards Sites of the Day). Deals researched directions (idea, composition, type, palette, photographs, section blueprints) from a library, enforces a strict no-slop house style with a real-browser inspector, and runs a look-and-fix loop on screenshots. Use this whenever you build, design, redesign, restyle, polish or review a landing page, marketing site, portfolio, product page, one-pager, hero or any public-facing web page, in any stack (HTML\u002FCSS, React, Next.js, Vue, Svelte, Astro, Tailwind) — also when the user says a page looks generic, templated, \"AI-made\", sloppy, or asks to make it look designed, premium, award-level or less like every other site. Not for dashboards or app screens.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FSKILL.md",[],[],{"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":19},"01M7EWY8FQFNQ2GB7NZZWGSSDX","test-driven-development","Use when implementing any feature or bugfix, before writing implementation code","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-tdd\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7EWY5SHBFRH1HDHVWM9K7TV","systematic-debugging","Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-debugging\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7EWY3NM0Z0JAKS7HDZ24K66","requesting-code-review","Use when completing tasks, implementing major features, or before merging to verify work meets requirements","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-code-review\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7EWY0WRMWX4M9ZFY0WKC593","brainstorming","You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-brainstorming\u002FSKILL.md",[],[]]