runtime-validation
यह क्या करती है
यह स्किल ऐसी जगहें खोजती है जहाँ ऐप नेटवर्क, स्टोरेज, एनवायरनमेंट सेटिंग या फ़ॉर्म से डेटा लेता है, और स्कीमा लाइब्रेरी से रनटाइम जाँच जोड़ती है। यह उन डेवलपर्स के लिए है जो अप्रत्याशित डेटा से होने वाली गलतियाँ कम करना चाहते हैं।
कब इस्तेमाल करें
- ✓जब आप एजेंट से API या फ़ॉर्म से आने वाले डेटा पर जाँच जुड़वाएँ।
- ✓जब आपका ऐप इसलिए टूट जाए क्योंकि API ने अपेक्षा से अलग आकार का डेटा लौटाया।
- ✓जब आप ऐसा कोड देख रहे हों जो लोकल स्टोरेज या एनवायरनमेंट वेरिएबल से पढ़ता है और चाहते हैं कि वे मान जाँचे जाएँ।
Skill का लिंक
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/runtime-validation/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“जब API थोड़ा अलग डेटा भेजती है तो मेरा ऐप टूट जाता है। क्या आप उन जगहों पर जाँच जोड़ सकते हैं जहाँ डेटा ऐप में आता है?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट ऐसी जगहें खोजता है जहाँ डेटा ऐप में प्रवेश करता है, जैसे fetch कॉल, लोकल स्टोरेज रीड और फ़ॉर्म सबमिशन। वह Zod जैसे स्कीमा जोड़ता है जो डेटा का आकार जाँचते हैं और मेल न खाने पर साफ़ एरर देते हैं।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे 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
अक्सर पूछे जाने वाले सवाल
TypeScript टाइप्स काफ़ी क्यों नहीं हैं?
स्किल कहती है कि कोड चलते समय TypeScript टाइप हटा दिए जाते हैं, इसलिए वे रनटाइम पर असली डेटा की जाँच नहीं कर सकते।
वैलिडेशन कहाँ होना चाहिए?
स्किल कहती है कि भरोसे की सीमाओं पर, जहाँ बाहरी डेटा आता है, वैलिडेट करें, न कि हर आंतरिक फ़ंक्शन में।
स्कीमा मुझे क्या देता है?
स्किल कहती है कि Zod स्कीमा डेटा जाँचता है और मेल खाने वाला TypeScript टाइप भी देता है।
जानकारी
लेखक का मूल विवरण
Use when reviewing code that calls fetch(), reads from localStorage, accesses process.env, or processes form submissions without explicitly validating the incoming data shape.
लोकप्रियता
- GitHub स्टार
- 75k
- रैंकिंग में स्थान
- #3006
- लाइसेंस
- MIT
- अपडेट की गई
- 31/10/2026
कमेंट
- …
इस repository की और skills
frontendchecklist
75kकमांड-लाइन टूल से फ़्रंटएंड कोड और लाइव पेजों को एक्सेसिबिलिटी, स्पीड, SEO और सिक्योरिटी के 380 से ज़्यादा नियमों से जाँचती है।
frontend-checklist-global
75kफ़्रंटएंड प्रोजेक्ट को Front-End Checklist के सभी 386 नियमों से ऑडिट करती है, और हर मिली समस्या का ठोस समाधान देती है।
404-page
75kजाँचती है कि आपका गुम पेज उपयोगी लिंक देता है और सही 404 स्टेटस लौटाता है, ताकि भटके हुए विज़िटर रास्ता ढूँढ सकें।
about-page
75kजाँचती है कि आपकी साइट पर एक साफ़ About पेज है जो बताता है कि उसे कौन चलाता है, ताकि विज़िटर और सर्च इंजन का भरोसा बढ़े।
मिलती-जुलती skills
diffs
394kयह आपके एजेंट को बदलावों का असली diff बनाने देती है, जिसे व्यूअर लिंक या इमेज फ़ाइल के रूप में साझा किया जा सकता है, हाथ से लिखे सारांश के बजाय।
coding-agent
394kयह आपके एजेंट को बड़े कोडिंग काम Codex, Claude Code या OpenCode को बैकग्राउंड वर्कर के रूप में सौंपने, फिर उसकी प्रगति जांचने में मदद करती है।
gh-issues
394kयह आपके एजेंट को GitHub issues खोजने, उनमें से काम करने लायक चुनने, और सुधार के साथ pull requests खोलने में मदद करती है, जिसमें समीक्षा टिप्पणियों का फ़ॉलो-अप भी शामिल है।