Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
clientell-ai avatar

Sf Schema

  • 41 installs
  • 12 repo stars
  • Updated July 14, 2026
  • clientell-ai/salesforce-skills

Generate and validate Salesforce custom field, formula, and object metadata XML when extending a CRM-backed app or sync layer.

About

sf-schema is an agent skill that equips solo builders and small teams with Salesforce Metadata API–style XML fragments for custom fields and formulas. When you extend Leads, Opportunities, or custom objects, agents often hallucinate invalid field types, wrong blank-handling, or broken cross-object syntax—this skill anchors generation to concrete patterns for text, number, and date formulas, renewal-date logic, and CASE-driven scoring. It fits builders shipping SaaS with Salesforce as system of record, RevOps automations, or sync services that must deploy metadata through CI. Use it while modeling fields in build, before packaging changes for ship, not as a substitute for org-specific validation rules or full object XML. Pair with your deployment toolchain and org documentation so generated XML matches your namespacing and API version.

  • Copy-paste XML patterns for Text, Number, and Date formula fields with formulaTreatBlanksAs
  • Cross-object formula examples using relationship traversal (e.g. Account__r.Industry)
  • CASE, IF, and ISBLANK formula snippets for priority and scoring fields
  • Precision, scale, and externalId flags aligned to Salesforce field-type rules
  • Reference-oriented snippets for common custom-field metadata blocks

Sf Schema by the numbers

  • 41 all-time installs (skills.sh)
  • Ranked #3,278 of 4,347 Backend & APIs skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
npx skills add https://github.com/clientell-ai/salesforce-skills --skill sf-schema

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs41
repo stars12
Security audit3 / 3 scanners passed
Last updatedJuly 14, 2026
Repositoryclientell-ai/salesforce-skills

What it does

Generate and validate Salesforce custom field, formula, and object metadata XML when extending a CRM-backed app or sync layer.

Files

SKILL.mdMarkdownGitHub ↗

Schema Design & Permission Management

You are a Salesforce schema and metadata specialist. Generate valid SFDX source format metadata.

Custom Object

<!-- force-app/main/default/objects/Invoice__c/Invoice__c.object-meta.xml -->
<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
    <label>Invoice</label>
    <pluralLabel>Invoices</pluralLabel>
    <nameField>
        <label>Invoice Number</label>
        <type>AutoNumber</type>
        <displayFormat>INV-{000000}</displayFormat>
    </nameField>
    <deploymentStatus>Deployed</deploymentStatus>
    <sharingModel>Private</sharingModel>
    <enableActivities>true</enableActivities>
    <enableHistory>true</enableHistory>
    <enableReports>true</enableReports>
</CustomObject>

Custom Fields

<!-- force-app/main/default/objects/Invoice__c/fields/Amount__c.field-meta.xml -->
<?xml version="1.0" encoding="UTF-8"?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>Amount__c</fullName>
    <label>Amount</label>
    <type>Currency</type>
    <precision>18</precision>
    <scale>2</scale>
    <required>true</required>
</CustomField>

Common Field Types

<!-- Text -->
<type>Text</type>
<length>255</length>

<!-- Long Text Area -->
<type>LongTextArea</type>
<length>32768</length>
<visibleLines>5</visibleLines>

<!-- Picklist -->
<type>Picklist</type>
<valueSet>
    <restricted>true</restricted>
    <valueSetDefinition>
        <sorted>false</sorted>
        <value><fullName>Active</fullName><default>true</default><label>Active</label></value>
        <value><fullName>Inactive</fullName><default>false</default><label>Inactive</label></value>
    </valueSetDefinition>
</valueSet>

<!-- Lookup -->
<type>Lookup</type>
<referenceTo>Account</referenceTo>
<relationshipLabel>Invoices</relationshipLabel>
<relationshipName>Invoices</relationshipName>

<!-- Master-Detail -->
<type>MasterDetail</type>
<referenceTo>Account</referenceTo>
<relationshipLabel>Invoices</relationshipLabel>
<relationshipName>Invoices</relationshipName>
<reparentableMasterDetail>false</reparentableMasterDetail>
<writeRequiresMasterRead>false</writeRequiresMasterRead>

<!-- Checkbox -->
<type>Checkbox</type>
<defaultValue>false</defaultValue>

<!-- Date -->
<type>Date</type>

<!-- DateTime -->
<type>DateTime</type>

<!-- Number -->
<type>Number</type>
<precision>18</precision>
<scale>0</scale>

<!-- Formula -->
<type>Text</type>
<formula>Account__r.Name &amp; ' - ' &amp; TEXT(Amount__c)</formula>

Validation Rules

<!-- force-app/main/default/objects/Invoice__c/validationRules/Amount_Required.validationRule-meta.xml -->
<?xml version="1.0" encoding="UTF-8"?>
<ValidationRule xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>Amount_Must_Be_Positive</fullName>
    <active>true</active>
    <errorConditionFormula>Amount__c &lt;= 0</errorConditionFormula>
    <errorDisplayField>Amount__c</errorDisplayField>
    <errorMessage>Amount must be greater than zero.</errorMessage>
</ValidationRule>

Permission Sets

<!-- force-app/main/default/permissionsets/Invoice_Manager.permissionset-meta.xml -->
<?xml version="1.0" encoding="UTF-8"?>
<PermissionSet xmlns="http://soap.sforce.com/2006/04/metadata">
    <label>Invoice Manager</label>
    <hasActivationRequired>false</hasActivationRequired>
    <objectPermissions>
        <object>Invoice__c</object>
        <allowCreate>true</allowCreate>
        <allowDelete>false</allowDelete>
        <allowEdit>true</allowEdit>
        <allowRead>true</allowRead>
        <modifyAllRecords>false</modifyAllRecords>
        <viewAllRecords>true</viewAllRecords>
    </objectPermissions>
    <fieldPermissions>
        <field>Invoice__c.Amount__c</field>
        <editable>true</editable>
        <readable>true</readable>
    </fieldPermissions>
    <fieldPermissions>
        <field>Invoice__c.Status__c</field>
        <editable>true</editable>
        <readable>true</readable>
    </fieldPermissions>
</PermissionSet>

Custom Permissions (for Flow Bypass)

<!-- force-app/main/default/customPermissions/Bypass_Automation.customPermission-meta.xml -->
<?xml version="1.0" encoding="UTF-8"?>
<CustomPermission xmlns="http://soap.sforce.com/2006/04/metadata">
    <label>Bypass Automation</label>
    <isLicensed>false</isLicensed>
</CustomPermission>

Additional Field Types

Formula Field:

<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>FullName__c</fullName>
    <label>Full Name</label>
    <type>Text</type>
    <formula>FirstName__c &amp; ' ' &amp; LastName__c</formula>
    <formulaTreatBlanksAs>BlankAsZero</formulaTreatBlanksAs>
</CustomField>

Rollup Summary Field (master-detail only):

<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>Total_Amount__c</fullName>
    <label>Total Amount</label>
    <type>Summary</type>
    <summarizedField>LineItem__c.Amount__c</summarizedField>
    <summaryOperation>sum</summaryOperation>
    <summaryForeignKey>LineItem__c.Order__c</summaryForeignKey>
</CustomField>

Geolocation Field:

<type>Location</type>
<displayLocationInDecimal>true</displayLocationInDecimal>
<scale>6</scale>

Global Value Set (Reusable Picklist):

<GlobalValueSet xmlns="http://soap.sforce.com/2006/04/metadata">
    <masterLabel>Industries</masterLabel>
    <sorted>false</sorted>
    <customValue><fullName>Technology</fullName><default>false</default><label>Technology</label></customValue>
    <customValue><fullName>Healthcare</fullName><default>false</default><label>Healthcare</label></customValue>
</GlobalValueSet>

Relationship Types

TypeDelete BehaviorRollup SummaryReparentingMax per Object
Master-DetailCascade deleteYesConfigurable2
LookupBlock/Clear/RestrictNoN/A40 (25 std)
External LookupN/ANoN/A-
HierarchicalN/ANoN/A1 (User only)
Junction (M2M)Two master-detailsOn both parents--

Record Types

<RecordType xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>Enterprise</fullName>
    <label>Enterprise</label>
    <active>true</active>
    <businessProcess>Enterprise Sales Process</businessProcess>
    <description>For enterprise accounts</description>
</RecordType>

Custom Metadata Types vs Custom Settings

FeatureCustom Metadata TypesCustom Settings (Hierarchy)
DeployableYes (metadata)No (data)
SOQL requiredYes (or getInstance)No (getOrgDefaults)
User/Profile overrideNoYes
Counts against SOQL limitYesNo
Use forOrg config, mappingsUser preferences

Permission Set Groups

<PermissionSetGroup xmlns="http://soap.sforce.com/2006/04/metadata">
    <label>Sales Team</label>
    <permissionSets>
        <permissionSet>Account_Manager</permissionSet>
        <permissionSet>Opportunity_Editor</permissionSet>
        <permissionSet>Report_Viewer</permissionSet>
    </permissionSets>
</PermissionSetGroup>

SFDX Source Directory Structure

force-app/main/default/
├── objects/
│   └── Invoice__c/
│       ├── Invoice__c.object-meta.xml
│       ├── fields/
│       │   ├── Amount__c.field-meta.xml
│       │   └── Status__c.field-meta.xml
│       ├── validationRules/
│       │   └── Amount_Must_Be_Positive.validationRule-meta.xml
│       └── listViews/
│           └── All.listView-meta.xml
├── permissionsets/
│   └── Invoice_Manager.permissionset-meta.xml
├── customPermissions/
│   └── Bypass_Automation.customPermission-meta.xml
└── layouts/
    └── Invoice__c-Invoice Layout.layout-meta.xml

Gotchas

  • Max 40 custom relationships per object (25 for standard objects)
  • Formula fields cannot reference LongTextArea, RichTextArea, MultiSelectPicklist, or Encrypted fields
  • Rollup Summary fields work only on Master-Detail relationships — not Lookups
  • Global Value Sets cannot be converted back to local picklists once shared
  • Encrypted Text fields are not searchable or sortable
  • Record type-dependent picklists require explicit value mapping per record type
  • Permission Set Groups recalculate asynchronously — changes may take minutes to apply
  • Custom Metadata Type records cannot be created/updated via DML in production — deploy only
  • Profiles are notoriously merge-conflict-prone — prefer Permission Sets for everything

References

  • Schema Reference — formula fields, rollup summaries, geolocation, Global Value Sets, record types, page layouts, FlexiPages, custom metadata, platform events, Big Objects, quick actions, custom labels

Workflow

1. Understand object/field requirements 2. Generate SFDX source format XML files 3. Generate permission set for new objects/fields 4. Deploy schema first, then code that references it 5. Verify with: sf org list metadata -m CustomObject --target-org myOrg

Related skills

FAQ

Is Sf Schema safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

Backend & APIsintegrationsbackend

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.