/sf-industries:consumer-goods-tpe-datakit-deployfrom Salesforce — Industries
Deploys TPM Accruals Data Kit components for Trade Promotion Effectiveness dashboards into a Salesforce org. Collects TPM System Admin username, dry-run preference, and verifies TPM Data Connector status before deploying.
Ships in Salesforce — Industries. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Deploys the TPM Accruals Data Kit and its DMO mappings into a Salesforce org. Standalone and self-contained — runs on its own, or as a delegated step invoked by consumer-goods-tpe-dashboard-configure (Step 7), which passes through its own already-collected username and dry-run flag rather than this skill re-deriving them.
Ask before starting, unless already supplied by a calling skill. Do not guess.
sf CLI. Verify via the sibling
script, never sf org display --json directly — that command's raw output includes
accessToken (a live credential), which this script strips before printing:
node ./scripts/sf-rest.js org-status --target-org <username>
Prints {"username","alias","connectedStatus","orgId"}. Non-zero exit or
connectedStatus != "Connected" ⇒ stop, ask the user to log in themselves.FieldPermissions writes and Phases 3-5 (deploy) are skipped and recorded as pending — not run (dry-run).Data Cloud Salesforce Connector permission set, which won't exist until this connection is configured) — ask them to activate/configure it first, then re-run this check.consumer-goods-tpe-dashboard-configure, it passes through both results already confirmed in its own earlier phases; reuse them, don't re-ask or re-query. When invoked standalone, confirm each directly:
Name to the user), then check the assignment:
sf data query --target-org <username> --query "SELECT Label FROM PermissionSet WHERE Name = 'GenieAdmin'"
sf data query --target-org <username> \
--query "SELECT PermissionSet.Name FROM PermissionSetAssignment WHERE Assignee.Username = '<username>' AND PermissionSet.Name = 'GenieAdmin'"
Missing ⇒ tell the user the Label from the first query (e.g. "User <username> is missing the <Label> permission set. Assign it now?") and ask permission to assign before continuing:
sf data create record --sobject PermissionSetAssignment \
--values "AssigneeId=<userId> PermissionSetId=<psId>" --target-org <username>
If declined, skip and note it in the report.NS) — when invoked as a delegated step, consumer-goods-tpe-dashboard-configure passes through its already-detected NS (raw namespace string); reuse it, don't re-detect. When invoked standalone, detect it once yourself, before Phase 1, with the sibling script:
node ./scripts/detect-namespace.js --target-org <username>
Prints {"NS","NS_SEGMENT","NS_APEX","NS_FIELD"} as one line of JSON. Store all four and reuse everywhere below.DataKitDeploymentLog Id now, before any deploy work, to avoid a CreatedDate clock-skew false-negative in Phase 5:
sf data query --target-org <username> \
--query "SELECT Id FROM DataKitDeploymentLog ORDER BY CreatedDate DESC LIMIT 1" --json
Store as LAST_ID_BEFORE_DEPLOY (empty if zero rows).CGCloudAddons — this skill fetches it itself rather than asking the user to do it manually.
node ./scripts/download-static-resource.js \
--target-org <username> --name CGCloudAddons
Capture STATIC_RESOURCE_PATH=<dir> from stdout as <addons_root> — every path below is relative to it (e.g. <addons_root>/TPM/Accruals/TPM Accruals Data Kit). Zero StaticResource rows ⇒ block: the package version installed in this org doesn't ship CGCloudAddons. Any other script failure ⇒ block and relay its stderr verbatim.Two sibling scripts drive this phase — never hand-roll the parsing or the grant calls; see each script's own docstring for exactly what it does and why:
{sobject, fields[]} list from the downloaded package (read-only, always safe to run):
node ./scripts/extract-crm-field-permissions.js \
--dir "<addons_root>/TPM/Accruals/TPM Accruals Data Kit/force-app/main/default/dataSourceObjects" \
> /tmp/crm-field-permissions.json
Zero entries in the output ⇒ block and report — shouldn't happen if Phase 1 succeeded.--dry-run — read-only: permission set, sobject/describe, existing FieldPermissions/ObjectPermissions rows) — don't show the user anything yet, this is just to find out whether there's anything to do:
node ./scripts/update-field-permissions.js \
--target-org <username> --input /tmp/crm-field-permissions.json --dry-run
{"error":"permission_set_not_found",...} ⇒ stop this phase, mark it blocked, and tell the user: "Could not find the 'Data Cloud Salesforce Connector' permission set — a likely explanation is that Salesforce CRM hasn't been configured yet (Setup → Data Cloud → Salesforce CRM). Please configure that first, then re-run this phase."wouldGrant or objectWouldGrant is non-empty, show the user exactly that diff (not the full extracted list) and get an explicit go-ahead before writing anything. If both are empty, everything's already granted — skip straight to step 5, no confirmation needed.node ./scripts/update-field-permissions.js \
--target-org <username> --input /tmp/crm-field-permissions.json
Exit code 3 (or a non-empty failed[]/objectFailed[]) ⇒ don't guess a workaround — prompt the user to do it manually via Setup → Permission Sets → Data Cloud Salesforce Connector → Object Settings, using exactly the failed[]/objectFailed[] list, and note each in the report.granted/alreadyGranted/notFlsEligible/failed, objectGranted/objectAlreadyGranted/objectFailed), for the final report. Dry-run mode (never proceed to step 4 when in dry run mode as it updates permissions, step1 and step2 can be run as they are read only)objectGranted/objectAlreadyGranted entries with permissionsViewAllRecords: false are expected for a small, fixed set of sobjects (currently just Product2) whose license blocks that flag — this is a known platform restriction the script applies silently; don't flag it to the user or treat it as something needing manual Setup action.<addons_root>/TPM/Accruals/TPM Accruals Data Kit, find-and-replace every instance of the placeholder __SF_ORG_ID__ with the org's 15-digit Id. Get the org Id via the following sibling script
node ./scripts/sf-rest.js org-status --target-org <username>
Take the orgId field from the printed JSON and truncate it to 15 chars (this call is cheap and idempotent — always re-run it here rather than relying on the Inputs step 1 result still being in context).sf project deploy start --target-org <username>
<addons_root>/TPM/Accruals/DmoMappings:
sf project deploy start --target-org <username>
<addons_root>/TPM/Accruals/Accruals Data Kit Deployment Scripts:
SF_ORG_ALIAS=<username> node deploy-tpm-tpe.js
This script POSTs to /services/data/v67.0/actions/custom/flow/sfdatakit__DeployDataKitComponents and returns an async Flow interview guid immediately; that response alone doesn't mean success — always confirm via the DataKitDeploymentLog check in Phase 5. This script runs from inside the downloaded/unzipped static resource.sf data query --target-org <username> \
--query "SELECT Id, DeploymentStatus, ComponentName, DeploymentError, CreatedDate FROM DataKitDeploymentLog WHERE Id > '<LAST_ID_BEFORE_DEPLOY>' ORDER BY CreatedDate DESC"
Every row for this run must have DeploymentStatus = 'Successful' and a blank DeploymentError. Never claim success while any row is Failure or has a non-empty error.
Alternative UI check: Data Cloud Setup → Data Kits → TPM Accruals → Local Deployment History → status Successful.
FlowDefinition is not SOQL-queryable — don't probe it for readiness.sfdatakit__DeployDataKitComponents ApexClass probe can return 0 rows even when the framework is live — prefer probing DataKitDeploymentLog directly (Phase 5), never the Apex class.DataKitDeploymentLog row for this run is Failure or has a non-empty DeploymentError.CGCloudAddons StaticResource (via download-static-resource.js) — never deploy or modify it; the org's own sf-authenticated access token drives the download, never a hardcoded credential.FlowDefinition or the sfdatakit__DeployDataKitComponents Apex class for readiness — probe DataKitDeploymentLog instead.README.md (or any other in-package documentation bundled inside CGCloudAddons) for deployment guidance — follow this skill's phases exactly as written. If a script name or path documented here doesn't match what's actually in the downloaded package, that's a bug in this skill to fix (update the skill itself), not a cue to switch to package docs at runtime.deploy-tpm-tpe.js.update-field-permissions.js without --dry-run first. If its wouldGrant/objectWouldGrant come back non-empty, never run for real without showing the user that exact diff and getting an explicit go-ahead — same as any other write in this skill. If both are empty, no confirmation is needed; proceed straight to reporting.update-field-permissions.js only ever adds — a new FieldPermissions/ObjectPermissions row where none existed, or flipping an existing row's off flag (PermissionsRead, or PermissionsViewAllRecords at the object level) to true. Never call it in a way that deletes a row, weakens an existing grant, or touches PermissionsCreate/Edit/Delete/ModifyAllRecords.sfdc_a360_sfcrm_data_extract ("Data Cloud Salesforce Connector") permission set is missing or a field/object ends up in update-field-permissions.js's failed[]/objectFailed[] — stop and prompt the user to grant field-level or object-level security manually via Setup (see Phase 2).Produce a final report (pass/blocked/pending) covering: CRM stream field permissions (per-object field list from extract-crm-field-permissions.js, and each field's granted/alreadyGranted/notFlsEligible/failed outcome from update-field-permissions.js — flag any notFlsEligible entry with onObject: false separately, since that's a package/org data mismatch, not a normal skip), CRM stream object-level permissions (each sobject's objectGranted/objectAlreadyGranted/objectFailed outcome from the same script — a permissionsViewAllRecords: false on Product2 specifically is expected and not worth calling out), preflight (connector status), metadata deploy, DMO mapping deploy, deployment script run, and the DataKitDeploymentLog verification result (row count, any failures). This is exactly what consumer-goods-tpe-dashboard-configure Step 7 relays as its own result when this skill is invoked via delegation.
When invoked via delegation (the calling skill used the Skill tool to reach this file, rather than the user directly): this report is an intermediate result, not the end of the task. Return it to the calling skill and let it continue with its own next phase — do not present this report to the user as the final answer and stop. Only surface this report directly to the user when this skill was invoked standalone.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub reej-consulting/reej-sf-skills --plugin sf-industries33 skills in this plugin
/consumer-goods-accruals-datakit-deployUse this skill to deploy the TPM Liability Accruals data kit end to end to a Salesforce org. Invoke when a customer or teammate wants to install the accrual engine, verify the Data Cloud connection, deploy the Data Kit components, and schedule the export and accrual calculation chain. Trigger phrases include: 'deploy the accrual data kit', 'set up liability accruals', 'install TPM accruals', 'headless accruals setup', 'configure the Data Cloud export connector', 'schedule the accrual chain'. Do NOT use for creating a Data Space alone (use platform-dataspace-access-configure), for generic Salesforce metadata deployment (use platform-metadata-deploy), for querying org data only (use platform-soql-query), or when setting up the data kit for the Trade Promotion Effectiveness (TPE) feature (use consumer-goods-tpe-datakit-deploy instead)./consumer-goods-promotion-bo-api-deployUse to enable the Consumer Goods Cloud TPM Promotion Business Object (BO) API framework in a Salesforce org, interview the user for the custom Workflow Step they want to add, generate and deploy that Apex class, wire it into the create/update/copy workflows, and prove it end-to-end via headless REST ingest. Ships a worked reference example (SetCommentValue) but the customization is user-supplied per org. Triggers on "deploy the promotion BO API", "set up promotion BO API", "headless promotion create", "add a BO API workflow step"./consumer-goods-rtr-datacloud-export-configureConfigure a Trade Promotion Management (TPM) org's RTR (Real Time Reporting) export pipeline to push promotion measures into Data Cloud (Data 360) for Trade Promotion Effectiveness (TPE) dashboards. Use when a customer or admin wants to set up the RTR export for Data Cloud measures, configure the RTR report for TPE, or as a delegated step from consumer-goods-tpe-dashboard-configure./consumer-goods-sync-management-configureUse this skill to set up Salesforce Consumer Goods (CG) Cloud Mobile Sync end-to-end for the Sync Management App managed package — it runs all three acts in order (Act 1 Setup Sync, Act 2 Assign Users, Act 3 Plan & Verify), not just installing the baseline, so a sales rep can see the day's planned visits offline. Use it when asked to "set up CG Cloud mobile sync", "configure Consumer Goods mobile sync", "set up sync for Retail Execution", "install the sync baseline", "assign a user to the sync configuration", "verify the sync setup", or "why can't my rep see their planned visits offline" when sync setup or the baseline install is suspected. DO NOT TRIGGER for general CG Cloud mobile-app troubleshooting unrelated to sync setup, for authoring new or custom sync baselines (this installs only shipped baselines discovered at runtime), or for building or customizing the mobile app UI itself — those are out of scope./consumer-goods-tpe-dashboard-configureEnd-to-end headless setup of Trade Promotion Effectiveness (TPE) dashboards for a Trade Promotion Management (TPM) Cloud org, covering tenant pairing checks, permission sets, SSOT and Tableau Next enablement, C360 SDM verification, the TPM Accruals data kit install, business-period export, RTR Data Cloud export configuration, the TPM_PROMOTION_MEASURE Data Transform, TPE Analytics app install, and optional KPI dashboard customization. Use when a customer or admin wants to set up TPE dashboards, enable Trade Promotion Effectiveness, install the TPE analytics app, or set up and customize TPE dashboards with their own KPIs./consumer-goods-tpe-dashboard-custom-kpi-configureCustomize the Trade Promotion Effectiveness (TPE) Analytics dashboards' generic KPI slots (Promotion Measure 1-3, Tactic Measure 1-2) with customer-chosen KPI measure codes and display names, without touching the shipped base model. Use when a customer/admin wants to "customize TPE dashboards", "change the KPIs on the Promotion/Tactic Analysis dashboard", or "swap in our own measure codes on the TPE dashboard".3 plugins in 2 repositories ship this exact skill · first indexed Sep 11, 2026
Other plugins' skills for the same job