runtime-validation
하는 일
이 스킬은 앱이 네트워크, 저장소, 환경 설정, 폼에서 데이터를 받아들이는 곳을 찾아, 스키마 라이브러리로 실행 시 검사를 추가합니다. 예상치 못한 데이터로 생기는 버그를 줄이려는 개발자를 위한 것입니다.
사용하는 경우
- ✓API나 폼에서 들어오는 데이터에 검사를 추가해 달라고 요청할 때.
- ✓API가 예상과 다른 형태로 응답해서 앱이 깨질 때.
- ✓로컬 저장소나 환경 변수에서 읽는 코드를 검토하면서 그 값도 검사하고 싶을 때.
스킬 링크
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/runtime-validation/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“API가 예상과 조금 다른 데이터를 보내면 제 앱이 깨집니다. 데이터가 들어오는 지점에 검사를 추가해 주실 수 있나요?”
매주 새 스킬 5개. 읽는 데 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
- 업데이트
- 2026. 10. 31.
댓글
- …
이 저장소의 다른 스킬
frontendchecklist
75k명령줄 도구를 사용해 380개가 넘는 규칙으로 프런트엔드 코드와 실시간 페이지를 접근성, 속도, SEO, 보안 측면에서 점검합니다.
frontend-checklist-global
75kFront-End Checklist의 386개 규칙 전체로 프런트엔드 프로젝트를 감사하고, 발견한 문제마다 구체적인 해결 방법을 제시합니다.
404-page
75k없는 페이지 화면에 도움이 되는 링크가 있고 실제 404 상태 코드를 반환하는지 확인해, 길을 잃은 방문자를 돕습니다.
about-page
75k사이트를 운영하는 사람을 설명하는 명확한 소개 페이지가 있는지 검토해, 방문자와 검색 엔진의 신뢰를 높입니다.