forcedotcom/sf-skills / plugins/builder/service-omni/skills/service-omni-agent-users-create
service-omni-agent-users-create
VerifiedCreate reusable agent users for Omni-Channel setup and routing validation. TRIGGER when users ask to create Omni agents, provision Omni test users, seed sandbox users for routing, create Omni-Channel routing agents, or repair missing demo agents. DO NOT TRIGGER for queue membership, permission-set assignment, or supervisor-user creation.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 8.6 KB |
| assets/create-users.apex.template | other | 3.2 KB |
| references/apex-patterns.md | markdown | 8.8 KB |
| references/apex-template-notes.md | markdown | 1.7 KB |
| scripts/detect-and-create.shexecutable | script | 8.2 KB |
| scripts/detect-existing.shexecutable | script | 5.1 KB |
| scripts/run-create.shexecutable | script | 15.7 KB |
| scripts/tests/test_user_create_security.py | script | 8.5 KB |
references/apex-template-notes.md
View on GitHub# `create-users.apex.template` notes
Anonymous Apex template for creating agent demo users. `run-create.sh` resolves the tokens
before execution and submits the rendered Apex.
## Tokens
| token | meaning |
| --- | --- |
| `__COUNT__` | integer 1..10 — number of user slots |
| `__PROFILE_ID__` | 18-char Profile Id (e.g. `00eRZ00000012tKYAQ`) |
| `__SUFFIX__` | 8-char lowercase hex string derived from `Organization.Id` |
## Idempotency
The block re-queries existing users inside the transaction and inserts only the truly
missing indexes. Two concurrent runs can both pass the pre-query before either commits;
Salesforce's `DUPLICATE_USERNAME` constraint is the authoritative deduplicator, and
`run-create.sh` treats `DUPLICATE_USERNAME` as "another agent won the race" and retries a
re-detect.
## Security note (password / TraceFlag)
This block only creates the `User` rows and never emits a password via `System.debug`. The
caller (`run-create.sh`) sets each password with a SEPARATE Anonymous Apex
`System.setPassword(id, pw)` submission per newly-created user. That plaintext lives in the
submitted Apex source, which appears in the inline `executeAnonymous` debug log and — ONLY
when a debug-log TraceFlag is active for the running user — in a queryable `ApexLog` row.
`run-create.sh` proves no active TraceFlag exists before calling `System.setPassword` and
otherwise fails closed (no password set), so plaintext never reaches a queryable log.
## Output contract
For every user created this run, `System.debug` emits one line:
```text
AGENT_USER_CREATED|<userId>|<username>|<email>
```
which `run-create.sh` greps from the log to build the skill's JSON return value.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |