SkillsLib.ai

dbt Model Optimization & Refactoring

Optimize and refactor your dbt models for performance and maintainability

0.0(0 reviews)
100+ downloads
Updated Sep 2026

What You Can Do

You can analyze your dbt models to identify performance bottlenecks, redundancies, and design issues, then receive concrete refactoring recommendations with implementation guidance. This skill helps you restructure models following dbt best practices, improve query efficiency, and enhance code maintainability across your entire dbt project.

Features

Performance analysis

Identify slow queries, inefficient joins, and materialization strategy issues causing bottlenecks

Code quality scanning

Detect redundant logic, unmaintainable patterns, and violations of dbt naming conventions

Refactoring blueprints

Receive step-by-step refactoring plans with before/after code examples

Test coverage assessment

Review existing tests and generate new test cases for refactored models

Dependency mapping

Visualize and optimize the DAG structure to reduce model interdependencies

Documentation generation

Auto-create or improve YAML documentation for refactored models

Best practice alignment

Ensure models follow industry standards for staging, intermediate, and mart layers

Example Output

Input: Your dbt project with 50+ models

Output:

code
### Performance Issues Found
- stg_customers: Cartesian join in customer_transactions (20s execution time)
- fct_orders: Redundant group-by across 3 upstream models

### Refactoring Plan
1. Extract transaction aggregation into int_customer_transactions
2. Replace cartesian join with LEFT JOIN + ROW_NUMBER()
3. Add incremental logic to stg_customers (current: full refresh)

### Code Changes
-- Before
SELECT c.*, t.*
FROM raw_customers c
CROSS JOIN raw_transactions t  -- Inefficient!

-- After
SELECT c.*, t.transaction_count
FROM {{ ref('stg_customers') }} c
LEFT JOIN {{ ref('int_customer_transactions') }} t
  USING (customer_id)

Expected Gains: 40% query time reduction, 3 fewer dependencies, improved test coverage

What's Included

  • SKILL.md: The Claude skill with dbt analysis workflows, optimization templates, and refactoring decision trees
  • Model Audit Checklist: Comprehensive list of performance and maintainability criteria
  • Refactoring Templates: SQL patterns for common refactoring scenarios (incremental models, staging layers, fact tables)
  • Test Generation Snippets: dbt YAML templates for unit tests and model contracts
  • DAG Optimization Guide: Best practices for model layering and dependency management

Who It's For

  • Analytics Engineers — Refactor legacy dbt projects and improve code quality
  • Data Team Leads — Establish optimization standards across your organization
  • dbt Project Owners — Reduce query costs and accelerate model execution
  • Data Platform Teams — Scale dbt projects while maintaining performance SLAs

Best For

  • Identifying and fixing performance bottlenecks in slow-running models
  • Restructuring large dbt projects to follow layered architecture (staging, intermediate, marts)
  • Eliminating redundant logic and consolidating overlapping models
  • Adding test coverage and documentation during refactoring
  • Planning incremental materialization strategies to reduce compute costs

You might also like

Film Location Scout Site Analyzer
$45
Scouting3.8(32)
Film Location Scout Site Analyzer

You can evaluate unfamiliar locations objectively against your specific production needs—whether that's crane access, parking capacity, noise restrictions, or permit requirements. The skill generates comprehensive scout reports that compare multiple sites using weighted evaluation matrices, flag deal-breakers early, and document infrastructure limitations so your production team makes informed decisions before committing resources to visits.

SCADA System Integration & Troubleshooting
$30
SCADA System Integration & Troubleshooting

You'll design robust SCADA system architectures, configure industrial protocols (Modbus, Profibus, OPC-UA, DNP3), and diagnose connectivity and performance issues across distributed control networks. Get step-by-step configuration guidance, integration workflows, and troubleshooting decision trees tailored to your specific hardware and protocol stack.

DaVinci Resolve Color Grading Workflow & Quality Control
$35
DaVinci Resolve Color Grading Workflow & Quality Control

You can establish systematic color grading workflows that accelerate project delivery, ensure visual consistency across episodes and projects, and maintain broadcast-quality standards. Claude generates reusable templates, quality control checklists, and grading decision frameworks tailored to your project's color science and deliverable requirements.

Invoice & Payment Collection Enforcer
$55
Invoice & Payment Collection Enforcer

Use Claude to automate your entire collection workflow, from first touch to recovery, with legally sound escalation protocols. You'll recover more money in less time, reduce bad debt write-offs by 25-40%, and build defensible collection records that withstand legal scrutiny. Claude handles customized demand letters, compliance validation, debtor profiling, and escalation strategies tailored to account age, debtor behavior, and jurisdiction.

Active Transportation Network Analysis & Planning
$35
Active Transportation Network Analysis & Planning

You can conduct comprehensive active transportation network audits that identify missing links, connectivity gaps, and underserved communities. Claude helps you prioritize infrastructure investments against limited budgets using equity screening, mode-share modeling, and cost-benefit analysis—producing client-ready documentation and stakeholder presentations that justify infrastructure decisions with quantitative evidence rather than assumptions.

Draw.io Diagram Automation for Project Management
$25
Draw.io Diagram Automation for Project Management

Turn project descriptions, timelines, and structured data into professional draw.io diagrams instantly. You can generate flowcharts, org charts, Gantt charts, swimlane diagrams, and process flows by describing what you need. Claude creates draw.io XML that you can open directly in the editor or modify further.

MyCase Document Workflow Automation
$40
MyCase Document Workflow Automation

Generate customized legal documents and client communications automatically from your MyCase case data. This skill extracts case details, client information, and matter status to populate document templates, send email updates, and create batch processing workflows. Reduce manual data entry and standardize your document generation process while maintaining client communication consistency.

Wwise Implementation & Troubleshooting Assistant
$45
Wwise Implementation & Troubleshooting Assistant

This skill helps you troubleshoot Wwise integration issues, diagnose audio performance bottlenecks, and generate comprehensive documentation for interactive audio specifications. You'll get step-by-step fixes for common implementation problems, performance optimization strategies, and best practices for audio systems across different game engines and platforms.

$30.00