본문으로 건너뛰기
Skillpedia
일반 코딩75k · #3006

runtime-validation

하는 일

이 스킬은 앱이 네트워크, 저장소, 환경 설정, 폼에서 데이터를 받아들이는 곳을 찾아, 스키마 라이브러리로 실행 시 검사를 추가합니다. 예상치 못한 데이터로 생기는 버그를 줄이려는 개발자를 위한 것입니다.

사용하는 경우

  • ✓API나 폼에서 들어오는 데이터에 검사를 추가해 달라고 요청할 때.
  • ✓API가 예상과 다른 형태로 응답해서 앱이 깨질 때.
  • ✓로컬 저장소나 환경 변수에서 읽는 코드를 검토하면서 그 값도 검사하고 싶을 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

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.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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.

repo: thedaviddias/Front-End-Checklist

인기도

GitHub 스타
75k
순위
#3006
라이선스
MIT
업데이트
2026. 10. 31.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬