Loading...
Loading...
Claude Code skills for analytics and data engineers working with dbt, Snowflake, and data pipelines
npx skill4agent add aradotso/data-skills altimate-data-engineering-skillsSkill by ara.so — Data Skills collection.
# Add the marketplace plugin
/plugin marketplace add AltimateAI/data-engineering-skills
# Install all skills
/plugin install dbt-skills@data-engineering-skills
/plugin install snowflake-skills@data-engineering-skills
/plugin install altimate-code@data-engineering-skills# Install altimate-code CLI (required for kits)
npm install -g altimate-code
# Install kit system
altimate-code kit install AltimateAI/data-engineering-skills
# Activate the dbt-snowflake kit
altimate-code kit activate dbt-snowflake
# Check status
altimate-code kit statusgit clone https://github.com/AltimateAI/data-engineering-skills.git
cd data-engineering-skillsdbt builddbt showaltimate-code run --yolonpm install -g altimate-code---
name: creating-dbt-models
description: |
Guide for creating dbt models. ALWAYS use this skill when:
(1) Creating ANY new model (staging, intermediate, mart)
(2) Task mentions "create", "build", "add" with model/table
(3) Modifying model logic or columns
---# dbt Model Development
**Read before you write. Build after you write. Verify your output.**
## Critical Rules
1. ALWAYS run `dbt build` after creating models - compile is NOT enough
2. ALWAYS verify output after build using `dbt show`
3. If build fails 3+ times, stop and reassess your approach
## Workflow
1. Discover Conventions
- Check existing models in same layer (staging/intermediate/mart)
- Note naming patterns, CTE style, column ordering
2. Write Model
- Follow discovered patterns
- Use proper refs and sources
3. Build and Verify
```bash
dbt build --select model_name
dbt show --select model_name --limit 10
## Usage Examples
### Creating a dbt Model
```yaml
# User request:
"Create a staging model for raw customers data"
# Skill triggers: creating-dbt-models
# AI workflow:
# 1. Checks models/staging/ for naming patterns
# 2. Creates models/staging/stg_customers.sql
# 3. Runs: dbt build --select stg_customers
# 4. Verifies: dbt show --select stg_customers-- models/staging/stg_customers.sql
with source as (
select * from {{ source('jaffle_shop', 'customers') }}
),
renamed as (
select
id as customer_id,
first_name,
last_name,
email,
created_at
from source
)
select * from renamed# User request:
"Fix this error: Compilation Error in model customers (models/customers.sql)"
# Skill triggers: debugging-dbt-errors
# AI workflow:
# 1. Reads full error message
# 2. Checks upstream model dependencies
# 3. Identifies issue (e.g., missing ref)
# 4. Applies fix
# 5. Rebuilds: dbt build --select customers# User request:
"This query is taking 5 minutes, can you optimize it?"
# Skill triggers: optimizing-query-text
# AI workflow:
# 1. Profiles query (EXPLAIN, execution stats)
# 2. Identifies bottlenecks (table scans, inefficient joins)
# 3. Applies optimizations (clustering, filters, join order)
# 4. Tests and measures improvement-- Before (slow)
SELECT
o.order_id,
c.customer_name,
SUM(oi.amount) as total
FROM orders o
JOIN customers c ON o.customer_id = c.customer_id
JOIN order_items oi ON o.order_id = oi.order_id
WHERE o.order_date >= '2024-01-01'
GROUP BY 1, 2;
-- After (optimized)
SELECT
o.order_id,
c.customer_name,
SUM(oi.amount) as total
FROM orders o
INNER JOIN order_items oi ON o.order_id = oi.order_id
LEFT JOIN customers c ON o.customer_id = c.customer_id
WHERE o.order_date >= '2024-01-01'
AND o.order_date < '2024-12-31' -- Added upper bound for partition pruning
GROUP BY 1, 2;
-- Assumes orders table is clustered by order_date# Activate dbt-snowflake kit for a project
cd /path/to/dbt-project
altimate-code kit activate dbt-snowflake
# This configures:
# - All dbt and Snowflake skills
# - MCP server for dbt (live project access)
# - Project-specific instructions
# Deactivate when done
altimate-code kit deactivate.altimate/kits/active.yamlkit: dbt-snowflake
version: 1.0.0
skills:
- creating-dbt-models
- debugging-dbt-errors
- testing-dbt-models
- documenting-dbt-models
- migrating-sql-to-dbt
- refactoring-dbt-models
- developing-incremental-models
- finding-expensive-queries
- optimizing-query-by-id
- optimizing-query-text
mcp_servers:
- dbt
instructions: |
You are working on a dbt + Snowflake project.
Always check project conventions before creating models.
Run dbt build (not compile) after creating models.// claude_desktop_config.json or similar
{
"mcpServers": {
"altimate-dbt": {
"command": "npx",
"args": ["-y", "@altimate/mcp-server-dbt"],
"env": {
"DBT_PROJECT_DIR": "/path/to/dbt/project",
"DBT_PROFILES_DIR": "/path/to/.dbt"
}
}
}
}dbt_project_infodbt_model_detailsdbt_compilesnowflake_query_historysnowflake_table_stats# User: "Create a mart model for monthly revenue by customer"
# Skills auto-chains:
# 1. creating-dbt-models: Creates initial model
# 2. testing-dbt-models: Adds schema tests
# 3. documenting-dbt-models: Adds documentation# User: "My model won't compile"
# Skill: debugging-dbt-errors
# Workflow:
# 1. Read error
# 2. Check dependencies
# 3. Apply fix
# 4. Rebuild
# 5. If still fails, repeat up to 3x
# 6. If 3x fails, stop and reassess approach# User: "Break this large model into smaller ones"
# Skill: refactoring-dbt-models
# Workflow:
# 1. Map all downstream dependencies
# 2. Create new intermediate models
# 3. Update refs in downstream models
# 4. Run dbt build on entire DAG
# 5. Verify no breakage-- Pattern: merge strategy with unique_key
{{ config(
materialized='incremental',
unique_key='event_id',
merge_update_columns=['status', 'updated_at']
) }}
select
event_id,
user_id,
event_type,
status,
created_at,
updated_at
from {{ source('events', 'raw_events') }}
{% if is_incremental() %}
where updated_at > (select max(updated_at) from {{ this }})
{% endif %}# Skill: optimizing-query-text
# Steps encoded:
# 1. Profile query
# 2. Identify bottleneck type:
# - Full table scan → Add filters/clustering
# - Inefficient join → Reorder, change type
# - Large aggregation → Pre-aggregate or partition
# 3. Apply pattern-based fix
# 4. Validate semantics unchanged
# 5. Measure improvement/plugin listdbt debug# Check MCP server config
cat claude_desktop_config.json | grep altimate
# Verify dbt project path
export DBT_PROJECT_DIR=/correct/path
export DBT_PROFILES_DIR=/correct/.dbt/path
# Restart Claude Code# Install altimate-code CLI
npm install -g altimate-code
# Verify installation
altimate-code --version
# Check Node version (requires 20+)
node --versionfinding-expensive-queries# Check kit is installed
altimate-code kit list
# Reinstall if needed
altimate-code kit install AltimateAI/data-engineering-skills
# Check for conflicting active kits
altimate-code kit status
# Deactivate others first
altimate-code kit deactivate