data-validator

data-validator is a skill for Claude Code from fafa-ai-data-lab/ai-data-analyst-agent. It costs 112 tokens per session (2,676 once invoked), scanned A, original, MIT.

A separate, read-only checker for SQL, downloaded data, and analysis reports. It applies topic-specific rules and sanity checks before results are used or delivered.

In plain words
What is it for?
Use it to review SQL before running it, validate report data, check completed analysis reports, or test whether query results look reasonable.
Why use it?
It provides an independent review, reducing the risk that the person or process that produced the work overlooks its own errors. It checks issues such as unknown fields, type mismatches, missing values, unusual changes, and unsupported numbers.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions subagents.

Good fit Use it to review SQL before running it, validate report data, check completed analysis reports, or test whether query results look reasonable.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/fafa-ai-data-lab/ai-data-analyst-agent/data-validator
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add fafa-ai-data-lab/ai-data-analyst-agent --skill data-validator
Clone the repo
git clone --depth 1 https://github.com/fafa-ai-data-lab/ai-data-analyst-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-validator

README.md
[![agentmods](https://agentmods.dev/badge/skills/fafa-ai-data-lab/ai-data-analyst-agent/data-validator/github.svg)](https://agentmods.dev/skills/fafa-ai-data-lab/ai-data-analyst-agent/data-validator)
Your own site
<a href="https://agentmods.dev/skills/fafa-ai-data-lab/ai-data-analyst-agent/data-validator"><img src="https://agentmods.dev/badge/skills/fafa-ai-data-lab/ai-data-analyst-agent/data-validator/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-validator

Your own site · 80×15
<a href="https://agentmods.dev/skills/fafa-ai-data-lab/ai-data-analyst-agent/data-validator"><img src="https://agentmods.dev/badge/skills/fafa-ai-data-lab/ai-data-analyst-agent/data-validator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 112 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,676 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.00112 $0.02676
Opus 5.5 $0.00045 $0.01070
Sonnet 5.5 $0.00022 $0.00535
Haiku 4.5 $0.00011 $0.00268

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

Security

Grade A, and why

data-validator 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 1mo ago.

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.

skills/data-validator/SKILL.md · 207 lines

How it starts

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

Data Validator

独立于主流程的数据校验,避免自评偏差。自评不可信,校验必须分离(对应 Anthropic harness 设计原则:让生产者评判自己的产物有系统性偏差,验证必须交给独立 agent)。

关键约束:这个 agent 没有 Write / Edit 权限(见上方 allowed-tools)。它只能 Read / Grep / Bash(只读) / Glob,物理上无法改你的文件——它的唯一产出是一份 PASS / WARNING / FAIL 校验报告。

校验规则按主题分文件存放在 rules/,按场景按需加载。每被纠正一个错误 → 追加一条规则,下次自动生效。


校验场景(按需加载规则文件)

1. SQL 校验(写完 SQL、提交前)

Step 1:识别 SQL 类型并加载规则

  • AB 实验 SQL(含实验分组逻辑)→ 加载 rules/abtest-rules.md
  • 涉及收入 / 订阅 / 付费 / 业务核心指标 → 加载你自己的 rules/<domain>-metric-rules.md(按 _TEMPLATE.md 建)
  • 所有 SQL → 加载你自己的 rules/<your>-field-traps.md(字段坑库)

Step 2:validator 用 Grep/regex 逐条 R-* 检查 SQL 文本,命中就报警。

Step 3:补充检查(规则不覆盖的)

  • Pre-flight:未知表/字段是否已 DESCRIBE 确认
  • 类型匹配:WHERE/JOIN 条件两侧类型是否一致

Step 4(关键):覆盖盲区检测 —— 见下文「## 覆盖盲区检测」。


2. 报表数据校验(数据拉完、写入报表/文档前)

加载:你的业务口径规则 + 文档格式规则(如有)。

规则不覆盖的额外检查:

  • 环比合理性(如 ±30% 预警)
  • 完整性(NULL / 0 / 缺失)
  • 节假日 / 异常窗口过滤
  • 跨源一致性(vs 已有看板 / 上一期)

3. 分析报告校验(写完、交付前)

加载:rules/report-style.md(必) + rules/sanity-check.md 的数字 grounding 规则。

校验方式:grep 报告 markdown 文本,逐条 R-RPT-* 检查。emoji 单独正则扫一遍。


4. SQL 结果合理性校验(SQL 跑完、用结果之前)

加载:rules/sanity-check.md(必)。

触发时机:

  • 跑完 SQL 拿到结果,用结果之前
  • 写完报告,交付之前

输入:SQL 文本 + 结果摘要(行数、关键聚合值、Top N 行)+ 业务上下文(预期粒度、对比基线)。

校验方式:validator 逐条 R-SAN-* 检查(结果空 / JOIN 膨胀 / 缺过滤 / 数字溯源)。

与场景 1 的关系:场景 1 是写 SQL 时的预防,场景 4 是跑完后的兜底,互补不重复。


5. ETL 修复回归校验(数据回刷完成后)

加载:你的 rules/known-bug-regression.md(按 _TEMPLATE.md 自建)。

机制:每修一个 ETL bug,agent 自决追加一条回归规则,含:bug 描述(根因 + 触发条件)、修复版本/日期、影响表、case、4 类回归 SQL(分布 / 业务规则 / 异常值 / 守恒)。长期形成 known-pattern 库。

这个文件高度业务相关(含真实表名、case),不要开源;本仓库只提供机制说明和模板。


6. 聚合/分摊表守恒对账(建表 / 改口径时)

加载:rules/sanity-check.md 的 R-SAN-007(必)。

核心:任何把上游度量(成本/收入/用量/计数)分摊或聚合到新粒度的表,必须 SUM(加工后) ≈ SUM(上游),差异 < 0.5%。单看加工表自身永远发现不了「少算/错配」,必须对上游总账。


覆盖盲区检测(每次必做)

校验完已知规则后,validator 必须主动识别「规则库没覆盖的新场景」,让人评估是否要沉淀新规则。否则规则库永远停留在已踩过的坑,新坑还是会被踩。

反幻觉铁律

涉及「与权威口径对比」的盲区,必须实际 Read 权威源文件验证,禁止凭印象判断,否则会 false positive 误报。涉及「表/字段是否文档化」的盲区,靠 grep 规则文件判断即可。

Read the full file on GitHub · 207 lines

Files

What ships with it

7 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. 1mo ago First seen · 207 lines · 112 tokens per session scan A 6666524eecbe

Subscribe to this mod's changes

data-validator is a skill published in the GitHub repository fafa-ai-data-lab/ai-data-analyst-agent (45 stars, last pushed 3mo ago), licensed MIT. It adds 112 tokens to every session and 2,676 once invoked, about $0.0004 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-30.