agent-instructions
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what…
Use when writing or optimizing SQL. Covers query planning, indexing strategy, window functions, CTEs, transaction isolation, and reading EXPLAIN output. Trigger on "this query is slow", "how do i read this explain plan", "write a window function for running totals", "what
Claude Code
$ npx -y skills add nimadorostkar/Claude-Skills-collection --skill sql --agent claude-code
Codex
$ npx skills add nimadorostkar/Claude-Skills-collection --skill sql -a codex -y
Cursor
$ npx skills add nimadorostkar/Claude-Skills-collection --skill sql -a cursor -y
Gemini CLI
$ npx skills add nimadorostkar/Claude-Skills-collection --skill sql -a gemini-cli -y
GitHub Copilot
$ npx skills add nimadorostkar/Claude-Skills-collection --skill sql -a github-copilot -y
OpenCode
$ npx skills add nimadorostkar/Claude-Skills-collection --skill sql -a opencode -y
Windsurf
$ npx skills add nimadorostkar/Claude-Skills-collection --skill sql -a windsurf -y
name: sql description: Use when writing or optimizing SQL. Covers query planning, indexing strategy, window functions, CTEs, transaction isolation, and reading EXPLAIN output. Trigger on "this query is slow", "how do i read this explain plan", "write a window function for running totals", "what isolation level should i use". Do not use when the whole database is the bottleneck under load — see the database-performance skill; for Postgres-specific operations, see the postgres skill. metadata: category: languages version: 1.0.0 tags: [sql, query-optimization, indexing, explain, transactions]
Write SQL that the planner can execute efficiently, and read execution plans well enough to know why it did not.
1. **Get the plan** — `EXPLAIN (ANALYZE, BUFFERS)`. Never optimize a query you have not profiled. 2. **Find the expensive node** — Look for sequential scans on large tables, nested loops with high row counts, and estimates that diverge from actuals by an order of magnitude. 3. **Fix the cause** — Bad estimate means stale statistics. Sequential scan on a selective filter means a missing index. High row counts through a join means the filter is applied too late. 4. **Index deliberately** — Column order in a composite index is equality columns first, then the range or sort column. 5. **Re-measure** — Confirm with a fresh plan, and check that write throughput did not regress.
**Window function instead of a correlated subquery:**
-- Latest order per customer, one pass.
SELECT customer_id, order_id, placed_at, total_cents
FROM (
SELECT
o.customer_id,
o.id AS order_id,
o.placed_at,
o.total_cents,
ROW_NUMBER() OVER (
PARTITION BY o.customer_id
ORDER BY o.placed_at DESC
) AS rn
FROM orders o
WHERE o.placed_at >= now() - interval '90 days'
) ranked
WHERE rn = 1;**Index matching the access pattern:**
-- Query: WHERE tenant_id = $1 AND status = 'open' ORDER BY created_at DESC LIMIT 50 CREATE INDEX CONCURRENTLY idx_tickets_tenant_open_recent ON tickets (tenant_id, status, created_at DESC) WHERE deleted_at IS NULL;
A curated library of 137 production-grade skills for Claude and other AI coding agents. Every skill follows one structure, speaks with one voice, and earns its place by changing what the agent does.
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what…
Use when an agent needs state that survives a session or a context compaction. Covers what to persist, file-based memory,…
Use when automating agent behavior with lifecycle hooks. Covers hook events, deterministic enforcement of rules the model should…
Use when packaging skills, commands, hooks, and MCP servers into a distributable plugin. Covers manifest structure, bundling,…
Use when writing a new skill for an AI agent. Covers scoping, description writing for reliable triggering, progressive…
Use when reviewing or improving an existing agent skill. Covers triggering accuracy, content quality, redundancy with the base…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.