Skip to content

forcedotcom/sf-skills / skills/crm-analytics-wave-generate

crm-analytics-wave-generate

Verified

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

references/scripts-reference.md

View on GitHub
# Scripts Reference

All scripts accept org alias as the first positional arg and read `accessToken` + `instanceUrl` from `sf org display -o <alias> --json`.

| Script | Purpose | Usage |
|--------|---------|-------|
| `scripts/create_app.js` | Idempotently create a CRMA app (folder). Lists existing folders first; only creates if missing. Do NOT include `assetIcon`. | `node scripts/create_app.js <alias> <appName>` |
| `scripts/deploy_and_run_recipe.js` | Create + compile + run a recipe end-to-end. POSTs or PATCHes via `findExistingRecipe` upsert logic. Polls until terminal. | `node scripts/deploy_and_run_recipe.js <alias> <recipeFile.wdpr> <appName> <recipeName>` |
| `scripts/probe_recipe.js` | Fetch a recipe with `?format=R3` and print compile status + `targetDataflowId`. | `node scripts/probe_recipe.js <alias> <recipeId>` |
| `scripts/fetch_dataset_xmd.js` | Look up a dataset by name and dump its current-version XMD (dimensions / measures / dates). Use before generating synthetic data so the schema matches. | `node scripts/fetch_dataset_xmd.js <alias> <datasetName>` |
| `scripts/gen_synthetic_dataset.js` | Schema-driven synthetic data generator. Reads live XMD, classifies each column by name pattern (`*Id`, `*Industry`, `*Year`, `*Amount`), renames dotted fields to underscored, writes CSV + Wave-compatible `metadata.json`. Default target: `<source>_Synthetic`. | `node scripts/gen_synthetic_dataset.js <alias> <sourceDatasetName>` |
| `scripts/upload_dataset.js` | Upload a CSV to a new or existing dataset via InsightsExternalData API. Polls until ingestion is terminal. | `node scripts/upload_dataset.js <alias> <csvPath> <metadataJsonPath> <datasetAlias> <folderId>` |
| `scripts/verify_synthetic_dataset.js` | Post-upload SAQL sanity checks: row count, sum/min/max, edge-case counts, group-by-dimension breakdowns. | `node scripts/verify_synthetic_dataset.js <alias> <datasetId> <versionId>` |
| `scripts/find_unused_dataset_fields.js` | Given a dataset name, list every XMD field that no dashboard SAQL references. | `node scripts/find_unused_dataset_fields.js <alias> <datasetName>` |
| `scripts/verify_dashboard_steps.js` | For each step in a deployed dashboard, GET stored SAQL, decode HTML entities, swap dataset name for `id/version`, POST to `/wave/query`. Prints HTTP status + row count per step. Update `DASH_ID` and `DS` constants at the top before running. | `node scripts/verify_dashboard_steps.js <alias>` |
| `scripts/patch_t_oppo_view.js` | Full-cycle PATCH template: GET state → `decodeAll` every step query → merge dark theme → PATCH. Use as the canonical pattern for future dashboard PATCH scripts. | `node scripts/patch_t_oppo_view.js <alias>` |
| `scripts/check_connector_error.sh` | GET `/wave/dataConnectors/{id}`, parse `errorCategory`, exit 0 if `System` (safe to retry), exit 1 if `User`/`Limit`/unknown (do not retry — fix config first). | `bash scripts/check_connector_error.sh <alias> <connectorId>` |
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: 471kUpdated Claude CodeCodexVerifiedInstall
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: 471kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall