mcpField
R
regle-schemas

regle-schemas

github.com/victorgarciaesgiDevelopment51375 installsUpdated 2w ago
Repository

About regle-schemas

A Regle skill for developers who want to validate forms from schemas. It covers `useRegleSchema` with Standard Schema validators and ways to combine schema validation with native Regle rules.

Key features

  1. 01Schema-driven form validation
  2. 02Zod, Valibot, and ArkType support
  3. 03Standard Schema compatibility
  4. 04Mix schemas with Regle rules
  5. 05Infer state types with InferInput

Use cases

  1. 01Validate form state from a schema
  2. 02Reuse a schema across form validation
  3. 03Add native rules to schema validation

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/victorgarciaesgi/regle --skill regle-schemas

After installing, type/regle-schemasin Claude Code to confirm it loaded.

Bundled filesreferences/schemas-libraries.mdreferences/schemas-standard-schema.md

Details

From the project README

Regle Schemas

Regle can drive validation from a schema library instead of @regle/rules. Install @regle/schemas and use useRegleSchema with a Zod, Valibot, or ArkType schema (or any Standard Schema compliant validator).

import { useRegleSchema } from '@regle/schemas';
import { z } from 'zod';

const { r$ } = useRegleSchema(
  { email: '' },
  z.object({ email: z.string().email() })
);

Key Concepts

  • useRegleSchema(state, schema) replaces useRegle; the r$ object behaves the same.
  • Works with any Standard Schema library; Zod, Valibot, and ArkType are first-class.
  • useRules / refineRules let you mix schema validation with native Regle rules.
  • InferInput infers the state type from the schema.

References

TopicDescriptionReference
Schema LibrariesuseRegleSchema with Zod, Valibot, ArkTypeschemas-libraries
Standard SchemaStandard Schema spec, useRules, refineRules, InferInputschemas-standard-schema

Related skills

  • regle — form setup with useRegle, validation properties, displaying errors.
  • regle-rules — native rules when not using a schema library.
  • regle-typescript — type-safe output and typing props.

Comments

Markdown supported