debugging-failed-data-quality-checks
This skill debugs failed or errored data quality checks by examining their run history, displaying matching rows, and identifying root causes in either the…
Identity proven by GitHub's verified organisation badge (PostHog)
- Agents
- Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode, claude.ai and API
- License
- MIT (permissive)
- Pin
- 244c70dpinned Oct 9, 2026
- Context cost
- about 1,900 tokenswhen the skill loads
- GitHub stars
- 40,191on posthog/posthog
- Scripts
- None found
What it does
“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.”
Generated summary from the skill's own text
This skill debugs failed or errored data quality checks by examining their run history, displaying matching rows, and identifying root causes in either the data or the assertion logic. It also handles materialized view refresh blocks triggered by data quality gates, helping users understand why views show stale data or fail to publish.
When to use it
- A data quality check shows failed or errored status and needs root cause analysis
- Rows matched by a check need to be examined and displayed to the user
- A materialized view shows Not published error after a refresh attempt
- A materialized view continued serving stale data despite a refresh
When not to
- Writing or authoring new data quality checks from scratch
- Finding failing views across the warehouse without a specific check context
- The check has passed and no debugging is needed
Install
These commands install from the publisher's repository and need no account.
skills CLI
npx skills add posthog/posthog --skill debugging-failed-data-quality-checksInstalls from the repository's default branch, which may have changed since the commit we checked.
GitHub CLI 2.90 or later
gh skill install posthog/posthog debugging-failed-data-quality-checks@244c70d066c0b441e3b8cc6875f914c5e09c42b3Installs the commit we checked (244c70d).
Copy by hand
Download the folder at 244c70d and put it in .claude/skills/debugging-failed-data-quality-checks for Claude Code and in .agents/skills/debugging-failed-data-quality-checks for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.
Claude Code plugin
/plugin install posthog@claude-plugins-officialThe publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.
Copy for your agent
A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.
Prompt
Install the agent skill "debugging-failed-data-quality-checks" by PostHog. Source, pinned to commit 244c70d066c0b441e3b8cc6875f914c5e09c42b3: https://github.com/posthog/posthog/tree/244c70d066c0b441e3b8cc6875f914c5e09c42b3/products/data_quality/skills/debugging-failed-data-quality-checks 1. Download that folder at exactly this commit. Do not use the default branch. 2. Copy every file unchanged, keeping the folder structure, into .claude/skills/debugging-failed-data-quality-checks/ for Claude Code and .agents/skills/debugging-failed-data-quality-checks/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist. 3. Do not edit the files, and do not run any script in the folder unless I ask you to. 4. When you are done, list the files you copied and where you put them. Listing and checks: https://www.agentnative.dev/skills/posthog/debugging-failed-data-quality-checks
SKILL.md at the pin
---
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.
---
# Debugging failed data quality checks
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.
## When to use this skill
- A check or a subject shows `failed` or `errored` and the user wants to know why
- The user wants to see the rows a check matched
- A materialized view's latest run shows an error that starts with `Not published:`
- A view kept serving old data after a refresh, and the data quality gate is on
- Another skill (`authoring-data-quality-checks` or `auditing-warehouse-view-health`) found a failing check or a blocked view and handed it off
## Available tools
| 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.
## Workflow
### Step 1: Read the run
Call `posthog:data-quality-check-results` for the check.
On the newest run, read:
- `status` and `error`
- `check_config` and `check_severity`: what the run asserted, which can differ from the check today
- `compiled_query`: HogQL that selects the failing rows. For `row_count` it returns the count instead, so judge that check by `observed_value`.
- `audited_staged_refresh`: true when the run was part of a gated audit of a refresh before it was published. An errored run can carry it too, so read `status` first.
Retention clears `compiled_query` after 30 days.
For an older run, run the check again.
### Step 2: Look at the failing rows
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.
### Step 3: Read an errored 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. |
| `A check that reads another subject needs an initiator or author…` | An automatic run of a `custom_sql` or `relationships` check has no user to run as. A manual run works. An edit to the check's assertion makes the editor its author. |
| A HogQL or ClickHouse error | A column name typo, a type mismatch, or a query that ran out of time. Fix the config, or add `lookback_hours`. |
Two messages come with `skipped`: `The subject was deleted.` and `The subject no longer resolves.`
The table or view is gone.
Delete the check or point it at the replacement.
### Step 4: Understand a blocked refresh
When the team turns on "Block materialization on failing checks", a materialized view's error-severity checks run on each refresh before it is published.
If one fails:
- The view's run shows an error that starts with `Not published:` (see `view-run-history`).
- The previous version of the view keeps serving queries.
- Downstream views in the same DAG are skipped for this run.
- The view's schedule is not paused.
The next scheduled refresh runs the checks again.
Warn-severity checks never block a refresh.
### Step 5: Recover
Fix the cause, then prove it:
1. Fix the upstream data, or fix the assertion with `posthog:data-quality-check-update`.
If the failure is real but must not block the refresh, change `severity` to `warn`.
2. For a blocked view, call `view-run` to materialize it again.
Otherwise call `posthog:data-quality-check-run`.
3. Read `posthog:data-quality-check-results` again and confirm the newest run passed.
## Important notes
- Do not change a check's severity or assertion only to turn it green.
Confirm with the user first.
- `errored` is never evidence of bad data, and `passed` on an empty table is not evidence of good data.
- A check reports against its subject, but a `custom_sql` query can read other tables.
Read the query before you blame the subject.
## Related
- `authoring-data-quality-checks`: writing and choosing checks
- `auditing-warehouse-view-health`: finding failing materialized views
From posthog/posthog at 244c70d, shown as plain text under its license: MIT (permissive). The license text is in LICENSE.
View SKILL.md on GitHub at 244c70dFiles
- SKILL.md8.2 KB · acc3c2c43d9b
1 file, 8.2 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.
Skill folder on GitHub at 244c70dAlso in
The same SKILL.md content appears in these places too. We list it once and credit the oldest public source.
More from PostHog
analyzing-experiment-session-replays
This skill enables agents to analyze session recordings from experiment variants to identify behavioral differences between control and test groups.
Claude Code, Codex, Cursor +4 · about 2.3K tokens · pinned 6 days ago
analyzing-offline-evaluations
This skill inspects and compares offline AI evaluation experiments stored in PostHog, diagnoses case-level regressions, and tracks scorer changes across…
Claude Code, Codex, Cursor +4 · about 1.5K tokens · pinned 6 days ago
auditing-warehouse-view-health
Audits materialized views in a PostHog data warehouse to identify failed views and flag unused ones that waste compute resources.
Claude Code, Codex, Cursor +4 · about 1.4K tokens · pinned 6 days ago
authoring-data-quality-checks
This skill adds data quality checks (like dbt tests) on warehouse tables, views, and HogQL metrics, supporting assertions such as not-null, uniqueness…
Claude Code, Codex, Cursor +4 · about 2.5K tokens · pinned 6 days ago
authoring-scouts
This skill helps engineers write, edit, and adapt PostHog Signals scouts, scheduled agents that scan projects and report findings to an inbox.
Claude Code, Codex, Cursor +4 · about 10.6K tokens · pinned 6 days ago
building-a-dashboard
This skill constructs or modifies PostHog dashboards by selecting and arranging insight tiles.
Claude Code, Codex, Cursor +4 · about 2.1K tokens · pinned 6 days ago
Related in Data and databases
data-table-manager
This skill manages n8n Data Tables through creation, import, querying, and mutation operations.
by n8nOfficial publisher
Claude Code, Codex, Cursor +3 · about 2.1K tokens · pinned 6 days ago
algolia-automation
This skill automates Algolia search and indexing operations through the Rube MCP interface.
by ComposioOfficial publisher
Claude Code, Codex, Cursor +3 · about 690 tokens · pinned 6 days ago
expo-sqlite
This skill enables SQLite database operations in Expo and React Native apps for structured data storage, offline queues, and persistent caches.
by ExpoOfficial publisher
Claude Code, Codex, Cursor +4 · about 2.6K tokens · pinned 6 days ago
prisma-8
This skill helps agents work with Prisma 8, a contract-first data layer for TypeScript projects.
by PrismaOfficial publisher
Contains scripts
Claude Code, Codex, Cursor +3 · about 3.5K tokens · pinned 6 days ago
configuring-experiment-analytics
Configures how PostHog measures experiment impact by setting exposure criteria (who counts in the analysis), choosing metrics to track (mean, funnel, ratio…
by PostHogOfficial publisher
Claude Code, Codex, Cursor +4 · about 3.4K tokens · pinned 6 days ago
configuring-experiment-rollout
Configures variant split and overall rollout percentage for PostHog experiments, determining who sees which test variant and what percentage of users enter…
by PostHogOfficial publisher
Claude Code, Codex, Cursor +4 · about 3.6K tokens · pinned 6 days ago