@salesforce/afv-skills 1.7.3 → 1.7.5
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 +3 -3
- package/package.json +1 -1
- package/skills/developing-agentforce/README.md +4 -4
- package/skills/developing-agentforce/SKILL.md +37 -37
- package/skills/developing-agentforce/assets/README-legacy.md +8 -8
- package/skills/developing-agentforce/assets/agent-spec-template.md +9 -9
- package/skills/developing-agentforce/assets/agents/README.md +4 -4
- package/skills/developing-agentforce/assets/agents/hello-world.agent +3 -3
- package/skills/developing-agentforce/assets/agents/{multi-topic.agent → multi-subagent.agent} +30 -30
- package/skills/developing-agentforce/assets/agents/order-service.agent +25 -25
- package/skills/developing-agentforce/assets/agents/production-faq.agent +12 -12
- package/skills/developing-agentforce/assets/agents/simple-qa.agent +8 -8
- package/skills/developing-agentforce/assets/agents/verification-gate.agent +19 -19
- package/skills/developing-agentforce/assets/components/apex-action.agent +3 -3
- package/skills/developing-agentforce/assets/components/error-handling.agent +7 -7
- package/skills/developing-agentforce/assets/components/escalation-setup.agent +11 -11
- package/skills/developing-agentforce/assets/components/flow-action.agent +5 -5
- package/skills/developing-agentforce/assets/components/n-ary-conditions.agent +11 -11
- package/skills/developing-agentforce/assets/components/{topic-with-actions.agent → subagent-with-actions.agent} +9 -9
- package/skills/developing-agentforce/assets/deterministic-routing.agent +19 -19
- package/skills/developing-agentforce/assets/escalation-pattern.agent +13 -13
- package/skills/developing-agentforce/assets/flow-action-lookup.agent +3 -3
- package/skills/developing-agentforce/assets/hub-and-spoke.agent +18 -18
- package/skills/developing-agentforce/assets/local-info-agent-annotated.agent +37 -37
- package/skills/developing-agentforce/assets/metadata/genai-function-apex.xml +3 -3
- package/skills/developing-agentforce/assets/metadata/genai-function-flow.xml +1 -1
- package/skills/developing-agentforce/assets/metadata/genai-plugin.xml +10 -10
- package/skills/developing-agentforce/assets/minimal-starter.agent +4 -4
- package/skills/developing-agentforce/assets/patterns/README.md +21 -21
- package/skills/developing-agentforce/assets/patterns/action-callbacks.agent +4 -4
- package/skills/developing-agentforce/assets/patterns/advanced-input-bindings.agent +1 -1
- package/skills/developing-agentforce/assets/patterns/bidirectional-routing.agent +25 -25
- package/skills/developing-agentforce/assets/patterns/critical-input-collection.agent +8 -8
- package/skills/developing-agentforce/assets/patterns/delegation-routing.agent +21 -21
- package/skills/developing-agentforce/assets/patterns/lifecycle-events.agent +8 -8
- package/skills/developing-agentforce/assets/patterns/llm-controlled-actions.agent +5 -5
- package/skills/developing-agentforce/assets/patterns/multi-step-workflow.agent +3 -3
- package/skills/developing-agentforce/assets/patterns/open-gate-routing.agent +59 -58
- package/skills/developing-agentforce/assets/patterns/procedural-instructions.agent +15 -15
- package/skills/developing-agentforce/assets/patterns/prompt-template-action.agent +8 -8
- package/skills/developing-agentforce/assets/patterns/system-instruction-overrides.agent +40 -40
- package/skills/developing-agentforce/assets/prompt-rag-search.agent +9 -9
- package/skills/developing-agentforce/assets/{template-multi-topic.agent → template-multi-subagent.agent} +25 -25
- package/skills/developing-agentforce/assets/{template-single-topic.agent → template-single-subagent.agent} +14 -14
- package/skills/developing-agentforce/assets/verification-gate.agent +16 -16
- package/skills/developing-agentforce/references/action-prompt-templates.md +1 -1
- package/skills/developing-agentforce/references/actions-reference.md +4 -4
- package/skills/developing-agentforce/references/agent-design-and-spec-creation.md +107 -107
- package/skills/developing-agentforce/references/agent-metadata-and-lifecycle.md +5 -5
- package/skills/developing-agentforce/references/agent-script-core-language.md +79 -79
- package/skills/developing-agentforce/references/{agent-topic-map-diagrams.md → agent-subagent-map-diagrams.md} +65 -65
- package/skills/developing-agentforce/references/agent-user-setup.md +2 -2
- package/skills/developing-agentforce/references/agent-validation-and-debugging.md +55 -55
- package/skills/developing-agentforce/references/architecture-patterns.md +33 -33
- package/skills/developing-agentforce/references/deploy-reference.md +1 -1
- package/skills/developing-agentforce/references/discover-reference.md +1 -1
- package/skills/developing-agentforce/references/examples.md +32 -32
- package/skills/developing-agentforce/references/feature-validity.md +3 -3
- package/skills/developing-agentforce/references/instruction-resolution.md +29 -29
- package/skills/developing-agentforce/references/known-issues.md +10 -10
- package/skills/developing-agentforce/references/minimal-examples.md +6 -6
- package/skills/developing-agentforce/references/production-gotchas.md +22 -22
- package/skills/developing-agentforce/references/safety-review-reference.md +2 -2
- package/skills/developing-agentforce/references/scoring-rubric.md +3 -3
- package/skills/developing-datacloud-code-extension/SKILL.md +321 -0
- package/skills/developing-datacloud-code-extension/references/README.md +193 -0
- package/skills/developing-datacloud-code-extension/references/quick-reference.md +269 -0
- package/skills/generating-permission-set/SKILL.md +1 -1
- package/skills/getting-datacloud-schema/SKILL.md +380 -0
- package/skills/getting-datacloud-schema/references/README.md +191 -0
- package/skills/getting-datacloud-schema/scripts/get_dlo_schema.py +244 -0
- package/skills/getting-datacloud-schema/scripts/get_dmo_schema.py +233 -0
- package/skills/observing-agentforce/SKILL.md +8 -8
- package/skills/observing-agentforce/apex/AgentforceOptimizeService.cls +2 -2
- package/skills/observing-agentforce/references/improve-reference.md +40 -40
- package/skills/observing-agentforce/references/issue-classification.md +47 -47
- package/skills/observing-agentforce/references/reproduce-reference.md +7 -7
- package/skills/observing-agentforce/references/stdm-queries.md +7 -7
- package/skills/observing-agentforce/references/stdm-schema.md +2 -2
- package/skills/testing-agentforce/SKILL.md +9 -9
- package/skills/testing-agentforce/assets/basic-test-spec.yaml +4 -0
- package/skills/testing-agentforce/assets/guardrail-test-spec.yaml +4 -0
- package/skills/testing-agentforce/assets/standard-test-spec.yaml +8 -4
- package/skills/testing-agentforce/references/batch-testing.md +17 -17
- package/skills/testing-agentforce/references/preview-testing.md +25 -25
- package/skills/testing-agentforce/references/test-report-format.md +6 -6
- package/skills/trigger-refactor-pipeline/SKILL.md +0 -191
- package/skills/trigger-refactor-pipeline/assets/test_template.apex +0 -321
- package/skills/trigger-refactor-pipeline/references/handler_patterns.md +0 -442
- package/skills/trigger-refactor-pipeline/scripts/analyze_trigger.py +0 -258
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
# Data Cloud Code Extension - Quick Reference
|
|
2
|
+
|
|
3
|
+
## Command Cheat Sheet
|
|
4
|
+
|
|
5
|
+
### Initialize Project
|
|
6
|
+
```bash
|
|
7
|
+
# Create script project
|
|
8
|
+
sf data-code-extension script init --package-dir <directory>
|
|
9
|
+
|
|
10
|
+
# Create function project
|
|
11
|
+
sf data-code-extension function init --package-dir <directory>
|
|
12
|
+
|
|
13
|
+
# Examples
|
|
14
|
+
sf data-code-extension script init --package-dir .
|
|
15
|
+
sf data-code-extension script init --package-dir my-transform
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Scan for Permissions
|
|
19
|
+
```bash
|
|
20
|
+
# Basic scan
|
|
21
|
+
sf data-code-extension script scan --entrypoint ./payload/entrypoint.py
|
|
22
|
+
|
|
23
|
+
# Preview without saving
|
|
24
|
+
sf data-code-extension script scan --entrypoint ./payload/entrypoint.py --dry-run
|
|
25
|
+
|
|
26
|
+
# Custom config location
|
|
27
|
+
sf data-code-extension script scan --entrypoint ./payload/entrypoint.py --config ./custom-config.json
|
|
28
|
+
|
|
29
|
+
# Skip requirements.txt
|
|
30
|
+
sf data-code-extension script scan --entrypoint ./payload/entrypoint.py --no-requirements
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Run Locally
|
|
34
|
+
```bash
|
|
35
|
+
# Basic run
|
|
36
|
+
sf data-code-extension script run --entrypoint ./payload/entrypoint.py --target-org <org_alias>
|
|
37
|
+
|
|
38
|
+
# With custom config
|
|
39
|
+
sf data-code-extension script run --entrypoint ./payload/entrypoint.py -o <org_alias> -c custom-config.json
|
|
40
|
+
|
|
41
|
+
# Examples
|
|
42
|
+
sf data-code-extension script run --entrypoint ./payload/entrypoint.py --target-org afvibe
|
|
43
|
+
sf data-code-extension script run --entrypoint ./payload/entrypoint.py -o afvibe
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Deploy
|
|
47
|
+
```bash
|
|
48
|
+
# Minimal deployment (MUST include --package-dir ./payload)
|
|
49
|
+
sf data-code-extension script deploy \
|
|
50
|
+
--target-org <org_alias> \
|
|
51
|
+
--name <name> \
|
|
52
|
+
--package-version <version> \
|
|
53
|
+
--description "<description>" \
|
|
54
|
+
--package-dir ./payload
|
|
55
|
+
|
|
56
|
+
# Full options
|
|
57
|
+
sf data-code-extension script deploy \
|
|
58
|
+
--target-org <org_alias> \
|
|
59
|
+
--name <name> \
|
|
60
|
+
--package-version <version> \
|
|
61
|
+
--description "<description>" \
|
|
62
|
+
--cpu-size <CPU_L|CPU_XL|CPU_2XL|CPU_4XL> \
|
|
63
|
+
--package-dir ./payload
|
|
64
|
+
|
|
65
|
+
# Examples (CRITICAL: Always include --package-dir ./payload)
|
|
66
|
+
sf data-code-extension script deploy \
|
|
67
|
+
--target-org afvibe \
|
|
68
|
+
--name Employee_Upper \
|
|
69
|
+
--package-version 1.0.0 \
|
|
70
|
+
--description "Uppercase employee positions" \
|
|
71
|
+
--package-dir ./payload
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Common Workflows
|
|
75
|
+
|
|
76
|
+
### New Project from Scratch
|
|
77
|
+
```bash
|
|
78
|
+
# 1. Create directory
|
|
79
|
+
mkdir my-transform && cd my-transform
|
|
80
|
+
|
|
81
|
+
# 2. Initialize
|
|
82
|
+
sf data-code-extension script init --package-dir .
|
|
83
|
+
|
|
84
|
+
# 3. Edit payload/entrypoint.py with your transformation
|
|
85
|
+
|
|
86
|
+
# 4. Scan
|
|
87
|
+
sf data-code-extension script scan --entrypoint ./payload/entrypoint.py
|
|
88
|
+
|
|
89
|
+
# 5. Test
|
|
90
|
+
sf data-code-extension script run --entrypoint ./payload/entrypoint.py --target-org afvibe
|
|
91
|
+
|
|
92
|
+
# 6. Deploy (MUST include --package-dir ./payload)
|
|
93
|
+
sf data-code-extension script deploy \
|
|
94
|
+
--target-org afvibe \
|
|
95
|
+
--name MyTransform \
|
|
96
|
+
--package-version 1.0.0 \
|
|
97
|
+
--description "My transformation" \
|
|
98
|
+
--package-dir ./payload
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Update Existing Code Extension
|
|
102
|
+
```bash
|
|
103
|
+
# 1. Edit payload/entrypoint.py
|
|
104
|
+
|
|
105
|
+
# 2. Re-scan
|
|
106
|
+
sf data-code-extension script scan --entrypoint ./payload/entrypoint.py
|
|
107
|
+
|
|
108
|
+
# 3. Test
|
|
109
|
+
sf data-code-extension script run --entrypoint ./payload/entrypoint.py -o afvibe
|
|
110
|
+
|
|
111
|
+
# 4. Deploy with new version (include --package-dir ./payload)
|
|
112
|
+
sf data-code-extension script deploy \
|
|
113
|
+
-o afvibe \
|
|
114
|
+
-n MyTransform \
|
|
115
|
+
--package-version 1.1.0 \
|
|
116
|
+
--description "Updated transformation" \
|
|
117
|
+
--package-dir ./payload
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Python Code Patterns
|
|
121
|
+
|
|
122
|
+
### Read/Write DLO
|
|
123
|
+
```python
|
|
124
|
+
from datacustomcode import Client
|
|
125
|
+
|
|
126
|
+
client = Client()
|
|
127
|
+
|
|
128
|
+
# Read
|
|
129
|
+
df = client.read_dlo('Employee__dll')
|
|
130
|
+
|
|
131
|
+
# Transform
|
|
132
|
+
df['new_field'] = df['old_field'].str.upper()
|
|
133
|
+
|
|
134
|
+
# Write (modes: 'overwrite', 'append')
|
|
135
|
+
client.write_to_dlo('Output__dll', df, 'overwrite')
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Read/Write DMO
|
|
139
|
+
```python
|
|
140
|
+
# Read
|
|
141
|
+
df = client.read_dmo('EmployeeDMO')
|
|
142
|
+
|
|
143
|
+
# Write (modes: 'upsert', 'insert')
|
|
144
|
+
client.write_to_dmo('EmployeeDMO', df, 'upsert')
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Multiple DLO Operations
|
|
148
|
+
```python
|
|
149
|
+
# Read multiple
|
|
150
|
+
employees = client.read_dlo('Employee__dll')
|
|
151
|
+
departments = client.read_dlo('Department__dll')
|
|
152
|
+
|
|
153
|
+
# Join
|
|
154
|
+
merged = employees.merge(departments, on='dept_id')
|
|
155
|
+
|
|
156
|
+
# Write multiple
|
|
157
|
+
client.write_to_dlo('Enriched__dll', merged, 'overwrite')
|
|
158
|
+
client.write_to_dmo('EmployeeDMO', merged, 'upsert')
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Data Transformations
|
|
162
|
+
```python
|
|
163
|
+
import pandas as pd
|
|
164
|
+
|
|
165
|
+
# Filter
|
|
166
|
+
active = df[df['status'] == 'Active']
|
|
167
|
+
|
|
168
|
+
# Computed column
|
|
169
|
+
df['full_name'] = df['first'] + ' ' + df['last']
|
|
170
|
+
|
|
171
|
+
# Aggregate
|
|
172
|
+
summary = df.groupby('dept')['salary'].mean()
|
|
173
|
+
|
|
174
|
+
# Conditional
|
|
175
|
+
df['grade'] = df['position'].apply(
|
|
176
|
+
lambda x: 'Senior' if 'VP' in x else 'Junior'
|
|
177
|
+
)
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## Option Reference
|
|
181
|
+
|
|
182
|
+
### --cpu-size
|
|
183
|
+
- `CPU_L` - Small datasets (< 1M records)
|
|
184
|
+
- `CPU_XL` - Medium datasets (1M-5M)
|
|
185
|
+
- `CPU_2XL` - Large datasets (5M-10M) **[default]**
|
|
186
|
+
- `CPU_4XL` - Very large (> 10M records)
|
|
187
|
+
|
|
188
|
+
### Write Modes
|
|
189
|
+
- `overwrite` - Replace all data
|
|
190
|
+
- `append` - Add to existing data
|
|
191
|
+
- `upsert` - Update or insert (DMO only)
|
|
192
|
+
- `insert` - Insert only (DMO only)
|
|
193
|
+
|
|
194
|
+
## Troubleshooting Quick Fixes
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
# Plugin not found
|
|
198
|
+
sf plugins install @salesforce/plugin-data-codeextension
|
|
199
|
+
|
|
200
|
+
# Python SDK missing
|
|
201
|
+
pip install salesforce-data-customcode
|
|
202
|
+
|
|
203
|
+
# Verify Python version (must be 3.11.x)
|
|
204
|
+
python --version
|
|
205
|
+
|
|
206
|
+
# Org not connected
|
|
207
|
+
sf org login web --alias <org_alias>
|
|
208
|
+
|
|
209
|
+
# Config missing
|
|
210
|
+
sf data-code-extension script scan --entrypoint ./payload/entrypoint.py
|
|
211
|
+
|
|
212
|
+
# Docker not running (for deploy)
|
|
213
|
+
# Start Docker Desktop
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## File Structure
|
|
217
|
+
|
|
218
|
+
```
|
|
219
|
+
my-project/
|
|
220
|
+
├── payload/
|
|
221
|
+
│ ├── entrypoint.py # Main code
|
|
222
|
+
│ └── config.json # Auto-generated permissions
|
|
223
|
+
├── requirements.txt # Auto-generated dependencies
|
|
224
|
+
└── README.md
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
## config.json Format
|
|
228
|
+
|
|
229
|
+
```json
|
|
230
|
+
{
|
|
231
|
+
"version": "1.0",
|
|
232
|
+
"permissions": {
|
|
233
|
+
"read": ["Employee__dll", "Department__dll"],
|
|
234
|
+
"write": ["Enriched__dll"]
|
|
235
|
+
},
|
|
236
|
+
"resources": {
|
|
237
|
+
"cpu_size": "CPU_2XL"
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## Common Errors
|
|
243
|
+
|
|
244
|
+
| Error | Quick Fix |
|
|
245
|
+
|-------|-----------|
|
|
246
|
+
| Plugin not found | `sf plugins install @salesforce/plugin-data-codeextension` |
|
|
247
|
+
| Python SDK missing | `pip install salesforce-data-customcode` |
|
|
248
|
+
| Wrong Python version | Use pyenv to install 3.11.0 |
|
|
249
|
+
| Org not connected | `sf org login web --alias <alias>` |
|
|
250
|
+
| Config missing | Run scan command |
|
|
251
|
+
| DLO not found | Check DLO name, use getting-datacloud-schema skill |
|
|
252
|
+
| Docker error | Start Docker Desktop |
|
|
253
|
+
|
|
254
|
+
## Deployment Checklist
|
|
255
|
+
|
|
256
|
+
- [ ] Code written in entrypoint.py
|
|
257
|
+
- [ ] Scanned for permissions
|
|
258
|
+
- [ ] Tested locally
|
|
259
|
+
- [ ] Version number decided
|
|
260
|
+
- [ ] Description added
|
|
261
|
+
- [ ] CPU size chosen
|
|
262
|
+
- [ ] Docker running
|
|
263
|
+
- [ ] Org authenticated
|
|
264
|
+
|
|
265
|
+
## Resources
|
|
266
|
+
|
|
267
|
+
- Plugin: https://github.com/salesforcecli/plugin-data-code-extension
|
|
268
|
+
- Python SDK: https://github.com/forcedotcom/datacloud-customcode-python-sdk
|
|
269
|
+
- Data Cloud Docs: https://help.salesforce.com/s/articleView?id=sf.c360_a_intro.htm
|
|
@@ -3,7 +3,7 @@ name: generating-permission-set
|
|
|
3
3
|
description: "Generates correct, deployable Salesforce permission set metadata (PermissionSet XML) with object, field, user, and app permissions. Use this skill when creating or editing permission set metadata, object permissions, field-level security (FLS), tab visibility, or deploying permission sets."
|
|
4
4
|
compatibility: Salesforce Metadata API v60.0+
|
|
5
5
|
metadata:
|
|
6
|
-
author:
|
|
6
|
+
author: sf-skills
|
|
7
7
|
version: "1.0"
|
|
8
8
|
---
|
|
9
9
|
|
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: getting-datacloud-schema
|
|
3
|
+
description: "Retrieve Data Lake Object (DLO) and Data Model Object (DMO) schema information from Salesforce Data Cloud using REST APIs. Use this skill when you need to inspect DLO or DMO field definitions, data types, or metadata. Takes org alias and optional DLO/DMO name as parameters."
|
|
4
|
+
metadata:
|
|
5
|
+
version: "1.0"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# getting-datacloud-schema Skill
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
This skill retrieves Data Lake Object (DLO) and Data Model Object (DMO) schema information from Salesforce Data Cloud using the SSOT REST API. It can list all DLOs or DMOs in an org, or retrieve detailed schema for a specific DLO or DMO.
|
|
14
|
+
|
|
15
|
+
## When to Use
|
|
16
|
+
|
|
17
|
+
- User wants to see all DLOs or DMOs in a Data Cloud org
|
|
18
|
+
- User needs field schema for a specific DLO or DMO
|
|
19
|
+
- User is exploring Data Cloud data structures
|
|
20
|
+
- User needs to understand DLO or DMO field types and metadata
|
|
21
|
+
|
|
22
|
+
## Prerequisites
|
|
23
|
+
|
|
24
|
+
- SF CLI installed and authenticated to target org
|
|
25
|
+
- Org has Data Cloud enabled
|
|
26
|
+
- User has appropriate Data Cloud permissions
|
|
27
|
+
|
|
28
|
+
## Skill Execution
|
|
29
|
+
|
|
30
|
+
### Parameters
|
|
31
|
+
|
|
32
|
+
1. **org_alias** (required): The SF CLI org alias (e.g., 'afvibe', 'myorg')
|
|
33
|
+
2. **dlo_name** (optional): Specific DLO developer name (e.g., 'Employee__dll')
|
|
34
|
+
3. **dmo_name** (optional): Specific DMO developer name (e.g., 'Individual__dlm')
|
|
35
|
+
|
|
36
|
+
### Step 1: Discover Connected Org
|
|
37
|
+
|
|
38
|
+
First, run `sf org list` to find out which org is connected and extract the alias to use for all subsequent calls:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
sf org list
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Example output:
|
|
45
|
+
```
|
|
46
|
+
┌────┬───────┬──────────────────────────┬────────────────────┬───────────┐
|
|
47
|
+
│ │ Alias │ Username │ Org Id │ Status │
|
|
48
|
+
├────┼───────┼──────────────────────────┼────────────────────┼───────────┤
|
|
49
|
+
│ 🍁 │ myorg │ chandresh@afvidedemo.org │ 00DKZ00000b80NT2AY │ Connected │
|
|
50
|
+
└────┴───────┴──────────────────────────┴────────────────────┴───────────┘
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Extract the **Alias** value (e.g., `myorg`) from the output and use it as the `<org_alias>` for all subsequent calls. Use `--all` to see expired and deleted scratch orgs as well.
|
|
54
|
+
|
|
55
|
+
### Step 2: Validate SF CLI Authentication
|
|
56
|
+
|
|
57
|
+
Before making API calls, verify the org is connected:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
sf org display --target-org <org_alias> --json
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
If not connected, inform user to run:
|
|
64
|
+
```bash
|
|
65
|
+
sf org login web --alias <org_alias>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Step 3a: Execute DLO Schema Script
|
|
69
|
+
|
|
70
|
+
The Python scripts are bundled with this skill. They live in the `scripts/` subdirectory of the same directory that contains this SKILL.md file. Use the absolute path to that directory — do NOT use `./scripts/` as that resolves relative to the current working directory, not the skill directory.
|
|
71
|
+
|
|
72
|
+
**To list all DLOs:**
|
|
73
|
+
```bash
|
|
74
|
+
python3 <skill_dir>/scripts/get_dlo_schema.py <org_alias>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**To get specific DLO schema:**
|
|
78
|
+
```bash
|
|
79
|
+
python3 <skill_dir>/scripts/get_dlo_schema.py <org_alias> <dlo_name>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Step 3b: Execute DMO Schema Script
|
|
83
|
+
|
|
84
|
+
**To list all DMOs:**
|
|
85
|
+
```bash
|
|
86
|
+
python3 <skill_dir>/scripts/get_dmo_schema.py <org_alias>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**To get specific DMO schema:**
|
|
90
|
+
```bash
|
|
91
|
+
python3 <skill_dir>/scripts/get_dmo_schema.py <org_alias> <dmo_name>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Step 4: Present Results
|
|
95
|
+
|
|
96
|
+
Parse and present the results in a user-friendly format:
|
|
97
|
+
|
|
98
|
+
**For DLO List:**
|
|
99
|
+
- Show DLO name, label, category, and ID
|
|
100
|
+
- Indicate total count
|
|
101
|
+
- Highlight DLOs with data (totalRecords > 0)
|
|
102
|
+
|
|
103
|
+
**For DLO Schema:**
|
|
104
|
+
- Show basic info (name, label, category, status)
|
|
105
|
+
- List all fields with:
|
|
106
|
+
- Field name
|
|
107
|
+
- Data type
|
|
108
|
+
- Primary key indicator
|
|
109
|
+
- Nullable status
|
|
110
|
+
- Highlight custom fields (exclude system fields like DataSource__c, cdp_sys_*)
|
|
111
|
+
- Show record count if available
|
|
112
|
+
|
|
113
|
+
**For DMO List:**
|
|
114
|
+
- Show DMO name, label, category, and ID
|
|
115
|
+
- Indicate total count
|
|
116
|
+
|
|
117
|
+
**For DMO Schema:**
|
|
118
|
+
- Show basic info (name, label, category, description)
|
|
119
|
+
- List all fields with:
|
|
120
|
+
- Field name
|
|
121
|
+
- Data type
|
|
122
|
+
- Primary key indicator
|
|
123
|
+
- Nullable status
|
|
124
|
+
- Show dataspace information if available
|
|
125
|
+
|
|
126
|
+
### Step 5: Offer Next Steps
|
|
127
|
+
|
|
128
|
+
After displaying results, suggest relevant follow-up actions:
|
|
129
|
+
- Query data from the DLO
|
|
130
|
+
- Create calculated insights
|
|
131
|
+
- Build segments
|
|
132
|
+
- Set up data streams
|
|
133
|
+
- Create DMO mappings
|
|
134
|
+
|
|
135
|
+
## API Endpoints Used
|
|
136
|
+
|
|
137
|
+
### List All DLOs
|
|
138
|
+
```
|
|
139
|
+
GET /services/data/v64.0/ssot/data-lake-objects
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Response structure:
|
|
143
|
+
```json
|
|
144
|
+
{
|
|
145
|
+
"dataLakeObjects": [
|
|
146
|
+
{
|
|
147
|
+
"name": "Employee__dll",
|
|
148
|
+
"label": "Employee",
|
|
149
|
+
"category": "Profile",
|
|
150
|
+
"id": "1dlXXXXXXXXXXXXXXX",
|
|
151
|
+
"status": "ACTIVE",
|
|
152
|
+
"totalRecords": 12,
|
|
153
|
+
"fields": [...]
|
|
154
|
+
}
|
|
155
|
+
],
|
|
156
|
+
"totalSize": 5
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Get DLO Schema
|
|
161
|
+
```
|
|
162
|
+
GET /services/data/v64.0/ssot/data-lake-objects/{dlo_name}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Response structure (same as individual object in list response, but wrapped in paginated format).
|
|
166
|
+
|
|
167
|
+
### List All DMOs
|
|
168
|
+
```
|
|
169
|
+
GET /services/data/v64.0/ssot/data-model-objects
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Response structure:
|
|
173
|
+
```json
|
|
174
|
+
{
|
|
175
|
+
"dataModelObjects": [
|
|
176
|
+
{
|
|
177
|
+
"name": "Individual__dlm",
|
|
178
|
+
"label": "Individual",
|
|
179
|
+
"category": "Profile",
|
|
180
|
+
"id": "0dmXXXXXXXXXXXXXXX",
|
|
181
|
+
"fields": [...]
|
|
182
|
+
}
|
|
183
|
+
],
|
|
184
|
+
"totalSize": 10
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Get DMO Schema
|
|
189
|
+
```
|
|
190
|
+
GET /services/data/v64.0/ssot/data-model-objects/{dmo_name}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Response structure (same as individual object in list response, but wrapped in paginated format).
|
|
194
|
+
|
|
195
|
+
## Error Handling
|
|
196
|
+
|
|
197
|
+
**Common Issues:**
|
|
198
|
+
|
|
199
|
+
1. **Org not connected**
|
|
200
|
+
- Message: "Org not connected"
|
|
201
|
+
- Solution: Ask user to authenticate via SF CLI
|
|
202
|
+
|
|
203
|
+
2. **DLO not found**
|
|
204
|
+
- Message: "DLO 'XYZ__dll' not found"
|
|
205
|
+
- Solution: List all DLOs first to verify name
|
|
206
|
+
|
|
207
|
+
5. **DMO not found**
|
|
208
|
+
- Message: "DMO 'XYZ__dlm' not found"
|
|
209
|
+
- Solution: List all DMOs first to verify name
|
|
210
|
+
|
|
211
|
+
3. **Permission issues**
|
|
212
|
+
- Message: HTTP 403 errors
|
|
213
|
+
- Solution: Verify user has Data Cloud permissions
|
|
214
|
+
|
|
215
|
+
4. **API version mismatch**
|
|
216
|
+
- Current: v64.0
|
|
217
|
+
- Solution: Script can be updated for newer API versions
|
|
218
|
+
|
|
219
|
+
## Example Usage
|
|
220
|
+
|
|
221
|
+
**Example 1: List all DLOs**
|
|
222
|
+
```
|
|
223
|
+
User: "Show me all DLOs in afvibe org"
|
|
224
|
+
|
|
225
|
+
Response:
|
|
226
|
+
1. Run sf org list to discover connected org alias
|
|
227
|
+
2. Authenticate to afvibe
|
|
228
|
+
3. Run: python3 <skill_dir>/scripts/get_dlo_schema.py afvibe
|
|
229
|
+
4. Display formatted list of DLOs
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
**Example 2: Get specific DLO schema**
|
|
233
|
+
```
|
|
234
|
+
User: "Get the schema for Employee__dll in afvibe"
|
|
235
|
+
|
|
236
|
+
Response:
|
|
237
|
+
1. Run sf org list to discover connected org alias
|
|
238
|
+
2. Authenticate to afvibe
|
|
239
|
+
3. Run: python3 <skill_dir>/scripts/get_dlo_schema.py afvibe Employee__dll
|
|
240
|
+
4. Display field schema with types and metadata
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
**Example 3: Explore DLOs then get schema**
|
|
244
|
+
```
|
|
245
|
+
User: "What DLOs exist in myorg and show me the schema for the Employee one"
|
|
246
|
+
|
|
247
|
+
Response:
|
|
248
|
+
1. Run sf org list to discover connected org alias
|
|
249
|
+
2. List all DLOs in myorg
|
|
250
|
+
3. Identify Employee__dll
|
|
251
|
+
4. Get detailed schema for Employee__dll
|
|
252
|
+
5. Present both results
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
**Example 4: List all DMOs**
|
|
256
|
+
```
|
|
257
|
+
User: "Show me all DMOs in afvibe org"
|
|
258
|
+
|
|
259
|
+
Response:
|
|
260
|
+
1. Run sf org list to discover connected org alias
|
|
261
|
+
2. Authenticate to afvibe
|
|
262
|
+
3. Run: python3 <skill_dir>/scripts/get_dmo_schema.py afvibe
|
|
263
|
+
4. Display formatted list of DMOs
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
**Example 5: Get specific DMO schema**
|
|
267
|
+
```
|
|
268
|
+
User: "Get the schema for Individual__dlm in afvibe"
|
|
269
|
+
|
|
270
|
+
Response:
|
|
271
|
+
1. Run sf org list to discover connected org alias
|
|
272
|
+
2. Authenticate to afvibe
|
|
273
|
+
3. Run: python3 <skill_dir>/scripts/get_dmo_schema.py afvibe Individual__dlm
|
|
274
|
+
4. Display field schema with types and metadata
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
**Example 6: Explore DMOs then get schema**
|
|
278
|
+
```
|
|
279
|
+
User: "What DMOs exist in myorg and show me the schema for the Individual one"
|
|
280
|
+
|
|
281
|
+
Response:
|
|
282
|
+
1. Run sf org list to discover connected org alias
|
|
283
|
+
2. List all DMOs in myorg
|
|
284
|
+
3. Identify Individual__dlm
|
|
285
|
+
4. Get detailed schema for Individual__dlm
|
|
286
|
+
5. Present both results
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
## Output Format
|
|
290
|
+
|
|
291
|
+
### DLO List Output
|
|
292
|
+
```
|
|
293
|
+
Found 5 DLOs in org 'afvibe':
|
|
294
|
+
|
|
295
|
+
1. DataCustomCodeLogs__dll
|
|
296
|
+
Label: DataCustomCodeLogs
|
|
297
|
+
Category: Engagement
|
|
298
|
+
Records: 233
|
|
299
|
+
|
|
300
|
+
2. Employee__dll
|
|
301
|
+
Label: Employee
|
|
302
|
+
Category: Profile
|
|
303
|
+
Records: 12
|
|
304
|
+
|
|
305
|
+
[...]
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
### DLO Schema Output
|
|
309
|
+
```
|
|
310
|
+
DLO: Employee__dll
|
|
311
|
+
Label: Employee
|
|
312
|
+
Category: Profile
|
|
313
|
+
Status: ACTIVE
|
|
314
|
+
Records: 12
|
|
315
|
+
|
|
316
|
+
Custom Fields:
|
|
317
|
+
• id__c (Text) - Primary Key
|
|
318
|
+
• name__c (Text)
|
|
319
|
+
• position__c (Text)
|
|
320
|
+
• manager_id__c (Number)
|
|
321
|
+
|
|
322
|
+
System Fields:
|
|
323
|
+
• DataSource__c (Text)
|
|
324
|
+
• InternalOrganization__c (Text)
|
|
325
|
+
• cdp_sys_SourceVersion__c (Text)
|
|
326
|
+
|
|
327
|
+
Next steps:
|
|
328
|
+
- Query data: SELECT * FROM Employee__dll LIMIT 10
|
|
329
|
+
- Create segment based on position field
|
|
330
|
+
- Set up data stream for real-time updates
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
### DMO List Output
|
|
334
|
+
```
|
|
335
|
+
Found 10 DMOs in org 'afvibe':
|
|
336
|
+
|
|
337
|
+
1. Individual__dlm
|
|
338
|
+
Label: Individual
|
|
339
|
+
Category: Profile
|
|
340
|
+
|
|
341
|
+
2. ContactPointEmail__dlm
|
|
342
|
+
Label: Contact Point Email
|
|
343
|
+
Category: Profile
|
|
344
|
+
|
|
345
|
+
[...]
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### DMO Schema Output
|
|
349
|
+
```
|
|
350
|
+
DMO: Individual__dlm
|
|
351
|
+
Label: Individual
|
|
352
|
+
Category: Profile
|
|
353
|
+
Description: Represents an individual person
|
|
354
|
+
|
|
355
|
+
Fields:
|
|
356
|
+
• Id__c (Text) - Primary Key
|
|
357
|
+
• FirstName__c (Text)
|
|
358
|
+
• LastName__c (Text)
|
|
359
|
+
• BirthDate__c (DateTime)
|
|
360
|
+
|
|
361
|
+
Next steps:
|
|
362
|
+
- Query data: SELECT * FROM Individual__dlm LIMIT 10
|
|
363
|
+
- View DLO mappings to this DMO
|
|
364
|
+
- Create calculated insights
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
## Notes
|
|
368
|
+
|
|
369
|
+
- DLO names always end with `__dll` suffix
|
|
370
|
+
- DMO names always end with `__dlm` suffix
|
|
371
|
+
- Field names always end with `__c` suffix
|
|
372
|
+
- System fields (DataSource__c, KQ_*, cdp_sys_*) are automatically added
|
|
373
|
+
- Primary key fields are required for DLO and DMO queries
|
|
374
|
+
- API supports pagination (limit/offset) for large result sets
|
|
375
|
+
|
|
376
|
+
## Related Skills
|
|
377
|
+
|
|
378
|
+
- **datakit_workflow**: For DMO mapping operations
|
|
379
|
+
- **datakit_validation**: For validating datakit configurations
|
|
380
|
+
- Use this skill before creating DMO mappings to understand source DLO structure
|