Skip to main content
skill CX Codex

service-omni-supervisor-users-create — Claude Code skill

The service-omni-supervisor-users-create Claude Code skill creates Omni-Channel supervisor users in a Salesforce org. It activates on requests to create or provision supervisor accounts.

Apache-2.0 102 installs ★ 1,183 updated 2026-10-23

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add forcedotcom/sf-skills --skill service-omni-supervisor-users-create -a claude-code
Open on GitHub

What service-omni-supervisor-users-create does

The skill checks a Salesforce org and uses Anonymous Apex to add missing Omni-Channel supervisor users. Usernames follow supervisor{i}.<suffix>@example.com; reruns skip usernames already in use. The plan mode previews changes, while run checks the org safety guard before inserting users.

It requires an authenticated org, sf version 2.139.6 or later, jq version 1.6 or later, a Service Cloud license, and PermissionsModifyAllData plus PermissionsManagePasswordPolicies. The org-alias must resolve through sf org display. Production orgs are blocked; if password-setting safety cannot be confirmed, the user remains active and is marked for a password reset.

What it helps with

  • create Omni-Channel supervisor accounts
  • insert only usernames that are still missing
  • preview user creation without writing to the org
  • identify a slot occupied by an inactive user

Example prompts for the agent

  • Create two Omni-Channel supervisor users in dev-org.
  • Preview the creation of one supervisor in dev-org without writing changes.
  • Provision the missing supervisor accounts in dev-org.

How to install service-omni-supervisor-users-create

1Skills CLI (Vercel)

npx skills add forcedotcom/sf-skills --skill service-omni-supervisor-users-create -a claude-code

2Manually: put the files in place

~/.claude/skills/service-omni-supervisor-users-create/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/service-omni-supervisor-users-create/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about service-omni-supervisor-users-create

How do I install service-omni-supervisor-users-create in Claude Code?

Run npx skills add forcedotcom/sf-skills --skill service-omni-supervisor-users-create -a claude-code. The skill file is at ~/.claude/skills/service-omni-supervisor-users-create/SKILL.md.

What does service-omni-supervisor-users-create do?

It creates missing Omni-Channel supervisor accounts in Salesforce using Anonymous Apex. Existing usernames are skipped on later runs.

What does service-omni-supervisor-users-create require?

It needs sf version 2.139.6 or later, jq version 1.6 or later, an authenticated Salesforce org with a Service Cloud license, and the PermissionsModifyAllData and PermissionsManagePasswordPolicies permissions. Production orgs are blocked.

Source text

SKILL.md · Apache-2.0
---
name: service-omni-supervisor-users-create
description: "Use to create N Omni-Channel supervisor users on a Salesforce org via Anonymous Apex, using the supervisor{i}.<suffix>@example.com pattern with SOQL-based idempotency (re-runs skip existing usernames). Passwords are set via System.setPassword and handled fail-closed: the wrapper proves no active debug TraceFlag before setting a password, and otherwise leaves the user ACTIVE and reset_required. Triggers: create supervisor users, provision supervisor accounts, scaffold supervisor personas. Do not use on production customer orgs (blocked by the safe_to_write guard), to bind supervisors to OmniSupervisorConfig (service-omni-supervisor-config-deploy), or to assign the ContactCenterSupervisor permission set (service-omni-supervisor-permset-assign)."
allowed-tools: Bash Read Write Edit Glob Grep
metadata:
  version: "1.0"
  domains: ["Service"]
  minApiVersion: "66.0"
  relatedSkills:
    - "service-omni-agent-users-create"
    - "service-omni-supervisor-config-deploy"
    - "service-omni-supervisor-permset-assign"
  accessCheck: "OrgPermissions.LightningService"
  cliTools:
    - tool: ["jq"]
      semver: ">=1.6"
    - tool: ["sf"]
      semver: ">=2.139.6"
---

# service-omni-supervisor-users-create

Create N supervisor users on a Salesforce org for the classic Omni-Channel Supervisor Configuration (`OmniSupervisorConfig`), which binds named user records via `OmniSupervisorConfigUser`. Users follow a deterministic `supervisor{i}.<suffix>@example.com` pattern so the coordinator can rediscover them across runs. It is the supervisor counterpart to `service-omni-agent-users-create` and shares its detection, password, and idempotency model; the only differences are the username/alias prefixes and the debug-log marker. Binding these users into a config (`service-omni-supervisor-config-deploy`) and granting them supervisor access (`service-omni-supervisor-permset-assign`) are separate leaves.

## Inputs

Confirm once, up front:

- `org-alias` (required, no default) — must resolve via `sf org display`.
- Supervisor count (optional, default `1`, range `1..5`; the coordinator typically requests 1).
- Profile name (optional, default `Standard User`). The coordinator overrides this to a Service Cloud profile so supervisors consume Service Cloud licenses; supervisor access itself comes from the standard `ContactCenterSupervisor` permission set assigned later.

Usernames and passwords are never accepted from the operator — both are generated (usernames from the org suffix, passwords via Anonymous Apex).

## Preconditions and safety

- Target org authenticated via `sf` CLI (My Domain URL, not `.lightning.force.com`), Service Cloud license present, `sf` CLI ≥ 2.139.6.
- The executing user has `PermissionsModifyAllData` and `PermissionsManagePasswordPolicies` (standard on System Administrator).
- **Production guardrail:** the detect script computes `safe_to_write` as `IsSandbox` OR `TrialExpirationDate != null` OR `OrganizationType` in {Developer Edition, Base Edition}, and the skill blocks with no override when it is false. CDOs, scratch orgs, and dev orgs are permitted.

**Password handling (fail-closed).** Passwords are set by Anonymous Apex `System.setPassword` (`sf user password generate` cannot target Apex-inserted users). The literal appears in the inline executeAnonymous debug log and, only when a debug-log TraceFlag is active for the running user, in a queryable `ApexLog`. The wrapper therefore fails closed *before* the first `System.setPassword`: it proves via a SOQL-filtered Tooling API query (`ExpirationDate > now`) that no active TraceFlag exists. If safety cannot be positively proven, it sets no password at all; the user is left ACTIVE, flagged `password_status:"reset_required"`, and a `security_warning` explains why. It never deletes logs. A user whose password could not be set is kept ACTIVE and flagged for reset — never deactivated.

## Run

```bash
# read-only preview (never writes)
bash scripts/detect-and-create.sh plan <org-alias> [count] [profile-name]
# detect, enforce safe_to_write, then insert only the missing supervisors
bash scripts/detect-and-create.sh run  <org-alias> [count=1] [profile-name="Standard User"]
```

`detect-and-create.sh` is the canonical entry point: it re-runs detection, enforces the production guard, and only then inserts. Do not call `scripts/run-create.sh` directly — it is internal and does not enforce the guard.

## Behavior

**Detection.** The detector derives an 8-char suffix from `Organization.Id`, resolves the profile by name, and queries `User` for `supervisor{i}.<suffix>@example.com`, splitting occupied slots into active `existing_users` and `inactive_users`.

**Insertion.** The Apex loads `assets/create-supervisors.apex.template`, substitutes `__COUNT__`/`__PROFILE_ID__`/`__SUFFIX__`, and inserts only the missing indexes, re-checking inside the transaction to prevent a single run from double-inserting; across *concurrent* runs this check is not a guarantee (both can pass their pre-query before either commits), so duplicate protection there relies on the global username-uniqueness constraint plus the `DUPLICATE_USERNAME` retry (see references/apex-template-notes.md). Created users get the Service Cloud feature (`UserPermissionsSupportUser=true`); if the profile's license does not allow it, the Apex strips the flag and retries (the permset assign will then block until the user is on a suitable license). Each created user is reported via `SUPERVISOR_CREATED|<id>|<username>|<email>` (no password in the marker — it is set by the separate `System.setPassword` submission).

**Inactive occupants.** An inactive user occupying a supervisor slot is not a reusable supervisor and cannot be recreated (usernames are globally unique). It is surfaced as a required manual reactivation and never counted toward the requested slots — counting it would under-provision the config.

**Verification.** After insertion the detector re-runs and must show `missing_count == 0`.

## Output contract

`detect-and-create.sh` emits a single JSON object with `status` ∈ `created` | `partial` | `reused` | `action_needed` | `blocked`, plus `detect`, `create` (`null` when nothing was created), `created_count`, `reused_count`, `total_present_after`, `users_needing_password_reset`, `action_required`, and `safe_to_write`.

- `created` — every missing index landed with a working password.
- `partial` — some landed but not all, any `System.setPassword` failed (kept ACTIVE, listed in `users_needing_password_reset`), or a slot is occupied by an inactive user needing reactivation.
- `reused` — all requested slots already existed; no DML.
- `action_needed` — plan mode only.
- `blocked` — precondition failed.

`create.created_users[].password` is populated only for users created this run whose `System.setPassword` succeeded. `create.rolled_back_users` is always empty (this skill never deactivates a user). Generated passwords are a secret: the returned JSON is the only place they appear; a caller that persists stdout must write it only to a restricted `CREDENTIALS.json` (mode 0600), redact it elsewhere, and delete it after distribution — the coordinator does this automatically.

## Limitations

- Username pattern and org suffix are fixed and never operator-configurable — that determinism is what enables idempotent re-runs.
- Creates only supervisor users; it never deletes or deactivates users, including orphaned supervisors from prior runs.
- Common User errors (`DUPLICATE_USERNAME`, `INVALID_EMAIL`, `LICENSE_LIMIT_EXCEEDED`) are translated into operator-friendly messages rather than surfaced raw.

## References

| File | When to read |
|---|---|
| `references/apex-patterns.md` | Before running the Apex — Apex structure, User field defaults, password policy, and the profile-localization risk |
| `references/apex-template-notes.md` | When creation returns a duplicate, license, password, or trace-safety error |
| `assets/create-supervisors.apex.template` | Loaded by `scripts/run-create.sh` when missing supervisor users must be inserted |
| `scripts/detect-existing.sh` | Loaded by `scripts/detect-and-create.sh` for the read-only org, profile, safety, and existing-user checks |
| `scripts/run-create.sh` | Internal writer loaded by `scripts/detect-and-create.sh` only after guard checks pass |

© forcedotcom · Apache-2.0 · forcedotcom/sf-skills

Similar skills

All skills for Backend and APIs →
salesforce-development official TemitayoAfolabi The salesforce-development plugin adds four agents to GitHub Copilot Chat for Apex, Salesforce UI components, Flow automation, and Visualforce. Pick an agent that matches the work. ★ 41,430repo stars Salesforce Visualforce Development official github Salesforce Visualforce Development — a GitHub Copilot subagent that builds and audits Visualforce pages together with their Apex controllers. CX Codex +1 ★ 41,430repo stars salesforce-apex-cursorrules-prompt-file PatrickJS salesforce-apex-cursorrules-prompt-file — a Cursor rule that shapes how the assistant writes Salesforce Apex. You drop it into a project when Apex classes and async logic are generated by the agent. CX Codex +1 ★ 41,178repo stars salesforce-automation davepoon The salesforce-automation skill automates Salesforce operations: create and search leads, contacts, accounts, opportunities, and run SOQL queries through Composio. CX Codex +1 128installs enterprise-integrator-architect Alysson Franklin enterprise-integrator-architect is a Claude Code plugin for designing and building integrations between B2B apps and external enterprise systems. Call it for API orchestration, data sync, or third-party webhooks. ★ 1,013repo stars crm-integration-wasp-drone Legion Code Inc. crm-integration-wasp-drone architects CRM pipelines, maps entity schemas, and designs sync logic. Connects your product to HubSpot, Salesforce, Attio, or Pipedrive without data loss. CX Codex ★ 96repo stars

From the same set232

The whole set →
service-omni-sidebar-configure service-omni-sidebar-configure — a skill for Claude Code enables and validates the pinned Omni-Channel sidebar on Lightning console apps. Configures the pinned utility view directly in CustomApplication metadata. CX Codex +1 103installs service-omni-presence-status-deploy The service-omni-presence-status-deploy Claude Code skill deploys Omni-Channel presence statuses. It runs for requests to create an Available status for Case, Incident, Messaging, or Voice, or to add the standard Busy status. CX Codex +1 103installs service-omni-base-settings-configure service-omni-base-settings-configure — a skill for Claude Code that configures Salesforce Omni-Channel base settings via the Metadata API. Deploys the five primary routing booleans required before setting up queues. CX Codex +1 103installs service-omni-supervisor-surface-deploy service-omni-supervisor-surface-deploy — a skill for Claude Code populates the Omni-Channel Supervisor action and tab surface in Salesforce via the Data API. Runs when configuring supervisor panels. CX Codex +1 102installs service-omni-supervisor-permset-assign service-omni-supervisor-permset-assign — a skill for Claude Code that automates assigning the ContactCenterSupervisor permission set to users. Runs a verification and assignment script for Salesforce supervisor provisioning. CX Codex +1 102installs service-omni-presence-user-config-deploy The service-omni-presence-user-config-deploy Claude Code skill deploys an Omni presence configuration for agents. It sets decline handling and an ACW timer, then assigns the configuration to users. CX Codex +1 102installs service-omni-agent-users-create service-omni-agent-users-create — a skill for Claude Code creates Salesforce agent users for Omni-Channel setup and routing checks. It responds to requests for new, seeded, or missing demo agents. CX Codex +1 101installs education-cloud-domain-configure education-cloud-domain-configure is a Claude Code skill for setting up Salesforce Education Cloud domains. It activates when a user asks to enable or configure domain features. CX Codex +1 100installs

Project sponsors

Companies that keep this analytics open