Agent Skillsvictorgarciaesgi/regle › regle-rules

regle-rules

GitHub

用于在 Regle 表单中声明、自定义、组合及条件应用验证规则。支持内置规则、自定义规则、包装器及逻辑运算符,适用于前端表单校验场景。

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

Trigger Scenarios

需要定义或修改表单字段验证规则时 使用 createRule 编写自定义校验逻辑时 组合多个验证规则(如 and, or)时

Install

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

Use without installing

npx skills use victorgarciaesgi/regle@regle-rules

指定 Agent (Claude Code)

npx skills add victorgarciaesgi/regle --skill regle-rules -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-rules",
    "license": "MIT",
    "metadata": {
        "author": "Victor Garcia",
        "source": "https:\/\/reglejs.dev",
        "version": "1.27.0"
    },
    "description": "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.",
    "compatibility": "Requires Vue 3.3+ and TypeScript 5.1+. Works with any agent supporting the Agent Skills spec."
}

Regle Rules

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

Key Concepts

  • All rules are optional by default; add required to enforce a field.
  • Built-in rules are imported from @regle/rules; some are factories that take parameters (e.g. minLength(3)).
  • Custom rules use createRule for reusability, or an inline function for one-offs.
  • Wrappers adapt an existing rule (message, params, async, tooltip) without rewriting it.
  • Operators combine or conditionally apply rules.

References

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

Related skills

  • regle — form setup with useRegle, validation properties, displaying errors, modifiers.
  • regle-typescript — typing rules schemas with inferRules and RegleComputedRules.

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-schemas/SKILL.md
skills/regle-typescript/SKILL.md
skills/regle/SKILL.md
.cursor/skills/zoom-out/SKILL.md

Metadata

Files
0
Version
0df09b5
Hash
6fcd87d4
Indexed
2026-07-24 22:00

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 13:40
浙ICP备14020137号-1 $방문자$