diff --git a/skills/lex-app-solution/SKILL.md b/skills/lex-app-solution/SKILL.md new file mode 100644 index 0000000..be90a7b --- /dev/null +++ b/skills/lex-app-solution/SKILL.md @@ -0,0 +1,76 @@ +--- +name: lex-app-solution +description: Use this skill to build and orchestrate complete Salesforce Lightning Applications (LEX Apps), custom projects, or end-to-end business solutions from a natural language scenario. Triggers when a user requests a "custom app", a "business solution", or describes any scenario requiring multiple interconnected Salesforce components to be built together into a complete Lightning Experience (LEX) Application. Orchestrates the sequenced creation of Custom Objects, Relationships, Fields, Lightning Record Pages, Custom Tabs, Custom Applications, Permission Sets, and OPTIONALLY Flows and Validation Rules. +--- + +# Salesforce Lightning Application (LEX App) Builder + +## Overview + +Build and orchestrate complete Salesforce Lightning Applications (LEX Apps) from natural language scenarios. This skill coordinates the sequenced creation of multiple interconnected Salesforce components—Custom Objects, Fields, Lightning Record Pages, Custom Tabs, Custom Applications, Permission Sets, and optionally Flows and Validation Rules—by invoking specialized metadata expert skills in the correct order. + +## When to Use This Skill + +Use this skill when you need to: +- Build or enhance a complete Lightning Application (LEX App) from a single user prompt. +- Create end-to-end solutions requiring multiple metadata types working together within the Lightning Experience. +- Ensure proper sequencing of metadata creation (Objects → Fields → Tabs → Pages → Apps → Security). + +**Do not use this skill for:** +- Creating individual metadata components (use specific metadata expert skills instead). +- Troubleshooting or fixing deployment errors. +- Building Salesforce Classic applications or off-platform integrations. + +## Specification + +# Salesforce Lightning Application Development Requirements + +You are a highly experienced and certified Salesforce Architect. Your purpose is to autonomously orchestrate the generation of a complete Salesforce Lightning application based on the user's requirements. + +## Specialized Skill Invocation Requirement + +**CRITICAL:** You **MUST NOT** generate raw metadata or XML directly. You **MUST** invoke the specialized metadata expert skill for each component type. + +### MANDATORY Skill Mapping (Always Evaluate & Invoke): +- **Custom Objects** → `salesforce-custom-object` +- **Custom Fields** → `salesforce-custom-field` +- **Custom Tabs** → `salesforce-custom-tab` +- **FlexiPages** → `salesforce-flexipage` +- **Custom Applications** → `salesforce-custom-application` (Ensure this generates a LEX CustomApplication, not Classic) +- **Permission Sets** → `salesforce-permission-set` (Create at least one baseline permission set for app access if specific personas aren't requested) + +### OPTIONAL Skill Mapping (Strictly Conditional): +*DO NOT invoke these unless the user's prompt explicitly asks for or clearly describes requirements for them (e.g., "enforce that...", "automate the...").* +- **Validation Rules** → `salesforce-validation-rule` +- **Flows** → `salesforce-flow` + +--- + +## Autonomous Execution Sequence + +Execute the following steps sequentially in a single response. Do not stop and ask the user for permission to proceed unless their initial prompt lacks the basic information needed to start building. + +### STEP 1: The Pre-Flight Checklist (Planning) +Before invoking any skills, you must analyze the user's request and output a bulleted "Build Plan". +- Explicitly list every Custom Object, Field, Tab, FlexiPage, LEX Application, and Permission Set you are about to create. +- **Evaluate Optional Metadata:** Actively scan the prompt for automation or validation requirements. If found, add them to the plan. If NOT found, explicitly state: *"No optional Flows or Validation Rules requested. Skipping."* +- Explicitly state which metadata skill you will invoke for each planned item. + +### STEP 2: The Build Sequence (Skill Invocations) +Immediately after outputting the Pre-Flight Checklist, begin invoking the specialized skills strictly in this order: +1. **Data Model (Mandatory):** Invoke skills for Custom Objects first, followed immediately by Custom Fields. +2. **Business Logic (Optional):** Invoke skills for Validation Rules and Flows **ONLY IF** they were explicitly included in your Pre-Flight Checklist. Otherwise, skip this step entirely. +3. **User Experience (Mandatory):** Invoke skills for Custom Tabs. Then, invoke skills for FlexiPages (only for objects that received tabs, ensuring you include requested components like Highlights Panels). +4. **App Assembly (Mandatory):** Invoke the skill for the Custom Application to create the Lightning App, adding the newly created tabs. +5. **Security (Mandatory):** Invoke the skill for Permission Sets to grant access to the newly created LEX App, Objects, and Fields. + +### STEP 3: Skill Invocation Summary +Once all invocations are complete, output a final summary confirming: +- The complete Lightning application has been orchestrated. +- A list of any errors, warnings, or constraints encountered during the skill invocations. + +--- + +### Error Handling & Constraints +- If a specialized skill invocation fails, note it in your internal sequence, skip that specific component, and attempt to continue building the rest of the application. +- Only pause and ask the user for intervention if a critical failure occurs (e.g., a primary Custom Object fails to generate). \ No newline at end of file diff --git a/skills/salesforce-custom-application/SKILL.md b/skills/salesforce-custom-application/SKILL.md new file mode 100644 index 0000000..8bffe53 --- /dev/null +++ b/skills/salesforce-custom-application/SKILL.md @@ -0,0 +1,211 @@ +--- +name: salesforce-custom-application +description: Use this skill when users need to create or configure Salesforce Custom Applications. Trigger when users mention custom apps, application metadata, app navigation, or organizing tabs into applications. Use when users want to create app containers for tabs and pages. Always use this skill for custom application work. +--- + +## When to Use This Skill + +Use this skill when you need to: +- Create Lightning applications +- Organize tabs and features into focused apps +- Configure application navigation and branding +- Set up custom page layouts for objects +- Troubleshoot deployment errors related to custom applications + +# CustomApplication (Lightning App) Metadata Specification + +## Overview + +Custom applications (Lightning Apps) that group tabs and functionality to provide a focused user experience for specific business processes. Always configured for Lightning Experience. + +## 🎯 Purpose +- Organize related functionality into focused applications +- Group tabs and components for specific user roles +- Provide tailored user experiences +- Control access to specific features and data +- Use Standard navigation for general business applications or Console navigation for specialized service/support workflows requiring multi-tab workspaces +- Create professional, branded application identity with custom colors and branding +- Override standard actions with custom Lightning pages for enhanced user experience +- Enable profile-specific experiences through profile action overrides + +## ⚙️ Required Properties + +### Core Application Properties +- **fullName**: API name of the application +- **label**: Display name of the application +- **uiType**: Always "Lightning" for modern apps +- **navType**: CRITICAL - Choose based on user requirements and workflow patterns + - "Standard": DEFAULT for general business applications (e.g., sales, marketing, operations) + - "Console": ONLY when workflow requires managing multiple records simultaneously with split-view or multi-tab workspace (e.g., customer service, call centers, support operations) +- **formFactors**: Array of form factors (["LARGE"] for desktop, ["SMALL"] for mobile, or both) + +### Optional Properties +- **description**: Brief description of the application's purpose +- **tabs**: Array of tab names to include +- **utilityBar**: API name of the Utility Bar configuration +- **brand**: ⚠️ HIGHLY RECOMMENDED - Branding configuration object (headerColor, shouldOverrideOrgTheme, footerColor, primaryTabColor) +- **actionOverrides**: ⚠️ REQUIRED when custom record pages exist - Action override configuration (actionName, content, formFactor, type, pageOrSobjectType) +- **profileActionOverrides**: Profile-specific action overrides (actionName, content, formFactor, pageOrSobjectType, type, profile) +- **isNavAutoTempTabsDisabled**: Navigation behavior setting (default: false) +- **isNavPersonalizationDisabled**: Personalization setting (default: false) +- **isNavTabPersistenceDisabled**: Tab persistence setting (default: false) + +## 🔧 Application Configuration + +### Navigation Type Selection (CRITICAL) +**Decision Criteria for navType:** + +**Choose "Standard" (DEFAULT) for:** +- General business applications and most workflows +- Single-record focus or linear navigation patterns +- Standard tab-based navigation is sufficient + +**Choose "Console" ONLY when workflow requires:** +- Managing multiple related records simultaneously in split-view +- Multi-tab workspace for handling complex, interconnected data +- Contextual information from multiple sources visible at once +- Examples: customer service operations, support desks, call centers + +**When in doubt:** Default to "Standard" for most general business use cases + +### Navigation Settings +- **isNavAutoTempTabsDisabled**: Controls automatic temporary tab creation +- **isNavPersonalizationDisabled**: Controls user personalization features +- **isNavTabPersistenceDisabled**: Controls tab persistence across sessions + +### Tab Management +- **tabs**: Array of tab names to include in the application +- **formFactors**: Device-specific configurations (Large for desktop, Small for mobile) + +### Utility Bar +- **utilityBar**: Reference to Lightning utility bar (appears at bottom of Lightning Experience) + +### Branding (HIGHLY RECOMMENDED - DO NOT SKIP) +**IMPORTANT**: Provide branding configuration to create a professional, visually distinct application identity. + +- **brand.headerColor**: Header bar color in hex format (e.g., "#0070D2") - RECOMMENDED +- **brand.shouldOverrideOrgTheme**: Override organization theme (true/false) - Default: false +- **brand.footerColor**: Footer color in hex format +- **brand.primaryTabColor**: Primary tab color in hex format + +### Action Overrides (CRITICAL - DO NOT SKIP) +**IMPORTANT**: Action overrides MUST be created for every custom object tab that has a record page generated by flexipage expert. + +- **actionOverrides.actionName**: Action to override ("View" or "Tab") +- **actionOverrides.content**: Page/component name (FlexiPage, Visualforce, Lightning component) + - For "View" action: Reference record pages generated by flexipage expert + - For "Tab" action: Reference home/app pages generated by flexipage expert +- **actionOverrides.formFactor**: Device type ("Large" or "Small") +- **actionOverrides.type**: Override type ("Default", "Visualforce", "Flexipage", "LightningComponent", "Scontrol") + - Recommended: Use "Flexipage" for Lightning record/home pages generated by flexipage expert +- **actionOverrides.pageOrSobjectType**: Object API name the override applies to +- **actionOverrides.comment**: Optional description (max 1000 characters) + - Auto-generated comment: "Action override created by Lightning App Builder during activation." +- **actionOverrides.skipRecordTypeSelect**: Skip record type selection (default: false) + +### Profile Action Overrides +- **profileActionOverrides.actionName**: Action to override ("View" or "Tab") +- **profileActionOverrides.content**: Page/component name + - For "View" action: Reference profile-specific record pages generated by flexipage expert + - For "Tab" action: Reference profile-specific home pages generated by flexipage expert + - Can reference same or different FlexiPages than actionOverrides for profile-specific experiences +- **profileActionOverrides.formFactor**: Device type ("Large" or "Small") +- **profileActionOverrides.pageOrSobjectType**: Object API name +- **profileActionOverrides.type**: Override type + - Recommended: Use "Flexipage" for Lightning pages generated by flexipage expert +- **profileActionOverrides.profile**: Profile API name (e.g., "Admin", "Standard User") + - Enables different page layouts for different user profiles + +## 📱 Device Support + +### Desktop Configuration +- **formFactor**: "Large" +- **tabs**: Full list of application tabs + +### Phone Configuration +- **formFactor**: "Small" +- **tabs**: Mobile-optimized tab selection + +### Tablet Configuration +- **formFactor**: "Medium" +- **tabs**: Tablet-appropriate tab selection + +## 🎨 User Experience Features + +### Navigation Behavior +- **Auto Temporary Tabs**: Can be enabled/disabled +- **Personalization**: User customization options +- **Tab Persistence**: Remember user's tab selections + +### Accessibility +- **Keyboard Navigation**: Full keyboard support +- **Screen Reader**: Compatible with assistive technologies +- **High Contrast**: Support for high contrast modes + +## 🔗 Integration Points +- **Custom Tabs**: Include custom object and web tabs +- **Standard Tabs**: Include standard Salesforce tabs +- **Lightning Pages**: Integrate with Lightning page layouts +- **Components**: Include custom Lightning components +## ✅ Best Practices +- **Always use Lightning UI**: Set `uiType` to "Lightning" for modern apps +- **Choose appropriate navigation**: CRITICAL - Analyze requirements carefully for `navType` selection + - Use "Standard" (DEFAULT) for general business applications + - Use "Console" ONLY when workflow requires multi-tab workspace, split-view, or managing multiple related records simultaneously + - Examples for Console: customer service, call centers, support operations + - Default to "Standard" for most general business use cases +- **Include Standard Tabs**: Add common Salesforce tabs (Home, Accounts, Contacts, etc.) +- **Use clear, descriptive application names** +- **Group related functionality logically** +- **Consider different user roles and needs** +- **Test across different device types** +- **Ensure proper permissions and access control** +- **Provide meaningful descriptions for users** +- **Follow consistent naming conventions** +- **Always configure branding**: Set headerColor to create professional application identity +- **Use accessible brand colors**: Ensure hex colors have sufficient contrast (WCAG AA compliant) +- **Configure utility bars**: Add useful quick-access tools for users +- **Leverage action overrides**: Customize page layouts for specific objects using FlexiPages from flexipage expert +- **Use profile overrides**: Provide role-specific experiences by referencing different flexipage expert generated pages per profile + +## 🎯 Enhancement Rules +- **uiType**: Always set to "Lightning" for modern app experience +- **navType**: CRITICAL DECISION - Analyze user requirements carefully + - Set to "Standard" (DEFAULT) for general business applications + - Set to "Console" ONLY when workflow requires: + - Managing multiple related records simultaneously with split-view capability + - Multi-tab workspace for handling complex, interconnected data + - Contextual information from multiple sources visible at once + - Console examples: customer service operations, call centers, support desks + - When in doubt between Standard and Console, choose "Standard" for most business use cases +- **formFactors**: Always set to ["LARGE"] for desktop Lightning Experience +- **Standard Tabs**: Automatically add Home, Accounts, Contacts, Opportunities, Leads, Cases +- **Navigation Settings**: Set all navigation flags to false for best user experience +- **Branding**: ALWAYS include brand configuration for professional application identity + - MANDATORY: Set brand.headerColor to appropriate color (e.g., "#0070D2" for Salesforce Blue) + - Set brand.shouldOverrideOrgTheme based on requirements +- **Action Overrides**: ALWAYS create action overrides when custom record pages exist + - MANDATORY: Add actionOverrides for "View" action pointing to flexipage expert generated record pages + - Use "Flexipage" type and reference the exact FlexiPage name + - Set formFactor to "Large" for desktop + - Include pageOrSobjectType with the object API name +- **Profile Action Overrides**: Reference flexipage expert generated pages for role-based customization +- **Form Factors**: Use "Large" for desktop, "Small" for mobile in overrides + +## ⚠️ CRITICAL Verification Checklist (MUST VERIFY) +- [ ] All tabs are included in the application +- [ ] **navType IS CORRECTLY SET** - Verify Console vs Standard selection +- [ ] Default to "Standard" for most general business applications +- [ ] Set to "Console" ONLY if workflow requires managing multiple records simultaneously, split-view, or multi-tab workspace +- [ ] If requirements are general/ambiguous → navType should be "Standard" +- [ ] **BRANDING IS CONFIGURED** - This is HIGHLY RECOMMENDED for professional applications +- [ ] brand.headerColor is set with valid hex color (e.g., "#0070D2") +- [ ] brand.shouldOverrideOrgTheme is set (default: false) +- [ ] **ACTION OVERRIDES ARE CREATED** - This is MANDATORY for every custom object with a record page +- [ ] Action overrides are defined for EACH custom object tab pointing to the correct record page +- [ ] actionOverrides.content matches the exact FlexiPage name generated by flexipage expert +- [ ] actionOverrides.pageOrSobjectType is set to the correct object API name +- [ ] actionOverrides.type is set to "Flexipage" +- [ ] actionOverrides.actionName is set to "View" +- [ ] actionOverrides.formFactor is set to "Large" +- [ ] All required fields are populated (fullName, label, uiType, navType, formFactors) diff --git a/skills/salesforce-custom-field/SKILL.md b/skills/salesforce-custom-field/SKILL.md new file mode 100644 index 0000000..a063d2d --- /dev/null +++ b/skills/salesforce-custom-field/SKILL.md @@ -0,0 +1,499 @@ +--- +name: salesforce-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. +--- + +## 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 `