Agent Skills
› victorgarciaesgi/regle
› regle-schemas
regle-schemas
GitHub用于将 Regle 表单验证与 Zod、Valibot 等外部 Schema 库集成。通过 useRegleSchema 替代原生规则,支持类型推断及混合使用 Schema 与原生规则,实现基于标准 Schema 规范的表单数据校验。
触发场景
需要将表单验证逻辑委托给外部 Schema 库(如 Zod)
需要基于 Standard Schema 规范进行表单校验
需要从 Schema 定义中自动推断 TypeScript 类型
安装
npx skills add victorgarciaesgi/regle --skill regle-schemas -g -y
SKILL.md
Frontmatter
{
"name": "regle-schemas",
"license": "MIT",
"metadata": {
"author": "Victor Garcia",
"source": "https:\/\/reglejs.dev",
"version": "1.27.0"
},
"description": "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.",
"compatibility": "Requires Vue 3.3+, TypeScript 5.1+, and `@regle\/schemas`. Works with any agent supporting the Agent Skills spec."
}
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)replacesuseRegle; ther$object behaves the same.- Works with any Standard Schema library; Zod, Valibot, and ArkType are first-class.
useRules/refineRuleslet you mix schema validation with native Regle rules.InferInputinfers the state type from the schema.
References
| Topic | Description | Reference |
|---|---|---|
| Schema Libraries | useRegleSchema with Zod, Valibot, ArkType |
schemas-libraries |
| Standard Schema | Standard Schema spec, useRules, refineRules, InferInput |
schemas-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.
版本历史
- aeafba7 当前 2026-07-24 22:00


