Skip to content

forcedotcom/sf-skills / plugins/builder/consumer-goods/skills/consumer-goods-rtr-datacloud-export-configure

consumer-goods-rtr-datacloud-export-configure

Verified

Configure 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.

FileKindSize
SKILL.mdskill md7.8 KB
references/inputs-and-namespace.mdmarkdown5.3 KB
references/procedure.mdmarkdown16.8 KB
scripts/detect-namespace.jsexecutablescript2.3 KB
scripts/render-apex.jsexecutablescript2.0 KB
scripts/resolve-id-by-name.jsexecutablescript1.5 KB
scripts/sf-rest.jsexecutablescript5.7 KB
scripts/soql-escape.jsexecutablescript882 B
scripts/upsert-report-config.apexother2.3 KB
scripts/upsert-system-setting.apexother722 B

scripts/detect-namespace.js

View on GitHub
#!/usr/bin/env node
/**
 * Detects this org's namespace and derives every prefixed form this skill
 * needs, replacing the manual "run sf, read the JSON, compute NS_* by hand"
 * steps in SKILL.md's Namespace detection section. Same canonical procedure
 * as `setup-tpe-dashboard`'s Namespace detection step — never re-derive a
 * different way:
 *   1. `sf package installed list` — find the "Consumer Goods Cloud" entry,
 *      NS = its SubscriberPackageNamespace.
 *   2. Not found (source-deployed/dev-beta org) ⇒ `sf org display`'s
 *      `result.namespace`.
 *   3. Still null/blank ⇒ NS = "" (genuinely unnamespaced org).
 *
 * CLI usage:
 *   node detect-namespace.js --target-org <username>
 *
 * Prints one line of JSON to stdout: {"NS","NS_SEGMENT","NS_APEX","NS_FIELD"}.
 * Exit codes: 0 = success, 2 = usage/CLI error.
 */

const { execFileSync } = require('child_process');

function sfJson(cliArgs) {
  const raw = execFileSync('sf', cliArgs, { encoding: 'utf8' });
  return JSON.parse(raw).result;
}

function detectNamespace(targetOrg) {
  const packages = sfJson([
    'package', 'installed', 'list',
    '--target-org', targetOrg, '--json',
  ]);
  const cgCloud = (packages || []).find(
    (p) => p.SubscriberPackageName === 'Consumer Goods Cloud'
  );
  if (cgCloud && cgCloud.SubscriberPackageNamespace) {
    return cgCloud.SubscriberPackageNamespace;
  }

  const { namespace } = sfJson([
    'org', 'display',
    '--target-org', targetOrg, '--json',
  ]);
  return namespace || '';
}

function deriveForms(NS) {
  return {
    NS,
    NS_SEGMENT: NS ? `${NS}/` : '',
    NS_APEX: NS ? `${NS}.` : '',
    NS_FIELD: NS ? `${NS}__` : '',
  };
}

function parseArgs(argv) {
  const args = {};
  for (let i = 0; i < argv.length; i += 1) {
    const token = argv[i];
    if (!token.startsWith('--')) continue;
    args[token.slice(2)] = argv[i + 1];
    i += 1;
  }
  return args;
}

function requireArg(args, name) {
  if (!args[name]) {
    console.error(`Missing required --${name}`);
    process.exit(2);
  }
  return args[name];
}

function main() {
  const args = parseArgs(process.argv.slice(2));
  const targetOrg = requireArg(args, 'target-org');
  const NS = detectNamespace(targetOrg);
  process.stdout.write(JSON.stringify(deriveForms(NS)));
}

if (require.main === module) {
  main();
}

module.exports = { detectNamespace, deriveForms };
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall