跳到主内容
智客 ZICQ

技能库 智客分类:Agent 工作流 analyzing-data

Analyzing Data

用 SQL 查询数据仓库并回答有关数据的商业问题. 在回答需要仓库数据的任何信息时使用 - 计数, 度量, 趋势, 汇总, 加入跨表格, 数据查看, 或 特设 SQL 分析( 例如“ 谁使用 X ” , “ 多少 Y ” , “ 显示我 Z ” , “ 查找客户 ” , “ 计算是什么 ” ) .

1361 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

用 SQL 查询数据仓库并回答有关数据的商业问题

何时用

回答需要仓库数据的任何信息 - 计数, 度量, 趋势, 汇总, 跨表加入, 数据查看, 或临时 SQL 分析( 例如“ 谁使用 X ” , “ 多少 Y ” , “ 显示我 Z ” , “ 找到客户 ” , “ 数是什么 ” )

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Data Analysis、Workflow、Kernel Functions、CLI Reference、Kernel、Concept Cache。 其中含规范建议的小节:分步指令。

文件分析

文件分析:除 SKILL.md 外,正文引用了 scripts/cli.py,属于带资源的技能包,这些文件按需再读。

官方 description(原文)

Queries the data warehouse with SQL and answers business questions about data. Use when answering anything that needs warehouse data - counts, metrics, trends, aggregations, joins across tables, data lookups, or ad-hoc SQL analysis (for example "who uses X", "how many Y", "show me Z", "find customers", "what is the count").

Data AnalysisWorkflowKernel FunctionsCLI ReferenceKernelConcept CachePattern CacheTable Schema CacheCache ManagementReferences

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
analyzing-data
description
Queries the data warehouse with SQL and answers business questions about data. Use when answering anything that needs warehouse data - counts, metrics, trends, aggregations, joins across tables, data lookups, or ad-hoc SQL analysis (for example "who uses X", "how many Y", "show me Z", "find customers", "what is the count").
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。
指令中引用的文件 · 1
  • scripts/cli.py

以下路径提取自原文;文件是否齐全请以来源仓库中的完整目录为准。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

该技能引用了附属文件,请从来源获取完整目录;仅复制 SKILL.md 可能缺少依赖。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「analyzing-data」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-b791365739799400-%E5%88%86%E6%9E%90%E6%95%B0%E6%8D%AE.html
请存为 .cursor/skills/analyzing-data/SKILL.md 或 .claude/skills/analyzing-data/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。
该技能还带 scripts/、references/、assets/ 等文件,请从 https://github.com/astronomer/agents 取完整目录,不要只建一个 SKILL.md。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/astronomer/agents' --list

npx skills add 'https://github.com/astronomer/agents' --skill 'analyzing-data'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版
--- name: analyzing-data description: Queries the data warehouse with SQL and answers business questions about data. Use when answering anything that needs warehouse data - counts, metrics, trends, aggregations, joins across tables, data lookups, or ad-hoc SQL analysis (for example "who uses X", "how many Y", "show me Z", "find customers", "what is the count"). --- # Data Analysis Answer business questions by querying the data warehouse. The kernel auto-starts on first `exec` call. **All CLI commands below are relative to this skill's directory.** Before running any `scripts/cli.py` command, `cd` to the directory containing this file. ## Workflow 1. **Pattern lookup** — Check for a cached query strategy: ```bash uv run scripts/cli.py pattern lookup "" ``` If a pattern exists, follow its strategy. Record the outcome after executing: ```bash uv run scripts/cli.py pattern record --success # or --failure ``` 2. **Concept lookup** — Find known table mappings: ```bash uv run scripts/cli.py concept lookup ``` 3. **Table discovery** — If cache misses, search the codebase (`Grep pattern="" glob="**/*.sql"`) or query `INFORMATION_SCHEMA`. See [reference/discovery-warehouse.md](reference/discovery-warehouse.md). 4. **Execute query**: ```bash uv run scripts/cli.py exec "df = run_sql('SELECT ...')" uv run scripts/cli.py exec "print(df)" ``` 5. **Cache learnings** — Always cache before presenting results: ```bash # Cache concept → table mapping uv run scripts/cli.py concept learn -k # Cache query strategy (if discovery was needed) uv run scripts/cli.py pattern learn -q "question" -s "step" -t "TABLE" -g "gotcha" ``` 6. **Present findings** to user. ## Kernel Functions | Function | Returns | |----------|---------| | `run_sql(query, limit=100)` | Polars DataFrame | | `run_sql_pandas(query, limit=100)` | Pandas DataFrame | | `run_sql_many(queries, limit=100)` | List of Polars DataFrames (one per query) | `pl` (Polars) and `pd` (Pandas) are pre-imported. **Run independent queries together** with `run_sql_many` — they execute concurrently (Snowflake async / connection-pool fan-out) instead of one at a time: ```bash uv run scripts/cli.py exec "dfs = run_sql_many(['SELECT ...', 'SELECT ...']); print(dfs[0])" ``` `run_sql_many` is **fail-fast**: if any query errors, the call raises and the results of the queries that succeeded are discarded. Use separate `run_sql` calls if you need partial results. **Timeouts:** `exec` waits up to 120s by default, then interrupts the query and returns a "client stopped waiting" message (the query may still finish server-side). Raise it for known long-running queries: `uv run scripts/cli.py exec "..." -t 600`. **Idle kernel:** the kernel self-terminates after 2h idle (preserving state until then). Override with `ASTRO_KERNEL_IDLE_TIMEOUT` (seconds; `0` disables). ## CLI Reference ### Kernel ```bash uv run scripts/cli.py warehouse list # List warehouses uv run scripts/cli.py start [-w name] # Start kernel (with optional warehouse) uv run scripts/cli.py exec "..." # Execute Python code uv run scripts/cli.py status # Kernel status uv run scripts/cli.py restart # Restart kernel uv run scripts/cli.py stop # Stop kernel uv run scripts/cli.py install # Install package ``` ### Concept Cache ```bash uv run scripts/cli.py concept lookup # Look up uv run scripts/cli.py concept learn
-k # Learn uv run scripts/cli.py concept list # List all uv run scripts/cli.py concept import -p /path/to/warehouse.md # Bulk import ``` ### Pattern Cache ```bash uv run scripts/cli.py pattern lookup "question" # Look up uv run scripts/cli.py pattern learn -q "..." -s "..." -t "TABLE" -g "gotcha" # Learn uv run scripts/cli.py pattern record --success # Record outcome uv run scripts/cli.py pattern list # List all uv run scripts/cli.py pattern delete # Delete ``` ### Table Schema Cache ```bash uv run scripts/cli.py table lookup
# Look up schema uv run scripts/cli.py table cache
-c '[...]' # Cache schema uv run scripts/cli.py table list # List cached uv run scripts/cli.py table delete
# Delete ``` ### Cache Management ```bash uv run scripts/cli.py cache status # Stats uv run scripts/cli.py cache clear [--stale-only] # Clear ``` ## References - [reference/discovery-warehouse.md](reference/discovery-warehouse.md) — Large table handling, warehouse exploration, INFORMATION_SCHEMA queries - [reference/common-patterns.md](reference/common-patterns.md) — SQL templates for trends, comparisons, top-N, distributions, cohorts

相关技能

Agent 工作流

Skill Creator

创造有效技能指南。 当用户想创造出新的技能(或更新现有的技能),以专业知识,工作流程,或工具集成来扩展克洛德的能力时,应该使用这种技能.

Agent 工作流

Clawdhub

使用ClawdHub CLI搜索,安装,更新并发布从taladhub.com的代理技能. 需要获取苍蝇上的新技能时使用,将安装的技能同步到最新版本或特定版本,或者发布 npm-instainddhub CLI 的新/更新的技能文件夹.

Agent 工作流

Agent Team Orchestration

管弦乐团多代理团队,任务设定周期,交接协议,审查工作流程. 使用时间: (1)建立2+特派员队伍,具有不同专业,(2)确定任务路线和生命周期(收录框_ spec_建设_审查_完成),(3)在特派员之间制定交接协议,(4)建立审查和质量关口,(5)管理特派员之间的交流和文物共享.

Agent 工作流

Superpowers

Spec-first,TDD,子代理驱动的软件开发工作流程. 当:(1)构建任何新功能或应用——触发脑暴_计划_子代理执行回路,(2)调试出一个bug或测试失败——触发系统性的根起过程,(3)用户说"让我们构建","帮助我计划","我想添加X",或"这个被打破",(4)完成一个功…