schema-validation

Validate and refresh the Revenue Cloud ERD against live Salesforce orgs and Core UDD source.

5|3|Updated Sep 9, 2026
One-click install
npx skills add https://github.com/SalesforceLabs/revenue-cloud-foundations --skill schema-validation-salesforcelabs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: schema-validation
Source: https://github.com/SalesforceLabs/revenue-cloud-foundations/tree/main/.cursor/skills/schema-validation
Command: npx skills add https://github.com/SalesforceLabs/revenue-cloud-foundations --skill schema-validation-salesforcelabs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Keeping the Revenue Cloud ERD (erd-data.json) aligned with the actual Salesforce platform schema is error-prone: releases add and retire fields, PDF-derived artifacts pollute the data, and org introspection alone cannot prove whether a missing field was removed or is merely feature-gated. This Skill provides the end-to-end workflow for validating, diffing, and certifying the ERD across releases. ## Core Features & Use Cases - Release refresh workflow: Extract schemas from two same-shape scratch orgs, diff against the previous release's committed snapshot, patch additions, and deliberately remove retired fields. - Orphan field classification: Classify fields missing from orgs as feature-gated RC fields, other-cloud fields, or PDF artifacts, verifying against canonical Core UDD source before removal. - Cross-release schema diffing: Compare schema JSON snapshots (e.g., 262 vs 264) with optional SFDMU data plan impact analysis. - Use Case: After a Salesforce release upgrade (e.g., 262 to 264), run the full refresh pipeline to add 70 new fields, remove 8 retired fields, repair null refersTo values, and regenerate the interactive HTML ERD. ## Quick Start Ask the agent to refresh the ERD for the new release by extracting schemas from two scratch orgs, diffing against the previous release snapshot, and validating the result.

Frequently Asked Questions about schema-validation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refresh the Revenue Cloud ERD after a Salesforce release upgrade?

Build two same-shape scratch orgs on the target release, extract schemas with extract_schema.py, diff against the previous release's committed snapshot using diff_schemas.py, then patch additions with validate_erd_against_org.py and manually remove retired fields before regenerating the HTML.

How do I classify orphan fields found in the ERD?

Orphans fall into three classes: feature-gated RC fields declared in RC UDD modules (keep), other-cloud fields from non-RC modules (decide), and PDF artifacts not declared anywhere (remove). Verify against Core UDD entity XML via codesearch before any removal.

Why doesn't validate_erd_against_org.py --patch remove retired fields?

The patch mode only adds fields; its fields_removed counter never increments, so a printed zero is unconditional. Retired fields must be removed deliberately from the diff's removed list, along with their relationship rows and recomputed stats.

Can I classify orphan fields using a single Salesforce org?

No. Org absence is never proof of removal because fields may be feature-gated. Use two orgs of the same release with complementary shapes, and require positive evidence from the release diff or Core UDD source before aggressive removal.

What Python version does the schema diff tooling require?

diff_schemas.py requires Python 3.10 or later because it uses X | None type annotations. Run it with the interpreter CumulusCI is installed under rather than an older system Python.