部署与运维

platform-custom-field-generate

forcedotcom/sf-skills

Use when users create, generate, or validate Salesforce Custom Field metadata. Trigger on custom fields, field types, Roll-Up Summary, Master-Detail/Lookup relationships, formula fields, picklists, dependent (controlling) picklists, referencing a value set from a field, or scoping picklist values per record type; also field deployment errors, including a record type that won't deploy without a business process. DO NOT TRIGGER for creating/customizing the value set itself — a new GlobalValueSet or a StandardValueSet catalog like Industry — use platform-value-set-generate; this skill covers the field that references a value set, not the value set definition.

  • 6650 次安装
  • 1100 星标
  • 收录于

安装命令

npx skills add https://github.com/forcedotcom/sf-skills --skill platform-custom-field-generate

SKILL.md

Salesforce Custom Field Generator and Validator

Overview

Generates and validates Salesforce CustomField metadata XML, with special handling for the highest-failure-rate types — Roll-Up Summary and Master-Detail. The agent must verify the constraints below before outputting XML to prevent Metadata API deployment errors.


1. Universal Mandatory Attributes

Every generated field must include these tags:

Attribute Requirement Notes
<fullName> Required Field name only: derive from <label> — capitalize each word, replace spaces with _, append __c. Must start with a letter. E.g., label Total Contract Value → Total_Contract_Value__c. This rule is for the FIELD name. Picklist VALUE <fullName> is different — keep it exactly as the user spelled it, spaces and all, no __c (e.g. Closed Won, NOT Closed_Won). See references/advanced-picklists.md (ref §3).
<label> Required The UI name (Title Case)
<description> Always include Explain the business reason why this field exists.
<inlineHelpText> Always include Actionable end-user guidance that adds value beyond the label (e.g., "Enter the value in USD including tax", not "The amount").