SQL and dbt Analytics
Writes analytical SQL and dbt models tested for grain and join errors, so the numbers come out right.
Claude's review
7/10 Specific analytical SQL and dbt guidance: grain tests, window pitfalls, unit tests, incremental models.
We asked Claude the question you would ask: would I be glad I installed this? Two separate reviews, the second blind to the first, must both rate a skill 7 or higher before we sell it.
In detail
Use when writing or changing analytical SQL or a dbt model — CTE structure, window functions, grain and join correctness, dbt data tests, unit tests, contracts and incremental models, and how to run them
How you use it
- Add it to your pack, then download your pack (1 credit).
- In Claude, open Customize > Skills and upload the zip. Code execution needs to be on under Settings > Capabilities.
- Ask Claude for the job in your own words. It uses the skill when your request matches what it does. Step by step guide
Safety check
Nothing risky found: no hidden instructions, no download and run, no reading of saved passwords or keys.
An automated scan lowers risk but cannot promise zero risk. How we check skills
Preview
The first lines of SKILL.md
---
name: sql-analytics-and-dbt
category: sql
description: Use when writing or changing analytical SQL or a dbt model — CTE structure, window functions, grain and join correctness, dbt data tests, unit tests, contracts and incremental models, and how to run them
tech_stack: SQL & dbt
source: original; informed by the dbt documentation (data tests, unit tests, model contracts, incremental models, node selection) — cited, not reproduced
---
# SQL Analytics and dbt
## Overview
Analytical SQL fails quietly: a join that fans out, a NULL that drops rows from a `NOT IN`, a running total over the wrong frame. The query runs, the dashboard shows a number, the number is wrong. dbt gives you the tools to make SQL testable — use them the way you use pytest.
**Core principle:** every model declares its grain and tests it; logic is proven with a dbt unit test before it is trusted with a real table.
## 1. Detect the project's conventions
Read `dbt_project.yml`, `packages.yml` (is `dbt_utils` installed?), the adapter in `profiles.yml` or CI (Postgres, Snowflake, BigQuery, Databricks, DuckDB), any `.sqlfluff` config, and the existing folder and naming scheme (`staging/stg_<source>__<entity>`, `intermediate/`, `marts/fct_*`, `dim_*`). Follow them. SQLMesh projects follow SQLMesh's own model and audit conventions — never mix the two.
## 2. Model structure
```sql
with
orders as (
select * from {{ ref('stg_shop__orders') }}
),
order_lines as (
select * from {{ ref('stg_shop__order_lines') }}
),
line_totals as (
select
order_id,
sum(amount) as order_value,
count(*) as line_count
from order_lines
where status != 'cancelled'
group by order_id
...From makifbaysal's repository, Apache-2.0 licence.
Related skills
-
Checked
dbt platform migration
Moves a dbt project from one warehouse to another and fixes SQL dialect gaps, so your models build again.
7/101 credit -
Checked
CSV and Excel merging
Merges, stacks and dedupes CSV and Excel files into one clean table, then checks the row counts add up.
7/101 credit -
Checked
BigQuery migration checks
Validates that tables moved to BigQuery match their source on schema, aggregates and rows, so nothing is lost.
7/101 credit -
Checked
dbt Mesh contracts
Checks whether a dbt model change breaks consumers and versions it, so downstream dashboards keep working.
7/101 credit -
Checked
D3 Animated Data Charts
Turns sourced data into honest, accessible animated D3 charts that render reliably frame by frame for video.
7/101 credit -
Checked
Graph Analytics in Snowflake
Runs Neo4j graph algorithms like PageRank and Louvain on your Snowflake tables without moving data.
7/101 credit