mirror of
https://github.com/forcedotcom/afv-library.git
synced 2026-08-07 16:04:41 +08:00
Merge branch 'main' into sandipkumar-yadav/skills
This commit is contained in:
commit
4e2b7df1ba
@ -27,27 +27,99 @@ Custom tabs for navigating to objects, web content, or Visualforce pages within
|
|||||||
## ⚙️ Required Properties
|
## ⚙️ Required Properties
|
||||||
|
|
||||||
### Core Tab Properties
|
### Core Tab Properties
|
||||||
- **label**: Display name of the tab
|
- **customObject**: `true` for custom object tabs, `false` for all others.
|
||||||
- **fullName**: API name of the object (for object tabs)
|
- **motif**: Tab icon style — choose a motif that semantically matches the object's purpose. Do NOT reuse the same motif for every tab.
|
||||||
|
- **label**: Display name (required for non-object tabs ONLY; object tabs inherit label from the object)
|
||||||
- **url**: Web URL (for web tabs)
|
- **url**: Web URL (for web tabs)
|
||||||
- **page**: Visualforce page name (for Visualforce tabs)
|
- **page**: Visualforce page name (for Visualforce tabs)
|
||||||
|
|
||||||
|
|
||||||
|
### 🚨 STRICT ELEMENT ALLOWLIST — READ THIS FIRST
|
||||||
|
|
||||||
|
**The root element MUST always be `<CustomTab>` (NOT `<Tab>`).** The XML namespace must be `xmlns="http://soap.sforce.com/2006/04/metadata"`.
|
||||||
|
|
||||||
|
Only the elements listed below are valid. **Any element not on this list WILL cause a deployment error.**
|
||||||
|
|
||||||
|
| Tab Type | ONLY these elements are allowed (nothing else) |
|
||||||
|
|---|---|
|
||||||
|
| **Object tabs** | `<customObject>` (required, set to `true`), `<motif>` (required), `<description>` (optional) |
|
||||||
|
| **Web tabs** | `<customObject>` (required, set to `false`), `<label>` (required), `<motif>` (required), `<url>` (required), `<urlEncodingKey>` (required, set to `UTF-8`), `<description>` (optional), `<frameHeight>` (optional) |
|
||||||
|
| **Visualforce tabs** | `<customObject>` (required, set to `false`), `<label>` (required), `<motif>` (required), `<page>` (required), `<description>` (optional) |
|
||||||
|
|
||||||
|
### ⚠️ FORBIDDEN ELEMENTS (every one of these causes a deployment error)
|
||||||
|
`<sobjectName>`, `<name>`, `<fullName>`, `<apiVersion>`, `<isHidden>`, `<tabVisibility>`, `<type>`, `<mobileReady>`, `<urlFrameHeight>`, `<urlType>`, `<urlRedirect>`, `<encodingKey>`, `<height>`, `<auraComponent>`
|
||||||
|
|
||||||
|
Also forbidden:
|
||||||
|
- `<label>` on object tabs (object tabs inherit their label from the custom object)
|
||||||
|
- `<page>` on web tabs (only for Visualforce tabs)
|
||||||
|
- Empty elements like `<page></page>` or `<description></description>`
|
||||||
|
- Any element not in the allowlist table above
|
||||||
|
|
||||||
## 🔧 Tab Types
|
## 🔧 Tab Types
|
||||||
|
|
||||||
### Object Tabs
|
### Object Tabs
|
||||||
- **Purpose**: Navigate to custom or standard objects
|
- **Purpose**: Navigate to custom or standard objects
|
||||||
- **Required**: `fullName` property (set to object API name)
|
- **File name** determines the object: `{ObjectApiName}.tab-meta.xml` (e.g., `Space_Station__c.tab-meta.xml`)
|
||||||
- **Example**: `<fullName>CustomObject__c</fullName>`
|
- **Required elements**: `<customObject>true</customObject>` and `<motif>`
|
||||||
|
- **Correct example** (for a Space_Station__c.tab-meta.xml):
|
||||||
|
```xml
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<CustomTab xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||||
|
<customObject>true</customObject>
|
||||||
|
<motif>Custom39: Telescope</motif>
|
||||||
|
</CustomTab>
|
||||||
|
```
|
||||||
|
- **Correct example** (for a Supply__c.tab-meta.xml — note different motif):
|
||||||
|
```xml
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<CustomTab xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||||
|
<customObject>true</customObject>
|
||||||
|
<motif>Custom98: Truck</motif>
|
||||||
|
</CustomTab>
|
||||||
|
```
|
||||||
|
- **❌ WRONG** — do NOT add `<sobjectName>`, `<name>`, `<fullName>`, or `<label>`:
|
||||||
|
```xml
|
||||||
|
<CustomTab xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||||
|
<sobjectName>Space_Station__c</sobjectName> <!-- DEPLOYMENT ERROR -->
|
||||||
|
<label>Space Station</label> <!-- DEPLOYMENT ERROR on object tabs -->
|
||||||
|
<customObject>true</customObject>
|
||||||
|
<motif>Custom57: Desert</motif>
|
||||||
|
</CustomTab>
|
||||||
|
```
|
||||||
|
|
||||||
### Web Tabs
|
### Web Tabs
|
||||||
- **Purpose**: Link to external websites or web applications
|
- **Purpose**: Link to external websites or web applications
|
||||||
- **Required**: `url` property
|
- **File name**: Use a descriptive name: `{TabName}.tab-meta.xml` (e.g., `Knowledge_Base.tab-meta.xml`)
|
||||||
- **Example**: `<url>https://example.com</url>`
|
- **COPY THIS EXACT TEMPLATE** — only replace the placeholder values. Do NOT add, remove, or rename any XML elements:
|
||||||
|
```xml
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<CustomTab xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||||
|
<customObject>false</customObject>
|
||||||
|
<description>REPLACE_WITH_DESCRIPTION</description>
|
||||||
|
<frameHeight>600</frameHeight>
|
||||||
|
<label>REPLACE_WITH_LABEL</label>
|
||||||
|
<motif>REPLACE_WITH_MOTIF</motif>
|
||||||
|
<url>REPLACE_WITH_URL</url>
|
||||||
|
<urlEncodingKey>UTF-8</urlEncodingKey>
|
||||||
|
</CustomTab>
|
||||||
|
```
|
||||||
|
- **These 7 elements above are the ONLY elements allowed in a web tab file.** Do not add ANY other elements.
|
||||||
|
- The `<description>` element is optional — you may remove it if not needed, but do not add anything else.
|
||||||
|
|
||||||
### Visualforce Tabs
|
### Visualforce Tabs
|
||||||
- **Purpose**: Access custom Visualforce pages
|
- **Purpose**: Access custom Visualforce pages
|
||||||
- **Required**: `page` property
|
- **File name**: `{TabName}.tab-meta.xml` (e.g., `Custom_Page_Tab.tab-meta.xml`)
|
||||||
- **Example**: `<page>CustomPage</page>`
|
- **Required elements**: `<customObject>false</customObject>`, `<label>`, `<motif>`, `<page>`
|
||||||
|
- **Correct example**:
|
||||||
|
```xml
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<CustomTab xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||||
|
<customObject>false</customObject>
|
||||||
|
<label>Custom Page</label>
|
||||||
|
<motif>Custom46: Computer</motif>
|
||||||
|
<page>CustomPage</page>
|
||||||
|
</CustomTab>
|
||||||
|
```
|
||||||
|
|
||||||
## 🎨 Tab Configuration
|
## 🎨 Tab Configuration
|
||||||
|
|
||||||
@ -72,7 +144,11 @@ Custom tabs for navigating to objects, web content, or Visualforce pages within
|
|||||||
## ✅ Best Practices
|
## ✅ Best Practices
|
||||||
- Use clear, descriptive tab labels
|
- Use clear, descriptive tab labels
|
||||||
- Choose appropriate tab types for functionality
|
- Choose appropriate tab types for functionality
|
||||||
|
- **Select a unique, contextually relevant motif for each tab** — do not default every tab to the same icon
|
||||||
- Consider user experience and navigation flow
|
- Consider user experience and navigation flow
|
||||||
- Test tab functionality across different applications
|
- Test tab functionality across different applications
|
||||||
- Ensure proper permissions and visibility settings
|
- Ensure proper permissions and visibility settings
|
||||||
- Follow consistent naming conventions
|
- Follow consistent naming conventions
|
||||||
|
- Object tab files MUST only contain `<customObject>true</customObject>` and `<motif>` — nothing else
|
||||||
|
- Web tab files MUST only contain: `<customObject>false</customObject>`, `<label>`, `<motif>`, `<url>`, `<urlEncodingKey>`, and optionally `<description>`, `<frameHeight>` — nothing else
|
||||||
|
- Never include `<isHidden>`, `<tabVisibility>`, `<type>`, `<mobileReady>`, or empty elements
|
||||||
@ -1,16 +1,17 @@
|
|||||||
---
|
---
|
||||||
name: salesforce-lightning-app-build
|
name: salesforce-lightning-app-build
|
||||||
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.
|
description: Build complete Salesforce Lightning Experience applications from natural language descriptions. Use this skill when a user requests a "complete app", "Lightning app", "business solution", "management system", or describes a scenario requiring multiple interconnected Salesforce components (objects, fields, pages, tabs, security). Orchestrates all required metadata types in proper dependency order to produce a deployable application.
|
||||||
metadata:
|
metadata:
|
||||||
category: orchestration
|
category: orchestration
|
||||||
related-skills: salesforce-custom-object, salesforce-custom-field, salesforce-custom-tab, salesforce-flexipage, salesforce-custom-application, salesforce-flow, salesforce-validation-rule, salesforce-list-view
|
version: "1.0"
|
||||||
|
related-skills: salesforce-custom-object, salesforce-custom-field, salesforce-custom-tab, salesforce-flexipage, salesforce-custom-application, salesforce-flow, salesforce-validation-rule, salesforce-list-view, generate-permission-set
|
||||||
---
|
---
|
||||||
|
|
||||||
# Salesforce Lightning Application Build
|
# Salesforce Lightning Application Build
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
Build complete Lightning Experience applications from natural language by orchestrating multiple metadata types in proper dependency order. This skill acts as a "conductor" that invokes specialized metadata skills when available, or generates metadata directly when no skill exists.
|
Build a complete, deployable Salesforce Lightning Experience application from a natural language description by orchestrating multiple metadata types in correct dependency order. Invoke specialized metadata skills when available; generate metadata directly when no skill exists.
|
||||||
|
|
||||||
## When to Use This Skill
|
## When to Use This Skill
|
||||||
**Use when:**
|
**Use when:**
|
||||||
@ -34,7 +35,6 @@ Build complete Lightning Experience applications from natural language by orches
|
|||||||
- Troubleshooting or debugging existing metadata
|
- Troubleshooting or debugging existing metadata
|
||||||
- Building Salesforce Classic apps (not Lightning Experience)
|
- Building Salesforce Classic apps (not Lightning Experience)
|
||||||
- User asks for just one object, or just one page, or just one permission set (without others)
|
- User asks for just one object, or just one page, or just one permission set (without others)
|
||||||
---
|
|
||||||
|
|
||||||
## Metadata Type Registry
|
## Metadata Type Registry
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ This table shows which metadata types are commonly needed for LEX apps and their
|
|||||||
| **List View** | ✅ YES | `salesforce-list-view` | MUST use skill |
|
| **List View** | ✅ YES | `salesforce-list-view` | MUST use skill |
|
||||||
| **Validation Rule** | ✅ YES | `salesforce-validation-rule` | MUST use skill (if requested) |
|
| **Validation Rule** | ✅ YES | `salesforce-validation-rule` | MUST use skill (if requested) |
|
||||||
| **Flow** | ✅ YES | `salesforce-flow` | MUST use skill (if requested) |
|
| **Flow** | ✅ YES | `salesforce-flow` | MUST use skill (if requested) |
|
||||||
| **Permission Set** | ❌ NO | - | Generate directly using Metadata API knowledge |
|
| **Permission Set** | ✅ YES | `generate-permission-set` | MUST use skill |
|
||||||
|
|
||||||
### Skill Usage Rules
|
### Skill Usage Rules
|
||||||
|
|
||||||
@ -115,8 +115,8 @@ Custom Application (depends on: Tabs exist)
|
|||||||
Permission Sets (depends on: Objects, Fields, Tabs, App exist)
|
Permission Sets (depends on: Objects, Fields, Tabs, App exist)
|
||||||
```
|
```
|
||||||
|
|
||||||
**Fallback generation (no skill available):**
|
**Skills to invoke:**
|
||||||
1. Generate Permission Set XML directly with access to:
|
1. `generate-permission-set` for each permission set with access to:
|
||||||
- Objects (Read, Create, Edit, Delete)
|
- Objects (Read, Create, Edit, Delete)
|
||||||
- Fields (Read, Edit)
|
- Fields (Read, Edit)
|
||||||
- Tabs (Visible)
|
- Tabs (Visible)
|
||||||
@ -170,7 +170,7 @@ METADATA SKILLS TO INVOKE:
|
|||||||
- salesforce-custom-tab (x N)
|
- salesforce-custom-tab (x N)
|
||||||
- salesforce-flexipage (x N)
|
- salesforce-flexipage (x N)
|
||||||
- salesforce-custom-application (x 1)
|
- salesforce-custom-application (x 1)
|
||||||
- [fallback] Permission Set XML generation (x N)
|
- generate-permission-set (x N)
|
||||||
|
|
||||||
DEPENDENCY ORDER:
|
DEPENDENCY ORDER:
|
||||||
1. Phase 1: Data Model (Objects → Fields)
|
1. Phase 1: Data Model (Objects → Fields)
|
||||||
@ -198,7 +198,99 @@ Execute in strict dependency order. For each metadata component:
|
|||||||
- For Custom Tab → Invoke `salesforce-custom-tab`
|
- For Custom Tab → Invoke `salesforce-custom-tab`
|
||||||
- For FlexiPage → Invoke `salesforce-flexipage`
|
- For FlexiPage → Invoke `salesforce-flexipage`
|
||||||
- For Custom Application → Invoke `salesforce-custom-application`
|
- For Custom Application → Invoke `salesforce-custom-application`
|
||||||
- For Permission Sets (no skill) → Generate XML directly
|
- For Permission Set → Invoke `generate-permission-set`
|
||||||
|
|
||||||
|
### STEP 3: Final Artifact Assembly
|
||||||
|
|
||||||
|
After all phases complete, consolidate outputs into deployment-ready structure.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
The completed build produces:
|
||||||
|
|
||||||
|
1. **Salesforce DX Project Directory** containing all generated metadata
|
||||||
|
- Organized by standard SFDX structure: `force-app/main/default/`
|
||||||
|
|
||||||
|
2. **Metadata Files** - One file per component, organized by type:
|
||||||
|
```
|
||||||
|
force-app/main/default/
|
||||||
|
├── objects/ # Custom Objects (.object-meta.xml)
|
||||||
|
├── fields/ # Custom Fields (.field-meta.xml)
|
||||||
|
├── tabs/ # Custom Tabs (.tab-meta.xml)
|
||||||
|
├── flexipages/ # Lightning Pages (.flexipage-meta.xml)
|
||||||
|
├── applications/ # Custom Applications (.app-meta.xml)
|
||||||
|
├── permissionsets/ # Permission Sets (.permissionset-meta.xml)
|
||||||
|
├── flows/ # Flows (.flow-meta.xml) - if applicable
|
||||||
|
└── objects/.../validationRules/ # Validation Rules (.validationRule-meta.xml) - if applicable
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Deployment Manifest** (`package.xml`)
|
||||||
|
- Lists all components with proper API version
|
||||||
|
- Organized by metadata type in dependency order
|
||||||
|
- Ready for Salesforce CLI deployment or Metadata API deployment
|
||||||
|
|
||||||
|
4. **Build Summary Report** - A markdown file listing:
|
||||||
|
- Every component created
|
||||||
|
- Component type and API name
|
||||||
|
- File path location
|
||||||
|
- Dependency relationships
|
||||||
|
- Any warnings or recommendations
|
||||||
|
|
||||||
|
**Example Summary Structure:**
|
||||||
|
```
|
||||||
|
📦 Lightning App Build Complete: Project Management App
|
||||||
|
|
||||||
|
METADATA GENERATED:
|
||||||
|
✅ 3 Custom Objects
|
||||||
|
- Project__c → force-app/main/default/objects/Project__c/Project__c.object-meta.xml
|
||||||
|
- Task__c → force-app/main/default/objects/Task__c/Task__c.object-meta.xml
|
||||||
|
- Resource__c → force-app/main/default/objects/Resource__c/Resource__c.object-meta.xml
|
||||||
|
|
||||||
|
✅ 12 Custom Fields
|
||||||
|
- Project__c.Name → force-app/main/default/objects/Project__c/fields/Name.field-meta.xml
|
||||||
|
- Project__c.Status__c → force-app/main/default/objects/Project__c/fields/Status__c.field-meta.xml
|
||||||
|
[... etc ...]
|
||||||
|
|
||||||
|
✅ 3 Custom Tabs
|
||||||
|
- Project__c → force-app/main/default/tabs/Project__c.tab-meta.xml
|
||||||
|
[... etc ...]
|
||||||
|
|
||||||
|
✅ 3 Lightning Record Pages
|
||||||
|
- Project_Record_Page → force-app/main/default/flexipages/Project_Record_Page.flexipage-meta.xml
|
||||||
|
[... etc ...]
|
||||||
|
|
||||||
|
✅ 1 Custom Application
|
||||||
|
- Project_Management → force-app/main/default/applications/Project_Management.app-meta.xml
|
||||||
|
|
||||||
|
✅ 2 Permission Sets
|
||||||
|
- Project_Manager → force-app/main/default/permissionsets/Project_Manager.permissionset-meta.xml
|
||||||
|
- Project_User → force-app/main/default/permissionsets/Project_User.permissionset-meta.xml
|
||||||
|
|
||||||
|
⚠️ WARNINGS: None
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Validation
|
||||||
|
|
||||||
|
Before presenting the completed build to the user, verify cross-component integrity:
|
||||||
|
|
||||||
|
- [ ] **Object-Tab Coverage**: Every Custom Object has at least one Custom Tab
|
||||||
|
- [ ] **Relationship Integrity**: Every Custom Object referenced in a relationship (parent or child) exists in the build
|
||||||
|
- [ ] **Field References in Pages**: Every field referenced in a FlexiPage exists on the corresponding object
|
||||||
|
- [ ] **Tab References in App**: Every tab referenced in the Custom Application was successfully created
|
||||||
|
- [ ] **Permission Set Completeness**: Permission Sets grant access to all generated objects, fields, tabs, and the application
|
||||||
|
- [ ] **No Orphaned Components**: No tabs without objects, no pages without corresponding tabs, no app without tabs
|
||||||
|
- [ ] **Deployment Manifest Completeness**: `package.xml` includes all generated components in proper dependency order
|
||||||
|
|
||||||
|
**Validation Failure Handling:**
|
||||||
|
- If validation fails, include failed checks in the Build Summary Report under a `⚠️ VALIDATION WARNINGS` section
|
||||||
|
- Do NOT block delivery of the build, but clearly communicate what needs manual review or correction
|
||||||
|
- Provide specific remediation steps for each failed validation check
|
||||||
|
|
||||||
|
**Note**: Individual component validations (reserved words, name lengths, field types, etc.) are handled by specialized metadata skills and do not need to be re-validated here.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -246,7 +338,7 @@ When user doesn't specify details:
|
|||||||
- Enable Search and Reports for user-facing objects
|
- Enable Search and Reports for user-facing objects
|
||||||
- Set sharingModel based on relationships
|
- Set sharingModel based on relationships
|
||||||
|
|
||||||
### 5. Validate Before Building
|
### 4. Validate Before Building
|
||||||
Check for:
|
Check for:
|
||||||
- Reserved words in API names
|
- Reserved words in API names
|
||||||
- Relationship limits (max 2 M-D per object)
|
- Relationship limits (max 2 M-D per object)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user