mirror of
https://github.com/forcedotcom/afv-library.git
synced 2026-08-09 00:42:46 +08:00
feat: Rename datacloud skills to domain-first convention @W-23195294@
This commit is contained in:
parent
b8d0e38ef1
commit
64a9fcb6ee
@ -1,11 +1,11 @@
|
|||||||
---
|
---
|
||||||
name: developing-datacloud-code-extension
|
name: data360-code-extension-generate
|
||||||
description: "Develop and deploy Data Cloud Code Extensions using SF CLI plugin. Use this skill when creating custom Python transformations for Data Cloud, deploying code extensions, or testing data transformations. Supports init, run, scan, and deploy operations."
|
description: "Develop and deploy Data Cloud Code Extensions using SF CLI plugin. Use this skill when creating custom Python transformations for Data Cloud, deploying code extensions, or testing data transformations. Supports init, run, scan, and deploy operations."
|
||||||
metadata:
|
metadata:
|
||||||
version: "1.0"
|
version: "1.0"
|
||||||
---
|
---
|
||||||
|
|
||||||
# developing-datacloud-code-extension Skill
|
# data360-code-extension-generate Skill
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ sf data-code-extension function init --package-dir <directory>
|
|||||||
- `--package-dir, -p` - Directory path where the package will be created
|
- `--package-dir, -p` - Directory path where the package will be created
|
||||||
|
|
||||||
**What it creates:**
|
**What it creates:**
|
||||||
```
|
```text
|
||||||
my-transform/ # Project root
|
my-transform/ # Project root
|
||||||
├── payload/ # CRITICAL: This is what --package-dir must point to for deploy
|
├── payload/ # CRITICAL: This is what --package-dir must point to for deploy
|
||||||
│ ├── entrypoint.py # Main transformation code
|
│ ├── entrypoint.py # Main transformation code
|
||||||
@ -172,7 +172,7 @@ cat payload/config.json
|
|||||||
|
|
||||||
#### Step 4b: Validate Each DLO Schema
|
#### Step 4b: Validate Each DLO Schema
|
||||||
|
|
||||||
**Use the `getting-datacloud-schema` skill to verify DLOs exist and check field names.**
|
**Use the `data360-schema-get` skill to verify DLOs exist and check field names.**
|
||||||
|
|
||||||
For each DLO referenced in your code:
|
For each DLO referenced in your code:
|
||||||
|
|
||||||
@ -260,7 +260,7 @@ sf data-code-extension script deploy --target-org <org_alias> --name <name> --pa
|
|||||||
| `Cannot connect to Docker daemon` | Start Docker Desktop |
|
| `Cannot connect to Docker daemon` | Start Docker Desktop |
|
||||||
| `No org found for alias` | `sf org login web --alias <org_alias>` |
|
| `No org found for alias` | `sf org login web --alias <org_alias>` |
|
||||||
| `config.json not found` | `sf data-code-extension script scan --entrypoint ./payload/entrypoint.py` |
|
| `config.json not found` | `sf data-code-extension script scan --entrypoint ./payload/entrypoint.py` |
|
||||||
| `DLO not found` | Verify DLO exists (use getting-datacloud-schema skill), check spelling and `__dll` suffix |
|
| `DLO not found` | Verify DLO exists (use data360-schema-get skill), check spelling and `__dll` suffix |
|
||||||
| `Permission denied writing` | Re-run scan, verify target DLO exists and is writable |
|
| `Permission denied writing` | Re-run scan, verify target DLO exists and is writable |
|
||||||
| `Deploy fails - wrong directory` | Ensure `--package-dir` points to `payload/` directory, not project root |
|
| `Deploy fails - wrong directory` | Ensure `--package-dir` points to `payload/` directory, not project root |
|
||||||
|
|
||||||
@ -285,9 +285,9 @@ sf data-code-extension script deploy --target-org <org_alias> --name <name> --pa
|
|||||||
|
|
||||||
## Integration with Other Skills
|
## Integration with Other Skills
|
||||||
|
|
||||||
**Use with getting-datacloud-schema skill (CRITICAL for validation):**
|
**Use with data360-schema-get skill (CRITICAL for validation):**
|
||||||
|
|
||||||
The `getting-datacloud-schema` skill is **required** for validating DLOs before testing code extensions.
|
The `data360-schema-get` skill is **required** for validating DLOs before testing code extensions.
|
||||||
|
|
||||||
**Use with Datakit Workflow:**
|
**Use with Datakit Workflow:**
|
||||||
1. Create DLO via code extension
|
1. Create DLO via code extension
|
||||||
@ -1,4 +1,4 @@
|
|||||||
# developing-datacloud-code-extension Skill
|
# data360-code-extension-generate Skill
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
@ -17,25 +17,25 @@ This skill helps you create Data Cloud Code Extensions through a complete workfl
|
|||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
**Initialize a project:**
|
**Initialize a project:**
|
||||||
```
|
```text
|
||||||
"Create a new Data Cloud code extension project called employee-transform"
|
"Create a new Data Cloud code extension project called employee-transform"
|
||||||
"Initialize a code extension to transform employee data"
|
"Initialize a code extension to transform employee data"
|
||||||
```
|
```
|
||||||
|
|
||||||
**Test locally:**
|
**Test locally:**
|
||||||
```
|
```text
|
||||||
"Run the code extension in my-transform directory against afvibe org"
|
"Run the code extension in my-transform directory against afvibe org"
|
||||||
"Test the entrypoint.py file locally"
|
"Test the entrypoint.py file locally"
|
||||||
```
|
```
|
||||||
|
|
||||||
**Scan for permissions:**
|
**Scan for permissions:**
|
||||||
```
|
```text
|
||||||
"Scan the entrypoint.py to generate config"
|
"Scan the entrypoint.py to generate config"
|
||||||
"Update permissions in config.json"
|
"Update permissions in config.json"
|
||||||
```
|
```
|
||||||
|
|
||||||
**Deploy:**
|
**Deploy:**
|
||||||
```
|
```text
|
||||||
"Deploy Employee_Upper code extension to afvibe"
|
"Deploy Employee_Upper code extension to afvibe"
|
||||||
"Deploy this transform with package-version 1.0.0"
|
"Deploy this transform with package-version 1.0.0"
|
||||||
```
|
```
|
||||||
@ -135,7 +135,7 @@ print(f"Processed {len(output)} employee records")
|
|||||||
|
|
||||||
After `init`, you'll have:
|
After `init`, you'll have:
|
||||||
|
|
||||||
```
|
```text
|
||||||
my-transform/
|
my-transform/
|
||||||
├── payload/
|
├── payload/
|
||||||
│ ├── entrypoint.py # Your transformation code
|
│ ├── entrypoint.py # Your transformation code
|
||||||
@ -173,7 +173,7 @@ client.write_to_dmo('EmployeeDMO', df, 'upsert')
|
|||||||
| Wrong Python version | Use pyenv to install 3.11.0 |
|
| Wrong Python version | Use pyenv to install 3.11.0 |
|
||||||
| Org not connected | `sf org login web --alias <alias>` |
|
| Org not connected | `sf org login web --alias <alias>` |
|
||||||
| Config missing | Run scan command |
|
| Config missing | Run scan command |
|
||||||
| DLO not found | Check DLO name, use getting-datacloud-schema skill |
|
| DLO not found | Check DLO name, use data360-schema-get skill |
|
||||||
| Docker error | Start Docker Desktop |
|
| Docker error | Start Docker Desktop |
|
||||||
|
|
||||||
## CPU Size Selection
|
## CPU Size Selection
|
||||||
@ -215,7 +215,7 @@ sf data-code-extension script scan --entrypoint ./payload/entrypoint.py
|
|||||||
|
|
||||||
## File Structure
|
## File Structure
|
||||||
|
|
||||||
```
|
```text
|
||||||
my-project/
|
my-project/
|
||||||
├── payload/
|
├── payload/
|
||||||
│ ├── entrypoint.py # Main code
|
│ ├── entrypoint.py # Main code
|
||||||
@ -248,7 +248,7 @@ my-project/
|
|||||||
| Wrong Python version | Use pyenv to install 3.11.0 |
|
| Wrong Python version | Use pyenv to install 3.11.0 |
|
||||||
| Org not connected | `sf org login web --alias <alias>` |
|
| Org not connected | `sf org login web --alias <alias>` |
|
||||||
| Config missing | Run scan command |
|
| Config missing | Run scan command |
|
||||||
| DLO not found | Check DLO name, use getting-datacloud-schema skill |
|
| DLO not found | Check DLO name, use data360-schema-get skill |
|
||||||
| Docker error | Start Docker Desktop |
|
| Docker error | Start Docker Desktop |
|
||||||
|
|
||||||
## Deployment Checklist
|
## Deployment Checklist
|
||||||
@ -1,11 +1,11 @@
|
|||||||
---
|
---
|
||||||
name: getting-datacloud-schema
|
name: data360-schema-get
|
||||||
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."
|
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."
|
||||||
metadata:
|
metadata:
|
||||||
version: "1.0"
|
version: "1.0"
|
||||||
---
|
---
|
||||||
|
|
||||||
# getting-datacloud-schema Skill
|
# data360-schema-get Skill
|
||||||
|
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
@ -42,7 +42,7 @@ sf org list
|
|||||||
```
|
```
|
||||||
|
|
||||||
Example output:
|
Example output:
|
||||||
```
|
```text
|
||||||
┌────┬───────┬──────────────────────────┬────────────────────┬───────────┐
|
┌────┬───────┬──────────────────────────┬────────────────────┬───────────┐
|
||||||
│ │ Alias │ Username │ Org Id │ Status │
|
│ │ Alias │ Username │ Org Id │ Status │
|
||||||
├────┼───────┼──────────────────────────┼────────────────────┼───────────┤
|
├────┼───────┼──────────────────────────┼────────────────────┼───────────┤
|
||||||
@ -67,28 +67,28 @@ sf org login web --alias <org_alias>
|
|||||||
|
|
||||||
### Step 3a: Execute DLO Schema Script
|
### Step 3a: Execute DLO Schema Script
|
||||||
|
|
||||||
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.
|
The Python scripts are bundled with this skill in the `scripts/` subdirectory.
|
||||||
|
|
||||||
**To list all DLOs:**
|
**To list all DLOs:**
|
||||||
```bash
|
```bash
|
||||||
python3 <skill_dir>/scripts/get_dlo_schema.py <org_alias>
|
python3 ./scripts/get_dlo_schema.py <org_alias>
|
||||||
```
|
```
|
||||||
|
|
||||||
**To get specific DLO schema:**
|
**To get specific DLO schema:**
|
||||||
```bash
|
```bash
|
||||||
python3 <skill_dir>/scripts/get_dlo_schema.py <org_alias> <dlo_name>
|
python3 ./scripts/get_dlo_schema.py <org_alias> <dlo_name>
|
||||||
```
|
```
|
||||||
|
|
||||||
### Step 3b: Execute DMO Schema Script
|
### Step 3b: Execute DMO Schema Script
|
||||||
|
|
||||||
**To list all DMOs:**
|
**To list all DMOs:**
|
||||||
```bash
|
```bash
|
||||||
python3 <skill_dir>/scripts/get_dmo_schema.py <org_alias>
|
python3 ./scripts/get_dmo_schema.py <org_alias>
|
||||||
```
|
```
|
||||||
|
|
||||||
**To get specific DMO schema:**
|
**To get specific DMO schema:**
|
||||||
```bash
|
```bash
|
||||||
python3 <skill_dir>/scripts/get_dmo_schema.py <org_alias> <dmo_name>
|
python3 ./scripts/get_dmo_schema.py <org_alias> <dmo_name>
|
||||||
```
|
```
|
||||||
|
|
||||||
### Step 4: Present Results
|
### Step 4: Present Results
|
||||||
@ -135,7 +135,7 @@ After displaying results, suggest relevant follow-up actions:
|
|||||||
## API Endpoints Used
|
## API Endpoints Used
|
||||||
|
|
||||||
### List All DLOs
|
### List All DLOs
|
||||||
```
|
```text
|
||||||
GET /services/data/v64.0/ssot/data-lake-objects
|
GET /services/data/v64.0/ssot/data-lake-objects
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -158,14 +158,14 @@ Response structure:
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Get DLO Schema
|
### Get DLO Schema
|
||||||
```
|
```text
|
||||||
GET /services/data/v64.0/ssot/data-lake-objects/{dlo_name}
|
GET /services/data/v64.0/ssot/data-lake-objects/{dlo_name}
|
||||||
```
|
```
|
||||||
|
|
||||||
Response structure (same as individual object in list response, but wrapped in paginated format).
|
Response structure (same as individual object in list response, but wrapped in paginated format).
|
||||||
|
|
||||||
### List All DMOs
|
### List All DMOs
|
||||||
```
|
```text
|
||||||
GET /services/data/v64.0/ssot/data-model-objects
|
GET /services/data/v64.0/ssot/data-model-objects
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -186,7 +186,7 @@ Response structure:
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Get DMO Schema
|
### Get DMO Schema
|
||||||
```
|
```text
|
||||||
GET /services/data/v64.0/ssot/data-model-objects/{dmo_name}
|
GET /services/data/v64.0/ssot/data-model-objects/{dmo_name}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -219,29 +219,29 @@ Response structure (same as individual object in list response, but wrapped in p
|
|||||||
## Example Usage
|
## Example Usage
|
||||||
|
|
||||||
**Example 1: List all DLOs**
|
**Example 1: List all DLOs**
|
||||||
```
|
```text
|
||||||
User: "Show me all DLOs in afvibe org"
|
User: "Show me all DLOs in afvibe org"
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
1. Run sf org list to discover connected org alias
|
1. Run sf org list to discover connected org alias
|
||||||
2. Authenticate to afvibe
|
2. Authenticate to afvibe
|
||||||
3. Run: python3 <skill_dir>/scripts/get_dlo_schema.py afvibe
|
3. Run: python3 ./scripts/get_dlo_schema.py afvibe
|
||||||
4. Display formatted list of DLOs
|
4. Display formatted list of DLOs
|
||||||
```
|
```
|
||||||
|
|
||||||
**Example 2: Get specific DLO schema**
|
**Example 2: Get specific DLO schema**
|
||||||
```
|
```text
|
||||||
User: "Get the schema for Employee__dll in afvibe"
|
User: "Get the schema for Employee__dll in afvibe"
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
1. Run sf org list to discover connected org alias
|
1. Run sf org list to discover connected org alias
|
||||||
2. Authenticate to afvibe
|
2. Authenticate to afvibe
|
||||||
3. Run: python3 <skill_dir>/scripts/get_dlo_schema.py afvibe Employee__dll
|
3. Run: python3 ./scripts/get_dlo_schema.py afvibe Employee__dll
|
||||||
4. Display field schema with types and metadata
|
4. Display field schema with types and metadata
|
||||||
```
|
```
|
||||||
|
|
||||||
**Example 3: Explore DLOs then get schema**
|
**Example 3: Explore DLOs then get schema**
|
||||||
```
|
```text
|
||||||
User: "What DLOs exist in myorg and show me the schema for the Employee one"
|
User: "What DLOs exist in myorg and show me the schema for the Employee one"
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
@ -253,29 +253,29 @@ Response:
|
|||||||
```
|
```
|
||||||
|
|
||||||
**Example 4: List all DMOs**
|
**Example 4: List all DMOs**
|
||||||
```
|
```text
|
||||||
User: "Show me all DMOs in afvibe org"
|
User: "Show me all DMOs in afvibe org"
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
1. Run sf org list to discover connected org alias
|
1. Run sf org list to discover connected org alias
|
||||||
2. Authenticate to afvibe
|
2. Authenticate to afvibe
|
||||||
3. Run: python3 <skill_dir>/scripts/get_dmo_schema.py afvibe
|
3. Run: python3 ./scripts/get_dmo_schema.py afvibe
|
||||||
4. Display formatted list of DMOs
|
4. Display formatted list of DMOs
|
||||||
```
|
```
|
||||||
|
|
||||||
**Example 5: Get specific DMO schema**
|
**Example 5: Get specific DMO schema**
|
||||||
```
|
```text
|
||||||
User: "Get the schema for Individual__dlm in afvibe"
|
User: "Get the schema for Individual__dlm in afvibe"
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
1. Run sf org list to discover connected org alias
|
1. Run sf org list to discover connected org alias
|
||||||
2. Authenticate to afvibe
|
2. Authenticate to afvibe
|
||||||
3. Run: python3 <skill_dir>/scripts/get_dmo_schema.py afvibe Individual__dlm
|
3. Run: python3 ./scripts/get_dmo_schema.py afvibe Individual__dlm
|
||||||
4. Display field schema with types and metadata
|
4. Display field schema with types and metadata
|
||||||
```
|
```
|
||||||
|
|
||||||
**Example 6: Explore DMOs then get schema**
|
**Example 6: Explore DMOs then get schema**
|
||||||
```
|
```text
|
||||||
User: "What DMOs exist in myorg and show me the schema for the Individual one"
|
User: "What DMOs exist in myorg and show me the schema for the Individual one"
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
@ -289,7 +289,7 @@ Response:
|
|||||||
## Output Format
|
## Output Format
|
||||||
|
|
||||||
### DLO List Output
|
### DLO List Output
|
||||||
```
|
```text
|
||||||
Found 5 DLOs in org 'afvibe':
|
Found 5 DLOs in org 'afvibe':
|
||||||
|
|
||||||
1. DataCustomCodeLogs__dll
|
1. DataCustomCodeLogs__dll
|
||||||
@ -306,7 +306,7 @@ Found 5 DLOs in org 'afvibe':
|
|||||||
```
|
```
|
||||||
|
|
||||||
### DLO Schema Output
|
### DLO Schema Output
|
||||||
```
|
```yaml
|
||||||
DLO: Employee__dll
|
DLO: Employee__dll
|
||||||
Label: Employee
|
Label: Employee
|
||||||
Category: Profile
|
Category: Profile
|
||||||
@ -331,7 +331,7 @@ Next steps:
|
|||||||
```
|
```
|
||||||
|
|
||||||
### DMO List Output
|
### DMO List Output
|
||||||
```
|
```text
|
||||||
Found 10 DMOs in org 'afvibe':
|
Found 10 DMOs in org 'afvibe':
|
||||||
|
|
||||||
1. Individual__dlm
|
1. Individual__dlm
|
||||||
@ -346,7 +346,7 @@ Found 10 DMOs in org 'afvibe':
|
|||||||
```
|
```
|
||||||
|
|
||||||
### DMO Schema Output
|
### DMO Schema Output
|
||||||
```
|
```yaml
|
||||||
DMO: Individual__dlm
|
DMO: Individual__dlm
|
||||||
Label: Individual
|
Label: Individual
|
||||||
Category: Profile
|
Category: Profile
|
||||||
@ -1,4 +1,4 @@
|
|||||||
# getting-datacloud-schema Skill
|
# data360-schema-get Skill
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
@ -7,25 +7,25 @@ A skill that retrieves Data Lake Object (DLO) and Data Model Object (DMO) schema
|
|||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
**List all DLOs:**
|
**List all DLOs:**
|
||||||
```
|
```text
|
||||||
"Show me all DLOs in afvibe org"
|
"Show me all DLOs in afvibe org"
|
||||||
"List Data Lake Objects in myorg"
|
"List Data Lake Objects in myorg"
|
||||||
```
|
```
|
||||||
|
|
||||||
**Get specific DLO schema:**
|
**Get specific DLO schema:**
|
||||||
```
|
```text
|
||||||
"Get the schema for Employee__dll in afvibe"
|
"Get the schema for Employee__dll in afvibe"
|
||||||
"What fields does the Employee__dll DLO have in myorg?"
|
"What fields does the Employee__dll DLO have in myorg?"
|
||||||
```
|
```
|
||||||
|
|
||||||
**List all DMOs:**
|
**List all DMOs:**
|
||||||
```
|
```text
|
||||||
"Show me all DMOs in afvibe org"
|
"Show me all DMOs in afvibe org"
|
||||||
"List Data Model Objects in myorg"
|
"List Data Model Objects in myorg"
|
||||||
```
|
```
|
||||||
|
|
||||||
**Get specific DMO schema:**
|
**Get specific DMO schema:**
|
||||||
```
|
```text
|
||||||
"Get the schema for Individual__dlm in afvibe"
|
"Get the schema for Individual__dlm in afvibe"
|
||||||
"What fields does the Individual__dlm DMO have in myorg?"
|
"What fields does the Individual__dlm DMO have in myorg?"
|
||||||
```
|
```
|
||||||
@ -116,7 +116,7 @@ python3 scripts/get_dmo_schema.py afvibe Individual__dlm
|
|||||||
## Output Format
|
## Output Format
|
||||||
|
|
||||||
### DLO List
|
### DLO List
|
||||||
```
|
```text
|
||||||
Found 5 DLOs in org 'afvibe':
|
Found 5 DLOs in org 'afvibe':
|
||||||
|
|
||||||
1. DataCustomCodeLogs__dll
|
1. DataCustomCodeLogs__dll
|
||||||
@ -131,7 +131,7 @@ Found 5 DLOs in org 'afvibe':
|
|||||||
```
|
```
|
||||||
|
|
||||||
### DLO Schema
|
### DLO Schema
|
||||||
```
|
```text
|
||||||
DLO: Employee__dll
|
DLO: Employee__dll
|
||||||
Label: Employee
|
Label: Employee
|
||||||
Category: Profile
|
Category: Profile
|
||||||
@ -148,7 +148,7 @@ Fields (9 total):
|
|||||||
```
|
```
|
||||||
|
|
||||||
### DMO List
|
### DMO List
|
||||||
```
|
```text
|
||||||
Found 10 DMOs in org 'afvibe':
|
Found 10 DMOs in org 'afvibe':
|
||||||
|
|
||||||
1. Individual__dlm
|
1. Individual__dlm
|
||||||
@ -161,7 +161,7 @@ Found 10 DMOs in org 'afvibe':
|
|||||||
```
|
```
|
||||||
|
|
||||||
### DMO Schema
|
### DMO Schema
|
||||||
```
|
```text
|
||||||
DMO: Individual__dlm
|
DMO: Individual__dlm
|
||||||
Label: Individual
|
Label: Individual
|
||||||
Category: Profile
|
Category: Profile
|
||||||
Loading…
Reference in New Issue
Block a user