
Platform Validation Rule Generate
This generates Salesforce validation rule metadata files with proper formula syntax and error handling. It's built for creating new rules from scratch or fixing deployment errors, which is nice because validation rule formulas are notoriously finicky with XML escaping and function usage. The skill knows the common gotchas like wrapping formulas in CDATA sections, not using TEXT() on text fields, and remembering CASE() needs an even number of parameters. It also handles the ambiguity when someone says "update the formula" versus "update the formula to also" by either replacing or appending logic. If you're tired of validation rule deployment failures or just want to scaffold rules faster, this handles the boilerplate and keeps you from making the usual mistakes.
- skills.sh installs
- 6.3K
- GitHub stars
- 1.2K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add forcedotcom/sf-skills --skill platform-validation-rule-generate --agent claude-codeInstalls into .claude/skills of the current project.
Files
When to Use This Skill
Use this skill when you need to:
- Create validation rules to enforce data quality
- Prevent invalid records from being saved
- Generate validation rule metadata with formulas
- Add business logic validation to objects
- Troubleshoot deployment errors related to validation rules
Specification
ValidationRule Metadata Specification
Overview
Validation Rules are declarative metadata components used to enforce data quality and business logic in Salesforce. They evaluate a formula expression when a record is saved and prevent the save operation if the expression returns TRUE.
Purpose
-Enforce business rules at the data layer -Prevent invalid or incomplete records from being saved -Display meaningful error messages to guide users
Required Properties
Core Validation Rule Properties
- fullName
- The unique API name of the validation rule
- Must start with a letter
- Can contain letters, numbers, and underscores
- Cannot end with an underscore
- Cannot contain consecutive underscores
- Cannot exceed 40 character.
Sponsors
Details
- Repository
- github.com/forcedotcom/sf-skills
- Categories
- Code Review & Quality, Debugging, Sales & Marketing
- First seen
- Jul 14, 2026
More from forcedotcom/sf-skills
All 158- Platform Data Manage6.3K
- Dx Org Manage6.2K
- Platform Flexipage Generate6.2K
- Platform Metadata Api Context Get6.2K
- Platform Sharing Rules Generate6.2K
- Design Systems Slds Apply6.1K
- Design Systems Slds Validate6K
- Agentforce Generate6K
- Platform Custom Tab Generate6K
- Dx Code Analyzer Configure5.9K
- Platform Custom Application Generate5.9K
- Platform List View Generate5.9K
- Agentforce Architecture Analyze5.9K
- Dx Org Switch5.8K
- Dx Org Permission Set Assign5.8K
- Platform Custom Lightning Type Generate5.8K
- Agentforce Test5.8K
- Agentforce Observe5.8K
- Platform Lightning App Coordinate5.7K
- Design Systems Slds2 Migrate5.7K
- External Diagram Mermaid Generate5.6K
- Integration Connectivity Connected App Configure5.5K
- Integration Connectivity Generate5.5K
- Agentforce D360 Analyze5.4K