
Permission Set Generator
OfficialFreeEasily create deployable Salesforce permission sets.
Free · Opens the source repo
What Permission Set Generator does
The Permission Set Generator skill simplifies the process of creating and editing Salesforce permission set metadata. It helps developers and administrators define object, field, user, and app permissions in a structured XML format. By following the provided steps, users can ensure that their permission sets are correctly configured and ready for deployment. This skill is particularly useful when managing access control in Salesforce, ensuring that users have the right permissions without unnecessary complications.
The skill guides users through defining core properties such as the permission set's name, label, and description. It emphasizes best practices like using descriptive API names and highlights critical aspects of configuring object permissions, field-level security, and user permissions. Each step is accompanied by XML code snippets that users can adapt for their specific needs, making the process both straightforward and efficient.
Additionally, the skill includes a validation checklist to help users verify their configurations before deployment. This checklist ensures that common pitfalls, such as assigning field permissions on required fields or using incorrect API names, are avoided. Overall, this skill is designed for Salesforce developers and administrators who need a reliable method for managing permission sets, enhancing security, and streamlining user access management.
When to use it
Use this skill when you need to generate or modify permission set metadata in Salesforce, particularly for managing user access and permissions.
When not to use it
This skill is not suitable for users who are not familiar with Salesforce metadata or those who require a graphical interface for permission management.
What you can build with it
Creating a New Permission Set
Use this skill to quickly generate a new permission set XML file for a specific user group, ensuring all necessary permissions are included.
Editing Existing Permission Sets
Modify existing permission sets by adjusting object and field permissions using the structured approach outlined in this skill.
Deploying Permission Sets via CLI
Utilize the generated XML with Salesforce CLI to deploy permission sets efficiently, streamlining the deployment process.
How to install Permission Set Generator
View source1. Install with the skills CLI
npx skills add forcedotcom/sf-skills/platform-permission-set-generate --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by forcedotcomWhen to Use This Skill
Use when generating or editing permission set metadata, or when granting object, field, user, and app permissions.
Step 1: Define Core Properties
Start by defining the required permission set properties:
<PermissionSet xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>YourPermissionSetName</fullName>
<label>Display Name for Administrators</label>
<description>Clear description of purpose and intended audience</description>
</PermissionSet>
Naming conventions:
- Use descriptive API names (e.g.,
Sales_Manager_Access)
Step 2: Configure Object Permissions
Add CRUD permissions for standard and custom objects:
<objectPermissions>
<allowCreate>true</allowCreate>
<allowRead>true</allowRead>
<allowEdit>true</allowEdit>
<allowDelete>false</allowDelete>
<modifyAllRecords>false</modifyAllRecords>
<viewAllRecords>false</viewAllRecords>
<viewAllFields>false</viewAllFields>
<object>Account</object>
</objectPermissions>
Step 3: Set Field-Level Security
Define field permissions for sensitive or custom fields:
<fieldPermissions>
<editable>true</editable>
<readable>true</readable>
<field>Account.SSN__c</field>
</fieldPermissions>
Important:
- Required fields must NEVER appear in list of field permissions. Granting field-level security on required fields is not allowed by the platform and will cause deployment failure.
- Before adding any field, confirm from the object metadata that the field exists and is not required
- A field is required when its metadata contains
<required>true</required>: - Formula fields cannot be editable
- Master-detail fields are required fields on the child (detail) object
<fields>
<fullName>FieldName__c</fullName>
<required>true</required>
</fields>
- Use format
ObjectName.FieldNamefor field references - Set both readable and editable to true when the user needs edit access; editable implies readable
- If all fields should be visible, can alternatively enable the "viewAllFields" object permission
Step 4: Grant User Permissions
Add system-level permissions for features and capabilities:
<userPermissions>
<enabled>true</enabled>
<name>ApiEnabled</name>
</userPermissions>
<userPermissions>
<enabled>true</enabled>
<name>RunReports</name>
</userPermissions>
Common permissions:
ApiEnabled: API accessViewSetup: View Setup menuManageUsers: User managementRunReports: Report execution
Security review required for:
ViewAllData: Read all recordsModifyAllData: Edit all recordsManageUsers: User administration
Step 5: Configure App and Tab Visibility
Make applications and tabs visible to users:
<applicationVisibilities>
<application>Sales_Console</application>
<visible>true</visible>
</applicationVisibilities>
<tabSettings>
<tab>CustomTab__c</tab>
<visibility>Visible</visibility>
</tabSettings>
Application visibility options:
- <visible> can be true or false
Tab visibility options:
Visible: The tab is available on the All Tabs page and appears in the visible tabs for its associated app. Can be customized.Available: The tab is available on the All Tabs page. Individual users can customize their display to make the tab visible in any appNone: Not visible
CRITICAL - Tab Naming:
- Custom object tabs: MUST include the __c suffix (e.g., MyCustomObject__c)
- Standard object tabs: Use the object name with "standard-" prefix (e.g., standard-Account, standard-Contact)
- The tab name matches the object's API name exactly
Step 6: Add Apex and Visualforce Access (Optional)
Grant access to custom code:
<classAccesses>
<apexClass>CustomController</apexClass>
<enabled>true</enabled>
</classAccesses>
<pageAccesses>
<apexPage>CustomPage</apexPage>
<enabled>true</enabled>
</pageAccesses>
Step 7: Set License and Record Type Settings (Optional)
Specify license requirements and record type visibility:
<license>Salesforce</license>
<hasActivationRequired>false</hasActivationRequired>
<recordTypeVisibilities>
<recordType>Account.Business</recordType>
<visible>true</visible>
<default>true</default>
</recordTypeVisibilities>
Step 8: Set Agent Access (Optional)
Enable access to Agentforce Employee Agents for users assigned to this permission set:
<agentAccesses> <agentName>Sales_Assistant_Agent</agentName> <enabled>true</enabled> </agentAccesses>Field requirements:
- agentName (Required): The developer name of the employee agent
- enabled (Required): Set to true to grant access, false to deny
Important:
- Agent names must match existing Agentforce Employee Agent developer names
Validation Checklist
Before deploying, verify:
- fullName, label, description set
- Permissions follow least privilege
- No required fields in
<fieldPermissions> - No duplicate permissions
- No lengthy comments
What Causes Deployment Failure
- Field permissions on required fields: Any required field in
<fieldPermissions>fails deployment. Required fields cannot have FLS; omit them entirely. Always confirm from object/field metadata that a field exists and is not required—never assume. - Incorrect API names: Using the wrong name or missing suffixes (e.g. missing
__cfor custom objects, fields, tabs) cause failure.
Deployment
Deploy using Salesforce CLI
Frequently asked questions about Permission Set Generator
Similar skills
Rhino 3D Scripting
Streamline your Rhinoceros 3D scripting tasks.
MVVM Toolkit
Streamline ViewModel development with source generators.
FreeCAD Scripts
Generate Python scripts for FreeCAD automation and modeling.
Azure Architecture Builder
Design and deploy Azure infrastructure using natural language.
Command Development
Streamline your command creation for Claude Code.
Create Cowork Plugin
Easily build and package plugins through guided sessions.
