data-validation by anthropics/knowledge-work-plugins
npx skills add https://github.com/anthropics/knowledge-work-plugins --skill data-validation交付前质量检查清单、常见数据分析陷阱、结果合理性检查,以及确保可复现性的文档标准。
在与利益相关者分享任何分析之前,请运行此检查清单。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
问题:多对多连接会默默地成倍增加行数,导致计数和总和膨胀。
如何检测:
-- 检查连接前后的行数
SELECT COUNT(*) FROM table_a; -- 1,000
SELECT COUNT(*) FROM table_a a JOIN table_b b ON a.id = b.a_id; -- 3,500 (有问题)
如何预防:
COUNT(DISTINCT a.id) 而不是 COUNT(*)问题:只分析今天存在的实体,忽略了那些已被删除、流失或失败的实体。
示例:
如何预防:在得出结论之前,先问"谁不在这个数据集中?"
问题:将部分周期与完整周期进行比较。
示例:
如何预防:始终筛选到完整的周期,或者比较同月同日/相同天数。
问题:分母在不同时期之间发生变化,使得比率无法比较。
示例:
如何预防:在所有比较的时期中使用一致的定义。注明任何定义变更。
问题:当组大小不同时,对预先计算的平均值进行平均会得到错误的结果。
示例:
如何预防:始终从原始数据聚合。切勿对预先聚合的平均值进行平均。
问题:不同的数据源使用不同的时区,导致错位。
示例:
如何预防:在分析之前将所有时间戳标准化为单个时区(建议使用 UTC)。记录所使用的时区。
问题:细分是根据你正在衡量的结果来定义的,造成了循环逻辑。
示例:
如何预防:根据处理前的特征定义细分,而不是根据结果。
对于分析中的任何关键数字,验证它通过了"嗅觉测试":
| 指标类型 | 合理性检查 |
|---|---|
| 用户数量 | 这与已知的 MAU/DAU 数字匹配吗? |
| 收入 | 与已知的 ARR 相比,这个数量级正确吗? |
| 转化率 | 这个值在 0% 到 100% 之间吗?与仪表板数字匹配吗? |
| 增长率 | 50%+ 的月环比增长是现实的,还是存在数据问题? |
| 平均值 | 根据你对分布的了解,这个平均值合理吗? |
| 百分比 | 细分百分比总和是否约为 100%? |
每个重要的分析都应包括:
## 分析:[标题]
### 问题
[正在回答的具体问题]
### 数据源
- 表:[schema.table_name](截至[日期])
- 表:[schema.other_table](截至[日期])
- 文件:[filename](来源:[它来自哪里])
### 定义
- [指标 A]:[具体计算方式]
- [细分 X]:[具体确定成员资格的方式]
- [时间段]:[开始日期] 至 [结束日期],[时区]
### 方法
1. [分析方法的步骤 1]
2. [步骤 2]
3. [步骤 3]
### 假设和限制
- [假设 1 及其合理性]
- [限制 1 及其对结论的潜在影响]
### 关键发现
1. [发现 1 及支持证据]
2. [发现 2 及支持证据]
### SQL 查询
[所有使用的查询,附带注释]
### 注意事项
- [读者在据此采取行动前应该知道的事情]
对于任何可能被重用的代码(SQL、Python):
"""
分析:月度群组留存率
作者:[姓名]
日期:[日期]
数据源:events 表,users 表
上次验证:[日期] -- 结果与仪表板匹配度在 2% 以内
目的:
根据首次活动日期计算月度用户留存群组。
假设:
- "活跃"意味着当月至少有一个事件
- 排除测试/内部账户(user_type != 'internal')
- 全程使用 UTC 日期
输出:
群组留存矩阵,行为 cohort_month,列为 months_since_signup。
值为留存率(0-100%)。
"""
每周安装数
227
代码仓库
GitHub 星标数
8.9K
首次出现
Jan 31, 2026
安全审计
安装于
opencode208
codex195
gemini-cli192
github-copilot183
kimi-cli173
amp172
Pre-delivery QA checklist, common data analysis pitfalls, result sanity checking, and documentation standards for reproducibility.
Run through this checklist before sharing any analysis with stakeholders.
The problem : A many-to-many join silently multiplies rows, inflating counts and sums.
How to detect :
-- Check row count before and after join
SELECT COUNT(*) FROM table_a; -- 1,000
SELECT COUNT(*) FROM table_a a JOIN table_b b ON a.id = b.a_id; -- 3,500 (uh oh)
How to prevent :
COUNT(DISTINCT a.id) instead of COUNT(*) when counting entities through joinsThe problem : Analyzing only entities that exist today, ignoring those that were deleted, churned, or failed.
Examples :
How to prevent : Ask "who is NOT in this dataset?" before drawing conclusions.
The problem : Comparing a partial period to a full period.
Examples :
How to prevent : Always filter to complete periods, or compare same-day-of-month / same-number-of-days.
The problem : The denominator changes between periods, making rates incomparable.
Examples :
How to prevent : Use consistent definitions across all compared periods. Note any definition changes.
The problem : Averaging pre-computed averages gives wrong results when group sizes differ.
Example :
How to prevent : Always aggregate from raw data. Never average pre-aggregated averages.
The problem : Different data sources use different timezones, causing misalignment.
Examples :
How to prevent : Standardize all timestamps to a single timezone (UTC recommended) before analysis. Document the timezone used.
The problem : Segments are defined by the outcome you're measuring, creating circular logic.
Examples :
How to prevent : Define segments based on pre-treatment characteristics, not outcomes.
For any key number in your analysis, verify it passes the "smell test":
| Metric Type | Sanity Check |
|---|---|
| User counts | Does this match known MAU/DAU figures? |
| Revenue | Is this in the right order of magnitude vs. known ARR? |
| Conversion rates | Is this between 0% and 100%? Does it match dashboard figures? |
| Growth rates | Is 50%+ MoM growth realistic, or is there a data issue? |
| Averages | Is the average reasonable given what you know about the distribution? |
| Percentages | Do segment percentages sum to ~100%? |
Every non-trivial analysis should include:
## Analysis: [Title]
### Question
[The specific question being answered]
### Data Sources
- Table: [schema.table_name] (as of [date])
- Table: [schema.other_table] (as of [date])
- File: [filename] (source: [where it came from])
### Definitions
- [Metric A]: [Exactly how it's calculated]
- [Segment X]: [Exactly how membership is determined]
- [Time period]: [Start date] to [end date], [timezone]
### Methodology
1. [Step 1 of the analysis approach]
2. [Step 2]
3. [Step 3]
### Assumptions and Limitations
- [Assumption 1 and why it's reasonable]
- [Limitation 1 and its potential impact on conclusions]
### Key Findings
1. [Finding 1 with supporting evidence]
2. [Finding 2 with supporting evidence]
### SQL Queries
[All queries used, with comments]
### Caveats
- [Things the reader should know before acting on this]
For any code (SQL, Python) that may be reused:
"""
Analysis: Monthly Cohort Retention
Author: [Name]
Date: [Date]
Data Source: events table, users table
Last Validated: [Date] -- results matched dashboard within 2%
Purpose:
Calculate monthly user retention cohorts based on first activity date.
Assumptions:
- "Active" means at least one event in the month
- Excludes test/internal accounts (user_type != 'internal')
- Uses UTC dates throughout
Output:
Cohort retention matrix with cohort_month rows and months_since_signup columns.
Values are retention rates (0-100%).
"""
Weekly Installs
227
Repository
GitHub Stars
8.9K
First Seen
Jan 31, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode208
codex195
gemini-cli192
github-copilot183
kimi-cli173
amp172
Excel财务建模规范与xlsx文件处理指南:专业格式、零错误公式与数据分析
39,600 周安装
价值主张模板:6步JTBD框架生成客户价值主张,产品策略与营销定位指南
249 周安装
产品头脑风暴工具:从产品经理、设计师、工程师多视角生成创意,筛选最佳方案
249 周安装
JavaScript 事实核查器 - 验证 33 JS 概念准确性,确保代码示例与 MDN 文档正确
249 周安装
阿里云函数计算AgentRun OpenAPI管理指南:运行时、沙箱、模型服务配置
250 周安装
发票模板生成技能 - 使用Python ReportLab快速创建专业PDF发票,支持批量生成与定制
250 周安装
移动优先设计指南:响应式网页开发、性能优化与渐进增强最佳实践
250 周安装