MCPInstall

platform-sharing-owd-configure

Use when the user wants to retrieve or update Organization-Wide Default (OWD) sharing settings for Salesforce objects. TRIGGER on org-wide defaults, checking/viewing sharing defaults, changing default access levels (Private, Public Read Only, Public Read/Write, Controlled by Parent), internal/external access for standard or custom objects, making records private, or sharingModel in .object-meta.xml files. DO NOT TRIGGER for sharing rules, criteria-based sharing, role hierarchy, or manual sharing — delegate to platform-sharing-rules-generate.

Installs
3.7K
Last 24h
+17
Trending rank
#6470
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/forcedotcom/sf-skills --skill platform-sharing-owd-configure
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads platform-sharing-owd-configure automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Managing Org-Wide Defaults

Retrieve and update Organization-Wide Default (OWD) sharing settings for standard and custom objects in a Salesforce org. OWDs define the baseline level of access users have to records they do not own.

Scope

  • In scope: Retrieving current OWD settings, updating internal/external access levels for standard and custom objects
  • Out of scope: Sharing rules, role hierarchy configuration, manual sharing, permission sets, criteria-based sharing — delegate to appropriate skills

Clarifying Questions

Before proceeding, confirm with the user if not already clear:

  • Which object(s) do you want to get or update OWD settings for?
  • What access level do you want to set? (Private, Public Read Only, Public Read/Write, Controlled by Parent)
  • Do you need to change both internal and external access, or just one?

Required Inputs

Gather or infer before proceeding:

  • Target org: The org alias or username to query/update (use default org if not specified)
  • Object name(s): Standard object API name (e.g., Account, Contact) or custom object API name (e.g., Invoice__c)
  • Operation: Get (retrieve current settings) or Update (change access levels)
  • Access levels (for update): Internal access and/or external access values

Defaults unless specified:

  • Use the default connected org
  • If only one access level is provided, assume it applies to internal access

Workflow

All steps are sequential. Do not skip or reorder.

Phase 1 — Retrieve Current Settings

  1. Query current OWD settings using the Salesforce CLI Tooling API: sf data query --query "SELECT QualifiedApiName, InternalSharingModel, ExternalSharingModel FROM EntityDefinition WHERE QualifiedApiName = '<ObjectName>'" --use-tooling-api --target-org <org>

  2. For retrieving all OWD settings at once: sf data query --query "SELECT QualifiedApiName, InternalSharingModel, ExternalSharingModel FROM EntityDefinition WHERE IsCustomizable = true ORDER BY QualifiedApiName" --use-tooling-api --target-org <org>

  3. Present results clearly — read references/access_levels.md for valid values and display a formatted table to the user.

Phase 2 — Update Settings (if requested)

  1. Check for immutable/fixed OWD — read references/access_levels.md "Immutable / Fixed OWD Objects" section. If the requested change targets a fixed value (e.g., Price Book external OWD), stop immediately and explain to the user that this value is platform-fixed and cannot be changed by any means. Do not attempt a deploy.

  2. Validate the requested access level — read references/access_levels.md to confirm the value is valid for the target object. If the value is not in the allowed set for that object, explain what values are valid and ask the user to choose one. Do not guess alternative values.

  3. Retrieve the object metadata using the Metadata API (same command for both standard and custom objects): sf project retrieve start --metadata CustomObject:<ObjectName> --target-org <org>. This retrieves <ObjectName>.object-meta.xml containing <sharingModel> and <externalSharingModel>. See references/metadata_api_approach.md for the full procedure.

  4. Modify the sharing settings — update the <sharingModel> (internal access) and/or <externalSharingModel> (external access) in the object's .object-meta.xml. Read references/metadata_api_approach.md for details.

  5. Pre-deploy verification — before deploying, confirm:

    • External access is not more permissive than internal access
    • Objects with Master-Detail relationships use ControlledByParent
    • The requested access level is valid for the target object (see references/access_levels.md)
    • Cross-object constraints are satisfied (see "Cross-Object Constraints" in references/access_levels.md)
    • The target field is not listed as immutable/fixed in references/access_levels.md
  6. Deploy the updated settings: sf project deploy start --metadata CustomObject:<ObjectName> --target-org <org>.

  7. Handle deploy failure (max 2 attempts): If the deploy fails:

    • Read the error message and identify the root cause.
    • If the error indicates the value is invalid or unsupported for the object, stop — report the failure to the user with the exact error message and explain what is and isn't possible. Do not try alternative values unless the user explicitly requests a different valid value.
    • If the error is transient (network timeout, auth expired), retry once.
    • Never attempt more than 2 total deploys for the same change. After 2 failures, report the error, discard local edits (sf project retrieve start --metadata CustomObject:<ObjectName> --target-org <org>), and ask the user how to proceed.
  8. Verify the change by re-running the query from Phase 1, Step 1.


Rules / Constraints

ConstraintRationale
Objects with Master-Detail relationships must use ControlledByParentPlatform enforces this — attempting other values fails
External access cannot be more permissive than internal accessSalesforce rejects configurations where external > internal
Some objects have immutable/fixed OWD (e.g., Price Book external, User, Activity external)These are platform-enforced — explain impossibility upfront, never attempt a deploy
Price Book only accepts Use (ReadSelect) or No Access (None) for internal OWD; external is always NoneStandard access levels (Private/Read/ReadWrite) are invalid for Price Book
Changing OWD to more restrictive triggers sharing recalculationThis can take significant time on large orgs — warn the user
Custom objects default to Public Read/Write when createdUsers may not realize the default is permissive
For managed package custom objects, use the full API name including namespace prefix (e.g., ns__Object__c)Namespace-prefixed objects require the prefix in both queries and metadata retrieval
Always verify the org connection before queryingPrevents confusing error messages
Maximum 2 deploy attempts per changePrevents unbounded retry loops — after 2 failures, stop and report to the user

Gotchas

IssueResolution
INSUFFICIENT_ACCESS error when updatingUser needs Manage Sharing permission or System Administrator profile
OWD change appears stuckSharing recalculation is running — check Setup > Sharing Settings for progress
Custom object not found in queryUse the full API name including __c suffix
ControlledByParent not availableObject has no Master-Detail relationship — use Private, Public Read Only, or Public Read/Write
External access field not showingExternal sharing model only appears when external org-wide defaults are enabled
Query returns no resultsObject may not be customizable or API name may be incorrect — verify spelling
Deploy fails with invalid value for Price BookPrice Book only accepts Use/None (internal) and external is fixed at None — do not retry with other values, explain to user

Output Expectations

Deliverables:

  • For get operations: Formatted table showing object name, internal access level, and external access level
  • For update operations: Confirmation of the change with before/after comparison

Cross-Skill Integration

NeedDelegate to
Creating sharing rules after restricting OWDplatform-sharing-rules-generate skill
Deploying metadata changes to another orgplatform-metadata-deploy skill

Reference File Index

FileWhen to read
references/access_levels.mdWhen validating or explaining OWD access level values
references/metadata_api_approach.mdWhen using Metadata API to update OWD instead of Tooling API
examples/get_owd_output.mdTo verify formatted output matches expected structure
examples/update_owd_output.mdTo verify update confirmation matches expected structure

FAQ

What does the platform-sharing-owd-configure skill do?

Use when the user wants to retrieve or update Organization-Wide Default (OWD) sharing settings for Salesforce objects. TRIGGER on org-wide defaults, checking/viewing sharing defaults, changing default access levels (Private, Public Read Only, Public Read/Write, Controlled by Parent), internal/external access for standard or custom objects, making records private, or sharingModel in .object-meta.xml files. DO NOT TRIGGER for sharing rules, criteria-based sharing, role hierarchy, or manual sharing — delegate to platform-sharing-rules-generate.

How do I install platform-sharing-owd-configure?

Run npx skills add https://github.com/forcedotcom/sf-skills --skill platform-sharing-owd-configure in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/platform-sharing-owd-configure/ (personal) or .claude/skills/platform-sharing-owd-configure/ (project).

Which AI agents can use platform-sharing-owd-configure?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is platform-sharing-owd-configure safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains platform-sharing-owd-configure?

It is published by forcedotcom in forcedotcom/sf-skills. It has 3,725 recorded installs.

More from forcedotcom/sf-skills

View all →

platform-apex-generate

forcedotcom/sf-skills

Primary Apex authoring skill for class generation, refactoring, and review. ALWAYS ACTIVATE when the user mentions Apex, .cls, triggers, or asks to create/refactor a class (service, selector, domain, batch, queueable, schedulable, invocable, DTO, utility, interface, abstract, exception, REST resource). Use this skill for requests involving SObject CRUD, mapping collections, fetching related records, scheduled jobs, batch jobs, trigger design, @AuraEnabled controllers, @RestResource endpoints, custom REST APIs, or code review of existing Apex.

platform-apex-test-generate

forcedotcom/sf-skills

Use to generate and validate Apex test classes with TestDataFactory patterns, bulk testing (251+ records), mocking, assertions, and disciplined test-fix loops. Use when creating Apex test classes (for triggers, services, controllers, batch jobs, queueables, and callouts), improving coverage, debugging or fixing failing Apex tests, or running test/coverage analysis. Triggers on Test.cls files, sf apex run test, coverage reports. Do NOT trigger for production Apex (use platform-apex-generate) or Jest/LWC tests.

Testing & QA7.1K installs

platform-apex-test-run

forcedotcom/sf-skills

Apex test execution, coverage analysis, and test-fix loops with 120-point scoring. Use when the user runs Apex tests, checks code coverage, fixes failing tests, or touches Test.cls / Test.cls files. DO NOT TRIGGER when writing Apex production code (use platform-apex-generate), Agentforce agent testing (use agentforce-test), or Jest/LWC tests (use experience-lwc-generate).

Testing & QA7K installs

platform-apex-logs-debug

forcedotcom/sf-skills

Salesforce debug log analysis and troubleshooting with 100-point scoring. TRIGGER when: user analyzes debug logs, hits governor limits, reads stack traces, or touches .log files from Salesforce orgs. DO NOT TRIGGER when: running Apex tests (use platform-apex-test-run), generating or fixing Apex code (use platform-apex-generate), or Agentforce session tracing (use agentforce-observe).

platform-soql-query

forcedotcom/sf-skills

Use when the user needs SOQL/SOSL authoring or optimization: natural-language-to-query generation, relationship queries, aggregates, query-plan/selectivity analysis, and performance or safety improvements. TRIGGER when the user writes, optimizes, or debugs SOQL/SOSL, touches .soql files, or asks about relationship queries, aggregates, or query performance. DO NOT TRIGGER for bulk data operations (use platform-data-manage), Apex DML logic (use platform-apex-generate), or report/dashboard queries.

platform-metadata-deploy

forcedotcom/sf-skills

Salesforce DevOps automation using sf CLI v2. TRIGGER when: user deploys metadata, validates a deploy or does a dry-run, deploys to a Production org, quick-deploys a validated job ID, ships/promotes to prod, creates/manages scratch orgs or sandboxes, sets up CI/CD pipelines, or troubleshoots deployment errors with sf project deploy. DO NOT TRIGGER when: writing Apex code, building LWC components (use experience-lwc-generate), creating metadata definitions (use platform-custom-object-generate), deleting metadata from an org (use platform-destructive-deploy), or querying org data (use platform-data-manage).

DevOps & Cloud6.8K installs

Popular other skills

View category →

hyperframes-cli

heygen-com/hyperframes

The HyperFrames CLI by job - scaffold, check, look at frames, edit the timeline, preview, render locally or in the cloud, publish, project history - plus reading its JSON and recovering from build or render failures.

1.3M installs

triage

mattpocock/skills

Move issues and external PRs through a state machine of triage roles, categorise, verify, grill if needed, and write agent-ready briefs.

1M installs

ask-matt

mattpocock/skills

Ask which skill or flow fits your situation. A router over the skills in this repo.

778.4K installs

to-questionnaire

mattpocock/skills

Turn a decision you can't fully answer into a questionnaire for someone else to fill in.

508.9K installs

wait-what

mattpocock/skills

Stop. That last message did not land: re-pitch it.

459.7K installs

loop-me

mattpocock/skills

Grill me about specs for the workflows I want to build, within this workspace.

447.9K installs