mcp-servers
Install, configure, authenticate, and troubleshoot MCP (Model Context Protocol) servers for…
Finds out why a data quality check failed or errored, looks at the rows it matched, and recommends the fix. Also covers a materialized view refresh that the data quality gate did not publish. Use when asked why a check is red, what rows failed, why a view shows "Not published",
$ npx -y skills add posthog/posthog --skill debugging-failed-data-quality-checks --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/debugging-failed-data-quality-checksContext preview
The summary Claude sees to decide when to auto-load this skill.
Finds out why a data quality check failed or errored, looks at the rows it matched, and recommends the fix. Also covers a materialized view refresh that the data quality gate did not publish. Use when asked why a check is red, what rows failed, why a view shows "Not published",
name: debugging-failed-data-quality-checks description: > Finds out why a data quality check failed or errored, looks at the rows it matched, and recommends the fix. Also covers a materialized view refresh that the data quality gate did not publish. Use when asked why a check is red, what rows failed, why a view shows "Not published", why a view's data is stale after a refresh, or how to get a blocked refresh published. Trigger terms: failed check, failing rows, errored check, data quality failure, not published, blocked materialization, unpublished refresh, check keeps failing.
A check run ends in one of four states. Read the state first, because it decides where the problem is:
| Status | Meaning | Where to look | | --------- | ---------------------------------------------- | -------------------------------------- | | `failed` | The query ran and the assertion found bad data | The data, or the assertion itself | | `errored` | The query could not run, so nothing was judged | The error text (never a data problem) | | `skipped` | The subject is gone | Whether the table or view still exists | | `passed` | The assertion held | Nothing |
`row_count` and `freshness` checks judge `observed_value`, not `failed_row_count`. A failed `row_count` means the count fell outside its bounds. A failed `freshness` means the newest row is older than the limit.
| Tool | Purpose | | ------------------------------------ | --------------------------------------------------------------------------- | | `posthog:data-quality-check-results` | A check's recent runs, with `compiled_query`, `error` and the config it ran | | `posthog:execute-sql` | Re-run a run's `compiled_query` to see the failing rows | | `posthog:data-quality-check-run` | Run a check now | | `posthog:data-quality-check-update` | Fix an assertion or change its severity | | `view-get` | A view's definition and status | | `view-run-history` | A view's materialization runs and their errors | | `view-run` | Materialize a view again |
To find the failing checks, query `system.information_schema.data_quality_checks` for `last_status IN ('failed', 'errored')`, or `system.information_schema.data_quality_health` for a subject's verdict.
Call `posthog:data-quality-check-results` for the check. On the newest run, read:
Retention clears `compiled_query` after 30 days. For an older run, run the check again.
Run `compiled_query` with `posthog:execute-sql`. An empty `compiled_query` means there is nothing to replay: retention cleared it, or a gated run could not read the view's definition. Look at what it matched before you report anything. A failure means one of two things: the data is bad, or the assertion is wrong. The rows tell you which.
When `audited_staged_refresh` is true, the query does not read the published table. It holds the view's definition in a `WITH` clause and reads the view's source tables now. The sources may have changed since the run, so the rows and the count can differ from the run. A query that now returns zero rows does not prove that the refresh was clean. Compare with `failed_row_count` on the run.
An errored run did not judge the data. Match the error text:
| Error text | Cause and fix | | ------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `The staged files could not be read, so this data was not audited.` | The gate could not reach the refresh before publish. The refresh publishes without a verdict. Run the view again. | | `Metric checks cannot audit staged data.` | A metric check was part of a gated refresh. It runs on its own schedule instead. | | `The check query returned no rows.` | The aggregate query returned nothing. Run the check again and report it if it repeats.
:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Repo: posthog/posthog
Install, configure, authenticate, and troubleshoot MCP (Model Context Protocol) servers for…
Designs and runs task-specific JavaScript harnesses with the `workflow` tool. Use for broad,…
How and when to delegate work to subagents via the `subagent` tool (Explore, Plan, General).…
Explains what a member or a role can do in a PostHog project, using the access control MCP…
Analyze the most expensive users in AI observability and explain why they cost so much. Use…
Inspect and compare offline AI evaluation experiments, diagnose case-level regressions, and…