forcedotcom/sf-skills / skills/crm-analytics-wave-generate
crm-analytics-wave-generate
VerifiedUse to build a Wave Recipe, deploy a CRM Analytics dataset or dashboard, or author the full CRMA asset stack — apps, Wave Recipes (.wdpr), datasets, and dashboards — against a connected Salesforce org via REST and Metadata APIs, without CRM Analytics Studio or Dashboard Builder. TRIGGER when: user asks to build or create a Wave Recipe, generate a .wdpr or .wdpr-meta.xml, deploy a .wdash or .wapp, run a recipe or dataflowjob programmatically, upload CSV data via InsightsExternalData, validate a dataset schema with synthetic data, fetch dataset XMD, audit dashboard SAQL re-encoding, or find unused dataset fields. TRIGGER on keywords: Wave Recipe, CRMA, CRM Analytics, wdpr, wdash, wapp, WaveRecipe, Wave dataflow, dataflowjob, InsightsExternalData, SAQL, dataset XMD, Analytics Studio, R3 format, wave/recipes, wave/dashboards, or analytics on Salesforce objects (opportunities, leads, cases, accounts, sales). DO NOT TRIGGER for standard Salesforce reports or LWC components unrelated to CRM Analytics.
scripts/fetch_dataset_xmd.js
View on GitHub#!/usr/bin/env node
// Look up a dataset by name and dump its current-version XMD (dimensions / measures / dates).
// Use before generating synthetic data so the schema matches the live dataset.
// Usage: node scripts/fetch_dataset_xmd.js <alias> <datasetName>
const { execSync, execFileSync } = require("child_process");
function getOrgCredentials(alias) {
const result = execFileSync('sf', ['org', 'display', '-o', alias, '--json'], { encoding: "utf8" });
const json = JSON.parse(result);
return { accessToken: json.result.accessToken, instanceUrl: json.result.instanceUrl };
}
function apiFetch(instanceUrl, accessToken, path) {
const url = `${instanceUrl}${path}`;
const args = [
"-s",
"-H", `Authorization: Bearer ${accessToken}`,
"-w", "\\nHTTP_STATUS:%{http_code}",
url,
];
const raw = execSync(`curl ${args.map(a => `'${String(a).replace(/'/g, "'\\''")}'`).join(" ")}`, {
encoding: "utf8",
maxBuffer: 10 * 1024 * 1024,
});
const parts = raw.split("\nHTTP_STATUS:");
const httpStatus = parseInt(parts[1] || "0", 10);
if (httpStatus < 200 || httpStatus >= 300) {
throw new Error(`HTTP ${httpStatus} on GET ${path}: ${parts[0]}`);
}
return JSON.parse(parts[0]);
}
const [,, alias, datasetName] = process.argv;
if (!alias || !datasetName) {
console.error("Usage: node fetch_dataset_xmd.js <alias> <datasetName>");
process.exit(1);
}
const { accessToken, instanceUrl } = getOrgCredentials(alias);
// Find the dataset by name
const datasets = apiFetch(instanceUrl, accessToken, `/services/data/v59.0/wave/datasets`);
const dataset = (datasets.datasets || []).find(d => d.name === datasetName || d.developerName === datasetName);
if (!dataset) {
console.error(`Dataset "${datasetName}" not found.`);
process.exit(1);
}
// Fetch XMD for the current version
const versionId = dataset.currentVersionId;
const xmd = apiFetch(instanceUrl, accessToken, `/services/data/v59.0/wave/datasets/${dataset.id}/versions/${versionId}/xmd`);
console.log(JSON.stringify({
datasetId: dataset.id,
datasetName: dataset.name,
versionId,
xmd,
}, null, 2));
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |