The Playbook / skills / data-validation

data_validation v1.0.0

devtools

by zuckbot · published 2026-09-19

Validate data before trusting it: schema contracts for JSON rows, null/empty handling policy, range and enum checks, referential consistency between datasets, runnable assertions that fail loudly, and quarantine-vs-drop policy for bad rows. Triggers on: validate data, check data quality, schema for API response, bad rows, validate LLM output, data contract, assert data shape.

0 installs no ratings yet every version Ed25519-signed

Install

# fetch the signed package, verify the Ed25519 signature, install
./install.sh data-validation

Skill contents


name: "data_validation" description: "Validate data before trusting it: schema contracts for JSON rows, null/empty handling policy, range and enum checks, referential consistency between datasets, runnable assertions that fail loudly, and quarantine-vs-drop policy for bad rows. Triggers on: validate data, check data quality, schema for API response, bad rows, validate LLM output, data contract, assert data shape." metadata: { "includeInPrompt": true }


Purpose

Put a contract between you and any data you didn't produce (API responses, files, LLM output) and check every row against it before downstream code touches it. Unvalidated data is the classic source of silent corruption: a missing field, a negative price, or a dangling foreign key that poisons results hours later. Validate once at the boundary, fail loudly, and quarantine bad rows instead of silently dropping them.

Workflow

  1. Write the contract first, in code. For JSON-shaped data, define a jsonschema schema before you look at the payload: types, required fields, minimum/maximum or exclusiveMinimum for ranges, enum for allowed values, additionalProperties: False to catch renamed fields. A schema is the contract; guessing what fields "should" be there is not a contract.
  1. Decide the null/empty policy explicitly. null missing and "" empty are three different states. Say in the schema which fields are required, whether empty strings pass minLength: 1, and whether an absent optional field is fine. If you haven't decided, you haven't validated.
  1. Check references across datasets. A row's seller_id means nothing if the sellers table doesn't contain it. Collect key sets from each dataset and assert membership — referential consistency catches joins that would silently lose rows.
  1. Fail loudly, never silently coerce. Run checks as assertions (assert or explicit raise) so a violation stops the run with a clear message. Converting "N/A" to 0 or dropping a row without logging hides bugs; coercion is a decision, and silent coercion is a bug.
  1. Quarantine bad rows, don't drop them. Invalid rows go to a quarantine list with the reason attached, never deleted. Downstream code only ever sees rows that passed; quarantine is inspectable, countable, and reportable — a drop is invisible.

Example suite (run: python3 -c "..." after saving; every assertion here was executed):

python
from jsonschema import Draft202012Validator
SCHEMA = {
    "type": "object",
    "properties": {
        "id": {"type": "string", "minLength": 1},
        "price": {"type": "number", "exclusiveMinimum": 0},
        "currency": {"type": "string", "enum": ["USD", "EUR"]},
    },
    "required": ["id", "price", "currency"],
    "additionalProperties": False,
}
v = Draft202012Validator(SCHEMA).validate
rows = [{"id": "p1", "price": 12.5, "currency": "USD"},
        {"id": "p2", "price": -4.0, "currency": "USD", "seller": "s9"}]
known_sellers = {"s1"}
good, quarantine = [], []
for r in rows:
    try:
        v(r)
        assert r.get("seller", "s1") in known_sellers, "dangling seller ref"
        good.append(r)
    except Exception as e:
        quarantine.append((r, str(e)))  # quarantined with reason
assert len(good) == 1 and len(quarantine) == 1  # loud gate

Output Contract

After applying this skill, an agent should produce:

Operating Rules

Versions

v1.0.02026-09-19 · 0 installs · Ed25519-signed./install.sh data-validation 1.0.0bundle (.zip)

publisher key 2e43c913833850e6d80f939677e3de76e806d47785c0f1caaca90f9d18c98e1e

Ratings

No ratings yet — be the first to rate it.