schema-boundary-typing

Validate untrusted boundary inputs with runtime schema checks for TypeScript types.

1|1|Updated May 3, 2026
One-click install
npx skills add https://github.com/matt-riley/agent-skills --skill schema-boundary-typing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: schema-boundary-typing
Source: https://github.com/matt-riley/agent-skills/tree/main/skills/schema-boundary-typing
Command: npx skills add https://github.com/matt-riley/agent-skills --skill schema-boundary-typing

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Untrusted data entering a TypeScript codebase often leads to runtime errors and fragile boundaries. This skill provides guidance to enforce runtime validation at the edge and keep static types aligned with the actual input.

Core Features & Use Cases

  • Validate external payloads at the first boundary using the repository's schema or guard patterns.
  • Derive or guard the TypeScript types from the runtime schema, reducing ad-hoc typing throughout the codebase.
  • Use across API requests, webhook payloads, and storage reads to ensure consistent boundary behavior.

Quick Start

Validate an untrusted payload at the API edge using the repository's schema-first approach and derive the TypeScript type.

Frequently Asked Questions about schema-boundary-typing

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

FAQPage Schema
How do I validate untrusted API payloads at runtime in TypeScript?

Runtime validation of untrusted API payloads in TypeScript applies a schema check at the boundary to enforce truthful types. You keep data as unknown until validation passes, preventing invalid shapes from entering your codebase.

What is the best way to keep TypeScript types aligned with incoming webhook payloads?

Keeping TypeScript types aligned with webhook payloads requires deriving static types directly from runtime schemas. This schema-first approach ensures the static type matches the actual validated input, reducing ad-hoc typing throughout the codebase.

Why should I keep incoming JSON as unknown before schema validation?

Keeping incoming JSON as unknown before schema validation forces an explicit runtime check at the boundary. This prevents untrusted data from being treated as a safe type prematurely, avoiding runtime errors and fragile boundaries downstream.

Do I need an existing validation library to enforce runtime types at the edge?

Enforcing runtime types at the edge uses your repository's existing validator or guard patterns. The skill applies available schema-first patterns rather than introducing a new external dependency.

How do I test invalid payloads against my TypeScript boundary validation?

Testing invalid payloads against TypeScript boundary validation involves passing malformed data to the schema check to verify rejection. This ensures the runtime guard correctly blocks untrusted inputs at HTTP requests, webhooks, and storage reads.

Can I use schema boundary typing for storage reads and JSON parsing?

Schema boundary typing applies across HTTP requests, webhook payloads, and storage reads to ensure consistent boundary behavior. It validates untrusted JSON parsing by applying the same runtime schema check at every data entry point.