--- name: platform-custom-object-generate description: "Use this skill when users need to create, generate, or validate Salesforce Custom Object metadata. Trigger when users mention custom objects, creating objects, object metadata, .object files, sharing models, name fields, or validation rules on objects. Also use when users say things like \"create a custom object\", \"generate object metadata\", \"set up an object for...\", or when they're troubleshooting object deployment errors especially around sharing models and Master-Detail relationships. Always use this skill for any custom object metadata work, including enriching and keeping the object's description current whenever its fields or validation rules change. Do NOT use this skill for non-Custom-Object metadata (Apex, Flows, LWC, Permission Sets, Custom Metadata Types) or for standard Salesforce objects." metadata: version: "1.1" minApiVersion: "60.0" --- ## When to Use This Skill Use this skill when you need to: - Create new custom objects - Generate custom object metadata XML - Configure object sharing and security settings - Set up object features and capabilities - Troubleshoot deployment errors related to custom objects - **Add, update, or delete a field OR a validation rule on an existing object** โ€” any of these may make the object's `` stale, so you must refresh it (propose + confirm). This applies equally to validation-rule changes, not just fields. See Section 3.B. ## Specification ## 1. Overview and Purpose This document defines the mandatory constraints for generating CustomObject metadata XML (`.object-meta.xml` file). The agent must verify these constraints before outputting XML to prevent Metadata API deployment errors. **File extension:** `.object-meta.xml` > **๐Ÿ”” Description freshness โ€” applies to EVERY object change, fields AND validation rules:** Whenever you add, update, or delete a field **or a validation rule** on an object, the `` may now be stale. Before finishing, refresh it per **Section 3.B** (propose, confirm with the user, write). A validation-rule change counts exactly like a field change โ€” the change is **not** done until the description has been reconciled. This is easy to forget on validation-rule edits/deletes โ€” don't. --- ## 2. Syntactic Essentials (Tier 1) The following constraints must be true for the XML body to deploy successfully. **Note:** The API Name (fullName) is NOT a tag; it is the filename (e.g., `Vehicle__c.object-meta.xml`). ### Required Elements | Element | Requirement | Notes | |---------|-------------|-------| | `