Skip to content
Skillpedia
General coding75k · #3006

runtime-validation

What it does

This skill finds places where an app takes in data from the network, storage, environment settings, or forms, and adds runtime checks using a schema library. It is for developers who want fewer bugs from unexpected data.

When to use it

  • ✓When you ask the agent to add checks to data coming from an API or a form.
  • ✓When your app breaks because an API returned a different shape than expected.
  • ✓When you are reviewing code that reads from local storage or environment variables and want those values checked.

Skill link

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/runtime-validation/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/runtime-validation/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“My app breaks when the API sends slightly different data than expected. Can you add checks at the points where data comes in?”

5 new skills a week. 1 minute to read.

How it works

The agent finds places where data enters the app, such as fetch calls, local storage reads, and form submissions. It adds schemas, for example with Zod, that check the shape of the data and give clear errors when it does not match.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Validate external data at runtime with a schema library

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/rules/javascript/runtime-validation

FAQ

Why are TypeScript types not enough?

The skill says TypeScript types are removed when the code runs, so they cannot check the actual data at runtime.

Where should validation go?

The skill says to validate at trust boundaries, where outside data enters, rather than in every internal function.

What does a schema give me?

The skill says a Zod schema checks the data and also provides the matching TypeScript type.

Details

Original description by the author

Use when reviewing code that calls fetch(), reads from localStorage, accesses process.env, or processes form submissions without explicitly validating the incoming data shape.

repo: thedaviddias/Front-End-Checklist

Popularity

GitHub stars
75k
Ranking position
#3006
License
MIT
Updated
10/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills