# Lead Qualification Scoring

Score a batch of prospects against ideal-customer-profile (ICP) criteria using extracted signals, then output a ranked, qualified shortlist.

## When to use

- A raw prospect list needs to be triaged before outreach begins.
- Sales or GTM (go-to-market) asks for a ranked shortlist against defined ICP criteria.
- New firmographic or behavioral signals arrive and existing scores need refreshing.
- A campaign is capped at N contacts and you must pick the best-fit subset.

## Tools

- `browser-navigate` — open each prospect's company site, pricing page, or LinkedIn profile to gather signal sources.
- `browser-extract` — pull firmographic and behavioral signals (headcount, industry, tech stack, job titles, recent posts) from the pages opened.
- `shell-execute` — run a small script to normalize extracted signals, apply the ICP scoring weights, and rank the list.
- `write-file` — save the scored, ranked shortlist as the delivered artifact.

## Playbook

1. Confirm the ICP criteria (firmographic, technographic, behavioral) and the scoring weights to apply; if undefined, stop and ask via `send-message`.
2. Load the raw prospect list you were given (from a prior task artifact or inline data).
3. For each prospect, `browser-navigate` to their company site and any public profile pages needed for signal extraction.
4. Use `browser-extract` on each page to capture the specific ICP signals (company size, industry, stack, title, intent signals).
5. Use `shell-execute` to run a scoring script: normalize the extracted fields, apply weighted scoring per the ICP criteria, and sort descending by score.
6. Use `shell-execute` again if needed to dedupe prospects appearing more than once in the source list before final ranking.
7. Filter out prospects below the minimum qualification threshold, keeping only qualified, ranked entries.
8. `write-file` the final ranked, qualified list (with scores and key signals per prospect) to a clearly named output file.
9. Summarize the count of qualified prospects and top scores when you `complete-task`.

## Failure modes

- 401/403 on any page load or embedded API call -> missing Integration; stop and message a human via `send-message` naming the service and required scopes.
- Empty extraction result from `browser-extract` -> verify the page loaded correctly and the target elements/selectors still exist before retrying.
- Rate limited while navigating multiple prospect pages -> back off, slow the pace, and note the limit in memory via `update-memory`.
- Target page layout changed and expected fields are missing -> fall back to `browser-search` to relocate the needed information.

## Done when

- A ranked, qualified prospect list has been written via `write-file`, including each prospect's score and the signals driving it.
- Every prospect below the qualification threshold has been excluded from the final list.
- The task is closed via `complete-task` with a summary of qualified count and top-ranked prospects.