Skip to content

forcedotcom/sf-skills / skills/sales-call-scoring-configure

sales-call-scoring-configure

Verified

Configure, set up, or repair AI Call Scoring (a.k.a. Call Coaching / Coaching Competencies) on an ECI-enabled Salesforce org. Flips ECICallScoringEnabled via SOAP Metadata API, enables Einstein Generative AI Platform if off, and manages Coaching Competency records (EnablementCompetencyDef Tooling API): install the 6 OOTB set, the 7 Momentum best-practice prompts, or conversationally author/edit/activate/deactivate custom competencies (8-active + 16000/255-char caps). TRIGGER when: user wants to turn on AI Call Scoring or Call Coaching, install OOTB or best-practice competencies, create/edit custom competencies, re-enable after sandbox refresh, or verify/repair partial Call Coaching setup on a 68+ ECI org. DO NOT TRIGGER when: no ECI license (direct to Agentforce for Sales), user wants to enable ECI/Momentum themselves (out of scope — Setup), Pipeline Management (use sales-agentforce-pipeline-management-configure), or custom agent (use agentforce-generate).

scripts/shared/cap.sh

View on GitHub
#!/bin/bash
# Shared cap-diagnosis helpers for the 8-active EnablementCompetencyDef limit.
#
# Server-side, EnablementCompetencyDef enforces a hard cap of 8 IsActive=true
# records per org (CoachingCompetenciesFeature.MAX_ACTIVE_COMPETENCIES). All
# five write scripts (create-competency, create-custom-competency,
# toggle-custom-competency, install-ootb-competencies,
# install-best-practice-competencies) call these helpers to keep the
# admin-facing cap message identical across the surface.
#
# Contract for callers: source this file, then use
#   query_active_count <ORG_ALIAS>
#   print_cap_report   <ORG_ALIAS> <CONTEXT>
#   print_cap_footer_activate_hint <NEW_ID_OR_NAME>
#
# CONTEXT is a short human phrase used in the header, e.g.
#   "creating '$MASTER_LABEL'"     (create paths)
#   "activating '$REC_LABEL'"      (toggle paths)
#   "installing OOTB competencies" (installer paths)
#
# All queries run through `sf api request rest --target-org` so the org's
# access token is never passed as curl argv (visible in the process table).
# Nothing here writes to the org — read-only diagnosis only. The decision to
# fall back to inactive (custom / installer paths) or refuse outright (toggle
# path — you can't activate to inactive) is the caller's.

MAX_ACTIVE_COMPETENCIES=8
CAP_TOOLING_BASE="services/data/v68.0/tooling"

# Return the current active count (or "0" on any failure — callers should
# treat a query failure as "cannot verify cap" and continue optimistically;
# the server-side hard cap still protects them).
query_active_count() {
  local org_alias="$1"
  (sf api request rest \
    "${CAP_TOOLING_BASE}/query/?q=SELECT+COUNT()+FROM+EnablementCompetencyDef+WHERE+IsActive=true" \
    --target-org "$org_alias" 2>/dev/null || true) \
    | jq -r '.totalSize // 0' 2>/dev/null || echo "0"
}

# Print a rich, admin-actionable cap report to stderr. Lists the currently
# active competencies with their Ids (deactivate command is copy-pasteable)
# and explains next steps. Caller supplies the context string that goes at
# the top ("Cap reached while <context>").
print_cap_report() {
  local org_alias="$1"
  local context="$2"

  local list_json
  list_json=$(sf api request rest \
    "${CAP_TOOLING_BASE}/query/?q=SELECT+Id,MasterLabel,DeveloperName,SourceCompetencyTemplate+FROM+EnablementCompetencyDef+WHERE+IsActive=true+ORDER+BY+MasterLabel" \
    --target-org "$org_alias" 2>/dev/null || true)

  {
    echo ""
    echo "Warning: Active Coaching Competency cap reached while ${context}."
    echo ""
    echo "    Salesforce allows up to ${MAX_ACTIVE_COMPETENCIES} active competencies per org."
    echo "    This org currently has ${MAX_ACTIVE_COMPETENCIES} active — listed below."
    echo ""
    echo "    Currently active:"
    echo "$list_json" | jq -r '.records[]? | "      • \(.MasterLabel)  (\(.Id))"' 2>/dev/null || echo "      (unable to list — the server-side cap check will still enforce this)"
    echo ""
    echo "    To free a slot, deactivate one of the above:"
    echo "$list_json" | jq -r '.records[0:1][]? | "      ./skills/sales-call-scoring-configure/scripts/toggle-custom-competency.sh <alias> \(.Id) deactivate"' 2>/dev/null
    echo ""
  } >&2
}

# Print the second half of the fallback message (only used by paths that
# auto-create an inactive record). Explains what just happened and how to
# flip it on later.
#
# Args:
#   $1 = record identifier the admin can copy-paste (Id preferred,
#        MasterLabel acceptable)
print_cap_footer_activate_hint() {
  local ident="$1"
  {
    echo "    The new competency was created INACTIVE so your work isn't blocked."
    echo "    Once you deactivate an existing competency, activate the new one:"
    echo ""
    echo "      ./skills/sales-call-scoring-configure/scripts/toggle-custom-competency.sh <alias> ${ident} activate"
    echo ""
  } >&2
}
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall