agentleFS
TJM-NZTJM-NZ/claude-skills/data-validation/SKILL.md

data-validation

Skill0 starsChanged 9 days agoMITView on GitHub

Data validation audit - maps every point where data enters a system (requests, imports, third-party responses, queues, model output) and checks that it is parsed, constrained and rejected clearly, that business rules and database constraints hold, and that stored data stays consistent. Optional finance and ML data packs. Stack-agnostic.

6 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check the database schema and migrations before reporting "no validation": a constraint there is a valid control, and its absence is its …

    line 39

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Data engineer. Find where the system accepts data it shouldn't, trusts data it can't, or carries on quietly when data is wrong. Bad data is rarely loud: it becomes a wrong total, a failed job next week, or a record nobody can explain. Judge each entry point by what happens to a malformed, hostile or merely unexpected value.

Scope: parsing and constraints at entry points, schemas as the source of truth, business rules, stored-data integrity, finance and ML data packs. Not in scope: exploiting input (injection, XSS, traversal, uploads, SSRF) is security-audit; retries and timeouts are resilience; API contract shape is api-design. Where a finding is mainly a vulnerability, name it and hand it over.

Workflow

  1. Context. Load references/method.md. Establish what the data represents, what a wrong value costs (money, safety, legal, trust), and where data comes from. Ask only what the repo can't answer.
  2. Detect stack and domain. Glob manifests (package.json, pyproject.toml, requirements.txt, go.mod, Gemfile, pom.xml, Cargo.toml, excluding vendored dirs) and schema/migration files. Note the validation library (Zod, Valibot, Pydantic, Joi, class-validator, Bean Validation, JSON Schema, or none), ORM and database, and domain signals: money (amount, invoice, ledger), ML (train, predict, feature, embedding), imports (csv, upload, ingest, etl).
  3. Map the entry points. List every place data crosses into the system: HTTP routes, forms, file and CSV imports, webhooks, queue consumers, CLI arguments, scheduled ingests, responses from third-party APIs, and model or LLM output. For each: schema or parser, constraints, behaviour on failure, and where it is stored. The gaps drive the findings.
  4. Scope. Offer: Full (all modules, plus domain packs found) | Quick (boundaries, schemas, business rules) | Targeted (a module, an entry point, or a data domain). Skip if specified.
  5. Analyse. Load the chosen modules. Grep hits are leads; read the code, trace where the value goes next, and check whether the database enforces it too.
  6. Report in the format below.
ModuleCovers
method.mdEntry-point map, validation layers, failure behaviour, evidence rules, stored-data checks
boundaries.mdParsing and constraints at requests, imports, files, webhooks, third-party responses, time, units and text
schemas.mdOne schema as the source of truth, strict vs lenient parsing, drift between layers, coercion traps
business-rules.mdCross-field rules, state transitions, uniqueness, limits, where rules live
integrity.mdDatabase constraints, transactions, races, idempotency, deletes and cascades, orphans
finance.mdOptional pack: money representation, rounding, currency, duplicate payments, audit trail, reconciliation
ml-data.mdOptional pack: training data, features, inference input, labels, leakage, drift

Confidence

LevelMeaning
ConfirmedThe missing or wrong control is visible and the value reaches storage or a decision
LikelyThe code is silent, but a framework, ORM or database constraint may cover it; name the check
PossibleDepends on data already stored or inputs not visible; goes under "Needs verification"

Check the database schema and migrations before reporting "no validation": a constraint there is a valid control, and its absence is its own finding.

Severity

By consequence of bad data getting in:

  • Critical: corrupts or loses data, moves money wrongly, breaks a legal obligation, or lets one tenant's input affect another.
  • High: bad data is stored and used (wrong totals, impossible states, duplicates), or a trusted-input assumption is violable from outside.
  • Medium: weak or inconsistent validation, poor error messages, drift between layers.
  • Low: edge cases and polish. List in one line.

Report format

# Data Validation Audit: [project]

Domain: [...] | Stack: [...] | Scope: [...]
Findings: Critical X | High Y | Medium Z | Low W   (Confirmed a | Likely b | Possible c)

## Entry-point map
| Entry point | Parsed by | Constraints | On failure | Stored in | DB enforces |

## [SEVERITY] Title   (boundary | schema | rule | integrity | finance | ml) · [confidence]
- Location: `file:line` (+ N other places)
- What gets through: the concrete bad value and where it ends up
- Consequence: what breaks, for whom, and when it is noticed
- Fix: concrete change, at the right layer
- Verify: a test input, or a read-only check for existing bad data

## Existing-data checks (see below)
## Needs verification

Group repeated patterns ("7 routes read req.body without a schema"). Skip validation that merely repeats a database constraint with no better message, and code that only receives already-validated values.

Existing data (consent required)

Code shows what the system accepts from now on, not what is already stored. For each invariant the code assumes, supply a read-only query or script that counts violations (orphans, duplicates, nulls where "never null", out-of-range values, impossible states). Run one only if the user approves that specific command and confirms the target is a safe dev or test copy, not live data. Never run anything that writes. Report counts, not row contents, when rows may hold personal data.

After the report

Offer: fix Critical and High findings | introduce a schema layer at the boundaries | add the missing database constraints (with a migration plan for existing violations) | add tests with the bad inputs from "Verify". Make no changes until the user picks.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.