/sf-industries:life-sciences-territory-configurefrom Salesforce — Industries
Creates and activates a Territory Type, Territory Model, and 3-level territory hierarchy (Region, District, Territory) for Life Sciences Cloud using the sf CLI. Confirms names with the user, shows a preview, then deploys and activates.
Ships in Salesforce — Industries. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Creates and activates a Territory Type, Territory Model, and a 3-level Territory hierarchy for Life Sciences Cloud using the sf CLI.
If the user asks for something unrelated to this skill (either at the start or mid-execution), do not attempt it. Tell the user you did not understand the request, then show what you can help with: setting up Life Sciences Cloud territories (this skill), and — if relevant — point them to life-sciences-prerequisites-validate for prerequisite checks or life-sciences-fieldsalesrep-coordinate for the full end-to-end setup. Then stop and wait.
Gather before proceeding:
sf config get target-org or user-specified)references/territory-metadata.md for the exact XML templates and default names.Present the names in a table:
| Component | Default Name |
|-----------|-------------|
| Territory Type | Geographical |
| Territory Model | LSC Territory Model |
| Territory (Level 1 - Region) | RD - West 20D |
| Territory (Level 2 - District) | DM - San Francisco 20D02 |
| Territory (Level 3 - Territory) | TM - SPC - San Francisco North 20D02T11 |
Ask the user if they are fine with these names or want to change any of them. Ask for each component individually:
If the user wants to change a name, ask them for the new name they'd like to use. Record the updated name.
references/territory-metadata.md and substitute any user-provided names.Show the preview in this format:
=== Territory Type ===
Name: <confirmed name>
Priority: 1
=== Territory Model ===
Name: <confirmed model name>
=== Territory Hierarchy ===
Level 1 (Region): <confirmed region name>
└── Level 2 (District): <confirmed district name>
└── Level 3 (Territory): <confirmed territory name>
Access Levels (all territories):
- Account: Read
- Contact: Edit
- Case: None
- Opportunity: None
If user says no, go back to Phase 1.
references/territory-metadata.md for the exact file structure and XML content.The directory structure must be:
territory-deploy/
├── sfdx-project.json
└── force-app/
└── main/
└── default/
└── territory2Models/
├── <ModelApiName>.territory2Model-meta.xml
└── <ModelApiName>/
├── territory2Types/
│ └── <TypeApiName>.territory2Type-meta.xml
└── territories/
├── <Level1ApiName>.territory2-meta.xml
├── <Level2ApiName>.territory2-meta.xml
└── <Level3ApiName>.territory2-meta.xml
Generate API names from user-confirmed display names:
Write the metadata files using the templates from references/territory-metadata.md with confirmed names.
Deploy the metadata using:
sf project deploy start --source-dir territory-deploy/force-app --target-org <org>
Check deployment status — if it fails, show the error and suggest remediation.
STOP-GATE (component count). The single deploy package must land the complete hierarchy: 1 Territory2Type + 1 Territory2Model + 3 Territory2 records (one Region, one District, one Territory). Confirm the deploy result reports 0 component failures AND verify the territories exist before activating:
sf data query --query "SELECT COUNT(Id) c FROM Territory2 WHERE Territory2Model.DeveloperName = '<ModelApiName>'" --target-org <org> --jsonThe count MUST be 3. A parent-reference failure (e.g. the District deploying before its Region) can land a partial hierarchy — a Level-3 territory with no path to its Region silently breaks downstream user/visit territory assignment. Do NOT activate the model (Phase 4) until all 3 territories are present with 0 deploy failures.
Report that the model deployed in Planning state and ask the user if they want to activate it. Include this warning:
Note: Once a Territory Model is activated, it can be deactivated but cannot be deleted. Do you want to proceed with activation?
If the user confirms activation, activate the model by querying its record ID then updating its State to 'Activating' (not 'Active' — the platform transitions asynchronously from Activating → Active):
# Query the model ID and current state
sf data query --query "SELECT Id, State FROM Territory2Model WHERE DeveloperName = '<ModelApiName>' LIMIT 1" --target-org <org> --json
If the model is in Planning state, update it:
sf data update record --sobject Territory2Model --record-id <ModelId> --values "State='Activating'" --target-org <org>
See references/territory-metadata.md for the full activation logic including error handling.
Verify activation — the platform transitions asynchronously from Activating → Active. Query to confirm:
sf data query --query "SELECT Id, DeveloperName, State FROM Territory2Model WHERE DeveloperName='<ModelApiName>'" --target-org <org>
If still Activating, wait a moment and query again until it reaches Active.
If the user declines activation, report that the model is in Planning state and can be activated later from Setup.
Report success — confirm to the user that all components are created, and report the model's current state (Planning, Activating, or Active).
| Constraint | Rationale |
|---|---|
| Create exactly one territory per level — one Level-1 Region, one Level-2 District, one Level-3 Territory (3 territories total) | Skill produces a single representative hierarchy branch, not a fully populated multi-child tree |
| Always confirm names before creating | User may want to customize territory names for their org |
| Show preview before deploying | User should see exactly what will be created |
| Deploy all components together | Territory hierarchy has dependencies (parent references) |
| Warn user before activation that model cannot be deleted once active | Irreversible action — user must explicitly consent |
Set State to 'Activating' (not 'Active') when updating the record | The platform handles the async transition from Activating → Active |
Target the update by --record-id <ModelId> or --where "DeveloperName='<ModelApiName>'" | Both forms work for sf data update record; use whichever is convenient |
| Clean up temp directory after deploy | Don't leave deployment artifacts behind |
| Issue | Resolution |
|---|---|
| Territory model already exists with same name | Check first with a query; ask user if they want a different name |
| Territory type already exists | Check first; reuse existing type if it matches |
| Deploy fails due to parent territory not found | Ensure all territories are in the same deployment package |
Setting State to 'Active' directly fails with INVALID_STATUS | Always set State to 'Activating' — the platform transitions to Active asynchronously |
Model state shows Activating after update | This is normal — activation is async. Wait and re-query until Active |
| API name conflicts | Ensure generated API names don't conflict with existing metadata |
Deliverables:
| File | When to read |
|---|---|
references/territory-metadata.md | During all phases — contains XML templates, file structure, and default values for territory components |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
33 skills in this plugin
/consumer-goods-accruals-datakit-deployUse this skill to deploy the TPM Liability Accruals data kit end to end to a Salesforce org. Invoke when a customer or teammate wants to install the accrual engine, verify the Data Cloud connection, deploy the Data Kit components, and schedule the export and accrual calculation chain. Trigger phrases include: 'deploy the accrual data kit', 'set up liability accruals', 'install TPM accruals', 'headless accruals setup', 'configure the Data Cloud export connector', 'schedule the accrual chain'. Do NOT use for creating a Data Space alone (use platform-dataspace-access-configure), for generic Salesforce metadata deployment (use platform-metadata-deploy), for querying org data only (use platform-soql-query), or when setting up the data kit for the Trade Promotion Effectiveness (TPE) feature (use consumer-goods-tpe-datakit-deploy instead)./consumer-goods-promotion-bo-api-deployUse to enable the Consumer Goods Cloud TPM Promotion Business Object (BO) API framework in a Salesforce org, interview the user for the custom Workflow Step they want to add, generate and deploy that Apex class, wire it into the create/update/copy workflows, and prove it end-to-end via headless REST ingest. Ships a worked reference example (SetCommentValue) but the customization is user-supplied per org. Triggers on "deploy the promotion BO API", "set up promotion BO API", "headless promotion create", "add a BO API workflow step"./consumer-goods-rtr-datacloud-export-configureConfigure a Trade Promotion Management (TPM) org's RTR (Real Time Reporting) export pipeline to push promotion measures into Data Cloud (Data 360) for Trade Promotion Effectiveness (TPE) dashboards. Use when a customer or admin wants to set up the RTR export for Data Cloud measures, configure the RTR report for TPE, or as a delegated step from consumer-goods-tpe-dashboard-configure./consumer-goods-sync-management-configureUse this skill to set up Salesforce Consumer Goods (CG) Cloud Mobile Sync end-to-end for the Sync Management App managed package — it runs all three acts in order (Act 1 Setup Sync, Act 2 Assign Users, Act 3 Plan & Verify), not just installing the baseline, so a sales rep can see the day's planned visits offline. Use it when asked to "set up CG Cloud mobile sync", "configure Consumer Goods mobile sync", "set up sync for Retail Execution", "install the sync baseline", "assign a user to the sync configuration", "verify the sync setup", or "why can't my rep see their planned visits offline" when sync setup or the baseline install is suspected. DO NOT TRIGGER for general CG Cloud mobile-app troubleshooting unrelated to sync setup, for authoring new or custom sync baselines (this installs only shipped baselines discovered at runtime), or for building or customizing the mobile app UI itself — those are out of scope./consumer-goods-tpe-dashboard-configureEnd-to-end headless setup of Trade Promotion Effectiveness (TPE) dashboards for a Trade Promotion Management (TPM) Cloud org, covering tenant pairing checks, permission sets, SSOT and Tableau Next enablement, C360 SDM verification, the TPM Accruals data kit install, business-period export, RTR Data Cloud export configuration, the TPM_PROMOTION_MEASURE Data Transform, TPE Analytics app install, and optional KPI dashboard customization. Use when a customer or admin wants to set up TPE dashboards, enable Trade Promotion Effectiveness, install the TPE analytics app, or set up and customize TPE dashboards with their own KPIs./consumer-goods-tpe-dashboard-custom-kpi-configureCustomize the Trade Promotion Effectiveness (TPE) Analytics dashboards' generic KPI slots (Promotion Measure 1-3, Tactic Measure 1-2) with customer-chosen KPI measure codes and display names, without touching the shipped base model. Use when a customer/admin wants to "customize TPE dashboards", "change the KPIs on the Promotion/Tactic Analysis dashboard", or "swap in our own measure codes on the TPE dashboard".npx claudepluginhub reej-consulting/reej-sf-skills --plugin sf-industries3 plugins ship this exact skill · first indexed Sep 11, 2026
Other plugins' skills for the same job