platform-validation-rule-generate

Generate and modify Salesforce Validation Rule metadata with formula and XML guidance.

Updated Jul 2, 2026
One-click install
npx skills add https://github.com/padjei/SF_Build --skill platform-validation-rule-generate-padjei
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: platform-validation-rule-generate
Source: https://github.com/padjei/SF_Build/tree/main/.claude/skills/platform-validation-rule-generate
Command: npx skills add https://github.com/padjei/SF_Build --skill platform-validation-rule-generate-padjei

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Creating Salesforce Validation Rules requires precise formula syntax, correct function usage per field type, and strict metadata XML formatting, and small mistakes cause deployment failures or broken business logic. ## Core Features & Use Cases - Validation Rule Generation: Produces .validationRule-meta.xml files with correct fullName, active, errorConditionFormula, and errorMessage properties. - Formula Function Guidance: Enforces correct usage of TEXT, CASE, VALUE, DAY, MONTH, DATEVALUE, ISPICKVAL, and ISCHANGE based on field data types. - Update Semantics: Distinguishes between replacing a formula and appending new logic with AND/OR wrapping when modifying existing rules. - Use Case: When a user asks to add a rule preventing Opportunities from closing without an Amount, the Skill generates deployable metadata XML with the formula wrapped in CDATA and a clear error message. ## Quick Start Ask the AI to create a Salesforce validation rule that prevents saving an Account record when the Phone field is blank.

Frequently Asked Questions about platform-validation-rule-generate

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Salesforce validation rule with a formula?▼

Define the errorConditionFormula that returns TRUE when the record is invalid, plus an errorMessage under 255 characters. The Skill generates the complete .validationRule-meta.xml file with proper naming and active status.

How to update an existing Salesforce validation rule formula?▼

Specify whether to replace the formula entirely or append new logic. Instructions like 'update to also check X' keep existing logic wrapped in AND/OR, while 'update to X' replaces the formula completely.

Why does my validation rule formula fail with XML errors?▼

Formulas containing XML tags or special characters must be wrapped in a CDATA section inside the metadata XML. This is the most common deployment error for validation rules.

When should I use ISPICKVAL instead of TEXT in Salesforce formulas?▼

Use ISPICKVAL() for equality checks on picklist fields, and never wrap Text fields in TEXT(). VALUE() only applies to Text fields, and DATEVALUE() only applies to DateTime fields.

What are the naming limits for Salesforce validation rules?▼

The fullName must start with a letter, contain only letters, numbers, and underscores, avoid consecutive or trailing underscores, and stay within 40 characters.