altimate-code
Delegates dbt and warehouse work to altimate-code, a specialized CLI agent with 100+ purpose-built data tools. USE THIS SKILL…
Refactor a bloated dbt model on Snowflake safely and produce a quantified before/after report that explains **which qualities improved and why** — not just raw deltas. Extends the standard refactor flow with (1) downstream impact analysis via `dbt-analyze`, (2) row-count +
$ npx -y skills add AltimateAI/data-engineering-skills --skill snowflake-dbt-model-refactoring --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/snowflake-dbt-model-refactoringContext preview
The summary Claude sees to decide when to auto-load this skill.
Refactor a bloated dbt model on Snowflake safely and produce a quantified before/after report that explains **which qualities improved and why** — not just raw deltas. Extends the standard refactor flow with (1) downstream impact analysis via `dbt-analyze`, (2) row-count +
name: snowflake-dbt-model-refactoring description: > Refactor a bloated dbt model on Snowflake safely and produce a quantified before/after report that explains **which qualities improved and why** — not just raw deltas. Extends the standard refactor flow with (1) downstream impact analysis via `dbt-analyze`, (2) row-count + column-hash parity validation via `data-parity`, (3) a report that lands a Bottleneck Summary and an "Outcome axes improved" table (readability, maintainability, performance, cost, governance, best-practices), and (4) an optional post-refactor warehouse benchmark against real Snowflake query history offered at the end. Use when the user says "refactor this model", "clean up this model", or points at a model that is oversized / over-joined / duplicated across the project — and the warehouse is Snowflake. Delegates to Altimate skills — does not reinvent them.
Trigger this skill when any of the following is true for a target dbt model **on a Snowflake-backed dbt project**:
If the project targets BigQuery, Redshift, or Databricks, use the generic `refactoring-dbt-models` skill instead — Phase 7's warehouse benchmark is Snowflake-specific.
This skill delegates specialized sub-tasks (lineage, parity, SQL review, cost attribution, etc.) that are not themselves packaged with `snowflake-skills`. Two valid invocation paths — pick the one that matches the user's environment:
**Preferred — `altimate-code`** (bundled in the `dbt-snowflake` kit). Before using any delegated-task line below, verify it is available:
command -v altimate-code
If present, delegate each sub-task via its non-interactive runner:
altimate-code run "<task description>" --yolo \ --output /tmp/altimate-result.md --dir "$(pwd)"
Then read `/tmp/altimate-result.md` and use the result. See the `altimate-code` skill for the full flag reference and install guidance.
**Fallback — plain dbt + direct SQL** when `altimate-code` is not installed and the user does not want to install it. In that case:
(downstream nodes) plus `dbt docs generate` + reading `target/catalog.json` and `target/manifest.json` for the column-usage map. Note: this is coarser than altimate-code's column-level lineage.
warehouse (via the dbt adapter, `snowsql`, or any Snowflake client).
`SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY` + `QUERY_ATTRIBUTION_HISTORY` (sample SQL in Phase 7).
If **neither** `altimate-code` nor plain `dbt` is available, stop and tell the user — do not fabricate results from file reads alone.
Throughout the procedure below, every reference to a delegated tool (`dbt-analyze`, `data-parity`, `sql-review`, `cost-report`, `query-optimize`, `lineage-diff`) is a logical sub-task name. Execute it via `altimate-code run "..."` on the preferred path or the plain-dbt equivalent on the fallback path. Every reference to `altimate-dbt build --model X` on the preferred path translates to `altimate-code run "dbt build --select X ..."` or plain `dbt build --select X` on the fallback path.
Target end-to-end runtime: **5–6 minutes**, hard ceiling **8 minutes**. The individual phases below have explicit budgets: Phase 1 ≤90s · Phase 2 ≤60s · Phase 3 ≤90s · Phase 4 ≤90s · Phase 5 ≤30s · Phase 6 ≤60s. If a phase exceeds its budget, stop the extra work and move on — the report is the deliverable, not a comprehensive audit.
Ask **only** these two questions before proceeding. Do NOT ask about warehouse benchmarking here — that comes at the end (see Phase 7).
1. **Target model name** (required). If missing, ask. 2. **Parity strictness.** Ask: *"For the before/after parity check, do you want row-count parity only (fast) or full column-hash parity (slower, slightly higher warehouse cost)?"* Default: row-count + spot-check hash on the grain column and one numeric column.
Do not ask further questions until these two are answered. Then proceed end-to-end.
**Do NOT ask about saving the report.** The report is always displayed inline at the end. It is not saved to a file. Persistence is not part of this skill.
Before touching anything, capture the baseline. Every number below feeds the "Before" column of the final report.
Run these steps **in parallel where possible** — most are independent:
1. **Static code metrics** (single bash pass; do not use one call per metric):
hardcoded literals repeated ≥3 times.
metric. 2. **Downstream + column-usage map** — delegate (see tool-delegation cheatsheet):
downstream dbt model consumes. Save the result. Columns produced by the target but not referenced by any downstream
Claude Code skills for Analytics & Data engineers working with dbt and Snowflake Altimate Data Skills is a collection of Claude Code skills that encode the workflows and best practices of experienced analytics engineers.
Delegates dbt and warehouse work to altimate-code, a specialized CLI agent with 100+ purpose-built data tools. USE THIS SKILL…
Analyze DBSQL queries, including SQL embedded in notebooks (`spark.sql(...)`, `%sql` cells), for anti-patterns, lint issues, and…
Creates dbt models following project conventions. Use when working with dbt models for: (1) Creating new models (any layer -…
Debugs and fixes dbt errors systematically. Use when working with dbt errors for: (1) Task mentions "fix", "error", "broken",…
Develops and troubleshoots dbt incremental models. Use when working with incremental materialization for: (1) Creating new…
Documents dbt models and columns in schema.yml. Use when working with dbt documentation for: (1) Adding model descriptions or…