/sf-industries-misc:life-sciences-fieldsalesrep-coordinatefrom sf-industries-misc
Orchestrates the full Life Sciences Cloud setup for field sales reps, running five stages in sequence: prerequisites, config deployment, territory configuration, user provisioning, and sample visit creation. Each stage gates on the previous one's success.
Ships in sf-industries-misc. 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.
Runs the complete Life Sciences Cloud setup workflow as five stages in strict sequence, gating each on the success of the previous stage. Each stage delegates to a child skill or a reference workflow, organized internally into phases and steps (defined under Execution Order below).
Serve only requests for the full end-to-end LSC setup. A single stage/phase/step is never invokable here — never silently expand a partial ask into the whole flow. Before any work:
life-sciences-prerequisites-validate / life-sciences-territory-configure); stop.life-sciences-prerequisites-validate / life-sciences-territory-configure; stop.Continue only for the complete end-to-end setup: orchestrating the full flow (prerequisites → config deploy → territory → user provisioning → visit creation) in order with gates. Each stage's actual work is delegated to child skills / reference files.
Gather before proceeding:
Terminology: Stage = one of the 5 units of work (1–5), each delegated to a child skill or a reference workflow; Phase = a named group of work inside a stage; Step = an atomic action inside a phase. So "Stage 2 › Phase 1 › Step 3" reads top-to-bottom.
Run in this order, each gated on the previous (see the full dependency diagram in references/orchestration-flow.md):
| # | Stage | Runs | Gate (must pass to advance) | Output |
|---|---|---|---|---|
| — | Setup: download .lsc-starter-config/LSStarterConfig | — | Folder present (MANDATORY — hard stop) | Shared source folder in CWD |
| 1 | Prerequisites Validation | life-sciences-prerequisites-validate skill | All prerequisites PASS | Org confirmed ready |
| 2 | Starter Config Deploy | references/stage-2-starter-config-overview.md | All 13 deploy steps succeed | LSC Custom Profile exists |
| 3 | Territory Configuration | life-sciences-territory-configure skill | Territory model Active + L3 territory | Level-3 territory ID + name |
| 4 | User Provisioning | references/stage-4-user-provisioning-overview.md | User created, permsets + territory assigned | Rep username |
| 5 | Sample Visit Creation | references/stage-5-visit-creation-overview.md | Visit + supporting records created; metadata cache generated | — |
Before presenting the workflow, establish which org to use. Do this every time the user asks to set up Life Sciences Cloud — do not silently reuse the current default org.
List connected orgs:
sf org list --json
Parse the result and present the authenticated orgs (non-expired) to the user as a numbered list — include alias, username, org type (Dev Hub / Sandbox / Scratch / Production), and the default marker if any:
Connected Orgs — select the target for Life Sciences Cloud setup
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. ls-dev [email protected] (Dev Hub) [default]
2. ls-sandbox [email protected] (Sandbox)
3. partial-scr [email protected] (Scratch)
N. Log in to a fresh org (opens a browser to authenticate a new org)
Ask the user to choose: "Which org would you like to use? Enter a number, or choose N to log in to a fresh org."
Handle the selection:
Existing org chosen → capture its username/alias as the target org for all subsequent steps.
Fresh org chosen (option N) → authenticate a new org interactively: ask for the login URL (My Domain / instance URL, e.g. https://mydomain.my.salesforce.com; https://login.salesforce.com for production, https://test.salesforce.com for a sandbox) and an alias (e.g. ls-setup), then run the login command yourself:
sf org login web --instance-url <user-supplied-url> --alias <user-supplied-alias> --set-default
Do not hand the command to the user to run — execute it directly. It opens a browser on the user's machine for them to complete the web login interactively; the command then returns. After it finishes, re-run sf org list --json to confirm the new org, then use it as the target org.
Confirm the target org back to the user before proceeding: "Using () as the target org for Life Sciences Cloud setup." Store this in OrchestrationState.targetOrg.
If
sf org listreturns no authenticated orgs, go straight to the fresh-org login flow (option N) — there is nothing to select from.
Present the workflow to the user:
Life Sciences Cloud — Full Setup Workflow
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This will execute 5 stages in sequence. Each stage is internally
organized into phases and steps.
Stage 1: Validate Prerequisites
Checks org settings, permissions, and features
Stage 2: Deploy Starter Configuration
Deploys objects, profiles, config records, layouts, flexipages
Stage 3: Configure Territories
Creates territory type, model, and 3-level hierarchy
Stage 4: Provision Field Sales Rep User
Creates user, assigns profile/permsets, assigns to territory
Stage 5: Create Sample Visit
Logs in as the rep, creates account/provider/visit records,
generates the mobile metadata cache
Target org: <org>
Ask for confirmation: "Ready to begin the full Life Sciences Cloud setup? (yes/no)"
Download the shared source folder FRESH (MANDATORY — hard gate, before any stage). Both Stage 2 (Starter Config Deploy — metadata + config records) and Stage 5 (Sample Visit Creation — Data CSVs) read from .lsc-starter-config/LSStarterConfig/; those stages do NOT download or delete it — the orchestrator owns one fresh download here and a single delete in Phase 8. Always re-pull — never reuse an existing folder (a stale copy could serve outdated CSVs, silently defeating Stage 5's "create strictly from the current CSV" rule, or skip newly added components). Delete any pre-existing .lsc-starter-config first, then sparse-checkout only that subtree (the repo is large) fresh into the CWD:
rm -rf .lsc-starter-config lsstarter-tmp
git clone --no-checkout --depth 1 --filter=blob:none \
https://github.com/SalesforceLabs/LSStarterConfig.git lsstarter-tmp
cd lsstarter-tmp && git sparse-checkout init --cone \
&& git sparse-checkout set Codey/LSStarterConfig && git checkout && cd ..
mv lsstarter-tmp/Codey ./.lsc-starter-config && rm -rf lsstarter-tmp
.lsc-starter-config/LSStarterConfig/contains its ownsfdx-project.json(pinssourceApiVersion: 65.0) — the deploy step (Phase 3) must run from inside it.
Download gate — verify the folder exists before proceeding. Confirm the download succeeded by checking that .lsc-starter-config/LSStarterConfig/sfdx-project.json and .lsc-starter-config/LSStarterConfig/Data/ are present (e.g. ls .lsc-starter-config/LSStarterConfig/sfdx-project.json .lsc-starter-config/LSStarterConfig/Data).
If present → set sourceFolderDownloaded: true in OrchestrationState and proceed to Phase 2.
If the download failed or the folder/contents are missing → STOP. Do NOT proceed to any stage — every stage depends on this folder. Report the failure and stop:
STOP: Setup cannot start — source download failed
Could not download .lsc-starter-config/LSStarterConfig from
https://github.com/SalesforceLabs/LSStarterConfig.git
Likely: no network / GitHub unreachable, git < 2.25 (no sparse-checkout),
or insufficient disk space / write permission in the CWD.
Mandatory prerequisite — no stage can run without it. Fix the cause and
re-run, or download the folder manually into the CWD, then re-run.
Leave sourceFolderDownloaded: false and do not advance the workflow.
Run the prerequisites validation following the life-sciences-prerequisites-validate skill workflow exactly.
Gate check: Review the results.
STOP: Stage 1 FAILED — Prerequisites not met
<show the prerequisite failure table>
Please resolve the failed prerequisites and re-run this workflow.
Ask the user: "Would you like to continue anyway (skip failed prerequisites), or stop and fix them first?"
Run the starter config deployment following references/stage-2-starter-config-overview.md exactly (all 13 steps in order); read its own reference files as directed.
Gate check: Verify the LSC Custom Profile exists:
sf data query --query "SELECT Id, Name FROM Profile WHERE Name = 'LSC Custom Profile'" --target-org <org> --json
Run the territory configuration following the life-sciences-territory-configure skill workflow exactly.
Gate check: Verify the territory model is Active and level-3 territory exists:
sf data query --query "SELECT Id, Name, DeveloperName, Territory2Model.State FROM Territory2 WHERE ParentTerritory2.ParentTerritory2Id != null AND Territory2Model.State = 'Active'" --target-org <org> --json
Run the user provisioning following references/stage-4-user-provisioning-overview.md exactly; read its own reference file as directed. Pass the territory information captured from Stage 3.
Gate check: Verify the user exists, has the correct profile, all 4 permission sets, and territory assignment. Capture the rep username — Stage 5 logs in as this user.
STOP-GATE (Stage 4 completeness). Do NOT accept "user created" as passing this gate — verify all four facets and STOP if any is short:
sf data query --query "SELECT COUNT(Id) c FROM PermissionSetAssignment WHERE AssigneeId = '<newUserId>' AND PermissionSet.IsOwnedByProfile = false" --target-org <org> --jsonThe permset count MUST be 4 ({LifeSciencesCore, LifeSciencesFieldSalesRepresentative, HealthCloudStarter, LifeSciencesKeyAccountManager}); the user MUST be
IsActive=trueon theLSC Custom Profile; and aUserTerritory2Associationto the level-3 territory MUST exist. If the permset count is < 4 or any facet is missing, Stage 4 did not fully complete — re-run the missing part ofreferences/stage-4-user-provisioning-overview.md(its own Phase 4/5 stop-gates cover this) before advancing to Stage 5. A rep missing a permset silently fails visit creation downstream with confusing permission errors.
Run the visit creation following references/stage-5-visit-creation-overview.md exactly; read its own reference files as directed. Pass the rep username captured from Stage 4. This stage:
sf org login web) and creates account, healthcare provider, and visit records (rep-owned), plus territory associations and product master data (admin-owned).This stage uses two identities — the rep user (from Stage 4) for visit records and the admin for product master data and metadata cache generation. Follow the child skill's rep/admin split exactly.
Gate check: Verify at least one Visit record was created:
sf data query --query "SELECT Id, Name, AccountId FROM Visit ORDER BY CreatedDate DESC LIMIT 1" --target-org <org> --json
Display the complete workflow summary — a "Life Sciences Cloud Setup Complete" header followed by one block per stage (substitute actual values from the run):
<N> layouts + <N> flexipages deployed, 28 trigger handlers activated.<model name> (Active); Level-3 Territory <territory name>.<firstName> <lastName> (<username>); Profile LSC Custom Profile; permission sets Life Sciences Core, Life Sciences Field Sales Representative, Health Cloud Starter, Life Sciences Key Account Management; Territory <territory name>; admin also assigned to the territory.<name> (Territory <territory name>); product detailing/discussion records; mobile metadata cache generated (Connect API).Close with: "The org is ready for Life Sciences Cloud field sales workflows."
After the final summary (all 5 stages complete), delete the .lsc-starter-config folder downloaded in Phase 1 to leave the working directory clean. Run from the CWD (the parent of .lsc-starter-config/):
rm -rf .lsc-starter-config
Do this silently — do NOT print a cleanup line or mention the folder deletion in the final output. Skip if the workflow stopped on a failure and the user may resume — keep the folder until the flow completes so a resumed stage can still read it. This is the single deletion for the whole flow; the child skills never delete it.
Maintain overall orchestration state:
OrchestrationState = {
targetOrg: string,
sourceFolderDownloaded: boolean, // .lsc-starter-config/LSStarterConfig downloaded in Phase 1, deleted in Phase 8
stages: [
{ name: "Prerequisites", status: "pending|running|passed|failed|skipped" },
{ name: "StarterConfig", status: "pending|running|passed|failed" },
{ name: "TerritorySetup", status: "pending|running|passed|failed", territoryId?: string, territoryName?: string },
{ name: "UserProvisioning", status: "pending|running|passed|failed", userId?: string, username?: string },
{ name: "VisitCreation", status: "pending|running|passed|failed", visitId?: string }
]
}
Stages are not re-entrant. Before executing any stage, check its status in OrchestrationState: running → reply "Stage N is already in progress" and take no action; passed → ask for explicit confirmation before re-running; failed → re-run (intentional recovery); pending → advance. Transition status to running at execution start (not on user input) so accidental double-confirms never run a stage twice.
If the user requests a change to an earlier stage's inputs while a later stage is in progress or pending, run an impact assessment first: acknowledge without applying, identify affected vs. unaffected stages, present options (re-run affected / apply going forward only / cancel), and wait for the decision. Surface destructive-change warnings (an activated territory model can't be deleted; an existing user/records remain).
The full behavior matrix, impact-assessment template, per-change impact mapping, and destructive-change warnings are in references/state-machine-and-changes.md.
| Constraint | Rationale |
|---|---|
| Always run Phase 0 org selection first; list connected orgs and let the user pick or log in to a fresh org | User must explicitly choose the target org; never silently reuse the default |
Download .lsc-starter-config/LSStarterConfig exactly once (Phase 1, MANDATORY hard gate) and delete it exactly once (Phase 8); child skills never download or delete it | Both child skills read from the shared folder — proceeding without it guarantees downstream failures |
| Execute stages strictly in order 1→5, gating each on prior success | Each stage depends on outputs from previous stages; prevents cascading failures |
| Never skip Stages 2 or 3, or Stage 4 before Stage 5 | User provisioning depends on profile + territory; visit creation logs in as the Stage-4 rep |
| Follow each child skill's workflow exactly; capture outputs (IDs, names) for later stages | Child skills have their own confirmations; avoids redundant re-queries |
Never re-execute a running/passed stage without explicit confirmation; transition status to running at execution start, not on user input | Race-free idempotency against duplicate "Proceed" messages |
| Perform impact assessment before applying mid-flow changes | User must see what will break/redo before committing to a change |
| Issue | Resolution |
|---|---|
| Source download fails in Phase 1 (network/git/disk) | Hard stop — do NOT run any stage. Report the failure (see Phase 1 download gate); fix the cause or download .lsc-starter-config/LSStarterConfig manually into the CWD, then re-run |
| No connected orgs found | sf org list returns none — go straight to the fresh-org login (sf org login web) in Phase 0 |
| Fresh-org / rep login needs a browser | Run sf org login web yourself (Phase 0 org auth, Stage 5 rep login) — don't hand it to the user. It opens a browser on the user's machine; they complete the web login there and the command returns |
| Artifacts exist from a prior run (profile, territory, user, config) | The child skills are idempotent/upsert-safe and detect existing records — query the org to confirm, then skip or re-run safely |
| Visit creation uses two identities (rep + admin) | Product master data and metadata cache are admin-owned; follow the child skill's rep/admin split |
| Stage re-triggered, or user changes an earlier input mid-flow | See the transition matrix and impact assessment in references/state-machine-and-changes.md |
If the user may have already completed some stages (e.g. from a prior session), ask which, then verify each claimed-complete stage by querying the org (Stage 1 = ask; 2 = LSC Custom Profile; 3 = active model + L3 territory; 4 = user with correct profile/permsets; 5 = a Visit record). Skip verified stages and resume from the first incomplete one. Exact detection queries per stage are in references/orchestration-flow.md → Resume Logic.
Deliverables:
.lsc-starter-config/LSStarterConfig folder downloaded once (Phase 1) and removed once (Phase 8) — both done silently; not reported in the final summary| File | When to read |
|---|---|
references/orchestration-flow.md | At start — the dependency diagram, per-stage gate verification queries, resume-detection queries, and timing expectations |
references/state-machine-and-changes.md | When a stage is re-triggered or the user changes an earlier input mid-flow — the full transition behavior matrix, impact-assessment template + mapping, and destructive-change warnings |
references/stage-2-starter-config-overview.md | During Stage 2 (Phase 3) — the full 13-step starter-config deploy workflow; it points to its own sibling references as needed |
references/stage-4-user-provisioning-overview.md | During Stage 4 (Phase 5) — the full field-sales-rep user provisioning workflow; it points to its own sibling reference as needed |
references/stage-5-visit-creation-overview.md | During Stage 5 (Phase 6) — the full sample-visit creation workflow; it points to its own sibling references as needed |
references/orchestration-flow.md (opens in a new tab)references/stage-2-starter-config-application-flexipage-mapping.md (opens in a new tab)references/stage-2-starter-config-deploy-commands.md (opens in a new tab)references/stage-2-starter-config-lifesci-metadata-deploy.md (opens in a new tab)references/stage-2-starter-config-overview.md (opens in a new tab)references/stage-2-starter-config-profile-layout-assignments.md (opens in a new tab)references/stage-2-starter-config-state-tracking.md (opens in a new tab)references/stage-2-starter-config-trigger-handlers.md (opens in a new tab)references/stage-4-user-provisioning-overview.md (opens in a new tab)references/stage-4-user-provisioning-user-provisioning-details.md (opens in a new tab)references/stage-5-visit-creation-execution-state-and-recovery.md (opens in a new tab)references/stage-5-visit-creation-metadata-cache-generation.md (opens in a new tab)references/stage-5-visit-creation-overview.md (opens in a new tab)references/stage-5-visit-creation-visit-creation-data.md (opens in a new tab)references/state-machine-and-changes.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub cloudzlab/sf-team-skills --plugin sf-industries-misc13 skills in this plugin
/afcc-setup-coordinateOrchestrates end-to-end headless setup of Agentforce Contact Center (AFCC) on a Salesforce org. Scans the org first, presents a delta plan for approval, then sequentially provisions demo users, Omni-Channel base settings, a human queue with routing config and members, presence statuses, permission sets, a PSTN voice number, and an active PstnVoice MessagingChannel wired to the queue. Interactive at key decision points — never assumes country, number type, queue names, or user counts. TRIGGER: set up AFCC, configure Agentforce Contact Center, stand up voice contact center, AFCC migration setup, provision AFCC org headlessly./insurance-brokerage-agency-billing-configureConfigure end-to-end Agency Billing on a Salesforce FSC Insurance Brokerage org via dispatch MCP calls. Use this skill when users want to set up brokerage billing, configure agency billing, enable insurance billing features, create billing rules, set up accounting periods, assign billing permission sets, or create a demo policy for the Issue-to-Invoice flow. TRIGGER when: user mentions agency billing setup, brokerage billing configuration, insurance billing enablement, billing treatments, billing rules creation, accounting period setup, insurance policy billing information, or Issue-to-Invoice testing. Also use when users say things like set up my brokerage org for billing, configure billing on my insurance org, enable billing features, create billing treatments, set up GL accounts, or assign billing permissions. DO NOT TRIGGER when: user needs general Revenue Cloud Billing without insurance context, needs CPQ/quoting configuration, or needs claims processing setup./life-sciences-kam-coordinateUse this skill to run the full end-to-end Life Sciences Cloud setup workflow for a key account management (KAM) user in sequence. Trigger when the user says 'set up Life Sciences Cloud end to end for kam user', 'run the full LSC setup for kam user', 'orchestrate Life Sciences Cloud configuration for kam user', 'complete LSC setup for kam user', or 'Life Sciences Cloud full install for kam user'. Executes six stages in order: prerequisites validation, starter config deployment, territory configuration, participant role and sprint creation, KAM data and plan-template (goals, tasks, measures) creation, and KAM user provisioning — gating each stage on the success of the previous one. DO NOT TRIGGER when: the user wants to run only one specific stage individually, or when the request targets a field sales rep rather than a KAM user (use life-sciences-fieldsalesrep-coordinate for that persona)./life-sciences-prerequisites-validateValidate Life Sciences Cloud for Customer Engagement org prerequisites. Use when an admin needs to verify that all required settings, permissions, OWD sharing rules, and feature toggles are correctly configured before deploying Life Sciences Cloud. Checks user profile, permission sets, Life Sciences CE settings, surveys, OWD, inventory, account plans, care plans, Chatter, data protection, multi-currency, state/country picklists, and person accounts. Reports pass/fail for each check with remediation steps. TRIGGER when: user says 'check prerequisites', 'verify org setup for Life Sciences', 'LSC readiness check', 'pre-requisites for Life Sciences Cloud', 'validate org for LSC'. DO NOT TRIGGER when: user wants to automatically enable or configure these settings, or when the user asks for the full end-to-end Life Sciences Cloud setup / orchestration (that is the `life-sciences-fieldsalesrep-coordinate` orchestrator's job — this skill runs only as a standalone prerequisites check)./life-sciences-territory-configureUse this skill to create and activate a Territory Type, Territory Model, and Territories for Life Sciences Cloud. Trigger when the user says 'set up territories', 'create territory model', 'configure territory hierarchy for Life Sciences', 'territory setup for LSC', or 'create territories for Life Sciences Cloud'. Creates a Geographical territory type, an LSC Territory Model, and a 3-level territory hierarchy (Region, District, Territory). Confirms names with the user, shows a preview, then deploys and activates the model. DO NOT TRIGGER when: user wants to validate prerequisites, assign users to territories, create territory assignment rules, or run the full end-to-end Life Sciences Cloud setup / orchestration (that is the `life-sciences-fieldsalesrep-coordinate` orchestrator's job — this skill runs only as a standalone territory setup)./marketing-message-testSalesforce Marketing Cloud / Engagement 360 message preview and test-send. Use this skill when the user wants to render a personalized or unpersonalized preview of an E360 message (Email, SMS, WhatsApp, Push, In-App, RCS) from a content key, or fire a test send, over the headless API — no app UI. TRIGGER when: user has a contentKey and wants to see how a message renders for a recipient, preview a message headlessly, or send a test message. DO NOT TRIGGER when: the task is authoring message content, building Data Cloud segments/DMOs (use data360-segment / data360-harmonize), or activating a segment (use data360-activate).3 plugins ship this exact skill · first indexed Oct 9, 2026
Other plugins' skills for the same job