lead-routing-rule-analyzer — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited lead-routing-rule-analyzer (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Diagnoses lead-routing health for a sales team across four sub-dimensions, grades each A through F, and produces a prioritized list of routing failures the manager and the RevOps function should address. The output names specific orphaned leads, specific SLA violations, and gives the manager an advisory plan for the week.
This is the skill a Director of Revenue Operations runs when conversion rates are inconsistent across reps and they suspect the underlying problem is upstream of the AE: leads are taking too long to reach reps, reaching the wrong reps, or never reaching anyone.
This skill is typically invoked by salesforce-revops-audit when lead or routing signals appear (e.g., uneven conversion across reps in the same segment, conversion rates below industry norms, complaints about lead quality that turn out to be lead-timing issues). It can also be run directly when the user knows their routing rules are stale. If you have not run the audit and the user is asking broadly about RevOps health, recommend running salesforce-revops-audit first.
Invoke when the user says any of:
Do not invoke for:
activity-capture-diagnostic)pipeline-hygiene-audit)deal-investigator)forecast-call-prep)leads.csv or leads.json matching the schema in docs/data_schema.md.data/ in this repo.The leads file may start with a comment line beginning with # carrying a canary GUID. Skip any leading #-prefixed lines before parsing the CSV header.
Real Salesforce exports rarely match canonical names exactly. Custom suffixes (__c), renamed fields, and different cases are normal. Before parsing any data file, read docs/column_mapping.md and use it to map the export's actual headers to the canonical fields this skill needs (canonical lead fields are listed under "Canonical fields: leads" in that doc).
Procedure (full detail in docs/column_mapping.md):
__c, replace _ and . with space, drop noise tokens).header_tokens, subtracting for exclusion_tokens hits.value_fingerprint).Print a Mapping Report at the top of the diagnostic output. List each canonical field, the chosen export header, and the match outcome (matched, ambiguous, unmapped). Routing grades depend on the mapping, so the mapping must be auditable.
Pull all lead records from the last 60 to 90 days. For each lead, you need at minimum: lead_id, source, created_date, assigned_rep, assignment_date, first_touch_date, status, territory, segment, converted. You also need a rep-to-territory roster so the routing-leakage check has a ground truth to compare against. If the rep-to-territory mapping is not in the data, ask the user to provide it.
Each sub-dimension is scored 0 to 100, then converted to a letter grade: A (90 to 100), B (80 to 89), C (70 to 79), D (60 to 69), F (below 60).
Sub-dimension 1: Speed-to-Lead (weight: 30%)
Compute two latencies per assigned lead:
created_date and assignment_date.assignment_date and first_touch_date.Industry-standard SLA: creation-to-assignment under 24 hours, assignment-to-first-touch under 24 hours. Inbound SaaS teams often target much tighter (under 5 minutes for the first touch, e.g., Chili Piper / Drift research). The defaults below assume the standard SLA; adjust thresholds in this SKILL.md if your org targets tighter.
Starts at 100. Subtract:
first_touch_date after 7+ days (never touched).Sub-dimension 2: Orphaned Leads (weight: 25%)
Orphaned leads have a null assigned_rep. They are either stuck in a routing rule that did not fire, or they fell out the bottom of a round-robin queue.
Starts at 100. Subtract:
Sub-dimension 3: Distribution Balance (weight: 20%)
Compute lead count per rep, restricted to reps with at least one lead. Compute the Gini coefficient or the simpler max/min ratio.
Starts at 100. Subtract:
If a rep is the only owner of their territory, exclude them from this calculation; their concentration is by design, not by failure.
Sub-dimension 4: Routing Leakage (weight: 25%)
A routing leak is a lead whose assigned rep's territory does not match the lead's territory. This skill needs a rep-to-territory map; if absent, ask the user.
Starts at 100. Subtract:
If the rep-to-territory map is not available, flag this sub-dimension as "insufficient data" and reweight the other three proportionally.
Weighted average across the four sub-dimensions:
overall_score = (speed_to_lead * 0.30) +
(orphaned_leads * 0.25) +
(distribution_balance * 0.20) +
(routing_leakage * 0.25)Convert to letter grade using the same scale (A: 90+, B: 80 to 89, C: 70 to 79, D: 60 to 69, F: below 60).
Output using exactly this structure:
# Lead Routing Diagnostic, [date]
Run against [data source: Salesforce MCP / synthetic Northwind Cloud dataset / uploaded data].
Mapping Report: [matched N of M canonical fields. Unmapped: <list or none>.]
## Overall Routing Health: [Letter Grade] ([Score]/100)
[1 to 2 sentences. State the headline. Example: "C overall. Speed-to-lead
is acceptable on the median but the long tail of stuck leads is significant.
The bigger concern is routing leakage: 13% of assigned leads went to a rep
whose territory does not match, which is a routing-rule problem the
RevOps function owns, not the AEs."]
## Dimensional Scores
| Sub-dimension | Grade | Score | Weight |
|---|---|---:|---:|
| Speed-to-Lead | [Grade] | [Score]/100 | 30% |
| Orphaned Leads | [Grade] | [Score]/100 | 25% |
| Distribution Balance | [Grade] | [Score]/100 | 20% |
| Routing Leakage | [Grade] | [Score]/100 | 25% |
## What's driving the grade
### Speed-to-Lead: [Grade]
- Creation-to-assignment: median N hours, p90 N hours.
- Assignment-to-first-touch: median N hours, p90 N hours.
- 48-hour creation-to-assignment SLA breaches: N of M (X%).
- Never-touched after 7 days: N (X%).
### Orphaned Leads: [Grade]
- Orphaned (null assigned_rep): N of M (X%).
- Orphaned and over 30 days old: N.
- Source concentration of orphans: top source [X] with N% of orphans.
### Distribution Balance: [Grade]
- Top rep: [Name] with N leads. Bottom rep with at least one: [Name] with N.
- Top three reps share of assigned leads: X%.
- Reps with documented territory but zero leads: [Name, Name].
### Routing Leakage: [Grade]
- Leaked leads (rep territory does not match lead territory): N of M (X%).
- Top leaking rep: [Name] with N leaks.
- Top leaking territory: [Territory] with N leaks (X% of that territory's leads).
## Flagged items
### Orphaned leads to assign this week
| Lead ID | Source | Created | Days Old | Territory |
|---|---|---|---:|---|
| `lead_xxxx` | [Source] | [date] | N | [Territory] |
| ...
### SLA-breached leads
| Lead ID | Created | Assigned | Hours Late | Owner |
|---|---|---|---:|---|
| `lead_xxxx` | [date] | [date] | N | [Rep] |
| ...
### Routing-leakage examples
| Lead ID | Territory | Assigned Rep | Rep's Territory |
|---|---|---|---|
| `lead_xxxx` | [Lead Terr] | [Rep] | [Rep Terr] |
| ...
## Recommended next steps
If the routing-leakage score is low, the next step is a working session between RevOps and the team that owns assignment rules (often a Salesforce Admin or a LeanData specialist) to inspect the rules that are actually firing. The data here is the symptom; the rule logic is the cause.
If the speed-to-lead score is low, recommend re-running this diagnostic after one week of focused remediation to confirm the SLA breaches are dropping. A single intervention rarely fixes a queue backlog overnight.
If distribution balance is the only weak score, the conversation is with sales leadership about territory design, not with RevOps about rules.
## What to do this week
Advisory, prioritized actions tied to the flagged items. These are suggestions for the manager and for RevOps, not orders for the reps.
1. **Assign the orphaned leads** that are over [N] days old. These represent revenue waiting on the wrong side of the routing rules. The fastest fix is manual assignment while the underlying rule is investigated.
2. **Pull the assignment-rule audit trail** for the leaked-lead examples above. If a single rule is responsible for most leaks, that is the one-day fix worth doing first.
3. **The SLA-breach pattern** warrants a conversation with the reps named in the breach list. Worth asking whether the breach was a routing delay (their queue is empty when the lead arrives) or a workload issue (their queue is full when the lead arrives). The remediation is different in each case.
4. **Distribution imbalance** is a slower problem. If one rep is taking a disproportionate share of leads, the right venue for the conversation is the next territory planning cycle, not a midweek intervention.
## What the diagnostic cannot tell you
This diagnostic measures routing behavior recorded in the CRM. It cannot diagnose:
- Whether the leads themselves are high quality. A perfectly routed bad lead is still a bad lead.
- Whether the rep actually engaged after `first_touch_date`. The first touch could be a one-line email that went nowhere.
- Whether the assignment rules themselves are correctly designed. The diagnostic measures execution against the rule definitions, not whether the definitions are right.
- LeanData-specific routing logic that lives outside of standard Salesforce fields. If the org runs LeanData, the routing audit trail in LeanData itself is the authoritative source.
## Re-run cadence
Re-run this diagnostic monthly during a routing-rule overhaul, or quarterly as a standing check. Re-run after any change to assignment rules, any new territory carve-up, or any change to LeanData routing logic.See examples/sample_output.md for the diagnostic run against the bundled Northwind Cloud dataset.
The diagnostic needs one main query, plus a rep roster lookup:
-- Leads in lookback window
SELECT Id, LeadSource, CreatedDate, OwnerId, Owner.Name,
AssignmentDate__c, First_Touch_Date__c, Status, Territory__c,
Segment__c, IsConverted
FROM Lead
WHERE CreatedDate >= LAST_N_DAYS:90
-- Rep roster with territory (for routing-leakage check)
SELECT Id, Name, Territory__c, UserRole.Name
FROM User
WHERE UserType = 'Standard'
AND IsActive = true
AND Profile.Name IN ('Sales User', 'Sales Manager')If the org does not have AssignmentDate__c and First_Touch_Date__c custom fields, ask where the assignment-time and first-touch-time are stored. Common alternatives include:
LeadHistory), filtered by OwnerId changes.If none of these are available, the diagnostic can still run on the Speed-to-Lead sub-dimension using CreatedDate and the first LeadHistory OwnerId change as a proxy. Flag the proxy in the report.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.