stacks-validation

Validate TypeScript request data and model attributes with Stacks schemas.

2|Updated Jul 8, 2026
One-click install
npx skills add https://github.com/bughq/bughq --skill stacks-validation-bughq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: stacks-validation
Source: https://github.com/bughq/bughq/tree/main/.claude/skills/stacks-validation
Command: npx skills add https://github.com/bughq/bughq --skill stacks-validation-bughq

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @stacksjs/validation, @stacksjs/ts-validation, @stacksjs/types, @stacksjs/strings.

What problem does it solve?

This Skill solves the challenge of ensuring data integrity and type safety within Stacks applications by providing a unified, fluent interface for validating request data and model attributes.

Core Features & Use Cases

  • Type Guarding: Provides a comprehensive suite of TypeScript type guards (isString, isNumber, isObject, etc.) for reliable runtime type narrowing.
  • Schema Validation: Offers a fluent schema builder to define complex validation rules for model attributes, including email, URL, numeric ranges, and custom logic.
  • Request Validation: Simplifies API request handling by automatically validating incoming data against defined model rules and throwing appropriate HTTP errors on failure.

Quick Start

Use the stacks-validation skill to define a schema for a user model and validate incoming request data against it.

Frequently Asked Questions about stacks-validation

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

FAQPage Schema
How do I validate request data in a TypeScript application?

TypeScript type guards like isString and isNumber enable reliable runtime type narrowing to validate data structures, preventing type errors that pure static typing cannot catch during execution.

How do I define schema validation rules for model attributes?

You can validate incoming API requests by automatically checking data against your defined model schema rules, which triggers appropriate HTTP errors on failure to maintain consistent backend data integrity.

Does the Stacks framework support custom model validation logic?

Yes, it provides a fluent schema builder that enables you to define custom validation logic and complex rules for model attributes, ensuring type-safe data handling across your application lifecycle.

What is the best way to ensure type safety for API payloads in Stacks?

Using a comprehensive validation framework ensures type safety for API payloads by combining runtime type checking with schema-based model attribute validation to handle data consistently across your application.

Why does my TypeScript runtime type narrowing fail for API responses?

Runtime type narrowing fails for API responses because static TypeScript types are erased at runtime; implementing dedicated type guards ensures reliable data structure verification when handling incoming payloads.