forcedotcom/sf-skills

service-omni-skills-based-routing-configure

Use to make agents routable by Omni skills-based routing: ensure an Omni Skill exists, then assign it to each active agent through the classic Omni-Channel SkillUser junction.

Quelltext ansehen

Verwendung

  1. Installationsbefehl kopieren und das Quellpaket vor der Installation in der eigenen Agentenumgebung prüfen.
  2. Benötigte Werkzeuge, Zugangsdaten und Hosts im Original prüfen.
  3. Eingabe und gewünschtes Ergebnis beschreiben und die Ausgabe mit den Quellen abgleichen.
npx skills add https://github.com/forcedotcom/sf-skills --skill service-omni-skills-based-routing-configure

Vor dem Start

  • Die Installation umfasst weder Modellabo noch API-Kontingent oder Dateizugriffsrechte.
  • Sterne und Installationen zeigen Aktivität, keine unabhängige Qualitäts- oder Sicherheitsprüfung.
Originales Skill-Dokument

Aus dem Quell-Repository gerendert; Überschriften, Beispiele, Code, Tabellen, Links und Bilder bleiben erhalten.

service-omni-skills-based-routing-configure

Make agents routable by Omni skills-based routing (SBR). A routable agent needs the Skill and a SkillUser junction assigning that skill to the agent's user. SkillUser is the classic Omni-Channel model written by Setup > Skills > Assign Users and evaluated when work has skill requirements. This skill ensures both, idempotently, for one skill across a set of active agent users.

ServiceResource and ServiceResourceSkill are the Field Service skill model. On a plain Service Cloud org, ServiceResource.IsActive is not writable or queryable, so a newly created resource remains inactive and the junction is rejected. This skill therefore uses the supported, license-appropriate SkillUser path.

Inputs

bash
bash scripts/configure-and-report.sh <org-alias> <skill_developer_name> [agent_members_csv] [skill_master_label]
  • org-alias (required).
  • skill_developer_name (required). The Omni Skill DeveloperName to ensure and bind (e.g. Omni_Demo_Voice).
  • agent_members_csv (optional). Comma-separated agents to make skill-routable — each token a Username (…@…) or a 15/18-char User Id (005…). May also be supplied via AGENT_MEMBERS_CSV. When omitted, the skill blocks (it will not guess which agents to skill).
  • skill_master_label (optional). MasterLabel used only when the skill must be created; defaults to a title-cased form of the DeveloperName.

Preconditions and safety

  • Target org authenticated via sf CLI, Service Cloud license, sf CLI ≥ 2.139.6.
  • Omni-Channel base settings enabled with skills-based routing turned on (service-omni-base-settings-configure).
  • The named agents exist and are active (service-omni-agent-users-create).
  • The three-way safe_to_write production guard applies.

Run

configure-and-report.sh proceeds in two idempotent phases, each detect-before-write:

  1. Skill — query Skill by DeveloperName. Present → reused; absent → deploy a Skill component via the Metadata API and re-query for its Id.
  2. SkillUser — query existing SkillUser records for the Skill and resolved users, then create only missing (SkillId, UserId) bindings via REST DML. A concurrent DUPLICATE_VALUE is reconciled as reused.

Behavior

Idempotent + non-destructive. Existing skills and bindings are reused; the skill never deletes or reassigns anything it did not create, so re-runs converge without duplication. Only active users are resolved — an inactive user cannot be routed work, so it is reported rather than silently skilled.

Partial safety. If some bindings succeed and others fail, the status is partial with per-agent errors in blocking_issue; the successful bindings are left in place (each junction is an independent write).

Output contract

A single JSON object: status ∈ configured | reused | partial | blocked, skill ({developer_name, id, state}), agents (array of {username, user_id, skill_binding_id, skill_binding_state}), created_counts, reused_counts, manual_actions, blocking_issue.

  • reused — skill and all bindings already existed.
  • configured — at least one component created and all requested bindings now exist.
  • partial / blocked — see blocking_issue; manual_actions names the prerequisite skill when the cause is a missing precondition.

Limitations

  • One skill per invocation; run again per skill an agent set needs.
  • Does not author WorkSkillRouting rules or field-based skill criteria — that is a separate skill.
  • Does not create agent users, queues, or presence configuration.
  • SkillUser.SkillLevel is left at the platform default; forking the DML body is required to set explicit proficiency.

References

FileWhen to read
references/api-notes.mdSkill metadata vs Skill sObject, the SkillUser agent-binding model, and SBR base-setting prerequisites
scripts/tests/test_sbr_contracts.pyWhen validating changes — run python3 scripts/tests/test_sbr_contracts.py from this skill directory

Verwandte Aufgaben

aus demselben Repository

Weitere Skills

Alle Skills
forcedotcom
Community

platform-custom-application-generate

Use this skill when users need to create or configure tab-based Salesforce Custom Applications with navigation, branding, and action overrides. Trigger when users mention custom apps, application metadata, app navigation, or organizing tabs into applications. Use when users want to create app containers for tabs and pages. Do NOT use when the goal is hosting a React UI bundle in the App Launcher — use experience-ui-bundle-custom-app-generate for that case.

Installationen
1
GitHub Stars
1112
Aktualisiert
23. Okt.
forcedotcom
Community

platform-custom-field-generate

Use when users create, generate, or validate Salesforce Custom Field metadata. Trigger on custom fields, field types, Roll-Up Summary, Master-Detail/Lookup relationships, formula fields, picklists, dependent (controlling) picklists, referencing a value set from a field, or scoping picklist values per record type; also field deployment errors, including a record type that won't deploy without a business process. DO NOT TRIGGER for creating/customizing the value set itself — a new GlobalValueSet o

Installationen
1
GitHub Stars
1112
Aktualisiert
23. Okt.
forcedotcom
Community

platform-custom-metadata-type-generate

Use to create, generate, or validate Salesforce Custom Metadata Type metadata — the mdt object, fields, and deployable records. Trigger on custom metadata types, CMDT, mdt objects, .md-meta.xml files, or cross-org reference/config data; also admin-maintained mapping/lookup/crosswalk tables (config that changes without a deploy belongs in a CMDT, never hardcoded in Apex/Flow), and CMDT deploy errors. DO NOT TRIGGER for Custom Settings (use platform-custom-setting-generate), business-record object

Installationen
1
GitHub Stars
1112
Aktualisiert
23. Okt.
forcedotcom
Community

platform-custom-report-type-generate

Use to create, generate, or validate Salesforce Custom Report Type metadata. Trigger on custom report types, CRTs, cross-object reports, report builder data sources, exposing fields for reporting across related objects, inner vs outer joins in reports, report type categories, or deployment errors for .reportType-meta.xml files. Do NOT trigger for running, editing, or filtering existing reports; creating report folders, dashboards, or list views; or non-authoring reporting questions.

Installationen
1
GitHub Stars
1112
Aktualisiert
23. Okt.