# Closed-won pattern mining

A reusable skill the "Know who actually signs before you call" recipe pulls in. Add it once and every agent on the team can use it.

Extract the buying-committee roles that recur across past closed-won deals in the CRM.

## Method
1. Pull the last N closed-won deals from the CRM (N is the lookback window).
2. For each deal, list every contact who touched it and the role they played: economic buyer, champion, technical evaluator, legal, etc.
3. Match each contact's role against the org's stored role definitions in memory.
4. Count how often each role appears across the pulled deals to find the recurring pattern.
5. Write the resulting pattern — which roles show up in most wins — back to memory as the standing buying-committee pattern.
6. Refresh the pattern each time new deals close, rather than mining from scratch every run.

## Rules
- The lookback window (number of deals to mine) is set on first run, then stored in memory.
- The org's buying-committee role definitions are set on first run, then stored in memory — ask before guessing a role.
- A role with no match in the CRM data stays out of the pattern; do not invent a role to fill a gap.

## Output
A standing "buying-committee pattern" note in memory: role name, how many closed-won deals included it, refreshed after each new close.
