@salesforce/afv-skills 1.1.0 → 1.3.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/package.json +6 -5
- package/skills/accessing-webapp-data/SKILL.md +178 -0
- package/skills/agentforce-development/SKILL.md +427 -0
- package/skills/agentforce-development/assets/README-legacy.md +89 -0
- package/skills/agentforce-development/assets/agent-spec-template.md +90 -0
- package/skills/agentforce-development/assets/agents/README.md +45 -0
- package/skills/agentforce-development/assets/agents/hello-world.agent +60 -0
- package/skills/agentforce-development/assets/agents/multi-topic.agent +105 -0
- package/skills/agentforce-development/assets/agents/production-faq.agent +101 -0
- package/skills/agentforce-development/assets/agents/production-faq.bundle-meta.xml +4 -0
- package/skills/agentforce-development/assets/agents/simple-qa.agent +72 -0
- package/skills/agentforce-development/assets/apex/models-api-queueable.cls +225 -0
- package/skills/agentforce-development/assets/bundle-meta.xml +23 -0
- package/skills/agentforce-development/assets/components/apex-action.agent +52 -0
- package/skills/agentforce-development/assets/components/error-handling.agent +58 -0
- package/skills/agentforce-development/assets/components/escalation-setup.agent +169 -0
- package/skills/agentforce-development/assets/components/flow-action.agent +66 -0
- package/skills/agentforce-development/assets/components/n-ary-conditions.agent +110 -0
- package/skills/agentforce-development/assets/components/topic-with-actions.agent +40 -0
- package/skills/agentforce-development/assets/deterministic-routing.agent +166 -0
- package/skills/agentforce-development/assets/escalation-pattern.agent +209 -0
- package/skills/agentforce-development/assets/flow-action-lookup.agent +115 -0
- package/skills/agentforce-development/assets/hub-and-spoke.agent +104 -0
- package/skills/agentforce-development/assets/invocable-apex-template.cls +187 -0
- package/skills/agentforce-development/assets/local-info-agent-annotated.agent +355 -0
- package/skills/agentforce-development/assets/metadata/basic-prompt-template.promptTemplate-meta.xml +109 -0
- package/skills/agentforce-development/assets/metadata/genai-function-apex.xml +92 -0
- package/skills/agentforce-development/assets/metadata/genai-function-flow.xml +57 -0
- package/skills/agentforce-development/assets/metadata/genai-plugin.xml +72 -0
- package/skills/agentforce-development/assets/metadata/http-callout-flow.flow-meta.xml +348 -0
- package/skills/agentforce-development/assets/metadata/record-grounded-prompt.promptTemplate-meta.xml +136 -0
- package/skills/agentforce-development/assets/minimal-starter.agent +42 -0
- package/skills/agentforce-development/assets/patterns/README.md +254 -0
- package/skills/agentforce-development/assets/patterns/action-callbacks.agent +178 -0
- package/skills/agentforce-development/assets/patterns/advanced-input-bindings.agent +141 -0
- package/skills/agentforce-development/assets/patterns/bidirectional-routing.agent +156 -0
- package/skills/agentforce-development/assets/patterns/critical-input-collection.agent +244 -0
- package/skills/agentforce-development/assets/patterns/delegation-routing.agent +89 -0
- package/skills/agentforce-development/assets/patterns/lifecycle-events.agent +127 -0
- package/skills/agentforce-development/assets/patterns/llm-controlled-actions.agent +184 -0
- package/skills/agentforce-development/assets/patterns/multi-step-workflow.agent +282 -0
- package/skills/agentforce-development/assets/patterns/open-gate-routing.agent +286 -0
- package/skills/agentforce-development/assets/patterns/procedural-instructions.agent +273 -0
- package/skills/agentforce-development/assets/patterns/prompt-template-action.agent +188 -0
- package/skills/agentforce-development/assets/patterns/system-instruction-overrides.agent +293 -0
- package/skills/agentforce-development/assets/prompt-rag-search.agent +131 -0
- package/skills/agentforce-development/assets/template-multi-topic.agent +160 -0
- package/skills/agentforce-development/assets/template-single-topic.agent +81 -0
- package/skills/agentforce-development/assets/verification-gate.agent +208 -0
- package/skills/agentforce-development/references/action-prompt-templates.md +164 -0
- package/skills/agentforce-development/references/actions-reference.md +592 -0
- package/skills/agentforce-development/references/agent-access-guide.md +72 -0
- package/skills/agentforce-development/references/agent-design-and-spec-creation.md +1010 -0
- package/skills/agentforce-development/references/agent-metadata-and-lifecycle.md +575 -0
- package/skills/agentforce-development/references/agent-script-core-language.md +1218 -0
- package/skills/agentforce-development/references/agent-topic-map-diagrams.md +323 -0
- package/skills/agentforce-development/references/agent-user-setup.md +526 -0
- package/skills/agentforce-development/references/agent-validation-and-debugging.md +803 -0
- package/skills/agentforce-development/references/known-issues.md +353 -0
- package/skills/agentforce-development/references/minimal-examples.md +67 -0
- package/skills/agentforce-development/references/production-gotchas.md +279 -0
- package/skills/agentforce-development/references/salesforce-cli-for-agents.md +393 -0
- package/skills/agentforce-development/references/version-history.md +23 -0
- package/skills/building-webapp-data-visualization/SKILL.md +72 -0
- package/skills/building-webapp-data-visualization/implementation/bar-line-chart.md +316 -0
- package/skills/building-webapp-data-visualization/implementation/dashboard-layout.md +189 -0
- package/skills/building-webapp-data-visualization/implementation/donut-chart.md +181 -0
- package/skills/building-webapp-data-visualization/implementation/stat-card.md +150 -0
- package/skills/building-webapp-react-components/SKILL.md +96 -0
- package/skills/building-webapp-react-components/implementation/component.md +78 -0
- package/skills/building-webapp-react-components/implementation/header-footer.md +132 -0
- package/skills/building-webapp-react-components/implementation/page.md +93 -0
- package/skills/configuring-webapp-csp-trusted-sites/SKILL.md +90 -0
- package/skills/configuring-webapp-csp-trusted-sites/implementation/metadata-format.md +281 -0
- package/skills/configuring-webapp-metadata/SKILL.md +158 -0
- package/skills/creating-webapp/SKILL.md +141 -0
- package/skills/deploying-webapp-to-salesforce/SKILL.md +229 -0
- package/skills/exploring-webapp-graphql-schema/SKILL.md +149 -0
- package/skills/fetching-webapp-rest-api/SKILL.md +167 -0
- package/skills/{salesforce-custom-application → generating-custom-application}/SKILL.md +2 -4
- package/skills/{salesforce-custom-field → generating-custom-field}/SKILL.md +1 -5
- package/skills/{salesforce-custom-lightning-type → generating-custom-lightning-type}/SKILL.md +36 -2
- package/skills/{salesforce-custom-object → generating-custom-object}/SKILL.md +1 -1
- package/skills/generating-custom-tab/SKILL.md +154 -0
- package/skills/generating-experience-lwr-site/SKILL.md +196 -0
- package/skills/generating-experience-lwr-site/docs/bootstrap-template-byo-lwr.md +224 -0
- package/skills/generating-experience-lwr-site/docs/configure-content-brandingSet.md +131 -0
- package/skills/generating-experience-lwr-site/docs/configure-content-route.md +232 -0
- package/skills/generating-experience-lwr-site/docs/configure-content-themeLayout.md +141 -0
- package/skills/generating-experience-lwr-site/docs/configure-content-view.md +233 -0
- package/skills/generating-experience-lwr-site/docs/configure-guest-sharing-rules.md +42 -0
- package/skills/generating-experience-lwr-site/docs/handle-component-and-region-ids.md +27 -0
- package/skills/generating-experience-lwr-site/docs/handle-ui-components.md +215 -0
- package/skills/generating-experience-react-site/SKILL.md +67 -0
- package/skills/generating-experience-react-site/docs/configure-metadata-custom-site.md +41 -0
- package/skills/generating-experience-react-site/docs/configure-metadata-digital-experience-bundle.md +17 -0
- package/skills/generating-experience-react-site/docs/configure-metadata-digital-experience-config.md +21 -0
- package/skills/generating-experience-react-site/docs/configure-metadata-digital-experience.md +38 -0
- package/skills/generating-experience-react-site/docs/configure-metadata-network.md +72 -0
- package/skills/{salesforce-flexipage → generating-flexipage}/SKILL.md +86 -9
- package/skills/{salesforce-flow → generating-flow}/SKILL.md +3 -3
- package/skills/generating-fragment/SKILL.md +117 -0
- package/skills/generating-lightning-app/SKILL.md +423 -0
- package/skills/{salesforce-list-view → generating-list-view}/SKILL.md +1 -1
- package/skills/generating-permission-set/SKILL.md +174 -0
- package/skills/{salesforce-validation-rule → generating-validation-rule}/SKILL.md +1 -1
- package/skills/generating-webapp-graphql-mutation-query/SKILL.md +258 -0
- package/skills/generating-webapp-graphql-read-query/SKILL.md +253 -0
- package/skills/implementing-webapp-file-upload/SKILL.md +396 -0
- package/skills/installing-webapp-features/SKILL.md +210 -0
- package/skills/managing-webapp-agentforce-conversation-client/SKILL.md +186 -0
- package/skills/managing-webapp-agentforce-conversation-client/references/constraints.md +134 -0
- package/skills/managing-webapp-agentforce-conversation-client/references/examples.md +132 -0
- package/skills/managing-webapp-agentforce-conversation-client/references/style-tokens.md +101 -0
- package/skills/managing-webapp-agentforce-conversation-client/references/troubleshooting.md +57 -0
- package/skills/switching-org/SKILL.md +28 -0
- package/skills/using-webapp-graphql/SKILL.md +324 -0
- package/skills/using-webapp-graphql/shared-schema.graphqls +1150 -0
- package/skills/apex-class/SKILL.md +0 -253
- package/skills/apex-class/examples/AccountDeduplicationBatch.cls +0 -148
- package/skills/apex-class/examples/AccountSelector.cls +0 -193
- package/skills/apex-class/examples/AccountService.cls +0 -201
- package/skills/apex-class/templates/abstract.cls +0 -128
- package/skills/apex-class/templates/batch.cls +0 -125
- package/skills/apex-class/templates/domain.cls +0 -102
- package/skills/apex-class/templates/dto.cls +0 -108
- package/skills/apex-class/templates/exception.cls +0 -51
- package/skills/apex-class/templates/interface.cls +0 -25
- package/skills/apex-class/templates/queueable.cls +0 -92
- package/skills/apex-class/templates/schedulable.cls +0 -75
- package/skills/apex-class/templates/selector.cls +0 -92
- package/skills/apex-class/templates/service.cls +0 -69
- package/skills/apex-class/templates/utility.cls +0 -97
- package/skills/apex-test-class/SKILL.md +0 -101
- package/skills/apex-test-class/references/assertion-patterns.md +0 -209
- package/skills/apex-test-class/references/async-testing.md +0 -276
- package/skills/apex-test-class/references/mocking-patterns.md +0 -219
- package/skills/apex-test-class/references/test-data-factory.md +0 -176
- package/skills/deployment-readiness-check/SKILL.md +0 -257
- package/skills/deployment-readiness-check/assets/deployment_checklist.md +0 -286
- package/skills/deployment-readiness-check/references/rollback_procedures.md +0 -308
- package/skills/deployment-readiness-check/scripts/check_metadata.sh +0 -207
- package/skills/salesforce-custom-tab/SKILL.md +0 -78
- package/skills/salesforce-experience-site/SKILL.md +0 -178
- package/skills/salesforce-fragment/SKILL.md +0 -42
- package/skills/salesforce-lightning-app-build/SKILL.md +0 -254
- package/skills/salesforce-web-app-creating-records/SKILL.md +0 -84
- package/skills/salesforce-web-app-feature/SKILL.md +0 -70
- package/skills/salesforce-web-app-list-and-create-records/SKILL.md +0 -36
- package/skills/salesforce-web-application/SKILL.md +0 -34
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fetching-webapp-rest-api
|
|
3
|
+
description: REST API usage via the Data SDK fetch method. Use when implementing Chatter, Connect REST, Apex REST, UI API REST, or Einstein LLM calls — only when GraphQL is not sufficient.
|
|
4
|
+
paths:
|
|
5
|
+
- "**/*.ts"
|
|
6
|
+
- "**/*.tsx"
|
|
7
|
+
- "**/*.graphql"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Salesforce REST API via Data SDK Fetch
|
|
11
|
+
|
|
12
|
+
Use `sdk.fetch` from the Data SDK when GraphQL is not sufficient. The SDK applies authentication, CSRF handling, and base URL resolution. **Always use optional chaining** (`sdk.fetch?.()`) and handle the case where `fetch` is not available.
|
|
13
|
+
|
|
14
|
+
Invoke this skill when you need to call Chatter, Connect REST, Apex REST, UI API REST, or Einstein LLM endpoints.
|
|
15
|
+
|
|
16
|
+
## API Version
|
|
17
|
+
|
|
18
|
+
Use the project's API version. It is typically injected as `__SF_API_VERSION__`; fallback to `"65.0"`:
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
declare const __SF_API_VERSION__: string;
|
|
22
|
+
const API_VERSION = typeof __SF_API_VERSION__ !== "undefined" ? __SF_API_VERSION__ : "65.0";
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Base Path
|
|
26
|
+
|
|
27
|
+
URLs are relative to the Salesforce API base. The SDK prepends the correct base path. Use paths starting with `/services/...`.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Chatter API
|
|
32
|
+
|
|
33
|
+
User and collaboration data. No GraphQL equivalent.
|
|
34
|
+
|
|
35
|
+
| Endpoint | Method | Purpose |
|
|
36
|
+
| -------- | ------ | ------- |
|
|
37
|
+
| `/services/data/v{version}/chatter/users/me` | GET | Current user (id, name, email, username) |
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
const sdk = await createDataSDK();
|
|
41
|
+
const response = await sdk.fetch?.(`/services/data/v${API_VERSION}/chatter/users/me`);
|
|
42
|
+
|
|
43
|
+
if (!response?.ok) throw new Error(`HTTP ${response?.status}`);
|
|
44
|
+
const data = await response.json();
|
|
45
|
+
return { id: data.id, name: data.name };
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Connect REST API
|
|
51
|
+
|
|
52
|
+
File and content operations.
|
|
53
|
+
|
|
54
|
+
| Endpoint | Method | Purpose |
|
|
55
|
+
| -------- | ------ | ------- |
|
|
56
|
+
| `/services/data/v{version}/connect/file/upload/config` | GET | Upload config (token, uploadUrl) for file uploads |
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
const sdk = await createDataSDK();
|
|
60
|
+
const configRes = await sdk.fetch?.(`/services/data/v${API_VERSION}/connect/file/upload/config`, {
|
|
61
|
+
method: "GET",
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
if (!configRes?.ok) throw new Error(`Failed to get upload config: ${configRes?.status}`);
|
|
65
|
+
const config = await configRes.json();
|
|
66
|
+
const { token, uploadUrl } = config;
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Apex REST
|
|
72
|
+
|
|
73
|
+
Custom Apex REST resources. Requires corresponding Apex classes in the org. CSRF protection is applied automatically for `services/apexrest` URLs.
|
|
74
|
+
|
|
75
|
+
| Endpoint | Method | Purpose |
|
|
76
|
+
| -------- | ------ | ------- |
|
|
77
|
+
| `/services/apexrest/auth/login` | POST | User login |
|
|
78
|
+
| `/services/apexrest/auth/register` | POST | User registration |
|
|
79
|
+
| `/services/apexrest/auth/forgot-password` | POST | Request password reset |
|
|
80
|
+
| `/services/apexrest/auth/reset-password` | POST | Reset password with token |
|
|
81
|
+
| `/services/apexrest/auth/change-password` | POST | Change password (authenticated) |
|
|
82
|
+
| `/services/apexrest/{resource}` | GET/POST | Custom Apex REST resources |
|
|
83
|
+
|
|
84
|
+
**Example (login):**
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
const sdk = await createDataSDK();
|
|
88
|
+
const response = await sdk.fetch?.("/services/apexrest/auth/login", {
|
|
89
|
+
method: "POST",
|
|
90
|
+
body: JSON.stringify({ email, password, startUrl: "/" }),
|
|
91
|
+
headers: { "Content-Type": "application/json", Accept: "application/json" },
|
|
92
|
+
});
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Apex REST paths do not include the API version.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## UI API (REST)
|
|
100
|
+
|
|
101
|
+
When GraphQL cannot cover the use case. **Prefer GraphQL** when possible.
|
|
102
|
+
|
|
103
|
+
| Endpoint | Method | Purpose |
|
|
104
|
+
| -------- | ------ | ------- |
|
|
105
|
+
| `/services/data/v{version}/ui-api/records/{recordId}` | GET | Fetch a single record |
|
|
106
|
+
|
|
107
|
+
```typescript
|
|
108
|
+
const sdk = await createDataSDK();
|
|
109
|
+
const response = await sdk.fetch?.(`/services/data/v${API_VERSION}/ui-api/records/${recordId}`);
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Einstein LLM Gateway
|
|
115
|
+
|
|
116
|
+
AI features. Requires Einstein API setup.
|
|
117
|
+
|
|
118
|
+
| Endpoint | Method | Purpose |
|
|
119
|
+
| -------- | ------ | ------- |
|
|
120
|
+
| `/services/data/v{version}/einstein/llm/prompt/generations` | POST | Generate text from Einstein LLM |
|
|
121
|
+
|
|
122
|
+
```typescript
|
|
123
|
+
const sdk = await createDataSDK();
|
|
124
|
+
const response = await sdk.fetch?.(`/services/data/v${API_VERSION}/einstein/llm/prompt/generations`, {
|
|
125
|
+
method: "POST",
|
|
126
|
+
headers: { "Content-Type": "application/json" },
|
|
127
|
+
body: JSON.stringify({
|
|
128
|
+
additionalConfig: { applicationName: "PromptTemplateGenerationsInvocable" },
|
|
129
|
+
promptTextorId: prompt,
|
|
130
|
+
}),
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
if (!response?.ok) throw new Error(`Einstein LLM failed (${response?.status})`);
|
|
134
|
+
const data = await response.json();
|
|
135
|
+
return data?.generations?.[0]?.text ?? "";
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## General Pattern
|
|
141
|
+
|
|
142
|
+
```typescript
|
|
143
|
+
import { createDataSDK } from "@salesforce/sdk-data";
|
|
144
|
+
|
|
145
|
+
const sdk = await createDataSDK();
|
|
146
|
+
|
|
147
|
+
if (!sdk.fetch) {
|
|
148
|
+
throw new Error("Data SDK fetch is not available in this context");
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const response = await sdk.fetch(url, {
|
|
152
|
+
method: "GET", // or POST, PUT, PATCH, DELETE
|
|
153
|
+
headers: { "Content-Type": "application/json", Accept: "application/json" },
|
|
154
|
+
body: method !== "GET" ? JSON.stringify(payload) : undefined,
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
|
158
|
+
const data = await response.json();
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Reference
|
|
164
|
+
|
|
165
|
+
- Parent: `accessing-data` — enforces Data SDK usage for all Salesforce data fetches
|
|
166
|
+
- GraphQL: `using-graphql` — use for record queries and mutations when possible
|
|
167
|
+
- `createRecord` from `@salesforce/webapp-experimental/api` for UI API record creation (uses SDK internally)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
2
|
+
name: generating-custom-application
|
|
3
3
|
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.
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -11,7 +11,6 @@ Use this skill when you need to:
|
|
|
11
11
|
- Configure application navigation and branding
|
|
12
12
|
- Set up custom page layouts for objects
|
|
13
13
|
- Troubleshoot deployment errors related to custom applications
|
|
14
|
-
|
|
15
14
|
# CustomApplication (Lightning App) Metadata Specification
|
|
16
15
|
|
|
17
16
|
## Overview
|
|
@@ -43,7 +42,7 @@ Custom applications (Lightning Apps) that group tabs and functionality to provid
|
|
|
43
42
|
- **description**: Brief description of the application's purpose
|
|
44
43
|
- **tabs**: Array of tab names to include
|
|
45
44
|
- **utilityBar**: API name of the Utility Bar configuration
|
|
46
|
-
- **brand**: ⚠️ HIGHLY RECOMMENDED - Branding configuration object (headerColor, shouldOverrideOrgTheme, footerColor
|
|
45
|
+
- **brand**: ⚠️ HIGHLY RECOMMENDED - Branding configuration object (headerColor, shouldOverrideOrgTheme, footerColor)
|
|
47
46
|
- **actionOverrides**: ⚠️ REQUIRED when custom record pages exist - Action override configuration (actionName, content, formFactor, type, pageOrSobjectType)
|
|
48
47
|
- **profileActionOverrides**: Profile-specific action overrides (actionName, content, formFactor, pageOrSobjectType, type, profile)
|
|
49
48
|
- **isNavAutoTempTabsDisabled**: Navigation behavior setting (default: false)
|
|
@@ -86,7 +85,6 @@ Custom applications (Lightning Apps) that group tabs and functionality to provid
|
|
|
86
85
|
- **brand.headerColor**: Header bar color in hex format (e.g., "#0070D2") - RECOMMENDED
|
|
87
86
|
- **brand.shouldOverrideOrgTheme**: Override organization theme (true/false) - Default: false
|
|
88
87
|
- **brand.footerColor**: Footer color in hex format
|
|
89
|
-
- **brand.primaryTabColor**: Primary tab color in hex format
|
|
90
88
|
|
|
91
89
|
### Action Overrides (CRITICAL - DO NOT SKIP)
|
|
92
90
|
**IMPORTANT**: Action overrides MUST be created for every custom object tab that has a record page generated by flexipage expert.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
2
|
+
name: generating-custom-field
|
|
3
3
|
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.
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -42,10 +42,6 @@ Every generated field must include these tags:
|
|
|
42
42
|
| `<description>` | Mandatory | State the business "why" behind the field |
|
|
43
43
|
| `<inlineHelpText>` | Mandatory | Provide actionable guidance for the end-user. Must add value beyond the label (e.g., "Enter the value in USD including tax" instead of just "The amount") |
|
|
44
44
|
|
|
45
|
-
### XML Comments — NEVER Before Root Element
|
|
46
|
-
|
|
47
|
-
**NEVER place XML comments (`<!-- ... -->`) before the root `<CustomField>` element in metadata XML files.** Comments between the XML declaration and `<CustomField>` cause a `ConversionError` during deployment. Comments inside the root element are safe.
|
|
48
|
-
|
|
49
45
|
### External ID Configuration
|
|
50
46
|
|
|
51
47
|
**Trigger:** If the user mentions "integration," "importing data," "external system ID," or "unique key from [System Name]," set `<externalId>true</externalId>`.
|
package/skills/{salesforce-custom-lightning-type → generating-custom-lightning-type}/SKILL.md
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
2
|
+
name: generating-custom-lightning-type
|
|
3
3
|
description: Use this skill when users need to create Custom Lightning Types (CLTs) for Einstein Agent actions or structured input/output schemas. Trigger when users mention CLT, Custom Lightning Types, JSON schemas for agents, type definitions, lightning__objectType, or editor/renderer configurations. This is complex - always use this skill for CLT work.
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -103,9 +103,11 @@ When strict validation is enabled (`unevaluatedProperties: false`), keep each pr
|
|
|
103
103
|
- Top-level `editor` object.
|
|
104
104
|
- Use `editor.componentOverrides` for component overrides.
|
|
105
105
|
- Use `editor.layout` for layout.
|
|
106
|
+
- **DEPRECATED**: Do NOT use `propertyRenderers` or `view` — these are legacy keys. Always use `componentOverrides` and `layout` instead.
|
|
106
107
|
- **Root override pattern** (most common for fully custom editing UI):
|
|
107
108
|
- `editor.componentOverrides["$"] = { "definition": "c/<yourEditorComponent>", "attributes": { ... } }`
|
|
108
109
|
- When passing schema data into a custom LWC, use attribute mapping with the `{!$attrs.<name>}` syntax: e.g. `"attributes": { "myField": "{!$attrs.value}" }` so the runtime binds schema values to your component's attributes.
|
|
110
|
+
- **CRITICAL**: The `<name>` in `{!$attrs.<name>}` must be a property defined in your type schema. For example, if your schema has a property called `temperature`, use `{!$attrs.temperature}`, not `{!$attrs.value}` unless `value` is an actual property.
|
|
109
111
|
- **Property-level override pattern** (for individual fields):
|
|
110
112
|
- `editor.componentOverrides["<propertyName>"] = { "definition": "es_property_editors/<...>" }`
|
|
111
113
|
- **Valid editor components** (examples): `es_property_editors/inputText`, `es_property_editors/inputNumber`, `es_property_editors/inputRichText`, `es_property_editors/inputImage`, `es_property_editors/inputTextarea`. **Do not use** `es_property_editors/inputList`.
|
|
@@ -113,6 +115,7 @@ When strict validation is enabled (`unevaluatedProperties: false`), keep each pr
|
|
|
113
115
|
- **Layout pattern**:
|
|
114
116
|
- `editor.layout.definition = "lightning/verticalLayout"`
|
|
115
117
|
- `editor.layout.children[*].definition = "lightning/propertyLayout"` with `attributes.property = "<propertyName>"`
|
|
118
|
+
- **CRITICAL**: `lightning/propertyLayout` only accepts the `property` attribute. Do NOT add `label`, `title`, or any other attributes — these will fail validation with `additionalProperties: false` errors.
|
|
116
119
|
- **Avoid known-invalid patterns**:
|
|
117
120
|
- Do not use `es_property_editors/inputList`.
|
|
118
121
|
- Do not use `itemSchema` attributes.
|
|
@@ -121,18 +124,41 @@ When strict validation is enabled (`unevaluatedProperties: false`), keep each pr
|
|
|
121
124
|
- Top-level `renderer` object.
|
|
122
125
|
- Use `renderer.componentOverrides` for component overrides.
|
|
123
126
|
- Use `renderer.layout` for layout.
|
|
127
|
+
- **DEPRECATED**: Do NOT use `propertyRenderers` or `view` — these are legacy keys. Always use `componentOverrides` and `layout` instead.
|
|
124
128
|
- **Root override pattern** (most common for fully custom rendering UI):
|
|
125
129
|
- `renderer.componentOverrides["$"] = { "definition": "c/<yourRendererComponent>", "attributes": { ... } }`
|
|
126
130
|
- Use `{!$attrs.<name>}` in attribute mappings when binding schema data to custom renderer component attributes.
|
|
131
|
+
- **CRITICAL**: Attribute mappings like `{!$attrs.propertyName}` must reference properties that **actually exist** in your type schema. Referencing non-existent properties will fail validation.
|
|
132
|
+
- **Type matching**: Attribute values must match the expected type for the component. For example, if a component expects a string attribute, passing an integer will fail validation.
|
|
127
133
|
- **Property-level override pattern**:
|
|
128
134
|
- `renderer.componentOverrides["<propertyName>"] = { "definition": "es_property_editors/outputText" | "es_property_editors/outputNumber" | "es_property_editors/outputImage" | ... }`. **Valid renderer components** (examples): `es_property_editors/outputText`, `es_property_editors/outputNumber`, `es_property_editors/outputImage`. Avoid input-style components in the renderer.
|
|
135
|
+
- **Layout pattern for renderer**:
|
|
136
|
+
- `renderer.layout.definition = "lightning/verticalLayout"`
|
|
137
|
+
- `renderer.layout.children[*].definition = "lightning/propertyLayout"` with `attributes.property = "<propertyName>"`
|
|
138
|
+
- **CRITICAL**: Same as editor layouts, `lightning/propertyLayout` only accepts the `property` attribute. Do NOT add `label`, `title`, or any other attributes.
|
|
129
139
|
- **Collection renderer** (for root-level `lightning__listType` properties): Use `collection.renderer.componentOverrides["$"] = { "definition": "c/<yourListRendererComponent>" }` or `es_property_editors/genericListTypeRenderer` to render the list.
|
|
130
140
|
5. **Place files in the correct bundle structure**
|
|
131
141
|
- `lightningTypes/<TypeName>/schema.json`
|
|
132
142
|
- (Optional) `lightningTypes/<TypeName>/lightningDesktopGenAi/editor.json`
|
|
133
143
|
- (Optional) `lightningTypes/<TypeName>/lightningDesktopGenAi/renderer.json`
|
|
134
144
|
- For Gen AI / Copilot the standard path is `lightningDesktopGenAi/`. Other targets (e.g. Experience Builder, Mobile Copilot, Enhanced Web Chat) use different subfolders when supported: `experienceBuilder/`, `lightningMobileGenAi/`, `enhancedWebChat/`.
|
|
135
|
-
6. **
|
|
145
|
+
6. **Configure custom LWC components (if using custom components)**
|
|
146
|
+
- **CRITICAL**: Custom LWC components referenced in editor/renderer configs MUST have the correct target configuration in their `-meta.xml` files:
|
|
147
|
+
- **For editor components** (`c/<componentName>` used in `editor.json`): The LWC's `-meta.xml` file must include `<target>lightning__AgentforceInput</target>`
|
|
148
|
+
- **For renderer components** (`c/<componentName>` used in `renderer.json`): The LWC's `-meta.xml` file must include `<target>lightning__AgentforceOutput</target>`
|
|
149
|
+
- Without the correct target, deployment will fail with: `Invalid target configuration. To use 'c/componentName' as a renderer/editor, your js-meta.xml file must include valid target 'lightning__AgentforceOutput/Input'.`
|
|
150
|
+
- Example `-meta.xml` for a renderer component:
|
|
151
|
+
```xml
|
|
152
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
153
|
+
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
154
|
+
<apiVersion>60.0</apiVersion>
|
|
155
|
+
<isExposed>true</isExposed>
|
|
156
|
+
<targets>
|
|
157
|
+
<target>lightning__AgentforceOutput</target>
|
|
158
|
+
</targets>
|
|
159
|
+
</LightningComponentBundle>
|
|
160
|
+
```
|
|
161
|
+
7. **Deploy and validate**
|
|
136
162
|
- Deploy the bundle using your org's standard metadata deployment flow (e.g. Salesforce CLI or IDE). The MCP client or tooling in use should provide or integrate with the appropriate deploy/retrieve commands for Lightning Type bundles.
|
|
137
163
|
- Validate incrementally: if deployment fails, remove disallowed keywords first (especially `examples`, `items`, nested `lightning:type`).
|
|
138
164
|
|
|
@@ -144,6 +170,11 @@ When strict validation is enabled (`unevaluatedProperties: false`), keep each pr
|
|
|
144
170
|
| Array property rejected | Use of `items` (or `lightning:type` in nested arrays) rejected by validator | For nested arrays: keep only `type: "array"`. For root arrays: use minimal structure; remove `items` if rejected |
|
|
145
171
|
| Apex-based CLT rejected | Extra fields added (e.g., `type`, `properties`) | Use only `title`, optional `description`, and `lightning:type` |
|
|
146
172
|
| Editor config rejected | Use of invalid patterns (`es_property_editors/inputList`, `itemSchema`) or unrecognized top-level keys | Use `editor.componentOverrides` and `editor.layout`; keep config minimal |
|
|
173
|
+
| `additionalProperties` error on layout attributes | Adding `label` or other attributes to `lightning/propertyLayout` | Only use `property` attribute in `lightning/propertyLayout`. Remove `label`, `title`, or any other attributes |
|
|
174
|
+
| Invalid target configuration for custom LWC | Custom LWC component's `-meta.xml` missing required target (`lightning__AgentforceInput` or `lightning__AgentforceOutput`) | Add correct target to LWC's `-meta.xml`: use `lightning__AgentforceInput` for editors, `lightning__AgentforceOutput` for renderers |
|
|
175
|
+
| Attribute mapping doesn't exist in type schema | Using `{!$attrs.propertyName}` where `propertyName` is not defined in schema | Ensure all attribute mappings reference actual properties in your type schema's `properties` section |
|
|
176
|
+
| `additionalProperties` error with deprecated keys | Using `propertyRenderers` or `view` in editor/renderer config | Replace deprecated `propertyRenderers` with `componentOverrides` and `view` with `layout` |
|
|
177
|
+
| Type mismatch in component attributes | Passing wrong type for component attribute (e.g., integer instead of string) | Ensure attribute values match the expected type defined by the component |
|
|
147
178
|
|
|
148
179
|
## Verification Checklist
|
|
149
180
|
- [ ] Root schema has `type: "object"`, `title`, `lightning:type: "lightning__objectType"`, and `unevaluatedProperties: false`
|
|
@@ -155,3 +186,6 @@ When strict validation is enabled (`unevaluatedProperties: false`), keep each pr
|
|
|
155
186
|
- [ ] Bundle structure and filenames match Lightning Types requirements
|
|
156
187
|
- [ ] Editor config uses only allowed patterns (no `es_property_editors/inputList`, no `itemSchema`); use valid components (e.g. `es_property_editors/inputText`, `es_property_editors/inputNumber`) or custom `c/` components
|
|
157
188
|
- [ ] Renderer config uses output-style components (e.g. `es_property_editors/outputText`, `es_property_editors/outputNumber`) where applicable, not input editors
|
|
189
|
+
- [ ] Layout configurations use `lightning/propertyLayout` with ONLY the `property` attribute (no `label`, `title`, or other attributes)
|
|
190
|
+
- [ ] All attribute mappings (`{!$attrs.propertyName}`) reference properties that exist in the type schema
|
|
191
|
+
- [ ] Custom LWC components have correct targets in `-meta.xml`: `lightning__AgentforceInput` for editors, `lightning__AgentforceOutput` for renderers
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
2
|
+
name: generating-custom-object
|
|
3
3
|
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.
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: generating-custom-tab
|
|
3
|
+
description: Use this skill when users need to create or configure Salesforce Custom Tabs. Trigger when users mention tabs, navigation tabs, object tabs, web tabs, Visualforce tabs, Lightning component tabs, app page tabs, or tab configuration. Also use when users want to add navigation to custom objects, create tabs for external content, or set up Lightning page tabs. Always use this skill for any custom tab work.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## When to Use This Skill
|
|
7
|
+
|
|
8
|
+
Use this skill when you need to:
|
|
9
|
+
- Create tabs for objects, web pages, or Visualforce pages
|
|
10
|
+
- Add navigation tabs to applications
|
|
11
|
+
- Configure tab visibility and access
|
|
12
|
+
- Troubleshoot deployment errors related to custom tabs
|
|
13
|
+
|
|
14
|
+
## Specification
|
|
15
|
+
|
|
16
|
+
# CustomTab Metadata Specification
|
|
17
|
+
|
|
18
|
+
## 📋 Overview
|
|
19
|
+
Custom tabs for navigating to objects, web content, or Visualforce pages within Salesforce applications.
|
|
20
|
+
|
|
21
|
+
## 🎯 Purpose
|
|
22
|
+
- Provide navigation to custom objects
|
|
23
|
+
- Link to external web content
|
|
24
|
+
- Access Visualforce pages
|
|
25
|
+
- Organize application navigation
|
|
26
|
+
|
|
27
|
+
## ⚙️ Required Properties
|
|
28
|
+
|
|
29
|
+
### Core Tab Properties
|
|
30
|
+
- **customObject**: `true` for custom object tabs, `false` for all others.
|
|
31
|
+
- **motif**: Tab icon style — choose a motif that semantically matches the object's purpose. Do NOT reuse the same motif for every tab.
|
|
32
|
+
- **label**: Display name (required for non-object tabs ONLY; object tabs inherit label from the object)
|
|
33
|
+
- **url**: Web URL (for web tabs)
|
|
34
|
+
- **page**: Visualforce page name (for Visualforce tabs)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### 🚨 STRICT ELEMENT ALLOWLIST — READ THIS FIRST
|
|
38
|
+
|
|
39
|
+
**The root element MUST always be `<CustomTab>` (NOT `<Tab>`).** The XML namespace must be `xmlns="http://soap.sforce.com/2006/04/metadata"`.
|
|
40
|
+
|
|
41
|
+
Only the elements listed below are valid. **Any element not on this list WILL cause a deployment error.**
|
|
42
|
+
|
|
43
|
+
| Tab Type | ONLY these elements are allowed (nothing else) |
|
|
44
|
+
|---|---|
|
|
45
|
+
| **Object tabs** | `<customObject>` (required, set to `true`), `<motif>` (required), `<description>` (optional) |
|
|
46
|
+
| **Web tabs** | `<customObject>` (required, set to `false`), `<label>` (required), `<motif>` (required), `<url>` (required), `<urlEncodingKey>` (required, set to `UTF-8`), `<description>` (optional), `<frameHeight>` (optional) |
|
|
47
|
+
| **Visualforce tabs** | `<customObject>` (required, set to `false`), `<label>` (required), `<motif>` (required), `<page>` (required), `<description>` (optional) |
|
|
48
|
+
|
|
49
|
+
### ⚠️ FORBIDDEN ELEMENTS (every one of these causes a deployment error)
|
|
50
|
+
`<sobjectName>`, `<name>`, `<fullName>`, `<apiVersion>`, `<isHidden>`, `<tabVisibility>`, `<type>`, `<mobileReady>`, `<urlFrameHeight>`, `<urlType>`, `<urlRedirect>`, `<encodingKey>`, `<height>`, `<auraComponent>`
|
|
51
|
+
|
|
52
|
+
Also forbidden:
|
|
53
|
+
- `<label>` on object tabs (object tabs inherit their label from the custom object)
|
|
54
|
+
- `<page>` on web tabs (only for Visualforce tabs)
|
|
55
|
+
- Empty elements like `<page></page>` or `<description></description>`
|
|
56
|
+
- Any element not in the allowlist table above
|
|
57
|
+
|
|
58
|
+
## 🔧 Tab Types
|
|
59
|
+
|
|
60
|
+
### Object Tabs
|
|
61
|
+
- **Purpose**: Navigate to custom or standard objects
|
|
62
|
+
- **File name** determines the object: `{ObjectApiName}.tab-meta.xml` (e.g., `Space_Station__c.tab-meta.xml`)
|
|
63
|
+
- **Required elements**: `<customObject>true</customObject>` and `<motif>`
|
|
64
|
+
- **Correct example** (for a Space_Station__c.tab-meta.xml):
|
|
65
|
+
```xml
|
|
66
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
67
|
+
<CustomTab xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
68
|
+
<customObject>true</customObject>
|
|
69
|
+
<motif>Custom39: Telescope</motif>
|
|
70
|
+
</CustomTab>
|
|
71
|
+
```
|
|
72
|
+
- **Correct example** (for a Supply__c.tab-meta.xml — note different motif):
|
|
73
|
+
```xml
|
|
74
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
75
|
+
<CustomTab xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
76
|
+
<customObject>true</customObject>
|
|
77
|
+
<motif>Custom98: Truck</motif>
|
|
78
|
+
</CustomTab>
|
|
79
|
+
```
|
|
80
|
+
- **❌ WRONG** — do NOT add `<sobjectName>`, `<name>`, `<fullName>`, or `<label>`:
|
|
81
|
+
```xml
|
|
82
|
+
<CustomTab xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
83
|
+
<sobjectName>Space_Station__c</sobjectName> <!-- DEPLOYMENT ERROR -->
|
|
84
|
+
<label>Space Station</label> <!-- DEPLOYMENT ERROR on object tabs -->
|
|
85
|
+
<customObject>true</customObject>
|
|
86
|
+
<motif>Custom57: Desert</motif>
|
|
87
|
+
</CustomTab>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Web Tabs
|
|
91
|
+
- **Purpose**: Link to external websites or web applications
|
|
92
|
+
- **File name**: Use a descriptive name: `{TabName}.tab-meta.xml` (e.g., `Knowledge_Base.tab-meta.xml`)
|
|
93
|
+
- **COPY THIS EXACT TEMPLATE** — only replace the placeholder values. Do NOT add, remove, or rename any XML elements:
|
|
94
|
+
```xml
|
|
95
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
96
|
+
<CustomTab xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
97
|
+
<customObject>false</customObject>
|
|
98
|
+
<description>REPLACE_WITH_DESCRIPTION</description>
|
|
99
|
+
<frameHeight>600</frameHeight>
|
|
100
|
+
<label>REPLACE_WITH_LABEL</label>
|
|
101
|
+
<motif>REPLACE_WITH_MOTIF</motif>
|
|
102
|
+
<url>REPLACE_WITH_URL</url>
|
|
103
|
+
<urlEncodingKey>UTF-8</urlEncodingKey>
|
|
104
|
+
</CustomTab>
|
|
105
|
+
```
|
|
106
|
+
- **These 7 elements above are the ONLY elements allowed in a web tab file.** Do not add ANY other elements.
|
|
107
|
+
- The `<description>` element is optional — you may remove it if not needed, but do not add anything else.
|
|
108
|
+
|
|
109
|
+
### Visualforce Tabs
|
|
110
|
+
- **Purpose**: Access custom Visualforce pages
|
|
111
|
+
- **File name**: `{TabName}.tab-meta.xml` (e.g., `Custom_Page_Tab.tab-meta.xml`)
|
|
112
|
+
- **Required elements**: `<customObject>false</customObject>`, `<label>`, `<motif>`, `<page>`
|
|
113
|
+
- **Correct example**:
|
|
114
|
+
```xml
|
|
115
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
116
|
+
<CustomTab xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
117
|
+
<customObject>false</customObject>
|
|
118
|
+
<label>Custom Page</label>
|
|
119
|
+
<motif>Custom46: Computer</motif>
|
|
120
|
+
<page>CustomPage</page>
|
|
121
|
+
</CustomTab>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## 🎨 Tab Configuration
|
|
125
|
+
|
|
126
|
+
### Tab Style
|
|
127
|
+
- **Default**: Use standard tab styling
|
|
128
|
+
- **Custom**: Can specify custom tab styles if needed
|
|
129
|
+
|
|
130
|
+
### Tab Visibility
|
|
131
|
+
- **Default**: Visible to all users with access
|
|
132
|
+
- **Custom**: Can be configured for specific user profiles
|
|
133
|
+
|
|
134
|
+
## 📱 Supported Applications
|
|
135
|
+
- **Standard Apps**: Available in standard Salesforce applications
|
|
136
|
+
- **Custom Apps**: Can be included in custom applications
|
|
137
|
+
- **Community Apps**: Available in community applications
|
|
138
|
+
|
|
139
|
+
## 🔗 Integration Points
|
|
140
|
+
- **Object Relationships**: Links to related object records
|
|
141
|
+
- **Web Content**: External website integration
|
|
142
|
+
- **Visualforce Pages**: Custom page functionality
|
|
143
|
+
- **Lightning Components**: Modern component integration
|
|
144
|
+
## ✅ Best Practices
|
|
145
|
+
- Use clear, descriptive tab labels
|
|
146
|
+
- Choose appropriate tab types for functionality
|
|
147
|
+
- **Select a unique, contextually relevant motif for each tab** — do not default every tab to the same icon
|
|
148
|
+
- Consider user experience and navigation flow
|
|
149
|
+
- Test tab functionality across different applications
|
|
150
|
+
- Ensure proper permissions and visibility settings
|
|
151
|
+
- Follow consistent naming conventions
|
|
152
|
+
- Object tab files MUST only contain `<customObject>true</customObject>` and `<motif>` — nothing else
|
|
153
|
+
- Web tab files MUST only contain: `<customObject>false</customObject>`, `<label>`, `<motif>`, `<url>`, `<urlEncodingKey>`, and optionally `<description>`, `<frameHeight>` — nothing else
|
|
154
|
+
- Never include `<isHidden>`, `<tabVisibility>`, `<type>`, `<mobileReady>`, or empty elements
|