Salesforce Metadata Review Skill
Purpose
This skill reviews pasted or exported Salesforce metadata for quality,
maintainability, security, and compliance indicators. It flags
over-customization, unused fields, hardcoded IDs, and deprecated metadata
types, and produces a structured findings report. It does not access live
orgs and does not authorize changes.
When to use
- A metadata export (objects, fields, layouts, profiles, permission sets,
sharing rules) needs review before a release.
- A code review has surfaced questions about the metadata surface.
- A technical debt assessment requires metadata-level findings.
- An audit requires documentation of deprecated or risky metadata patterns.
When not to use
- Full org posture assessment — use
salesforce-org-assessment-skill.
- Permission topology review across profiles and permission set groups — use
salesforce-permission-model-review-skill.
- Automation logic review (Flow XML, validation rules) — use
salesforce-flow-automation-review-skill.
- Live production change review — use
salesforce-live-change-approval-protocol.
Minimum payload (required inputs)
- One or more sanitized metadata exports: object XML, field definitions,
layout XML, profile XML, permission set XML, sharing rule XML, or equivalent.
- Metadata type(s) being reviewed.
- Context: release context, org type (production/sandbox placeholder), business use case.
Workflow
Object and field review
- Identify fields with zero or low usage indicators (no referenced automation, no layout placement).
- Flag fields with hardcoded IDs in default values or formula expressions.
- Flag objects with excessive custom field counts (> configurable threshold).
- Identify deprecated field types (Text Area vs Rich Text Area misuse, currency without multi-currency awareness).
- Flag custom objects that duplicate standard object functionality.
Layout review
- Page layouts: flag layouts with > configurable threshold components; flag required fields not aligned with business process.
- Lightning record pages
: flag components using hardcoded record IDs or hardcoded URLs.
- Flag layouts assigned to no profiles or permission sets (orphaned).
Profile and permission set review
- Flag profiles with excessive object permissions (Create/Edit/Delete/ViewAll/ModifyAll on sensitive objects).
- Flag permission sets with duplicate coverage of profile permissions (redundant grants).
- Flag permission sets with no assignees (orphaned).
- Flag profiles granting API access without IP restrictions.
Sharing rule review
- Identify sharing rules that effectively expose all records to a broad group.
- Flag criteria-based sharing rules with conditions that evaluate to always-true.
- Flag sharing rules on objects with OWD = Public Read/Write (redundant).
Deprecated metadata types
- Flag use of: workflow rules, Process Builder
(deprecated),
legacy assignment rules (where Flow equivalent exists), Visualforce pages in Lightning context
without Lightning migration plan.
Hardcoded ID detection
- Flag any string matching Salesforce ID patterns (15- or 18-character alphanumeric) in:
field defaults, formula fields, validation rule expressions, layout XML.
Evidence requirements
- Sanitized metadata XML or equivalent export; no credentials, session tokens, or customer data.
- If metadata contains what appears to be record-level data (not schema), decline and ask for schema-only.
Output format
metadata_review_findings:
objects_and_fields:
- finding: [description]
severity: Critical | High | Medium | Low
evidence: [what in the metadata supports this]
recommendation: [brief]
layouts:
- finding: [description]
severity: [tier]
evidence: [...]
recommendation: [...]
profiles_and_permission_sets:
- finding: [description]
severity: [tier]
evidence: [...]
recommendation: [...]
sharing_rules:
- finding: [description]
severity: [tier]
evidence: [...]
recommendation: [...]
deprecated_metadata_types:
- type: [name]
usage: [where found]
migration_path: [recommended replacement]
hardcoded_ids:
- location: [metadata element]
pattern: [describe pattern, do not repeat the ID value]
recommendation: [use Custom Metadata, Custom Setting, or label instead]
summary:
total_findings: [count]
critical_count: [count]
high_count: [count]
escalation_gates_fired: [from salesforce-risk-taxonomy, or "none"]
assumptions: [list]
missing_evidence: [what would improve the review]
Redaction rules
- Never request secrets, credentials, OAuth tokens, refresh tokens, session IDs, MFA seeds, customer PII.
- Sanitize org IDs, user IDs (replace with placeholders) before sharing in outputs.
- Do not repeat hardcoded ID values in output; describe the pattern and location only.
Privilege / data handling rules
- Metadata review is schema-level only; do not carry record-level data.
- Sharing rule findings involving PII objects escalate to salesforce-permission-model-review-skill.
Handoff rules
- Hands off to: salesforce-permission-model-review-skill (permission findings),
salesforce-flow-automation-review-skill (deprecated automation findings),
salesforce-org-assessment-skill (if full posture context is needed).
- If escalation gate fires: salesforce-case-capsule with escalation_required = true.
- Required handoff fields: matter_id, metadata_review_findings (summary), escalation_gates_fired.
Audit log fields
- matter_id, skill_id, skill_version, invoked_by, input_hash, evidence_quality, output_verdict, escalation_fired, timestamp
Stop conditions
- Metadata contains live credentials, record-level PII, or session tokens — stop and ask for sanitized version.
- Metadata is from a regulated-vertical org and compliance scope is unknown — flag and escalate.
- Hardcoded ID count is very high (systemic pattern) — escalate to salesforce-org-assessment-skill for full posture review.
Security notes
- Read-only static review of exported metadata; never requests live org access.
- Hardcoded ID values must not be repeated in output to avoid accidental leakage.
- Deprecated metadata flags are informational; migration requires human-authorized release planning.
1---2name: salesforce-metadata-review-skill3description: Salesforce Metadata Review Skill4---56# Salesforce Metadata Review Skill78## Purpose9This skill reviews pasted or exported Salesforce metadata for quality,10maintainability, security, and compliance indicators. It flags11over-customization, unused fields, hardcoded IDs, and deprecated metadata12types, and produces a structured findings report. It does not access live13orgs and does not authorize changes.1415## When to use16- A metadata export (objects, fields, layouts, profiles, permission sets,17 sharing rules) needs review before a release.18- A code review has surfaced questions about the metadata surface.19- A technical debt assessment requires metadata-level findings.20- An audit requires documentation of deprecated or risky metadata patterns.2122## When not to use23- Full org posture assessment — use `salesforce-org-assessment-skill`.24- Permission topology review across profiles and permission set groups — use `salesforce-permission-model-review-skill`.25- Automation logic review (Flow XML, validation rules) — use `salesforce-flow-automation-review-skill`.26- Live production change review — use `salesforce-live-change-approval-protocol`.2728## Minimum payload (required inputs)29- One or more sanitized metadata exports: object XML, field definitions,30 layout XML, profile XML, permission set XML, sharing rule XML, or equivalent.31- Metadata type(s) being reviewed.32- Context: release context, org type (production/sandbox placeholder), business use case.3334## Workflow351. **Object and field review**36 - Identify fields with zero or low usage indicators (no referenced automation, no layout placement).37 - Flag fields with hardcoded IDs in default values or formula expressions.38 - Flag objects with excessive custom field counts (> configurable threshold).39 - Identify deprecated field types (Text Area vs Rich Text Area misuse, currency without multi-currency awareness).40 - Flag custom objects that duplicate standard object functionality.41422. **Layout review**43 - Page layouts: flag layouts with > configurable threshold components; flag required fields not aligned with business process.44 - Lightning record pages45: flag components using hardcoded record IDs or hardcoded URLs.46 - Flag layouts assigned to no profiles or permission sets (orphaned).47483. **Profile and permission set review**49 - Flag profiles with excessive object permissions (Create/Edit/Delete/ViewAll/ModifyAll on sensitive objects).50 - Flag permission sets with duplicate coverage of profile permissions (redundant grants).51 - Flag permission sets with no assignees (orphaned).52 - Flag profiles granting API access without IP restrictions.53544. **Sharing rule review**55 - Identify sharing rules that effectively expose all records to a broad group.56 - Flag criteria-based sharing rules with conditions that evaluate to always-true.57 - Flag sharing rules on objects with OWD = Public Read/Write (redundant).58595. **Deprecated metadata types**60 - Flag use of: workflow rules, Process Builder61(deprecated),62 legacy assignment rules (where Flow equivalent exists), Visualforce pages in Lightning context63 without Lightning migration plan.64656. **Hardcoded ID detection**66 - Flag any string matching Salesforce ID patterns (15- or 18-character alphanumeric) in:67 field defaults, formula fields, validation rule expressions, layout XML.6869## Evidence requirements70- Sanitized metadata XML or equivalent export; no credentials, session tokens, or customer data.71- If metadata contains what appears to be record-level data (not schema), decline and ask for schema-only.7273## Output format74```75metadata_review_findings:76 objects_and_fields:77 - finding: [description]78 severity: Critical | High | Medium | Low79 evidence: [what in the metadata supports this]80 recommendation: [brief]81 layouts:82 - finding: [description]83 severity: [tier]84 evidence: [...]85 recommendation: [...]86 profiles_and_permission_sets:87 - finding: [description]88 severity: [tier]89 evidence: [...]90 recommendation: [...]91 sharing_rules:92 - finding: [description]93 severity: [tier]94 evidence: [...]95 recommendation: [...]96 deprecated_metadata_types:97 - type: [name]98 usage: [where found]99 migration_path: [recommended replacement]100 hardcoded_ids:101 - location: [metadata element]102 pattern: [describe pattern, do not repeat the ID value]103 recommendation: [use Custom Metadata, Custom Setting, or label instead]104105summary:106 total_findings: [count]107 critical_count: [count]108 high_count: [count]109escalation_gates_fired: [from salesforce-risk-taxonomy, or "none"]110assumptions: [list]111missing_evidence: [what would improve the review]112```113114## Redaction rules115- Never request secrets, credentials, OAuth tokens, refresh tokens, session IDs, MFA seeds, customer PII.116- Sanitize org IDs, user IDs (replace with placeholders) before sharing in outputs.117- Do not repeat hardcoded ID values in output; describe the pattern and location only.118119## Privilege / data handling rules120- Metadata review is schema-level only; do not carry record-level data.121- Sharing rule findings involving PII objects escalate to salesforce-permission-model-review-skill.122123## Handoff rules124- Hands off to: salesforce-permission-model-review-skill (permission findings),125 salesforce-flow-automation-review-skill (deprecated automation findings),126 salesforce-org-assessment-skill (if full posture context is needed).127- If escalation gate fires: salesforce-case-capsule with escalation_required = true.128- Required handoff fields: matter_id, metadata_review_findings (summary), escalation_gates_fired.129130## Audit log fields131- matter_id, skill_id, skill_version, invoked_by, input_hash, evidence_quality, output_verdict, escalation_fired, timestamp132133## Stop conditions134- Metadata contains live credentials, record-level PII, or session tokens — stop and ask for sanitized version.135- Metadata is from a regulated-vertical org and compliance scope is unknown — flag and escalate.136- Hardcoded ID count is very high (systemic pattern) — escalate to salesforce-org-assessment-skill for full posture review.137138## Security notes139- Read-only static review of exported metadata; never requests live org access.140- Hardcoded ID values must not be repeated in output to avoid accidental leakage.141- Deprecated metadata flags are informational; migration requires human-authorized release planning.