Skill / SKILL.md

Bd Validation Rule

Lonsdale201/wp-agent-skills

Add a new validation rule to better-data — implement the Rule interface (NOT "RuleInterface"; the actual interface in src/Validation/Rule.php is named Rule), live in src/Validation/Rule/, and follow the canonical contract — check(mixed, string, DataObject) returns null on pass or a short error string on fail; rules other than Required treat null as skip so nullable fields don't false- positive. Each rule is also a PHP attribute (TARGET_PARAMETER | TARGET_PROPERTY | IS_REPEATABLE), is final readonly, holds zero business logic outside check(), and surfaces in JSON Schema via RestSchemaBuilder::applyRuleAttribute when relevant. Use when introducing a rule that isn't in src/Validation/Rule/ (Email, Url, Uuid, Min, Max, MinLength, MaxLength, Regex, OneOf, Required, Callback). Triggers on creating a class implementing Rule, adding a new
2 views 26 repository stars 0 commentsUpdated Nov 27, 2026
Overview

Add a new validation rule to better-data — implement the Rule interface (NOT "RuleInterface"; the actual interface in src/Validation/Rule.php is named Rule), live in src/Validation/Rule/, and follow the canonical contract — check(mixed, string, DataObject) returns null on pass or a short error string on fail; rules other than Required treat null as skip so nullable fields don't false- positive. Each rule is also a PHP attribute (TARGET_PARAMETER | TARGET_PROPERTY | IS_REPEATABLE), is final readonly, holds zero business logic outside check(), and surfaces in JSON Schema via RestSchemaBuilder::applyRuleAttribute when relevant. Use when introducing a rule that isn't in src/Validation/Rule/ (Email, Url, Uuid, Min, Max, MinLength, MaxLength, Regex, OneOf, Required, Callback). Triggers on creating a class implementing Rule, adding a new

Installation & variants

Download the repository, including the skill’s supporting files.

git clone -- 'https://github.com/Lonsdale201/wp-agent-skills' skill-source

Use the complete skill-source/better-data/bd-validation-rule directory with your client’s skill installer.

  • better-data/bd-validation-rule

    main · SKILL.md

    Open installation source

    Source directory recorded from the imported repository path

Source directory better-data/bd-validation-rule

Source instructions
Read source instructions

Open to load source instructions

Original SKILL.md

Open to load the original file

Included files
Source & validation
Source status
Awaiting source check
Format validation
Format valid
Checked at
Pending source check
Content SHA-256
e1350dbb0dbb44826af7a76d3596ed142b35d51f3377534b43a8f90de33a4681
Discussion
Comments Be the First to Comment

Please log in to comment

    No comments yet

Related skills