Skip to main content
ClaudeWave
Skill435 repo starsupdated 7mo ago

lead-routing

Intelligent lead assignment and routing - AI-powered scoring, territory mapping, round-robin distribution, and workload balancing

Install in Claude Code
Copy
git clone --depth 1 https://github.com/claude-office-skills/skills /tmp/lead-routing && cp -r /tmp/lead-routing/lead-routing ~/.claude/skills/lead-routing
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# Lead Routing

Intelligent lead assignment and routing system with AI-powered scoring, territory mapping, round-robin distribution, and workload balancing. Based on n8n's HubSpot/Salesforce automation templates.

## Overview

This skill covers:
- Lead scoring and qualification
- Territory-based routing
- Round-robin distribution
- Workload balancing
- SLA monitoring and escalation

---

## Routing Strategies

### 1. Rule-Based Routing

```yaml
routing_rules:
  # By Company Size
  - name: "Enterprise Routing"
    condition:
      company_size: ">= 500"
      OR:
        annual_revenue: ">= $10M"
    assign_to: "Enterprise Team"
    priority: high
    sla: 1_hour
    
  - name: "Mid-Market Routing"
    condition:
      company_size: "100-499"
    assign_to: "Mid-Market Team"
    priority: medium
    sla: 4_hours
    
  - name: "SMB Routing"
    condition:
      company_size: "< 100"
    assign_to: "SMB Team"
    priority: standard
    sla: 24_hours

  # By Geography
  - name: "APAC Routing"
    condition:
      country: ["China", "Japan", "Singapore", "Australia"]
    assign_to: "APAC Team"
    timezone_aware: true
    
  - name: "EMEA Routing"
    condition:
      country: ["UK", "Germany", "France", "Netherlands"]
    assign_to: "EMEA Team"
    
  - name: "Americas Routing"
    condition:
      country: ["US", "Canada", "Brazil", "Mexico"]
    assign_to: "Americas Team"

  # By Industry
  - name: "Healthcare Specialist"
    condition:
      industry: ["Healthcare", "Pharmaceuticals", "Medical Devices"]
    assign_to: "Healthcare Sales"
    
  - name: "Finance Specialist"
    condition:
      industry: ["Banking", "Insurance", "FinTech"]
    assign_to: "Financial Services Sales"
```

---

### 2. Round-Robin Distribution

```yaml
round_robin_config:
  team: "SMB Sales"
  members:
    - name: Alice
      capacity: 100%
      max_leads_per_day: 20
      
    - name: Bob
      capacity: 100%
      max_leads_per_day: 20
      
    - name: Carol
      capacity: 50%  # Part-time
      max_leads_per_day: 10
      
  rules:
    distribution: weighted  # or equal
    skip_if:
      - out_of_office: true
      - at_capacity: true
    reset: daily
    
  tracking:
    log_assignments: true
    balance_check: hourly
```

**Distribution Algorithm**:
```
┌─────────────────────────────────────────────────────────────┐
│                   ROUND-ROBIN LOGIC                         │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│  1. New lead arrives                                        │
│                    │                                        │
│                    ▼                                        │
│  2. Check team availability                                 │
│     - Filter out: OOO, at capacity, off-hours              │
│                    │                                        │
│                    ▼                                        │
│  3. Calculate weighted position                             │
│     - Current assignments today                             │
│     - Capacity percentage                                   │
│     - Last assignment time                                  │
│                    │                                        │
│                    ▼                                        │
│  4. Assign to rep with lowest weighted score               │
│                    │                                        │
│                    ▼                                        │
│  5. Update tracking, notify rep                            │
│                                                             │
└─────────────────────────────────────────────────────────────┘
```

---

### 3. AI-Powered Lead Scoring

```yaml
ai_scoring:
  provider: openai
  model: gpt-4
  
  input_factors:
    demographic:
      - company_size
      - industry
      - job_title
      - location
      
    firmographic:
      - annual_revenue
      - employee_count
      - funding_stage
      - tech_stack
      
    behavioral:
      - pages_visited
      - content_downloads
      - email_engagement
      - demo_requests
      
    fit_score:
      - icp_match_percentage
      - competitor_usage
      - budget_authority
      
  scoring_prompt: |
    Score this lead from 0-100 based on:
    
    Our ICP (Ideal Customer Profile):
    - B2B SaaS companies
    - 50-500 employees
    - Series A or later
    - Using {competitor} or {similar_tool}
    
    Lead Data:
    {lead_data}
    
    Return JSON:
    {
      "score": 0-100,
      "fit_score": 0-100,
      "intent_score": 0-100,
      "tier": "A/B/C/D",
      "reasoning": "...",
      "recommended_action": "...",
      "routing_suggestion": "..."
    }

  tier_thresholds:
    A: 80-100  # Hot lead, immediate follow-up
    B: 60-79   # Qualified, standard follow-up
    C: 40-59   # Nurture, marketing sequence
    D: 0-39    # Low priority, long-term nurture
```

---

### 4. Territory Mapping

```yaml
territory_map:
  north_america:
    west:
      states: [CA, WA, OR, NV, AZ, CO, UT]
      owner: "West Coast Team"
      reps: [Alice, Bob]
      
    central:
      states: [TX, IL, OH, MI, MN, WI]
      owner: "Central Team"
      reps: [Carol, David]
      
    east:
      states: [NY, MA, PA, FL, GA, NC]
      owner: "East Coast Team"
      reps: [Eve, Frank]
      
  international:
    emea:
      countries: [UK, DE, FR, NL, ES, IT]
      owner: "EMEA Team"
      timezone: "Europe/London"
      
    apac:
      countries: [JP, SG, AU, KR, IN]
      owner: "APAC Team"
      timezone: "Asia/Tokyo"

  overlap_resolution:
    # When lead matches multiple territories
    priority_order:
      1: named_account_owner  # If account already has owner
      2: industry_specialist  # If industry requires specialist
      3: geography           # Default to geography
```

---

### 5. Workload Balancing

```yaml
workload_balancer:
  check_frequency: hourly