forcedotcom avatar

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-code

Installs 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, and sharingGuestRules metadata; 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

Recommended

More Security
1trailofbits avatarentry-point-analyzertrailofbits/skillsAnalyzes smart contract codebases to identify state-changing entry points for security auditing. Detects externally callable functions that modify state, catego6.2Kskills.sh installs
2aws avataraws-lambda-microvmsaws/agent-toolkit-for-awsBuilds, runs, debugs, and operates applications on AWS Lambda MicroVMs — Firecracker-isolated, snapshot-resumable serverless compute environments running inside6.1Kskills.sh installs
3trailofbits avataraudit-prep-assistanttrailofbits/skillsPrepares codebases for security review using Trail of Bits' checklist. Helps set review goals, runs static analysis tools, increases test coverage, removes dead6.1Kskills.sh installs
4wordpress avatarwordpress-routerwordpress/agent-skillsUse when the user asks about WordPress codebases (plugins, themes, block themes, Gutenberg blocks, WP core checkouts) and you need to quickly classify the repo 6Kskills.sh installs
5forcedotcom avataragentforce-generateforcedotcom/sf-skillsBuild, modify, optimize, debug, and deploy agents with Agentforce Agent Script. TRIGGER when: user creates, modifies, optimizes, or asks about .agent files or a6Kskills.sh installs
6jeffallan avatarfullstack-guardianjeffallan/claude-skillsBuilds security-focused full-stack web applications by implementing integrated frontend and backend components with layered security at every level. Covers the 5.9Kskills.sh installs