--- name: generating-custom-field description: "Use this skill when users need to create, generate, or validate Salesforce Custom Field metadata. Trigger when users mention custom fields, field types, Roll-up Summary fields, Master-Detail relationships, Lookup relationships, formula fields, picklists, or field metadata. Also use when users encounter field deployment errors, especially around Roll-up Summary format, Master-Detail constraints, or formula issues. Always use this skill for any custom field metadata work, field generation, or field troubleshooting." metadata: version: "1.0" --- ## When to Use This Skill Use this skill when you need to: - Create custom fields on any object - Generate field metadata for any field type - Set up relationship fields (Lookup or Master-Detail) - Create formula or roll-up summary fields - Troubleshoot deployment errors related to custom fields # Salesforce Custom Field Generator and Validator ## Overview Generate and validate Salesforce Custom Field metadata with mandatory constraints to prevent deployment errors. This skill has special focus on the **highest-failure-rate field types**: Roll-up Summary and Master-Detail relationships. ## Specification ## 1. Purpose This document defines the mandatory constraints for generating CustomField metadata XML. The agent must verify these constraints before outputting XML to prevent Metadata API deployment errors. **Critical Focus Areas:** - Roll-up Summary field format errors - Master-Detail field attribute restrictions - Lookup Filter restrictions --- ## 2. Universal Mandatory Attributes Every generated field must include these tags: | Attribute | Requirement | Notes | |-----------|-------------|-------| | `` | Required | Derive from `