Validate external data at runtime with a schema library
SkillFiles & storageRuntime-validation is a skill for reviewing JavaScript code that brings in external data, fetch calls, localStorage reads, process.env access, and form submissions. It checks whether that data is validated at runtime with a schema library, since TypeScript types are erased at runtime and cannot
Available today. Use it from your connected AI after setup.
No other account needed.
Have the skill available to your agent alongside the JavaScript code you want reviewed.
Then ask your AI: use the Validate external data at runtime with a schema library skill
What your AI can do with it
- Identify external data entry points (fetch, localStorage, process.env, forms) lacking runt
- Add Zod schemas that validate data and infer the matching TypeScript type
- Show where to call .parse() or .safeParse() and when to use each
- Explain why compile-time types do not protect against runtime data mismatches
- Flag code that casts data to a TypeScript type without a preceding runtime validation step
- Point to framework-specific guidance and code examples in references/rule.md
Getting started
- Have the skill available to your agent alongside the JavaScript code you want reviewed.
- Ask the agent to run the check: it lists every place external data enters the code and which ones lack schema validation.
- Ask for the fix: the agent adds Zod schemas, shows the validated type inference, and indicates where to call .parse() or .safeParse().
- Ask for the explanation of why TypeScript types alone do not catch runtime mismatches.
- Consult references/rule.md for full implementation details and framework-specific guidance.
What this skill tells your AI
The instructions your AI receives, as published by thedaviddias/front-end-checklist in skills/runtime-validation/SKILL.md and read by ahel’s review.
TypeScript gives you confidence at compile time, but data from the network, user input, and storage arrives at runtime as raw, untyped values. A backend schema change, a misconfigured API, or malicious input can produce data that does not match your TypeScript types — and the compiler will never warn you. Runtime validation with a schema library catches these mismatches at the boundary, surfaces clear error messages, and prevents type-unsafe data from propagating through your application.
Quick Reference
- TypeScript types are compile-time only — they are completely erased at runtime
- API responses can differ from their declared types without causing a compile error
- A Zod schema simultaneously validates data and infers the TypeScript type
- Validate at trust boundaries only — not inside every internal function call
Check
Identify all places in this code where external data enters the application (fetch calls, localStorage reads, env variable access, form submissions) and report which ones lack runtime schema validation.
Fix
Add Zod schemas to validate the external data entry points in this code. Show the schema definition, the validated type inference, and where to call .parse() or .safeParse().
Explain
Explain why TypeScript types do not protect against runtime data mismatches, how Zod bridges compile-time and runtime safety, and when to use .parse() versus .safeParse().
Code Review
Review all external data entry points in this file: API calls, storage reads, environment variable access, and form handling. Flag any location where data is cast to a TypeScript type without a preceding runtime validation step.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/en/rules/javascript/runtime-validation
Signals
- GitHub stars
- 74k
- Forks
- 7k
- Last commit
- Aug 2026
Questions
- Why do I need runtime validation if I already use TypeScript?
- TypeScript types exist only at compile time and are erased at runtime. Data from APIs, storage, or user input arrives as raw untyped values, so a mismatch would never trigger a compiler warning.
- When should I use .parse() versus .safeParse()?
- The skill explains the difference between the two Zod methods as part of its guidance; it shows where each call belongs when adding schemas to your data entry points.
Advanced
- Item type
- skill
- Key
runtime-validation- Source
- github.com/thedaviddias/front-end-checklist