Skip to content
AI & Agents
Skill

/consumer-goods-accruals-datakit-deploy

Use 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

From plugin
forcedotcom-sf-skills
1k200 skills2 agents14 commands3 MCP
Install
$ npx -y skills add forcedotcom/afv-library --skill consumer-goods-accruals-datakit-deploy --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/consumer-goods-accruals-datakit-deploy

Context preview

The summary Claude sees to decide when to auto-load this skill.

Use 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

SKILL.md

consumer-goods-accruals-datakit-deploy.SKILL.md
name: consumer-goods-accruals-datakit-deploy
description: "Use 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)."
metadata:
  version: "1.0"
  domains: ["Consumer Goods"]
  relatedSkills:
    - "consumer-goods-tpe-datakit-deploy"
    - "platform-dataspace-access-configure"
    - "platform-metadata-deploy"
    - "platform-soql-query"
  minApiVersion: "62.0"
  cliTools:
    - tool: ["node"]
      semver: ">=22.0.0"
    - tool: ["sf"]
      semver: ">=2.0.0"

MANDATORY: Always write the Phase 6 report

After completing all phases — including early stops, blocked phases, or error conditions — you MUST write the Phase 6 report to disk. Failure to write the report is always a test failure, regardless of how well you handled the scenario.

This applies to **ALL exit paths** without exception:

  • Normal completion (all phases ran)
  • Phase 1 stop (preflight failed, sales org not found, CGCloudAddons missing, Data Cloud not enabled)
  • Phase 3 error (setup script non-zero exit)
  • Phase 4 failure detection (DataKitDeploymentLog failures)
  • Schedule conflict (Phase 5 guard triggered)
  • Any other blocking condition (missing inputs, org unreachable, etc.)

Write the report to `${outputDir}/report.md` (the path from the `generatedFileLocationDirective` in the task). Do not print it as a chat message only — it must exist as a file on disk. If you handled a scenario correctly but never wrote the file, the eval will record `no_output` and score zero.

---

Deploy the Accrual Data Kit

Installs the TPM Liability Accruals solution into a Salesforce org end to end. Runs the full setup toolchain bundled in `scripts/`: checks the org is ready, verifies the Data Cloud connection, downloads the `CGCloudAddons` static resource, deploys the data kit, confirms the deployment, and schedules the Data Cloud export and accrual calculation chain.

Designed for **headless delivery**: point it at an org and it runs the full install.

The namespace differs per build: `cgcloud` (released), `cgcloud_dev` (dev/beta), or no prefix (source-only). The setup script auto-detects the prefix at runtime via the `DataCloudExportScheduler` Apex class query. **Never hardcode `cgcloud.` or `cgcloud_dev.`.**

Reference: [TPM Accrual Engine concept](https://help.salesforce.com/s/articleView?id=ind.tpm_concept_accruals.htm&type=5)

Run the setup script from the skill root directory:

node scripts/setup.js --org <alias> [options]

---

Inputs to collect

**Collect and validate ALL required inputs before running any Phase 1 checks.** Do not start Phase 1 until org alias and sales org name are both confirmed. If either is missing after asking, stop immediately and write the Phase 6 report.

Ask before starting — do not guess.

| Input | Default | Notes | |---|---|---| | **Org alias / username** | — | `sf` alias of the target org. Required. | | **Sales org name** | — | Used to name the Data Space (`DataSpace_<salesOrg>`), its prefix (`DS<lastChar>_`), and the UI controller map key. **Required. Must be exactly 4 alphanumeric characters (e.g. `0001`, `AB12`). If the user has not provided it and cannot provide it, do NOT guess or use any default value — stop immediately, write the Phase 6 report with Phase 1 blocked ("sales org name not provided"), and end the session. Do not run any Phase 1 checks without it.** | | **Skip Data Space?** | no | Yes only if the org has no Data Spaces (some demo orgs). | | **Dry run?** | no | Prepares files; skips all deploys and scheduling. Offer this first. | | **Namespace override** | auto-detected | Pass only if auto-detection would fail. Value WITHOUT trailing `__`. | | **Export cron** | `0 0 2 * * ?` | Only prompt if user requests a different schedule. | | **Accrual chain cron** | `0 0 3 * * ?` | Only prompt if user requests a different schedule. |

The dry-run flag is collected once here and honored through all phases — do not re-prompt.

---

Phase 1 — Preflight

Stop on first failure. Do not continue past a failed check.

1.1 Local tooling

1. **Salesforce CLI present:** `sf --version` 2. **Node 22:** `node --version`

1.2 Org reachable

sf org display --target-org <alias> --json

Confirm `status` is `Active`. Capture `id` (org id), `instanceUrl`, `apiVersion`. Non-zero exit or inactive status → stop, ask user to log in.

1.3 Data Cloud Data Kit framework present

sf data query --target-org <alias> \
  --query "SELECT Id FROM DataKitDeploymentLog LIMIT 1"

`INVALID_TYPE` or `NOT_FOUND` → **stop immediately**: the Data Cloud Data Kit framework is not enabled in this org. Tell the user they must enable Data Cloud and the Data Kit feature before this skill can proceed. Write the Phase 6 report now with Phase 1 blocked and the exact query error. Do NOT run any further queries, downloads, or deploys. Zero rows is fine — the framework is present, continue to Phase 1.4.

1.4 CGCloudAddons static resource present

sf data query --target-org <alias> \
  --query "SELECT Id FROM StaticResource WHERE Name='CGCloudAddons'"

Zero rows → **stop immediately**: the managed package is not installed (or this version does not ship `CGCloudAddons`). Tell the user the package must b

Read more
Ships withforcedotcom-sf-skills

This repository provides a curated collection of Salesforce agent skills for building applications.

Get the whole plugin

Other skills on forcedotcom-sf-skills.