1---2name: lead-scoring3description: >-4 Builds a B2B SaaS lead score from the company's own closed-won and closed-lost deals: a fit score (who the lead is)5 and a behaviour score (what they did before the opportunity), combined into an A to D grade, then tested on the6 most recent deals held out of the build. Recommends the model only when it sorts held-out deals better than7 chance and grade A beats grade D, and stops with NOT ENOUGH DEALS when the history is too thin to test. Use it8 when building or rebuilding lead scoring, when sales ignores the current score, or before routing leads by score.9 Not for pipeline by channel (use pipeline-report) or for sending stages to ad platforms (use crm-feedback-loop).10license: MIT11compatibility: >-12 Works in Claude, ChatGPT, Codex, Cursor and any agent that reads SKILL.md. Reads a connected CRM read-only if the13 agent has one, otherwise a CSV export or pasted rows. Python 3 is optional, for the build and the hold-out test.14metadata:15 author: SHAKEUP16 version: "1.0.0"17 stage: make18 plugin: markops19 homepage: https://www.shakeuphq.com/skills/lead-scoring20---21 22# Lead scoring23 24Builds a fit and behaviour score from the deals a company actually won and lost, and proves it on deals it hasn't seen before recommending it.25 26## Purpose27 28- One job: build one scoring model (fit points, behaviour points, 2 bars, 4 grades), test it on held-out deals, and recommend it or say why not.29- Stage: make. It ends with its own check, at most 2 rounds.30- It never recommends a model that failed the hold-out test, and never builds one from fewer deals than the test needs. Saying no is a valid result.31- It never uses points, bars, weights or win rates from outside the reader's data. It never changes the CRM; it writes the model for people to build.32 33## Use when / not34 35| Situation | Use |36| --- | --- |37| Building or rebuilding lead scoring | this skill |38| Sales ignores the current score | this skill, with the current score as the comparison |39| Before routing leads to sales by score | this skill |40| Pipeline per channel | `pipeline-report` |41| Sending a stage or grade to ad platforms | `crm-feedback-loop`, which can use a READY grade as an early stage |42| Points set by hand in a browser, no history yet | the lead scoring builder tool, labelled untested |43 44## Inputs45 46| Input | Required | Ways to provide, in order | If missing |47| --- | --- | --- | --- |48| Closed deals, won and lost, last 12 to 24 months: outcome, close date, fit attributes as they were when the lead came in, behaviour before the opportunity was created | yes | a connected CRM, read-only; a CSV export of deals with their primary contact and company fields; pasted rows | `BLOCKED`: ask for the export |49| Which columns are fit and which are behaviour | yes | the reader; infer from column names and confirm | ask once |50| When each behaviour field is recorded | no | the reader; CRM property history | leak check by the data only; open item |51| The current score per deal | no | the same export | no comparison; `KEEP CURRENT` can't fire |52| Open leads to grade | no | an export of open leads | the model only |53 54Fit attributes: company size, industry, country, role or seniority, tools used, business model. Behaviour attributes: pricing page visits, demo or trial request, content and tool use, webinar attendance, email replies, product sign-up. Never use what sales records during the deal (demo held, proposal sent, stage).55 56## Profile read57 58From `company-profile.md`: `## Buyers` (ideal customer and bad fit, to name candidate fit attributes and disqualifiers), `### Buying group` (roles, to group titles), `## Company` (Business model: product-led companies have product usage as behaviour), `## Targets` (opportunity to closed-won rate, as a stated value to compare with the measured one), `## Accounts and data` (CRM), and every `## Learnings` entry for `lead-scoring`.59 60No profile: ask for the ideal customer, the bad fit and the CRM, in one message. Say that `company-profile` saves this next time.61 62## Steps63 641. **Apply learnings.** An accepted learning can add a disqualifier, retire a feature or change a default. Name each one used.65 662. **Assemble the deals.** Closed won and closed lost only; open deals are left out. Keep the close date. Name each column fit or behaviour, with the reader. Drop columns filled in only after the opportunity opened.67 683. **Gate on the history.**69 70 | Condition | Result | Why |71 | --- | --- | --- |72 | Fewer than 20 won or fewer than 20 lost deals | Stop: `NOT ENOUGH DEALS` | After holding out 30%, fewer than 14 of each are left to learn from and fewer than 6 of each to test on, so one deal sorted differently moves the test by more than 15 points |73 | The hold-out holds fewer than 5 won or 5 lost | Stop: `NOT ENOUGH DEALS` | One deal would move the test by 20 points |74 75 At `NOT ENOUGH DEALS`, give the reader what is honest: the deals needed, the months until there are enough at the measured close pace (deals closed per month in the export), and a plain fit filter from `## Buyers` (must-haves and disqualifiers, no points), labelled untested.76 774. **Split by time.** Hold out the latest 30% of deals by close date. The model will score future leads, so it is tested on deals later than those it learned from. Without close dates, say the split is by row order, not time.78 795. **Build and test** with the script:80 81 ```82 python3 scripts/score_model.py --csv deals.csv --outcome stage --close-date close_date \83 --fit "employees,industry,seniority" --behaviour "pricing_visits,demo_request,webinar" --current hubspot_score84 ```85 86 Without Python, follow `references/model-method.md` in a spreadsheet: features, points from the training deals only, bars, grades, then the hold-out test. Say which way you ran it.87 88 The rules the build applies:89 90 | Rule | Default | Why |91 | --- | --- | --- |92 | Points per feature | 10 x ln(share of won with it / share of lost with it), 0.5 added to each count | Positive when it is more common in won deals; the 0.5 keeps a 0 count from dividing by 0 |93 | Cap | 30 points either way | No single feature decides a grade |94 | Support | 5 deals with the feature (8 in round 2) | With fewer, one deal swings its points by 10 or more |95 | No signal | Under 2 points either way: dropped | It doesn't separate won from lost |96 | Possible leak | In 90% or more of won and 10% or less of lost: held back | Fields that clean are usually filled in by sales during the deal |97 | Numbers | 1 split at the training median | One split per number keeps the model explainable to sales |98 | Bars | The training score that best separates won from lost | Set from the data, not chosen by hand |99 1006. **Read the test.** On the hold-out deals:101 102 | Test | Passes when | Why |103 | --- | --- | --- |104 | Concordance | Above 0.5 by more than 2 standard errors for the hold-out's size | 0.5 is a coin toss; the margin keeps a lucky small sample from passing |105 | Grade order | Grade A wins more often than grade D | The grades must mean something to sales |106 | Against the current score | The new model's concordance is above the current score's | Otherwise there's no evidence the change helps |107 1087. **Write the model for the CRM.** A table: criterion, fit or behaviour, points, won and lost deals with it. The 2 bars. The grade actions: A to sales now, B to nurture, C a qualifying question before sales calls, D no sales time. Each grade's hold-out win rate with its counts.109 1108. **Plan the rollout.** Run it in shadow for 30 days first: score new leads without routing on the score, and compare with what sales decided (this finds criteria that are empty when a lead arrives). Review against new closed deals every quarter.111 112## Check and verdict113 114Checks on the model:115 116| ID | Passes when |117| --- | --- |118| M1 | The gate passed |119| M2 | The hold-out is by close date, or the output says it isn't |120| M3 | No feature is recorded after the lead was scored: leak check run, and behaviour fields confirmed by the reader or labelled unconfirmed |121| M4 | Every feature has the minimum support |122| M5 | Hold-out concordance beats 0.5 by more than 2 standard errors |123| M6 | Grade A's hold-out win rate is above grade D's |124| M7 | Points and bars come from the training deals only |125 126| Verdict | Condition (first match wins) |127| --- | --- |128| `BLOCKED` | No closed deals with an outcome, or no attribute columns |129| `NOT ENOUGH DEALS` | The gate failed |130| `FAILS HOLD-OUT` | M5 or M6 still fails after round 2 |131| `KEEP CURRENT` | The new model passes, but the current score's hold-out concordance is at least as high |132| `READY` | M1 to M7 pass, and the model beats the current score or there is none |133 134Named stops: `BLOCKED` asks for the export. `NOT ENOUGH DEALS` and `FAILS HOLD-OUT` stop before any model is recommended; they show what was tried and what would change the result. No other stops.135 136## Loop137 1381. Round 1: build with the defaults, run M1 to M7.1392. If M5 or M6 fails, round 2: raise support to 8, drop features whose points change sign between the older and newer half of the training deals, rebuild and test again. The script does this on its own.1403. Stop after round 2. Never tune on the hold-out deals (testing many versions against the same hold-out until one passes is just luck). If round 2 fails, the verdict is `FAILS HOLD-OUT`.141 142## Learn143 144- The reader confirms a behaviour field is filled before the opportunity: write a `fact`, so later runs don't hold it back.145- The reader adds a disqualifier ("students", "competitors"): write a `proposal`.146- After the shadow period or a quarter, the grades' real win rates on new deals: write a `fact` with the counts, and propose a rebuild when grade A no longer beats grade D.147 148Example: `- 2026-10-24 | lead-scoring | fact | "pricing_visits" is set by the website tag before any opportunity exists | Why: reader confirmed from the CRM property history | Status: noted`149 150## Output151 152```153Verdict: <READY | KEEP CURRENT | FAILS HOLD-OUT | NOT ENOUGH DEALS | BLOCKED> · Coverage: <complete | partial (what's missing)> · Build: <script | by hand> · Round used: <1 | 2>154Deals: <won> won, <lost> lost · Split: <by close date | by row order> · Training <n> · Hold-out <n> (<won> won, <lost> lost)155 156Model:157| Criterion | Type | Points | Won with | Lost with |158Held back: <feature: why>159Bars: fit <n>, behaviour <n>160 161Hold-out test: concordance <c> (standard error <se>, needs above <0.5 + 2 se>) · fit only <c> · behaviour only <c> · current score <c or not available>162| Grade | Hold-out deals | Won | Win rate | Action |163 164Rollout: shadow for 30 days, then route; review quarterly165Learnings applied: <list, or none>166```167 168At `NOT ENOUGH DEALS`: the counts, the deals still needed, the months until enough at the measured pace, and the untested fit filter. Then the handoff block.169 170## Hand off171 172```handoff173skill: lead-scoring174version: 1.0.0175verdict: READY176coverage: complete177for: <company> inbound leads178outputs:179 grades_holdout: {A: 0.58, B: 0.31, C: 0.22, D: 0.07}180 concordance: 0.74181 fit_bar: 18182 behaviour_bar: 11183 criteria: 9184next: [crm-feedback-loop]185open: [confirm webinar attendance is recorded before the opportunity]186```187 188`crm-feedback-loop` can offer grade A as a predicted stage when a platform's window is shorter than the sales cycle, valued by `grades_holdout.A`.189 190## Failure modes191 192| Problem | Do this |193| --- | --- |194| Lost deals aren't marked lost (they stay open forever) | Ask for the reader's rule for a dead deal (no activity for a set period) and apply it, labelled; without it, the lost count is what it is |195| Fit fields are filled by enrichment after the deal | Use only fields with a value at lead creation; ask how enrichment runs |196| One segment dominates the deals (one country, one size) | Say the model holds for that segment only |197| The reader wants points from "best practice" | Decline; offer the lead scoring builder tool for a hand-set model, labelled untested |198| A feature with strong points makes no business sense | Show it, ask the reader, and hold it back if they can't explain it |199| Product-led company with usage data | Treat product usage before the sales touch as behaviour; same rules |200 201## Influenced by202 203- MadKudu's customer fit, likelihood to buy and lead grade models, which keep who the lead is apart from what they do and combine the 2 into a grade (MadKudu's help center now lives with HG Insights): https://help.hginsights.com/what-are-the-different-models204- SHAKEUP's lead scoring builder: fit and intent kept apart, disqualifiers with negative points, and bars agreed with sales.