nadolskimm-max/sf-skills/sf-formula
Claude Code and agent skill by nadolskimm-max/sf-skills
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Creates Salesforce formula fields, validation rules, and formula-based automation. Use when writing formula field expressions, building validation rules, troubleshooting formula compilation errors, or optimizing formula performance (compiled size limits). Do NOT use for SOQL queries (use sf-soql) or Flow formulas (use sf-flow).
Install
npx vskill@latest install nadolskimm-max/sf-skills/sf-formulaSKILL.md
Salesforce Formulas & Validation Rules
Core Responsibilities
- Create formula fields (text, number, checkbox, date)
- Build validation rules with complex conditions
- Troubleshoot formula compilation errors and size limits
- Handle null values and cross-object references
- Optimize formula performance
Formula Field Types
| Return Type | Use Case | Example | |
|---|---|---|---|
| Text | Concatenation, formatting | Full Name, formatted address | |
| Number | Calculations | Discount amount, days open | |
| Currency | Financial calculations | Weighted revenue | |
| Percent | Ratios | Win rate, completion % | |
| Checkbox | Boolean logic | Is High Value?, Is Overdue? | |
| Date | Date calculations | Due Date, Next Review Date | |
| DateTime | Timestamp calculations | SLA deadline |
Common Formula Patterns
Null-Safe Field Access
Cross-Object Reference
Text Concatenation
Date Calculations
Conditional Logic
Image Formula
Validation Rules
Required Field Conditionally
Prevent Backdating
Email Format Validation
Cross-Object Validation
REGEX Patterns
| Pattern | Matches | |
|---|---|---|
^[0-9]{5}(-[0-9]{4})?$ | US ZIP code (12345 or 12345-6789) | |
^\\+?[1-9]\\d{1,14}$ | E.164 phone number | |
^[A-Z]{2}[0-9]{2}[A-Z0-9]{4}[0-9]{7}([A-Z0-9]?){0,16}$ | IBAN | |
^[0-9]{3}-[0-9]{2}-[0-9]{4}$ | US SSN format |
Compiled Size Limits
| Limit | Maximum | |
|---|---|---|
| Formula field compiled size | 5,000 characters | |
| Validation rule formula size | 5,000 characters | |
| Cross-object spans | Max 10 relationships | |
| SOQL in formulas | Not allowed |
Size Reduction Tips
- Replace
IF(condition, true, false)with justconditionfor checkboxes - Use
CASEinstead of nestedIF(smaller compiled size) - Move complex logic to Apex/Flow if approaching limits
- Avoid deep cross-object references (each span adds ~200 chars)
Anti-Patterns
| Anti-Pattern | Fix | |
|---|---|---|
| No null handling | Wrap in IF(ISBLANK(...)) or BLANKVALUE() | |
| Nested IF > 5 levels | Use CASE statement instead | |
| Hardcoded picklist values | Use ISPICKVAL() for type safety | |
| Formula field referencing formula field | Beware of compiled size cascade | |
| Validation rule with no error message context | Point to specific field with errorDisplayField |
Cross-Skill References
- For formula fields in metadata: see sf-metadata
- For Flow formula resources: see sf-flow
- For validation rule deployment: see sf-deploy
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/sf-formula/SKILL.md
Popularity
- 7-day trend score
- 0
Refreshed 20 Mar 2026, 8 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/nadolskimm-max/sf-skills/sf-formula)