Help us improve
Share bugs, ideas, or general feedback.
From vanguard-frontier-agentic
Translates plain-English business rules into deployable Salesforce validation rule formula syntax, including error messages, profile bypass, null handling, and formula safety checks.
npx claudepluginhub raishin/vanguard-frontier-agentic --plugin vanguard-frontier-agenticHow this skill is triggered — by the user, by Claude, or both
Slash command
/vanguard-frontier-agentic:salesforce-validation-rule-writer-skillThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Pure-generation T0 skill that translates plain-English business rules into
Creates, modifies, and validates Salesforce Validation Rules metadata with formulas, error messages, and data quality logic. Includes guidelines for correct function usage.
Reviews Salesforce Flow automation definitions for correctness, safety, and maintainability. Flags recursion, bypass flags, null handling, and missing fault paths.
Identifies Salesforce pitfalls like SOQL N+1 queries, governor limit violations, API overuse, and SOQL injection during code reviews, onboarding, and integration audits.
Share bugs, ideas, or general feedback.
Pure-generation T0 skill that translates plain-English business rules into production-ready Salesforce validation rule formula syntax. Outputs the formula, a clear error message, profile bypass guidance, null handling, and a formula compilation checklist. Nothing is deployed — this skill generates text only.
Use salesforce-validation-rule-writer-skill when the request is to write
or design a validation rule formula:
Delegate elsewhere when:
| Situation | Skill to use |
|---|---|
| Reviewing or auditing existing validation rule logic | salesforce-platform-admin-review-agent |
| Deploying the generated formula to an org | salesforce-deployment-validator-skill |
| Bulk enabling/disabling many rules across objects | salesforce-bulk-data-ops-skill |
| Need to check what existing rules are on an object | salesforce-metadata-fetcher-skill |
Before generating a formula, confirm:
My_Object__c).RecordType.DeveloperName branching.)ISNEW, ISCHANGED implications.)If any critical context is missing, ask before generating.
Restate the rule in your own words to confirm understanding:
"This rule fires when: [condition]. It blocks save with: [error text]. It is bypassed for: [profile/record type]. It applies on: [new/edit/both]."
Ask for confirmation before proceeding.
Break the rule into atomic boolean conditions. Map each condition to the appropriate Salesforce formula function:
| Condition type | Formula pattern |
|---|---|
| Field is blank | ISBLANK(Field__c) for text; ISNULL(Field__c) for number/date |
| Field equals picklist value | TEXT(Field__c) = "API_Value" |
| Field changed | ISCHANGED(Field__c) |
| New record | ISNEW |
| Prior value comparison | PRIORVALUE(Field__c) |
| Record type check | RecordType.DeveloperName = "RecordTypeName" |
| Date in past | Field__c < TODAY |
Wrap atomic conditions using:
AND(cond1, cond2) — both must be trueOR(cond1, cond2) — either must be trueNOT(cond) — negationPrefer explicit AND/OR over &&/|| operators for readability
and tooling compatibility. Nest carefully — Salesforce formulas have a
5,000-character compiled size limit.
Unless the customer explicitly opts out, wrap the core logic with a System Administrator bypass:
AND(
$Profile.Name <> "System Administrator",
<your_core_formula>
)
For additional profiles, use:
AND(
NOT(OR(
$Profile.Name = "System Administrator",
$Profile.Name = "Sales Ops"
)),
<your_core_formula>
)
Validate that every text, date, and number field access guards against null where needed:
ISBLANK not = ""ISNULL or BLANKVALUE(Field__c, 0) before
arithmeticISNULL or compare after null guardTEXT(Field__c) = "Value" not Field__c = "Value"INCLUDES(Field__c, "Value")Apply these principles (see references/error-message-style.md):
Good: "Close Date cannot be in the past. Set a future date to save."
Bad: "Validation error: CloseDate field value failed validation formula."
Before emitting, verify mentally:
IF(divisor = 0, ...))NOT(ISNEW))Produce the full output block per the Output Format section below.
Score every output before emitting. Threshold: 85+ ship, 70–84 ship with caveat, below 70 reject and revise.
| Dimension | Points | What earns full marks |
|---|---|---|
| Formula correctness | 30 | Formula evaluates to TRUE when it should block; correct operators; picklist TEXT wrapper; ISBLANK/ISNULL appropriately placed |
| Error message clarity | 20 | ≤ 15 words, action-oriented, names the required field or condition, no technical jargon |
| Profile bypass awareness | 15 | System Admin bypass present unless explicitly opted out; additional profiles listed; bypass wrapper syntactically correct |
| Null handling | 15 | Every field access null-guarded; no runtime errors on blank fields; BLANKVALUE used where arithmetic is involved |
| Governor limit safety | 10 | Compiled size < 5,000 chars; no cross-object formula chain deeper than 5 hops; no expensive SOQL-like patterns in formulas |
| Formula compilation safety | 10 | PRIORVALUE/ISCHANGED gated by NOT(ISNEW); no division by zero; no circular references; all functions used with correct argument counts |
Scoring penalties:
This skill is static-review (T0) only:
salesforce-deployment-validator-skill.Stop and decline if:
salesforce-platform-admin-review-agent).salesforce-deployment-validator-skill).verdict: "ship | ship-with-caveat | reject"
quality_score: <0-100>
quality_notes: "<what drove the score>"
validation_rule:
object_api_name: "<SObjectApiName>"
rule_name_suggestion: "<DescriptiveRuleName_NoSpaces>"
active: true
description: "<one-sentence plain English description>"
error_condition_formula: |
<multiline formula text>
error_message: "<≤15 word actionable message>"
error_display_field: "<FieldApiName | blank for page-level>"
profile_bypass:
included: <true|false>
profiles_bypassed: ["System Administrator"]
notes: "<any bypass caveats>"
null_handling_notes: "<summary of null guards applied>"
compilation_checklist:
formula_is_true_when_blocking: <true|false>
priorvalue_gated_by_isnew: <true|false|not_applicable>
ischanged_gated_by_isnew: <true|false|not_applicable>
no_division_by_zero: <true|false>
all_picklists_use_text_wrapper: <true|false|not_applicable>
compiled_size_estimate: "<characters>"
deployment_notes: "<instructions for deploying in Setup UI or via Change Set>"
handoff_suggestions:
- "<any recommended follow-up actions>"
assumptions:
- "<explicit list of assumptions made>"
This is a T0 generation skill with no live org connection. Apply:
00D)
or User IDs (18-char starting 005) before incorporating into output.| Situation | Hand off to |
|---|---|
| User wants to deploy the generated rule | salesforce-deployment-validator-skill |
| User wants to review existing rules on the object | salesforce-metadata-fetcher-skill → salesforce-platform-admin-review-agent |
| Formula involves complex record types or permission topology | salesforce-permission-model-review-skill |
| User needs bulk enable/disable of rules | salesforce-bulk-data-ops-skill |
| File | When to read |
|---|---|
references/formula-syntax-quickref.md | Operators, ISBLANK/ISNULL, AND/OR/NOT, TEXT/VALUE/DATEVALUE, BLANKVALUE, PRIORVALUE |
references/validation-patterns.md | Required-when patterns, prevent-bypass-by-profile, conditional require by record type, dependent picklist validation |
references/error-message-style.md | Concise actionable errors, no jargon, point to fix |