/platform-value-set-generate
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
$ npx -y skills add forcedotcom/sf-skills --skill platform-value-set-generate --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/platform-value-set-generate
Context preview
The summary Claude sees to decide when to auto-load this skill.
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
SKILL.md
platform-value-set-generate.SKILL.mdname: 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 `<valueSetName>`.
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 `<valueSetDefinition>`). 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 | `<GlobalValueSet>` | `<StandardValueSet>` | | Name source | filename (dev name) | `<fullName>` = fixed catalog name | | Value element | `<customValue>` | `<standardValue>` | | 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/<DeveloperName>.globalValueSet-meta.xml`
The developer name comes from the **filename**, not a `<fullName>` tag.
Required Elements
| Element | Requirement | Notes | |---------|-------------|-------| | `<masterLabel>` | Required | UI label for the value set | | `<sorted>` | Required | `true` = alphabetize values in the UI; `false` = preserve listed order | | `<customValue>` | Required (≥1) | One per value (see below) |
`<customValue>` Sub-Elements
| Sub-element | Requirement | Notes | |-------------|-------------|-------| | `<fullName>` | 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. | | `<default>` | Optional | At most one value `true`. Omit it (or use `false`) on the rest — it is not required on every value. | | `<label>` | Required | UI label for the value | | `<color>` | Optional | Hex color, e.g. `#FF0000` | | `<isActive>` | Optional | Omit (active) or `false` to deactivate | | `<description>` | Optional | Per-value description |
The `__gvs` Suffix — do NOT use it in metadata
**Rule: reference a GlobalValueSet by its bare developer name. Never add `__gvs`.**
In API 57.0+ orgs the platform *stores/displays* a GlobalValueSet's developer name with a `__gvs` suffix internally, but the **Metadata API (deploy and retrieve) always uses the bare name** — `<valueSetName>Priority_Levels</valueSetName>`, not `Priority_Levels__gvs`. The suffix was briefly emitted by a Winter '23 change that caused deploy failures and was patched out. So:
- The file is `globalValueSets/Priority_Levels.globalValueSet-meta.xml` — **no `__gvs`** in the filename.
- A field references it as `<valueSetName>Priority_Levels</valueSetName>` — **no `__gvs`**.
- If a retrieve shows `Priority_Levels__gvs` in the org or you see a "returned from org but not found in local project" warning, that's the expected org-storage display — keep your local metadata on the bare name.
CORRECT — GlobalValueSet
<?xml version="1.0" encoding="UTF-8"?>
<GlobalValueSet xmlns="http://soap.sforce.com/2006/04/metadata">
<masterLabel>Priority Levels</masterLabel>
<sorted>false</sorted>
<customValue>
<fullName>Critical</fullName>
<default>false</default>
<label>Critical</label>
</customValue>
<customValue>
<fullName>High</fullName>
<default>false</default>
<label>High</label>
</customValue>
<customValue>
<fullName>Medium</fullName>
<default>true</default>
<label>Medium</label>
</customValue>
<customValue>
<fullName>Low</fullName>
<default>false</default>
<label>Low</labelRead more
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 `<valueSetName>`.
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 `<valueSetDefinition>`). 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 | `<GlobalValueSet>` | `<StandardValueSet>` | | Name source | filename (dev name) | `<fullName>` = fixed catalog name | | Value element | `<customValue>` | `<standardValue>` | | 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/<DeveloperName>.globalValueSet-meta.xml`
The developer name comes from the **filename**, not a `<fullName>` tag.
Required Elements
| Element | Requirement | Notes | |---------|-------------|-------| | `<masterLabel>` | Required | UI label for the value set | | `<sorted>` | Required | `true` = alphabetize values in the UI; `false` = preserve listed order | | `<customValue>` | Required (≥1) | One per value (see below) |
`<customValue>` Sub-Elements
| Sub-element | Requirement | Notes | |-------------|-------------|-------| | `<fullName>` | 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. | | `<default>` | Optional | At most one value `true`. Omit it (or use `false`) on the rest — it is not required on every value. | | `<label>` | Required | UI label for the value | | `<color>` | Optional | Hex color, e.g. `#FF0000` | | `<isActive>` | Optional | Omit (active) or `false` to deactivate | | `<description>` | Optional | Per-value description |
The `__gvs` Suffix — do NOT use it in metadata
**Rule: reference a GlobalValueSet by its bare developer name. Never add `__gvs`.**
In API 57.0+ orgs the platform *stores/displays* a GlobalValueSet's developer name with a `__gvs` suffix internally, but the **Metadata API (deploy and retrieve) always uses the bare name** — `<valueSetName>Priority_Levels</valueSetName>`, not `Priority_Levels__gvs`. The suffix was briefly emitted by a Winter '23 change that caused deploy failures and was patched out. So:
- The file is `globalValueSets/Priority_Levels.globalValueSet-meta.xml` — **no `__gvs`** in the filename.
- A field references it as `<valueSetName>Priority_Levels</valueSetName>` — **no `__gvs`**.
- If a retrieve shows `Priority_Levels__gvs` in the org or you see a "returned from org but not found in local project" warning, that's the expected org-storage display — keep your local metadata on the bare name.
CORRECT — GlobalValueSet
<?xml version="1.0" encoding="UTF-8"?>
<GlobalValueSet xmlns="http://soap.sforce.com/2006/04/metadata">
<masterLabel>Priority Levels</masterLabel>
<sorted>false</sorted>
<customValue>
<fullName>Critical</fullName>
<default>false</default>
<label>Critical</label>
</customValue>
<customValue>
<fullName>High</fullName>
<default>false</default>
<label>High</label>
</customValue>
<customValue>
<fullName>Medium</fullName>
<default>true</default>
<label>Medium</label>
</customValue>
<customValue>
<fullName>Low</fullName>
<default>false</default>
<label>Low</labelThis repository provides a curated collection of Salesforce agent skills for building applications.
Repo: forcedotcom/sf-skills
Other skills on sf-skills.
- /agentforce-generate
Build, modify, optimize, debug, and deploy agents with Agentforce Agent Script. TRIGGER when: user creates, modifies, optimizes, or asks about .agent files or aiAuthoringBundle metadata; changes agent behavior, responses, or conversation logic; designs agent actions, tools,
Open skill - /agentforce-observe
Analyze production Agentforce agent behavior using session traces and Data Cloud. TRIGGER when: user queries STDM session data or Data Cloud trace records; investigates production agent failures, regressions, or performance issues; asks about session traces, conversation logs,
Open skill - /agentforce-test
Write, run, and analyze structured test suites for Agentforce agents — functional AND security. TRIGGER when: user writes or modifies test spec YAML (AiEvaluationDefinition); runs sf agent test create, run, run-eval, or results commands; asks about test coverage strategy, metric
Open skill - /automation-flow-generate
Generate Salesforce Flows using the MCP tool execute_metadata_action. Use when the user asks to create, build, or generate a flow — including Screen, Autolaunched, Record-Triggered (before/after-save), Scheduled. Also trigger for flow-like requests such as \"when a record is
Open skill - /dx-code-analyzer-configure
Set up, configure, and troubleshoot Salesforce Code Analyzer for any project. Handles installation, prerequisite checks, diagnosing broken setups, creating and editing code-analyzer.yml overrides, engine-specific settings, ignore patterns, severity overrides, and CI/CD pipeline
Open skill - /dx-code-analyzer-custom-rule-create
Create custom Code Analyzer rules for Regex (pattern matching), PMD (XPath/AST for Apex and metadata XML), and ESLint (LWC/JavaScript/TypeScript). Use when users want to enforce coding standards, ban patterns, detect hardcoded values, govern metadata, or add rules not in the
Open skill

