Terminal
Terminal/Skill
Scores enriched inbound leads A to D using weights you approve, with a quoted evidence trail and a validity gate that blocks dead contacts.
By Clay
Works with
npx skills add clay-run/clay-skill-creator --skill score-inbound-leadsThe insight: a score nobody can explain is a score nobody trusts — and a score on a contact who isn't reachable is worse than no score, because it spends a rep's morning on a ghost. The naive version multiplies magic constants into a number; a rep sees "72", disagrees once, and the model is dead. Scoring here is four commitments: every point traces to a quoted field value (evidence or it didn't happen); missing data scores as UNKNOWN with a stated policy — never a silent zero, because "we couldn't see their headcount" and "they're the wrong size" must never look the same; weights are a config the user approves, not numbers you invented; and validity gates the score — a tier is surfaced only for a contact who is demonstrably reachable and current. Scoring is deterministic arithmetic — code, never an LLM (an LLM adds variance to math a formula does for free), and the same input must produce the same tiers on every re-run.
Nothing here ships with a value. Each one is the installer's, not the author's: ask for it, never substitute a plausible default, and where an answer does not exist say which step becomes unavailable rather than guessing. Where a default IS defensible it is named below, and using it means saying so in the output.
| Input | What the installer supplies | If it is missing |
|---|---|---|
| The enriched leads | per lead: email and its type, person fields, company fields, any intent signals, and where the pipeline produced them, validity fields | rows that are just raw emails are not scoreable — say so and point at enrichment rather than scoring them anyway |
| The ICP | target industries, headcount range, geographies, buyer titles | stop rather than defaulting. Fit against an undefined ICP is fiction |
| Disqualifiers | competitor domains, blocked geographies, disposable-email domains | ask. An empty list is a real answer on a first run |
| An account score column | if one already exists | its presence changes the score shape, so ask rather than detect |
| Weights and thresholds | the config | proposed for explicit sign-off, never assumed. These are the installer's judgment about their own market |
If an answer sheet is present beside this skill, load it and ask only for what it does not cover. A partial sheet is normal; a value it is missing gets asked for on its own rather than restarting the interview. Say which values came from the sheet before using them — a sheet applied silently is a wrong field nobody catches. If there is no sheet, say nothing about sheets — the check is a file lookup, not a question, so run the interview as though the feature did not exist rather than reporting an absence. At delivery, offer to save the answers back (identifiers only — never a token or a password), private and never published — and phrase the offer so it explains itself: "want me to save your answers to a file, so the next person on your team doesn't have to answer these again?"
Run clay whoami; echo "exit_code=$?". If it fails or Clay tools are missing, run the
Clay plugin's setup skill and re-run. Say which workspace you're in. Scoring itself
costs zero credits and needs no Clay calls — Clay matters only if inputs are missing
(route to enrich-signup-users) or the model graduates to a table (see Output). Don't
hunt for a managed scoring function: there isn't one; scoring is formula/code territory.
Batch economics (rows not yet enriched): the cheap move is to score FIRST on whatever raw fields exist and enrich only rows above a floor — never enrich a whole list and then discover 60% was junk. This skill's pass over partial rows (heavy UNKNOWNs, many UNSCORED) works as that pre-score, but the full pre-enrichment gate — triage → enrich survivors → rescore — is its own pipeline; route it to a dedicated skill rather than looping enrichment in here.
Present a table the user edits: each component, its weight, what earns points, and the UNKNOWN policy. A sane default (rescale to taste):
| Component | Weight | Scores on | If missing |
|---|---|---|---|
| Industry fit | 20 | company industry ∈ ICP list | UNKNOWN |
| Headcount fit | 20 | band overlaps ICP range | UNKNOWN |
| Geography fit | 10 | country ∈ ICP geos | UNKNOWN |
| Persona fit | 25 | title matches buyer keywords (seniority AND function) | UNKNOWN |
| Email type | 10 | work email = full; personal = 0 (known, not UNKNOWN) | — |
| Intent signal | 15 | stated signal present (funding, usage, source) | 0 (absence is data) |
Two UNKNOWN policies — the user picks one, in writing:
score = Σ(wᵢ·sᵢ) / Σ(wᵢ observed) × 100. One line, deterministic, no AI "redistributing weights".Guard either way: below half the total weight observed, the lead is UNSCORED (insufficient data) — a fraction computed from two fields dressed as a percentage is fabrication. Tier thresholds (0–100 score): A ≥ 75, B ≥ 50, C ≥ 25, else D — the user's to move.
Two score shapes — pick by what the caller already has:
account_fit × contact_fit × validity: when an account score
already exists (an account-scoring build, a CRM field), pull it in by lookup and
use it as a factor — never recompute account fit per contact: recomputing drifts
(two contacts at one account scoring its fit differently is a credibility bug) and
double-spends. Contact_fit is then persona + email type + intent only (account
components drop out of the weights; renormalize), composed score =
account_fit × contact_fit / 100, and validity is the Step 4 gate, not a
multiplier. A row whose account-score cell is EMPTY is UNSCORED (the dominant
factor is unobserved — never silently fall back to flat scoring mid-batch). Same
evidence rules: the account factor's evidence line quotes the looked-up score and
its source column.parseInt the string and pray (that yields 1). An unparseable
value is UNKNOWN, never a guess. An integer, if one appears, still gets Number()
coercion: CSV numbers are often strings, and "30" + "20" is "3020".valid (email verified
deliverable AND, where employment fields exist, employment current) · invalid
(email verdict invalid/undeliverable, OR employment fields show the person departed
— e.g. a former-employee relationship, or an employment-end date in the past) ·
unverified (the fields simply aren't in the input). Map each validator's
vocabulary explicitly — verdict semantics differ per validator, and catch-all hides
inside "valid" on some; when in doubt, treat catch-all as unverified, not valid.Disqualifiers are a gate, not a component. A lead at a competitor domain with a perfect fit profile is tier DQ, full stop — a disqualifier beaten by a good score is a policy violation, not a nuance. Check junk/disposable email, competitor domain, blocked geo before computing anything. Record the tripped rule as the evidence. DQ runs FIRST: it is a definitive verdict, so it beats both the validity lane and the coverage guard (a competitor contact with a dead email is DQ, not re-verify).
Validity gates the score — the departed-contact trap. A high score on a contact whose email bounces or who left the company last quarter is the worst output this skill can produce: it looks hottest exactly when it's most wrong. Per the normalized validity vocabulary:
invalid → lane RE-VERIFY (re-verify the email / re-source a current contact
at the same account), NEVER a scored tier — not even D. Compute account-fit
components internally and record them as refresh_priority evidence so the
re-sourcing queue works best-accounts-first, but the row surfaces in the RE-VERIFY
lane, not the ranking. Re-verifying and re-sourcing are other skills'
jobs (verify-email-deliverability, people search) — this skill only routes.unverified → the row scores and tiers normally but carries a visible
validity: unverified flag, and the summary reports validity coverage. Gating on
absent evidence would conflate unknown with bad — the same principle as the
UNKNOWN policy — but the flag must survive into the output so nobody reads an
unverified A as a verified one.valid → clean; the evidence line quotes the verification verdict and the
employment field that proved currency.Validity runs BEFORE the coverage guard: an invalid contact routes to RE-VERIFY even when coverage is too thin to score — RE-VERIFY is a definitive next action, UNSCORED is a shrug.
Then, per surviving lead, record a triple per component: points · weight · the quoted field value that earned them ("headcount '1,001-5,000 employees' overlaps ICP 50–5,000 → 20/20"). The evidence column is the deliverable — the score is just its sum.
Identity-miss ≠ account-miss (the trap that throws away pipeline): a work-email
lead whose person never resolved still has a real company — score the account
components, mark persona fit UNKNOWN, flag identity: unresolved, and cap the tier
at B: a rep needs to know who they're calling before it's an A. A personal-email
lead with nothing resolved has no account either — UNSCORED or D, honestly.
Apply thresholds. Then re-run the entire scoring pass and diff: every score and tier must be byte-identical. Any drift means something non-deterministic leaked in (an LLM call, an unstable sort, a timestamp) — find and remove it. Sort output by score descending with a stable tiebreak (email asc) so ranks don't shuffle.
Per lead: email · tier (A/B/C/D/DQ/RE-VERIFY/UNSCORED) · score (0–100) · per-component breakdown (points/weight + quoted evidence) · unknowns · validity (valid/invalid/unverified + the quoted verdict) · flags (identity: unresolved, validity: unverified, tier-capped) · DQ reason / re-verify reason (+ refresh_priority). Plus a summary: config used + score shape, tier distribution,
UNKNOWN rates per component, validity coverage, determinism check result. At
recurring volume, graduate the approved config to Clay table formula columns —
weights in named weight columns so the user can tune them (Clay's free "Score Row in
Clay" action, outputting score + scoreReasons, is the same spirit).
Ask: "Score these 12 enriched trial leads. ICP: B2B SaaS, 50–5,000 employees, NA/EU,
buyer = VP+ marketing." Config approved: default weights, neutral UNKNOWNs, flat
shape (no account score exists). vp.growth@brightloop.example: email verified valid,
employment current → gate passes; industry "B2B software" 20/20 · band "201-500
employees" overlaps → 20/20 · US 10/10 · "VP Growth Marketing" 25/25 · work email
10/10 · no signal 0/15 → 85 → A, every line quoting its field.
cto@meridianops.example: perfect 90-point fit, but email verdict invalid →
RE-VERIFY ("email undeliverable; refresh_priority: account fit 50/50"), not A.
vp.eng@stellarbase.example: fit 85, but employment fields show she left in March →
RE-VERIFY (departed contact), not A. ops@meridiansoft.example: no validity fields →
scores normally, validity: unverified flag; person unresolved + headcount missing
→ both UNKNOWN, renormalized 64 → B (identity-capped anyway). founder.zx4q19@gmail.com,
nothing resolved: observed weight 25/100 → UNSCORED. cmo@competitor-corp.example:
fit would be 90, email also dead → DQ (competitor domain) — DQ beats the lane.
Summary: 12 in → 2 A, 3 B, 2 C, 1 D, 1 DQ, 2 RE-VERIFY, 1 UNSCORED; validity
coverage 10/12; re-run identical.