@salesforce/afv-skills 1.16.0 → 1.18.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.
Files changed (69) hide show
  1. package/package.json +1 -1
  2. package/skills/activating-datacloud/SKILL.md +2 -2
  3. package/skills/analyzing-omnistudio-dependencies/SKILL.md +1 -1
  4. package/skills/building-sf-integrations/SKILL.md +1 -1
  5. package/skills/building-ui-bundle-app/SKILL.md +1 -1
  6. package/skills/configuring-code-analyzer/SKILL.md +482 -0
  7. package/skills/configuring-code-analyzer/examples/apex-project-config.yml +41 -0
  8. package/skills/configuring-code-analyzer/examples/ci-github-actions.yml +96 -0
  9. package/skills/configuring-code-analyzer/examples/fullstack-project-config.yml +46 -0
  10. package/skills/configuring-code-analyzer/examples/lwc-project-config.yml +26 -0
  11. package/skills/configuring-code-analyzer/references/ci-cd-templates.md +648 -0
  12. package/skills/configuring-code-analyzer/references/config-schema.md +257 -0
  13. package/skills/configuring-code-analyzer/references/diagnostic-flow.md +70 -0
  14. package/skills/configuring-code-analyzer/references/engine-prerequisites.md +276 -0
  15. package/skills/configuring-code-analyzer/references/rule-name-resolution.md +67 -0
  16. package/skills/configuring-code-analyzer/references/troubleshooting.md +298 -0
  17. package/skills/configuring-code-analyzer/scripts/check-prerequisites.sh +189 -0
  18. package/skills/configuring-code-analyzer/scripts/generate-config.sh +143 -0
  19. package/skills/configuring-code-analyzer/scripts/validate-config.sh +153 -0
  20. package/skills/connecting-datacloud/SKILL.md +2 -2
  21. package/skills/creating-b2b-commerce-store/SKILL.md +0 -1
  22. package/skills/developing-agentforce/SKILL.md +0 -1
  23. package/skills/generating-apex/SKILL.md +1 -0
  24. package/skills/generating-mermaid-diagrams/assets/datamodel/b2b-commerce-erd.md +1 -1
  25. package/skills/generating-mermaid-diagrams/assets/datamodel/campaigns-erd.md +1 -1
  26. package/skills/generating-mermaid-diagrams/assets/datamodel/consent-erd.md +1 -1
  27. package/skills/generating-mermaid-diagrams/assets/datamodel/files-erd.md +1 -1
  28. package/skills/generating-mermaid-diagrams/assets/datamodel/forecasting-erd.md +1 -1
  29. package/skills/generating-mermaid-diagrams/assets/datamodel/fsl-erd.md +1 -1
  30. package/skills/generating-mermaid-diagrams/assets/datamodel/party-model-erd.md +1 -1
  31. package/skills/generating-mermaid-diagrams/assets/datamodel/quote-order-erd.md +1 -1
  32. package/skills/generating-mermaid-diagrams/assets/datamodel/revenue-cloud-erd.md +1 -1
  33. package/skills/generating-mermaid-diagrams/assets/datamodel/sales-cloud-erd.md +1 -1
  34. package/skills/generating-mermaid-diagrams/assets/datamodel/salesforce-erd.md +1 -1
  35. package/skills/generating-mermaid-diagrams/assets/datamodel/scheduler-erd.md +1 -1
  36. package/skills/generating-mermaid-diagrams/assets/datamodel/service-cloud-erd.md +1 -1
  37. package/skills/generating-mermaid-diagrams/assets/datamodel/territory-management-erd.md +1 -1
  38. package/skills/generating-mermaid-diagrams/references/erd-conventions.md +1 -1
  39. package/skills/generating-mermaid-diagrams/references/preview-guide.md +2 -5
  40. package/skills/harmonizing-datacloud/SKILL.md +2 -2
  41. package/skills/implementing-ui-bundle-agentforce-conversation-client/SKILL.md +1 -2
  42. package/skills/investigating-agentforce-d360/SKILL.md +1 -1
  43. package/skills/managing-cdc-enablement/SKILL.md +164 -0
  44. package/skills/managing-cdc-enablement/assets/PlatformEventChannel-template.xml +5 -0
  45. package/skills/managing-cdc-enablement/assets/PlatformEventChannelMember-template.xml +11 -0
  46. package/skills/managing-cdc-enablement/references/deploy-troubleshooting.md +73 -0
  47. package/skills/managing-cdc-enablement/references/filter-expressions.md +93 -0
  48. package/skills/observing-agentforce/SKILL.md +0 -1
  49. package/skills/observing-agentforce/references/stdm-queries.md +3 -11
  50. package/skills/orchestrating-datacloud/README.md +5 -7
  51. package/skills/orchestrating-datacloud/SKILL.md +3 -3
  52. package/skills/orchestrating-datacloud/references/feature-readiness.md +2 -2
  53. package/skills/orchestrating-datacloud/references/plugin-setup.md +6 -8
  54. package/skills/orchestrating-datacloud/scripts/diagnose-org.mjs +1 -1
  55. package/skills/orchestrating-datacloud/scripts/verify-plugin.sh +2 -2
  56. package/skills/preparing-datacloud/SKILL.md +2 -2
  57. package/skills/retrieving-datacloud/SKILL.md +3 -3
  58. package/skills/reviewing-lwc-mobile-offline/SKILL.md +0 -1
  59. package/skills/running-code-analyzer/SKILL.md +264 -267
  60. package/skills/running-code-analyzer/references/post-scan-workflows.md +286 -0
  61. package/skills/running-code-analyzer/scripts/describe-rule.js +382 -0
  62. package/skills/running-code-analyzer/scripts/list-rules.js +260 -0
  63. package/skills/running-code-analyzer/scripts/query-results.js +230 -0
  64. package/skills/testing-agentforce/SKILL.md +0 -1
  65. package/skills/using-mobile-native-capabilities/SKILL.md +0 -1
  66. package/skills/using-salesforce-archive/SKILL.md +121 -0
  67. package/skills/using-salesforce-archive/examples/monitor-failed-jobs.md +47 -0
  68. package/skills/using-salesforce-archive/references/archive-activity-entity.md +59 -0
  69. package/skills/using-salesforce-archive/references/connect-api-operations.md +157 -0
@@ -0,0 +1,153 @@
1
+ #!/bin/bash
2
+ # validate-config.sh
3
+ # Validates a code-analyzer.yml configuration file.
4
+ # Usage: bash <skill_dir>/scripts/validate-config.sh [config-file]
5
+ #
6
+ # If no config file is specified, looks for code-analyzer.yml in current directory.
7
+ #
8
+ # Exit codes:
9
+ # 0 = Config is valid
10
+ # 1 = Config has errors
11
+
12
+ set -euo pipefail
13
+
14
+ CONFIG_FILE="${1:-code-analyzer.yml}"
15
+
16
+ echo "Validating: ${CONFIG_FILE}"
17
+ echo ""
18
+
19
+ # Check file exists
20
+ if [ ! -f "$CONFIG_FILE" ]; then
21
+ echo "ERROR: Config file not found: ${CONFIG_FILE}"
22
+ echo ""
23
+ echo "Expected locations:"
24
+ echo " - ./code-analyzer.yml"
25
+ echo " - ./code-analyzer.yaml"
26
+ echo ""
27
+ echo "Generate one with: sf code-analyzer config --output-file code-analyzer.yml"
28
+ exit 1
29
+ fi
30
+
31
+ # Check file is not empty
32
+ if [ ! -s "$CONFIG_FILE" ]; then
33
+ echo "ERROR: Config file is empty: ${CONFIG_FILE}"
34
+ exit 1
35
+ fi
36
+
37
+ # Basic YAML syntax check (if python3 available)
38
+ if command -v python3 &> /dev/null; then
39
+ echo "Checking YAML syntax..."
40
+ if python3 -c "
41
+ import yaml, sys
42
+ try:
43
+ with open('${CONFIG_FILE}', 'r') as f:
44
+ config = yaml.safe_load(f)
45
+ if config is None:
46
+ print('WARNING: Config file is empty or contains only comments')
47
+ sys.exit(0)
48
+ if not isinstance(config, dict):
49
+ print('ERROR: Config must be a YAML mapping (dictionary)')
50
+ sys.exit(1)
51
+ print('YAML syntax: OK')
52
+ except yaml.YAMLError as e:
53
+ print(f'ERROR: Invalid YAML syntax')
54
+ print(f' {e}')
55
+ sys.exit(1)
56
+ " 2>&1; then
57
+ echo ""
58
+ else
59
+ echo ""
60
+ echo "Fix YAML syntax errors before proceeding."
61
+ exit 1
62
+ fi
63
+ else
64
+ echo "WARNING: python3 not found — skipping YAML syntax validation (install python3 for full checks)"
65
+ fi
66
+
67
+ # Validate known field names
68
+ echo "Checking known fields..."
69
+ VALID_TOP_LEVEL="config_root log_folder log_level rules engines ignores suppressions"
70
+
71
+ if command -v python3 &> /dev/null; then
72
+ python3 -c "
73
+ import yaml, sys
74
+
75
+ with open('${CONFIG_FILE}', 'r') as f:
76
+ config = yaml.safe_load(f)
77
+
78
+ if config is None:
79
+ sys.exit(0)
80
+
81
+ valid_fields = set('${VALID_TOP_LEVEL}'.split())
82
+ unknown = set(config.keys()) - valid_fields
83
+ if unknown:
84
+ print(f'WARNING: Unknown top-level fields: {sorted(unknown)}')
85
+ print(' Valid fields: config_root, log_folder, log_level, rules, engines, ignores, suppressions')
86
+ else:
87
+ print('Known fields: OK')
88
+
89
+ # Check engines section
90
+ if 'engines' in config and config['engines']:
91
+ valid_engines = {'pmd', 'cpd', 'eslint', 'regex', 'retire-js', 'flow', 'sfge', 'apexguru'}
92
+ configured_engines = set(config['engines'].keys())
93
+ unknown_engines = configured_engines - valid_engines
94
+ if unknown_engines:
95
+ print(f'WARNING: Unknown engine names: {sorted(unknown_engines)}')
96
+ print(f' Valid engines: {sorted(valid_engines)}')
97
+ else:
98
+ print(f'Engines configured: {sorted(configured_engines)}')
99
+
100
+ # Check ignores section
101
+ if 'ignores' in config and config['ignores']:
102
+ if 'files' not in config['ignores']:
103
+ print('WARNING: ignores section should contain a \"files\" list')
104
+ elif not isinstance(config['ignores']['files'], list):
105
+ print('ERROR: ignores.files must be a list of glob patterns')
106
+ sys.exit(1)
107
+ else:
108
+ print(f'Ignore patterns: {len(config[\"ignores\"][\"files\"])} patterns configured')
109
+
110
+ # Check rules section
111
+ if 'rules' in config and config['rules']:
112
+ for engine, rules in config['rules'].items():
113
+ if rules and isinstance(rules, dict):
114
+ for rule_name, overrides in rules.items():
115
+ if overrides and isinstance(overrides, dict):
116
+ if 'severity' in overrides:
117
+ sev = overrides['severity']
118
+ valid_sevs = [1, 2, 3, 4, 5, 'Critical', 'High', 'Moderate', 'Low', 'Info']
119
+ if sev not in valid_sevs:
120
+ print(f'WARNING: rules.{engine}.{rule_name}.severity = {sev} (expected 1-5 or Critical/High/Moderate/Low/Info)')
121
+
122
+ print('')
123
+ " 2>&1
124
+ fi
125
+
126
+ # Run sf code-analyzer config validation (if sf CLI available)
127
+ echo ""
128
+ echo "Running Code Analyzer validation..."
129
+ if command -v sf &> /dev/null; then
130
+ if sf plugins --core 2>&1 | grep -qi "code-analyzer"; then
131
+ if sf code-analyzer config --config-file "$CONFIG_FILE" > /dev/null 2>&1; then
132
+ echo "Code Analyzer validation: PASSED"
133
+ echo ""
134
+ echo "Configuration is valid and ready to use."
135
+ exit 0
136
+ else
137
+ echo "Code Analyzer validation: FAILED"
138
+ echo ""
139
+ echo "Running with verbose output:"
140
+ sf code-analyzer config --config-file "$CONFIG_FILE" 2>&1 || true
141
+ exit 1
142
+ fi
143
+ else
144
+ echo "SKIP: Code Analyzer plugin not installed (cannot run full validation)"
145
+ echo "Install: sf plugins install @salesforce/plugin-code-analyzer"
146
+ fi
147
+ else
148
+ echo "SKIP: sf CLI not available (cannot run full validation)"
149
+ fi
150
+
151
+ echo ""
152
+ echo "Basic validation passed. Install Code Analyzer for full validation."
153
+ exit 0
@@ -43,7 +43,7 @@ Ask for or infer:
43
43
  ## Core Operating Rules
44
44
 
45
45
  - Verify the plugin runtime first; see [../orchestrating-datacloud/references/plugin-setup.md](../orchestrating-datacloud/references/plugin-setup.md).
46
- - Run the shared readiness classifier before mutating connections: `node ~/.claude/skills/orchestrating-datacloud/scripts/diagnose-org.mjs -o <org> --phase connect --json`.
46
+ - Run the shared readiness classifier before mutating connections: `node ../orchestrating-datacloud/scripts/diagnose-org.mjs -o <org> --phase connect --json`.
47
47
  - Prefer read-only discovery before connection creation.
48
48
  - Suppress linked-plugin warning noise with `2>/dev/null` for standard usage.
49
49
  - Remember that `connection list` requires `--connector-type`.
@@ -59,7 +59,7 @@ Ask for or infer:
59
59
 
60
60
  ### 1. Classify readiness for connect work
61
61
  ```bash
62
- node ~/.claude/skills/orchestrating-datacloud/scripts/diagnose-org.mjs -o <org> --phase connect --json
62
+ node ../orchestrating-datacloud/scripts/diagnose-org.mjs -o <org> --phase connect --json
63
63
  ```
64
64
 
65
65
  ### 2. Discover connector types
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: creating-b2b-commerce-store
3
3
  description: "Interactive workflow to create Commerce B2B Stores and retrieve storefront metadata. Use when users want to: create B2B Commerce stores, build Commerce storefronts, set up B2B stores from Vibes, retrieve Commerce metadata, deploy Commerce experiences, work with DigitalExperienceBundle for Commerce."
4
- Critical: "Agents must follow the interactive flow and NEVER create storefront metadata from scratch."
5
4
  compatibility: "Requires Commerce licenses, Experience Cloud, Salesforce CLI"
6
5
  metadata:
7
6
  version: "1.0"
@@ -4,7 +4,6 @@ description: "Build, modify, debug, and deploy agents with Agentforce Agent Scri
4
4
  compatibility: "Requires Agentforce license, API v66.0+, Einstein Agent User"
5
5
  metadata:
6
6
  version: "1.0"
7
- last_updated: "2026-04-08"
8
7
  ---
9
8
 
10
9
  # Agent Script Skill
@@ -3,6 +3,7 @@ name: generating-apex
3
3
  description: "Primary Apex authoring skill for class generation, refactoring, and review. ALWAYS ACTIVATE when the user mentions Apex, .cls, triggers, or asks to create/refactor a class (service, selector, domain, batch, queueable, schedulable, invocable, DTO, utility, interface, abstract, exception, REST resource). Use this skill for requests involving SObject CRUD, mapping collections, fetching related records, scheduled jobs, batch jobs, trigger design, @AuraEnabled controllers, @RestResource endpoints, custom REST APIs, or code review of existing Apex."
4
4
  metadata:
5
5
  version: "1.0"
6
+ minApiVersion: "66.0"
6
7
  ---
7
8
 
8
9
  # Generating Apex
@@ -22,7 +22,7 @@ Pre-built data model for Salesforce B2B Commerce using `flowchart LR` format wit
22
22
  Enrich diagram with live org data:
23
23
 
24
24
  ```bash
25
- python3 ~/.claude/skills/generating-mermaid-diagrams/scripts/query-org-metadata.py \
25
+ python3 ../../scripts/query-org-metadata.py \
26
26
  --objects WebStore,WebCart,CartItem,BuyerGroup,BuyerAccount \
27
27
  --target-org myorg
28
28
  ```
@@ -21,7 +21,7 @@ Pre-built data model for Salesforce Campaigns using `flowchart LR` format with c
21
21
  Enrich diagram with live org data:
22
22
 
23
23
  ```bash
24
- python3 ~/.claude/skills/generating-mermaid-diagrams/scripts/query-org-metadata.py \
24
+ python3 ../../scripts/query-org-metadata.py \
25
25
  --objects Campaign,CampaignMember,CampaignInfluence,Lead,Contact,Opportunity \
26
26
  --target-org myorg
27
27
  ```
@@ -24,7 +24,7 @@ Pre-built data model for Salesforce Consent Management (GDPR/Privacy) using `flo
24
24
  Enrich diagram with live org data:
25
25
 
26
26
  ```bash
27
- python3 ~/.claude/skills/generating-mermaid-diagrams/scripts/query-org-metadata.py \
27
+ python3 ../../scripts/query-org-metadata.py \
28
28
  --objects Individual,ContactPointEmail,ContactPointPhone,DataUsePurpose,ContactPointConsent \
29
29
  --target-org myorg
30
30
  ```
@@ -21,7 +21,7 @@ Pre-built data model for Salesforce Files (Content) using `flowchart LR` format
21
21
  Enrich diagram with live org data:
22
22
 
23
23
  ```bash
24
- python3 ~/.claude/skills/generating-mermaid-diagrams/scripts/query-org-metadata.py \
24
+ python3 ../../scripts/query-org-metadata.py \
25
25
  --objects ContentDocument,ContentVersion,ContentDocumentLink,ContentWorkspace \
26
26
  --target-org myorg
27
27
  ```
@@ -21,7 +21,7 @@ Pre-built data model for Salesforce Collaborative Forecasts using `flowchart LR`
21
21
  Enrich diagram with live org data:
22
22
 
23
23
  ```bash
24
- python3 ~/.claude/skills/generating-mermaid-diagrams/scripts/query-org-metadata.py \
24
+ python3 ../../scripts/query-org-metadata.py \
25
25
  --objects ForecastingItem,ForecastingQuota,Opportunity,OpportunitySplit \
26
26
  --target-org myorg
27
27
  ```
@@ -25,7 +25,7 @@ Pre-built data model for Salesforce Field Service (formerly Field Service Lightn
25
25
  Enrich diagram with live org data:
26
26
 
27
27
  ```bash
28
- python3 ~/.claude/skills/generating-mermaid-diagrams/scripts/query-org-metadata.py \
28
+ python3 ../../scripts/query-org-metadata.py \
29
29
  --objects WorkOrder,WorkOrderLineItem,ServiceAppointment,ServiceResource,ServiceTerritory \
30
30
  --target-org myorg
31
31
  ```
@@ -20,7 +20,7 @@ Pre-built data model for Salesforce Party Model used in Industry Clouds (Financi
20
20
  Enrich diagram with live org data:
21
21
 
22
22
  ```bash
23
- python3 ~/.claude/skills/generating-mermaid-diagrams/scripts/query-org-metadata.py \
23
+ python3 ../../scripts/query-org-metadata.py \
24
24
  --objects Account,Contact,AccountContactRelation,AccountContactRole \
25
25
  --target-org myorg
26
26
  ```
@@ -23,7 +23,7 @@ Pre-built data model for Salesforce Quotes and Orders using `flowchart LR` forma
23
23
  Enrich diagram with live org data:
24
24
 
25
25
  ```bash
26
- python3 ~/.claude/skills/generating-mermaid-diagrams/scripts/query-org-metadata.py \
26
+ python3 ../../scripts/query-org-metadata.py \
27
27
  --objects Opportunity,Quote,QuoteLineItem,Order,OrderItem,Product2,Contract \
28
28
  --target-org myorg
29
29
  ```
@@ -22,7 +22,7 @@ Pre-built data model for Salesforce Revenue Cloud (CPQ, Billing, Subscription Ma
22
22
  Enrich diagram with live org data:
23
23
 
24
24
  ```bash
25
- python3 ~/.claude/skills/generating-mermaid-diagrams/scripts/query-org-metadata.py \
25
+ python3 ../../scripts/query-org-metadata.py \
26
26
  --objects ProductCatalog,ProductCategory,ProductSellingModel,PriceAdjustmentSchedule \
27
27
  --target-org myorg
28
28
  ```
@@ -22,7 +22,7 @@ Pre-built data model for Salesforce Sales Cloud using `flowchart LR` format with
22
22
  Enrich diagram with live org data:
23
23
 
24
24
  ```bash
25
- python3 ~/.claude/skills/generating-mermaid-diagrams/scripts/query-org-metadata.py \
25
+ python3 ../../scripts/query-org-metadata.py \
26
26
  --objects Account,Contact,Lead,Opportunity,Product2,Campaign \
27
27
  --target-org myorg
28
28
  ```
@@ -56,7 +56,7 @@ Use `flowchart LR` (left-to-right) for data model diagrams. This format supports
56
56
  Enrich diagrams with live org data:
57
57
 
58
58
  ```bash
59
- python3 ~/.claude/skills/generating-mermaid-diagrams/scripts/query-org-metadata.py \
59
+ python3 ../../scripts/query-org-metadata.py \
60
60
  --objects Account,Contact,Opportunity,Case \
61
61
  --target-org myorg
62
62
  ```
@@ -23,7 +23,7 @@ Pre-built data model for Salesforce Scheduler (Lightning Scheduler) using `flowc
23
23
  Enrich diagram with live org data:
24
24
 
25
25
  ```bash
26
- python3 ~/.claude/skills/generating-mermaid-diagrams/scripts/query-org-metadata.py \
26
+ python3 ../../scripts/query-org-metadata.py \
27
27
  --objects ServiceAppointment,ServiceResource,ServiceTerritory,WorkType \
28
28
  --target-org myorg
29
29
  ```
@@ -23,7 +23,7 @@ Pre-built data model for Salesforce Service Cloud using `flowchart LR` format wi
23
23
  Enrich diagram with live org data:
24
24
 
25
25
  ```bash
26
- python3 ~/.claude/skills/generating-mermaid-diagrams/scripts/query-org-metadata.py \
26
+ python3 ../../scripts/query-org-metadata.py \
27
27
  --objects Account,Contact,Case,Entitlement,ServiceContract,Asset \
28
28
  --target-org myorg
29
29
  ```
@@ -20,7 +20,7 @@ Pre-built data model for Salesforce Enterprise Territory Management (Territory2)
20
20
  Enrich diagram with live org data:
21
21
 
22
22
  ```bash
23
- python3 ~/.claude/skills/generating-mermaid-diagrams/scripts/query-org-metadata.py \
23
+ python3 ../../scripts/query-org-metadata.py \
24
24
  --objects Territory2Model,Territory2,Territory2Type,UserTerritory2Association,ObjectTerritory2Association \
25
25
  --target-org myorg
26
26
  ```
@@ -210,7 +210,7 @@ style std fill:#f0f9ff,stroke:#0369a1,stroke-dasharray:5
210
210
  Use the provided Python script for efficient metadata queries:
211
211
 
212
212
  ```bash
213
- python3 ~/.claude/skills/generating-mermaid-diagrams/scripts/query-org-metadata.py \
213
+ python3 ../scripts/query-org-metadata.py \
214
214
  --objects Account,Contact,Lead,Opportunity,Case \
215
215
  --target-org myorg \
216
216
  --output table
@@ -14,10 +14,7 @@ After generating the diagram, offer the user a localhost preview for real-time i
14
14
  2. Start preview server (runs in background):
15
15
  ```bash
16
16
  # From installed skill folder:
17
- python ~/.claude/skills/generating-mermaid-diagrams/scripts/mermaid_preview.py start --file /tmp/mermaid-preview.mmd
18
-
19
- # Or from project folder (if working locally):
20
- python [project-root]/skills/generating-mermaid-diagrams/scripts/mermaid_preview.py start --file /tmp/mermaid-preview.mmd
17
+ python ../scripts/mermaid_preview.py start --file /tmp/mermaid-preview.mmd
21
18
  ```
22
19
 
23
20
  3. Provide URL to user:
@@ -37,7 +34,7 @@ After generating the diagram, offer the user a localhost preview for real-time i
37
34
 
38
35
  When user is done:
39
36
  ```bash
40
- python ~/.claude/skills/generating-mermaid-diagrams/scripts/mermaid_preview.py stop
37
+ python ../scripts/mermaid_preview.py stop
41
38
  ```
42
39
 
43
40
  ## Preview Server Features
@@ -40,7 +40,7 @@ Ask for or infer:
40
40
  ## Core Operating Rules
41
41
 
42
42
  - Inspect DMO schema before creating mappings.
43
- - Run the shared readiness classifier before mutating harmonization assets: `node ~/.claude/skills/orchestrating-datacloud/scripts/diagnose-org.mjs -o <org> --phase harmonize --json`.
43
+ - Run the shared readiness classifier before mutating harmonization assets: `node ../orchestrating-datacloud/scripts/diagnose-org.mjs -o <org> --phase harmonize --json`.
44
44
  - Prefer `dmo list --all` when browsing the catalog, but use first-page `dmo list` for fast readiness checks.
45
45
  - Use `query describe` or `dmo get --json` instead of inventing unsupported describe flows.
46
46
  - Treat identity resolution runs as asynchronous and verify results after execution.
@@ -52,7 +52,7 @@ Ask for or infer:
52
52
 
53
53
  ### 1. Classify readiness for harmonize work
54
54
  ```bash
55
- node ~/.claude/skills/orchestrating-datacloud/scripts/diagnose-org.mjs -o <org> --phase harmonize --json
55
+ node ../orchestrating-datacloud/scripts/diagnose-org.mjs -o <org> --phase harmonize --json
56
56
  ```
57
57
 
58
58
  ### 2. Inspect the catalog
@@ -1,8 +1,7 @@
1
1
  ---
2
2
  name: implementing-ui-bundle-agentforce-conversation-client
3
- description: "Use this skill when the user asks to add, embed, integrate, configure, style, or remove an agent, chatbot, chat widget, conversation client, or AI assistant in a UI Bundle project. Covers styling (colors, fonts, spacing, borders), layout (inline vs floating, width, height, dimensions), and props (agentId, agentLabel, headerEnabled, showHeaderIcon, showAvatar, styleTokens). TRIGGER when: project contains a uiBundles/*/src/ directory and the task involves adding or modifying a chat widget, chatbot, or conversational AI; files under uiBundles/*/src/ import AgentforceConversationClient; user asks to add any chat or agent functionality to a page. DO NOT TRIGGER when: user wants to create a custom agent, chatbot, or chat widget component from scratch; the project has no uiBundles directory."
3
+ description: "Use this skill when the user asks to add, embed, integrate, configure, style, or remove an agent, chatbot, chat widget, conversation client, or AI assistant in a UI Bundle project. TRIGGER when: project contains a uiBundles/*/src/ directory and the task involves adding or modifying a chat widget, chatbot, or conversational AI; files under uiBundles/*/src/ import AgentforceConversationClient; user asks to add any chat or agent functionality to a page. DO NOT TRIGGER when: user wants to create a custom agent, chatbot, or chat widget component from scratch; the project has no uiBundles directory."
4
4
  metadata:
5
- author: ACC Components
6
5
  version: "1.1"
7
6
  package: "@salesforce/ui-bundle-template-feature-react-agentforce-conversation-client"
8
7
  sdk-package: "@salesforce/agentforce-conversation-client"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: investigating-agentforce-d360
3
- description: "Data Cloud 360° view of a single Agentforce session. Pulls 24 STDM + GenAI DMO rows via the DC Query REST API, assembles a hierarchical session tree (Interaction → Step → Generation → GatewayRequest), renders a human-readable summary with transcript + per-turn topic/action invocations + LLM generations + tool calls + audit chain. TRIGGER when user asks to trace, inspect, summarize, or describe a specific Agentforce session by session id (Agent Session UUID `019d…` or MessagingSession id `0Mw…`). Also triggers on session discovery — find/list/search sessions by time, agent, channel, outcome, or conversation text — when the user has no session id yet. DO NOT TRIGGER for design-time architecture questions (use investigating-agentforce-architecture instead) or for runtime perf/latency/SLO questions that require platform telemetry beyond Data Cloud."
3
+ description: "Data Cloud 360° view of a single Agentforce session. TRIGGER when user asks to trace, inspect, summarize, or describe a specific Agentforce session by session id (Agent Session UUID `019d…` or MessagingSession id `0Mw…`). Also triggers on session discovery — find/list/search sessions by time, agent, channel, outcome, or conversation text — when the user has no session id yet. DO NOT TRIGGER for design-time architecture questions (use investigating-agentforce-architecture instead) or for runtime perf/latency/SLO questions that require platform telemetry beyond Data Cloud."
4
4
  metadata:
5
5
  version: "1.0"
6
6
  ---
@@ -0,0 +1,164 @@
1
+ ---
2
+ name: managing-cdc-enablement
3
+ description: "Use to enable Salesforce Change Data Capture (CDC) on a standard or custom object, configure a custom event channel, set a filter expression, or add enrichment fields. TRIGGER broadly on any of: 'enable CDC', 'enable Change Data Capture', 'turn on CDC', 'subscribe X to change events', 'only emit events for', 'filter change events', 'enrich change events', 'create a custom event channel'; or any mention of CDC, change events, PlatformEventChannel, PlatformEventChannelMember, EnrichedField, ChangeEvents channel, enrichment fields, change event filter; or when the user wants a downstream system to receive Salesforce data changes; or when the user touches .platformEventChannelMember-meta.xml / .platformEventChannel-meta.xml files. SKIP when publishing platform events, Pub/Sub API or REST/SOAP (use building-sf-integrations), or ManagedEventSubscription (out of scope for CDC). Always use this skill for CDC channel-membership metadata."
4
+ metadata:
5
+ version: "1.0"
6
+ ---
7
+
8
+ # Managing Change Data Capture Enablement
9
+
10
+ Generate the metadata that subscribes Salesforce objects to Change Data Capture: `PlatformEventChannelMember` files for the default `ChangeEvents` channel or a custom channel, and `PlatformEventChannel` files for new custom channels. Covers enrichment fields, filter expressions, and the canonical naming and value formats that the Metadata API actually accepts (which differ from values that appear in many internal test fixtures and code-search hits).
11
+
12
+ ## Scope
13
+
14
+ - **In scope**: Generating `PlatformEventChannelMember` and `PlatformEventChannel` metadata for CDC. Subscribing standard objects, custom objects, or both. Configuring enrichment fields. Configuring filter expressions. Defining custom data channels.
15
+ - **Out of scope**: Publishing custom platform events (PE) — that's a different metadata type (`PlatformEvent`). Pub/Sub API or external Kafka/Bayeux configuration. Pricing/limits guidance — refer the user to the [CDC Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.change_data_capture.meta/change_data_capture/). Programmatic event-bus subscribers in Apex.
16
+
17
+ ---
18
+
19
+ ## Clarifying Questions
20
+
21
+ Before generating, confirm with the user if not already clear:
22
+
23
+ - Which entity (or entities) need CDC enablement? Standard, custom, or both?
24
+ - Default channel (`ChangeEvents`) or a custom channel? If custom, what's the channel label?
25
+ - Any enrichment fields needed? (Lookup IDs that the consumer needs even when they didn't change.)
26
+ - Any filter expression needed? (A SOQL-WHERE-clause body that gates which change events emit.)
27
+
28
+ ---
29
+
30
+ ## Required Inputs
31
+
32
+ Gather or infer before proceeding:
33
+
34
+ - **Source entity API name(s)** — e.g. `Account`, `Lead`, `Order__c`. The skill internally translates this to the **ChangeEvent entity name** (see Workflow step 2).
35
+ - **Channel** — either `ChangeEvents` (default) or the developer name of a custom channel ending in `__chn`.
36
+ - **Enrichment fields (optional)** — list of field API names on the source object whose values should be included in every change event.
37
+ - **Filter expression (optional)** — a predicate over fields on the change event payload (e.g. `Status__c != null`).
38
+
39
+ Defaults unless specified:
40
+ - Channel: `ChangeEvents` (the default CDC channel — no path prefix).
41
+ - Enrichment fields: none.
42
+ - Filter expression: none.
43
+
44
+ If the user provides a clear, complete request, generate immediately without unnecessary back-and-forth.
45
+
46
+ ---
47
+
48
+ ## Workflow
49
+
50
+ All steps are sequential. Do not skip or reorder.
51
+
52
+ **Before generating anything, know the only valid CDC metadata types:** CDC is expressed entirely through `PlatformEventChannelMember` (one per subscribed entity) and `PlatformEventChannel` (only for custom channels). Do NOT use `<ChangeDataCapture>`, `.changeDataCapture-meta.xml`, `changeDataCapture/` directories, `EnableChangeDataCapture`, or `ManagedEventSubscription` — these are not in scope for CDC. If you find yourself writing any of them, stop and use a `PlatformEventChannelMember` file instead.
53
+
54
+ 1. **Identify the channel** — if the user names a custom channel, you'll generate a `PlatformEventChannel` file (see step 4). Otherwise use the literal value `ChangeEvents` for the default channel.
55
+
56
+ 2. **Translate source entity to ChangeEvent entity name** — `<selectedEntity>` is the **ChangeEvent** type, NOT the source object:
57
+
58
+ | Source object | `<selectedEntity>` value |
59
+ |---|---|
60
+ | `Account` | `AccountChangeEvent` |
61
+ | `Lead` | `LeadChangeEvent` |
62
+ | `Contact` | `ContactChangeEvent` |
63
+ | `Order__c` (custom) | `Order__ChangeEvent` |
64
+ | `MyThing__c` (custom) | `MyThing__ChangeEvent` |
65
+
66
+ For standard objects: append `ChangeEvent`. For custom objects: replace the trailing `__c` with `__ChangeEvent` (the double-underscore is preserved).
67
+
68
+ 3. **Generate the channel-member file** — one file per `(entity, channel)` pair. **The filename and fullName always use a SINGLE underscore between the entity stem and `ChangeEvent`** — this is independent of how `selectedEntity` is formatted in the XML body. For custom objects, drop the `__c` from the source name when forming the filename:
69
+
70
+ | Source object | Filename (and fullName) | `<selectedEntity>` (in XML) |
71
+ |---|---|---|
72
+ | `Account` | `Account_ChangeEvent.platformEventChannelMember-meta.xml` | `AccountChangeEvent` |
73
+ | `Lead` | `Lead_ChangeEvent.platformEventChannelMember-meta.xml` | `LeadChangeEvent` |
74
+ | `Order__c` | `Order_ChangeEvent.platformEventChannelMember-meta.xml` (NOT `Order__ChangeEvent`) | `Order__ChangeEvent` |
75
+ | `MyThing__c` | `MyThing_ChangeEvent.platformEventChannelMember-meta.xml` (NOT `MyThing__ChangeEvent`) | `MyThing__ChangeEvent` |
76
+
77
+ The custom-object case is the easiest place to slip — the filename uses single underscore, the `selectedEntity` keeps its double underscore. Read `assets/PlatformEventChannelMember-template.xml` as the structural template.
78
+
79
+ 4. **For a custom channel**, generate a `PlatformEventChannel` file — required if any member references a non-default channel. Derive a DeveloperName from the user's label: strip spaces and non-alphanumeric characters, convert to CamelCase, then **always** append the literal suffix `__chn`. The filename and the channel's `<eventChannel>` reference must use this exact form, otherwise the deploy fails with `Invalid channel name`:
80
+
81
+ | User says | DeveloperName | Filename |
82
+ |---|---|---|
83
+ | `Partner Sync` | `PartnerSync__chn` | `PartnerSync__chn.platformEventChannel-meta.xml` (NOT `Partner_Sync...` or `PartnerSync...`) |
84
+ | `Order Updates` | `OrderUpdates__chn` | `OrderUpdates__chn.platformEventChannel-meta.xml` |
85
+ | `data sync` | `DataSync__chn` | `DataSync__chn.platformEventChannel-meta.xml` |
86
+
87
+ Members on this channel reference it by the same DeveloperName: `<eventChannel>PartnerSync__chn</eventChannel>`. Read `assets/PlatformEventChannel-template.xml`.
88
+
89
+ 5. **Add enrichment fields** if requested — repeat the `<enrichedFields><name>FIELD_API_NAME</name></enrichedFields>` block for each field. The name must be a **single-hop API name on the source entity** — verified working with: standard lookup IDs (`OwnerId`, `ParentId`), custom lookup fields (`MyLookup__c`), and custom non-relationship fields (`Region__c`, `Status__c`). Relationship traversals like `Owner.Name` or `Parent.Account.Industry` are rejected by deploy with "The selected field, X.Y, isn't valid".
90
+
91
+ 6. **Add a filter expression** if requested — wrap the predicate in `<filterExpression>...</filterExpression>`. The body is a WHERE-clause body without the `WHERE` keyword (e.g. `Status__c != null`, not `WHERE Status__c != null`). For supported operators, field types, and pitfalls, read `references/filter-expressions.md`.
92
+
93
+ ---
94
+
95
+ ## Rules / Constraints
96
+
97
+ | Constraint | Rationale |
98
+ |---|---|
99
+ | `<selectedEntity>` is the ChangeEvent type name, not the source object name | The Metadata API binds the member to a ChangeEvent entity — passing `Account` directly fails with "invalid event in selectedEntity". |
100
+ | Member fullName uses **single** underscore: `Account_ChangeEvent` | The double-underscore form (`Account__ChangeEvent`) is parsed as `<namespace>__<name>` and rejected: "Cannot create a new component with the namespace: Account". |
101
+ | Default channel value is exactly `ChangeEvents` — no path prefix | Older fixtures and some docs show `data/ChangeEvents`; the deploy returns "Unable to find the specified channel" for that value. |
102
+ | Enrichment field names are single-hop API names on the source entity | Standard (`OwnerId`), custom lookup (`MyLookup__c`), and custom non-relationship (`Region__c`) all validate. Traversals like `Owner.Name` are rejected: "The selected field, X.Y, isn't valid". |
103
+ | `<filterExpression>` body has no `WHERE` keyword | Deploy returns "filter expression has syntax errors: unexpected token: 'WHERE'". |
104
+ | Filter cannot reference `IsDeleted` or do relationship traversal (`Owner.Username`) | Deploy rejects with "field is invalid". |
105
+ | DateTime fields support **only equality** in filters (`=`, `!=`) — not `<` / `>` | Deploy returns "Only equality operators are supported for this field type or value". Use a named date literal: `LastModifiedDate = TODAY`. |
106
+ | Filter RHS must be a literal — no field-to-field comparison | `BillingCity = ShippingCity` returns "unexpected token: 'ShippingCity'". |
107
+ | Compound fields (e.g. `BillingAddress`) require dotted component access in filter | `BillingAddress.City = 'X'` deploys; flat `BillingCity` is rejected as "field is invalid"; raw `BillingAddress` is rejected as "has to be used with a component field". Note this is the OPPOSITE of `<enrichedFields>`, which uses flat names. |
108
+ | Custom channel filename ends with `__chn` before the meta-xml suffix | Salesforce's MDAPI naming convention; mismatch causes deploy ambiguity. |
109
+ | Custom channel XML must include `<channelType>data</channelType>` | Without `data`, the channel is rejected for CDC (other types exist for streaming/event channels). |
110
+ | Source custom objects must already exist (or be deployed in the same transaction) | The ChangeEvent entity for `Foo__c` doesn't exist until `Foo__c` does; member deploy fails otherwise. |
111
+ | Never generate a `PlatformEventChannel` file for the default `ChangeEvents` channel | The default channel is system-provided. Reference it via `<eventChannel>ChangeEvents</eventChannel>` on members, but only custom (`__chn`) channels need a channel-meta file. |
112
+ | `PlatformEventChannelMember` accepts ONLY four elements: `<enrichedFields>`, `<eventChannel>`, `<filterExpression>`, `<selectedEntity>` | Adding `<description>`, `<isActive>`, `<masterLabel>`, or any other element fails XML schema validation: "Element {...} invalid at this location". Stick to the four documented elements. |
113
+ | `PlatformEventChannel` accepts ONLY two elements: `<channelType>` and `<label>` | Adding `<masterLabel>`, `<description>`, etc. produces "Element {...}masterLabel invalid at this location in type PlatformEventChannel". Use `<label>`, not `<masterLabel>`. |
114
+ | Generated metadata files only — never run `sf project deploy start` from this skill | This skill produces artifacts; deployment is a separate lifecycle concern. |
115
+
116
+ ---
117
+
118
+ ## Gotchas
119
+
120
+ | Issue | Resolution |
121
+ |---|---|
122
+ | `Unable to find the specified channel` | Set `<eventChannel>ChangeEvents</eventChannel>` (no `data/` prefix). |
123
+ | `The PlatformEventChannelMember can't be created because it references an invalid event in the "selectedEntity" field` | Use the ChangeEvent name, not the source object: `AccountChangeEvent`, not `Account`. |
124
+ | `Cannot create a new component with the namespace: <Object>` | Rename the file to use a single underscore: `Account_ChangeEvent...`, not `Account__ChangeEvent...`. |
125
+ | `The selected field, X.Y, isn't valid` (in `<enrichedFields>`) | Replace `Owner.Name` with `OwnerId`. CDC enriches the lookup automatically; only single-hop field API names validate. |
126
+ | `filter expression has syntax errors: unexpected token: 'WHERE'` | Remove the `WHERE` keyword. The body is the predicate only. |
127
+ | `The BillingCity field in the filter expression is invalid` (or any flat Address component) | Use the compound dotted form: `BillingAddress.City`, not `BillingCity`. See `references/filter-expressions.md` for the full compound-field matrix. |
128
+ | Custom-object member fails with "ChangeEvent doesn't exist" | The source object isn't deployed yet. Ensure the `Foo__c` object metadata is in the same deploy or already in the org. |
129
+ | `DUPLICATE_VALUE` on second deploy | The member is already subscribed. Either delete first or skip — CDC doesn't support upsert on members directly. |
130
+ | `sf infra error (TypeInferenceError, DeployMetadata): Could not infer a metadata type` for a `.changeDataCapture-meta.xml` file | That file extension and metadata type don't exist. Replace the `changeDataCapture/<Entity>.changeDataCapture-meta.xml` file with a `platformEventChannelMembers/<Entity>_ChangeEvent.platformEventChannelMember-meta.xml` file. |
131
+ | User says "subscribe Order__c" but means standard `Order` | Confirm — `OrderChangeEvent` (standard) and `Order__ChangeEvent` (custom) are different entities. |
132
+
133
+ ---
134
+
135
+ ## Output Expectations
136
+
137
+ Deliverables:
138
+ - One `force-app/.../platformEventChannelMembers/<Entity>_ChangeEvent.platformEventChannelMember-meta.xml` per subscribed entity.
139
+ - One `force-app/.../platformEventChannels/<DevName>__chn.platformEventChannel-meta.xml` per custom channel (if any).
140
+
141
+ File structure follows the templates in `assets/`.
142
+
143
+ After receiving the generated files, the user can verify them with `sf project deploy start --dry-run -d <path> --target-org <alias>` before deploying. If a dry-run surfaces an unfamiliar error, `references/deploy-troubleshooting.md` maps the common deploy errors to their metadata-side fixes.
144
+
145
+ ---
146
+
147
+ ## Cross-Skill Integration
148
+
149
+ | Need | Delegate to |
150
+ |---|---|
151
+ | Generate the source custom object | `generating-custom-object` skill |
152
+ | Generate custom fields referenced by enrichment or filter | `generating-custom-field` skill |
153
+ | Build a permission set for users who consume change events | `generating-permission-set` skill |
154
+
155
+ ---
156
+
157
+ ## Reference File Index
158
+
159
+ | File | When to read |
160
+ |---|---|
161
+ | `assets/PlatformEventChannelMember-template.xml` | Step 3 — starting structure for a channel member |
162
+ | `assets/PlatformEventChannel-template.xml` | Step 4 — starting structure for a custom channel |
163
+ | `references/filter-expressions.md` | Step 6 — for the supported operators and field-type matrix when writing a filter expression |
164
+ | `references/deploy-troubleshooting.md` | When a user reports a dry-run deploy error and asks for help diagnosing it |
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <PlatformEventChannel xmlns="http://soap.sforce.com/2006/04/metadata">
3
+ <channelType>data</channelType>
4
+ <label>My Custom Channel</label>
5
+ </PlatformEventChannel>
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <PlatformEventChannelMember xmlns="http://soap.sforce.com/2006/04/metadata">
3
+ <!-- Optional: add one <enrichedFields><name>FIELD_API_NAME</name></enrichedFields> per field. Single-hop API names only (e.g. OwnerId, ParentId, MyLookup__c, Region__c). -->
4
+
5
+ <!-- Default CDC channel: ChangeEvents (no path prefix). For a custom channel, use its DeveloperName, e.g. PartnerSync__chn. -->
6
+ <eventChannel>ChangeEvents</eventChannel>
7
+ <!-- Optional: add <filterExpression>YOUR_PREDICATE</filterExpression> if needed (predicate body only, no WHERE keyword). -->
8
+
9
+ <!-- ChangeEvent entity name. Standard: <Object>ChangeEvent. Custom: replace __c with __ChangeEvent. -->
10
+ <selectedEntity>AccountChangeEvent</selectedEntity>
11
+ </PlatformEventChannelMember>