stacks-validation

Validate data against Stacks rules for model and API safety.

622|17|Updated Apr 26, 2022
One-click install
npx skills add https://github.com/stacksjs/stacks --skill stacks-validation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: stacks-validation
Source: https://github.com/stacksjs/stacks/tree/main/.claude/skills/stacks-validation
Command: npx skills add https://github.com/stacksjs/stacks --skill stacks-validation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Validation of data against Stacks validation rules to ensure model integrity and API input safety.

Core Features & Use Cases

  • Type guards (isString, isNumber, isBoolean, isObject, isArray, isFunction, isUndefined, isNull, isNullOrUndefined)
  • Numeric checks (isInteger, isPositive, isEven, etc.)
  • Schema builder for model attribute validation and request validation
  • Error reporting and integration with custom validators
  • Re-exports and integration with @stacksjs/validation for a coherent validation layer

Quick Start

Run a sample data validation against your model using the stacks-validation rules.

Frequently Asked Questions about stacks-validation

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

FAQPage Schema
How do I validate API request input in a Bun TypeScript project?

You can validate API request input using schema builders to enforce model integrity. The system applies type guards to runtime data checks, ensuring input safety for your Stacks projects.

What type guards are available for TypeScript data validation?

Available type guards include isString, isNumber, isBoolean, isObject, isArray, and isFunction. Numeric checks like isInteger, isPositive, and isEven are also provided for comprehensive runtime data validation.

How do I build a custom validation schema for model attributes?

You build a custom validation schema using the integrated schema builder to define rules for model attributes. This allows you to apply specific data validation logic and handle errors via the error reporter.

Does this validation tool work without external dependencies?

Yes, the validation tool operates with zero dependencies. It directly re-exports and integrates with @stacksjs/validation to provide a coherent validation layer for your TypeScript environment.

How are validation errors reported when a data check fails?

Validation errors are reported through an integrated error reporter. When data checks fail against your schema, the error reporter captures and surfaces the issues for custom validators to handle.