skills/lead-gen/lead-scoring/SKILL.md
Implement and manage lead scoring systems. Use when working with lead qualification, conversion tracking, or lead funnel optimization. Triggers on "lead", "scoring", "conversion", "funnel", "qualification".
npx skillsauth add javeedishaq/ai-workflow-orchestrator lead-scoringInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Implement progressive lead scoring based on user engagement and conversion events.
| Score | Stage | Event | |-------|-------|-------| | 5 | Awareness | Page view | | 15 | Interest | Content view | | 40 | Consideration | Inquiry started | | 60 | Intent | Contact info provided | | 85 | Evaluation | WhatsApp contact | | 100 | Conversion | Form submitted |
import { LEAD_GENERATION_EVENTS, LEAD_SCORES } from '@akson/cortex-utilities/events';
// Track page view (Score: 5)
trackEvent(LEAD_GENERATION_EVENTS.LEAD_PAGE_VIEW, {
page_path: '/badges',
lead_score: LEAD_SCORES.PAGE_VIEW
});
// Track content engagement (Score: 15)
trackEvent(LEAD_GENERATION_EVENTS.LEAD_CONTENT_VIEW, {
content_type: 'product',
lead_score: LEAD_SCORES.CONTENT_VIEW
});
// Track inquiry start (Score: 40)
trackEvent(LEAD_GENERATION_EVENTS.LEAD_INQUIRY_STARTED, {
form_type: 'quote_request',
lead_score: LEAD_SCORES.INQUIRY_STARTED
});
// Track contact info (Score: 60)
trackEvent(LEAD_GENERATION_EVENTS.LEAD_CONTACT_INFO, {
contact_method: 'email',
lead_score: LEAD_SCORES.CONTACT_INFO
});
// Track WhatsApp contact (Score: 85)
trackEvent(LEAD_GENERATION_EVENTS.LEAD_WHATSAPP_CONTACT, {
phone_number_provided: true,
lead_score: LEAD_SCORES.WHATSAPP_CONTACT
});
// Track form submission (Score: 100)
trackEvent(LEAD_GENERATION_EVENTS.LEAD_FORM_SUBMITTED, {
form_id: 'quote_form',
lead_score: LEAD_SCORES.FORM_SUBMITTED
});
CREATE TABLE leads (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
phone_number TEXT,
first_name TEXT,
last_name TEXT,
email TEXT,
status TEXT DEFAULT 'new',
score INTEGER DEFAULT 0,
form_data JSONB DEFAULT '{}',
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ DEFAULT NOW()
);
-- Index for quick lookups
CREATE INDEX idx_leads_phone ON leads(phone_number);
CREATE INDEX idx_leads_status ON leads(status);
CREATE INDEX idx_leads_score ON leads(score DESC);
| Status | Description | |--------|-------------| | new | Just created, not contacted | | contacted | Initial contact made | | qualified | Confirmed interest | | proposal | Quote sent | | won | Converted to customer | | lost | Did not convert |
| Lead Score | Response SLA | |------------|--------------| | 85-100 | 1 hour | | 60-84 | 4 hours | | 40-59 | 24 hours | | < 40 | 48 hours |
-- Get hot leads (score >= 85)
SELECT id, phone_number, first_name, last_name, email, score, created_at
FROM leads
WHERE score >= 85 AND status = 'new'
ORDER BY score DESC, created_at ASC;
-- Get leads needing follow-up
SELECT id, phone_number, score, status, created_at
FROM leads
WHERE status IN ('new', 'contacted')
AND created_at < NOW() - INTERVAL '24 hours'
ORDER BY score DESC;
Lead events flow to:
tools
# Test Patterns Testing patterns for reliable, maintainable, and fast tests. > **Template Usage:** Customize for your test framework (Vitest, Jest, Playwright, etc.) and assertion library. ## Test Structure ```typescript // user.test.ts import { describe, it, expect, beforeEach, afterEach } from 'vitest'; import { userService } from '@/services/user.service'; import { createTestUser, cleanupTestData } from '@/tests/helpers'; describe('UserService', () => { let testUserId: string; befor
tools
# State Management Patterns Client-side state management patterns for modern applications. > **Template Usage:** Customize for your state library (React Query, Zustand, Jotai, Redux, etc.). ## State Categories | Type | Description | Solution | |------|-------------|----------| | **Server State** | Data from API/database | React Query, SWR | | **Client State** | UI state, user preferences | Zustand, Jotai, useState | | **Form State** | Form inputs, validation | React Hook Form, Formik | | **U
development
# Service Patterns Service layer patterns for clean architecture with proper error handling, logging, and type safety. > **Template Usage:** Customize for your ORM (Prisma, Drizzle, TypeORM, etc.) and logging solution. ## Result Type Pattern Never throw exceptions from services. Always return a Result type. ```typescript // lib/result.ts export type Result<T, E = Error> = | { success: true; data: T } | { success: false; error: E }; export function ok<T>(data: T): Result<T, never> { r
testing
# Row-Level Security Patterns Database security patterns for multi-tenant and user-scoped data. > **Template Usage:** Customize for your database (PostgreSQL, Supabase, etc.) and auth system. ## RLS Fundamentals ### Enable RLS on Tables ```sql -- Enable RLS (required before policies take effect) ALTER TABLE users ENABLE ROW LEVEL SECURITY; ALTER TABLE posts ENABLE ROW LEVEL SECURITY; ALTER TABLE comments ENABLE ROW LEVEL SECURITY; -- Force RLS for table owners too (recommended) ALTER TABLE