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/toggle-competency.sh

View on GitHub
#!/bin/bash

# Activate or deactivate a Coaching Competency by DeveloperName or Id.
# Toggles IsActive via Tooling API PATCH.
#
# Deactivation preserves historical EnablementCompetencyEval scores (per the
# entity XML comment on IsActive).
#
# Usage: ./toggle-competency.sh <org-alias> <name-or-id> <activate|deactivate>

set -euo pipefail

export NO_COLOR=1
export FORCE_COLOR=0

ORG_ALIAS="${1:-}"
IDENT="${2:-}"
ACTION="${3:-}"

if [[ -z "$ORG_ALIAS" || -z "$IDENT" || -z "$ACTION" ]]; then
  echo "Usage: $0 <org-alias> <name-or-id> <activate|deactivate>"
  exit 1
fi

if [[ "$ACTION" != "activate" && "$ACTION" != "deactivate" ]]; then
  echo "Action must be 'activate' or 'deactivate'"
  exit 1
fi

TARGET=$([[ "$ACTION" == "activate" ]] && echo "true" || echo "false")

# ---------------------------------------------------------------------------
# Auth
# ---------------------------------------------------------------------------
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
# shellcheck source=shared/auth.sh
source "$SCRIPT_DIR/shared/auth.sh"
# shellcheck source=shared/soql.sh
source "$SCRIPT_DIR/shared/soql.sh"

resolve_org_auth "$ORG_ALIAS" || exit 1

TOOLING_BASE="services/data/v68.0/tooling"

# ---------------------------------------------------------------------------
# Resolve identifier → Id + current state
# ---------------------------------------------------------------------------
# Ids start with 1nA (keyPrefix). Anything else is treated as DeveloperName or MasterLabel.
if [[ "$IDENT" =~ ^1nA[0-9a-zA-Z]{12,15}$ ]]; then
  WHERE="Id='${IDENT}'"
else
  SAFE=$(soql_escape "$IDENT")
  WHERE="DeveloperName='${SAFE}' OR MasterLabel='${SAFE}'"
fi

QUERY="SELECT+Id,MasterLabel,IsActive+FROM+EnablementCompetencyDef+WHERE+$(printf '%s' "$WHERE" | jq -sRr @uri)"
LOOKUP=$(sf api request rest "${TOOLING_BASE}/query/?q=${QUERY}" --target-org "$ORG_ALIAS" 2>/dev/null) || true

RECORD_COUNT=$(echo "$LOOKUP" | jq -r '.totalSize // 0')
if [[ "$RECORD_COUNT" == "0" ]]; then
  echo "No competency found matching: $IDENT"
  exit 1
fi
if [[ "$RECORD_COUNT" != "1" ]]; then
  echo "Multiple competencies matched '$IDENT' — refusing to bulk-toggle."
  echo "$LOOKUP" | jq -r '.records[] | "   \(.Id)  \(.MasterLabel)"'
  exit 1
fi

REC_ID=$(echo "$LOOKUP" | jq -r '.records[0].Id')
REC_LABEL=$(echo "$LOOKUP" | jq -r '.records[0].MasterLabel')
REC_STATE=$(echo "$LOOKUP" | jq -r '.records[0].IsActive')

echo "$REC_LABEL ($REC_ID) — currently IsActive=$REC_STATE"

# Idempotency
if [[ "$REC_STATE" == "$TARGET" ]]; then
  echo "Already $ACTION'd — no-op."
  exit 0
fi

# Enforce 8-active cap when activating.
if [[ "$ACTION" == "activate" ]]; then
  ACTIVE_COUNT=$( (sf api request rest \
    "${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)
  ACTIVE_COUNT="${ACTIVE_COUNT:-0}"
  if [[ "$ACTIVE_COUNT" -ge 8 ]]; then
    echo "Cannot activate: org already has $ACTIVE_COUNT active competencies (max 8)."
    echo "   Deactivate one first, then retry."
    exit 1
  fi
fi

# ---------------------------------------------------------------------------
# PATCH
# ---------------------------------------------------------------------------
PAYLOAD=$(jq -n --argjson v "$TARGET" '{IsActive: $v}')

if RESP_BODY=$(sf api request rest "${TOOLING_BASE}/sobjects/EnablementCompetencyDef/${REC_ID}" \
  --target-org "$ORG_ALIAS" \
  --method PATCH \
  --header 'Content-Type: application/json' \
  --body "$PAYLOAD" \
  2>/dev/null); then
  echo "${ACTION}d $REC_LABEL — IsActive now $TARGET"
  exit 0
else
  echo "Error: PATCH failed"
  echo "   $RESP_BODY"
  exit 1
fi
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