--- name: platform-value-set-generate description: "Use this skill when users need to create, generate, or validate a Salesforce global value set or customize a standard value set. Trigger when users mention a global value set, GlobalValueSet, standard value set, StandardValueSet, a reusable picklist, a picklist value set shared across fields, or customizing standard picklists like Industry, Lead Source, or Opportunity Stage. Also use when users hit deployment errors adding values to a standard picklist, referencing a value set from a custom field, or working with .globalValueSet-meta.xml or .standardValueSet-meta.xml files. DO NOT TRIGGER for an inline one-off picklist on a single field with no reuse, or for general custom field metadata work that does not involve a GlobalValueSet or StandardValueSet — use platform-custom-field-generate instead." metadata: version: "1.0" minApiVersion: "60.0" cliTools: - tool: ["sf"] semver: ">=2.0.0" --- ## Overview Generates and validates the two reusable picklist value-set metadata types — **GlobalValueSet** (a new reusable set shared across fields) and **StandardValueSet** (customizing a built-in catalog picklist like Industry or Lead Source) — and wires a CustomField to one via ``. ### Scope - **In scope:** creating a GlobalValueSet, customizing a StandardValueSet, referencing either from a field, and the related deployment errors. - **Out of scope:** a one-off inline picklist on a single field with no reuse → use **`platform-custom-field-generate`** (inline ``). Generating the *field* that references a value set is also `platform-custom-field-generate`'s job; this skill produces the value set itself. **Two different metadata types — do not confuse them:** | Concern | GlobalValueSet | StandardValueSet | |---------|----------------|------------------| | Folder | `globalValueSets/` | `standardValueSets/` | | File suffix | `.globalValueSet-meta.xml` | `.standardValueSet-meta.xml` | | Root element | `` | `` | | Name source | filename (dev name) | `` = fixed catalog name | | Value element | `` | `` | | Can add NEW values? | Yes | No — modify existing only | | Can create a new NAME? | Yes | No — only the fixed catalog | | `*` wildcard in package.xml | Supported | Not supported | --- ## Specification ### 1. Purpose This document defines the mandatory constraints for generating value-set metadata XML. The agent must verify these constraints before outputting XML to prevent Metadata API deployment errors. - **GlobalValueSet** — a reusable, named set of picklist values defined once and referenced by any number of picklist/multi-select fields. Use when the same value list is shared across multiple fields. - **StandardValueSet** — the value list behind a Salesforce-defined standard picklist (Industry, Lead Source, etc.). You can only **modify** the values in a fixed catalog of named sets; you cannot invent a new set or add brand-new values. --- ### 2. GlobalValueSet — Syntactic Essentials **File:** `globalValueSets/.globalValueSet-meta.xml` The developer name comes from the **filename**, not a `` tag. #### Required Elements | Element | Requirement | Notes | |---------|-------------|-------| | `` | Required | UI label for the value set | | `` | Required | `true` = alphabetize values in the UI; `false` = preserve listed order | | `` | Required (≥1) | One per value (see below) | #### `` Sub-Elements | Sub-element | Requirement | Notes | |-------------|-------------|-------| | `` | Required | The value's API name. Use the value text **as the user spelled it** — spaces are allowed and must be preserved (e.g. `Closed Won`, not `Closed_Won`). Must start with a letter. This is a value name, NOT a field API name, so do not append `__c` or replace spaces with underscores. | | `` | Optional | At most one value `true`. Omit it (or use `false`) on the rest — it is not required on every value. | | `