
Platform Sharing Rules Generate
Generates Salesforce sharing rules metadata files when you need record-level access beyond org-wide defaults. Handles criteria-based rules, owner rules, and the notoriously finicky guest user rules for Experience Sites. The workflow is solid: it discovers existing rules first, retrieves from the org if needed, then constructs the XML following Salesforce's schemas. The verification checklist is extensive and catches common pitfalls like using role instead of guestUser for guest rules, or forgetting the accountSettings element that Account rules require. One file per object, all rules consolidated, which matches platform requirements. Most valuable when you're tired of manually debugging "Specify a guest user's nickname" errors or wrestling with multi-rule XML files.
- skills.sh installs
- 6.2K
- GitHub stars
- 1.2K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add forcedotcom/sf-skills --skill platform-sharing-rules-generate --agent claude-codeInstalls into .claude/skills of the current project.
Files
Sharing Rules Generator
Get, create, edit, and delete Salesforce Sharing Rules metadata to control record-level access beyond org-wide defaults. Supports criteria-based rules, role/group-based owner rules, and guest user rules for Experience Sites.
Scope
- In scope: Creating, editing, deleting, and retrieving (getting)
sharingCriteriaRules,sharingOwnerRules, andsharingGuestRulesmetadata; retrieving existing sharing rules from an org using the Metadata API Retrieve pattern; appending new rules to existing files; modifying rule criteria or access levels; removing rules from metadata files; configuring rules for Guest and Portal profiles. - Out of scope: Changing org-wide defaults (OWD/sharing model), creating Experience Sites, configuring permission sets or profiles (use
platform-permission-set-generate), territory-based sharing rules.
Clarifying Questions
Before proceeding, confirm with the user if not already clear:
For Get operations:
- Which object's sharing rules should be retrieved? (standard or custom object API name, or all objects)
- Which target org should the rules be retrieved from? (org alias or default)
Sponsors
Details
- Repository
- github.com/forcedotcom/sf-skills
- Categories
- Security, Sales & Marketing
- First seen
- Jul 14, 2026
More from forcedotcom/sf-skills
All 158- Design Systems Slds Apply6.1K
- Design Systems Slds Validate6K
- Agentforce Generate6K
- Platform Custom Tab Generate6K
- Dx Code Analyzer Configure5.9K
- Platform Custom Application Generate5.9K
- Platform List View Generate5.9K
- Agentforce Architecture Analyze5.9K
- Dx Org Switch5.8K
- Dx Org Permission Set Assign5.8K
- Platform Custom Lightning Type Generate5.8K
- Agentforce Test5.8K
- Agentforce Observe5.8K
- Platform Lightning App Coordinate5.7K
- Design Systems Slds2 Migrate5.7K
- External Diagram Mermaid Generate5.6K
- Integration Connectivity Connected App Configure5.5K
- Integration Connectivity Generate5.5K
- Agentforce D360 Analyze5.4K
- Experience Ui Bundle Frontend Generate5.3K
- Platform Tracing Configure5.3K
- Experience Ui Bundle Metadata Generate5.3K
- Experience Ui Bundle App Coordinate5.3K
- Experience Ui Bundle Deploy5.3K