mirror of
https://github.com/forcedotcom/afv-library.git
synced 2026-07-30 03:09:50 +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."
|
||||
metadata:
|
||||
version: "1.0"
|
||||
---
|
||||
|
||||
# developing-datacloud-code-extension Skill
|
||||
# data360-code-extension-generate Skill
|
||||
|
||||
## 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
|
||||
|
||||
**What it creates:**
|
||||
```
|
||||
```text
|
||||
my-transform/ # Project root
|
||||
├── payload/ # CRITICAL: This is what --package-dir must point to for deploy
|
||||
│ ├── entrypoint.py # Main transformation code
|
||||
@ -172,7 +172,7 @@ cat payload/config.json
|
||||
|
||||
#### 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:
|
||||
|
||||
@ -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 |
|
||||
| `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` |
|
||||
| `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 |
|
||||
| `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
|
||||
|
||||
**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:**
|
||||
1. Create DLO via code extension
|
||||
@ -1,4 +1,4 @@
|
||||
# developing-datacloud-code-extension Skill
|
||||
# data360-code-extension-generate Skill
|
||||
|
||||
## Overview
|
||||
|
||||
@ -17,25 +17,25 @@ This skill helps you create Data Cloud Code Extensions through a complete workfl
|
||||
## Usage
|
||||
|
||||
**Initialize a project:**
|
||||
```
|
||||
```text
|
||||
"Create a new Data Cloud code extension project called employee-transform"
|
||||
"Initialize a code extension to transform employee data"
|
||||
```
|
||||
|
||||
**Test locally:**
|
||||
```
|
||||
```text
|
||||
"Run the code extension in my-transform directory against afvibe org"
|
||||
"Test the entrypoint.py file locally"
|
||||
```
|
||||
|
||||
**Scan for permissions:**
|
||||
```
|
||||
```text
|
||||
"Scan the entrypoint.py to generate config"
|
||||
"Update permissions in config.json"
|
||||
```
|
||||
|
||||
**Deploy:**
|
||||
```
|
||||
```text
|
||||
"Deploy Employee_Upper code extension to afvibe"
|
||||
"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:
|
||||
|
||||
```
|
||||
```text
|
||||
my-transform/
|
||||
├── payload/
|
||||
│ ├── 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 |
|
||||
| Org not connected | `sf org login web --alias <alias>` |
|
||||
| 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 |
|
||||
|
||||
## CPU Size Selection
|
||||
@ -215,7 +215,7 @@ sf data-code-extension script scan --entrypoint ./payload/entrypoint.py
|
||||
|
||||
## File Structure
|
||||
|
||||
```
|
||||
```text
|
||||
my-project/
|
||||
├── payload/
|
||||
│ ├── entrypoint.py # Main code
|
||||
@ -248,7 +248,7 @@ my-project/
|
||||
| Wrong Python version | Use pyenv to install 3.11.0 |
|
||||
| Org not connected | `sf org login web --alias <alias>` |
|
||||
| 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 |
|
||||
|
||||
## 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."
|
||||
metadata:
|
||||
version: "1.0"
|
||||
---
|
||||
|
||||
# getting-datacloud-schema Skill
|
||||
# data360-schema-get Skill
|
||||
|
||||
|
||||
## Overview
|
||||
@ -42,7 +42,7 @@ sf org list
|
||||
```
|
||||
|
||||
Example output:
|
||||
```
|
||||
```text
|
||||
┌────┬───────┬──────────────────────────┬────────────────────┬───────────┐
|
||||
│ │ Alias │ Username │ Org Id │ Status │
|
||||
├────┼───────┼──────────────────────────┼────────────────────┼───────────┤
|
||||
@ -67,28 +67,28 @@ sf org login web --alias <org_alias>
|
||||
|
||||
### 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:**
|
||||
```bash
|
||||
python3 <skill_dir>/scripts/get_dlo_schema.py <org_alias>
|
||||
python3 ./scripts/get_dlo_schema.py <org_alias>
|
||||
```
|
||||
|
||||
**To get specific DLO schema:**
|
||||
```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
|
||||
|
||||
**To list all DMOs:**
|
||||
```bash
|
||||
python3 <skill_dir>/scripts/get_dmo_schema.py <org_alias>
|
||||
python3 ./scripts/get_dmo_schema.py <org_alias>
|
||||
```
|
||||
|
||||
**To get specific DMO schema:**
|
||||
```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
|
||||
@ -135,7 +135,7 @@ After displaying results, suggest relevant follow-up actions:
|
||||
## API Endpoints Used
|
||||
|
||||
### List All DLOs
|
||||
```
|
||||
```text
|
||||
GET /services/data/v64.0/ssot/data-lake-objects
|
||||
```
|
||||
|
||||
@ -158,14 +158,14 @@ Response structure:
|
||||
```
|
||||
|
||||
### Get DLO Schema
|
||||
```
|
||||
```text
|
||||
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).
|
||||
|
||||
### List All DMOs
|
||||
```
|
||||
```text
|
||||
GET /services/data/v64.0/ssot/data-model-objects
|
||||
```
|
||||
|
||||
@ -186,7 +186,7 @@ Response structure:
|
||||
```
|
||||
|
||||
### Get DMO Schema
|
||||
```
|
||||
```text
|
||||
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 1: List all DLOs**
|
||||
```
|
||||
```text
|
||||
User: "Show me all DLOs in afvibe org"
|
||||
|
||||
Response:
|
||||
1. Run sf org list to discover connected org alias
|
||||
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
|
||||
```
|
||||
|
||||
**Example 2: Get specific DLO schema**
|
||||
```
|
||||
```text
|
||||
User: "Get the schema for Employee__dll in afvibe"
|
||||
|
||||
Response:
|
||||
1. Run sf org list to discover connected org alias
|
||||
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
|
||||
```
|
||||
|
||||
**Example 3: Explore DLOs then get schema**
|
||||
```
|
||||
```text
|
||||
User: "What DLOs exist in myorg and show me the schema for the Employee one"
|
||||
|
||||
Response:
|
||||
@ -253,29 +253,29 @@ Response:
|
||||
```
|
||||
|
||||
**Example 4: List all DMOs**
|
||||
```
|
||||
```text
|
||||
User: "Show me all DMOs in afvibe org"
|
||||
|
||||
Response:
|
||||
1. Run sf org list to discover connected org alias
|
||||
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
|
||||
```
|
||||
|
||||
**Example 5: Get specific DMO schema**
|
||||
```
|
||||
```text
|
||||
User: "Get the schema for Individual__dlm in afvibe"
|
||||
|
||||
Response:
|
||||
1. Run sf org list to discover connected org alias
|
||||
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
|
||||
```
|
||||
|
||||
**Example 6: Explore DMOs then get schema**
|
||||
```
|
||||
```text
|
||||
User: "What DMOs exist in myorg and show me the schema for the Individual one"
|
||||
|
||||
Response:
|
||||
@ -289,7 +289,7 @@ Response:
|
||||
## Output Format
|
||||
|
||||
### DLO List Output
|
||||
```
|
||||
```text
|
||||
Found 5 DLOs in org 'afvibe':
|
||||
|
||||
1. DataCustomCodeLogs__dll
|
||||
@ -306,7 +306,7 @@ Found 5 DLOs in org 'afvibe':
|
||||
```
|
||||
|
||||
### DLO Schema Output
|
||||
```
|
||||
```yaml
|
||||
DLO: Employee__dll
|
||||
Label: Employee
|
||||
Category: Profile
|
||||
@ -331,7 +331,7 @@ Next steps:
|
||||
```
|
||||
|
||||
### DMO List Output
|
||||
```
|
||||
```text
|
||||
Found 10 DMOs in org 'afvibe':
|
||||
|
||||
1. Individual__dlm
|
||||
@ -346,7 +346,7 @@ Found 10 DMOs in org 'afvibe':
|
||||
```
|
||||
|
||||
### DMO Schema Output
|
||||
```
|
||||
```yaml
|
||||
DMO: Individual__dlm
|
||||
Label: Individual
|
||||
Category: Profile
|
||||
@ -1,4 +1,4 @@
|
||||
# getting-datacloud-schema Skill
|
||||
# data360-schema-get Skill
|
||||
|
||||
## Overview
|
||||
|
||||
@ -7,25 +7,25 @@ A skill that retrieves Data Lake Object (DLO) and Data Model Object (DMO) schema
|
||||
## Usage
|
||||
|
||||
**List all DLOs:**
|
||||
```
|
||||
```text
|
||||
"Show me all DLOs in afvibe org"
|
||||
"List Data Lake Objects in myorg"
|
||||
```
|
||||
|
||||
**Get specific DLO schema:**
|
||||
```
|
||||
```text
|
||||
"Get the schema for Employee__dll in afvibe"
|
||||
"What fields does the Employee__dll DLO have in myorg?"
|
||||
```
|
||||
|
||||
**List all DMOs:**
|
||||
```
|
||||
```text
|
||||
"Show me all DMOs in afvibe org"
|
||||
"List Data Model Objects in myorg"
|
||||
```
|
||||
|
||||
**Get specific DMO schema:**
|
||||
```
|
||||
```text
|
||||
"Get the schema for Individual__dlm in afvibe"
|
||||
"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
|
||||
|
||||
### DLO List
|
||||
```
|
||||
```text
|
||||
Found 5 DLOs in org 'afvibe':
|
||||
|
||||
1. DataCustomCodeLogs__dll
|
||||
@ -131,7 +131,7 @@ Found 5 DLOs in org 'afvibe':
|
||||
```
|
||||
|
||||
### DLO Schema
|
||||
```
|
||||
```text
|
||||
DLO: Employee__dll
|
||||
Label: Employee
|
||||
Category: Profile
|
||||
@ -148,7 +148,7 @@ Fields (9 total):
|
||||
```
|
||||
|
||||
### DMO List
|
||||
```
|
||||
```text
|
||||
Found 10 DMOs in org 'afvibe':
|
||||
|
||||
1. Individual__dlm
|
||||
@ -161,7 +161,7 @@ Found 10 DMOs in org 'afvibe':
|
||||
```
|
||||
|
||||
### DMO Schema
|
||||
```
|
||||
```text
|
||||
DMO: Individual__dlm
|
||||
Label: Individual
|
||||
Category: Profile
|
||||
Loading…
Reference in New Issue
Block a user