forcedotcom/sf-skills / skills/dx-org-analyze
dx-org-analyze
VerifiedCompare two Salesforce orgs side-by-side and produce a comparison report with drift score, or analyze a single org to produce an inventory covering metadata components, org permissions, system permissions, profiles, installed packages, licenses, and org limits. Use this skill when the user wants to compare orgs, diff orgs, audit configuration drift, find what changed between two environments, compare sandbox against production, or analyze a single org. Trigger phrases include: 'compare orgs', 'compare these 2 orgs', 'compare my orgs', 'diff orgs', 'org diff', 'what is different between these orgs', 'compare metadata', 'org comparison', 'audit org differences', 'compare sandbox to production', 'introspect org', 'org inventory', 'what is in my org', 'analyze org', 'org analysis', 'analyze my org', 'analyze my Salesforce org'. Do NOT use for retrieving metadata (use platform-metadata-retrieve), deploying metadata (use platform-metadata-deploy), or switching orgs (use dx-org-switch).
| File | Kind | Size |
|---|---|---|
| README.md | markdown | 13.3 KB |
| SKILL.md | skill md | 10.7 KB |
| references/collection-details.md | markdown | 3.3 KB |
| references/report-format.md | markdown | 3.0 KB |
| scripts/collect_org_data.pyexecutable | script | 36.5 KB |
| scripts/compute_diff.pyexecutable | script | 46.5 KB |
| scripts/introspect_org.pyexecutable | script | 15.5 KB |
| tests/README.md | markdown | 1.8 KB |
| tests/fixtures/org_a.json | config | 2.6 KB |
| tests/fixtures/org_b.json | config | 2.3 KB |
| tests/test_compute_diff.shexecutable | script | 10.2 KB |
| tests/test_consistency.shexecutable | script | 13.4 KB |
tests/README.md
View on GitHub# dx-org-analyze Tests
Structural consistency tests and diff computation tests for the `dx-org-analyze` skill.
## What's covered
| Test | What it checks |
|------|----------------|
| `test_consistency.sh` | Frontmatter fields, SF CLI auth documented, drift formula, severity levels, public API usage, no internal tool references, core rules |
| `test_compute_diff.sh` | Diff computation against fixture data: metadata, permissions, org values, packages, licenses, markdown report structure |
## What's not covered
- **Live org comparison** — requires two authenticated orgs. Keep as manual smoke test.
- **Drift calculation accuracy** — verify manually against known org pairs.
- **Package comparison** — requires real managed packages on the instance.
- **OrganizationSettingsDetail** — not available on all editions; test graceful fallback manually.
## Running
```bash
# Run all tests
bash tests/test_consistency.sh && bash tests/test_compute_diff.sh
# Run individually
bash tests/test_consistency.sh # Skill structure tests
bash tests/test_compute_diff.sh # Diff computation tests
```
Exit code `0` on pass, `1` on fail.
## Manual smoke checklist
- [ ] Triggers on "compare these two orgs"
- [ ] Lists authenticated orgs from `sf org list`
- [ ] Asks user to pick source and target
- [ ] Handles `sf org login web` when org not authenticated
- [ ] Report order: Drift Score → Summary → Details
- [ ] Drift percentages are 0-100%
- [ ] Shared components show field/body-level diff
- [ ] Permissions categorized correctly
- [ ] Handles 0 packages gracefully
- [ ] Handles different editions without breaking
- [ ] Gracefully degrades when OrganizationSettingsDetail unavailable
- [ ] Falls back to SecurityHealthCheckRisks for settings
- [ ] REST /limits/ endpoint populates org values
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: 472k | 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: 472k | 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: 472k | 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 |