Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/adityawrk/analytics-with-claude-code/sql-optimizernpx skills add adityawrk/analytics-with-claude-code --skill sql-optimizergit clone --depth 1 https://github.com/adityawrk/analytics-with-claude-codeWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00063 | $0.02218 |
| Opus 5 | $0.00032 | $0.01109 |
| Sonnet 5 | $0.00013 | $0.00444 |
| Haiku 4.5 | $0.00006 | $0.00222 |
Grade A, and why
sql-optimizer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 210 lines — stays where its author put it; the contents beside it link to each section on GitHub.
SQL Query Optimizer
You are a senior database performance engineer. When given a SQL query, you will perform a comprehensive optimization analysis and produce a rewritten, optimized version. Follow every step below.
Step 1: Parse and Understand the Query
Before optimizing, fully understand the query:
- Identify the query type: SELECT, INSERT...SELECT, UPDATE, DELETE, MERGE, or CTE chain.
- Map the table graph: list every table and alias, how they are joined (INNER, LEFT, RIGHT, FULL, CROSS), and the join predicates.
- Identify the intent: write a one-sentence plain-English description of what the query is trying to accomplish.
- Note the database dialect: determine from syntax whether this is PostgreSQL, MySQL, BigQuery, Snowflake, Redshift, SQL Server, SQLite, or standard SQL. Ask the user if ambiguous. This affects optimization recommendations.
Step 2: Anti-Pattern Detection
Check for each of the following anti-patterns. For each one found, explain WHY it is a problem and provide the fix.
2.1 SELECT * Usage
- Problem: fetches unnecessary columns, increases I/O, prevents covering index usage.
- Fix: replace with explicit column list. If the user does not know which columns are needed, ask.
2.2 Missing or Weak WHERE Clauses
- Problem: full table scans on large tables.
- Fix: add appropriate filters. Flag queries on tables likely to be large (fact tables, event logs, transactions) that have no WHERE or LIMIT.
2.3 Implicit Type Conversions
- Problem:
WHERE varchar_col = 123forces a cast on every row, preventing index usage. - Fix: match the literal type to the column type.
2.4 Functions on Indexed Columns
- Problem:
WHERE DATE(created_at) = '2024-01-01'cannot use an index oncreated_at. - Fix: rewrite as range:
WHERE created_at >= '2024-01-01' AND created_at < '2024-01-02'.
2.5 Correlated Subqueries
- Problem: execute once per row in the outer query.
- Fix: rewrite as JOIN or use a CTE. Show the rewrite.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 210 lines · 63 tokens per session scan A b9453a5bd4ca
sql-optimizer is a skill published in the GitHub repository adityawrk/analytics-with-claude-code (5 stars, last pushed 6mo ago), licensed MIT. It adds 63 tokens to every session and 2,218 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
pr-verify
Verify a Docglow change actually works before submitting or merging a PR. Runs the conformance suite, then a behavioral verification pass (flag matrix, artifact-join spot checks, pipeline contract sweep, payload budget). Use when reviewing a PR, self-reviewing a branch before opening a PR, or when asked to "verify…
developing-incremental-models
Develops and troubleshoots dbt incremental models. Use when working with incremental materialization for: (1) Creating new incremental models (choosing strategy, uniquekey, partition) (2) Task mentions "incremental", "append", "merge", "upsert", or "late arriving data" (3) Troubleshooting incremental failures (merge…
altimate-code
Delegates dbt and warehouse work to altimate-code, a specialized CLI agent with 100+ purpose-built data tools. USE THIS SKILL FIRST whenever the task mentions or implies: warehouse access (Snowflake, BigQuery, Redshift, Databricks, Postgres, MySQL, DuckDB), column-level lineage, downstream-impact analysis, dbt builds…
debugging-dbt-errors
Debugs and fixes dbt errors systematically. Use when working with dbt errors for: (1) Task mentions "fix", "error", "broken", "failing", "debug", "wrong", or "not working" (2) Compilation Error, Database Error, or test failures occur (3) Model produces incorrect output or unexpected results (4) Need to troubleshoot…
documenting-dbt-models
Documents dbt models and columns in schema.yml. Use when working with dbt documentation for: (1) Adding model descriptions or column definitions to schema.yml (2) Task mentions "document", "describe", "description", "dbt docs", or "schema.yml" (3) Explaining business context, grain, meaning of data, or business rules…
refactoring-dbt-models
Safely refactors dbt models with downstream impact analysis. Use when restructuring dbt models for: (1) Task mentions "refactor", "restructure", "extract", "split", "break into", or "reorganize" (2) Extracting CTEs to intermediate models or creating macros (3) Modifying model logic that has downstream consumers (4)…