data-analysis

GitHub

用于自然语言数据查询与分析,涵盖指标查询、趋势分析及报告生成。新增知识库集成支持,优先调用retrieve_knowledge获取定义与事实;优化工作流,强调探索Schema后再编写SQL,并强化结果验证步骤以确保准确性。

packages/skills/builtin/data-analysis/SKILL.md datagallery-lab/datafoundry

Trigger Scenarios

数据分析 查数 指标查询 报表 SQL 分析 趋势分析 维度 度量 异常检查 数据质量

Install

npx skills add datagallery-lab/datafoundry --skill data-analysis -g -y
More Options

Non-standard path

npx skills add https://github.com/datagallery-lab/datafoundry/tree/main/packages/skills/builtin/data-analysis -g -y

Use without installing

npx skills use datagallery-lab/datafoundry@data-analysis

指定 Agent (Claude Code)

npx skills add datagallery-lab/datafoundry --skill data-analysis -a claude-code -g -y

安装 repo 全部 skill

npx skills add datagallery-lab/datafoundry --all -g -y

预览 repo 内 skill

npx skills add datagallery-lab/datafoundry --list

SKILL.md

Frontmatter
{
    "name": "data-analysis",
    "tags": [
        "data",
        "analysis",
        "sql",
        "report",
        "数据分析",
        "查数",
        "指标"
    ],
    "version": "1.0.0",
    "description": "Answer data questions from quick metric lookups to full investigations and stakeholder-ready reports.",
    "denied-tools": [],
    "allowed-tools": [
        "list_data_sources",
        "inspect_schema",
        "preview_table",
        "run_sql_readonly",
        "retrieve_knowledge",
        "read_file",
        "write_file",
        "list_files"
    ],
    "user-invocable": true
}

Data Analysis

Use this skill for natural-language data questions, including metric lookups, trend investigations, segment comparisons, anomaly checks, quality reviews, and short reports.

Chinese search aliases: 数据分析, 查数, 指标查询, 报表, SQL 分析, 趋势分析, 维度, 度量, 异常检查, 数据质量.

This workflow is adapted for this workbench from public data-analysis skill patterns:

  • Classify the user's request before querying.
  • When a knowledge base is enabled for the run, call retrieve_knowledge first for definitions, prior findings, or document-backed facts before guessing or writing SQL.
  • Explore schema before SQL.
  • Retrieve only the data needed for the current question.
  • Validate results before presenting them.
  • Match the output to the user's requested level of detail.

Workflow

1. Understand The Question

Classify the task:

  • Quick answer: one metric, a simple filter, or a factual lookup.
  • Full analysis: trends, drivers, comparisons, segmentation, or anomalies.
  • Report: a structured write-up with method, findings, caveats, and recommendations.

Identify the needed datasource, tables, metrics, dimensions, filters, time range, and output format. If a required business definition is missing, state the assumption or ask only when guessing would materially change the answer.

2. Explore Before Querying

Always inspect the relevant datasource before writing SQL unless a valid schema token is already available in the current run.

Use progressive disclosure:

  • Start broad with datasource and schema discovery.
  • Narrow to candidate tables and columns.
  • Inspect only the specific tables needed for the query.
  • Use preview_table sparingly to understand shape, examples, nulls, or category values.

Do not dump broad schemas into the answer. Keep schema exploration focused on the user's task.

3. Query Read-Only Data

Write precise SELECT or WITH SQL through run_sql_readonly.

Use exact inspected table and column names. If a query fails, inspect the schema or simplify the query before retrying. Do not guess alternate names blindly.

For multi-step analysis, break the problem into focused sub-questions. Prefer a small number of high-signal queries over many speculative queries.

4. Validate Results

Before presenting conclusions, perform checks appropriate to the task:

  • Row count sanity: does the result size make sense?
  • Null handling: could missing values skew the result?
  • Magnitude check: are values in a plausible range?
  • Aggregation check: do subtotals align with totals?
  • Trend continuity: are there unexpected gaps or date boundary issues?
  • Filter check: did the query apply the user's requested scope?

If validation raises concerns, investigate when possible and surface the caveat.

5. Present The Answer

For quick answers:

  • Lead with the direct answer.
  • Include the most relevant context or caveat.
  • Include SQL only when it helps reproducibility.

For full analyses:

  • Lead with the key finding.
  • Support it with compact tables, calculations, or charts when useful.
  • Explain method and caveats.
  • Suggest the next best follow-up only when it is actionable.

For reports:

  • Write a concise executive summary.
  • Include method, findings, evidence, caveats, and recommendations.
  • Save longer reports or reusable outputs as workspace files and publish them as artifacts.

Guardrails

  • Never invent schemas, rows, metric definitions, SQL results, or file contents.
  • Never use write SQL, DDL, multi-statement SQL, or direct database clients.
  • Never bypass the Data Gateway with command-line database clients.
  • Never hide tool failures; explain what failed and how you adapted.
  • Keep conclusions proportional to the data actually inspected.

Version History

  • e4aeb17 Current 2026-07-19 10:03

    新增知识库支持:启用时优先调用 retrieve_knowledge 获取业务定义和先验发现;优化工作流逻辑,明确探索 Schema 后执行 SQL 的步骤,增强结果验证环节。

  • 77fa566 2026-07-11 16:58

Same Skill Collection

scripts/fixtures/test-skill/SKILL.md

Metadata

Files
0
Version
e4aeb17
Hash
66aff698
Indexed
2026-07-11 16:58

ホーム - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-19 13:47
浙ICP备14020137号-1 $お客様$