@salesforce/afv-skills 1.29.0 → 1.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/package.json +1 -1
- package/skills/agentforce-architecture-analyze/README.md +2 -8
- package/skills/agentforce-architecture-analyze/SKILL.md +2 -2
- package/skills/agentforce-architecture-analyze/references/contract.json +4 -4
- package/skills/agentforce-architecture-analyze/references/soql_fields.md +1 -1
- package/skills/data360-activate/README.md +0 -1
- package/skills/data360-activate/SKILL.md +0 -2
- package/skills/data360-connect/README.md +0 -2
- package/skills/data360-connect/SKILL.md +0 -2
- package/skills/data360-harmonize/SKILL.md +0 -1
- package/skills/data360-orchestrate/README.md +0 -7
- package/skills/data360-orchestrate/SKILL.md +0 -2
- package/skills/data360-prepare/README.md +0 -1
- package/skills/data360-prepare/SKILL.md +0 -1
- package/skills/data360-query/README.md +0 -1
- package/skills/data360-query/SKILL.md +0 -1
- package/skills/data360-segment/README.md +0 -1
- package/skills/data360-segment/SKILL.md +0 -2
- package/skills/experience-cms-brand-apply/SKILL.md +47 -16
- package/skills/experience-lwc-generate/README.md +3 -2
- package/skills/experience-lwc-generate/references/async-notification-patterns.md +1 -1
- package/skills/experience-lwc-generate/references/component-patterns.md +3 -3
- package/skills/experience-lwc-generate/references/flow-integration-guide.md +1 -1
- package/skills/experience-lwc-generate/references/lwc-best-practices.md +4 -4
- package/skills/experience-lwc-generate/references/scoring-and-testing.md +1 -1
- package/skills/experience-lwc-generate/references/state-management.md +2 -2
- package/skills/experience-lwc-generate/references/triangle-pattern.md +3 -3
- package/skills/experience-lwc-generate/scripts/post-tool-validate.py +2 -2
- package/skills/experience-lwc-generate/scripts/template_validator.py +1 -1
- package/skills/external-diagram-mermaid-generate/README.md +2 -2
- package/skills/external-diagram-mermaid-generate/SKILL.md +1 -3
- package/skills/external-diagram-mermaid-generate/assets/agentforce/agent-flow.md +4 -4
- package/skills/external-diagram-mermaid-generate/assets/architecture/system-landscape.md +1 -1
- package/skills/external-diagram-mermaid-generate/assets/datamodel/b2b-commerce-erd.md +3 -3
- package/skills/external-diagram-mermaid-generate/assets/datamodel/campaigns-erd.md +1 -1
- package/skills/external-diagram-mermaid-generate/assets/datamodel/consent-erd.md +2 -2
- package/skills/external-diagram-mermaid-generate/assets/datamodel/files-erd.md +2 -2
- package/skills/external-diagram-mermaid-generate/assets/datamodel/forecasting-erd.md +2 -2
- package/skills/external-diagram-mermaid-generate/assets/datamodel/fsl-erd.md +2 -2
- package/skills/external-diagram-mermaid-generate/assets/datamodel/party-model-erd.md +1 -1
- package/skills/external-diagram-mermaid-generate/assets/datamodel/quote-order-erd.md +3 -3
- package/skills/external-diagram-mermaid-generate/assets/datamodel/revenue-cloud-erd.md +2 -2
- package/skills/external-diagram-mermaid-generate/assets/datamodel/sales-cloud-erd.md +1 -1
- package/skills/external-diagram-mermaid-generate/assets/datamodel/salesforce-erd.md +1 -1
- package/skills/external-diagram-mermaid-generate/assets/datamodel/scheduler-erd.md +2 -2
- package/skills/external-diagram-mermaid-generate/assets/datamodel/service-cloud-erd.md +3 -3
- package/skills/external-diagram-mermaid-generate/assets/datamodel/territory-management-erd.md +1 -1
- package/skills/external-diagram-mermaid-generate/assets/integration/api-sequence.md +1 -1
- package/skills/external-diagram-mermaid-generate/assets/oauth/authorization-code-pkce.md +1 -1
- package/skills/external-diagram-mermaid-generate/assets/oauth/authorization-code.md +1 -1
- package/skills/external-diagram-mermaid-generate/assets/oauth/client-credentials.md +1 -1
- package/skills/external-diagram-mermaid-generate/assets/oauth/device-authorization.md +2 -2
- package/skills/external-diagram-mermaid-generate/assets/oauth/jwt-bearer.md +2 -2
- package/skills/external-diagram-mermaid-generate/assets/oauth/refresh-token.md +1 -1
- package/skills/external-diagram-mermaid-generate/assets/oauth/user-agent-social-sign-on.md +2 -2
- package/skills/external-diagram-mermaid-generate/assets/role-hierarchy/user-hierarchy.md +1 -1
- package/skills/external-diagram-mermaid-generate/references/color-palette.md +13 -13
- package/skills/external-diagram-mermaid-generate/references/diagram-conventions.md +5 -5
- package/skills/external-diagram-mermaid-generate/references/erd-conventions.md +1 -1
- package/skills/external-diagram-mermaid-generate/references/mermaid-styling.md +2 -2
- package/skills/external-diagram-mermaid-generate/references/preview-guide.md +1 -1
- package/skills/external-diagram-mermaid-generate/references/usage-examples.md +9 -9
- package/skills/external-diagram-mermaid-generate/scripts/README.md +1 -1
- package/skills/integration-connectivity-connected-app-configure/README.md +4 -5
- package/skills/integration-connectivity-connected-app-configure/SKILL.md +2 -2
- package/skills/integration-connectivity-connected-app-configure/references/example-usage.md +7 -7
- package/skills/integration-connectivity-connected-app-configure/references/migration-guide.md +1 -1
- package/skills/integration-connectivity-connected-app-configure/references/oauth-flows-reference.md +1 -1
- package/skills/integration-connectivity-connected-app-configure/references/testing-validation-guide.md +3 -3
- package/skills/integration-connectivity-generate/README.md +1 -1
- package/skills/integration-connectivity-generate/SKILL.md +6 -0
- package/skills/integration-connectivity-generate/assets/callouts/rest-queueable-callout.cls +1 -1
- package/skills/integration-connectivity-generate/assets/external-services/external-service-operations.md +1 -1
- package/skills/integration-connectivity-generate/assets/soap/wsdl2apex-guide.md +1 -1
- package/skills/integration-connectivity-generate/references/callout-patterns.md +4 -0
- package/skills/integration-connectivity-generate/references/cdc-guide.md +2 -2
- package/skills/integration-connectivity-generate/references/event-driven-architecture-guide.md +5 -5
- package/skills/integration-connectivity-generate/references/event-patterns.md +3 -2
- package/skills/integration-connectivity-generate/references/external-services-guide.md +4 -1
- package/skills/integration-connectivity-generate/references/messaging-api-v2.md +2 -2
- package/skills/integration-connectivity-generate/references/named-credentials-automation.md +1 -1
- package/skills/integration-connectivity-generate/references/named-credentials-guide.md +12 -2
- package/skills/integration-connectivity-generate/references/platform-events-guide.md +3 -3
- package/skills/integration-connectivity-generate/references/rest-callout-patterns.md +1 -1
- package/skills/integration-connectivity-generate/references/scoring-rubric.md +1 -1
- package/skills/integration-connectivity-generate/references/security-best-practices.md +5 -2
- package/skills/integration-connectivity-generate/scripts/configure-named-credential.sh +16 -5
- package/skills/integration-connectivity-generate/scripts/set-api-credential.sh +11 -2
- package/skills/integration-connectivity-generate/scripts/suggest_credential_setup.py +4 -3
- package/skills/integration-connectivity-generate/scripts/validate_integration.py +1 -1
- package/skills/omnistudio-callable-apex-generate/README.md +1 -5
- package/skills/omnistudio-callable-apex-generate/SKILL.md +14 -4
- package/skills/omnistudio-callable-apex-generate/assets/pattern_callable_vanilla.cls +8 -1
- package/skills/omnistudio-callable-apex-generate/examples/Test_VlocityOpenInterface2Conversion/TRANSCRIPT.md +1 -1
- package/skills/omnistudio-callable-apex-generate/examples/Test_VlocityOpenInterfaceConversion/TRANSCRIPT.md +1 -1
- package/skills/omnistudio-datamapper-generate/SKILL.md +1 -1
- package/skills/omnistudio-datamapper-generate/assets/completion-summary-template.md +2 -2
- package/skills/omnistudio-datamapper-generate/references/best-practices.md +9 -9
- package/skills/omnistudio-datamapper-generate/references/naming-conventions.md +6 -6
- package/skills/omnistudio-datapacks-deploy/README.md +1 -1
- package/skills/omnistudio-datapacks-deploy/examples/business-internet-plus-bundle/deploy-business-internet-plus-bundle.yaml +1 -1
- package/skills/omnistudio-dependencies-analyze/SKILL.md +12 -5
- package/skills/omnistudio-dependencies-analyze/references/dependency-patterns.md +9 -9
- package/skills/omnistudio-dependencies-analyze/references/namespace-guide.md +1 -1
- package/skills/omnistudio-epc-catalog-generate/README.md +1 -1
- package/skills/omnistudio-flexcard-generate/SKILL.md +11 -4
- package/skills/omnistudio-flexcard-generate/references/best-practices.md +6 -6
- package/skills/omnistudio-flexcard-generate/references/data-binding-guide.md +9 -9
- package/skills/omnistudio-integration-procedure-generate/SKILL.md +9 -1
- package/skills/omnistudio-integration-procedure-generate/references/element-types.md +3 -3
- package/skills/omnistudio-omniscript-generate/SKILL.md +2 -2
- package/skills/omnistudio-omniscript-generate/references/best-practices.md +1 -1
- package/skills/omnistudio-omniscript-generate/scripts/check-duplicate-omniscript.sh +8 -0
- package/skills/omnistudio-omniscript-generate/scripts/deploy-omniscript.sh +8 -0
- package/skills/platform-apex-logs-debug/README.md +2 -2
- package/skills/platform-apex-logs-debug/references/cli-commands.md +2 -2
- package/skills/platform-apex-logs-debug/references/debug-log-reference.md +16 -16
- package/skills/platform-apex-logs-debug/references/log-analysis-tools.md +2 -2
- package/skills/platform-apex-test-run/README.md +1 -1
- package/skills/platform-apex-test-run/references/test-fix-loop.md +2 -2
- package/skills/platform-apex-test-run/references/testing-best-practices.md +3 -3
- package/skills/platform-data-manage/README.md +4 -4
- package/skills/platform-data-manage/references/bulk-testing-example.md +1 -1
- package/skills/platform-data-manage/references/crud-workflow-example.md +2 -2
- package/skills/platform-data-manage/references/orchestration.md +6 -6
- package/skills/platform-flexipage-generate/SKILL.md +281 -346
- package/skills/platform-flexipage-generate/references/cli_commands.md +39 -0
- package/skills/platform-flexipage-generate/references/flexipage_fieldSection.md +162 -0
- package/skills/platform-flexipage-generate/references/flexipage_richText.md +84 -0
- package/skills/platform-flexipage-generate/references/identifiers_and_regions.md +167 -0
- package/skills/platform-flexipage-generate/references/mcp_action_examples.md +104 -0
- package/skills/platform-flexipage-generate/references/record_flexipage_dynamicHighlights.md +119 -0
- package/skills/platform-flexipage-generate/references/xml_rules.md +335 -0
- package/skills/platform-flexipage-generate/scripts/resolve-component-instructions.sh +42 -0
- package/skills/platform-flexipage-generate/scripts/scan-lwc-components.sh +113 -0
- package/skills/platform-metadata-deploy/README.md +2 -2
- package/skills/platform-metadata-deploy/references/agent-deployment-guide.md +2 -2
- package/skills/platform-metadata-deploy/references/deployment-workflows.md +16 -16
- package/skills/platform-metadata-deploy/references/orchestration.md +3 -3
- package/skills/platform-metadata-deploy/references/trigger-deployment-safety.md +2 -2
- package/skills/platform-models-api-configure/SKILL.md +140 -0
- package/skills/platform-models-api-configure/scripts/get-orgjwt.sh +48 -0
- package/skills/platform-policy-rule-generate/SKILL.md +260 -0
- package/skills/platform-policy-rule-generate/references/deploy-errors.md +54 -0
- package/skills/platform-policy-rule-generate/references/fixtures-index.md +29 -0
- package/skills/platform-policy-rule-generate/references/policy-schema-full.md +250 -0
- package/skills/platform-policy-rule-generate/references/templates-access.md +132 -0
- package/skills/platform-policy-rule-generate/references/templates-advanced.md +58 -0
- package/skills/platform-policy-rule-generate/references/templates-record.md +75 -0
- package/skills/platform-policy-rule-generate/references/templates-transform.md +70 -0
- package/skills/platform-policy-rule-generate/references/templates.md +10 -0
- package/skills/platform-policy-rule-generate/references/ui-compatibility.md +142 -0
- package/skills/platform-soql-query/README.md +1 -1
- package/skills/platform-soql-query/SKILL.md +1 -1
- package/skills/platform-soql-query/references/anti-patterns.md +1 -1
- package/skills/platform-soql-query/references/field-coverage-rules.md +1 -1
- package/skills/platform-soql-query/references/query-optimization.md +1 -1
- package/skills/platform-soql-query/scripts/post-tool-validate.py +3 -3
- package/skills/data360-activate/CREDITS.md +0 -5
- package/skills/data360-connect/CREDITS.md +0 -5
- package/skills/data360-harmonize/CREDITS.md +0 -3
- package/skills/data360-orchestrate/CREDITS.md +0 -15
- package/skills/data360-orchestrate/UPSTREAM.md +0 -45
- package/skills/data360-prepare/CREDITS.md +0 -7
- package/skills/data360-query/CREDITS.md +0 -7
- package/skills/data360-segment/CREDITS.md +0 -3
- package/skills/experience-lwc-generate/CREDITS.md +0 -5
- package/skills/external-diagram-mermaid-generate/CREDITS.md +0 -46
- package/skills/external-diagram-visual-generate/CREDITS.md +0 -80
- package/skills/external-diagram-visual-generate/README.md +0 -83
- package/skills/external-diagram-visual-generate/SKILL.md +0 -207
- package/skills/external-diagram-visual-generate/assets/architecture/integration-flow.md +0 -55
- package/skills/external-diagram-visual-generate/assets/erd/core-objects.md +0 -131
- package/skills/external-diagram-visual-generate/assets/erd/custom-objects.md +0 -60
- package/skills/external-diagram-visual-generate/assets/lwc/dashboard-card.md +0 -45
- package/skills/external-diagram-visual-generate/assets/lwc/data-table.md +0 -57
- package/skills/external-diagram-visual-generate/assets/lwc/record-form.md +0 -60
- package/skills/external-diagram-visual-generate/assets/review/apex-review.md +0 -57
- package/skills/external-diagram-visual-generate/assets/review/lwc-review.md +0 -48
- package/skills/external-diagram-visual-generate/references/architect-aesthetic-guide.md +0 -257
- package/skills/external-diagram-visual-generate/references/examples-index.md +0 -35
- package/skills/external-diagram-visual-generate/references/gemini-cli-setup.md +0 -65
- package/skills/external-diagram-visual-generate/references/interview-questions.md +0 -529
- package/skills/external-diagram-visual-generate/references/iteration-workflow.md +0 -173
- package/skills/external-diagram-visual-generate/scripts/check-prerequisites.sh +0 -101
- package/skills/external-diagram-visual-generate/scripts/generate_image.py +0 -243
- package/skills/integration-connectivity-connected-app-configure/CREDITS.md +0 -3
- package/skills/integration-connectivity-generate/CREDITS.md +0 -5
- package/skills/omnistudio-callable-apex-generate/CREDITS.md +0 -9
- package/skills/omnistudio-datamapper-generate/CREDITS.md +0 -5
- package/skills/omnistudio-datapacks-deploy/CREDITS.md +0 -5
- package/skills/omnistudio-dependencies-analyze/CREDITS.md +0 -5
- package/skills/omnistudio-epc-catalog-generate/CREDITS.md +0 -14
- package/skills/omnistudio-flexcard-generate/CREDITS.md +0 -5
- package/skills/omnistudio-integration-procedure-generate/CREDITS.md +0 -5
- package/skills/omnistudio-omniscript-generate/CREDITS.md +0 -5
- package/skills/platform-apex-generate/CREDITS.md +0 -5
- package/skills/platform-apex-logs-debug/CREDITS.md +0 -22
- package/skills/platform-apex-test-generate/CREDITS.md +0 -5
- package/skills/platform-apex-test-run/CREDITS.md +0 -22
- package/skills/platform-data-manage/CREDITS.md +0 -5
- package/skills/platform-metadata-deploy/CREDITS.md +0 -25
- package/skills/platform-soql-query/CREDITS.md +0 -21
- /package/skills/omnistudio-callable-apex-generate/examples/Test_VlocityOpenInterfaceConversion/{MyCustomVlocityOpenInterface2.cls → MyCustomClass.cls} +0 -0
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: platform-flexipage-generate
|
|
3
|
-
description: "Use this skill when users need to create, generate, modify, or validate Salesforce Lightning pages (FlexiPages). Trigger when users mention RecordPage, AppPage, HomePage, Lightning pages, page layouts, adding components to pages, or page customization. Also use when users say things like 'create a Lightning page', 'add a component to a page', 'customize the record page', 'generate a FlexiPage', or when they're working with FlexiPage XML files and need help with components, regions, or deployment errors. Always use this skill for any FlexiPage-related work, even if they just mention 'page' in the context of Salesforce."
|
|
3
|
+
description: "Use this skill when users need to create, generate, modify, or validate Salesforce Lightning pages (FlexiPages). Trigger when users mention RecordPage, AppPage, HomePage, Lightning pages, page layouts, adding components to pages, or page customization. Also use when users say things like 'create a Lightning page', 'add a component to a page', 'customize the record page', 'generate a FlexiPage', or when they're working with FlexiPage XML files and need help with components, regions, or deployment errors. Always use this skill for any FlexiPage-related work, even if they just mention 'page' in the context of Salesforce. DO NOT TRIGGER when users ask about Visualforce pages, Aura components without FlexiPage context, page layout assignments in the UI, or Lightning Web Component development that does not involve placing components on a FlexiPage."
|
|
4
|
+
allowed-tools: Bash Read Write
|
|
4
5
|
metadata:
|
|
5
|
-
version: "1.
|
|
6
|
+
version: "1.1"
|
|
7
|
+
cliTools:
|
|
8
|
+
- tool: ["sf"]
|
|
9
|
+
semver: ">=2.126.4"
|
|
6
10
|
---
|
|
7
11
|
|
|
8
12
|
## When to Use This Skill
|
|
@@ -18,8 +22,6 @@ Use this skill when you need to:
|
|
|
18
22
|
|
|
19
23
|
## Specification
|
|
20
24
|
|
|
21
|
-
# FlexiPage Generation Guide
|
|
22
|
-
|
|
23
25
|
## Overview
|
|
24
26
|
|
|
25
27
|
**CRITICAL: When creating NEW FlexiPages, you MUST ALWAYS start with the CLI template command.** Never create FlexiPage XML from scratch - the CLI provides valid structure, proper regions, and correct component configuration that prevents deployment errors.
|
|
@@ -34,6 +36,8 @@ Generate Lightning pages (RecordPage, AppPage, HomePage) using CLI bootstrapping
|
|
|
34
36
|
|
|
35
37
|
**MANDATORY FOR NEW PAGES: This step is NOT optional.** Always use the CLI template command when creating a new FlexiPage. The CLI generates valid XML structure, proper regions, and correct metadata that prevents common deployment errors. Only skip this step if you're editing an existing FlexiPage file.
|
|
36
38
|
|
|
39
|
+
**`<packageDirectory>`** = the `path` value from `sfdx-project.json` → `packageDirectories[0]` (e.g., `force-app`). Read it from the project file before running commands.
|
|
40
|
+
|
|
37
41
|
```bash
|
|
38
42
|
sf template generate flexipage \
|
|
39
43
|
--name <PageName> \
|
|
@@ -42,7 +46,7 @@ sf template generate flexipage \
|
|
|
42
46
|
--primary-field <Field1> \
|
|
43
47
|
--secondary-fields <Field2,Field3> \
|
|
44
48
|
--detail-fields <Field4,Field5,Field6,Field7> \
|
|
45
|
-
--output-dir
|
|
49
|
+
--output-dir <packageDirectory>/main/default/flexipages
|
|
46
50
|
```
|
|
47
51
|
|
|
48
52
|
**CRITICAL:** If the `sf template generate flexipage` command fails, **STOP**.
|
|
@@ -84,439 +88,370 @@ Do NOT continue to Step 2 until the template command succeeds. The generated XML
|
|
|
84
88
|
|
|
85
89
|
### Step 2: Deploy Base Page
|
|
86
90
|
|
|
87
|
-
Run a **dry-run** deployment
|
|
91
|
+
Run a **dry-run** deployment to validate the page and dependencies (use the default package directory from `sfdx-project.json`):
|
|
88
92
|
```bash
|
|
89
|
-
sf project deploy start --dry-run -d "
|
|
93
|
+
sf project deploy start --dry-run -d "<packageDirectory>/main/default" --test-level NoTestRun --wait 10 --json
|
|
90
94
|
```
|
|
91
95
|
|
|
92
96
|
**Critical:** Fix any deployment errors before proceeding. The page must validate successfully.
|
|
93
97
|
|
|
94
|
-
### Step 3:
|
|
98
|
+
### Step 3: Add Components Dynamically (if requested)
|
|
95
99
|
|
|
96
|
-
**
|
|
100
|
+
After the base page deploys successfully, if the user wants additional components, follow the **Adding Components Dynamically** workflow below. All component additions MUST go through the discovery and inference pipeline — never write component XML from memory alone.
|
|
97
101
|
|
|
98
|
-
|
|
99
|
-
- Additional components
|
|
100
|
-
- Page customization
|
|
101
|
-
- Component configuration
|
|
102
|
+
---
|
|
102
103
|
|
|
103
|
-
|
|
104
|
-
- Suggest what components would be useful
|
|
105
|
-
- Explain what enhancements are possible
|
|
106
|
-
- Document what would need to be added manually
|
|
104
|
+
## Critical XML Rules
|
|
107
105
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
-
|
|
106
|
+
**Read `references/xml_rules.md`** for all XML encoding rules, field reference format, region/facet types, fieldInstance structure, unique identifier requirements, and common deployment error resolutions.
|
|
107
|
+
|
|
108
|
+
**Key rules (quick reminder):**
|
|
109
|
+
- Encode HTML in `<value>` tags: `&` first, then `<`, `>`, `"`, `'`
|
|
110
|
+
- Field references: `Record.{FieldApiName}` (never `Object.Field`)
|
|
111
|
+
- Every `<identifier>` and region `<name>` must be unique across the file
|
|
112
|
+
- Multiple components in same facet → combine in ONE region with multiple `<itemInstances>`
|
|
112
113
|
|
|
113
114
|
---
|
|
114
115
|
|
|
115
|
-
|
|
116
|
+
### Identifiers, Regions, and Containers
|
|
116
117
|
|
|
117
|
-
|
|
118
|
+
**Read `references/identifiers_and_regions.md`** for the identifier generation algorithm, facet naming patterns (named vs UUID), region selection rules, and container component facet structure.
|
|
118
119
|
|
|
119
|
-
|
|
120
|
+
---
|
|
120
121
|
|
|
121
|
-
|
|
122
|
-
1. & → & (FIRST! Encode this before others)
|
|
123
|
-
2. < → <
|
|
124
|
-
3. > → >
|
|
125
|
-
4. " → "
|
|
126
|
-
5. ' → '
|
|
127
|
-
```
|
|
122
|
+
## Component-Specific Tips
|
|
128
123
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
124
|
+
### dynamicHighlights (RecordPage Header)
|
|
125
|
+
**Location:** `header` region only. See `references/record_flexipage_dynamicHighlights.md` for full structure.
|
|
126
|
+
CLI generates Facets automatically from `--primary-field` and `--secondary-fields`.
|
|
127
|
+
|
|
128
|
+
### fieldSection
|
|
129
|
+
**Use for:** Displaying fields in columns. Three-level nesting: Region → Column Facets → Field Facets.
|
|
130
|
+
See `references/flexipage_fieldSection.md` for full structure and XML example.
|
|
131
|
+
**Critical:** The `columns` property value is a Facet name, not a number.
|
|
132
|
+
|
|
133
|
+
### richText
|
|
134
|
+
See `references/flexipage_richText.md` for encoding rules and XML structure.
|
|
135
|
+
Identifier: `flexipage_richText` or `flexipage_richText_{N}`
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
## Required Metadata Structure
|
|
133
139
|
|
|
134
|
-
**Correct:**
|
|
135
140
|
```xml
|
|
136
|
-
<
|
|
141
|
+
<FlexiPage xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
142
|
+
<flexiPageRegions>
|
|
143
|
+
<!-- Regions and components here -->
|
|
144
|
+
</flexiPageRegions>
|
|
145
|
+
<masterLabel>Page Label</masterLabel>
|
|
146
|
+
<template>
|
|
147
|
+
<name>flexipage:recordHomeTemplateDesktop</name>
|
|
148
|
+
</template>
|
|
149
|
+
<type>RecordPage</type>
|
|
150
|
+
<sobjectType>Object__c</sobjectType> <!-- RecordPage only -->
|
|
151
|
+
</FlexiPage>
|
|
137
152
|
```
|
|
138
153
|
|
|
139
|
-
**
|
|
154
|
+
**Page Types:**
|
|
155
|
+
- `RecordPage` - requires `<sobjectType>`
|
|
156
|
+
- `AppPage` - no sobjectType
|
|
157
|
+
- `HomePage` - no sobjectType
|
|
140
158
|
|
|
141
|
-
|
|
159
|
+
---
|
|
142
160
|
|
|
143
|
-
|
|
144
|
-
**NEVER:** `{ObjectName}.{FieldApiName}`
|
|
161
|
+
## Validation Checklist
|
|
145
162
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
<fieldItem>Record.Name</fieldItem>
|
|
163
|
+
### Structure (new pages)
|
|
164
|
+
- [ ] Used CLI to bootstrap — never create FlexiPage XML from scratch
|
|
149
165
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
166
|
+
### Identifiers & Regions
|
|
167
|
+
- [ ] All `<identifier>` values unique across entire file
|
|
168
|
+
- [ ] All region/facet `<name>` values unique across entire file
|
|
169
|
+
- [ ] Multiple components in same facet combined in ONE region with multiple `<itemInstances>`
|
|
153
170
|
|
|
154
|
-
###
|
|
171
|
+
### Field Instances
|
|
172
|
+
- [ ] All field references use `Record.{Field}` format
|
|
173
|
+
- [ ] Each fieldInstance has `fieldInstanceProperties` with `uiBehavior`
|
|
174
|
+
- [ ] Each fieldInstance in its own `<itemInstances>` wrapper
|
|
155
175
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
176
|
+
### Types & Encoding
|
|
177
|
+
- [ ] Template regions use `<type>Region</type>`; component facets use `<type>Facet</type>`
|
|
178
|
+
- [ ] Property values with HTML/XML are entity-encoded
|
|
179
|
+
- [ ] No unnecessary `<mode>` tags (only where component patterns require them)
|
|
180
|
+
- [ ] No `__c` suffix in page names
|
|
181
|
+
- [ ] Each Facet referenced by exactly one component property
|
|
161
182
|
|
|
162
|
-
|
|
163
|
-
```xml
|
|
164
|
-
<name>Facet-12345</name>
|
|
165
|
-
<type>Facet</type>
|
|
166
|
-
```
|
|
183
|
+
---
|
|
167
184
|
|
|
168
|
-
|
|
185
|
+
## Quick Reference: CLI Command
|
|
169
186
|
|
|
170
|
-
|
|
187
|
+
**Read `references/cli_commands.md`** for full CLI examples (RecordPage, AppPage, HomePage) and available options.
|
|
171
188
|
|
|
172
|
-
|
|
173
|
-
```xml
|
|
174
|
-
<itemInstances>
|
|
175
|
-
<fieldInstance>
|
|
176
|
-
<fieldInstanceProperties>
|
|
177
|
-
<name>uiBehavior</name>
|
|
178
|
-
<value>none</value> <!-- none|readonly|required -->
|
|
179
|
-
</fieldInstanceProperties>
|
|
180
|
-
<fieldItem>Record.FieldName__c</fieldItem>
|
|
181
|
-
<identifier>RecordFieldName_cField</identifier>
|
|
182
|
-
</fieldInstance>
|
|
183
|
-
</itemInstances>
|
|
184
|
-
```
|
|
189
|
+
---
|
|
185
190
|
|
|
186
|
-
|
|
187
|
-
- Each fieldInstance in its own `<itemInstances>` wrapper
|
|
188
|
-
- Must have `fieldInstanceProperties` with `uiBehavior`
|
|
189
|
-
- Use `Record.{Field}` format
|
|
191
|
+
## Adding Components Dynamically
|
|
190
192
|
|
|
191
|
-
|
|
193
|
+
> **MANDATORY WORKFLOW:** ALL component additions to a FlexiPage MUST follow this workflow. Do not write component XML from memory or skip discovery. This applies to standard OOTB components, custom LWC components, and any other component type.
|
|
192
194
|
|
|
193
|
-
|
|
195
|
+
### Overview
|
|
194
196
|
|
|
195
|
-
|
|
196
|
-
- ❌ **NEVER create two `<flexiPageRegions>` blocks with the same `<name>`**
|
|
197
|
-
- ✅ **If multiple components belong to same facet, combine them in ONE region with multiple `<itemInstances>`**
|
|
198
|
-
- ❌ **NEVER reuse the same `<identifier>` value**
|
|
199
|
-
- ✅ **Always read entire file first and extract ALL existing identifiers and names**
|
|
197
|
+
When the user requests components (e.g., "add a related list of contacts and a report"), follow this pipeline:
|
|
200
198
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
<identifier>flexipage_property_details_fieldSection</identifier>
|
|
208
|
-
...
|
|
209
|
-
</componentInstance>
|
|
210
|
-
</itemInstances>
|
|
211
|
-
<name>detailTabContent</name> <!-- ❌ DUPLICATE NAME -->
|
|
212
|
-
<type>Facet</type>
|
|
213
|
-
</flexiPageRegions>
|
|
214
|
-
|
|
215
|
-
<!-- Second field section in detail tab -->
|
|
216
|
-
<flexiPageRegions>
|
|
217
|
-
<itemInstances>
|
|
218
|
-
<componentInstance>
|
|
219
|
-
<identifier>flexipage_pricing_fieldSection</identifier>
|
|
220
|
-
...
|
|
221
|
-
</componentInstance>
|
|
222
|
-
</itemInstances>
|
|
223
|
-
<name>detailTabContent</name> <!-- ❌ DUPLICATE NAME - DEPLOYMENT FAILS -->
|
|
224
|
-
<type>Facet</type>
|
|
225
|
-
</flexiPageRegions>
|
|
199
|
+
```text
|
|
200
|
+
1. Parse Intent → identify ALL requested components
|
|
201
|
+
2. Discover ALL → batch components through 3-tier discovery
|
|
202
|
+
3. Infer Properties → run 3-step inference for EACH discovered component
|
|
203
|
+
4. Generate XML → produce valid XML for all components together
|
|
204
|
+
5. Validate → check identifiers, regions, property completeness
|
|
226
205
|
```
|
|
227
206
|
|
|
228
|
-
**
|
|
229
|
-
```xml
|
|
230
|
-
<!-- Both field sections in same detail tab facet -->
|
|
231
|
-
<flexiPageRegions>
|
|
232
|
-
<itemInstances>
|
|
233
|
-
<componentInstance>
|
|
234
|
-
<identifier>flexipage_property_details_fieldSection</identifier>
|
|
235
|
-
...
|
|
236
|
-
</componentInstance>
|
|
237
|
-
</itemInstances>
|
|
238
|
-
<itemInstances>
|
|
239
|
-
<componentInstance>
|
|
240
|
-
<identifier>flexipage_pricing_fieldSection</identifier>
|
|
241
|
-
...
|
|
242
|
-
</componentInstance>
|
|
243
|
-
</itemInstances>
|
|
244
|
-
<name>detailTabContent</name> <!-- ✅ ONE REGION, MULTIPLE COMPONENTS -->
|
|
245
|
-
<type>Facet</type>
|
|
246
|
-
</flexiPageRegions>
|
|
247
|
-
```
|
|
207
|
+
**Key rule:** Discover ALL components as a batch first (one scan, one MCP call), THEN infer properties for each. Do not invoke discovery steps per-component or interleave discovery and inference.
|
|
248
208
|
|
|
249
|
-
|
|
250
|
-
- **Combine**: Components that logically belong to same tab/section (e.g., multiple field sections in detail tab)
|
|
251
|
-
- **Separate**: Components that belong to different tabs/sections (e.g., `detailTabContent` vs `relatedTabContent`)
|
|
209
|
+
### Step 1: Parse User Intent
|
|
252
210
|
|
|
253
|
-
|
|
211
|
+
Extract every component request from the user's utterance. Examples:
|
|
212
|
+
- "Create Account page with a report and related contacts" → 2 components: report, related list
|
|
213
|
+
- "Add activities, chatter, and a DRL of Cases" → 3 components: activities, chatter, dynamic related list
|
|
254
214
|
|
|
255
|
-
|
|
215
|
+
### Step 2: 3-Tier Component Discovery
|
|
256
216
|
|
|
257
|
-
|
|
258
|
-
**Cause:** Invalid field API name - field doesn't exist on the object or has incorrect spelling
|
|
259
|
-
**Fix:** Use MCP tools or describe commands to discover valid fields, then update the field reference (see Field Selection Rules)
|
|
217
|
+
Complete each tier for ALL components before moving to the next tier — do NOT run Tier 1→2→3 per component:
|
|
260
218
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
**
|
|
219
|
+
| Tier | Source | When | Calls |
|
|
220
|
+
|------|--------|------|-------|
|
|
221
|
+
| **1** | Local workspace scan | Always first — run for ALL components | 0 (local only) |
|
|
222
|
+
| **2** | `discoverUiComponents` MCP action | Single call for all components unresolved after Tier 1 | 1 |
|
|
223
|
+
| **3** | Generate new LWC bundle | Only for components still unresolved after Tier 2 + user confirms | 0 |
|
|
264
224
|
|
|
265
|
-
|
|
266
|
-
**Cause:** Multiple fieldInstances in one itemInstances
|
|
267
|
-
**Fix:** Each fieldInstance needs its own `<itemInstances>` wrapper
|
|
225
|
+
After Tier 1 completes for all components, collect only the unresolved ones and pass them to Tier 2 in a single MCP call. Only components still unresolved after Tier 2 proceed to Tier 3.
|
|
268
226
|
|
|
269
|
-
|
|
270
|
-
**Cause:** No uiBehavior specified
|
|
271
|
-
**Fix:** Add `fieldInstanceProperties` with `uiBehavior`
|
|
227
|
+
See **Local Workspace Scanner** and **MCP Action Integration** sections below for details.
|
|
272
228
|
|
|
273
|
-
###
|
|
274
|
-
**Cause:** Facet defined but not referenced by any component
|
|
275
|
-
**Fix:** Remove Facet or reference it in a component property
|
|
229
|
+
### Step 3: Property Inference (per component)
|
|
276
230
|
|
|
277
|
-
|
|
278
|
-
**Cause:** Unencoded HTML/XML in property values
|
|
279
|
-
**Fix:** Manually encode `<`, `>`, `&`, `"`, `'` in all `<value>` tags
|
|
231
|
+
For EACH discovered component, infer properties using the 3-step strategy:
|
|
280
232
|
|
|
281
|
-
|
|
282
|
-
**
|
|
283
|
-
**
|
|
233
|
+
1. **Fetch schema or read source** — For Tier 2 (org) components, call `getUiComponentSchemas`; for Tier 1 (local), extract `@api` props from source
|
|
234
|
+
2. **Apply component instructions** — If `references/<name>.md` exists, read and follow its inference rules
|
|
235
|
+
3. **Resolve remaining** — Smart defaults → LLM inference → user prompts (last resort)
|
|
284
236
|
|
|
285
|
-
|
|
286
|
-
**Cause:** Added `<mode>` tag to region
|
|
287
|
-
**Fix:** Remove `<mode>` tags - they're not needed for standard regions
|
|
237
|
+
See **Hybrid Property Inference Strategy** below for full details.
|
|
288
238
|
|
|
289
|
-
|
|
239
|
+
### Step 4: Generate XML
|
|
240
|
+
|
|
241
|
+
What you CANNOT do:
|
|
242
|
+
- Modify top level structure in the XML file
|
|
243
|
+
- Add any components from memory which is not resolved from 3-Tier Component Discovery
|
|
244
|
+
- Make any enhancements
|
|
290
245
|
|
|
291
|
-
|
|
246
|
+
**Read `references/xml_rules.md` before writing any XML.** Follow all element naming and structure rules defined there.
|
|
292
247
|
|
|
293
|
-
|
|
248
|
+
Produce `<itemInstances>` XML for all resolved components:
|
|
249
|
+
- Use `<componentInstanceProperties>` for every property (NOT `<properties>`)
|
|
250
|
+
- Assign unique identifiers across the full set (see references/identifiers_and_regions.md)
|
|
251
|
+
- Insert into appropriate regions (header, main, sidebar, or facets)
|
|
252
|
+
- Follow each component's XML structure from its instructions file or schema
|
|
294
253
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
254
|
+
### Step 5: Validate
|
|
255
|
+
|
|
256
|
+
Check the complete FlexiPage for:
|
|
257
|
+
- Identifier uniqueness (no duplicates across entire file)
|
|
258
|
+
- Region validity (components in correct regions)
|
|
259
|
+
- Property completeness (all required properties populated)
|
|
260
|
+
- XML encoding (HTML values entity-encoded)
|
|
261
|
+
- Element name correctness (see references/xml_rules.md §6)
|
|
262
|
+
|
|
263
|
+
Deploy with dry-run (use default package directory from `sfdx-project.json`):
|
|
264
|
+
```bash
|
|
265
|
+
sf project deploy start --dry-run -d "<packageDirectory>/main/default" --test-level NoTestRun --wait 10 --json
|
|
304
266
|
```
|
|
305
267
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
- Rich text in header: `richText_header_1`
|
|
310
|
-
- Field section: `fieldSection_details_1`
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## MCP Action Integration
|
|
311
271
|
|
|
312
|
-
**
|
|
272
|
+
**Read `references/mcp_action_examples.md`** for full input/output examples and parameter tables.
|
|
313
273
|
|
|
314
|
-
|
|
315
|
-
- `detailTabContent` (detail tab content)
|
|
316
|
-
- `maintabs` (main tab container)
|
|
317
|
-
- `sidebartabs` (sidebar tab container)
|
|
318
|
-
- Use when facet represents meaningful content area
|
|
274
|
+
Two MCP actions via `execute_metadata_action`:
|
|
319
275
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
276
|
+
| Action | Purpose | When |
|
|
277
|
+
|--------|---------|------|
|
|
278
|
+
| `DISCOVER_UI_COMPONENTS` | Find components for a page type | Tier 2 discovery — single call for all unresolved components |
|
|
279
|
+
| `GET_UI_COMPONENT_SCHEMAS` | Get property schemas | Property inference Step 1 (Tier 2 org components only) |
|
|
324
280
|
|
|
325
|
-
**
|
|
326
|
-
-
|
|
327
|
-
-
|
|
328
|
-
-
|
|
281
|
+
**Key conventions:**
|
|
282
|
+
- Component definition format: `namespace/blockName` (forward-slash) in MCP calls, `namespace:blockName` (colon) in XML
|
|
283
|
+
- `pageContext` with `entityName` is required for RECORD_PAGE
|
|
284
|
+
- `getUiComponentSchemas` supports partial failures — check each component's `success` boolean
|
|
329
285
|
|
|
330
286
|
---
|
|
331
287
|
|
|
332
|
-
|
|
288
|
+
## Local Workspace Scanner
|
|
333
289
|
|
|
334
|
-
|
|
335
|
-
- `flexipage:recordHomeTemplateDesktop` → `header`, `main`, `sidebar`
|
|
336
|
-
- `runtime_service_fieldservice:...` → `header`, `main`, `footer`
|
|
337
|
-
- Others may have different region names
|
|
290
|
+
Scans the local SFDX project for custom LWC components before making any MCP calls (Tier 1 discovery).
|
|
338
291
|
|
|
339
|
-
|
|
292
|
+
### Algorithm
|
|
340
293
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
<type>Region</type>
|
|
346
|
-
<itemInstances><!-- Existing component 1 --></itemInstances>
|
|
347
|
-
<itemInstances><!-- Existing component 2 --></itemInstances>
|
|
348
|
-
<itemInstances>
|
|
349
|
-
<!-- INSERT NEW COMPONENT HERE -->
|
|
350
|
-
</itemInstances>
|
|
351
|
-
</flexiPageRegions>
|
|
294
|
+
Run the scanner for each component query (local scan — no network calls):
|
|
295
|
+
|
|
296
|
+
```bash
|
|
297
|
+
scripts/scan-lwc-components.sh "<query>" [packageDirectory]
|
|
352
298
|
```
|
|
353
299
|
|
|
354
|
-
|
|
300
|
+
The script scans `<packageDirectory>/**/lwc/*/`, tokenizes camelCase component names, scores them against user intent keywords, and returns a JSON array of matches with confidence tiers:
|
|
355
301
|
|
|
356
|
-
|
|
302
|
+
- **High confidence (≥70%):** auto-select, confirm with user
|
|
303
|
+
- **Medium confidence (40-69%):** present ranked list for user selection
|
|
304
|
+
- **Low confidence (<40%):** skip, proceed to Tier 2
|
|
357
305
|
|
|
358
|
-
|
|
306
|
+
Run Tier 1 for ALL components before moving any to Tier 2. Collect all unresolved components from Tier 1, then pass them to Tier 2 in a single MCP call.
|
|
359
307
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
</componentInstance>
|
|
374
|
-
</itemInstances>
|
|
375
|
-
<name>main</name>
|
|
376
|
-
<type>Region</type>
|
|
377
|
-
</flexiPageRegions>
|
|
378
|
-
|
|
379
|
-
<!-- 2. Facets (siblings of region, NOT nested inside) -->
|
|
380
|
-
<flexiPageRegions>
|
|
381
|
-
<itemInstances><!-- Tab 1 content --></itemInstances>
|
|
382
|
-
<name>tab1_content</name>
|
|
383
|
-
<type>Facet</type>
|
|
384
|
-
</flexiPageRegions>
|
|
385
|
-
|
|
386
|
-
<flexiPageRegions>
|
|
387
|
-
<itemInstances><!-- Tab 2 content --></itemInstances>
|
|
388
|
-
<name>tab2_content</name>
|
|
389
|
-
<type>Facet</type>
|
|
390
|
-
</flexiPageRegions>
|
|
391
|
-
```
|
|
308
|
+
### Disambiguation
|
|
309
|
+
|
|
310
|
+
For medium-confidence matches (40-69%) or multiple high-confidence matches:
|
|
311
|
+
1. Read each candidate's `.js-meta.xml` for `<description>` and `<targetConfigs>`
|
|
312
|
+
2. Present ranked list to user with component name + description
|
|
313
|
+
3. User selects or says "none of these" (→ proceed to Tier 2)
|
|
314
|
+
|
|
315
|
+
### When to Skip
|
|
316
|
+
|
|
317
|
+
Skip local scan when:
|
|
318
|
+
- User explicitly mentions an org-level component ("use the standard report component")
|
|
319
|
+
- User intent clearly maps to a known standard component (DRL, richText, etc.)
|
|
320
|
+
- No `<packageDirectory>` directory exists in the workspace
|
|
392
321
|
|
|
393
|
-
**Critical**: Facet regions are siblings of template regions at the same level, not nested inside them.
|
|
394
322
|
---
|
|
395
|
-
## Component-Specific Tips
|
|
396
|
-
### dynamicHighlights (RecordPage Header)
|
|
397
|
-
**Location:** Must be in `header` region.
|
|
398
|
-
**Explicit Fields** (via CLI): Use the most important fields to show a summary of the record. The single primary field is used to identify the record, like a name. The secondary fields (max 12, recommended 6) are used as a summary of the record.
|
|
399
|
-
```bash
|
|
400
|
-
--primary-field Name
|
|
401
|
-
--secondary-fields Phone,Industry,AnnualRevenue
|
|
402
|
-
```
|
|
403
|
-
CLI generates Facets with field references automatically.
|
|
404
|
-
### fieldSection
|
|
405
|
-
**Use for:** Displaying fields in columns.
|
|
406
|
-
**Structure:** Three-level nesting:
|
|
407
|
-
1. Template Region (Region type)
|
|
408
|
-
2. Column Facets (Facet type)
|
|
409
|
-
3. Field Facets (Facet type)
|
|
410
|
-
**Referenced in component property:**
|
|
411
|
-
```xml
|
|
412
|
-
<componentInstanceProperties>
|
|
413
|
-
<name>columns</name>
|
|
414
|
-
<value>Facet-{uuid}</value>
|
|
415
|
-
</componentInstanceProperties>
|
|
416
|
-
```
|
|
417
323
|
|
|
418
|
-
|
|
324
|
+
## Hybrid Property Inference Strategy
|
|
419
325
|
|
|
420
|
-
|
|
326
|
+
For EACH discovered component, populate its properties using this 3-step strategy in order:
|
|
421
327
|
|
|
422
|
-
|
|
328
|
+
### Step 1: Fetch Latest Schema (conditional)
|
|
423
329
|
|
|
424
|
-
|
|
330
|
+
Call `getUiComponentSchemas` only when the component does **not** exist on the local machine (i.e., Tier 2 org-discovered components). For local components (Tier 1), extract `@api` properties directly from the source code instead.
|
|
425
331
|
|
|
332
|
+
**When to call:**
|
|
333
|
+
- Tier 2 (org discovery): Always — the schema is the only source of property info
|
|
334
|
+
- Tier 1 (local): Skip — read `@api` properties from the component's `.js` source file
|
|
335
|
+
- Tier 3 (generated): Skip — you just created the source, so properties are already known
|
|
426
336
|
|
|
427
|
-
|
|
337
|
+
### Step 2: Apply Component Instructions (if present)
|
|
428
338
|
|
|
429
|
-
|
|
339
|
+
Run `scripts/resolve-component-instructions.sh <namespace:component>` — it returns the instructions file path if it exists, or empty string.
|
|
430
340
|
|
|
431
|
-
|
|
432
|
-
|
|
341
|
+
Examples:
|
|
342
|
+
- `record_flexipage:dynamicHighlights` → `references/record_flexipage_dynamicHighlights.md`
|
|
343
|
+
- `flexipage:fieldSection` → `references/flexipage_fieldSection.md`
|
|
344
|
+
- `c:expenseTracker` → (empty — no file)
|
|
433
345
|
|
|
434
|
-
XML
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
346
|
+
If a file is returned: read and follow its inference rules, XML patterns, and defaults.
|
|
347
|
+
If empty: skip directly to Step 3.
|
|
348
|
+
|
|
349
|
+
Instructions files augment the schema — they provide *how* to derive values from user intent. Any properties in the schema not covered by the instructions file are resolved in Step 3.
|
|
350
|
+
|
|
351
|
+
### Step 3: Resolve Remaining Properties
|
|
352
|
+
|
|
353
|
+
For any properties not yet resolved, apply in this priority order:
|
|
354
|
+
|
|
355
|
+
**3a. Smart Default Heuristics:**
|
|
356
|
+
|
|
357
|
+
| Property Pattern | Default Value |
|
|
358
|
+
|-----------------|---------------|
|
|
359
|
+
| `recordId` | `{!recordId}` |
|
|
360
|
+
| `objectApiName` / `sObjectName` | Page's `<sobjectType>` value |
|
|
361
|
+
| `show*` / `visible*` / `display*` | `true` |
|
|
362
|
+
| `hide*` / `hidden*` / `disabled*` | `false` |
|
|
363
|
+
| Boolean without prefix | `false` |
|
|
364
|
+
| Schema specifies `"default"` | Use schema default |
|
|
365
|
+
|
|
366
|
+
**3b. LLM Inference:**
|
|
367
|
+
Use the component schema + user intent + page context to infer reasonable values. Example: user says "report showing top opportunities" → infer `reportName` should reference an opportunities report.
|
|
368
|
+
|
|
369
|
+
**3c. User Prompts (last resort):**
|
|
370
|
+
Only prompt the user for critical required properties that cannot be inferred. If user says "skip", omit the component entirely.
|
|
371
|
+
|
|
372
|
+
### Tier-Specific Behavior
|
|
447
373
|
|
|
448
|
-
|
|
374
|
+
| Tier | Extra Step | Schema Call | Instructions |
|
|
375
|
+
|------|-----------|-------------|--------------|
|
|
376
|
+
| Tier 1 (local) | Extract `@api` props from source | No (use source) | If exists |
|
|
377
|
+
| Tier 2 (org) | — | Yes | If exists |
|
|
378
|
+
| Tier 3 (generated) | Extract `@api` from just-generated source | No (just created) | No |
|
|
449
379
|
|
|
450
380
|
---
|
|
451
|
-
## Required Metadata Structure
|
|
452
381
|
|
|
453
|
-
|
|
454
|
-
<FlexiPage xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
455
|
-
<flexiPageRegions>
|
|
456
|
-
<!-- Regions and components here -->
|
|
457
|
-
</flexiPageRegions>
|
|
458
|
-
<masterLabel>Page Label</masterLabel>
|
|
459
|
-
<template>
|
|
460
|
-
<name>flexipage:recordHomeTemplateDesktop</name>
|
|
461
|
-
</template>
|
|
462
|
-
<type>RecordPage</type>
|
|
463
|
-
<sobjectType>Object__c</sobjectType> <!-- RecordPage only -->
|
|
464
|
-
</FlexiPage>
|
|
465
|
-
```
|
|
382
|
+
## New LWC Generation (Tier 3)
|
|
466
383
|
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
384
|
+
When no component is found locally (Tier 1) or in the org (Tier 2), offer to generate a new LWC.
|
|
385
|
+
|
|
386
|
+
### Trigger Conditions
|
|
387
|
+
|
|
388
|
+
- Tier 1 and Tier 2 both miss or user rejected all candidates
|
|
389
|
+
- User has not explicitly said "skip" or "don't create"
|
|
390
|
+
|
|
391
|
+
### Confirmation
|
|
392
|
+
|
|
393
|
+
Always confirm before creating. Explain: component name. If user declines: skip, continue with other components.
|
|
394
|
+
|
|
395
|
+
### Post-Generation
|
|
396
|
+
|
|
397
|
+
After creating the LWC bundle:
|
|
398
|
+
1. Treat as a Tier 1 local component immediately
|
|
399
|
+
2. Extract `@api` properties from the generated source
|
|
400
|
+
3. Apply smart defaults for `recordId` and `objectApiName`
|
|
401
|
+
4. Generate FlexiPage XML with `c:{componentName}` as the componentName
|
|
402
|
+
|
|
403
|
+
### Naming Convention
|
|
404
|
+
|
|
405
|
+
- Derive from user intent: "customer health score" → `customerHealthScore`
|
|
406
|
+
- camelCase, no hyphens, no underscores in the JS class name
|
|
407
|
+
- Folder name matches class name (lowercase first letter): `customerHealthScore/`
|
|
471
408
|
|
|
472
409
|
---
|
|
473
410
|
|
|
474
|
-
##
|
|
411
|
+
## Reference File Index
|
|
475
412
|
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
-
|
|
486
|
-
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
- [ ] Each Facet referenced by exactly one component property
|
|
413
|
+
| File | When to read |
|
|
414
|
+
|------|-------------|
|
|
415
|
+
| `references/xml_rules.md` | Before writing or editing any FlexiPage XML — encoding, field refs, identifiers, deployment errors |
|
|
416
|
+
| `references/identifiers_and_regions.md` | When adding components — identifier algorithm, facet naming, region selection, container pattern |
|
|
417
|
+
| `references/cli_commands.md` | When bootstrapping new pages — full CLI examples for RecordPage, AppPage, HomePage |
|
|
418
|
+
| `references/mcp_action_examples.md` | When calling MCP actions — full input/output JSON for discoverUiComponents and getUiComponentSchemas |
|
|
419
|
+
| `references/flexipage_fieldSection.md` | When adding a Field Section with columns |
|
|
420
|
+
| `references/record_flexipage_dynamicHighlights.md` | When adding a Dynamic Highlights panel |
|
|
421
|
+
| `references/flexipage_richText.md` | When adding a Rich Text component |
|
|
422
|
+
| `scripts/scan-lwc-components.sh` | Tier 1 local workspace scan — tokenizes and scores LWC component names against user query |
|
|
423
|
+
| `scripts/resolve-component-instructions.sh` | Property inference Step 2 — resolves component definition to instructions file path |
|
|
424
|
+
|
|
425
|
+
**To add a new component pattern:** Create `references/<namespace>_<componentName>.md` following the structure in existing files. The skill automatically checks for the file during Step 2 of property inference.
|
|
490
426
|
|
|
491
427
|
---
|
|
492
428
|
|
|
493
|
-
##
|
|
429
|
+
## Validation Rules for Dynamic Components
|
|
494
430
|
|
|
495
|
-
|
|
496
|
-
# RecordPage with fields
|
|
497
|
-
sf template generate flexipage \
|
|
498
|
-
--name Account_Custom_Page \
|
|
499
|
-
--template RecordPage \
|
|
500
|
-
--sobject Account \
|
|
501
|
-
--primary-field Name \
|
|
502
|
-
--secondary-fields Phone,Industry,AnnualRevenue \
|
|
503
|
-
--detail-fields Street,City,State,Name,Phone,Email
|
|
504
|
-
|
|
505
|
-
# AppPage
|
|
506
|
-
sf template generate flexipage \
|
|
507
|
-
--name Sales_Dashboard \
|
|
508
|
-
--template AppPage \
|
|
509
|
-
--label "Sales Dashboard"
|
|
431
|
+
After generating XML for dynamically added components, verify ALL of the following before deployment:
|
|
510
432
|
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
433
|
+
### Identifier Uniqueness
|
|
434
|
+
- Extract ALL `<identifier>` values from the entire FlexiPage file
|
|
435
|
+
- Confirm zero duplicates
|
|
436
|
+
- If conflict: auto-increment suffix (`_2`, `_3`, etc.)
|
|
437
|
+
|
|
438
|
+
### Region Validity
|
|
439
|
+
- Components placed in correct regions for their type:
|
|
440
|
+
- `record_flexipage:dynamicHighlights` → `header` only
|
|
441
|
+
- `flexipage:fieldSection` → `main` or tab facets
|
|
442
|
+
- `flexipage:richText` → any region
|
|
443
|
+
|
|
444
|
+
### Property Completeness
|
|
445
|
+
- All properties marked required in schema have values
|
|
446
|
+
- All values match expected types (String, Boolean, valueList, Integer)
|
|
447
|
+
- No raw HTML in `<value>` tags (must be entity-encoded)
|
|
448
|
+
|
|
449
|
+
### Structural Integrity
|
|
450
|
+
- Every Facet referenced by a component property exists as a `<flexiPageRegions>` block
|
|
451
|
+
- No orphan Facets (every Facet is referenced by exactly one component)
|
|
452
|
+
- Multiple components in same region use ONE `<flexiPageRegions>` block with multiple `<itemInstances>`
|
|
517
453
|
|
|
518
|
-
|
|
519
|
-
-
|
|
520
|
-
-
|
|
521
|
-
-
|
|
522
|
-
- `--description`
|
|
454
|
+
### Cross-Component Consistency
|
|
455
|
+
- For multi-component additions: identifiers are unique across ALL new components
|
|
456
|
+
- Facet UUIDs don't collide between components
|
|
457
|
+
- Components that require singleton placement (dynamicHighlights, recordDetailPanelMobile) are not duplicated
|