posit-dev/pointblank/write-validation
Claude Code and agent skill by posit-dev/pointblank
- community
Checking that the SKILL.md file is still in the repository.
Write data-validation plans with Pointblank. Covers choosing the right validation methods for each data quality concern, composing multi-step plans, setting thresholds and actions, using segments, conditional steps, handling nulls and missing values, and extracting results. Use when building or improving a validation workflow.
Install
npx vskill@latest install posit-dev/pointblank/write-validationSKILL.md
The same SKILL.md was published earlier as posit-dev/pointblank/write-validation.
Write Validation
Skill for composing effective data-validation plans with Pointblank. A validation plan is a sequence of steps that check different aspects of your data, organized to catch issues early and report clearly.
Quick start
Skill directory structure
When to use what
| Data quality concern | Recommended method | |
|---|---|---|
| Column exists | col_exists | |
| Schema matches expectations | col_schema_match | |
| Expected row count | row_count_match | |
| Expected column count | col_count_match | |
| No null values | col_vals_not_null | |
| All null (placeholder column) | col_vals_null | |
| No duplicate rows | rows_distinct | |
| No near-duplicate text | rows_near_distinct | |
| All rows complete (no nulls) | rows_complete | |
| Values above/below a bound | col_vals_gt/lt/ge/le | |
| Values in a numeric range | col_vals_between | |
| Values outside a range | col_vals_outside | |
| Values from an allowed set | col_vals_in_set | |
| Values found in a lookup table | col_vals_in_table | |
| Values not in a forbidden set | col_vals_not_in_set | |
| Values match a pattern | col_vals_regex | |
| String length within bounds | col_vals_str_len | |
| Values match a format (email etc) | col_vals_within_spec | |
| Values are monotonically ordered | col_vals_increasing/decreasing | |
| Null percentage within budget | col_pct_null | |
| Structured missingness | col_pct_missing, col_missing_coded, col_missing_only_coded, col_missing_consistent with MissingSpec | |
| Aggregate comparison (sum, avg) | col_sum_eq, col_avg_gt, etc. | |
| Data is recent enough | data_freshness | |
| Table matches another table | tbl_match (keys=, tolerance=) | |
| Totals agree with a source table | tbl_reconcile | |
| Multiple conditions per row | conjointly | |
| Custom logic | specially | |
| LLM-based semantic check | prompt | |
| Score from a model or function | col_vals_scored | |
| Chat data well formed | col_vals_chat_format | |
| No overlap with a benchmark | rows_not_contaminated |
For text corpora, RAG data, and model training sets, see the check-training-data skill.
Core concepts
Ordering your steps
Organize validation steps from structural to semantic:
- Schema checks --
col_exists,col_schema_match,
col_count_match, row_count_match
- Completeness checks --
col_vals_not_null,rows_complete,
col_pct_null, col_missing_*
- Uniqueness checks --
rows_distinct,rows_near_distinct - Value-range checks --
col_vals_gt,col_vals_between, etc. - Format checks --
col_vals_regex,col_vals_within_spec,
col_vals_str_len, col_vals_chat_format
- Set membership --
col_vals_in_set,col_vals_not_in_set,
col_vals_in_table
- Cross-column checks --
conjointly,col_vals_expr - Aggregate checks --
col_sum_eq,col_avg_gt,tbl_reconcile - Freshness checks --
data_freshness - Custom/semantic checks --
specially,prompt,
col_vals_scored, rows_not_contaminated
This order means structural problems surface first before value-level checks run.
Handling nulls
By default, null values count as failures in value checks. Control this per step:
For structured missingness (sentinel values like -999, "N/A"):
Segmented validation
Break validation into groups to see which segments fail. Each segment becomes its own step in the report:
Conditional steps
Skip steps dynamically based on the data:
Pre-processing data
Transform data before a check with pre:
Steps with pre= are left out of get_sundered_data() and get_row_flags(), since their rows can't be matched to the target table. Wrap a function that only filters, reorders, or changes values in pb.row_preserving(...) to keep the step in.
Reusable bundles of steps
pb.Steps records steps (with the same methods as Validate) that can be added to any validation with add_steps():
add_steps(*steps, active=None, thresholds=None, exclude=None, columns_map=None) can override the bundle's thresholds, skip steps, or rename columns. The pb.rag functions return Steps bundles too.
Thresholds
Set thresholds at three severity levels:
- Values
< 1: fraction of failing test units (e.g.,0.05= 5%) - Values
>= 1: absolute count of failures (e.g.,5= 5 rows) True: any failure triggers (equivalent to1)
Actions
Trigger responses when thresholds are exceeded:
Template variables: {type}, {level}, {step} (or {i}), {col} (or {column}), {val} (or {value}), {time}.
Final actions
Run after all steps complete, with access to the full summary:
Comparing against reference data
Track drift by comparing current data to a reference table:
Extracting results
Saving and reloading
Workflows
Building a validation plan from scratch
- Profile the data with
pb.DataScan(data=df)to understand
distributions, nulls, and types.
- Start with structural checks (
col_exists,col_schema_match). - Add completeness checks (
col_vals_not_null,rows_complete). - Add value constraints based on domain knowledge.
- Set thresholds appropriate to the use case.
- Run
interrogate()and review the report. - Iterate: adjust thresholds, add missing checks, remove noisy ones.
Adding checks to an existing plan
Read the current validation code, identify uncovered columns or concerns, and add steps in the appropriate position (structural before semantic). Preserve the existing threshold/action configuration unless changing it is part of the task.
Diagnosing validation failures
- Run
interrogate()and check the report. - Use
get_data_extracts(i=N, frame=True)to see failing rows. - Use
get_step_report(i=N)for a detailed per-step view. - Determine whether the check or the data is wrong.
- Fix the check (adjust value/threshold) or flag the data issue.
Gotchas
- `.interrogate()` must be called. Steps are declarative until
executed.
- `na_pass` defaults to `False`. Nulls fail value checks unless
you opt in.
- Threshold `0.05` vs `5`. Fractional = percentage, integer =
count.
- `col_vals_between` is closed by default. Pass
inclusive=(False, False) for an open interval.
- `conjointly` takes callables that return expressions. Each
argument is like lambda df: pl.col("a") > 0 (or lambda df: expr_col("a") > 0), not a validation method call.
- Aggregate methods compare one value per column, not per row.
They produce a single pass/fail per column, and they take no pre= or segments=.
- `segments` splits the check into sub-groups. Each segment is
reported separately in the validation report. pb.seg_group() is only valid inside a (column, ...) tuple.
- Comparison methods can't check boolean columns. Use
col_vals_expr(expr=pl.col("flag")) (or ~pl.col("flag")) instead of col_vals_eq(columns="flag", value=True).
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/write-validation/SKILL.md
Popularity
- Repository stars
- 505
- Repository forks
- 39
- 7-day trend score
- 31
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/posit-dev/pointblank/write-validation)