Token导航 LogoToken导航TokenDH.com
研究检索external-servicegithub未标认证来源可访问许可证需确认审计通过

answering-natural-language-questions-with-dbtanswering natural language questions with DBT 搜索

Agent Skill

answering-natural-language-questions-with-dbt 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

5,750

周安装

247

GitHub Stars

448

下载量

2,016
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:answering-natural-language-questions-with-dbt(answering natural language questions with DBT 搜索)
来源仓库:https://github.com/dbt-labs/dbt-agent-skills
仓库路径:skills/answering-natural-language-questions-with-dbt
安装命令:
npx skills add https://github.com/dbt-labs/dbt-agent-skills --skill answering-natural-language-questions-with-dbt
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/dbt-labs/dbt-agent-skills --skill answering-natural-language-questions-with-dbt

简介

用于回答基于自然语言的数据查询,优先使用语义层再 fallback 到 SQL。

  • 支持模型发现、manifest 分析和 SQL 修改,最大化利用现有资源。
  • 适用于业务用户提问“上月销售额?”类场景,非模型开发用途。
  • 需配置 dbt 项目和语义层连接,确保数据源可访问。
  • 不能替代 dbt run/test 流程,仅用于问答型交互场景。

SKILL.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, or dbt build workflows

Decision Flow

flowchart TD
    start([Business question received])
    check_sl{Semantic layer tools available?}
    list_metrics[list_metrics]
    metric_exists{Relevant metric exists?}
    get_dims[get_dimensions]
    sl_sufficient{SL can answer directly?}
    query_metrics[query_metrics]
    answer([Return answer])
    try_compiled[get_metrics_compiled_sql<br/>Modify SQL, execute_sql]
    check_discovery{Model discovery tools available?}
    try_discovery[get_mart_models<br/>get_model_details<br/>Write SQL, execute]
    check_manifest{In dbt project?}
    try_manifest[Analyze manifest/catalog<br/>Write SQL]
    cannot([Cannot answer])
    suggest{In dbt project?}
    improvements[Suggest semantic layer changes]
    done([Done])

    start --> check_sl
    check_sl -->|yes| list_metrics
    check_sl -->|no| check_discovery
    list_metrics --> metric_exists
    metric_exists -->|yes| get_dims
    metric_exists -->|no| check_discovery
    get_dims --> sl_sufficient
    sl_sufficient -->|yes| query_metrics
    sl_sufficient -->|no| try_compiled
    query_metrics --> answer
    try_compiled -->|success| answer
    try_compiled -->|fail| check_discovery
    check_discovery -->|yes| try_discovery
    check_discovery -->|no| check_manifest
    try_discovery -->|success| answer
    try_discovery -->|fail| check_manifest
    check_manifest -->|yes| try_manifest
    check_manifest -->|no| cannot
    try_manifest -->|SQL ready| answer
    answer --> suggest
    cannot --> done
    suggest -->|yes| improvements
    suggest -->|no| done
    improvements --> done

Quick Reference

PriorityConditionApproachTools
1Semantic layer activeQuery metrics directlylist_metrics, get_dimensions, query_metrics
2SL active but minor modifications needed (missing dimension, custom filter, case when, different aggregation)Modify compiled SQLget_metrics_compiled_sql, then execute_sql
3No SL, discovery tools activeExplore models, write SQLget_mart_models, get_model_details, then show/execute_sql
4No MCP, in dbt projectAnalyze artifacts, write SQLRead target/manifest.json, target/catalog.json

Approach 1: Semantic Layer Query

When list_metrics and query_metrics are available:

  1. list_metrics - find relevant metric
  2. get_dimensions - verify required dimensions exist
  3. query_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
  1. get_metrics_compiled_sql - get the SQL that would run (returns raw SQL, not Jinja)
  2. Modify SQL to add what's needed
  3. execute_sql to run the raw SQL
  4. Always suggest updating the semantic model if the modification would be reusable
-- Example: Adding sales_rep dimension
WITH base AS (
    -- ... compiled metric logic (already resolved to table names) ...
)
SELECT base.*, reps.sales_rep_name
FROM base
JOIN analytics.dim_sales_reps reps ON base.rep_id = reps.id
GROUP BY ...

-- Example: Custom filter
SELECT * FROM (compiled_metric_sql) WHERE region = 'EMEA'

-- Example: Case when categorization
SELECT
    CASE WHEN amount > 1000 THEN 'large' ELSE 'small' END as deal_size,
    SUM(amount)
FROM (compiled_metric_sql)
GROUP BY 1

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:

  1. get_mart_models - start with marts, not staging
  2. get_model_details for relevant models - understand schema
  3. Write SQL using {{ref('model_name')}}
  4. show --inline "..." or execute_sql

Prefer marts over staging - marts have business logic applied.

Approach 4: Manifest/Catalog Analysis

When in a dbt project but no MCP server:

  1. Check for target/manifest.json and target/catalog.json
  2. Filter before reading - these files can be large
# Find mart models in manifest
jq '.nodes | to_entries | map(select(.key | startswith("model.") and contains("mart"))) | .[].value | {name: .name, schema: .schema, columns: .columns}' target/manifest.json

# Get column info from catalog
jq '.nodes["model.project_name.model_name"].columns' target/catalog.json
  1. Write SQL based on discovered schema
  2. 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):

GapSuggestion
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

MistakeFix
Giving up when SL can't answer directlyGet compiled SQL and modify it
Querying staging modelsUse get_mart_models first
Reading full manifest.jsonUse jq to filter
Suggesting ETL changesKeep suggestions at semantic layer
Not checking tool availabilityList available tools before choosing approach

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.29%
按下载量换算752

Claude

30.76%
按下载量换算620

Cursor

17.28%
按下载量换算348

Gemini CLI

8.91%
按下载量换算180

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills