# Sales Playbook System - Gap Analysis & Implementation Plan

> Complete analysis of what exists vs what's needed to fully support the 0.1% Sales Playbook

**Generated:** Jan 19, 2026
**Updated:** Jan 19, 2026
**Status:** Investigation Complete

---

## The 5 Wins Per Call

Every conversation has up to 5 wins:

| Win | Bonus | System Support |
|-----|-------|----------------|
| Worker signs up | $1 | ✅ Stage tracking |
| Worker profile complete | +$1 | ✅ Stage tracking |
| Worker Stripe connected | +$1 | ✅ Stage tracking |
| Worker gives contractor details | - | ✅ Contractor extraction |
| Worker refers other workers | - | ✅ WorkerReferralCapture |

Same flywheel for contractors (signs up, refers other contractors).

---

## Executive Summary

**The system is 95% ready.** Only sequence automation remains.

| Category | Status | Gap |
|----------|--------|-----|
| Lead Stages | ✅ 95% | Minor UI polish |
| Lead Extraction | ✅ 100% | Complete - WorkerReferralCapture built |
| Business Intel | ✅ 100% | Complete - BusinessIntelCard built |
| Objection Tracking | ✅ 95% | Complete |
| Today's Plays | ✅ 90% | Working |
| Attempt Sequences | ⚠️ 30% | Schema exists, automation missing |
| Contractor Codes | ✅ 100% | Built on rateright.com.au |
| ~~Founder Queue~~ | ✅ N/A | Not needed (2 reps + founder) |

**Total Implementation Time: 15-20 hours** (only sequence automation remaining)

---

## What Already Exists

### 1. Lead Stages System ✅

**Worker Funnel (8 stages):**
```
not_signed_up → signed_up → profile_complete → stripe_ready →
job_ready → applied → working → proven
```

**Contractor Funnel (6 stages):**
```
not_signed_up → signed_up → profile_complete → job_posted → hired → active
```

**Features working:**
- Stage auto-calculation from platform data
- Stage transition logging (audit trail)
- Stuck lead detection (7+ days threshold)
- AI-powered diagnosis (forgot, avoiding, confused, blocked)
- Health scoring (0-100)
- Platform sync every 15 minutes
- Funnel visualization UI

**Files:**
- `src/services/stageCalculator.js`
- `src/services/stageDiagnosis.js`
- `src/routes/activation.js`
- `admin/src/components/ActivationFunnel.jsx`

---

### 2. Lead Extraction & Referrals ✅

**What works:**
- `referred_by_lead_id` - Links worker → contractor referral
- `referral_context` - Stores intro context
- `is_hot_referral` - Flag for priority leads
- Contractor extraction via AI voice command ("he works for ABC Construction")
- Perplexity search for decision maker contact info
- Auto-creates contractor lead with score 70+
- Slack alerts for new referrals
- Hot referral badge in Call List UI

**Files:**
- `supabase/contractor-referral-migration.sql`
- `src/routes/ai.js` (lines 1695-1820)
- `src/routes/webhooks.js` (lines 165-223)
- `admin/src/pages/CallList.jsx` (lines 250-299)

---

### 3. Business Intelligence Capture ✅

**Stored in `lead_intel.business_intel` JSONB:**
```json
{
  "current_employer": {"company_name": "...", "role": "...", "how_long": "..."},
  "pain_points": [{"issue": "...", "detail": "..."}],
  "competitors_mentioned": ["WorkPac", "Hays"],
  "hiring_needs": {"looking_for": [...], "urgency": "...", "quantity": "..."},
  "budget_signals": {"hourly_rate_mentioned": "...", "willing_to_pay": "..."},
  "decision_timeline": "Needs to decide by Friday",
  "current_projects": [{"project": "...", "detail": "..."}]
}
```

**Extraction happens:**
- After calls via `extractPersonalIntelFromConversations()`
- Sources: Last 50 SMS, Last 20 notes, Last 10 call transcripts
- Uses GPT-4o-mini for extraction

**Files:**
- `src/services/ai.js` (lines 1217-1479)
- `supabase/migrations/20260117095000_add_business_intel_column.sql`

---

### 4. Objection Tracking & Learning ✅

**Complete system:**
- `objections` table - Objection catalog by category
- `objection_responses` table - Tracks effectiveness (times_shown, times_helpful, led_to_conversion)
- `suggestion_feedback` table - Thumbs up/down on copilot suggestions
- `conversion_patterns` table - Captures full journey when lead converts

**Learning loop:**
1. AI suggests objection response during call
2. User gives thumbs up/down → updates effectiveness_score
3. When lead converts → responses used get conversion credit
4. AI retrieves proven responses (effectiveness > 0.3) for future suggestions

**Files:**
- `src/services/learning.js`
- `src/routes/calls.js`
- `admin/src/pages/Objections.jsx`

---

### 5. Today's Plays ✅

**Working features:**
- Top 3 leads with AI-generated messages
- 3 message angles per lead (follow_up, value_prop, urgency)
- One-tap send
- Bulk personalized outreach (max 20)
- 4-hour cache

**Files:**
- `src/routes/playbook.js`
- `admin/src/components/playbook/TodaysPlays.jsx`

---

### 6. Callbacks & Scheduled SMS ✅

**Working:**
- Callback scheduling with priority
- Scheduled SMS (processes every 60 seconds)
- Callback priority boosts call list ranking (250-320 points for overdue)

**Files:**
- `src/jobs/scheduledSms.js`
- `src/routes/calls.js`
- `src/services/callListRanker.js`

---

## What's Missing (Critical Gaps)

### ~~GAP 1: Contractor Referral Code System~~ ✅ ALREADY BUILT

**The playbook says:**
> "Contractors get a referral code. Workers who use it pay 5.9% instead of 9.9%."

**Current state:** ✅ Built on rateright.com.au (main platform)

The code system is handled by the main RateRight platform, not the Growth Engine CRM. Sales reps can reference this when talking to contractors.

**Estimate:** 0 hours (already exists)

---

### GAP 2: Multi-Step Sequence Automation ❌

**The playbook says:**
| Attempt | Day | Channel | Action |
|---------|-----|---------|--------|
| 1 | 0 | Call | Intro call |
| 2 | 0 | SMS | If no answer |
| 3 | 1 | Call | Follow-up |
| 4 | 3 | SMS | Value prop |
| 5 | 7 | SMS | Last chance |

**Current state:** Schema exists, not wired up

**What's needed:**
1. Sequence engine that triggers next step based on:
   - Days since last contact
   - Response received (yes/no)
   - Stage changes
2. Smart queue: "Today's sequence actions"
3. Auto-skip if lead replied
4. Analytics: Sequence completion rates

**Existing schema:**
- `sequences`, `sequence_steps`, `sequence_enrollments` tables

**Files to create/modify:**
- `src/jobs/sequenceProcessor.js`
- `src/services/sequenceEngine.js`
- `admin/src/components/SequenceQueue.jsx`

**Estimate:** 15-20 hours

---

### GAP 3: Worker Referral Capture UI ✅ COMPLETE

**The playbook says:**
> "Know any other tradies looking for work?"

**Built:**
- `admin/src/components/WorkerReferralCapture.jsx` - Quick capture modal
- Added to `CallOutcomeSheet.jsx` - Shows for worker leads or positive outcomes
- Auto-sets `referred_by_lead_id`, `source: 'worker_referral'`, `score: 70`
- Supports multiple referrals (up to 5), trade selection
- Creates hot leads with `is_hot_referral: true`

**Completed:** 2026-01-19

---

### GAP 4: Business Intel Display in UI ✅ COMPLETE

**Built:**
- `admin/src/components/BusinessIntelCard.jsx` - Expandable card showing all business intel
- Updated `LeadProfile.jsx` - BusinessIntelCard after RecentIntelCard
- Updated `CallPrepPage.jsx` - Business Intel collapsible section with tags
- Updated `src/routes/ai.js` - live-intel API now returns business_intel from dossier

**Displays:**
- Pain points (red highlighted)
- Competitors mentioned (purple tags)
- Hiring needs (green alert with urgency)
- Decision timeline (blue)
- Budget signals (emerald)
- Current employer (if known)

**Completed:** 2026-01-19

---

### ~~GAP 5: Founder Callback Queue~~ ✅ NOT NEEDED

**Original idea:** Separate queue for founder to close warm contractors.

**Reality:** Team is 2 reps + founder. No special queue needed - callbacks work as-is.

**Estimate:** 0 hours

---

### GAP 6: Lead Type Onboarding Guidance ⚠️

**Current state:** Stages exist but guidance is generic

**What's needed:**
1. Worker-specific guidance (Stripe setup, docs)
2. Contractor-specific guidance (job posting tips)
3. Stage-specific CTAs in Lead Profile

**Estimate:** 4-6 hours

---

## Implementation Priority & Timeline

### Phase 1: Quick Wins (8-12 hours)

| Task | Hours | Impact |
|------|-------|--------|
| Worker referral capture UI | 5 | High - enables flywheel |
| Business intel display in UI | 6 | High - uses captured data |
| **Subtotal** | **11** | |

### Phase 2: Polish (Optional) (5 hours)

| Task | Hours | Impact |
|------|-------|--------|
| ~~Contractor referral code system~~ | ~~15~~ | ✅ Already on rateright.com.au |
| ~~Founder callback queue~~ | ~~5~~ | ✅ Not needed (2 reps + founder) |
| Lead type onboarding guidance | 5 | Low - nice to have |
| **Subtotal** | **5** | |

### Phase 3: Full Automation (15-20 hours)

| Task | Hours | Impact |
|------|-------|--------|
| Multi-step sequence engine | 18 | High - automates follow-up |
| Sequence analytics | 4 | Medium - measures effectiveness |
| **Subtotal** | **22** | |

---

## Total Estimate

| Phase | Hours | Priority |
|-------|-------|----------|
| Phase 1: Quick Wins | 11 | Do first |
| Phase 2: Polish | 5 | Optional |
| Phase 3: Full Automation | 22 | Nice to have |
| **TOTAL** | **38** | |

**Realistic scope: Phase 1 only = 11 hours**

*Notes:*
- *Contractor code system already on rateright.com.au*
- *Founder queue not needed (2 reps + founder)*

---

## Recommended Build Order

1. **Worker Referral Capture** (5 hrs) - Enable "refers other workers" win
2. **Business Intel UI** (6 hrs) - Surface extracted data
3. **Sequence Engine** (18 hrs) - Automate follow-up (optional)

---

## Files Reference

### To Create:
```
admin/src/components/WorkerReferralCapture.jsx
src/jobs/sequenceProcessor.js (Phase 3)
src/services/sequenceEngine.js (Phase 3)
```

### To Modify:
```
admin/src/components/CallOutcomeSheet.jsx (add referral section)
admin/src/pages/LeadProfile.jsx (add business intel)
admin/src/pages/CallPrepPage.jsx (add hiring needs alert)
admin/src/components/IntelBriefModal.jsx (add pain points)
```

---

## What's NOT Needed (Already Working)

- ✅ Stage tracking (fully implemented)
- ✅ Contractor extraction from calls
- ✅ Hot referral flagging
- ✅ Objection learning
- ✅ Today's Plays
- ✅ Scheduled SMS
- ✅ Callback scheduling
- ✅ Business intel capture (just needs UI)
- ✅ Platform sync

---

## Conclusion

The system is **85% ready**. The main gap is:

1. **Worker Referral Capture UI** - Needed to enable the "refers other workers" win

Secondary:
2. **Business Intel UI** - Data is captured but not shown
3. **Sequence automation** - Schema exists, needs engine (optional)

**Not needed:**
- Contractor codes (already on rateright.com.au)
- Founder queue (team is 2 reps + founder)

**Recommendation:** Build Worker Referral Capture (5 hrs) first - it directly enables a bonus-incentivized win for every call.
