schema-validation

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

33|12|Updated Sep 24, 2024
One-click install
npx skills add https://github.com/bgaldino/rlm-base-dev --skill schema-validation-bgaldino
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: schema-validation
Source: https://github.com/bgaldino/rlm-base-dev/tree/main/.cursor/skills/schema-validation
Command: npx skills add https://github.com/bgaldino/rlm-base-dev --skill schema-validation-bgaldino

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 differences make it hard to tell a removed field from a feature-gated one. This Skill provides the validated workflow, scripts, and classification rules to keep the ERD accurate so AI agents grounded on it stay correct. ## Core Features & Use Cases - Release refresh workflow: Extract schemas from 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, with safe-only removal and mandatory backups. - Core UDD verification: Cross-check field ownership against canonical Core UDD entity XML via codesearch before bulk removals. - Use Case: After a 262 → 264 release upgrade, build two scratch orgs, extract and diff their schemas, patch the ERD with 70 new fields, remove the 8 retired fields, regenerate the HTML ERD, and re-validate to zero gaps. ## Quick Start Ask the agent to refresh the Revenue Cloud ERD for the new release by extracting schemas from two scratch orgs, diffing against the previous release snapshot, and re-validating until gaps and missing fields reach zero.

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 --patch 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 before any bulk removal.

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

The patch mode is add-only: it never increments its fields_removed counter and only writes attributes for fields it is adding. Retired fields must be removed deliberately from the release 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.

Does the ERD include custom fields like RLM_*__c?

No. The ERD reflects platform schema only, and every validator and extraction script excludes any field with a __c suffix, including project and managed-package fields. Pass --include-custom only for project-internal tooling.