Analytics result qa

From makifbaysal/tasktrooper · View interactive version

Analytics result qa is an AI agent skill from the GitHub repository makifbaysal/tasktrooper. Use when you are about to hand off any number, table, chart or analysis someone will act on (a metric query, a dbt mart, a report, an experiment readout) — the pre-delivery checklist for data quality, calculation, reasonableness and presentation, and the pitfalls that produce plausible wrong numbers

How to use this skill

Skill file

Analytics Result QA

Overview

The dangerous analytics bug is not the query that fails — it is the one that returns a plausible number. A fan-out join, a partial month, a shifted denominator: each produces a result that looks fine and is wrong by 20%. This checklist runs before any number leaves your run, and the checks that can be automated become tests.

Core principle: recompute every headline number a second way, and turn every check you did by hand into a test or a dbt test that keeps doing it.

1. Before computing: the question and the definitions

2. Pre-delivery checklist

Data quality

Calculation

Reasonableness

Presentation

3. Pitfalls that produce plausible wrong numbers

| Pitfall | How it happens | Detect / prevent |

|---|---|---|

| Join fan-out | one-to-many join before aggregating | row counts before and after; aggregate before joining; count(distinct key) |

| Survivorship | only entities that still exist are analysed | ask who is missing (churned, deleted, failed) |

| Incomplete period | current month compared with a full one | complete periods only, or same-number-of-days comparisons |

| Denominator shift | the definition of "eligible" changed between periods | one definition across compared periods; note any change |

| Average of averages | pre-aggregated means averaged across unequal groups | aggregate from rows or weight by group size |

| Timezone mismatch | UTC events bucketed against local-time days | convert to one timezone before truncating; state it |

| Selection by outcome | segment defined by the result being measured | segment on pre-treatment attributes |

| Look-ahead | a later fact used to explain an earlier event | as-of joins; only information available at the time |

| Simpson's paradox | mix shift reverses the trend in the aggregate | check the key segments |

4. Recompute it another way

  1. Compute the headline number by a second route (from a different table, bottom-up vs top-down, SQL vs pandas) and compare.
  2. Trace three individual entities by hand through every step.
  3. Reverse-check: per-unit value × count ≈ total.
  4. Boundary slices: one day, one customer, one category — do the micro-results make sense?

5. Red-flag values

Each one is investigated before delivery, not footnoted after.

6. Make the checks permanent

| Manual check | Permanent form |

|---|---|

| Key is unique after the join | dbt unique test / merge(validate="many_to_one") |

| Parts sum to the total | a singular dbt test or a pytest assertion on the fixture |

| Rate within 0–1 | dbt accepted_range (if dbt_utils is installed) or a pandera Field(ge=0, le=1) |

| Matches the finance figure within 1% | a reconciliation test against a fixture, or a monitored check in the pipeline |

7. Your verdict, in the closing message

State one of:

Include the reconciliation you did ("total revenue 1.284M matches the finance export within 0.3%").

Common Mistakes

Red Flags

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.