data-insight-agent: Skill for Claude Code

.claude/skills/data-analysis/SKILL.md

data-analysis is a skill for Claude Code from shanggqm/data-insight-agent. It costs 56 tokens per session (1,477 once invoked), scanned A, original, MIT.

A structured workflow for querying data, calculating statistics, and producing Markdown and HTML reports. It is intended for database-backed analysis and handles time zones and large result sets explicitly.

In plain words
What is it for?
Use it to analyze trends, distributions, comparisons, relationships, and unusual values from database data, then save the source data, processed results, and reports.
Why use it?
It reduces the risk of incorrect time-based results, overloaded conversations with raw data, and inconsistent report output.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths.

This is shanggqm/data-insight-agent's own configuration. It tells Claude Code how to work on data-insight-agent itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything data-insight-agent configures →

Reuse

Borrowing it

Nothing to install: this file belongs to shanggqm/data-insight-agent. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/shanggqm/data-insight-agent/main/.claude/skills/data-analysis/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/shanggqm/data-insight-agent

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for data-analysis

README.md
[![agentmods](https://agentmods.dev/badge/skills/shanggqm/data-insight-agent/data-analysis/github.svg)](https://agentmods.dev/skills/shanggqm/data-insight-agent/data-analysis)
Your own site
<a href="https://agentmods.dev/skills/shanggqm/data-insight-agent/data-analysis"><img src="https://agentmods.dev/badge/skills/shanggqm/data-insight-agent/data-analysis/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for data-analysis

Your own site · 80×15
<a href="https://agentmods.dev/skills/shanggqm/data-insight-agent/data-analysis"><img src="https://agentmods.dev/badge/skills/shanggqm/data-insight-agent/data-analysis.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,477 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00056 $0.01477
Opus 5.5 $0.00022 $0.00591
Sonnet 5.5 $0.00011 $0.00295
Haiku 4.5 $0.00006 $0.00148

Measured 2mo ago against content hash fa70a3ab1580, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

data-analysis scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/generate_index.mjs), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/data-analysis/SKILL.md · 172 lines

How it starts

The opening of the file, as written. The whole thing — 172 lines — stays where its author put it; the contents beside it link to each section on GitHub.

数据分析技能

标准化数据分析工作流,确保分析高效、结果可靠、输出规范。

激活条件

  • 用户需要查询数据库并分析数据
  • 用户需要生成数据分析报告
  • 涉及"数据分析"、"统计"、"报告"、"洞察"等关键词

核心约束

1. 时区处理

首次分析时确认数据库时区设定,常见情况:

存储时区 查询处理 展示处理
UTC 查询条件转 UTC 结果转本地时区
本地时区 直接使用 直接展示
时间戳 按需转换 转本地时区

确认后记录到对应的 schema 文件中,后续分析直接参考。

2. 输出规范

{workspace}/analysis-output/{topic}_{YYYYMMDD_HHmmss}/
├── raw_data/           # 原始查询结果(仅复杂场景)
├── processed_data/     # 计算后的分析数据(JSON格式,供HTML读取)
│   └── charts_data.json
├── report.md           # Markdown 报告
└── report.html         # 可视化报告(幻灯片样式)

3. 数据处理原则

  • 禁止将大量原始数据读入对话上下文
  • 优先通过 SQL 聚合直接得出统计结果
  • 仅当数据量大或查询复杂时,才落地本地用代码处理

工作流程

Step 1: 需求理解与 Schema 获取

  1. 识别分析主题、时间范围、关注维度
  2. 查看 schemas/ 是否有对应表结构,无则通过工具获取并保存
  3. 确定查询范围:哪些表、哪些字段、什么条件

Schema 文件: schemas/{source}_{name}.md

Step 2: 设计分析方案

根据数据特点选择分析维度(参考 references/analysis_perspectives.md):

  • 描述性分析:规模、分布、集中趋势、离散程度
  • 时序分析:趋势、周期、同环比
  • 对比分析:分群、分类、交叉对比
  • 关联分析:相关性、因果推断
  • 异常分析:离群值、突变点

输出简要分析方案后再执行查询。

Step 3: 数据查询与计算

可用工具参考 dbtool/README.md,根据用户指定或默认使用 MySQL。

策略选择

简单场景(优先):直接用 SQL 聚合

-- 通过 GROUP BY、COUNT、SUM、AVG 等直接得出统计结果
-- 多个统计需求可并行发起多条查询
SELECT DATE(created_at) as date, COUNT(*) as count FROM table GROUP BY date;

复杂场景(降级):当遇到以下情况时,才落地本地处理

  • 查询超时
  • 需要跨表复杂计算
  • 数据量过大无法一次返回
  • SQL 难以表达的统计逻辑
1. 查询原始数据保存到 raw_data/
2. 在输出目录编写 Node.js 脚本处理
3. 结果保存到 processed_data/charts_data.json

Step 4: 生成报告

Markdown 报告(参考 templates/report_template.md):

  • 执行摘要:核心发现 + 关键指标
  • 详细分析:按维度展开
  • 洞察建议:结论 + 行动项
  • 附录:数据说明 + 计算口径

HTML 幻灯片报告(参考 templates/visualization_template.html):

技术栈:

  • Reveal.js:幻灯片框架,支持键盘翻页、过渡动画、演讲者模式(按 S 键)
  • Tailwind CSS:原子化 CSS,直接用类名布局
  • ECharts:图表引擎,暗金色主题
  • Animate.css:元素入场动画(配合 fragment)
  • Remix Icon:图标库

设计规范:

  • 暗金色主题(#0f0f1a 背景 + #d4af37 金色)
  • 每页一个观点 + 图表 + 洞察说明
  • 数据必须从 processed_data/charts_data.json 读取,禁止硬编码

Read the full file on GitHub · 172 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 172 lines · 56 tokens per session scan A fa70a3ab1580

Subscribe to this mod's changes

data-analysis is a skill published in the GitHub repository shanggqm/data-insight-agent (5 stars, last pushed 10mo ago), licensed MIT. It adds 56 tokens to every session and 1,477 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

data-analysis compared with skills from other repositories

data-analysis next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
data-analysisshanggqm/data-insight-agentSkill510mo agoMITA56Claude Code
imagegenopenai/codexSkill133kyesterdayApache-2.0A113Codex
playwright-climicrosoft/playwrightSkill99kyesterdayApache-2.0A19Claude Code
local-ai-agentsmicrosoft/ai-agents-for-beginnersSkill79k4d agoMITA200Claude Code, Codex
systematic-debuggingobra/superpowersSkill313k3d agoMITA21Claude Code
next-cache-components-adoptionvercel/next.jsSkill143kyesterdayMITA95Claude Code
next-partial-prefetching-adoptionvercel/next.jsSkill143kyesterdayMITA103Claude Code