# /sales-call-score

> Score a recorded a teammate sales call against the Paradox SOP v3 and post Charlie-Morgan-voiced feedback (with metrics) to the #your-channel Slack channel.


# /sales-call-score

Scores one of a teammate Curt's recorded sales calls against **SOP v3** and produces **Charlie Morgan-voiced** coaching feedback plus structured metrics, posted to Slack.

## When to trigger
- User pastes a Fathom recording id and asks to score/grade it.
- User says "ocijeni ovaj poziv", "score this call", "kako je prošao poziv X".
- Testing/iterating the auto-scoring system (format, rubric, model).

## What it does
1. Fetches the diarized transcript from a teammate's Fathom account (`FATHOM_ADI_API_KEY`, `X-Api-Key` auth).
2. Computes deterministic metrics: talk-ratio (rep %), duration, discovery-question proxy.
3. One Claude call **via the Max subscription** (`runClaudeSubprocess` → OAuth, NOT the Anthropic API key, which it scrubs), default **Opus 4.8**, JSON-only output (+1 retry) returns: overall adherence %, 12-section scores, closing-discipline flags (frame / pain / silence-after-price / incentive / binary / deposit), weakest sections, what-went-well, biggest leak, **Charlie feedback**, and the one fix for next call.
4. Formats a clean Slack message (no emojis, bold headers) and posts to `#your-channel` (`C0B7XN78W1Y`) when `--post` is passed.

## Usage
```
node ACME Agency/sales-audit/score_call.mjs <recording_id>            # print only
node ACME Agency/sales-audit/score_call.mjs <recording_id> --post     # + post to channel
```

## How it runs in production
`ACME Agency/sales-audit/poll_score.mjs` runs every 10 min on your server cron (`shared/your server_setup/install_scoring_cron.sh`). It polls a teammate's Fathom account for newly-finished sales calls (recording done, ≥5 min, has an external/prospect invitee), scores each via `score_call.mjs`, and posts to the channel. First run **seeds** (marks existing calls seen, scores nothing) so the channel is never backfill-spammed. State: `ACME Agency/sales-audit/data/scoring_state.json` (gitignored).

## Files
- `ACME Agency/sales-audit/score_call.mjs` — engine (fetch + metrics + Anthropic scoring + Slack format)
- `ACME Agency/sales-audit/poll_score.mjs` — cron driver (poll + seed + score new)
- `ACME Agency/sales-audit/rubric/sop_v3.md` — the committed rubric the scorer reads
- `shared/your server_setup/install_scoring_cron.sh` — cron installer

## Notes
- Rubric is committed under `rubric/` because `sales-audit/data` + `analysis` are gitignored (PII). Update the rubric there when SOP changes.
- Model: `SCORING_MODEL` env (default `claude-opus-4-8`). Runs on the **Claude Max subscription** (no API billing) via `runClaudeSubprocess`, which now accepts a `model` option.
- Sensitive: this is per-rep performance feedback. The channel should stay restricted.
