Agent Skillsvictorgarciaesgi/regle › regle-schemas

regle-schemas

GitHub

用于在 Regle 表单中集成 Zod、Valibot 等外部 Schema 库进行数据验证。通过 useRegleSchema 替代原生规则,支持混合验证与类型推断,适用于基于 Schema 定义校验逻辑的场景。

skills/regle-schemas/SKILL.md victorgarciaesgi/regle

Trigger Scenarios

需要基于 Zod/Valibot 等 Schema 库验证表单 使用 Standard Schema 规范进行前端表单校验

Install

npx skills add victorgarciaesgi/regle --skill regle-schemas -g -y
More Options

Use without installing

npx skills use victorgarciaesgi/regle@regle-schemas

指定 Agent (Claude Code)

npx skills add victorgarciaesgi/regle --skill regle-schemas -a claude-code -g -y

安装 repo 全部 skill

npx skills add victorgarciaesgi/regle --all -g -y

预览 repo 内 skill

npx skills add victorgarciaesgi/regle --list

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) 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

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.

Version History

  • aeafba7 Current 2026-07-24 22:00

Same Skill Collection

.cursor/skills/antfu/SKILL.md
.cursor/skills/caveman/SKILL.md
.cursor/skills/diagnose/SKILL.md
.cursor/skills/edit-article/SKILL.md
.cursor/skills/grill-me/SKILL.md
.cursor/skills/grill-with-docs/SKILL.md
.cursor/skills/improve-codebase-architecture/SKILL.md
.cursor/skills/prototype/SKILL.md
.cursor/skills/ts-memory-baseline/SKILL.md
.cursor/skills/tsdown/SKILL.md
.cursor/skills/turborepo/SKILL.md
.cursor/skills/vite-plus/SKILL.md
.cursor/skills/vite/SKILL.md
.cursor/skills/vitepress/SKILL.md
.cursor/skills/vitest/SKILL.md
.cursor/skills/vue/SKILL.md
.cursor/skills/write-a-skill/SKILL.md
.github/skills/code-review/SKILL.md
skills/regle-advanced/SKILL.md
skills/regle-migrate-vuelidate/SKILL.md
skills/regle-rules/SKILL.md
skills/regle-typescript/SKILL.md
skills/regle/SKILL.md
.cursor/skills/zoom-out/SKILL.md

Metadata

Files
0
Version
0df09b5
Hash
34a2691f
Indexed
2026-07-24 22:00

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 08:24
浙ICP备14020137号-1 $Гость$