Agent skill · forcedotcom
platform-custom-metadata-type-generate
Use this skill when users need to create, generate, or validate Salesforce Custom Metadata Type metadata — the __mdt object, its fields, and its deployable records. Trigger when users mention custom metadata types, CMDT, __mdt objects, custom metadata records, .md-meta.xml files, or reference/config data that must ship between orgs. Also trigger for admin-maintained mapping, lookup, or crosswalk tables and field mappings (\"map fields from A to B\", code lookups) — config admins change without a code deploy belongs in a CMDT, never hardcoded in Apex or Flow — and when troubleshooting CMDT record/type deploy errors. DO NOT TRIGGER for Custom Settings — route to platform-custom-setting-generate; for regular custom objects holding business records — use platform-custom-object-generate; or for secrets and API keys — recommend a Named Credential, which this skill never generates.
What it needs
About 11k tokens when loaded.
What this skill does
Salesforce Custom Metadata Type Generator and Validator When to Use This Skill Use this skill when you need to: Create a Custom Metadata Type (mdt) Generate or validate CMDT fields, including MetadataRelationship fields Generate CMDT records as deployable .md-meta.xml files Troubleshoot CMDT deployment errors --- 1. Overview and Purpose A Custom Metadata Type produces two separate artifact families, and most requests need both: Artifact Path Metadata type --- --- --- Type definition objects/<Name>mdt/<Name>mdt.object-meta.xml CustomObject Fields objects/<Name>mdt/fields/<Field>c.field-meta.xml CustomField Records customMetadata/<Name>.<Record>.md-meta.xml CustomMetadata API name suffix: mdt on the type; fields still end in c. The defining advantage over a custom setting: CMDT records are metadata and therefore deploy between orgs. When a user says configuration should "ship with the package" or "be the same in every org," CMDT is the right answer. The root element is <CustomObject>, but almost none of a custom object's rules apply. sharingModel, nameField, and deploymentStatus are required or normal on a regular custom object and are hard errors here. Do not carry assumptions across from platform-custom-object-generate. --- 2. Syntactic Essentials — Type Definition (Tier 1) Required and Allowed Elements Element Requirement Notes --------- ------------- ------- <label> Required Singular UI name <pluralLabel> Required Omitting it gives Must specify a non-empty plural label for the CustomObject <visibility> Always include Public, or Protected/PackageProtected only in dev/sandbox/scratch (Section 6) <description> Always include What this type configures and who owns it <pluralLabel> being required here but forbidden on a custom setting is the most commonly inverted rule between the two families. Neither failure mentions the other family's rule. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills forcedotcom/platform-custom-metadata-type-generate--4413cd