agentforce-architectur…
Declared architecture snapshot for one Agentforce agent: planner, topics, actions, flows, Apex, prompt templates, and NGA…
ALWAYS USE THIS SKILL to assign permission sets to org users. Assign one or more permission sets to org users using the sf org assign permset command. TRIGGER when the user asks to assign, grant, give, add, or apply permission sets to users, admins, specific orgs, or specific
Claude Code
$ npx -y skills add forcedotcom/sf-skills --skill dx-org-permission-set-assign --agent claude-code
Codex
$ npx skills add forcedotcom/sf-skills --skill dx-org-permission-set-assign -a codex -y
Cursor
$ npx skills add forcedotcom/sf-skills --skill dx-org-permission-set-assign -a cursor -y
Gemini CLI
$ npx skills add forcedotcom/sf-skills --skill dx-org-permission-set-assign -a gemini-cli -y
GitHub Copilot
$ npx skills add forcedotcom/sf-skills --skill dx-org-permission-set-assign -a github-copilot -y
OpenCode
$ npx skills add forcedotcom/sf-skills --skill dx-org-permission-set-assign -a opencode -y
Windsurf
$ npx skills add forcedotcom/sf-skills --skill dx-org-permission-set-assign -a windsurf -y
name: dx-org-permission-set-assign
description: "ALWAYS USE THIS SKILL to assign permission sets to org users. Assign one or more permission sets to org users using the sf org assign permset command. TRIGGER when the user asks to assign, grant, give, add, or apply permission sets to users, admins, specific orgs, or specific users. Supports granting permissions, giving access, and adding permission sets to default admin or specific users via --on-behalf-of. DO NOT TRIGGER for listing permission sets or checking user permissions."
metadata:
version: "1.0"
domains: ["Developer Experience"]
relatedSkills:
- "platform-permission-set-generate"
cliTools:
- tool: ["sf"]
semver: ">=2.0.0"Assigns one or more permission sets to org users using `sf org assign permset`. Handles all variants: default admin user, specific org targets, multiple permission sets, and assignment to specific users.
---
**Use ONLY the Bash tool** to execute `sf org assign permset`. Do NOT use MCP tools like `assign_permission_set` — ignore them completely.
---
---
Infer from the user's request:
---
1. Match user request to command in table below 2. Execute via Bash tool: `sf org assign permset` with appropriate flags and `--json` flag 3. Return result
If error occurs, check the `failures` array in JSON output for details.
| User intent | Execute via Bash tool | |-------------|---------| | Assign one permission set to default admin | `sf org assign permset --name <PermSetName> --json` | | Assign multiple permission sets to default admin | `sf org assign permset --name <PermSet1> --name <PermSet2> --json` | | Assign to specific org | `sf org assign permset --name <PermSetName> --target-org <alias> --json` | | Assign to specific user(s) | `sf org assign permset --name <PermSetName> --on-behalf-of <username1> --on-behalf-of <username2> --json` | | Assign multiple sets to specific users | `sf org assign permset --name <PermSet1> --name <PermSet2> --on-behalf-of <username1> --on-behalf-of <username2> --json` |
---
| Constraint | Rationale | |-----------|-----------| | Always use `--json` flag | Provides structured output for reliable parsing and error handling | | Permission set names are case-sensitive | Use exact API names as they appear in the org | | Multiple `--name` flags can be combined in one command | More efficient than separate commands per permission set | | Multiple `--on-behalf-of` flags assign to multiple users | Batch assignment in single command; processed sequentially to avoid auth file collisions | | Use CLI username aliases, not Salesforce User.Alias field | The `--target-org` and `--on-behalf-of` flags expect CLI aliases set via `sf alias set`, not the User object's Alias field | | Duplicate assignments are idempotent | Re-assigning an already-assigned permission set succeeds silently | | Partial success is possible | Command can return both successes and failures in one run; non-zero exit code if any failures |
---
| Issue | Resolution | |-------|------------| | Permission set name with spaces | Enclose in double quotes: `--name "Permission Set Name"` | | "PermissionSet not found" error | Verify permission set exists in target org; check for typos in name | | Assignment succeeds but user doesn't see permissions | Check `<hasActivationRequired>` in permission set metadata — may need manual activation in Setup | | "User not found" error | Username/alias doesn't exist in target org — verify with `sf org display user --target-org <alias>` | | Partial success (some users succeed, others fail) | Check JSON output — command returns both `successes` and `failures` arrays; exit code will be non-zero if any failures occurred |
---
The command returns JSON output with status code and result details.
See `examples/success_output.json` and `examples/error_output.json` for response structures.
---
| File | When to read | |------|-------------| | `examples/success_output.json` | To understand successful assignment response structure | | `examples/error_output.json` | To handle common error scenarios | | `references/cli_flags.md` | For detailed explanation of all available flags |
This repository provides Salesforce agent skills, plugins, and sample apps for building applications.
Declared architecture snapshot for one Agentforce agent: planner, topics, actions, flows, Apex, prompt templates, and NGA…
Use this skill to Upgrade Einstein Bots into Agentforce agents end-to-end in a single pass, orchestrating per-bot Agent Spec…
Data Cloud 360° view of a single Agentforce session. TRIGGER when user asks to trace, inspect, summarize, or describe a specific…
Build, modify, audit, repair, optimize, debug, and deploy agents with Agentforce Agent Script. TRIGGER when: user creates,…
Analyze production Agentforce agent behavior using session traces and Data Cloud, and manage Agent Health Monitoring (AHM)…
Use to design an AI agent persona — identity, voice, tone, behavioral style, guardrails — and encode it into Agent Script (.agent…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.