authoring-data-quality-checks
하는 일
이 스킬은 데이터 테이블과 뷰에 자동 테스트를 추가합니다. 예를 들어 열이 비어 있지 않은지 확인합니다. 보고서에 도달하기 전에 나쁜 데이터를 잡으려는 사람을 위한 것입니다.
사용하는 경우
- ✓테이블이나 뷰에서 빈 값, 중복, 누락된 참조를 확인하고 싶을 때.
- ✓테이블이 정해진 시간 안에 새로 고쳐지는지 확인해야 할 때.
- ✓비즈니스 규칙을 위해 HogQL로 작성한 사용자 지정 점검을 추가하고 싶을 때.
스킬 링크
https://github.com/PostHog/posthog/blob/master/products/data_quality/skills/authoring-data-quality-checks/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“주문 테이블의 모든 주문에 빈 고객 ID가 없는지 확인하는 점검을 추가해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
각 점검은 실패하는 행 수를 세는 작은 검증입니다. 실패가 없으면 통과하며, 이는 dbt 테스트와 비슷합니다. 개수와 쿼리만 저장됩니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Authoring data quality checks
A check is one assertion about one warehouse table, view, or HogQL catalog metric. It compiles to a
count-only HogQL query and passes when it finds zero failing rows, like dbt test. Failing rows are
never stored; only counts and the compiled query are, so to see the offending rows you re-run the
stored query yourself.
row_count is the exception. It passes when the observed count is within its configured min/max
bounds, so its failed_row_count comes back null and its stored query returns that single count,
not offending rows. Read the observed count to judge it rather than looking for matched rows.
Reads go through SQL (system.information_schema.data_quality_*); writes and runs go through the
data-quality MCP tools.
Before you write anything: look
Two queries save you from the two most common mistakes — duplicating a check, and checking a column that doesn't exist.
-- What is already covered?
SELECT name, subject_name, column_name, check_type, config, severity, last_status
FROM system.information_schema.data_quality_checks
WHERE subject_name = 'orders'
-- What columns are there, and what do they mean?
SELECT column_name, data_type, description
FROM system.information_schema.columns
WHERE table_name = 'orders'
Re-creating a byte-identical check is a harmless no-op — checks are keyed by a fingerprint of the subject, type, column, and config, so an identical create upserts. A near-duplicate is not harmless: it doubles the noise for whoever reads the results. If an existing check's assertion is close but wrong, edit the existing check. Updates preserve its identity and history; the subject stays fixed by the URL. An edit that duplicates another check's assertion is rejected.
Choosing checks
Aim for a handful that would actually catch a real regression, not blanket coverage. A model with twenty checks nobody reads is worse than three that fail meaningfully.
Reach for these first, in roughly this order:
not_nullon the columns downstream joins and filters depend on. The single highest-value check. A null join key silently drops rows.uniqueon whatever the model claims is its grain. Ifordersis one row per order, say so.relationshipson foreign keys. Catches the join that quietly stopped matching after an upstream change.accepted_valueson status and category columns whose downstream logic branches on them.freshnesson the timestamp column of anything that syncs. Catches a dead pipeline, which no row-level check will.row_countbounds when you know the plausible range. Good for catching a truncated sync.custom_sqlonly when nothing above expresses the invariant — e.g. cross-column arithmetic (select 1 from orders where total != subtotal + tax). Every row it returns counts as a failure.
Call posthog:data-quality-check-types for each type's exact config schema rather than guessing.
One tool set covers every kind of subject. Call posthog:data-quality-subjects for the tables,
views and metrics you can read, then pass the subject_type and id it gives you as
subject_type and subject_uuid in posthog:data-quality-check-create. Only a subject marked
editable can carry a check; the others can still be the target of a relationships check. After that a check is
addressed by its own id: -update, -delete, -run and -results take no subject.
Checks on PostHog tables
events, persons and groups take checks like any other subject: pass
subject_type: "posthog_table" with the id posthog:data-quality-subjects gives you. Every check
type works on them, and relationships can point at one as its target too.
These tables are large, so consider lookback_hours before you author a check on one. It bounds
the rows the check reads by the table's own time column: timestamp on events, and created_at
on persons and groups, which is when each was first seen rather than when it last changed.
Without it the check reads the whole table, which is allowed and sometimes what you want -- an
unbounded unique on events.uuid says something a windowed one cannot. A check that runs out of
ClickHouse's execution budget reports errored with the message; adding a window is usually the fix.
On a relationships check, lookback_hours bounds the rows it checks and to_lookback_hours
bounds the rows it looks for a match among. Set the second one carefully: a narrow t
자주 묻는 질문
문제가 되는 행이 어딘가에 저장되나요?
아니요. 개수와 컴파일된 쿼리만 저장되므로, 문제 행을 보려면 쿼리를 직접 다시 실행해야 합니다.
중복 점검을 만들게 되나요?
스킬은 기존 점검을 먼저 확인하며, 동일한 점검을 다시 만들어도 해가 되지 않습니다.
행 수 점검은 무엇을 하나요?
관측된 행 수가 설정한 최소와 최대 범위 안에 있으면 통과합니다.
상세 정보
작성자의 원본 설명
Adds and runs data quality checks (dbt-test style assertions) on a project's warehouse tables and saved-query views, and HogQL catalog metrics: not-null, uniqueness, accepted values, referential integrity, row-count bounds, freshness, and custom HogQL. Metrics support custom SQL checks only. Use when asked to test a model, validate a view, check for nulls or duplicates, add data quality checks, find out why a number looks wrong, or judge whether a warehouse table is trustworthy before using it in an analysis. To describe what data *means* (metrics, certifications, joins), see setting-up-data-c
repo: PostHog/posthog
인기도
- GitHub 스타
- 41k
- 순위
- #6854
- 라이선스
- —
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
depot-ci
41k에이전트가 GitHub Actions 대안인 Depot CI 워크플로를 설정하고 실행하도록 돕습니다. 기존 워크플로 이전과 실행 로그 읽기를 포함합니다.
depot-container-builds
41k에이전트가 Depot 원격 빌더에서 Docker 이미지를 빌드하도록 돕습니다. 다중 플랫폼 이미지, 레지스트리 푸시, 빌드 실패 수정을 포함합니다.
depot-github-runners
41k에이전트가 GitHub Actions 작업을 Depot 관리형 러너로 옮기고, 러너 크기와 라벨을 고르도록 돕습니다.
editing-agents-md
41k에이전트가 규칙을 AGENTS.md나 CLAUDE.md 중 어디에 둘지 정하고, 파일을 키우지 않으면서 잘 지켜지도록 쓰게 돕습니다.
비슷한 스킬
discrawl
394k에이전트가 저장된 로컬 Discord 메시지 보관본을 검색하고 요약하며, 최신 상태를 확인하고 다이렉트 메시지를 읽도록 돕습니다.
clickhouse-io
280k에이전트가 ClickHouse 데이터베이스의 쿼리와 스키마를 최적화하도록 돕습니다. 고성능 분석 작업의 모범 사례를 적용합니다. 분석 쿼리가 느릴 때 씁니다.
scientific-db-pubmed-database
280k생의학 분야의 과학 논문을 에이전트가 검색하도록 돕습니다. 특정 의학 정보가 필요한 연구에 유용합니다.