data-validator

data-validator is a skill for Claude Code, Codex 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 CodeCodex

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.

agentmods
npx agentmods add skills/fafa-ai-data-lab/ai-data-analyst-agent/data-validator
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, Codex.

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.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.svg" alt="Measured on agentmods" 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. Scan, not verified.
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 $0.00112 $0.02676
Opus 5 $0.00056 $0.01338
Sonnet 5 $0.00022 $0.00535
Haiku 4.5 $0.00011 $0.00268

Measured 4d ago against content hash 6666524eecbe, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 4d 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.mdR-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. 4d 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 (40 stars, last pushed 2mo ago), licensed MIT. It adds 112 tokens to every session and 2,676 once invoked, about $0.0006 per session on Opus 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.

Related

Other skills, from other repositories

clawhub

Dingo: A Comprehensive AI Data, Model and Application Quality Evaluation Tool.

MigoXLab/dingo · 0 tokens

dingo-verify

Use when the user wants to fact-check an article or verify factual claims in a document. Triggers on: "fact-check", "verify article", "check facts", "文章事实核查", "验证文章". Runs Dingo's ArticleFactChecker via SDK to extract and verify all factual claims with web search evidence.

MigoXLab/dingo · 70 tokens

fetch-data

取数 / 查数据 / 拉数据 / 跑 SQL。把自然语言取数需求转为 SQL,经数据湖仓执行后返回查询结果供下游分析。任何需要业务数据的任务在工作区缺少对应文件时都必须先调用此技能——覆盖 BI 业务分析、留存 / 转化 / 同期群分析、数据探索 EDA、统计建模、定量计算、元数据查询、数据查询。命中任一即触发:(1) 直接索要指标或记录,如「DAU 多少」「上月销售额」「3 月留存率」「这个客户的订单」;(2) 取数口语,如「查 / 查一下 / 取一下 / 拉一下 / 抓数据 / 找数据 / 搜数据 / 跑 SQL / 写 SQL / 导出 / 缺数据 / 没数据 / 数据不够」;(3) 涉及数据来源,如「从语义层 / 数据湖仓…

agentscope-ai/QwenPaw-Data · 276 tokens

bi-causal-attribution

从运营周报、活动文档、对话输入或文档工具 API 中提取业务事件,与指标异常时间窗口对齐,生成有证据支撑的因果归因假设并排序。当已知指标存在异常波动、需要从外部文档证据中解释"为什么"时调用。.

agentscope-ai/QwenPaw-Data · 76 tokens

bi-clustering

将特征相似或策略上需区分的业务对象(用户、产品、门店等)划为若干群组。根据分群分析的目的。.

agentscope-ai/QwenPaw-Data · 107 tokens

skill-hub-guide

Data Skill-Hub 技能仓库使用指南。在执行任何数据分析任务前,必须优先加载此技能以了解可用技能体系和调用规范。.

agentscope-ai/QwenPaw-Data · 39 tokens