Skip to content
forcedotcom avatar

Platform Sharing Rules Generate

Generates, edits, deletes, and retrieves Salesforce sharing rules for record-level access beyond org-wide defaults.

CCM score
73 of 100
skills.sh installs
6.3K
GitHub stars
1.2K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers criteria-based, role or group owner-based, and guest user sharing rules stored in .sharingRules-meta.xml files
  • Retrieves the latest org state with sf project retrieve start before every edit or delete to avoid stale overwrites
  • Blocks sharing to queues and refuses in-place changes to sharedTo or sharedFrom, requiring delete and recreate instead
  • Designed for Salesforce developers managing record sharing, excluding permission sets, profiles, and object-level security

Install

$ npx -y skills add forcedotcom/sf-skills --skill platform-sharing-rules-generate -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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)

Details

Repository
github.com/forcedotcom/sf-skills
Categories
Backend & APIs, Security
First seen
Jul 14, 2026

Questions

What does the platform-sharing-rules-generate skill do?

It creates, edits, deletes and retrieves Salesforce Sharing Rules metadata to control record-level access beyond org-wide defaults. It supports criteria-based rules, role or group owner rules, and guest user rules for Experience Sites.

How do I install the platform-sharing-rules-generate skill?

Run npx -y skills add forcedotcom/sf-skills --skill platform-sharing-rules-generate -y in a project. Once installed, the agent can work with sharingCriteriaRules, sharingOwnerRules and sharingGuestRules files.

What does this skill need to work?

It needs the Salesforce CLI (sf, version 2.0.0 or later) and access to a target org so it can retrieve the latest sharing rules before editing them. It targets metadata API version 60.0 or later.

When should I not use this skill?

Do not use it for permission sets, profiles or object-level security, which fall under platform-permission-set-generate. It also does not change org-wide defaults or create territory-based sharing rules.

Where does this skill sit in its category?

It is listed in the Backend and APIs category on Claude Marketplaces. It focuses on Salesforce record-level sharing metadata rather than general backend services.

More from forcedotcom/sf-skills

All 78

Similar to Platform Sharing Rules Generate

More Backend & APIs