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

View on GitHub
#!/bin/bash

# Edit a Coaching Competency's MasterLabel (display name), Description,
# and/or EvaluationInstructions.
# Preserves Id, DeveloperName, IsActive, EvaluationScope, SourceCompetencyTemplate.
#
# --label renames the admin-facing display name (MasterLabel). DeveloperName
# is NOT renamed — it's the API name used by any downstream references and
# would risk breaking integrations to change. If you need a new
# DeveloperName, deactivate + create a fresh record.
#
# Usage:
#   ./edit-competency.sh <org-alias> <name-or-id> --label "<new-label>"
#   ./edit-competency.sh <org-alias> <name-or-id> --instructions-file <file>
#   ./edit-competency.sh <org-alias> <name-or-id> --description "<new-desc>"
#   ./edit-competency.sh <org-alias> <name-or-id> --instructions "<literal>"  # short text only
#   (combine flags to update multiple fields at once)

set -euo pipefail

export NO_COLOR=1
export FORCE_COLOR=0

ORG_ALIAS="${1:-}"
IDENT="${2:-}"
shift 2 || true

if [[ -z "$ORG_ALIAS" || -z "$IDENT" ]]; then
  echo "Usage: $0 <org-alias> <name-or-id> [--label \"<text>\"] [--instructions-file <file>] [--description \"<text>\"] [--instructions \"<text>\"]"
  exit 1
fi

NEW_LABEL=""
NEW_INSTRUCTIONS=""
NEW_DESCRIPTION=""

while [[ $# -gt 0 ]]; do
  case "$1" in
    --label)
      NEW_LABEL="$2"
      shift 2
      ;;
    --instructions-file)
      if [[ ! -f "$2" ]]; then
        echo "File not found: $2"; exit 1
      fi
      NEW_INSTRUCTIONS=$(cat "$2")
      shift 2
      ;;
    --instructions)
      NEW_INSTRUCTIONS="$2"
      shift 2
      ;;
    --description)
      NEW_DESCRIPTION="$2"
      shift 2
      ;;
    *)
      echo "Error: Unknown flag: $1"; exit 1
      ;;
  esac
done

if [[ -z "$NEW_LABEL" && -z "$NEW_INSTRUCTIONS" && -z "$NEW_DESCRIPTION" ]]; then
  echo "Nothing to update — pass --label, --instructions[-file], and/or --description"
  exit 1
fi

if [[ -n "$NEW_LABEL" ]]; then
  LEN=${#NEW_LABEL}
  # MasterLabel is a standard platform label field, capped at 80 chars.
  if [[ "$LEN" -gt 80 ]]; then
    echo "MasterLabel is ${LEN} chars — max is 80."
    exit 1
  fi
fi

if [[ -n "$NEW_INSTRUCTIONS" ]]; then
  LEN=${#NEW_INSTRUCTIONS}
  if [[ "$LEN" -gt 16000 ]]; then
    echo "EvaluationInstructions is ${LEN} chars — max is 16000."
    exit 1
  fi
fi

if [[ -n "$NEW_DESCRIPTION" ]]; then
  LEN=${#NEW_DESCRIPTION}
  if [[ "$LEN" -gt 255 ]]; then
    echo "Description is ${LEN} chars — max is 255."
    exit 1
  fi
fi

# ---------------------------------------------------------------------------
# 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
# ---------------------------------------------------------------------------
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_ENC=$(printf 'SELECT Id,MasterLabel,IsActive FROM EnablementCompetencyDef WHERE %s' "$WHERE" | jq -sRr @uri)
LOOKUP=$(sf api request rest "${TOOLING_BASE}/query/?q=${QUERY_ENC}" --target-org "$ORG_ALIAS" 2>/dev/null) || true
RC=$(echo "$LOOKUP" | jq -r '.totalSize // 0')

if [[ "$RC" == "0" ]]; then echo "No competency matched: $IDENT"; exit 1; fi
if [[ "$RC" != "1" ]]; then
  echo "Multiple competencies matched '$IDENT' — refusing to bulk-edit."
  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_ACTIVE=$(echo "$LOOKUP" | jq -r '.records[0].IsActive')

echo "$REC_LABEL ($REC_ID) — IsActive=$REC_ACTIVE"

# ---------------------------------------------------------------------------
# Uniqueness gate for rename — mirrors the same check create-competency.sh
# already runs on create, so a rename can't silently collide with an
# existing label. Excludes the target record's own Id so no-op renames
# don't self-collide.
# ---------------------------------------------------------------------------
if [[ -n "$NEW_LABEL" && "$NEW_LABEL" != "$REC_LABEL" ]]; then
  LABEL_ENC=$(printf "SELECT Id FROM EnablementCompetencyDef WHERE MasterLabel='%s' AND Id!='%s'" \
    "$(soql_escape "$NEW_LABEL")" "$REC_ID" | jq -sRr @uri)
  DUP=$( (sf api request rest "${TOOLING_BASE}/query/?q=${LABEL_ENC}" --target-org "$ORG_ALIAS" 2>/dev/null || true) \
    | jq -r '.totalSize // 0' 2>/dev/null)
  DUP="${DUP:-0}"
  if [[ "$DUP" != "0" ]]; then
    echo "Another competency already uses label '$NEW_LABEL' — refusing to duplicate."
    echo "   Choose a different label, or edit the existing record instead."
    exit 1
  fi
fi

# ---------------------------------------------------------------------------
# Build PATCH payload
# ---------------------------------------------------------------------------
PAYLOAD='{}'
if [[ -n "$NEW_LABEL" ]]; then
  PAYLOAD=$(echo "$PAYLOAD" | jq --arg v "$NEW_LABEL" '. + {MasterLabel: $v}')
fi
if [[ -n "$NEW_INSTRUCTIONS" ]]; then
  PAYLOAD=$(echo "$PAYLOAD" | jq --arg v "$NEW_INSTRUCTIONS" '. + {EvaluationInstructions: $v}')
fi
if [[ -n "$NEW_DESCRIPTION" ]]; then
  PAYLOAD=$(echo "$PAYLOAD" | jq --arg v "$NEW_DESCRIPTION" '. + {Description: $v}')
fi

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
  # Show the new label if renamed, since the pre-rename $REC_LABEL is now stale.
  if [[ -n "$NEW_LABEL" && "$NEW_LABEL" != "$REC_LABEL" ]]; then
    echo "Renamed '$REC_LABEL' → '$NEW_LABEL'"
  else
    echo "Updated $REC_LABEL"
  fi
  [[ -n "$NEW_INSTRUCTIONS" ]] && echo "   EvaluationInstructions: ${#NEW_INSTRUCTIONS} chars"
  [[ -n "$NEW_DESCRIPTION" ]]  && echo "   Description:            ${#NEW_DESCRIPTION} chars"
  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