agentleFS
victorgarciaesgivictorgarciaesgi/regle/skills/regle-rules/SKILL.md

regle-rules

Skill508 starsChanged 8 months agoMITView on GitHub

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.

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All rules are optional by default.

    line 28

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

TopicDescriptionReference
Built-in RulesAll validation rules from @regle/rulesrules-built-in
Custom RulesInline rules, createRule, reactive parameters, async rules, metadatarules-custom
Rule WrapperswithMessage, withParams, withAsync, withTooltip, chainingrules-wrappers
Rule Operatorsand, or, xor, not, applyIf, assignIf, piperules-operators

Related skills

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

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.