skills/regle-rules/SKILL.md
Regle validation rules — built-in rules from `@regle/rules`, custom rules with `createRule`, rule wrappers (`withMessage`, `withParams`, `withAsync`, `withTooltip`), and rule operators (`and`, `or`, `xor`, `not`, `applyIf`, `assignIf`, `pipe`). Use when declaring, customizing, composing, or conditionally applying validation rules in a Regle form. For form setup see regle.
npx skillsauth add victorgarciaesgi/regle regle-rulesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
Security scan pending...
This skill is queued for security scanning. Results will appear when the scan completes.
Validation rules for Regle. Rules come from @regle/rules, but you can also write your own with createRule, customize them with wrappers, and combine them with operators.
import { useRegle } from '@regle/core';
import { required, email, minLength } from '@regle/rules';
const { r$ } = useRegle(
{ email: '' },
{ email: { required, email, minLength: minLength(5) } }
);
required to enforce a field.@regle/rules; some are factories that take parameters (e.g. minLength(3)).createRule for reusability, or an inline function for one-offs.| Topic | Description | Reference |
|-------|-------------|-----------|
| Built-in Rules | All validation rules from @regle/rules | rules-built-in |
| Custom Rules | Inline rules, createRule, reactive parameters, async rules, metadata | rules-custom |
| Rule Wrappers | withMessage, withParams, withAsync, withTooltip, chaining | rules-wrappers |
| Rule Operators | and, or, xor, not, applyIf, assignIf, pipe | rules-operators |
useRegle, validation properties, displaying errors, modifiers.inferRules and RegleComputedRules.development
Validate Regle forms with schema libraries via `@regle/schemas` — Zod, Valibot, ArkType, and any Standard Schema spec library using `useRegleSchema`, `useRules`, `refineRules`, and `InferInput`. Use when a form's validation is defined by an external schema instead of `@regle/rules`. For native rules see regle-rules; for form setup see regle.
data-ai
Migrate Vuelidate form validation to Regle. Use when porting forms that import from `@vuelidate/core`/`@vuelidate/validators` or call `useVuelidate` over to `useRegle`/`useScopedRegle`, including rules, validation properties, `v-model` bindings, nested/scoped validation, and parent-child form propagation.
development
Core Regle form validation in Vue 3 — setup with `useRegle`, the reactive `r$` object, validation properties, displaying errors, and modifiers. Use when adding or editing Regle forms, binding `v-model` to `r$.$value`, or reading `$error`/`$errors`/`$invalid`/`$validate`/`$reset`. For validation rules see regle-rules; for advanced patterns see regle-advanced.
development
TypeScript integration for Regle — type-safe validated output (`InferSafeOutput`, `$validate`), inferring state from rules (`InferInput`), typing computed rules (`inferRules`, `RegleComputedRules`), and typing component props (`InferRegleRoot`, `RegleRoot`, `RegleFieldStatus`, `SuperCompatibleRegleRoot`). Use when typing rules schemas, passing `r$` between components, or extracting validated data types.