Refactoring Dbt Models
Automatically improves DBT model code quality, performance, and maintainability using AI-powered refactoring suggestions.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add refactoring-dbt-models npx -- -y @trustedskills/refactoring-dbt-models
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"refactoring-dbt-models": {
"command": "npx",
"args": [
"-y",
"@trustedskills/refactoring-dbt-models"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
This skill helps AI agents refactor existing dbt models. It can identify areas for improvement in model logic, optimize SQL queries within models, and improve overall code readability and maintainability of a dbt project. The agent can suggest changes to adhere to best practices and enhance the efficiency of data transformations.
When to use it
- You have a large dbt project with complex or outdated models that need cleaning up.
- Existing dbt models are performing slowly, and you suspect inefficient SQL queries are the cause.
- New team members struggle to understand the logic within certain dbt models due to poor formatting or convoluted code.
- You want to ensure your dbt project adheres to consistent coding standards and best practices.
Key capabilities
- Identifies opportunities for query optimization in dbt models.
- Suggests improvements to SQL syntax and structure.
- Recommends refactoring strategies for complex model logic.
- Enforces consistent code formatting within dbt models.
Example prompts
- "Refactor this dbt model: [paste model SQL here]"
- "Can you suggest ways to optimize the performance of this dbt model? [paste model SQL here]"
- "Improve the readability and maintainability of this dbt model, adhering to best practices. [paste model SQL here]"
Tips & gotchas
- The skill requires access to the relevant dbt project files. Ensure the AI agent has appropriate permissions and context.
- While it can suggest improvements, always review the proposed changes carefully before implementing them in your dbt project.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.