kilo-org/kilo-marketplace/answering-natural-language-questions-with-dbt
- community
Checking that the SKILL.md file is still in the repository.
Writes and executes SQL queries against the data warehouse using dbt's Semantic Layer or ad-hoc SQL to answer business questions. Use when a user asks about analytics, metrics, KPIs, or data (e.g., "What were total sales last quarter?", "Show me top customers by revenue"). NOT for validating, testing, or building dbt models during development.
Install
npx vskill@latest install kilo-org/kilo-marketplace/answering-natural-language-questions-with-dbtSKILL.md
Answering Natural Language Questions with dbt
Overview
Answer data questions using the best available method: semantic layer first, then SQL modification, then model discovery, then manifest analysis. Always exhaust options before saying "cannot answer."
Use for: Business questions from users that need data answers
- "What were total sales last month?"
- "How many active customers do we have?"
- "Show me revenue by region"
Not for:
- Validating model logic during development
- Testing dbt models or semantic layer definitions
- Building or modifying dbt models
dbt run,dbt test, ordbt buildworkflows
Decision Flow
Quick Reference
| Priority | Condition | Approach | Tools | |
|---|---|---|---|---|
| 1 | Semantic layer active | Query metrics directly | list_metrics, get_dimensions, query_metrics | |
| 2 | SL active but minor modifications needed (missing dimension, custom filter, case when, different aggregation) | Modify compiled SQL | get_metrics_compiled_sql, then execute_sql | |
| 3 | No SL, discovery tools active | Explore models, write SQL | get_mart_models, get_model_details, then show/execute_sql | |
| 4 | No MCP, in dbt project | Analyze artifacts, write SQL | Read target/manifest.json, target/catalog.json |
Approach 1: Semantic Layer Query
When list_metrics and query_metrics are available:
list_metrics- find relevant metricget_dimensions- verify required dimensions existquery_metrics- execute with appropriate filters
If semantic layer can't answer directly (missing dimension, need custom logic) → go to Approach 2.
Approach 2: Modified Compiled SQL
When semantic layer has the metric but needs minor modifications:
- Missing dimension (join + group by)
- Custom filter not available as a dimension
- Case when logic for custom categorization
- Different aggregation than what's defined
get_metrics_compiled_sql- get the SQL that would run (returns raw SQL, not Jinja)- Modify SQL to add what's needed
execute_sqlto run the raw SQL- Always suggest updating the semantic model if the modification would be reusable
Note: The compiled SQL contains resolved table names, not {{ ref() }}. Work with the raw SQL as returned.
Approach 3: Model Discovery
When no semantic layer but get_all_models/get_model_details available:
get_mart_models- start with marts, not stagingget_model_detailsfor relevant models - understand schema- Write SQL using
{{ ref('model_name') }} show --inline "..."orexecute_sql
Prefer marts over staging - marts have business logic applied.
Approach 4: Manifest/Catalog Analysis
When in a dbt project but no MCP server:
- Check for
target/manifest.jsonandtarget/catalog.json - Filter before reading - these files can be large
- Write SQL based on discovered schema
- Explain: "This SQL should run in your warehouse. I cannot execute it without database access."
Suggesting Improvements
When in a dbt project, suggest semantic layer changes after answering (or when cannot answer):
| Gap | Suggestion | |
|---|---|---|
| Metric doesn't exist | "Add a metric definition to your semantic model" | |
| Dimension missing | "Add dimension_name to the dimensions list in the semantic model" | |
| No semantic layer | "Consider adding a semantic layer for this data" |
Stay at semantic layer level. Do NOT suggest:
- Database schema changes
- ETL pipeline modifications
- "Ask your data engineering team to..."
Rationalizations to Resist
| You're Thinking... | Reality | |
|---|---|---|
| "Semantic layer doesn't support this exact query" | Get compiled SQL and modify it (Approach 2) | |
| "No MCP tools, can't help" | Check for manifest/catalog locally | |
| "User needs this quickly, skip the systematic check" | Systematic approach IS the fastest path | |
| "Just write SQL, it's faster" | Semantic layer exists for a reason - use it first | |
| "The dimension doesn't exist in the data" | Maybe it exists but not in semantic layer config |
Red Flags - STOP
- Writing SQL without checking if semantic layer can answer
- Saying "cannot answer" without trying all 4 approaches
- Suggesting database-level fixes for semantic layer gaps
- Reading entire manifest.json without filtering
- Using staging models when mart models exist
- Using this to validate model correctness rather than answer business questions
Common Mistakes
| Mistake | Fix | |
|---|---|---|
| Giving up when SL can't answer directly | Get compiled SQL and modify it | |
| Querying staging models | Use get_mart_models first | |
| Reading full manifest.json | Use jq to filter | |
| Suggesting ETL changes | Keep suggestions at semantic layer | |
| Not checking tool availability | List available tools before choosing approach |
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/dbt/skills/answering-natural-language-questions-with-dbt/SKILL.md
Popularity
- Repository stars
- 153
- Repository forks
- 77
- 7-day trend score
- 25
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kilo-org/kilo-marketplace/answering-natural-language-questions-with-dbt)