input-validation

Validate HTTP requests, files, and API data using schemas.

13|2|Updated Jan 21, 2026
One-click install
npx skills add https://github.com/yanko-belov/code-craft --skill input-validation-yanko-belov
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: input-validation
Source: https://github.com/yanko-belov/code-craft/tree/main/skills/input-validation
Command: npx skills add https://github.com/yanko-belov/code-craft --skill input-validation-yanko-belov

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Unvalidated input from users and external systems can cause security vulnerabilities and data corruption. This Skill enforces robust input validation at system boundaries.

Core Features & Use Cases

  • Boundary Validation: Validate HTTP bodies, query parameters, headers, files, and API responses to ensure data integrity.
  • Schema-Driven: Define allowed shapes and constraints using schemas (e.g., Zod, Yup) to prevent bad data from propagating.
  • Fail Fast & Clear Errors: Return precise error messages and stop processing when data is invalid.
  • Use Case: Protect APIs that ingest external data or user input by validating at the boundary.

Quick Start

Validate an incoming HTTP request by defining a validation schema for fields like email and age, then apply it to req.body and return a 400 on failure.

Frequently Asked Questions about input-validation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate HTTP request bodies in a TypeScript backend?

Schema-based validation enforces allowed shapes and constraints on HTTP request bodies in TypeScript backends, returning precise 400 error messages and stopping processing when incoming data is invalid.

What is the best way to prevent untrusted input from external APIs entering my system?

Implement schema-driven boundary validation to prevent untrusted input from external APIs entering your system, verifying API response shapes and stopping processing immediately when external data fails schema constraints.

Can I use schema validation libraries like Zod or Yup for backend input validation?

Yes, you can use schema validation libraries like Zod or Yup for backend input validation. This approach is schema-driven, allowing you to define allowed shapes and constraints to prevent malformed data from propagating through your system.

Why does fail-fast behavior matter when validating user input?

Fail-fast behavior matters when validating user input because it stops processing immediately upon detecting invalid data, returning precise error messages and preventing untrusted input from causing security vulnerabilities or data corruption deeper within the system.

Does schema-based validation work for file reading and query parameters?

Yes, schema-based validation works for file reading and query parameters. It applies to common data ingestion scenarios including HTTP bodies, query parameters, headers, and files, ensuring data integrity across all system boundaries.